0024043: Performance improvements: Modeling Algorithms
[occt.git] / src / IntWalk / IntWalk_IWalking.cdl
CommitLineData
b311480e 1-- Created on: 1992-03-25
2-- Created by: Isabelle GRIGNON
3-- Copyright (c) 1992-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
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.
10--
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.
13--
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.
20
7fd59977 21
22generic class IWalking from IntWalk (
23 ThePointOfPath as any;
24 ThePointOfPathTool as any; -- as PathPointTool(ThePointOfPath)
25 ThePOPIterator as any; -- as Iterator from IntWalk(ThePointOfPath)
26 ThePointOfLoop as any;
27 ThePointOfLoopTool as any; -- as LoopPointTool(ThePointOfLoop)
28 ThePOLIterator as any; -- as Iterator from IntWalk(ThePointOfLoop)
29 ThePSurface as any;
30 ThePSurfaceTool as any; -- as PSurfaceTool(ThePSurface)
31 TheIWFunction as any) -- as IWFunction from IntWalk(ThePSurface)
32
33
34 ---Purpose: This class implements an algorithm to find all the points
35 -- on a parametric surface verifying f(u,v)=0
36 -- where f is defined in the IWFunction class.
37 -- These points are found by a marching algorithm, using a set of
38 -- points as starting points.
39
40
41
42
43uses Vector from math,
44 SequenceOfInteger from TColStd,
45 SequenceOfReal from TColStd,
46 StatusDeflection from IntWalk,
96a85238
RL
47 VectorOfInteger from IntWalk,
48 VectorOfWalkingData from IntWalk,
7fd59977 49 Vec from gp,
50 Dir2d from gp,
51 PntOn2S from IntSurf
52
53
54raises NotDone from StdFail,
55 OutOfRange from Standard
56
57
58 class TheIWLine instantiates IWLine from IntWalk
59 (ThePointOfPath);
60
61 class SequenceOfIWLine instantiates Sequence from TCollection
62 (TheIWLine);
63
64
65is
66
7fd59977 67 Create(Epsilon, Deflection, Step : Real from Standard)
68
69 ---Purpose: Deflection is the maximum deflection admitted between two
70 -- consecutive points on a resulting polyline.
71 -- Step is the maximum increment admitted between two
72 -- consecutive points (in 2d space).
73 -- Epsilon est la tolerance au dela de laquelle 2 points
74 -- sont confondus
75
76 returns IWalking from IntWalk;
77
78
79 SetTolerance(me: in out;Epsilon, Deflection, Step : Real from Standard)
80
81 ---Purpose: Deflection is the maximum deflection admitted between two
82 -- consecutive points on a resulting polyline.
83 -- Step is the maximum increment admitted between two
84 -- consecutive points (in 2d space).
85 -- Epsilon est la tolerance au dela de laquelle 2 points
86 -- sont confondus
87
88 ---C++: inline
89
90 is static;
91
92
93 Perform(me: in out;
94 Pnts1 : ThePOPIterator;
95 Pnts2 : ThePOLIterator;
96 Func : in out TheIWFunction;
97 S : ThePSurface;
98 Reversed : Boolean from Standard = Standard_False)
99
100 ---Purpose: Searches a set of polylines starting on a point of Pnts1
101 -- or Pnts2.
102 -- Each point on a resulting polyline verifies F(u,v)=0
103
104 is static;
105
106
107 Perform(me: in out;
108 Pnts1 : ThePOPIterator;
109 Func : in out TheIWFunction;
110 S : ThePSurface;
111 Reversed : Boolean from Standard = Standard_False)
112
113 ---Purpose: Searches a set of polylines starting on a point of Pnts1.
114 -- Each point on a resulting polyline verifies F(u,v)=0
115
116 is static;
117
118
119 IsDone(me)
120
121 ---Purpose: Returns true if the calculus was successful.
122
123 returns Boolean from Standard
124 ---C++: inline
125
126 is static;
127
128
129 NbLines(me)
130
131 ---Purpose: Returns the number of resulting polylines.
132 -- An exception is raised if IsDone returns False.
133
134 returns Integer from Standard
135 ---C++: inline
136
137 raises NotDone from StdFail
138
139 is static;
140
141
142 Value(me; Index: Integer from Standard)
143
144 ---Purpose: Returns the polyline of range Index.
145 -- An exception is raised if IsDone is False.
146 -- An exception is raised if Index<=0 or Index>NbLines.
147
148 returns TheIWLine
149 ---C++: return const&
150 ---C++: inline
151
152 raises OutOfRange from Standard,
153 NotDone from StdFail
154
155 is static;
156
157
158 NbSinglePnts(me)
159
160 ---Purpose: Returns the number of points belonging to Pnts on which no
161 -- line starts or ends.
162 -- An exception is raised if IsDone returns False.
163
164 returns Integer from Standard
165 ---C++: inline
166
167 raises NotDone from StdFail
168
169 is static;
170
171
172 SinglePnt(me ; Index: Integer from Standard)
173
174 ---Purpose: Returns the point of range Index .
175 -- An exception is raised if IsDone returns False.
176 -- An exception is raised if Index<=0 or
177 -- Index > NbSinglePnts.
178
179 returns ThePointOfPath
180 ---C++: return const&
181 ---C++: inline
182
183 raises OutOfRange from Standard,
184 NotDone from StdFail
185
186 is static;
187
188
189-- -- private
190
191 Cadrage(me; BornInf, BornSup, UVap : in out Vector from math;
192 Step : in out Real from Standard;
193-- StepV : in out Real from Standard;
194 StepSign : Integer from Standard)
195 returns Boolean from Standard
196 is static protected;
197
198 TestArretPassage (me: in out; Umult : SequenceOfReal from TColStd;
199 Vmult : SequenceOfReal from TColStd;
200 Section: in out TheIWFunction;
201 UV : in out Vector from math;
202 Irang : out Integer from Standard)
203 returns Boolean from Standard
204 is static protected;
205
206 TestArretPassage (me: in out; Umult : SequenceOfReal from TColStd;
207 Vmult : SequenceOfReal from TColStd;
208 UV : Vector from math;
209 Index : Integer from Standard;
210 Irang : out Integer from Standard)
211 returns Boolean from Standard
212 is static protected;
213
214 TestArretAjout(me: in out; Section: in out TheIWFunction;
215 UV : in out Vector from math;
216 Irang : out Integer from Standard;
217 PSol : out PntOn2S from IntSurf )
218 returns Boolean from Standard
219 is static protected;
220
221 TestArretCadre(me : in out; Umult : SequenceOfReal from TColStd;
222 Vmult : SequenceOfReal from TColStd;
223 Line : mutable TheIWLine;
224 Section: in out TheIWFunction;
225 UV : in out Vector from math;
226 Irang : out Integer from Standard)
227 is static protected;
228
229
230 TestDeflection(me: in out; Section : in out TheIWFunction;
231 Finished : Boolean from Standard;
232 UV : Vector from math;
233 StatusPrecedent : StatusDeflection from IntWalk;
234 NbDivision : in out Integer from Standard;
235 Step : in out Real from Standard;
236-- StepV : in out Real from Standard;
237 StepSign : Integer from Standard)
238 returns StatusDeflection from IntWalk
239 is static protected;
240
241 ComputeOpenLine(me : in out; Umult : SequenceOfReal from TColStd;
242 Vmult : SequenceOfReal from TColStd;
243 Pnts1 : ThePOPIterator;
244 Section: in out TheIWFunction;
245 Rajout : in out Boolean from Standard)
246 is static protected;
247
248 OpenLine(me : in out; N : Integer from Standard;
249 Psol : PntOn2S from IntSurf;
250 Pnts1 : ThePOPIterator;
251 Section: in out TheIWFunction;
252 Line : mutable TheIWLine)
253 is static protected;
254
255 ComputeCloseLine(me : in out; Umult : SequenceOfReal from TColStd;
256 Vmult : SequenceOfReal from TColStd;
257 Pnts1 : ThePOPIterator;
258 Pnts2 : ThePOLIterator;
259 Section: in out TheIWFunction;
260 Rajout : in out Boolean from Standard)
261 is static protected;
262
263 AddPointInCurrentLine(me ; N : Integer from Standard;
264 PathPnt : ThePointOfPath;
265 CurrentLine : mutable TheIWLine)
266 is static protected;
267
268 MakeWalkingPoint(me : in out ; Case : Integer from Standard;
269 U,V : Real from Standard;
270 Section : in out TheIWFunction;
271 Psol : in out PntOn2S from IntSurf)
272
273 is static protected;
96a85238
RL
274
275 Clear (me: in out) is static protected;
276 ---Purpose: Clears up internal containers
7fd59977 277
278
279fields
280
281 done : Boolean from Standard;
282 seqSingle : ThePOPIterator;
283 fleche : Real from Standard;
284 pas : Real from Standard;
285 tolerance : Vector from math;
286 epsilon : Real from Standard;
287 reversed : Boolean from Standard;
288
96a85238
RL
289 wd1 : VectorOfWalkingData from IntWalk;
290 wd2 : VectorOfWalkingData from IntWalk;
291 nbMultiplicities : VectorOfInteger from IntWalk;
7fd59977 292 Um : Real from Standard; -- Min U de la surf
293 UM : Real from Standard; -- Max U de la surf
294 Vm : Real from Standard; -- Min V de la surf
295 VM : Real from Standard; -- Max V de la surf
296 previousPoint : PntOn2S from IntSurf;
297 prevtg : Boolean from Standard;
298 previousd3d : Vec from gp;
299 previousd2d : Dir2d from gp;
300 seqAjout : SequenceOfInteger from TColStd;
301 lines : SequenceOfIWLine;
1ef32e96
RL
302 NbPointsConfondusConsecutifs: Integer from Standard;
303 EpsilonSembleTropGrand : Integer from Standard;
7fd59977 304end IWalking;
305