0024358: TKV3d - connected structures are not re-computed on device lost
[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,
00302ba4 35 Dir2d from gp,
36 Pnt from gp
7fd59977 37
38
39raises OutOfRange from Standard,
40 NotDone from StdFail
41
42
43 class TheInt2S instantiates Int2S from IntImp
44 (ThePSurface, ThePSurfaceTool);
45
46is
47
48
49 Create ( Caro1 ,
50 Caro2 : ThePSurface ;
51 TolTangency,
52 Epsilon,
53 Deflection,
54 Increment : Real from Standard)
55
56 ---Purpose: Constructor used to set the data to compute intersection
57 -- lines between Caro1 and Caro2.
58 -- Deflection is the maximum deflection admitted between two
59 -- consecutive points on the resulting polyline.
60 -- TolTangency is the tolerance to find a tangent point.
61 -- Func is the criterion which has to be evaluated at each
62 -- solution point (each point of the line).
63 -- It is necessary to call the Perform method to compute
64 -- the intersection lines.
b1c5c4e6 65 -- The line found starts at a point on or in 2 natural domains
66 -- of surfaces. It can be closed in the
67 -- standard case if it is open it stops and begins at the
68 -- border of one of the domains. If an open line
69 -- stops at the middle of a domain, one stops at the tangent point.
70 -- Epsilon is SquareTolerance of points confusion.
7fd59977 71
72 returns PWalking;
73
74
75 Create ( Caro1 ,
76 Caro2 : ThePSurface ;
77 TolTangency,
78 Epsilon,
79 Deflection,
80 Increment : Real from Standard;
81 U1,V1,U2,V2 :Real from Standard)
82
83 ---Purpose: Returns the intersection line containing the exact
84 -- point Poin. This line is a polygonal line.
85 -- Deflection is the maximum deflection admitted between two
86 -- consecutive points on the resulting polyline.
87 -- TolTangency is the tolerance to find a tangent point.
88 -- Func is the criterion which has to be evaluated at each
89 -- solution point (each point of the line).
b1c5c4e6 90 -- The line found starts at a point on or in 2 natural domains
91 -- of surfaces. It can be closed in the
92 -- standard case if it is open it stops and begins at the
93 -- border of one of the domains. If an open line
94 -- stops at the middle of a domain, one stops at the tangent point.
95 -- Epsilon is SquareTolerance of points confusion.
7fd59977 96
97 returns PWalking;
98
99
100 Perform(me :in out;ParDep : Array1OfReal from TColStd)
101
b1c5c4e6 102 ---Purpose: calculate the line of intersection
7fd59977 103
104 is static;
105
106 Perform(me :in out;ParDep : Array1OfReal from TColStd;
107 u1min,v1min,u2min,v2min,u1max,v1max,u2max,v2max: Real from Standard)
108
b1c5c4e6 109 ---Purpose: calculate the line of intersection. The regulation
110 -- of steps is done using min and max values on u and
111 -- v. (if this data is not presented as in the
112 -- previous method, the initial steps are calculated
113 -- starting from min and max uv of faces).
7fd59977 114
115 is static;
116
117
118 PerformFirstPoint(me :in out;
119 ParDep : Array1OfReal from TColStd;
120 FirstPoint: in out PntOn2S from IntSurf)
121
b1c5c4e6 122 ---Purpose: calculate the first point of a line of intersection
7fd59977 123 --
124
125 returns Boolean from Standard
126
127 is static;
128
129
130 IsDone(me)
131
132 ---Purpose: Returns true if the calculus was successful.
133
134 returns Boolean from Standard
135 ---C++: inline
136
137 is static;
138
139
140 NbPoints(me)
141
142 ---Purpose: Returns the number of points of the resulting polyline.
143 -- An exception is raised if IsDone returns False.
144
145 returns Integer from Standard
146 ---C++: inline
147
148 raises NotDone from StdFail
149
150 is static;
151
152
153 Value(me ; Index : Integer from Standard)
154
155 ---Purpose: Returns the point of range Index on the polyline.
156 -- An exception is raised if IsDone returns False.
157 -- An exception is raised if Index<=0 or Index>NbPoints.
158
159 returns PntOn2S from IntSurf
160 ---C++: inline
161 ---C++: return const&
162
163 raises NotDone from StdFail,
164 OutOfRange from Standard
165
166 is static;
167
168
169 Line(me)
170
171 returns mutable LineOn2S from IntSurf
172 ---C++: inline
173 ---C++: return const&
174
175 raises NotDone from StdFail
176 is static;
177
178
179 TangentAtFirst(me)
180
181 ---Purpose: Returns True if the surface are tangent at the first point
182 -- of the line.
183 -- An exception is raised if IsDone returns False.
184
185 returns Boolean from Standard
186 ---C++: inline
187
188 raises NotDone from StdFail
189
190 is static;
191
192
193 TangentAtLast(me)
194
195 ---Purpose: Returns true if the surface are tangent at the last point
196 -- of the line.
197 -- An exception is raised if IsDone returns False.
198
199 returns Boolean from Standard
200 ---C++: inline
201
202 raises NotDone from StdFail
203 is static;
204
205
206 IsClosed(me)
207
208 ---Purpose: Returns True if the line is closed.
209 -- An exception is raised if IsDone returns False.
210
211 returns Boolean from Standard
212 ---C++: inline
213
214 raises NotDone from StdFail
215 is static;
216
217
218 TangentAtLine(me; Index: out Integer from Standard)
219
220 returns Dir from gp
221 ---C++: return const&
222 ---C++: inline
223
224 raises NotDone from StdFail
225 is static;
226
227
228--private
229
230 TestDeflection(me : in out)
231
232 returns StatusDeflection from IntWalk
233 is static;
234
235
236 TestArret(me : in out; DejaReparti : Boolean from Standard;
237 Param : in out Array1OfReal from TColStd;
238 ChoixIso : out ConstIsoparametric from IntImp)
239
240
241 returns Boolean from Standard
242 is static;
243
244
245 RepartirOuDiviser(me : in out; DejaReparti : in out Boolean from Standard;
246 ChoixIso : out ConstIsoparametric from IntImp;
247 Arrive : in out Boolean from Standard )
248
249 is static;
250
251 AddAPoint ( me : in out ;
00302ba4 252 line : in out LineOn2S from IntSurf ;
253 POn2S : PntOn2S from IntSurf ) ;
254 ---C++: inline
255
7fd59977 256 ExtendLineInCommonZone(me: in out; theChoixIso: ConstIsoparametric from IntImp;
00302ba4 257theDirectionFlag: Boolean from Standard)
258 returns Boolean from Standard
259 is private;
260
261 DistanceMinimizeByGradient( me : in out;
262 theASurf1 , theASurf2 : ThePSurface ;
263 theU1, theV1, theU2, theV2: out Real from Standard;
264 theStep0U1V1: Real from Standard = 1.0e-6;
265 theStep0U2V2: Real from Standard = 1.0e-6)
266 returns Boolean from Standard
267 is private;
268
269 DistanceMinimizeByExtrema(me : in out;
270 theASurf1 : ThePSurface ;
271 theP0 : Pnt from gp;
272 theU0, theV0: out Real from Standard;
273 theStep0U: Real from Standard = 1.0;
274 theStep0V: Real from Standard = 1.0)
275 returns Boolean from Standard
276 is private;
277
278 SeekAdditionalPoints( me : in out;
279 theASurf1 , theASurf2 : ThePSurface;
280 theMinNbPoints : Integer from Standard)
281 returns Boolean from Standard;
7fd59977 282
283fields
284
285 done : Boolean from Standard;
286 line : LineOn2S from IntSurf;
287 close : Boolean from Standard;
288 tgfirst : Boolean from Standard;
289 tglast : Boolean from Standard;
290 indextg : Integer from Standard;
291 tgdir : Dir from gp;
292
b1c5c4e6 293 fleche : Real from Standard; -- max possible vector
294 pasMax : Real from Standard; -- max possible uv ratio
295 tolconf : Real from Standard; -- tol of confusion of 2 points
296 pasuv : Real from Standard[4];-- uv step on squares
297 pasSav : Real from Standard[4];-- first saved step
298 pasInit : Real from Standard[4];-- saving of steps
7fd59977 299
300 Um1 : Real from Standard;
301 UM1 : Real from Standard;
302 Vm1 : Real from Standard;
303 VM1 : Real from Standard;
304
305 Um2 : Real from Standard;
306 UM2 : Real from Standard;
307 Vm2 : Real from Standard;
308 VM2 : Real from Standard;
309
310 ResoU1 : Real from Standard;
311 ResoU2 : Real from Standard;
312 ResoV1 : Real from Standard;
313 ResoV2 : Real from Standard;
314
315 sensCheminement : Integer from Standard;
316 choixIsoSav : ConstIsoparametric from IntImp;
b1c5c4e6 317 -- save 1st iso choice
7fd59977 318 previousPoint : PntOn2S from IntSurf;
b1c5c4e6 319 -- previous intersection point
7fd59977 320 previoustg : Boolean from Standard;
321 previousd : Dir from gp;
322 previousd1 : Dir2d from gp;
323 previousd2 : Dir2d from gp;
324 firstd1 : Dir2d from gp;
325 firstd2 : Dir2d from gp;
326
327 myIntersectionOn2S : TheInt2S ;
1ef32e96
RL
328 STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
329 STATIC_PRECEDENT_INFLEXION : Integer from Standard;
7fd59977 330end PWalking;