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>
23 #include <TopTools_IndexedMapOfShape.hxx>
24 #include <Standard_Integer.hxx>
26 class TopoDS_Compound;
29 //! This class provides operators to analyze edges orientation
31 class ShapeAnalysis_Shell
39 Standard_EXPORT ShapeAnalysis_Shell();
41 //! Clears data about loaded shells and performed checks
42 Standard_EXPORT void Clear();
44 //! Adds shells contained in the <shape> to the list of loaded shells
45 Standard_EXPORT void LoadShells (const TopoDS_Shape& shape);
47 //! Checks if shells fulfill orientation condition, i.e. if each
48 //! edge is, either present once (free edge) or twice (connected
49 //! edge) but with different orientations (FORWARD/REVERSED)
50 //! Edges which do not fulfill these conditions are bad
52 //! If <alsofree> is True free edges are considered.
53 //! Free edges can be queried but are not bad
54 Standard_EXPORT Standard_Boolean CheckOrientedShells (const TopoDS_Shape& shape, const Standard_Boolean alsofree = Standard_False, const Standard_Boolean checkinternaledges = Standard_False);
56 //! Tells if a shape is loaded (only shells are checked)
57 Standard_EXPORT Standard_Boolean IsLoaded (const TopoDS_Shape& shape) const;
59 //! Returns the actual number of loaded shapes (i.e. shells)
60 Standard_EXPORT Standard_Integer NbLoaded() const;
62 //! Returns a loaded shape specified by its rank number.
63 //! Returns null shape if <num> is out of range
64 Standard_EXPORT TopoDS_Shape Loaded (const Standard_Integer num) const;
66 //! Tells if at least one edge is recorded as bad
67 Standard_EXPORT Standard_Boolean HasBadEdges() const;
69 //! Returns the list of bad edges as a Compound
70 //! It is empty (not null) if no edge are recorded as bad
71 Standard_EXPORT TopoDS_Compound BadEdges() const;
73 //! Tells if at least one edge is recorded as free (not connected)
74 Standard_EXPORT Standard_Boolean HasFreeEdges() const;
76 //! Returns the list of free (not connected) edges as a Compound
77 //! It is empty (not null) if no edge are recorded as free
78 Standard_EXPORT TopoDS_Compound FreeEdges() const;
80 //! Tells if at least one edge is connected (shared twice or more)
81 Standard_EXPORT Standard_Boolean HasConnectedEdges() const;
96 TopTools_IndexedMapOfShape myShells;
97 TopTools_IndexedMapOfShape myBad;
98 TopTools_IndexedMapOfShape myFree;
99 Standard_Boolean myConex;
110 #endif // _ShapeAnalysis_Shell_HeaderFile