1 -- Created on: 1999-03-03
2 -- Created by: Fabrice SERVANT
3 -- Copyright (c) 1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License 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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 -- Modified by skv - Thu Sep 25 16:51:09 2003 OCC567
18 -- The method GetArrayOfCouples() is added. The Boolean flag isShiftFwd is
19 -- added to the method FillArrayOfPnt(..).
20 -- The method GetArrayOfCouples() returns array of couples of contact triangles.
21 -- The flag isShiftFwd shows whether circumscribed (Standard_True) or inscribed
22 -- (Standard_False) mesh should be constructed.
23 -- modified by ofv Thu Apr 8 14:45:35 2004 fip
25 class MaillageAffinage from IntPolyh
26 ---Purpose: Provide the algorythms used in the package
31 HSurface from Adaptor3d,
32 TopolTool from Adaptor3d,
34 StartPoint from IntPolyh,
36 Triangle from IntPolyh,
37 ArrayOfCouples from IntPolyh,
38 ArrayOfPoints from IntPolyh,
39 ArrayOfStartPoints from IntPolyh,
40 ArrayOfEdges from IntPolyh,
41 ArrayOfTriangles from IntPolyh,
42 SectionLine from IntPolyh,
43 ArrayOfSectionLines from IntPolyh,
44 ArrayOfTangentZones from IntPolyh,
45 Array1OfReal from TColStd
49 Create(S1 : HSurface from Adaptor3d;
50 NbSU1,NbSV1 : Integer from Standard;
51 S2 : HSurface from Adaptor3d;
52 NbSU2,NbSV2 : Integer from Standard;
53 PRINT : Integer from Standard);
55 Create(S1,S2: HSurface from Adaptor3d;
56 PRINT : Integer from Standard);
58 FillArrayOfPnt(me: in out; SurfID: Integer from Standard)
60 ---Purpose: Compute points on one surface and fill an array of points;
61 --- standard (default) method
63 FillArrayOfPnt(me: in out; SurfID : Integer from Standard;
64 isShiftFwd: Boolean from Standard)
65 ---Purpose: isShiftFwd flag is added. The purpose is to define shift
66 -- of points along normal to the surface in this point. The
67 -- shift length represents maximal deflection of triangulation.
68 -- The direction (forward or reversed regarding to normal
69 -- direction) is defined by isShiftFwd flag.
71 ---Purpose: Compute points on one surface and fill an array of points;
75 FillArrayOfPnt(me: in out; SurfID: Integer from Standard;
76 Upars, Vpars : Array1OfReal from TColStd)
78 ---Purpose: Compute points on one surface and fill an array of points;
79 --- standard (default) method
81 FillArrayOfPnt(me: in out; SurfID : Integer from Standard;
82 isShiftFwd: Boolean from Standard;
83 Upars, Vpars : Array1OfReal from TColStd)
84 ---Purpose: isShiftFwd flag is added. The purpose is to define shift
85 -- of points along normal to the surface in this point. The
86 -- shift length represents maximal deflection of triangulation.
87 -- The direction (forward or reversed regarding to normal
88 -- direction) is defined by isShiftFwd flag.
90 ---Purpose: Compute points on one surface and fill an array of points;
94 CommonBox(me:in out; B1,B2: Box from Bnd; xMin,yMin,zMin,xMax,yMax,zMax: in out Real from Standard)
96 ---Purpose: Compute the common box witch is the intersection
97 -- of the two bounding boxes, and mark the points of
98 -- the two surfaces that are inside.
100 FillArrayOfEdges(me: in out; SurfID: Integer from Standard)
102 ---Purpose: Compute edges from the array of points
104 FillArrayOfTriangles(me: in out; SurfID: Integer from Standard)
106 ---Purpose: Compute triangles from the array of points, and --
107 -- mark the triangles that use marked points by the
108 -- CommonBox function.
110 LinkEdges2Triangles(me:in out)
112 ---Purpose: fill the edge fields in Triangle object for the
113 -- two array of triangles.
115 CommonPartRefinement(me: in out)
117 ---Purpose: Refine systematicaly all marked triangles of both surfaces
119 LocalSurfaceRefinement(me: in out; SurfId: Integer from Standard)
121 ---Purpose: Refine systematicaly all marked triangles of ONE surface
123 ComputeDeflections(me: in out; SurfID: Integer from Standard)
125 ---Purpose: Compute deflection for all triangles of one
126 -- surface,and sort min and max of deflections
129 TrianglesDeflectionsRefinementBSB(me:in out)
131 ---Purpose: Refine both surfaces using BoundSortBox as --
132 -- rejection. The criterions used to refine a --
133 -- triangle are: The deflection The size of the --
134 -- bounding boxes (one surface may be very small
135 -- compared to the other)
137 TriContact(me; P1,P2,P3,Q1,Q2,Q3: Point from IntPolyh;
138 Angle:in out Real from Standard)
139 returns Integer from Standard
141 ---Purpose: This fonction Check if two triangles are in
142 -- contact or no, return 1 if yes, return 0
145 TriangleEdgeContact(me; TriSurfID, EdgeIndice: Integer from Standard;
146 P1,P2,P3,C1,C2,C3,Pe1,Pe2,E,N: Point from IntPolyh;
147 SP1,SP2: in out StartPoint from IntPolyh)
148 returns Integer from Standard
151 TriangleEdgeContact2(me; TriSurfID, EdgeIndice: Integer from Standard;
152 Tri1, Tri2: Triangle from IntPolyh;
153 P1,P2,P3,C1,C2,C3,Pe1,Pe2,E,N: Point from IntPolyh;
154 SP1,SP2: in out StartPoint from IntPolyh)
155 returns Integer from Standard
158 StartingPointsResearch(me; T1,T2: Integer from Standard;
159 SP1,SP2: in out StartPoint from IntPolyh)
160 returns Integer from Standard
163 StartingPointsResearch2(me; T1,T2: Integer from Standard;
164 SP1,SP2: in out StartPoint from IntPolyh)
165 returns Integer from Standard
167 ---Purpose: From two triangles compute intersection points.
168 -- If I found more than two intersection points
169 -- that's mean that those triangle are coplanar
171 NextStartingPointsResearch(me; T1,T2: Integer from Standard;
172 SPInit: StartPoint from IntPolyh;
173 SPNext: in out StartPoint from IntPolyh)
174 returns Integer from Standard
177 NextStartingPointsResearch2(me; T1,T2: Integer from Standard;
178 SPInit: StartPoint from IntPolyh;
179 SPNext: in out StartPoint from IntPolyh)
180 returns Integer from Standard
182 ---Purpose: from two triangles and an intersection point I
183 -- seach the other point (if it exist).
184 -- This function is used by StartPointChain
186 TriangleCompare(me :in out)
187 returns Integer from Standard
189 ---Purpose: Analyse each couple of triangles from the two --
190 -- array of triangles, to see if they are in
191 -- contact, and compute the incidence. Then put
192 -- couples in contact in the array of couples
194 TriangleComparePSP(me :in out)
195 returns Integer from Standard
197 ---Purpose: The same as TriangleCompare, plus compute the
198 -- StartPoints without chaining them.
200 StartPointsCalcul(me)
202 ---Purpose: From the array of couples compute all the start
203 -- points and display them on the screen
205 StartPointsChain(me: in out;
206 TSectionLines: in out ArrayOfSectionLines from IntPolyh;
207 TTangentZones: in out ArrayOfTangentZones from IntPolyh)
208 returns Integer from Standard
210 ---Purpose: Loop on the array of couples. Compute StartPoints.
211 -- Try to chain the StartPoints into SectionLines or
212 -- put the point in the ArrayOfTangentZones if
213 -- chaining it, is not possible.
215 GetNextChainStartPoint(me: in out;
216 SPInit: StartPoint from IntPolyh;
217 SPNext: in out StartPoint from IntPolyh;
218 MySectionLine: in out SectionLine from IntPolyh;
219 TTangentZones: in out ArrayOfTangentZones from IntPolyh;
220 Prepend : Boolean from Standard = Standard_False)
221 returns Integer from Standard
223 ---Purpose: Mainly used by StartPointsChain(), this function
224 -- try to compute the next StartPoint.
226 GetArrayOfPoints(me; SurfID: Integer from Standard)
227 ---C++: return const &
228 returns ArrayOfPoints from IntPolyh
231 GetArrayOfEdges(me; SurfID: Integer from Standard)
232 ---C++: return const &
233 returns ArrayOfEdges from IntPolyh
236 GetArrayOfTriangles(me; SurfID: Integer from Standard)
237 ---C++: return const &
238 returns ArrayOfTriangles from IntPolyh
241 GetFinTE(me; SurfID: Integer from Standard)
242 returns Integer from Standard
245 GetFinTT(me; SurfID: Integer from Standard)
246 returns Integer from Standard
249 GetBox(me; SurfID: Integer from Standard)
253 GetBoxDraw(me; SurfID: Integer from Standard)
258 ---C++: return const &
259 returns ArrayOfStartPoints from IntPolyh
262 GetArrayOfCouples(me: in out)
263 ---Purpose: This method returns array of couples of contact triangles.
265 returns ArrayOfCouples from IntPolyh
268 SetEnlargeZone(me: in out; EnlargeZone: in out Boolean from Standard);
269 GetEnlargeZone(me) returns Boolean from Standard;
275 MaSurface1 : HSurface from Adaptor3d;
276 MaSurface2 : HSurface from Adaptor3d;
278 MyBox1 : Box from Bnd;
279 MyBox2 : Box from Bnd;
281 NbSamplesU1 : Integer from Standard;
282 NbSamplesU2 : Integer from Standard;
283 NbSamplesV1 : Integer from Standard;
284 NbSamplesV2 : Integer from Standard;
286 FlecheMax1 : Real from Standard;
287 FlecheMax2 : Real from Standard;
288 FlecheMin1 : Real from Standard;
289 FlecheMin2 : Real from Standard;
290 FlecheMoy1 : Real from Standard;
291 FlecheMoy2 : Real from Standard;
293 TPoints1 : ArrayOfPoints from IntPolyh;
294 TPoints2 : ArrayOfPoints from IntPolyh;
295 TEdges1 : ArrayOfEdges from IntPolyh;
296 TEdges2 : ArrayOfEdges from IntPolyh;
297 TTriangles1 : ArrayOfTriangles from IntPolyh;
298 TTriangles2 : ArrayOfTriangles from IntPolyh;
299 TTrianglesContacts : ArrayOfCouples from IntPolyh;
300 TStartPoints : ArrayOfStartPoints from IntPolyh;
302 myEnlargeZone : Boolean from Standard;
304 end Test from IntPolyh;