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