1 -- Created on: 1992-04-03
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1992-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.
23 generic class PWalking from IntWalk (
25 ThePSurfaceTool as any) -- as PSurfaceTool from IntWalk(ThePSurface)
28 ---Purpose: This class implements an algorithm to determine the
29 -- intersection between 2 parametrized surface, marching from
30 -- a starting point. The intersection line
31 -- starts and ends on the natural surface 's boundaries .
35 StatusDeflection from IntWalk,
36 ConstIsoparametric from IntImp,
37 Array1OfReal from TColStd,
39 LineOn2S from IntSurf,
44 raises OutOfRange from Standard,
48 class TheInt2S instantiates Int2S from IntImp
49 (ThePSurface, ThePSurfaceTool);
59 Increment : Real from Standard)
61 ---Purpose: Constructor used to set the data to compute intersection
62 -- lines between Caro1 and Caro2.
63 -- Deflection is the maximum deflection admitted between two
64 -- consecutive points on the resulting polyline.
65 -- TolTangency is the tolerance to find a tangent point.
66 -- Func is the criterion which has to be evaluated at each
67 -- solution point (each point of the line).
68 -- It is necessary to call the Perform method to compute
69 -- the intersection lines.
70 -- la ligne trouvee part d'un point sur ou dans les 2 domaines
71 -- naturelles des surfaces .Elle peut etre fermee ;dans les
72 -- cas standard si elle est ouverte elle s arrete et commence
73 -- a une frontiere d 'un des domaines.Si une ligne ouverte
74 -- s arrete en plein milieu d'un domaine ,on s'arrete sur
76 -- Epsilon tolerance au carre de confusion de points
86 Increment : Real from Standard;
87 U1,V1,U2,V2 :Real from Standard)
89 ---Purpose: Returns the intersection line containing the exact
90 -- point Poin. This line is a polygonal line.
91 -- Deflection is the maximum deflection admitted between two
92 -- consecutive points on the resulting polyline.
93 -- TolTangency is the tolerance to find a tangent point.
94 -- Func is the criterion which has to be evaluated at each
95 -- solution point (each point of the line).
96 -- la ligne trouvee part d'un point sur ou dans les 2 domaines
97 -- naturelles des surfaces .Elle peut etre fermee ;dans les
98 -- cas standard si elle est ouverte elle s arrete et commence
99 -- a une frontiere d 'un des domaines.Si une ligne ouverte
100 -- s arrete en plein milieu d'un domaine ,on s'arrete sur
101 -- point de tangence.
102 -- Epsilon tolerance au carre de confusion de points
107 Perform(me :in out;ParDep : Array1OfReal from TColStd)
109 ---Purpose: calcule la ligne d 'intersection
113 Perform(me :in out;ParDep : Array1OfReal from TColStd;
114 u1min,v1min,u2min,v2min,u1max,v1max,u2max,v2max: Real from Standard)
116 ---Purpose: calcule la ligne d 'intersection le reglage des
117 -- pas est fait a partir des valeurs min max sur u et
118 -- v. (si ces donnees ne sont pas presentes comme
119 -- dans la methode precedente, les pas initiaux sont
120 -- calcules a partir des min max uv des faces).
125 PerformFirstPoint(me :in out;
126 ParDep : Array1OfReal from TColStd;
127 FirstPoint: in out PntOn2S from IntSurf)
129 ---Purpose: calcule le premier point d'une ligne d'intersection
132 returns Boolean from Standard
139 ---Purpose: Returns true if the calculus was successful.
141 returns Boolean from Standard
149 ---Purpose: Returns the number of points of the resulting polyline.
150 -- An exception is raised if IsDone returns False.
152 returns Integer from Standard
155 raises NotDone from StdFail
160 Value(me ; Index : Integer from Standard)
162 ---Purpose: Returns the point of range Index on the polyline.
163 -- An exception is raised if IsDone returns False.
164 -- An exception is raised if Index<=0 or Index>NbPoints.
166 returns PntOn2S from IntSurf
168 ---C++: return const&
170 raises NotDone from StdFail,
171 OutOfRange from Standard
178 returns mutable LineOn2S from IntSurf
180 ---C++: return const&
182 raises NotDone from StdFail
188 ---Purpose: Returns True if the surface are tangent at the first point
190 -- An exception is raised if IsDone returns False.
192 returns Boolean from Standard
195 raises NotDone from StdFail
202 ---Purpose: Returns true if the surface are tangent at the last point
204 -- An exception is raised if IsDone returns False.
206 returns Boolean from Standard
209 raises NotDone from StdFail
215 ---Purpose: Returns True if the line is closed.
216 -- An exception is raised if IsDone returns False.
218 returns Boolean from Standard
221 raises NotDone from StdFail
225 TangentAtLine(me; Index: out Integer from Standard)
228 ---C++: return const&
231 raises NotDone from StdFail
237 TestDeflection(me : in out)
239 returns StatusDeflection from IntWalk
243 TestArret(me : in out; DejaReparti : Boolean from Standard;
244 Param : in out Array1OfReal from TColStd;
245 ChoixIso : out ConstIsoparametric from IntImp)
248 returns Boolean from Standard
252 RepartirOuDiviser(me : in out; DejaReparti : in out Boolean from Standard;
253 ChoixIso : out ConstIsoparametric from IntImp;
254 Arrive : in out Boolean from Standard )
258 AddAPoint ( me : in out ;
259 line : in out LineOn2S from IntSurf ;
260 POn2S : PntOn2S from IntSurf ) ;
263 ExtendLineInCommonZone(me: in out; theChoixIso: ConstIsoparametric from IntImp;
264 theDirectionFlag: Boolean from Standard)
265 returns Boolean from Standard
270 done : Boolean from Standard;
271 line : LineOn2S from IntSurf;
272 close : Boolean from Standard;
273 tgfirst : Boolean from Standard;
274 tglast : Boolean from Standard;
275 indextg : Integer from Standard;
278 fleche : Real from Standard; -- fleche maxi autorisee
279 pasMax : Real from Standard; -- ratio uv maximum autorise
280 tolconf : Real from Standard; -- tol de confusion de 2 points
281 pasuv : Real from Standard[4];-- pas uv sur les caros
282 pasSav : Real from Standard[4];-- premier pas sauvegarde
283 pasInit : Real from Standard[4];-- sauvegarde des pas
285 Um1 : Real from Standard;
286 UM1 : Real from Standard;
287 Vm1 : Real from Standard;
288 VM1 : Real from Standard;
290 Um2 : Real from Standard;
291 UM2 : Real from Standard;
292 Vm2 : Real from Standard;
293 VM2 : Real from Standard;
295 ResoU1 : Real from Standard;
296 ResoU2 : Real from Standard;
297 ResoV1 : Real from Standard;
298 ResoV2 : Real from Standard;
300 sensCheminement : Integer from Standard;
301 choixIsoSav : ConstIsoparametric from IntImp;
302 -- sauvegarde du choix 1 iere iso
303 previousPoint : PntOn2S from IntSurf;
304 -- point d 'intersection precedent
305 previoustg : Boolean from Standard;
306 previousd : Dir from gp;
307 previousd1 : Dir2d from gp;
308 previousd2 : Dir2d from gp;
309 firstd1 : Dir2d from gp;
310 firstd2 : Dir2d from gp;
312 myIntersectionOn2S : TheInt2S ;
313 STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
314 STATIC_PRECEDENT_INFLEXION : Integer from Standard;