0024208: Optimization of the edge-edge and edge-face intersection algorithms
[occt.git] / src / IntWalk / IntWalk_PWalking.cdl
CommitLineData
b311480e 1-- Created on: 1992-04-03
2-- Created by: Isabelle GRIGNON
3-- Copyright (c) 1992-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
973c2be1 8-- This library is free software; you can redistribute it and / or modify it
9-- under the terms of the GNU Lesser General Public 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
7fd59977 16
17generic class PWalking from IntWalk (
18 ThePSurface as any;
19 ThePSurfaceTool as any) -- as PSurfaceTool from IntWalk(ThePSurface)
20
21
22 ---Purpose: This class implements an algorithm to determine the
b1c5c4e6 23 -- intersection between 2 parametrized surfaces, marching from
7fd59977 24 -- a starting point. The intersection line
b1c5c4e6 25 -- starts and ends on the natural surface's boundaries .
7fd59977 26
27
28uses XY from gp,
29 StatusDeflection from IntWalk,
30 ConstIsoparametric from IntImp,
31 Array1OfReal from TColStd,
32 PntOn2S from IntSurf,
33 LineOn2S from IntSurf,
34 Dir from gp,
35 Dir2d from gp
36
37
38raises OutOfRange from Standard,
39 NotDone from StdFail
40
41
42 class TheInt2S instantiates Int2S from IntImp
43 (ThePSurface, ThePSurfaceTool);
44
45is
46
47
48 Create ( Caro1 ,
49 Caro2 : ThePSurface ;
50 TolTangency,
51 Epsilon,
52 Deflection,
53 Increment : Real from Standard)
54
55 ---Purpose: Constructor used to set the data to compute intersection
56 -- lines between Caro1 and Caro2.
57 -- Deflection is the maximum deflection admitted between two
58 -- consecutive points on the resulting polyline.
59 -- TolTangency is the tolerance to find a tangent point.
60 -- Func is the criterion which has to be evaluated at each
61 -- solution point (each point of the line).
62 -- It is necessary to call the Perform method to compute
63 -- the intersection lines.
b1c5c4e6 64 -- The line found starts at a point on or in 2 natural domains
65 -- of surfaces. It can be closed in the
66 -- standard case if it is open it stops and begins at the
67 -- border of one of the domains. If an open line
68 -- stops at the middle of a domain, one stops at the tangent point.
69 -- Epsilon is SquareTolerance of points confusion.
7fd59977 70
71 returns PWalking;
72
73
74 Create ( Caro1 ,
75 Caro2 : ThePSurface ;
76 TolTangency,
77 Epsilon,
78 Deflection,
79 Increment : Real from Standard;
80 U1,V1,U2,V2 :Real from Standard)
81
82 ---Purpose: Returns the intersection line containing the exact
83 -- point Poin. This line is a polygonal line.
84 -- Deflection is the maximum deflection admitted between two
85 -- consecutive points on the resulting polyline.
86 -- TolTangency is the tolerance to find a tangent point.
87 -- Func is the criterion which has to be evaluated at each
88 -- solution point (each point of the line).
b1c5c4e6 89 -- The line found starts at a point on or in 2 natural domains
90 -- of surfaces. It can be closed in the
91 -- standard case if it is open it stops and begins at the
92 -- border of one of the domains. If an open line
93 -- stops at the middle of a domain, one stops at the tangent point.
94 -- Epsilon is SquareTolerance of points confusion.
7fd59977 95
96 returns PWalking;
97
98
99 Perform(me :in out;ParDep : Array1OfReal from TColStd)
100
b1c5c4e6 101 ---Purpose: calculate the line of intersection
7fd59977 102
103 is static;
104
105 Perform(me :in out;ParDep : Array1OfReal from TColStd;
106 u1min,v1min,u2min,v2min,u1max,v1max,u2max,v2max: Real from Standard)
107
b1c5c4e6 108 ---Purpose: calculate the line of intersection. The regulation
109 -- of steps is done using min and max values on u and
110 -- v. (if this data is not presented as in the
111 -- previous method, the initial steps are calculated
112 -- starting from min and max uv of faces).
7fd59977 113
114 is static;
115
116
117 PerformFirstPoint(me :in out;
118 ParDep : Array1OfReal from TColStd;
119 FirstPoint: in out PntOn2S from IntSurf)
120
b1c5c4e6 121 ---Purpose: calculate the first point of a line of intersection
7fd59977 122 --
123
124 returns Boolean from Standard
125
126 is static;
127
128
129 IsDone(me)
130
131 ---Purpose: Returns true if the calculus was successful.
132
133 returns Boolean from Standard
134 ---C++: inline
135
136 is static;
137
138
139 NbPoints(me)
140
141 ---Purpose: Returns the number of points of the resulting polyline.
142 -- An exception is raised if IsDone returns False.
143
144 returns Integer from Standard
145 ---C++: inline
146
147 raises NotDone from StdFail
148
149 is static;
150
151
152 Value(me ; Index : Integer from Standard)
153
154 ---Purpose: Returns the point of range Index on the polyline.
155 -- An exception is raised if IsDone returns False.
156 -- An exception is raised if Index<=0 or Index>NbPoints.
157
158 returns PntOn2S from IntSurf
159 ---C++: inline
160 ---C++: return const&
161
162 raises NotDone from StdFail,
163 OutOfRange from Standard
164
165 is static;
166
167
168 Line(me)
169
170 returns mutable LineOn2S from IntSurf
171 ---C++: inline
172 ---C++: return const&
173
174 raises NotDone from StdFail
175 is static;
176
177
178 TangentAtFirst(me)
179
180 ---Purpose: Returns True if the surface are tangent at the first point
181 -- of the line.
182 -- An exception is raised if IsDone returns False.
183
184 returns Boolean from Standard
185 ---C++: inline
186
187 raises NotDone from StdFail
188
189 is static;
190
191
192 TangentAtLast(me)
193
194 ---Purpose: Returns true if the surface are tangent at the last point
195 -- of the line.
196 -- An exception is raised if IsDone returns False.
197
198 returns Boolean from Standard
199 ---C++: inline
200
201 raises NotDone from StdFail
202 is static;
203
204
205 IsClosed(me)
206
207 ---Purpose: Returns True if the line is closed.
208 -- An exception is raised if IsDone returns False.
209
210 returns Boolean from Standard
211 ---C++: inline
212
213 raises NotDone from StdFail
214 is static;
215
216
217 TangentAtLine(me; Index: out Integer from Standard)
218
219 returns Dir from gp
220 ---C++: return const&
221 ---C++: inline
222
223 raises NotDone from StdFail
224 is static;
225
226
227--private
228
229 TestDeflection(me : in out)
230
231 returns StatusDeflection from IntWalk
232 is static;
233
234
235 TestArret(me : in out; DejaReparti : Boolean from Standard;
236 Param : in out Array1OfReal from TColStd;
237 ChoixIso : out ConstIsoparametric from IntImp)
238
239
240 returns Boolean from Standard
241 is static;
242
243
244 RepartirOuDiviser(me : in out; DejaReparti : in out Boolean from Standard;
245 ChoixIso : out ConstIsoparametric from IntImp;
246 Arrive : in out Boolean from Standard )
247
248 is static;
249
250 AddAPoint ( me : in out ;
251 line : in out LineOn2S from IntSurf ;
252 POn2S : PntOn2S from IntSurf ) ;
253 ---C++: inline
254
255 ExtendLineInCommonZone(me: in out; theChoixIso: ConstIsoparametric from IntImp;
256 theDirectionFlag: Boolean from Standard)
257 returns Boolean from Standard
258 is private;
259
260fields
261
262 done : Boolean from Standard;
263 line : LineOn2S from IntSurf;
264 close : Boolean from Standard;
265 tgfirst : Boolean from Standard;
266 tglast : Boolean from Standard;
267 indextg : Integer from Standard;
268 tgdir : Dir from gp;
269
b1c5c4e6 270 fleche : Real from Standard; -- max possible vector
271 pasMax : Real from Standard; -- max possible uv ratio
272 tolconf : Real from Standard; -- tol of confusion of 2 points
273 pasuv : Real from Standard[4];-- uv step on squares
274 pasSav : Real from Standard[4];-- first saved step
275 pasInit : Real from Standard[4];-- saving of steps
7fd59977 276
277 Um1 : Real from Standard;
278 UM1 : Real from Standard;
279 Vm1 : Real from Standard;
280 VM1 : Real from Standard;
281
282 Um2 : Real from Standard;
283 UM2 : Real from Standard;
284 Vm2 : Real from Standard;
285 VM2 : Real from Standard;
286
287 ResoU1 : Real from Standard;
288 ResoU2 : Real from Standard;
289 ResoV1 : Real from Standard;
290 ResoV2 : Real from Standard;
291
292 sensCheminement : Integer from Standard;
293 choixIsoSav : ConstIsoparametric from IntImp;
b1c5c4e6 294 -- save 1st iso choice
7fd59977 295 previousPoint : PntOn2S from IntSurf;
b1c5c4e6 296 -- previous intersection point
7fd59977 297 previoustg : Boolean from Standard;
298 previousd : Dir from gp;
299 previousd1 : Dir2d from gp;
300 previousd2 : Dir2d from gp;
301 firstd1 : Dir2d from gp;
302 firstd2 : Dir2d from gp;
303
304 myIntersectionOn2S : TheInt2S ;
1ef32e96
RL
305 STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
306 STATIC_PRECEDENT_INFLEXION : Integer from Standard;
7fd59977 307end PWalking;