0022564: BRepMesh_Classifier improvements
[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
169 -- Output :
170
171
172         NbTriangles(me)
173             ---Purpose: Gives the number of built triangles.
174             returns Integer from Standard
175             is static;
176
177         Triangle   (me;
178                     Index : Integer from Standard)
179             ---Purpose: Gives the triangle of <Index>.
180             ---C++: return const &
181             returns Triangle from BRepMesh
182             is static;
183
184
185         NbEdges    (me)
186             ---Purpose: Gives the number of built Edges
187             returns Integer from Standard
188             is static;
189
190         Edge       (me;
191                     Index : Integer from Standard)
192             ---Purpose: Gives the edge of index <Index>.
193             ---C++: return const &
194               returns Edge from BRepMesh
195             is static;
196
197         NbVertices (me)
198             ---Purpose: Gives the number of built Vertices.
199             returns Integer from Standard
200             is static;
201
202         Vertex     (me;
203                     Index : Integer from Standard)
204             ---Purpose: Gives the vertex of <Index>.
205             ---C++: return const &
206             returns Vertex from BRepMesh
207             is static;
208
209         Pnt        (me;
210                     Index : Integer from Standard)
211             ---Purpose: Gives the location3d of the vertex of <Index>.
212             ---C++: return const &
213             returns Pnt from gp
214             is static;
215
216         VerticesOfDomain
217                  (me; Indices : in out MapOfInteger from BRepMesh)
218             ---Purpose: Gives the list of indices of the vertices
219             is static;
220
221
222         EdgesOfDomain
223                  (me; Indices : in out MapOfInteger from BRepMesh)
224             ---Purpose: Gives the list of indices of the edges
225             ---C++: inline
226             is static;
227
228
229         TrianglesOfDomain(me; Indices: in out MapOfInteger from BRepMesh)
230             ---Purpose: Gives the list of indices of the triangles
231             ---C++: inline
232             is static;
233
234
235         NbPoint3d (me)
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.
241             ---C++: inline
242             returns Integer from Standard
243             is static;
244
245         Point3d    (me;
246                     Index : Integer from Standard)
247             ---Purpose: Gives the 3d space location of the vertex <Index>.
248             ---C++: return const &
249             ---C++: inline
250             returns Pnt from gp
251             is static;
252
253
254         GetDeflection(me)
255             ---Purpose: returns the deflection value.
256             ---C++: inline
257             returns Real from Standard;
258
259         GetAngle(me)  
260             ---Purpose: returns the deflection value.
261             ---C++: inline
262             returns Real from Standard;
263
264         WithShare(me)
265             ---C++: inline
266             returns Boolean from Standard;
267     
268         InShape(me)
269             ---C++: inline
270             returns Boolean from Standard;
271     
272         ShapeTrigu(me)
273             ---C++: inline
274             returns Boolean from Standard;
275     
276         GetFaceAttribute(me;
277                          face    : Face from TopoDS;
278                          fattrib : in out FaceAttribute from BRepMesh)
279             ---Purpose: returns the face deflection value.
280             returns Boolean from Standard;
281     
282         RemoveFaceAttribute(me   : mutable;
283                             face : Face     from TopoDS);
284             ---Purpose: remove face attribute as useless to free locate memory
285     
286         GetMapOfDefEdge(me)
287             ---C++: return const &
288             ---C++: inline
289             returns DataMapOfShapeReal from TopTools;
290     
291 fields  
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;
312
313 end FastDiscret;