0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_Shell.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _ShapeAnalysis_Shell_HeaderFile
18 #define _ShapeAnalysis_Shell_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <TopTools_IndexedMapOfShape.hxx>
24 #include <Standard_Integer.hxx>
25 class TopoDS_Shape;
26 class TopoDS_Compound;
27
28
29 //! This class provides operators to analyze edges orientation
30 //! in the shell.
31 class ShapeAnalysis_Shell 
32 {
33 public:
34
35   DEFINE_STANDARD_ALLOC
36
37   
38   //! Empty constructor
39   Standard_EXPORT ShapeAnalysis_Shell();
40   
41   //! Clears data about loaded shells and performed checks
42   Standard_EXPORT void Clear();
43   
44   //! Adds shells contained in the <shape> to the list of loaded shells
45   Standard_EXPORT void LoadShells (const TopoDS_Shape& shape);
46   
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
51   //!
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);
55   
56   //! Tells if a shape is loaded (only shells are checked)
57   Standard_EXPORT Standard_Boolean IsLoaded (const TopoDS_Shape& shape) const;
58   
59   //! Returns the actual number of loaded shapes (i.e. shells)
60   Standard_EXPORT Standard_Integer NbLoaded() const;
61   
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;
65   
66   //! Tells if at least one edge is recorded as bad
67   Standard_EXPORT Standard_Boolean HasBadEdges() const;
68   
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;
72   
73   //! Tells if at least one edge is recorded as free (not connected)
74   Standard_EXPORT Standard_Boolean HasFreeEdges() const;
75   
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;
79   
80   //! Tells if at least one edge is connected (shared twice or more)
81   Standard_EXPORT Standard_Boolean HasConnectedEdges() const;
82
83
84
85
86 protected:
87
88
89
90
91
92 private:
93
94
95
96   TopTools_IndexedMapOfShape myShells;
97   TopTools_IndexedMapOfShape myBad;
98   TopTools_IndexedMapOfShape myFree;
99   Standard_Boolean myConex;
100
101
102 };
103
104
105
106
107
108
109
110 #endif // _ShapeAnalysis_Shell_HeaderFile