Salome HOME
Merge from V5_1_main 14/05/2010
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer.hxx
1 //  Copyright (C) 2007-2010  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
23 #ifndef _GEOMAlgo_Gluer_HeaderFile
24 #define _GEOMAlgo_Gluer_HeaderFile
25
26 #ifndef _Standard_Boolean_HeaderFile
27 #include <Standard_Boolean.hxx>
28 #endif
29 #ifndef _Standard_Real_HeaderFile
30 #include <Standard_Real.hxx>
31 #endif
32 #ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
33 #include <TopTools_DataMapOfShapeListOfShape.hxx>
34 #endif
35 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
36 #include <TopTools_DataMapOfShapeShape.hxx>
37 #endif
38 #ifndef _Standard_Integer_HeaderFile
39 #include <Standard_Integer.hxx>
40 #endif
41 #ifndef _TopTools_ListOfShape_HeaderFile
42 #include <TopTools_ListOfShape.hxx>
43 #endif
44 #ifndef _TopTools_MapOfShape_HeaderFile
45 #include <TopTools_MapOfShape.hxx>
46 #endif
47 #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
48 #include <GEOMAlgo_ShapeAlgo.hxx>
49 #endif
50 #ifndef _TopAbs_ShapeEnum_HeaderFile
51 #include <TopAbs_ShapeEnum.hxx>
52 #endif
53 #ifndef _TopoDS_Compound_HeaderFile
54 #include <TopoDS_Compound.hxx>
55 #endif
56 class TopTools_ListOfShape;
57 class TopoDS_Shape;
58 class TopoDS_Edge;
59 class GEOMAlgo_PassKeyShape;
60 class TopoDS_Face;
61 class TopoDS_Vertex;
62 class TopTools_DataMapOfShapeListOfShape;
63 class TopTools_DataMapOfShapeShape;
64
65
66 #ifndef _Standard_HeaderFile
67 #include <Standard.hxx>
68 #endif
69 #ifndef _Standard_Macro_HeaderFile
70 #include <Standard_Macro.hxx>
71 #endif
72
73
74 class GEOMAlgo_Gluer  : public GEOMAlgo_ShapeAlgo {
75
76 public:
77
78     void* operator new(size_t,void* anAddress) 
79       {
80         return anAddress;
81       }
82     void* operator new(size_t size) 
83       { 
84         return Standard::Allocate(size); 
85       }
86     void  operator delete(void *anAddress) 
87       { 
88         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
89       }
90  // Methods PUBLIC
91  // 
92
93
94 Standard_EXPORT GEOMAlgo_Gluer();
95 Standard_EXPORT virtual ~GEOMAlgo_Gluer();
96
97
98 Standard_EXPORT   void SetCheckGeometry(const Standard_Boolean aFlag) ;
99
100
101 Standard_EXPORT   Standard_Boolean CheckGeometry() const;
102
103
104 Standard_EXPORT   void SetKeepNonSolids(const Standard_Boolean aFlag) ;
105
106
107 Standard_EXPORT virtual  void Perform() ;
108
109
110 Standard_EXPORT   Standard_Integer AloneShapes() const;
111
112
113 Standard_EXPORT  const TopTools_ListOfShape& Modified(const TopoDS_Shape& S) ;
114
115
116 Standard_EXPORT  const TopTools_ListOfShape& Generated(const TopoDS_Shape& S) ;
117
118
119 Standard_EXPORT   Standard_Boolean IsDeleted(const TopoDS_Shape& S) ;
120
121
122 Standard_EXPORT  const TopTools_DataMapOfShapeListOfShape& Images() const;
123
124
125 Standard_EXPORT  const TopTools_DataMapOfShapeShape& Origins() const;
126
127
128
129
130
131 protected:
132
133  // Methods PROTECTED
134  // 
135
136
137 Standard_EXPORT virtual  void CheckData() ;
138
139
140 Standard_EXPORT virtual  void CheckResult() ;
141
142
143 Standard_EXPORT   void MakeVertices() ;
144
145
146 Standard_EXPORT   void MakeEdges() ;
147
148
149 Standard_EXPORT   void MakeFaces() ;
150
151
152 Standard_EXPORT   void MakeShapes(const TopAbs_ShapeEnum aType) ;
153
154
155 Standard_EXPORT   void MakeShells() ;
156
157
158 Standard_EXPORT   void MakeSubShapes(const TopoDS_Shape& theShape,
159                                      TopTools_MapOfShape& theMS,
160                                      TopoDS_Compound& theResult);
161
162
163 Standard_EXPORT   void MakeSolids() ;
164
165
166 Standard_EXPORT   void InnerTolerance() ;
167
168
169 Standard_EXPORT   void EdgePassKey(const TopoDS_Edge& aE,GEOMAlgo_PassKeyShape& aPK) ;
170
171
172 Standard_EXPORT   void FacePassKey(const TopoDS_Face& aF,GEOMAlgo_PassKeyShape& aPK) ;
173
174
175 Standard_EXPORT   void MakeVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewV) ;
176
177
178 Standard_EXPORT   void MakeEdge(const TopoDS_Edge& aEdge,TopoDS_Edge& aNewEdge) ;
179
180
181 Standard_EXPORT   void MakeFace(const TopoDS_Face& aFace,TopoDS_Face& aNewEdge) ;
182
183
184 Standard_EXPORT   Standard_Boolean IsToReverse(const TopoDS_Face& aFR,const TopoDS_Face& aF) ;
185
186
187 Standard_EXPORT   Standard_Boolean HasNewSubShape(const TopoDS_Shape& aS) const;
188
189
190  // Fields PROTECTED
191  //
192 Standard_Boolean myCheckGeometry;
193 Standard_Boolean myKeepNonSolids;
194 Standard_Real myTol;
195 TopTools_DataMapOfShapeListOfShape myImages;
196 TopTools_DataMapOfShapeShape myOrigins;
197 Standard_Integer myNbAlone;
198 TopTools_ListOfShape myGenerated;
199
200
201 private: 
202
203  // Methods PRIVATE
204  // 
205
206
207  // Fields PRIVATE
208  //
209
210
211 };
212
213
214
215
216
217 // other Inline functions and methods (like "C++: function call" methods)
218 //
219
220
221 #endif