0022600: TBB has to be disabled in BRepMesh due to data races
[occt.git] / src / BRepMesh / BRepMesh_FastDiscret.cdl
1 -- File:        BRepMesh_FastDiscret.cdl
2 -- Created:     Tue Feb 27 14:21:35 1996
3 -- Author:      Laurent PAINNOT
4 --              <lpa@nonox>
5 ---Copyright:    Matra Datavision 1996
6
7
8 class FastDiscret from BRepMesh inherits TShared from MMgt
9
10         ---Purpose: Algorithm  to mesh  a shape  with  respect of  the
11         --          frontier the deflection  and by option the  shared
12         --          components.
13
14
15 uses    Boolean                   from Standard,
16         Integer                   from Standard,
17         Box                       from Bnd,
18         Real                      from Standard,
19         Shape                     from TopoDS,
20         Face                      from TopoDS,
21         Edge                      from TopoDS,
22         FaceAttribute             from BRepMesh,
23         Vertex                    from TopoDS,
24         Triangle                  from BRepMesh,
25         Vertex                    from BRepMesh,
26         Edge                      from BRepMesh,
27         ListOfInteger             from TColStd,
28         MapOfInteger              from TColStd,
29         SequenceOfInteger         from TColStd,
30         ListOfReal                from TColStd,
31         IndexedMapOfInteger       from TColStd,
32         SequenceOfPnt2d           from TColgp,
33         Dir                       from gp,
34         Pnt                       from gp,
35         XY                        from gp,
36         Pnt2d                     from gp,
37         DataMapOfIntegerPnt       from BRepMesh,
38         DataMapOfIntegerListOfXY  from BRepMesh,
39         DataMapOfShapePairOfPolygon from  BRepMesh,
40         Delaun                    from BRepMesh,
41         DataMapOfVertexInteger    from BRepMesh,
42         DataStructureOfDelaun     from BRepMesh,
43         ListOfVertex              from BRepMesh,
44         MapOfShape                from TopTools,
45         HSurface                  from BRepAdaptor,
46         ClassifierPtr             from BRepMesh,
47         IndexedMapOfReal          from TColStd,
48         Status                    from BRepMesh,
49         DataMapOfShapeReal        from TopTools,
50         ListOfShape               from TopTools,
51         Curve                     from Geom2d,
52         MapOfInteger              from BRepMesh,
53         BaseAllocator             from BRepMesh,
54         DataMapOfFaceAttribute    from BRepMesh
55
56
57 is
58
59         Create (defle     : Real    from Standard;
60                 angle     : Real    from Standard;
61                 B         : Box     from Bnd;
62                 withShare : Boolean from Standard=Standard_True;
63                 inshape   : Boolean from Standard=Standard_False;
64                 relative  : Boolean from Standard=Standard_False;
65                 shapetrigu: Boolean from Standard=Standard_False)
66           returns mutable FastDiscret from BRepMesh;
67
68
69         Create (defle     : Real    from Standard;
70                 shape     : Shape   from TopoDS;
71                 B         : Box     from Bnd;
72                 angle     : Real    from Standard;
73                 withShare : Boolean from Standard=Standard_True;
74                 inshape   : Boolean from Standard=Standard_False;
75                 relative  : Boolean from Standard=Standard_False;
76                 shapetrigu: Boolean from Standard=Standard_False)
77            ---Purpose: if the  boolean    <relative>   is  True,    the
78            --          deflection used   for the polygonalisation   of
79            --          each edge will be <defle> * Size of Edge.
80            --          the deflection used for the faces will be the maximum
81            --          deflection of their edges.
82            --          
83            --          if <shapetrigu> is True, the triangulation, if exists
84            --          with a correct deflection, can be used to re-triangulate 
85            --          the shape.
86            --          
87            --          if   <inshape>   is   True, the      calculated
88            --          triangulation will be stored in the shape.
89             returns mutable FastDiscret from BRepMesh;
90
91
92         Perform (me: mutable; shape: Shape from TopoDS) is static;
93         ---Purpose: Build triangulation on the whole shape
94
95         Add (me: mutable; face: Face from TopoDS) is static;
96         ---Purpose: Record a face for further processing.
97
98         Process (me; face: Face from TopoDS) is static;
99         ---Purpose: Triangulate a face previously recorded for
100             --          processing by call to Add(). Can be executed in
101             --          parallel threads.
102         ---C++: alias operator ()
103
104         CurrentFaceStatus(me)
105         returns Status from BRepMesh;
106
107         Add (me     : mutable;
108              edge   : Edge     from TopoDS;
109              face   : Face     from TopoDS;
110              S      : HSurface from BRepAdaptor;
111              C      : Curve    from Geom2d;
112              defedge: Real     from Standard;
113              first  : Real     from Standard;
114              last   : Real     from Standard)
115         is static private;
116
117         Add (me     : mutable;
118              theVert: Vertex   from TopoDS;
119              face   : Face     from TopoDS;
120              S      : HSurface from BRepAdaptor) is private;
121
122         Update (me: mutable; 
123                 Edge   : Edge     from TopoDS; 
124                 Face   : Face     from TopoDS; 
125                 C      : Curve    from Geom2d;
126                 defedge: Real     from Standard;
127                 first  : Real     from Standard;
128                 last   : Real     from Standard)     
129         returns Boolean is private;
130
131         RelativeEdgeDeflection(myclass;
132                                edge    : Edge    from TopoDS;
133                                defle   : Real    from Standard;
134                                dtotale : Real    from Standard;
135                                cdef    : out Real    from Standard)
136         ---Purpose: Returns computed relative deflection for edge
137           returns Real from Standard;
138
139         BoxMaxDimension(myclass;
140                         box    : in Box from Bnd;
141                         maxdim : out Real from Standard);
142         ---Purpose: Returns the maximal dimension of Bnd_Box
143
144         InternalVertices
145                (me         : mutable;
146                caro       : HSurface            from BRepAdaptor;
147                inter      : in out ListOfVertex from BRepMesh;
148                defedge    : Real                from Standard;
149                classifier : ClassifierPtr       from BRepMesh)
150         is static private;
151
152
153         Control (me      : mutable;
154                  caro    : HSurface                from BRepAdaptor;
155                  defface : Real                    from Standard;
156                  inter   : in out ListOfVertex     from BRepMesh;
157                  badTri  : in out ListOfInteger    from TColStd;
158                  nulTri  : in out ListOfInteger    from TColStd;
159                  trigu   : in out Delaun           from BRepMesh;
160                  isfirst : Boolean                 from Standard)
161           returns Real from Standard is static private;
162
163         AddInShape(me: mutable;
164                    face   : Face from TopoDS;
165                    defedge: Real from Standard)
166         is static private;
167
168         SetParallel (           me : mutable;
169                      theInParallel : Boolean from Standard);
170         ---Purpose:
171         -- Request algorithm to launch in multiple threads
172         -- to improve performance (should be supported by plugin).
173
174         IsParallel (me)
175             returns Boolean from Standard;
176         ---Purpose:
177         -- Returns the multi-threading usage flag.
178
179 -- Output :
180
181
182         NbTriangles(me)
183             ---Purpose: Gives the number of built triangles.
184             returns Integer from Standard
185             is static;
186
187         Triangle   (me;
188                     Index : Integer from Standard)
189             ---Purpose: Gives the triangle of <Index>.
190             ---C++: return const &
191             returns Triangle from BRepMesh
192             is static;
193
194
195         NbEdges    (me)
196             ---Purpose: Gives the number of built Edges
197             returns Integer from Standard
198             is static;
199
200         Edge       (me;
201                     Index : Integer from Standard)
202             ---Purpose: Gives the edge of index <Index>.
203             ---C++: return const &
204               returns Edge from BRepMesh
205             is static;
206
207         NbVertices (me)
208             ---Purpose: Gives the number of built Vertices.
209             returns Integer from Standard
210             is static;
211
212         Vertex     (me;
213                     Index : Integer from Standard)
214             ---Purpose: Gives the vertex of <Index>.
215             ---C++: return const &
216             returns Vertex from BRepMesh
217             is static;
218
219         Pnt        (me;
220                     Index : Integer from Standard)
221             ---Purpose: Gives the location3d of the vertex of <Index>.
222             ---C++: return const &
223             returns Pnt from gp
224             is static;
225
226         VerticesOfDomain
227                  (me; Indices : in out MapOfInteger from BRepMesh)
228             ---Purpose: Gives the list of indices of the vertices
229             is static;
230
231
232         EdgesOfDomain
233                  (me; Indices : in out MapOfInteger from BRepMesh)
234             ---Purpose: Gives the list of indices of the edges
235             ---C++: inline
236             is static;
237
238
239         TrianglesOfDomain(me; Indices: in out MapOfInteger from BRepMesh)
240             ---Purpose: Gives the list of indices of the triangles
241             ---C++: inline
242             is static;
243
244
245         NbPoint3d (me)
246             ---Purpose: Gives the  number of different  location in 3d
247             --          space.  It  is  different    of the number  of
248             --          vertices if there is more than one surface.
249             --          Even for one surface, the number can be different
250             --          if an edge is shared.
251             ---C++: inline
252             returns Integer from Standard
253             is static;
254
255         Point3d    (me;
256                     Index : Integer from Standard)
257             ---Purpose: Gives the 3d space location of the vertex <Index>.
258             ---C++: return const &
259             ---C++: inline
260             returns Pnt from gp
261             is static;
262
263
264         GetDeflection(me)
265             ---Purpose: returns the deflection value.
266             ---C++: inline
267             returns Real from Standard;
268
269         GetAngle(me)  
270             ---Purpose: returns the deflection value.
271             ---C++: inline
272             returns Real from Standard;
273
274         WithShare(me)
275             ---C++: inline
276             returns Boolean from Standard;
277     
278         InShape(me)
279             ---C++: inline
280             returns Boolean from Standard;
281     
282         ShapeTrigu(me)
283             ---C++: inline
284             returns Boolean from Standard;
285     
286         GetFaceAttribute(me;
287                          face    : Face from TopoDS;
288                          fattrib : in out FaceAttribute from BRepMesh)
289             ---Purpose: returns the face deflection value.
290             returns Boolean from Standard;
291     
292         RemoveFaceAttribute(me   : mutable;
293                             face : Face     from TopoDS);
294             ---Purpose: remove face attribute as useless to free locate memory
295     
296         GetMapOfDefEdge(me)
297             ---C++: return const &
298             ---C++: inline
299             returns DataMapOfShapeReal from TopTools;
300     
301 fields  
302       myAngle        : Real                          from Standard;
303       myDeflection   : Real                          from Standard;
304       myDtotale      : Real                          from Standard;
305       myWithShare    : Boolean                       from Standard;
306       myInParallel   : Boolean                       from Standard;
307       myVertices     : DataMapOfVertexInteger        from BRepMesh;
308       myEdges        : DataMapOfShapePairOfPolygon   from BRepMesh;
309       myInternaledges: DataMapOfShapePairOfPolygon   from BRepMesh;
310       myNbLocat      : Integer                       from Standard;
311       myLocation3d   : DataMapOfIntegerPnt           from BRepMesh;
312       myStructure    : DataStructureOfDelaun         from BRepMesh;
313       myMapattrib    : DataMapOfFaceAttribute        from BRepMesh;
314       myVemap        : IndexedMapOfInteger           from TColStd;
315       myLocation2d   : DataMapOfIntegerListOfXY      from BRepMesh;
316       myRelative     : Boolean                       from Standard;
317       myShapetrigu   : Boolean                       from Standard;
318       myInshape      : Boolean                       from Standard; 
319       myFacestate    : Status                        from BRepMesh;
320       myMapdefle     : DataMapOfShapeReal            from TopTools;
321       myNottriangulated : ListOfShape                from TopTools;
322       myAllocator    : BaseAllocator                 from BRepMesh;
323
324 end FastDiscret;