1 -- File: BRepMesh_FastDiscret.cdl
2 -- Created: Tue Feb 27 14:21:35 1996
3 -- Author: Laurent PAINNOT
5 ---Copyright: Matra Datavision 1996
8 class FastDiscret from BRepMesh inherits TShared from MMgt
10 ---Purpose: Algorithm to mesh a shape with respect of the
11 -- frontier the deflection and by option the shared
15 uses Boolean from Standard,
16 Integer from Standard,
22 FaceAttribute from BRepMesh,
24 Triangle 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,
37 DataMapOfIntegerPnt from BRepMesh,
38 DataMapOfIntegerListOfXY from BRepMesh,
39 DataMapOfShapePairOfPolygon 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,
49 DataMapOfShapeReal from TopTools,
50 ListOfShape from TopTools,
52 MapOfInteger from BRepMesh,
53 BaseAllocator from BRepMesh,
54 DataMapOfFaceAttribute from BRepMesh
59 Create (defle : Real from Standard;
60 angle : Real from Standard;
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;
69 Create (defle : Real from Standard;
70 shape : Shape from TopoDS;
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.
83 -- if <shapetrigu> is True, the triangulation, if exists
84 -- with a correct deflection, can be used to re-triangulate
87 -- if <inshape> is True, the calculated
88 -- triangulation will be stored in the shape.
89 returns mutable FastDiscret from BRepMesh;
92 Perform (me: mutable; shape: Shape from TopoDS) is static;
93 ---Purpose: Build triangulation on the whole shape
95 Add (me: mutable; face: Face from TopoDS) is static;
96 ---Purpose: Record a face for further processing.
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
102 ---C++: alias operator ()
104 CurrentFaceStatus(me)
105 returns Status from BRepMesh;
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)
118 theVert: Vertex from TopoDS;
119 face : Face from TopoDS;
120 S : HSurface from BRepAdaptor) is private;
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;
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;
139 BoxMaxDimension(myclass;
140 box : in Box from Bnd;
141 maxdim : out Real from Standard);
142 ---Purpose: Returns the maximal dimension of Bnd_Box
146 caro : HSurface from BRepAdaptor;
147 inter : in out ListOfVertex from BRepMesh;
148 defedge : Real from Standard;
149 classifier : ClassifierPtr from BRepMesh)
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;
163 AddInShape(me: mutable;
164 face : Face from TopoDS;
165 defedge: Real from Standard)
168 SetParallel ( me : mutable;
169 theInParallel : Boolean from Standard);
171 -- Request algorithm to launch in multiple threads
172 -- to improve performance (should be supported by plugin).
175 returns Boolean from Standard;
177 -- Returns the multi-threading usage flag.
183 ---Purpose: Gives the number of built triangles.
184 returns Integer from Standard
188 Index : Integer from Standard)
189 ---Purpose: Gives the triangle of <Index>.
190 ---C++: return const &
191 returns Triangle from BRepMesh
196 ---Purpose: Gives the number of built Edges
197 returns Integer from Standard
201 Index : Integer from Standard)
202 ---Purpose: Gives the edge of index <Index>.
203 ---C++: return const &
204 returns Edge from BRepMesh
208 ---Purpose: Gives the number of built Vertices.
209 returns Integer from Standard
213 Index : Integer from Standard)
214 ---Purpose: Gives the vertex of <Index>.
215 ---C++: return const &
216 returns Vertex from BRepMesh
220 Index : Integer from Standard)
221 ---Purpose: Gives the location3d of the vertex of <Index>.
222 ---C++: return const &
227 (me; Indices : in out MapOfInteger from BRepMesh)
228 ---Purpose: Gives the list of indices of the vertices
233 (me; Indices : in out MapOfInteger from BRepMesh)
234 ---Purpose: Gives the list of indices of the edges
239 TrianglesOfDomain(me; Indices: in out MapOfInteger from BRepMesh)
240 ---Purpose: Gives the list of indices of the triangles
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.
252 returns Integer from Standard
256 Index : Integer from Standard)
257 ---Purpose: Gives the 3d space location of the vertex <Index>.
258 ---C++: return const &
265 ---Purpose: returns the deflection value.
267 returns Real from Standard;
270 ---Purpose: returns the deflection value.
272 returns Real from Standard;
276 returns Boolean from Standard;
280 returns Boolean from Standard;
284 returns Boolean from Standard;
287 face : Face from TopoDS;
288 fattrib : in out FaceAttribute from BRepMesh)
289 ---Purpose: returns the face deflection value.
290 returns Boolean from Standard;
292 RemoveFaceAttribute(me : mutable;
293 face : Face from TopoDS);
294 ---Purpose: remove face attribute as useless to free locate memory
297 ---C++: return const &
299 returns DataMapOfShapeReal from TopTools;
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;