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)
173 ---Purpose: Gives the number of built triangles.
174 returns Integer from Standard
178 Index : Integer from Standard)
179 ---Purpose: Gives the triangle of <Index>.
180 ---C++: return const &
181 returns Triangle from BRepMesh
186 ---Purpose: Gives the number of built Edges
187 returns Integer from Standard
191 Index : Integer from Standard)
192 ---Purpose: Gives the edge of index <Index>.
193 ---C++: return const &
194 returns Edge from BRepMesh
198 ---Purpose: Gives the number of built Vertices.
199 returns Integer from Standard
203 Index : Integer from Standard)
204 ---Purpose: Gives the vertex of <Index>.
205 ---C++: return const &
206 returns Vertex from BRepMesh
210 Index : Integer from Standard)
211 ---Purpose: Gives the location3d of the vertex of <Index>.
212 ---C++: return const &
217 (me; Indices : in out MapOfInteger from BRepMesh)
218 ---Purpose: Gives the list of indices of the vertices
223 (me; Indices : in out MapOfInteger from BRepMesh)
224 ---Purpose: Gives the list of indices of the edges
229 TrianglesOfDomain(me; Indices: in out MapOfInteger from BRepMesh)
230 ---Purpose: Gives the list of indices of the triangles
236 ---Purpose: Gives the number of different location in 3d
237 -- space. It is different of the number of
238 -- vertices if there is more than one surface.
239 -- Even for one surface, the number can be different
240 -- if an edge is shared.
242 returns Integer from Standard
246 Index : Integer from Standard)
247 ---Purpose: Gives the 3d space location of the vertex <Index>.
248 ---C++: return const &
255 ---Purpose: returns the deflection value.
257 returns Real from Standard;
260 ---Purpose: returns the deflection value.
262 returns Real from Standard;
266 returns Boolean from Standard;
270 returns Boolean from Standard;
274 returns Boolean from Standard;
277 face : Face from TopoDS;
278 fattrib : in out FaceAttribute from BRepMesh)
279 ---Purpose: returns the face deflection value.
280 returns Boolean from Standard;
282 RemoveFaceAttribute(me : mutable;
283 face : Face from TopoDS);
284 ---Purpose: remove face attribute as useless to free locate memory
287 ---C++: return const &
289 returns DataMapOfShapeReal from TopTools;
292 myAngle : Real from Standard;
293 myDeflection : Real from Standard;
294 myDtotale : Real from Standard;
295 myWithShare : Boolean from Standard;
296 myVertices : DataMapOfVertexInteger from BRepMesh;
297 myEdges : DataMapOfShapePairOfPolygon from BRepMesh;
298 myInternaledges: DataMapOfShapePairOfPolygon from BRepMesh;
299 myNbLocat : Integer from Standard;
300 myLocation3d : DataMapOfIntegerPnt from BRepMesh;
301 myStructure : DataStructureOfDelaun from BRepMesh;
302 myMapattrib : DataMapOfFaceAttribute from BRepMesh;
303 myVemap : IndexedMapOfInteger from TColStd;
304 myLocation2d : DataMapOfIntegerListOfXY from BRepMesh;
305 myRelative : Boolean from Standard;
306 myShapetrigu : Boolean from Standard;
307 myInshape : Boolean from Standard;
308 myFacestate : Status from BRepMesh;
309 myMapdefle : DataMapOfShapeReal from TopTools;
310 myNottriangulated : ListOfShape from TopTools;
311 myAllocator : BaseAllocator from BRepMesh;