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
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.
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.
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.
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
30 class MaillageAffinage from IntPolyh
36 HSurface from Adaptor3d,
37 TopolTool from Adaptor3d,
39 StartPoint 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
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);
60 Create(S1,S2: HSurface from Adaptor3d;
61 PRINT : Integer from Standard);
63 FillArrayOfPnt(me: in out; SurfID: Integer from Standard)
65 ---Purpose: Compute points on one surface and fill an array of points;
66 --- standard (default) method
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.
76 ---Purpose: Compute points on one surface and fill an array of points;
80 FillArrayOfPnt(me: in out; SurfID: Integer from Standard;
81 Upars, Vpars : Array1OfReal from TColStd)
83 ---Purpose: Compute points on one surface and fill an array of points;
84 --- standard (default) method
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.
95 ---Purpose: Compute points on one surface and fill an array of points;
99 CommonBox(me:in out; B1,B2: Box from Bnd; xMin,yMin,zMin,xMax,yMax,zMax: in out Real from Standard)
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.
105 FillArrayOfEdges(me: in out; SurfID: Integer from Standard)
107 ---Purpose: Compute edges from the array of points
109 FillArrayOfTriangles(me: in out; SurfID: Integer from Standard)
111 ---Purpose: Compute triangles from the array of points, and --
112 -- mark the triangles that use marked points by the
113 -- CommonBox function.
115 LinkEdges2Triangles(me:in out)
117 ---Purpose: fill the edge fields in Triangle object for the
118 -- two array of triangles.
120 CommonPartRefinement(me: in out)
122 ---Purpose: Refine systematicaly all marked triangles of both surfaces
124 LocalSurfaceRefinement(me: in out; SurfId: Integer from Standard)
126 ---Purpose: Refine systematicaly all marked triangles of ONE surface
128 ComputeDeflections(me: in out; SurfID: Integer from Standard)
130 ---Purpose: Compute deflection for all triangles of one
131 -- surface,and sort min and max of deflections
134 TrianglesDeflectionsRefinementBSB(me:in out)
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)
142 TriContact(me; P1,P2,P3,Q1,Q2,Q3: Point from IntPolyh;
143 Angle:in out Real from Standard)
144 returns Integer from Standard
146 ---Purpose: This fonction Check if two triangles are in
147 -- contact or no, return 1 if yes, return 0
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
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
163 StartingPointsResearch(me; T1,T2: Integer from Standard;
164 SP1,SP2: in out StartPoint from IntPolyh)
165 returns Integer from Standard
168 StartingPointsResearch2(me; T1,T2: Integer from Standard;
169 SP1,SP2: in out StartPoint from IntPolyh)
170 returns Integer from Standard
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
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
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
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
191 TriangleCompare(me :in out)
192 returns Integer from Standard
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
199 TriangleComparePSP(me :in out)
200 returns Integer from Standard
202 ---Purpose: The same as TriangleCompare, plus compute the
203 -- StartPoints without chaining them.
205 StartPointsCalcul(me)
207 ---Purpose: From the array of couples compute all the start
208 -- points and display them on the screen
210 StartPointsChain(me: in out;
211 TSectionLines: in out ArrayOfSectionLines from IntPolyh;
212 TTangentZones: in out ArrayOfTangentZones from IntPolyh)
213 returns Integer from Standard
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.
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
228 ---Purpose: Mainly used by StartPointsChain(), this function
229 -- try to compute the next StartPoint.
231 GetArrayOfPoints(me; SurfID: Integer from Standard)
232 ---C++: return const &
233 returns ArrayOfPoints from IntPolyh
236 GetArrayOfEdges(me; SurfID: Integer from Standard)
237 ---C++: return const &
238 returns ArrayOfEdges from IntPolyh
241 GetArrayOfTriangles(me; SurfID: Integer from Standard)
242 ---C++: return const &
243 returns ArrayOfTriangles from IntPolyh
246 GetFinTE(me; SurfID: Integer from Standard)
247 returns Integer from Standard
250 GetFinTT(me; SurfID: Integer from Standard)
251 returns Integer from Standard
254 GetBox(me; SurfID: Integer from Standard)
258 GetBoxDraw(me; SurfID: Integer from Standard)
263 ---C++: return const &
264 returns ArrayOfStartPoints from IntPolyh
267 GetArrayOfCouples(me: in out)
268 ---Purpose: This method returns array of couples of contact triangles.
270 returns ArrayOfCouples from IntPolyh
273 SetEnlargeZone(me: in out; EnlargeZone: in out Boolean from Standard);
274 GetEnlargeZone(me) returns Boolean from Standard;
280 MaSurface1 : HSurface from Adaptor3d;
281 MaSurface2 : HSurface from Adaptor3d;
283 MyBox1 : Box from Bnd;
284 MyBox2 : Box from Bnd;
286 NbSamplesU1 : Integer from Standard;
287 NbSamplesU2 : Integer from Standard;
288 NbSamplesV1 : Integer from Standard;
289 NbSamplesV2 : Integer from Standard;
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;
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;
307 myEnlargeZone : Boolean from Standard;
309 end Test from IntPolyh;