0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler)
[occt.git] / src / ElCLib / ElCLib.cdl
CommitLineData
7fd59977 1-- File: ElCLib.cdl
2-- Created: Tue Sep 10 08:53:41 1991
3-- Author: Michel Chauvat
4---Copyright: Matra Datavision 1991, 1992
5
6
7
8
9package ElCLib
10
11 --- Purpose: Provides functions for basic geometric computations on
12 -- elementary curves such as conics and lines in 2D and 3D space.
13 -- This includes:
14 -- - calculation of a point or derived vector on a 2D or
15 -- 3D curve where:
16 -- - the curve is provided by the gp package, or
17 -- defined in reference form (as in the gp package),
18 -- and
19 -- - the point is defined by a parameter,
20 -- - evaluation of the parameter corresponding to a point
21 -- on a 2D or 3D curve from gp,
22 -- - various elementary computations which allow you to
23 -- position parameterized values within the period of a curve.
24 -- Notes:
25 -- - ElCLib stands for Elementary Curves Library.
26 -- - If the curves provided by the gp package are not
27 -- explicitly parameterized, they still have an implicit
28 -- parameterization, analogous to that which they infer
29 -- for the equivalent Geom or Geom2d curves.
30
31uses gp
32
33is
34
35 InPeriod(U, UFirst, ULast : Real) returns Real;
36
37 ---Purpose: Return a value in the range <UFirst, ULast> by
38 -- adding or removing the period <ULast - UFirst> to
39 -- <U>.
40
41 AdjustPeriodic(UFirst, ULast, Precision : Real;
42 U1, U2 : in out Real);
43
44 ---Purpose: Adjust U1 and U2 in the parametric range UFirst
45 -- Ulast of a periodic curve, where ULast -
46 -- UFirst is its period. To do this, this function:
47 -- - sets U1 in the range [ UFirst, ULast ] by
48 -- adding/removing the period to/from the value U1, then
49 -- - sets U2 in the range [ U1, U1 + period ] by
50 -- adding/removing the period to/from the value U2.
51 -- Precision is used to test the equalities.
52
53
54
55
56
57 Value (U : Real; L : Lin from gp) returns Pnt from gp;
58 --- Purpose : For elementary curves (lines, circles and conics) from
59 -- the gp package, computes the point of parameter U.
60 -- The result is either:
61 -- - a gp_Pnt point for a curve in 3D space, or
62 -- - a gp_Pnt2d point for a curve in 2D space.
63
64 Value (U : Real; C : Circ from gp) returns Pnt from gp;
65 ---C++: inline
66
67 Value (U : Real; E : Elips from gp) returns Pnt from gp;
68 ---C++: inline
69
70 Value (U : Real; H : Hypr from gp) returns Pnt from gp;
71 ---C++: inline
72
73 Value (U : Real; Prb : Parab from gp) returns Pnt from gp;
74 ---C++: inline
75
76 D1 (U : Real; L : Lin from gp; P : out Pnt from gp; V1 : out Vec from gp);
77 ---Purpose:
78 -- For elementary curves (lines, circles and conics) from the
79 -- gp package, computes:
80 -- - the point P of parameter U, and
81 -- - the first derivative vector V1 at this point.
82 -- The results P and V1 are either:
83 -- - a gp_Pnt point and a gp_Vec vector, for a curve in 3D space, or
84 -- - a gp_Pnt2d point and a gp_Vec2d vector, for a curve in 2D space.
85
86 D1 (U : Real; C : Circ from gp; P : out Pnt from gp; V1 : out Vec from gp);
87 ---C++: inline
88
89 D1 (U : Real; E : Elips from gp; P : out Pnt from gp; V1 : out Vec from gp);
90 ---C++: inline
91
92 D1 (U : Real; H : Hypr from gp; P : out Pnt from gp; V1 : out Vec from gp);
93 ---C++: inline
94
95 D1 (U : Real; Prb : Parab from gp; P : out Pnt from gp;
96 V1 : out Vec from gp);
97 ---C++: inline
98
99 D2 (U : Real; C : Circ from gp; P : out Pnt from gp;
100 V1, V2 : out Vec from gp);
101 ---Purpose: For elementary curves (circles and conics) from the gp
102 -- package, computes:
103 -- - the point P of parameter U, and
104 -- - the first and second derivative vectors V1 and V2 at this point.
105 -- The results, P, V1 and V2, are either:
106 -- - a gp_Pnt point and two gp_Vec vectors, for a curve in 3D space, or
107 -- - a gp_Pnt2d point and two gp_Vec2d vectors, for a curve in 2D space.
108
109 D2 (U : Real; E : Elips from gp; P : out Pnt from gp;
110 V1, V2 : out Vec from gp);
111 ---C++: inline
112
113 D2 (U : Real; H : Hypr from gp; P : out Pnt from gp;
114 V1, V2 : out Vec from gp);
115 ---C++: inline
116
117 D2 (U : Real; Prb : Parab from gp; P : out Pnt from gp;
118 V1, V2 : out Vec from gp);
119 ---C++: inline
120
121 D3 (U : Real; C : Circ from gp; P : out Pnt from gp;
122 V1, V2, V3 : out Vec from gp);
123 ---Purpose: For elementary curves (circles, ellipses and hyperbolae)
124 -- from the gp package, computes:
125 -- - the point P of parameter U, and
126 -- - the first, second and third derivative vectors V1, V2
127 -- and V3 at this point.
128 -- The results, P, V1, V2 and V3, are either:
129 -- - a gp_Pnt point and three gp_Vec vectors, for a curve in 3D space, or
130 -- - a gp_Pnt2d point and three gp_Vec2d vectors, for a curve in 2D space.
131
132 D3 (U : Real; E : Elips from gp; P : out Pnt from gp;
133 V1, V2, V3 : out Vec from gp);
134 ---C++: inline
135
136 D3 (U : Real; H : Hypr from gp; P : out Pnt from gp;
137 V1, V2, V3 : out Vec from gp);
138
139 DN (U : Real; L : Lin from gp; N : Integer) returns Vec from gp;
140 ---Purpose:
141 -- For elementary curves (lines, circles and conics) from
142 -- the gp package, computes the vector corresponding to
143 -- the Nth derivative at the point of parameter U. The result is either:
144 -- - a gp_Vec vector for a curve in 3D space, or
145 -- - a gp_Vec2d vector for a curve in 2D space.
146 -- In the following functions N is the order of derivation
147 -- and should be greater than 0
148
149 DN (U : Real; C : Circ from gp; N : Integer) returns Vec from gp;
150 ---C++: inline
151
152 DN (U : Real; E : Elips from gp; N : Integer) returns Vec from gp;
153 ---C++: inline
154
155 DN (U : Real; H : Hypr from gp; N : Integer) returns Vec from gp;
156 ---C++: inline
157
158 DN (U : Real; Prb : Parab from gp; N : Integer) returns Vec from gp;
159 ---C++: inline
160
161 Value (U : Real; L : Lin2d from gp) returns Pnt2d from gp;
162 ---C++: inline
163
164 Value (U : Real; C : Circ2d from gp) returns Pnt2d from gp;
165 ---C++: inline
166
167 Value (U : Real; E : Elips2d from gp) returns Pnt2d from gp;
168 ---C++: inline
169
170 Value (U : Real; H : Hypr2d from gp) returns Pnt2d from gp;
171 ---C++: inline
172
173 Value (U : Real; Prb : Parab2d from gp) returns Pnt2d from gp;
174 ---C++: inline
175
176 D1 (U : Real; L : Lin2d from gp; P : out Pnt2d from gp;
177 V1 : out Vec2d from gp);
178 ---C++: inline
179
180 D1 (U : Real; C : Circ2d from gp; P : out Pnt2d from gp;
181 V1 : out Vec2d from gp);
182 ---C++: inline
183
184 D1 (U : Real; E : Elips2d from gp; P : out Pnt2d from gp;
185 V1 : out Vec2d from gp);
186 ---C++: inline
187
188 D1 (U : Real; H : Hypr2d from gp; P : out Pnt2d from gp;
189 V1 : out Vec2d from gp);
190 ---C++: inline
191
192 D1 (U : Real; Prb : Parab2d from gp; P : out Pnt2d from gp;
193 V1 : out Vec2d from gp);
194 ---C++: inline
195
196 D2 (U : Real; C : Circ2d from gp; P : out Pnt2d from gp;
197 V1, V2 : out Vec2d from gp);
198 ---C++: inline
199
200 D2 (U : Real; E : Elips2d from gp; P : out Pnt2d from gp;
201 V1, V2 : out Vec2d from gp);
202 ---C++: inline
203
204 D2 (U : Real; H : Hypr2d from gp; P : out Pnt2d from gp;
205 V1, V2 : out Vec2d from gp);
206 ---C++: inline
207
208 D2 (U : Real; Prb : Parab2d from gp; P : out Pnt2d from gp;
209 V1, V2 : out Vec2d from gp);
210 ---C++: inline
211
212 D3 (U : Real; C : Circ2d from gp; P : out Pnt2d from gp;
213 V1, V2, V3 : out Vec2d from gp);
214 ---C++: inline
215
216 D3 (U : Real; E : Elips2d from gp; P : out Pnt2d from gp;
217 V1, V2, V3 : out Vec2d from gp);
218 ---C++: inline
219
220 D3 (U : Real; H : Hypr2d from gp; P : out Pnt2d from gp;
221 V1, V2, V3 : out Vec2d from gp);
222 ---C++: inline
223
224
225 --- Purpose :
226 -- In the following functions N is the order of derivation
227 -- and should be greater than 0
228
229 DN (U : Real; L : Lin2d from gp; N : Integer) returns Vec2d from gp;
230 ---C++: inline
231
232 DN (U : Real; C : Circ2d from gp; N : Integer) returns Vec2d from gp;
233 ---C++: inline
234
235 DN (U : Real; E : Elips2d from gp; N : Integer) returns Vec2d from gp;
236 ---C++: inline
237
238 DN (U : Real; H : Hypr2d from gp; N : Integer) returns Vec2d from gp;
239 ---C++: inline
240
241 DN (U : Real; Prb : Parab2d from gp; N : Integer) returns Vec2d from gp;
242 ---C++: inline
243
244
245
246
247
248
249
250 LineValue (U : Real; Pos : Ax1 from gp)
251 returns Pnt from gp;
252 --- Purpose : Curve evaluation
253 -- The following basis functions compute the derivatives on
254 -- elementary curves defined by their geometric characteristics.
255 -- These functions can be called without constructing a conic
256 -- from package gp. They are called by the previous functions.
257 -- Example :
258 -- A circle is defined by its position and its radius.
259
260 CircleValue (U : Real; Pos : Ax2 from gp; Radius : Real)
261 returns Pnt from gp;
262
263 EllipseValue (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real)
264 returns Pnt from gp;
265
266 HyperbolaValue (U : Real; Pos : Ax2 from gp;
267 MajorRadius, MinorRadius : Real)
268 returns Pnt from gp;
269
270 ParabolaValue (U : Real; Pos : Ax2 from gp; Focal : Real)
271 returns Pnt from gp;
272
273 LineD1 (U : Real; Pos : Ax1 from gp; P : out Pnt from gp;
274 V1 : out Vec from gp);
275
276 CircleD1 (U : Real; Pos : Ax2 from gp; Radius : Real; P : out Pnt from gp;
277 V1 : out Vec from gp);
278
279 EllipseD1 (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
280 P : out Pnt from gp; V1 : out Vec from gp);
281
282 HyperbolaD1 (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
283 P : out Pnt from gp; V1 : out Vec from gp);
284
285 ParabolaD1 (U : Real; Pos : Ax2 from gp; Focal : Real; P : out Pnt from gp;
286 V1 : out Vec from gp);
287
288 CircleD2 (U : Real; Pos : Ax2 from gp; Radius : Real;
289 P : out Pnt from gp; V1, V2 : out Vec from gp);
290
291 EllipseD2 (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
292 P : out Pnt from gp; V1, V2 : out Vec from gp);
293
294 HyperbolaD2 (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
295 P : out Pnt from gp; V1, V2 : out Vec from gp);
296
297 ParabolaD2 (U : Real; Pos : Ax2 from gp; Focal : Real;
298 P : out Pnt from gp; V1, V2 : out Vec from gp);
299
300 CircleD3 (U : Real; Pos : Ax2 from gp; Radius : Real;
301 P : out Pnt from gp; V1, V2, V3 : out Vec from gp);
302
303 EllipseD3 (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
304 P : out Pnt from gp; V1, V2, V3 : out Vec from gp);
305
306 HyperbolaD3 (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
307 P : out Pnt from gp; V1, V2, V3 : out Vec from gp);
308
309
310
311 LineDN (U : Real; Pos : Ax1 from gp; N : Integer)
312 returns Vec from gp;
313 --- Purpose :
314 -- In the following functions N is the order of derivation
315 -- and should be greater than 0
316 CircleDN (U : Real; Pos : Ax2 from gp; Radius : Real; N : Integer)
317 returns Vec from gp;
318
319 EllipseDN (U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
320 N : Integer)
321 returns Vec from gp;
322
323 HyperbolaDN (
324 U : Real; Pos : Ax2 from gp; MajorRadius, MinorRadius : Real; N : Integer)
325 returns Vec from gp;
326
327 ParabolaDN (U : Real; Pos : Ax2 from gp; Focal : Real; N : Integer)
328 returns Vec from gp;
329
330
331
332
333
334 LineValue (U : Real; Pos : Ax2d from gp)
335 returns Pnt2d from gp;
336
337 CircleValue (U : Real; Pos : Ax22d from gp; Radius : Real)
338 returns Pnt2d from gp;
339
340 EllipseValue (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real)
341 returns Pnt2d from gp;
342
343 HyperbolaValue (U : Real; Pos : Ax22d from gp;
344 MajorRadius, MinorRadius : Real)
345 returns Pnt2d from gp;
346
347 ParabolaValue (U : Real; Pos : Ax22d from gp; Focal : Real)
348 returns Pnt2d from gp;
349
350 LineD1 (U : Real; Pos : Ax2d from gp; P : out Pnt2d from gp;
351 V1 : out Vec2d from gp);
352
353 CircleD1 (U : Real; Pos : Ax22d from gp; Radius : Real;
354 P : out Pnt2d from gp; V1 : out Vec2d from gp);
355
356 EllipseD1 (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
357 P : out Pnt2d from gp; V1 : out Vec2d from gp);
358
359 HyperbolaD1 (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
360 P : out Pnt2d from gp; V1 : out Vec2d from gp);
361
362 ParabolaD1 (U : Real; Pos : Ax22d from gp; Focal : Real;
363 P : out Pnt2d from gp; V1 : out Vec2d from gp);
364
365 CircleD2 (U : Real; Pos : Ax22d from gp; Radius : Real;
366 P : out Pnt2d from gp; V1, V2 : out Vec2d from gp);
367
368 EllipseD2 (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
369 P : out Pnt2d from gp; V1, V2 : out Vec2d from gp);
370
371 HyperbolaD2 (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
372 P : out Pnt2d from gp; V1, V2 : out Vec2d from gp);
373
374 ParabolaD2 (U : Real; Pos : Ax22d from gp; Focal : Real;
375 P : out Pnt2d from gp; V1, V2 : out Vec2d from gp);
376
377 CircleD3 (U : Real; Pos : Ax22d from gp; Radius : Real;
378 P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp);
379
380 EllipseD3 (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
381 P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp);
382
383 HyperbolaD3 (U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
384 P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp);
385
386 --- Purpose :
387 -- In the following functions N is the order of derivation
388 -- and should be greater than 0
389
390 LineDN (U : Real; Pos : Ax2d from gp; N : Integer)
391 returns Vec2d from gp;
392
393 CircleDN (U : Real; Pos : Ax22d from gp; Radius : Real; N : Integer)
394 returns Vec2d from gp;
395
396 EllipseDN (
397 U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
398 N : Integer)
399 returns Vec2d from gp;
400
401 HyperbolaDN (
402 U : Real; Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
403 N : Integer)
404 returns Vec2d from gp;
405
406 ParabolaDN (U : Real; Pos : Ax22d from gp; Focal : Real; N : Integer)
407 returns Vec2d from gp;
408
409
410
411
412 --- Purpose :
413 -- The following functions compute the parametric value corresponding
414 -- to a given point on a elementary curve. The point should be on the
415 -- curve.
416
417
418 Parameter (L : Lin from gp; P : Pnt from gp) returns Real;
419 ---Purpose:
420 -- Computes the parameter value of the point P on the given curve.
421 -- Note: In its local coordinate system, the parametric
422 -- equation of the curve is given by the following:
423 -- - for the line L: P(U) = Po + U*Vo
424 -- where Po is the origin and Vo the unit vector of its positioning axis.
425 -- - for the circle C: X(U) = Radius*Cos(U), Y(U) = Radius*Sin(U)
426 -- - for the ellipse E: X(U) = MajorRadius*Cos(U). Y(U) = MinorRadius*Sin(U)
427 -- - for the hyperbola H: X(U) = MajorRadius*Ch(U), Y(U) = MinorRadius*Sh(U)
428 -- - for the parabola Prb:
429 -- X(U) = U**2 / (2*p)
430 -- Y(U) = U
431 -- where p is the distance between the focus and the directrix.
432 -- Warning
433 -- The point P must be on the curve. These functions are
434 -- not protected, however, and if point P is not on the
435 -- curve, an exception may be raised.
436
437 Parameter (L : Lin2d from gp; P : Pnt2d from gp) returns Real;
438 ---C++: inline
439
440 --- Purpose : parametrization
441 -- P (U) = L.Location() + U * L.Direction()
442
443
444
445
446 Parameter (C : Circ from gp; P : Pnt from gp) returns Real;
447 ---C++: inline
448
449 Parameter (C : Circ2d from gp; P : Pnt2d from gp) returns Real;
450 ---C++: inline
451
452 --- Purpose : parametrization
453 -- In the local coordinate system of the circle
454 -- X (U) = Radius * Cos (U)
455 -- Y (U) = Radius * Sin (U)
456
457
458
459
460 Parameter (E : Elips from gp; P : Pnt from gp) returns Real;
461 ---C++: inline
462
463 Parameter (E : Elips2d from gp; P : Pnt2d from gp) returns Real;
464 ---C++: inline
465
466 --- Purpose : parametrization
467 -- In the local coordinate system of the Ellipse
468 -- X (U) = MajorRadius * Cos (U)
469 -- Y (U) = MinorRadius * Sin (U)
470
471
472 Parameter (H : Hypr from gp; P : Pnt from gp) returns Real;
473 ---C++: inline
474
475 Parameter (H : Hypr2d from gp; P : Pnt2d from gp) returns Real;
476 ---C++: inline
477
478 --- Purpose : parametrization
479 -- In the local coordinate system of the Hyperbola
480 -- X (U) = MajorRadius * Ch (U)
481 -- Y (U) = MinorRadius * Sh (U)
482
483
484 Parameter (Prb : Parab from gp; P : Pnt from gp) returns Real;
485 ---C++: inline
486
487 Parameter (Prb : Parab2d from gp; P : Pnt2d from gp) returns Real;
488 ---C++: inline
489
490 --- Purpose : parametrization
491 -- In the local coordinate system of the parabola
492 -- Y**2 = (2*P) * X where P is the distance between the focus
493 -- and the directrix.
494
495
496 LineParameter (Pos : Ax1 from gp; P : Pnt from gp) returns Real;
497
498 LineParameter (Pos : Ax2d from gp; P : Pnt2d from gp) returns Real;
499
500 --- Purpose : parametrization
501 -- P (U) = L.Location() + U * L.Direction()
502
503
504
505 CircleParameter (Pos : Ax2 from gp; P : Pnt from gp) returns Real;
506
507 CircleParameter (Pos : Ax22d from gp; P : Pnt2d from gp) returns Real;
508 --- Purpose : Pos is the Axis of the Circle
509
510 --- Purpose : parametrization
511 -- In the local coordinate system of the circle
512 -- X (U) = Radius * Cos (U)
513 -- Y (U) = Radius * Sin (U)
514
515
516
517 EllipseParameter (Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
518 P : Pnt from gp)
519 returns Real;
520
521 EllipseParameter (Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
522 P : Pnt2d from gp)
523 returns Real;
524 --- Purpose : Pos is the Axis of the Ellipse
525
526 --- Purpose : parametrization
527 -- In the local coordinate system of the Ellipse
528 -- X (U) = MajorRadius * Cos (U)
529 -- Y (U) = MinorRadius * Sin (U)
530
531
532 HyperbolaParameter (Pos : Ax2 from gp; MajorRadius, MinorRadius : Real;
533 P : Pnt from gp)
534 returns Real;
535
536 HyperbolaParameter (Pos : Ax22d from gp; MajorRadius, MinorRadius : Real;
537 P : Pnt2d from gp)
538 returns Real;
539 --- Purpose : Pos is the Axis of the Hyperbola
540
541 --- Purpose : parametrization
542 -- In the local coordinate system of the Hyperbola
543 -- X (U) = MajorRadius * Ch (U)
544 -- Y (U) = MinorRadius * Sh (U)
545
546
547 ParabolaParameter (Pos : Ax2 from gp; P : Pnt from gp) returns Real;
548
549 ParabolaParameter (Pos : Ax22d from gp; P : Pnt2d from gp) returns Real;
550 --- Purpose : Pos is the mirror axis of the parabola
551
552 --- Purpose : parametrization
553 -- In the local coordinate system of the parabola
554 -- Y**2 = (2*P) * X where P is the distance between the focus
555 -- and the directrix.
556
557
558
559
560 --- Purpose: The following functions build a 3d curve from a
561 -- 2d curve at a given position defined with an Ax2.
562
563
564 To3d (Pos : Ax2 from gp; P : Pnt2d from gp) returns Pnt from gp;
565
566 To3d (Pos : Ax2 from gp; V : Vec2d from gp) returns Vec from gp;
567
568 To3d (Pos : Ax2 from gp; V : Dir2d from gp) returns Dir from gp;
569
570 To3d (Pos : Ax2 from gp; A : Ax2d from gp) returns Ax1 from gp;
571
572 To3d (Pos : Ax2 from gp; A : Ax22d from gp) returns Ax2 from gp;
573
574 To3d (Pos : Ax2 from gp; L : Lin2d from gp) returns Lin from gp;
575
576 To3d (Pos : Ax2 from gp; C : Circ2d from gp) returns Circ from gp;
577
578 To3d (Pos : Ax2 from gp; E : Elips2d from gp) returns Elips from gp;
579
580 To3d (Pos : Ax2 from gp; H : Hypr2d from gp) returns Hypr from gp;
581
582 To3d (Pos : Ax2 from gp; Prb : Parab2d from gp) returns Parab from gp;
583
584
585 --- Purpose:
586 -- These functions build a 3D geometric entity from a 2D geometric entity.
587 -- The "X Axis" and the "Y Axis" of the global coordinate
588 -- system (i.e. 2D space) are lined up respectively with the
589 -- "X Axis" and "Y Axis" of the 3D coordinate system, Pos.
590
591end ElCLib;
592