Test for 0022778: Bug in BRepMesh
[occt.git] / src / IntPolyh / IntPolyh_MaillageAffinage.cdl
1 -- Created on: 1999-03-03
2 -- Created by: Fabrice SERVANT
3 -- Copyright (c) 1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22 -- Modified by skv - Thu Sep 25 16:51:09 2003 OCC567
23 -- The method GetArrayOfCouples() is added. The Boolean flag isShiftFwd is 
24 -- added to the method FillArrayOfPnt(..).
25 -- The method GetArrayOfCouples() returns array of couples of contact triangles. 
26 -- The flag isShiftFwd shows whether circumscribed (Standard_True) or inscribed 
27 -- (Standard_False) mesh should be constructed.
28 -- modified by ofv Thu Apr  8 14:45:35 2004 fip
29
30 class MaillageAffinage from IntPolyh
31
32
33 uses
34     Box                 from Bnd,
35     Pnt                 from gp,
36     HSurface            from Adaptor3d,
37     TopolTool           from Adaptor3d, 
38     Point               from IntPolyh,
39     StartPoint          from IntPolyh,
40     Edge                from IntPolyh,
41     Triangle            from IntPolyh,
42     ArrayOfCouples      from IntPolyh,
43     ArrayOfPoints       from IntPolyh,
44     ArrayOfStartPoints  from IntPolyh,
45     ArrayOfEdges        from IntPolyh,
46     ArrayOfTriangles    from IntPolyh,
47     SectionLine         from IntPolyh,
48     ArrayOfSectionLines from IntPolyh,
49     ArrayOfTangentZones from IntPolyh, 
50     Array1OfReal        from TColStd
51         
52 is 
53
54     Create(S1 : HSurface from Adaptor3d;
55            NbSU1,NbSV1 : Integer from Standard;
56            S2 : HSurface from Adaptor3d;
57            NbSU2,NbSV2 : Integer from Standard;
58            PRINT : Integer from Standard);
59         
60     Create(S1,S2: HSurface from Adaptor3d;
61            PRINT : Integer from Standard);
62     
63     FillArrayOfPnt(me: in out; SurfID: Integer from Standard)
64         is static;
65         ---Purpose: Compute points on one surface and fill an array of points;
66         ---         standard (default) method
67
68     FillArrayOfPnt(me: in out; SurfID    : Integer from Standard; 
69                                isShiftFwd: Boolean from Standard) 
70         ---Purpose: isShiftFwd flag is added. The purpose is to define shift 
71         --          of points along normal to the surface in this point. The 
72         --          shift length represents maximal deflection of triangulation. 
73         --          The direction (forward or reversed regarding to normal 
74         --          direction) is defined by isShiftFwd flag.
75     is static;
76         ---Purpose: Compute points on one surface and fill an array of points;
77         ---         advanced method 
78          
79     --  IFV  start      
80     FillArrayOfPnt(me: in out; SurfID: Integer from Standard;  
81                                Upars, Vpars :  Array1OfReal  from  TColStd)
82         is static;
83         ---Purpose: Compute points on one surface and fill an array of points;
84         ---         standard (default) method
85
86     FillArrayOfPnt(me: in out; SurfID    : Integer from Standard; 
87                                isShiftFwd: Boolean from Standard; 
88                                Upars, Vpars :  Array1OfReal  from  TColStd) 
89         ---Purpose: isShiftFwd flag is added. The purpose is to define shift 
90         --          of points along normal to the surface in this point. The 
91         --          shift length represents maximal deflection of triangulation. 
92         --          The direction (forward or reversed regarding to normal 
93         --          direction) is defined by isShiftFwd flag.
94     is static;
95         ---Purpose: Compute points on one surface and fill an array of points;
96         ---         advanced method
97  
98     --  IFV  end     
99     CommonBox(me:in out; B1,B2: Box from Bnd; xMin,yMin,zMin,xMax,yMax,zMax: in out Real from Standard)
100     is static;
101         ---Purpose:  Compute the common box  witch is the intersection
102         --          of the two bounding boxes,  and mark the points of
103         --          the two surfaces that are inside.
104     
105     FillArrayOfEdges(me: in out; SurfID: Integer from Standard)
106     is static;
107         ---Purpose: Compute edges from the array of points
108
109     FillArrayOfTriangles(me: in out; SurfID: Integer from Standard)
110     is static;
111         ---Purpose: Compute triangles from the array of points, and --
112         --           mark the triangles  that use marked points by the
113         --           CommonBox function.
114     
115     LinkEdges2Triangles(me:in out)
116     is static;
117         ---Purpose: fill the  edge fields in  Triangle object  for the
118         --          two array of triangles.
119     
120     CommonPartRefinement(me: in out)
121     is static;
122         ---Purpose: Refine systematicaly all marked triangles of both surfaces
123
124     LocalSurfaceRefinement(me: in out; SurfId: Integer from Standard)
125     is static;
126         ---Purpose: Refine systematicaly all marked triangles of ONE surface
127
128     ComputeDeflections(me: in out; SurfID: Integer from Standard) 
129     is static;
130         ---Purpose:  Compute deflection  for   all  triangles  of  one
131         --          surface,and sort min and max of deflections
132
133
134     TrianglesDeflectionsRefinementBSB(me:in out)
135         is static;
136         ---Purpose:  Refine  both  surfaces using  BoundSortBox  as --
137         --           rejection.  The  criterions  used to refine a  --
138         --           triangle are:  The deflection The  size of the --
139         --           bounding boxes   (one surface may be   very small
140         --           compared to the other)
141
142     TriContact(me; P1,P2,P3,Q1,Q2,Q3: Point from IntPolyh;
143               Angle:in out Real from Standard)
144     returns Integer from Standard
145     is static; 
146         ---Purpose: This fonction     Check if two triangles   are  in
147         --          contact or no,  return 1 if yes, return 0
148         --          if no.
149     
150     TriangleEdgeContact(me; TriSurfID, EdgeIndice:  Integer from Standard; 
151                         P1,P2,P3,C1,C2,C3,Pe1,Pe2,E,N: Point from IntPolyh;
152                         SP1,SP2: in out StartPoint from IntPolyh)
153     returns Integer from Standard
154     is static;
155
156     TriangleEdgeContact2(me; TriSurfID, EdgeIndice:  Integer from Standard;
157                         Tri1, Tri2: Triangle from IntPolyh;
158                         P1,P2,P3,C1,C2,C3,Pe1,Pe2,E,N: Point from IntPolyh;
159                         SP1,SP2: in out StartPoint from IntPolyh)
160     returns Integer from Standard
161     is static;
162
163     StartingPointsResearch(me; T1,T2: Integer from Standard;
164                            SP1,SP2: in out StartPoint from IntPolyh)
165     returns Integer from Standard
166     is static;
167         
168     StartingPointsResearch2(me; T1,T2: Integer from Standard;
169                            SP1,SP2: in out StartPoint from IntPolyh)
170     returns Integer from Standard
171     is static;
172         ---Purpose: From  two  triangles compute intersection  points.
173         --            If I found   more  than two intersection  points
174         --          that's mean that those triangle are coplanar
175         
176     NextStartingPointsResearch(me; T1,T2: Integer from Standard;
177                                SPInit: StartPoint from IntPolyh;
178                                SPNext: in out StartPoint from IntPolyh)
179     returns Integer from Standard
180     is static;
181
182     NextStartingPointsResearch2(me; T1,T2: Integer from Standard;
183                                 SPInit: StartPoint from IntPolyh;
184                                 SPNext: in out StartPoint from IntPolyh)
185     returns Integer from Standard
186     is static;
187         ---Purpose: from  two triangles  and an intersection   point I
188         --          seach the other point (if it exist).
189         --          This function is used by StartPointChain
190
191     TriangleCompare(me :in out)
192     returns Integer from Standard
193     is static;
194         ---Purpose: Analyse  each couple of  triangles from the two --
195         --             array  of triangles,  to   see  if they are  in
196         --           contact,  and  compute the  incidence.  Then  put
197         --            couples  in contact  in  the  array  of  couples
198
199     TriangleComparePSP(me :in out)
200     returns Integer from Standard
201     is static;
202         ---Purpose:  The   same as   TriangleCompare, plus compute the
203         --          StartPoints without chaining them.
204
205     StartPointsCalcul(me)
206     is static;
207         ---Purpose:  From the array  of couples compute  all the start
208         --          points and display them on the screen
209
210     StartPointsChain(me: in out; 
211                      TSectionLines: in out ArrayOfSectionLines from IntPolyh;
212                      TTangentZones: in out ArrayOfTangentZones from IntPolyh)
213     returns Integer from Standard
214     is static;
215         ---Purpose: Loop on the array of couples. Compute StartPoints.
216         --          Try to chain  the StartPoints into SectionLines or
217         --          put  the  point  in  the    ArrayOfTangentZones if
218         --          chaining it, is not possible.
219
220     GetNextChainStartPoint(me: in out; 
221                            SPInit: StartPoint from IntPolyh; 
222                            SPNext: in out StartPoint from IntPolyh;
223                            MySectionLine: in out SectionLine from IntPolyh;
224                            TTangentZones: in out ArrayOfTangentZones from IntPolyh;
225                            Prepend : Boolean from Standard = Standard_False)
226     returns Integer from Standard
227     is static;
228         ---Purpose:  Mainly  used  by StartPointsChain(), this function
229         --           try to compute the next StartPoint.
230
231     GetArrayOfPoints(me; SurfID: Integer from Standard)
232         ---C++: return const &
233     returns ArrayOfPoints from IntPolyh
234     is static;
235
236     GetArrayOfEdges(me; SurfID: Integer from Standard)
237         ---C++: return const &
238     returns ArrayOfEdges from IntPolyh
239     is static;
240
241     GetArrayOfTriangles(me; SurfID: Integer from Standard)
242         ---C++: return const &
243     returns ArrayOfTriangles from IntPolyh
244     is static;
245     
246     GetFinTE(me; SurfID: Integer from Standard)
247     returns Integer from Standard
248     is static;
249     
250     GetFinTT(me; SurfID: Integer from Standard)
251     returns Integer from Standard
252     is static;
253     
254     GetBox(me; SurfID: Integer from Standard)
255     returns Box from Bnd
256     is static;
257     
258     GetBoxDraw(me; SurfID: Integer from Standard)
259     is static;    
260
261
262     GetArrayOfSP(me)
263         ---C++: return const &
264     returns ArrayOfStartPoints from IntPolyh
265     is static;
266     
267     GetArrayOfCouples(me:  in  out)
268         ---Purpose: This method returns array of couples of contact triangles.
269         ---C++: return & 
270     returns ArrayOfCouples from IntPolyh
271     is static;
272
273     SetEnlargeZone(me: in out; EnlargeZone: in out Boolean from Standard);
274     GetEnlargeZone(me) returns Boolean from Standard;
275
276
277 fields
278
279     
280     MaSurface1     : HSurface from Adaptor3d;
281     MaSurface2     : HSurface from Adaptor3d;
282     
283     MyBox1         : Box from Bnd;
284     MyBox2         : Box from Bnd;
285     
286     NbSamplesU1    : Integer from Standard;
287     NbSamplesU2    : Integer from Standard;
288     NbSamplesV1    : Integer from Standard;
289     NbSamplesV2    : Integer from Standard;
290     
291     FlecheMax1     : Real    from Standard;
292     FlecheMax2     : Real    from Standard;
293     FlecheMin1     : Real    from Standard;
294     FlecheMin2     : Real    from Standard;
295     FlecheMoy1     : Real    from Standard;
296     FlecheMoy2     : Real    from Standard;
297
298     TPoints1           : ArrayOfPoints      from IntPolyh;
299     TPoints2           : ArrayOfPoints      from IntPolyh;
300     TEdges1            : ArrayOfEdges       from IntPolyh;
301     TEdges2            : ArrayOfEdges       from IntPolyh;
302     TTriangles1        : ArrayOfTriangles   from IntPolyh;
303     TTriangles2        : ArrayOfTriangles   from IntPolyh;
304     TTrianglesContacts : ArrayOfCouples     from IntPolyh;
305     TStartPoints       : ArrayOfStartPoints from IntPolyh;
306     
307     myEnlargeZone    : Boolean from Standard;
308
309 end Test from IntPolyh;
310