Salome HOME
untabify
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef _GEOMAlgo_Gluer_HeaderFile
23 #define _GEOMAlgo_Gluer_HeaderFile
24
25 #ifndef _Standard_Boolean_HeaderFile
26 #include <Standard_Boolean.hxx>
27 #endif
28 #ifndef _Standard_Real_HeaderFile
29 #include <Standard_Real.hxx>
30 #endif
31 #ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
32 #include <TopTools_DataMapOfShapeListOfShape.hxx>
33 #endif
34 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
35 #include <TopTools_DataMapOfShapeShape.hxx>
36 #endif
37 #ifndef _Standard_Integer_HeaderFile
38 #include <Standard_Integer.hxx>
39 #endif
40 #ifndef _TopTools_ListOfShape_HeaderFile
41 #include <TopTools_ListOfShape.hxx>
42 #endif
43 #ifndef _TopTools_MapOfShape_HeaderFile
44 #include <TopTools_MapOfShape.hxx>
45 #endif
46 #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
47 #include <GEOMAlgo_ShapeAlgo.hxx>
48 #endif
49 #ifndef _TopAbs_ShapeEnum_HeaderFile
50 #include <TopAbs_ShapeEnum.hxx>
51 #endif
52 #ifndef _TopoDS_Compound_HeaderFile
53 #include <TopoDS_Compound.hxx>
54 #endif
55 class TopTools_ListOfShape;
56 class TopoDS_Shape;
57 class TopoDS_Edge;
58 class GEOMAlgo_PassKeyShape;
59 class TopoDS_Face;
60 class TopoDS_Vertex;
61 class TopTools_DataMapOfShapeListOfShape;
62 class TopTools_DataMapOfShapeShape;
63
64
65 #ifndef _Standard_HeaderFile
66 #include <Standard.hxx>
67 #endif
68 #ifndef _Standard_Macro_HeaderFile
69 #include <Standard_Macro.hxx>
70 #endif
71
72
73 class GEOMAlgo_Gluer  : public GEOMAlgo_ShapeAlgo {
74
75 public:
76
77     void* operator new(size_t,void* anAddress) 
78       {
79         return anAddress;
80       }
81     void* operator new(size_t size) 
82       { 
83         return Standard::Allocate(size); 
84       }
85     void  operator delete(void *anAddress) 
86       { 
87         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
88       }
89  // Methods PUBLIC
90  // 
91
92
93 Standard_EXPORT GEOMAlgo_Gluer();
94 Standard_EXPORT virtual ~GEOMAlgo_Gluer();
95
96
97 Standard_EXPORT   void SetCheckGeometry(const Standard_Boolean aFlag) ;
98
99
100 Standard_EXPORT   Standard_Boolean CheckGeometry() const;
101
102
103 Standard_EXPORT   void SetKeepNonSolids(const Standard_Boolean aFlag) ;
104
105
106 Standard_EXPORT virtual  void Perform() ;
107
108
109 Standard_EXPORT   Standard_Integer AloneShapes() const;
110
111
112 Standard_EXPORT  const TopTools_ListOfShape& Modified(const TopoDS_Shape& S) ;
113
114
115 Standard_EXPORT  const TopTools_ListOfShape& Generated(const TopoDS_Shape& S) ;
116
117
118 Standard_EXPORT   Standard_Boolean IsDeleted(const TopoDS_Shape& S) ;
119
120
121 Standard_EXPORT  const TopTools_DataMapOfShapeListOfShape& Images() const;
122
123
124 Standard_EXPORT  const TopTools_DataMapOfShapeShape& Origins() const;
125
126
127
128
129
130 protected:
131
132  // Methods PROTECTED
133  // 
134
135
136 Standard_EXPORT virtual  void CheckData() ;
137
138
139 Standard_EXPORT virtual  void CheckResult() ;
140
141
142 Standard_EXPORT   void MakeVertices() ;
143
144
145 Standard_EXPORT   void MakeEdges() ;
146
147
148 Standard_EXPORT   void MakeFaces() ;
149
150
151 Standard_EXPORT   void MakeShapes(const TopAbs_ShapeEnum aType) ;
152
153
154 Standard_EXPORT   void MakeShells() ;
155
156
157 Standard_EXPORT   void MakeSubShapes(const TopoDS_Shape& theShape,
158                                      TopTools_MapOfShape& theMS,
159                                      TopoDS_Compound& theResult);
160
161
162 Standard_EXPORT   void MakeSolids() ;
163
164
165 Standard_EXPORT   void InnerTolerance() ;
166
167
168 Standard_EXPORT   void EdgePassKey(const TopoDS_Edge& aE,GEOMAlgo_PassKeyShape& aPK) ;
169
170
171 Standard_EXPORT   void FacePassKey(const TopoDS_Face& aF,GEOMAlgo_PassKeyShape& aPK) ;
172
173
174 Standard_EXPORT   void MakeVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewV) ;
175
176
177 Standard_EXPORT   void MakeEdge(const TopoDS_Edge& aEdge,TopoDS_Edge& aNewEdge) ;
178
179
180 Standard_EXPORT   void MakeFace(const TopoDS_Face& aFace,TopoDS_Face& aNewEdge) ;
181
182
183 Standard_EXPORT   Standard_Boolean IsToReverse(const TopoDS_Face& aFR,const TopoDS_Face& aF) ;
184
185
186 Standard_EXPORT   Standard_Boolean HasNewSubShape(const TopoDS_Shape& aS) const;
187
188
189  // Fields PROTECTED
190  //
191 Standard_Boolean myCheckGeometry;
192 Standard_Boolean myKeepNonSolids;
193 Standard_Real myTol;
194 TopTools_DataMapOfShapeListOfShape myImages;
195 TopTools_DataMapOfShapeShape myOrigins;
196 Standard_Integer myNbAlone;
197 TopTools_ListOfShape myGenerated;
198
199
200 private: 
201
202  // Methods PRIVATE
203  // 
204
205
206  // Fields PRIVATE
207  //
208
209
210 };
211
212
213
214
215
216 // other Inline functions and methods (like "C++: function call" methods)
217 //
218
219
220 #endif