1 // Created on: 1998-06-03
2 // Created by: data exchange team
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _ShapeAnalysis_Shell_HeaderFile
18 #define _ShapeAnalysis_Shell_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopTools_IndexedMapOfShape.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
28 class TopoDS_Compound;
31 //! This class provides operators to analyze edges orientation
33 class ShapeAnalysis_Shell
40 //! Clears data about loaded shells and performed checks
41 Standard_EXPORT void Clear();
43 //! Adds shells contained in the <shape> to the list of loaded shells
44 Standard_EXPORT void LoadShells (const TopoDS_Shape& shape);
46 //! Checks if shells fulfill orientation condition, i.e. if each
47 //! edge is, either present once (free edge) or twice (connected
48 //! edge) but with different orientations (FORWARD/REVERSED)
49 //! Edges which do not fulfill these conditions are bad
51 //! If <alsofree> is True free edges are considered.
52 //! Free edges can be queried but are not bad
53 Standard_EXPORT Standard_Boolean CheckOrientedShells (const TopoDS_Shape& shape, const Standard_Boolean alsofree = Standard_False, const Standard_Boolean checkinternaledges = Standard_False);
55 //! Tells if a shape is loaded (only shells are checked)
56 Standard_EXPORT Standard_Boolean IsLoaded (const TopoDS_Shape& shape) const;
58 //! Returns the actual number of loaded shapes (i.e. shells)
59 Standard_EXPORT Standard_Integer NbLoaded() const;
61 //! Returns a loaded shape specified by its rank number.
62 //! Returns null shape if <num> is out of range
63 Standard_EXPORT TopoDS_Shape Loaded (const Standard_Integer num) const;
65 //! Tells if at least one edge is recorded as bad
66 Standard_EXPORT Standard_Boolean HasBadEdges() const;
68 //! Returns the list of bad edges as a Compound
69 //! It is empty (not null) if no edge are recorded as bad
70 Standard_EXPORT TopoDS_Compound BadEdges() const;
72 //! Tells if at least one edge is recorded as free (not connected)
73 Standard_EXPORT Standard_Boolean HasFreeEdges() const;
75 //! Returns the list of free (not connected) edges as a Compound
76 //! It is empty (not null) if no edge are recorded as free
77 Standard_EXPORT TopoDS_Compound FreeEdges() const;
79 //! Tells if at least one edge is connected (shared twice or more)
80 Standard_EXPORT Standard_Boolean HasConnectedEdges() const;
95 TopTools_IndexedMapOfShape myShells;
96 TopTools_IndexedMapOfShape myBad;
97 TopTools_IndexedMapOfShape myFree;
98 Standard_Boolean myConex;
109 #endif // _ShapeAnalysis_Shell_HeaderFile