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