summaryrefslogtreecommitdiff
path: root/inc/TopOpeBRepDS_DataStructure.hxx
blob: ed1dd7be5b38b2c828695ab6db287ce47581e2fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _TopOpeBRepDS_DataStructure_HeaderFile
#define _TopOpeBRepDS_DataStructure_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopOpeBRepDS_MapOfSurface_HeaderFile
#include <TopOpeBRepDS_MapOfSurface.hxx>
#endif
#ifndef _TopOpeBRepDS_MapOfCurve_HeaderFile
#include <TopOpeBRepDS_MapOfCurve.hxx>
#endif
#ifndef _TopOpeBRepDS_MapOfPoint_HeaderFile
#include <TopOpeBRepDS_MapOfPoint.hxx>
#endif
#ifndef _TopOpeBRepDS_MapOfShapeData_HeaderFile
#include <TopOpeBRepDS_MapOfShapeData.hxx>
#endif
#ifndef _TopTools_IndexedMapOfShape_HeaderFile
#include <TopTools_IndexedMapOfShape.hxx>
#endif
#ifndef _TopOpeBRepDS_ListOfInterference_HeaderFile
#include <TopOpeBRepDS_ListOfInterference.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopOpeBRepDS_Point_HeaderFile
#include <TopOpeBRepDS_Point.hxx>
#endif
#ifndef _TopOpeBRepDS_Surface_HeaderFile
#include <TopOpeBRepDS_Surface.hxx>
#endif
#ifndef _TopOpeBRepDS_Curve_HeaderFile
#include <TopOpeBRepDS_Curve.hxx>
#endif
#ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx>
#endif
#ifndef _TopOpeBRepDS_ShapeSurface_HeaderFile
#include <TopOpeBRepDS_ShapeSurface.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopOpeBRepDS_IndexedDataMapOfShapeWithState_HeaderFile
#include <TopOpeBRepDS_IndexedDataMapOfShapeWithState.hxx>
#endif
#ifndef _TopOpeBRepDS_Config_HeaderFile
#include <TopOpeBRepDS_Config.hxx>
#endif
#ifndef _Handle_TopOpeBRepDS_Interference_HeaderFile
#include <Handle_TopOpeBRepDS_Interference.hxx>
#endif
class Geom_Surface;
class TopOpeBRepDS_SurfaceExplorer;
class TopOpeBRepDS_CurveExplorer;
class TopOpeBRepDS_PointExplorer;
class TopOpeBRepDS_Surface;
class TopOpeBRepDS_Curve;
class TopOpeBRepDS_Point;
class TopoDS_Shape;
class TopoDS_Edge;
class TopOpeBRepDS_ListOfInterference;
class TopTools_ListOfShape;
class TopOpeBRepDS_MapOfShapeData;
class TopOpeBRepDS_Interference;
class TopOpeBRepDS_ListIteratorOfListOfInterference;
class TopOpeBRepDS_IndexedDataMapOfShapeWithState;
class TopOpeBRepDS_ShapeWithState;
class TopTools_IndexedMapOfShape;


//! The DataStructure stores : <br>
//! <br>
//! New geometries : points, curves, and surfaces. <br>
//! Topological shapes : vertices, edges, faces. <br>
//! The new geometries and the topological shapes have interferences. <br>
//! <br>
class TopOpeBRepDS_DataStructure  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
  Standard_EXPORT   TopOpeBRepDS_DataStructure();
  //! reset the data structure <br>
  Standard_EXPORT     void Init() ;
  //! Insert a new surface. Returns the index. <br>
  Standard_EXPORT     Standard_Integer AddSurface(const TopOpeBRepDS_Surface& S) ;
  
  Standard_EXPORT     void RemoveSurface(const Standard_Integer I) ;
  
  Standard_EXPORT     Standard_Boolean KeepSurface(const Standard_Integer I) const;
  
  Standard_EXPORT     Standard_Boolean KeepSurface(TopOpeBRepDS_Surface& S) const;
  
  Standard_EXPORT     void ChangeKeepSurface(const Standard_Integer I,const Standard_Boolean FindKeep) ;
  
  Standard_EXPORT     void ChangeKeepSurface(TopOpeBRepDS_Surface& S,const Standard_Boolean FindKeep) ;
  //! Insert a new curve. Returns the index. <br>
  Standard_EXPORT     Standard_Integer AddCurve(const TopOpeBRepDS_Curve& S) ;
  
  Standard_EXPORT     void RemoveCurve(const Standard_Integer I) ;
  
  Standard_EXPORT     Standard_Boolean KeepCurve(const Standard_Integer I) const;
  
  Standard_EXPORT     Standard_Boolean KeepCurve(const TopOpeBRepDS_Curve& C) const;
  
  Standard_EXPORT     void ChangeKeepCurve(const Standard_Integer I,const Standard_Boolean FindKeep) ;
  
  Standard_EXPORT     void ChangeKeepCurve(TopOpeBRepDS_Curve& C,const Standard_Boolean FindKeep) ;
  //! Insert a new point. Returns the index. <br>
  Standard_EXPORT     Standard_Integer AddPoint(const TopOpeBRepDS_Point& PDS) ;
  //! Insert a new point. Returns the index. <br>
  Standard_EXPORT     Standard_Integer AddPointSS(const TopOpeBRepDS_Point& PDS,const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
  
  Standard_EXPORT     void RemovePoint(const Standard_Integer I) ;
  
  Standard_EXPORT     Standard_Boolean KeepPoint(const Standard_Integer I) const;
  
  Standard_EXPORT     Standard_Boolean KeepPoint(const TopOpeBRepDS_Point& P) const;
  
  Standard_EXPORT     void ChangeKeepPoint(const Standard_Integer I,const Standard_Boolean FindKeep) ;
  
  Standard_EXPORT     void ChangeKeepPoint(TopOpeBRepDS_Point& P,const Standard_Boolean FindKeep) ;
  //! Insert a shape S. Returns the index. <br>
  Standard_EXPORT     Standard_Integer AddShape(const TopoDS_Shape& S) ;
  //! Insert a shape S which ancestor is I = 1 or 2. Returns the index. <br>
  Standard_EXPORT     Standard_Integer AddShape(const TopoDS_Shape& S,const Standard_Integer I) ;
  
  Standard_EXPORT     Standard_Boolean KeepShape(const Standard_Integer I,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     Standard_Boolean KeepShape(const TopoDS_Shape& S,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     void ChangeKeepShape(const Standard_Integer I,const Standard_Boolean FindKeep) ;
  
  Standard_EXPORT     void ChangeKeepShape(const TopoDS_Shape& S,const Standard_Boolean FindKeep) ;
  
  Standard_EXPORT     void InitSectionEdges() ;
  
  Standard_EXPORT     Standard_Integer AddSectionEdge(const TopoDS_Edge& E) ;
  
  Standard_EXPORT    const TopOpeBRepDS_ListOfInterference& SurfaceInterferences(const Standard_Integer I) const;
  
  Standard_EXPORT     TopOpeBRepDS_ListOfInterference& ChangeSurfaceInterferences(const Standard_Integer I) ;
  
  Standard_EXPORT    const TopOpeBRepDS_ListOfInterference& CurveInterferences(const Standard_Integer I) const;
  
  Standard_EXPORT     TopOpeBRepDS_ListOfInterference& ChangeCurveInterferences(const Standard_Integer I) ;
  
  Standard_EXPORT    const TopOpeBRepDS_ListOfInterference& PointInterferences(const Standard_Integer I) const;
  
  Standard_EXPORT     TopOpeBRepDS_ListOfInterference& ChangePointInterferences(const Standard_Integer I) ;
  
  Standard_EXPORT    const TopOpeBRepDS_ListOfInterference& ShapeInterferences(const TopoDS_Shape& S,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     TopOpeBRepDS_ListOfInterference& ChangeShapeInterferences(const TopoDS_Shape& S) ;
  
  Standard_EXPORT    const TopOpeBRepDS_ListOfInterference& ShapeInterferences(const Standard_Integer I,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     TopOpeBRepDS_ListOfInterference& ChangeShapeInterferences(const Standard_Integer I) ;
  
  Standard_EXPORT    const TopTools_ListOfShape& ShapeSameDomain(const TopoDS_Shape& S) const;
  
  Standard_EXPORT     TopTools_ListOfShape& ChangeShapeSameDomain(const TopoDS_Shape& S) ;
  
  Standard_EXPORT    const TopTools_ListOfShape& ShapeSameDomain(const Standard_Integer I) const;
  
  Standard_EXPORT     TopTools_ListOfShape& ChangeShapeSameDomain(const Standard_Integer I) ;
  
  Standard_EXPORT     TopOpeBRepDS_MapOfShapeData& ChangeShapes() ;
  
  Standard_EXPORT     void AddShapeSameDomain(const TopoDS_Shape& S,const TopoDS_Shape& SSD) ;
  
  Standard_EXPORT     void RemoveShapeSameDomain(const TopoDS_Shape& S,const TopoDS_Shape& SSD) ;
  
  Standard_EXPORT     Standard_Integer SameDomainRef(const Standard_Integer I) const;
  
  Standard_EXPORT     Standard_Integer SameDomainRef(const TopoDS_Shape& S) const;
  
  Standard_EXPORT     void SameDomainRef(const Standard_Integer I,const Standard_Integer Ref) ;
  
  Standard_EXPORT     void SameDomainRef(const TopoDS_Shape& S,const Standard_Integer Ref) ;
  
  Standard_EXPORT     TopOpeBRepDS_Config SameDomainOri(const Standard_Integer I) const;
  
  Standard_EXPORT     TopOpeBRepDS_Config SameDomainOri(const TopoDS_Shape& S) const;
  
  Standard_EXPORT     void SameDomainOri(const Standard_Integer I,const TopOpeBRepDS_Config Ori) ;
  
  Standard_EXPORT     void SameDomainOri(const TopoDS_Shape& S,const TopOpeBRepDS_Config Ori) ;
  
  Standard_EXPORT     Standard_Integer SameDomainInd(const Standard_Integer I) const;
  
  Standard_EXPORT     Standard_Integer SameDomainInd(const TopoDS_Shape& S) const;
  
  Standard_EXPORT     void SameDomainInd(const Standard_Integer I,const Standard_Integer Ind) ;
  
  Standard_EXPORT     void SameDomainInd(const TopoDS_Shape& S,const Standard_Integer Ind) ;
  
  Standard_EXPORT     Standard_Integer AncestorRank(const Standard_Integer I) const;
  
  Standard_EXPORT     Standard_Integer AncestorRank(const TopoDS_Shape& S) const;
  
  Standard_EXPORT     void AncestorRank(const Standard_Integer I,const Standard_Integer Ianc) ;
  
  Standard_EXPORT     void AncestorRank(const TopoDS_Shape& S,const Standard_Integer Ianc) ;
  
  Standard_EXPORT     void AddShapeInterference(const TopoDS_Shape& S,const Handle(TopOpeBRepDS_Interference)& I) ;
  
  Standard_EXPORT     void RemoveShapeInterference(const TopoDS_Shape& S,const Handle(TopOpeBRepDS_Interference)& I) ;
  
  Standard_EXPORT     void FillShapesSameDomain(const TopoDS_Shape& S1,const TopoDS_Shape& S2,const Standard_Boolean refFirst = Standard_True) ;
  
  Standard_EXPORT     void FillShapesSameDomain(const TopoDS_Shape& S1,const TopoDS_Shape& S2,const TopOpeBRepDS_Config c1,const TopOpeBRepDS_Config c2,const Standard_Boolean refFirst = Standard_True) ;
  
  Standard_EXPORT     void UnfillShapesSameDomain(const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
  
  Standard_EXPORT     Standard_Integer NbSurfaces() const;
  
  Standard_EXPORT     Standard_Integer NbCurves() const;
  
  Standard_EXPORT     void ChangeNbCurves(const Standard_Integer N) ;
  
  Standard_EXPORT     Standard_Integer NbPoints() const;
  
  Standard_EXPORT     Standard_Integer NbShapes() const;
  
  Standard_EXPORT     Standard_Integer NbSectionEdges() const;
  //! Returns the surface of index <I>. <br>
  Standard_EXPORT    const TopOpeBRepDS_Surface& Surface(const Standard_Integer I) const;
  //! Returns the surface of index <I>. <br>
  Standard_EXPORT     TopOpeBRepDS_Surface& ChangeSurface(const Standard_Integer I) ;
  //! Returns the Curve of index <I>. <br>
  Standard_EXPORT    const TopOpeBRepDS_Curve& Curve(const Standard_Integer I) const;
  //! Returns the Curve of index <I>. <br>
  Standard_EXPORT     TopOpeBRepDS_Curve& ChangeCurve(const Standard_Integer I) ;
  //! Returns the point of index <I>. <br>
  Standard_EXPORT    const TopOpeBRepDS_Point& Point(const Standard_Integer I) const;
  //! Returns the point of index <I>. <br>
  Standard_EXPORT     TopOpeBRepDS_Point& ChangePoint(const Standard_Integer I) ;
  //! returns the shape of index I stored in <br>
//!          the map myShapes, accessing a list of interference. <br>
  Standard_EXPORT    const TopoDS_Shape& Shape(const Standard_Integer I,const Standard_Boolean FindKeep = Standard_True) const;
  //! returns the index of shape <S> stored in <br>
//!          the map myShapes, accessing a list of interference. <br>
//!          returns 0 if <S> is not in the map. <br>
  Standard_EXPORT     Standard_Integer Shape(const TopoDS_Shape& S,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT    const TopoDS_Edge& SectionEdge(const Standard_Integer I,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     Standard_Integer SectionEdge(const TopoDS_Edge& E,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     Standard_Boolean IsSectionEdge(const TopoDS_Edge& E,const Standard_Boolean FindKeep = Standard_True) const;
  //! Returns True if <S> has new geometries, i.e : <br>
//! True si : <br>
//!     HasShape(S) True <br>
//!     S a une liste d'interferences non vide. <br>
//! S = SOLID, FACE, EDGE : true/false <br>
//! S = SHELL, WIRE, VERTEX : false. <br>
  Standard_EXPORT     Standard_Boolean HasGeometry(const TopoDS_Shape& S) const;
  //! Returns True if <S> est dans myShapes <br>
  Standard_EXPORT     Standard_Boolean HasShape(const TopoDS_Shape& S,const Standard_Boolean FindKeep = Standard_True) const;
  
  Standard_EXPORT     void SetNewSurface(const TopoDS_Shape& F,const Handle(Geom_Surface)& S) ;
  
  Standard_EXPORT     Standard_Boolean HasNewSurface(const TopoDS_Shape& F) const;
  
  Standard_EXPORT    const Handle_Geom_Surface& NewSurface(const TopoDS_Shape& F) const;
  
  Standard_EXPORT     void Isfafa(const Standard_Boolean isfafa) ;
  
  Standard_EXPORT     Standard_Boolean Isfafa() const;
  
  Standard_EXPORT     TopOpeBRepDS_IndexedDataMapOfShapeWithState& ChangeMapOfShapeWithStateObj() ;
  
  Standard_EXPORT     TopOpeBRepDS_IndexedDataMapOfShapeWithState& ChangeMapOfShapeWithStateTool() ;
  
  Standard_EXPORT     TopOpeBRepDS_IndexedDataMapOfShapeWithState& ChangeMapOfShapeWithState(const TopoDS_Shape& aShape,Standard_Boolean& aFlag) ;
  
  Standard_EXPORT    const TopOpeBRepDS_ShapeWithState& GetShapeWithState(const TopoDS_Shape& aShape) const;
  
  Standard_EXPORT     TopTools_IndexedMapOfShape& ChangeMapOfRejectedShapesObj() ;
  
  Standard_EXPORT     TopTools_IndexedMapOfShape& ChangeMapOfRejectedShapesTool() ;


friend class TopOpeBRepDS_SurfaceExplorer;
friend class TopOpeBRepDS_CurveExplorer;
friend class TopOpeBRepDS_PointExplorer;



protected:





private:

  
  Standard_EXPORT     Standard_Boolean FindInterference(TopOpeBRepDS_ListIteratorOfListOfInterference& IT,const Handle(TopOpeBRepDS_Interference)& I) const;


Standard_Integer myNbSurfaces;
TopOpeBRepDS_MapOfSurface mySurfaces;
Standard_Integer myNbCurves;
TopOpeBRepDS_MapOfCurve myCurves;
Standard_Integer myNbPoints;
TopOpeBRepDS_MapOfPoint myPoints;
TopOpeBRepDS_MapOfShapeData myShapes;
TopTools_IndexedMapOfShape mySectionEdges;
TopOpeBRepDS_ListOfInterference myEmptyListOfInterference;
TopTools_ListOfShape myEmptyListOfShape;
TopoDS_Shape myEmptyShape;
TopOpeBRepDS_Point myEmptyPoint;
TopOpeBRepDS_Surface myEmptySurface;
TopOpeBRepDS_Curve myEmptyCurve;
Handle_Geom_Surface myEmptyGSurface;
TopOpeBRepDS_ShapeSurface myNewSurface;
Standard_Boolean myIsfafa;
Standard_Integer myI;
TopOpeBRepDS_IndexedDataMapOfShapeWithState myMapOfShapeWithStateObj;
TopOpeBRepDS_IndexedDataMapOfShapeWithState myMapOfShapeWithStateTool;
TopTools_IndexedMapOfShape myMapOfRejectedShapesObj;
TopTools_IndexedMapOfShape myMapOfRejectedShapesTool;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif