0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / ElCLib / ElCLib.hxx
1 // Created on: 1991-09-10
2 // Created by: Michel Chauvat
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License 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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _ElCLib_HeaderFile
18 #define _ElCLib_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <gp_Pnt.hxx>
26 #include <Standard_Integer.hxx>
27 #include <gp_Vec.hxx>
28 #include <gp_Pnt2d.hxx>
29 #include <gp_Vec2d.hxx>
30 class gp_Pnt;
31 class gp_Lin;
32 class gp_Circ;
33 class gp_Elips;
34 class gp_Hypr;
35 class gp_Parab;
36 class gp_Vec;
37 class gp_Lin2d;
38 class gp_Circ2d;
39 class gp_Elips2d;
40 class gp_Hypr2d;
41 class gp_Parab2d;
42 class gp_Pnt2d;
43 class gp_Vec2d;
44 class gp_Ax1;
45 class gp_Ax2;
46 class gp_Ax2d;
47 class gp_Ax22d;
48 class gp_Dir;
49 class gp_Dir2d;
50
51
52 //! Provides functions for basic geometric computations on
53 //! elementary curves such as conics and lines in 2D and 3D space.
54 //! This includes:
55 //! -   calculation of a point or derived vector on a 2D or
56 //! 3D curve where:
57 //! -   the curve is provided by the gp package, or
58 //! defined in reference form (as in the gp package),
59 //! and
60 //! -   the point is defined by a parameter,
61 //! -   evaluation of the parameter corresponding to a point
62 //! on a 2D or 3D curve from gp,
63 //! -   various elementary computations which allow you to
64 //! position parameterized values within the period of a curve.
65 //! Notes:
66 //! -   ElCLib stands for Elementary Curves Library.
67 //! -   If the curves provided by the gp package are not
68 //! explicitly parameterized, they still have an implicit
69 //! parameterization, analogous to that which they infer
70 //! for the equivalent Geom or Geom2d curves.
71 class ElCLib 
72 {
73 public:
74
75   DEFINE_STANDARD_ALLOC
76
77   
78   //! Return a value in   the  range <UFirst, ULast>  by
79   //! adding or removing the period <ULast -  UFirst> to
80   //! <U>.
81   //! ATTENTION!!!
82   //!   It is expected but not checked that (ULast > UFirst)
83   Standard_EXPORT static Standard_Real InPeriod (const Standard_Real U, const Standard_Real UFirst, const Standard_Real ULast);
84   
85   //! Adjust U1 and  U2 in the  parametric range  UFirst
86   //! Ulast of a periodic curve, where ULast -
87   //! UFirst is its period. To do this, this function:
88   //! -   sets U1 in the range [ UFirst, ULast ] by
89   //! adding/removing the period to/from the value U1, then
90   //! -   sets U2 in the range [ U1, U1 + period ] by
91   //! adding/removing the period to/from the value U2.
92   //! Precision is used to test the equalities.
93   Standard_EXPORT static void AdjustPeriodic (const Standard_Real UFirst, const Standard_Real ULast, const Standard_Real Precision, Standard_Real& U1, Standard_Real& U2);
94   
95   //! For elementary curves (lines, circles and conics) from
96   //! the gp package, computes the point of parameter U.
97   //! The result is either:
98   //! -   a gp_Pnt point for a curve in 3D space, or
99   //! -   a gp_Pnt2d point for a curve in 2D space.
100   static gp_Pnt Value (const Standard_Real U, const gp_Lin& L);
101   
102   static gp_Pnt Value (const Standard_Real U, const gp_Circ& C);
103   
104   static gp_Pnt Value (const Standard_Real U, const gp_Elips& E);
105   
106   static gp_Pnt Value (const Standard_Real U, const gp_Hypr& H);
107   
108   static gp_Pnt Value (const Standard_Real U, const gp_Parab& Prb);
109
110   //! For elementary curves (lines, circles and conics) from the
111   //! gp package, computes:
112   //! -   the point P of parameter U, and
113   //! -   the first derivative vector V1 at this point.
114   //! The results P and V1 are either:
115   //! -   a gp_Pnt point and a gp_Vec vector, for a curve in 3D  space, or
116   //! -   a gp_Pnt2d point and a gp_Vec2d vector, for a curve in 2D space.
117   static void D1 (const Standard_Real U, const gp_Lin& L, gp_Pnt& P, gp_Vec& V1);
118   
119   static void D1 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1);
120   
121   static void D1 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1);
122   
123   static void D1 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1);
124   
125   static void D1 (const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1);
126   
127   //! For elementary curves (circles and conics) from the gp
128   //! package, computes:
129   //! - the point P of parameter U, and
130   //! - the first and second derivative vectors V1 and V2 at this point.
131   //! The results, P, V1 and V2, are either:
132   //! -   a gp_Pnt point and two gp_Vec vectors, for a curve in 3D space, or
133   //! -   a gp_Pnt2d point and two gp_Vec2d vectors, for a curve in 2D space.
134   static void D2 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
135   
136   static void D2 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
137   
138   static void D2 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
139   
140   static void D2 (const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
141   
142   //! For elementary curves (circles, ellipses and hyperbolae)
143   //! from the gp package, computes:
144   //! -   the point P of parameter U, and
145   //! -   the first, second and third derivative vectors V1, V2
146   //! and V3 at this point.
147   //! The results, P, V1, V2 and V3, are either:
148   //! -   a gp_Pnt point and three gp_Vec vectors, for a curve in 3D space, or
149   //! -   a gp_Pnt2d point and three gp_Vec2d vectors, for a curve in 2D space.
150   static void D3 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
151   
152   static void D3 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
153   
154   static void D3 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
155
156   //! For elementary curves (lines, circles and conics) from
157   //! the gp package, computes the vector corresponding to
158   //! the Nth derivative at the point of parameter U. The result is either:
159   //! -   a gp_Vec vector for a curve in 3D space, or
160   //! -   a gp_Vec2d vector for a curve in 2D space.
161   //! In the following functions N is the order of derivation
162   //! and should be greater than 0
163   static gp_Vec DN (const Standard_Real U, const gp_Lin& L, const Standard_Integer N);
164   
165   static gp_Vec DN (const Standard_Real U, const gp_Circ& C, const Standard_Integer N);
166   
167   static gp_Vec DN (const Standard_Real U, const gp_Elips& E, const Standard_Integer N);
168   
169   static gp_Vec DN (const Standard_Real U, const gp_Hypr& H, const Standard_Integer N);
170   
171   static gp_Vec DN (const Standard_Real U, const gp_Parab& Prb, const Standard_Integer N);
172   
173   static gp_Pnt2d Value (const Standard_Real U, const gp_Lin2d& L);
174   
175   static gp_Pnt2d Value (const Standard_Real U, const gp_Circ2d& C);
176   
177   static gp_Pnt2d Value (const Standard_Real U, const gp_Elips2d& E);
178   
179   static gp_Pnt2d Value (const Standard_Real U, const gp_Hypr2d& H);
180   
181   static gp_Pnt2d Value (const Standard_Real U, const gp_Parab2d& Prb);
182   
183   static void D1 (const Standard_Real U, const gp_Lin2d& L, gp_Pnt2d& P, gp_Vec2d& V1);
184
185   static void D1 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1);
186
187   static void D1 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1);
188
189   static void D1 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1);
190
191   static void D1 (const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1);
192
193   static void D2 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
194
195   static void D2 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
196
197   static void D2 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
198
199   static void D2 (const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
200
201   static void D3 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
202
203   static void D3 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
204
205   //! In the following functions N is the order of derivation
206   //! and should be greater than 0
207     static void D3 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
208   
209     static gp_Vec2d DN (const Standard_Real U, const gp_Lin2d& L, const Standard_Integer N);
210   
211     static gp_Vec2d DN (const Standard_Real U, const gp_Circ2d& C, const Standard_Integer N);
212   
213     static gp_Vec2d DN (const Standard_Real U, const gp_Elips2d& E, const Standard_Integer N);
214   
215     static gp_Vec2d DN (const Standard_Real U, const gp_Hypr2d& H, const Standard_Integer N);
216   
217     static gp_Vec2d DN (const Standard_Real U, const gp_Parab2d& Prb, const Standard_Integer N);
218   
219   //! Curve evaluation
220   //! The following basis functions compute the derivatives on
221   //! elementary curves defined by their geometric characteristics.
222   //! These functions can be called without constructing a conic
223   //! from package gp. They are called by the previous functions.
224   //! Example :
225   //! A circle is defined by its position and its radius.
226   Standard_EXPORT static gp_Pnt LineValue (const Standard_Real U, const gp_Ax1& Pos);
227   
228   Standard_EXPORT static gp_Pnt CircleValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius);
229   
230   Standard_EXPORT static gp_Pnt EllipseValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
231   
232   Standard_EXPORT static gp_Pnt HyperbolaValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
233   
234   Standard_EXPORT static gp_Pnt ParabolaValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal);
235   
236   Standard_EXPORT static void LineD1 (const Standard_Real U, const gp_Ax1& Pos, gp_Pnt& P, gp_Vec& V1);
237   
238   Standard_EXPORT static void CircleD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, gp_Pnt& P, gp_Vec& V1);
239   
240   Standard_EXPORT static void EllipseD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt& P, gp_Vec& V1);
241   
242   Standard_EXPORT static void HyperbolaD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt& P, gp_Vec& V1);
243   
244   Standard_EXPORT static void ParabolaD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, gp_Pnt& P, gp_Vec& V1);
245   
246   Standard_EXPORT static void CircleD2 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
247   
248   Standard_EXPORT static void EllipseD2 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
249   
250   Standard_EXPORT static void HyperbolaD2 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
251   
252   Standard_EXPORT static void ParabolaD2 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
253   
254   Standard_EXPORT static void CircleD3 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
255   
256   Standard_EXPORT static void EllipseD3 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
257   
258   Standard_EXPORT static void HyperbolaD3 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
259   
260
261   //! In the following functions N is the order of derivation
262   //! and should be greater than 0
263   Standard_EXPORT static gp_Vec LineDN (const Standard_Real U, const gp_Ax1& Pos, const Standard_Integer N);
264   
265   Standard_EXPORT static gp_Vec CircleDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, const Standard_Integer N);
266   
267   Standard_EXPORT static gp_Vec EllipseDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Integer N);
268   
269   Standard_EXPORT static gp_Vec HyperbolaDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Integer N);
270   
271   Standard_EXPORT static gp_Vec ParabolaDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, const Standard_Integer N);
272   
273   Standard_EXPORT static gp_Pnt2d LineValue (const Standard_Real U, const gp_Ax2d& Pos);
274   
275   Standard_EXPORT static gp_Pnt2d CircleValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius);
276   
277   Standard_EXPORT static gp_Pnt2d EllipseValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
278   
279   Standard_EXPORT static gp_Pnt2d HyperbolaValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
280   
281   Standard_EXPORT static gp_Pnt2d ParabolaValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal);
282   
283   Standard_EXPORT static void LineD1 (const Standard_Real U, const gp_Ax2d& Pos, gp_Pnt2d& P, gp_Vec2d& V1);
284   
285   Standard_EXPORT static void CircleD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, gp_Pnt2d& P, gp_Vec2d& V1);
286   
287   Standard_EXPORT static void EllipseD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt2d& P, gp_Vec2d& V1);
288   
289   Standard_EXPORT static void HyperbolaD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt2d& P, gp_Vec2d& V1);
290   
291   Standard_EXPORT static void ParabolaD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, gp_Pnt2d& P, gp_Vec2d& V1);
292   
293   Standard_EXPORT static void CircleD2 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
294   
295   Standard_EXPORT static void EllipseD2 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
296   
297   Standard_EXPORT static void HyperbolaD2 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
298   
299   Standard_EXPORT static void ParabolaD2 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
300   
301   Standard_EXPORT static void CircleD3 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
302   
303   Standard_EXPORT static void EllipseD3 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
304   
305
306   //! In the following functions N is the order of derivation
307   //! and should be greater than 0
308   Standard_EXPORT static void HyperbolaD3 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
309   
310   Standard_EXPORT static gp_Vec2d LineDN (const Standard_Real U, const gp_Ax2d& Pos, const Standard_Integer N);
311   
312   Standard_EXPORT static gp_Vec2d CircleDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, const Standard_Integer N);
313   
314   Standard_EXPORT static gp_Vec2d EllipseDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Integer N);
315   
316   Standard_EXPORT static gp_Vec2d HyperbolaDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Integer N);
317   
318
319   //! The following functions compute the parametric value corresponding
320   //! to a given point on a elementary curve. The point should be on the
321   //! curve.
322   Standard_EXPORT static gp_Vec2d ParabolaDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, const Standard_Integer N);
323   
324
325   //! Computes the parameter value of the point P on the given curve.
326   //! Note: In its local coordinate system, the parametric
327   //! equation of the curve is given by the following:
328   //! -   for the line L: P(U) = Po + U*Vo
329   //! where Po is the origin and Vo the unit vector of its positioning axis.
330   //! -   for the circle C: X(U) = Radius*Cos(U), Y(U) = Radius*Sin(U)
331   //! -   for the ellipse E: X(U) = MajorRadius*Cos(U). Y(U) = MinorRadius*Sin(U)
332   //! -   for the hyperbola H: X(U) = MajorRadius*Ch(U), Y(U) = MinorRadius*Sh(U)
333   //! -   for the parabola Prb:
334   //! X(U) = U**2 / (2*p)
335   //! Y(U) = U
336   //! where p is the distance between the focus and the directrix.
337   //! Warning
338   //! The point P must be on the curve. These functions are
339   //! not protected, however, and if point P is not on the
340   //! curve, an exception may be raised.
341   static Standard_Real Parameter (const gp_Lin& L, const gp_Pnt& P);
342   
343   //! parametrization
344   //! P (U) = L.Location() + U * L.Direction()
345     static Standard_Real Parameter (const gp_Lin2d& L, const gp_Pnt2d& P);
346   
347     static Standard_Real Parameter (const gp_Circ& C, const gp_Pnt& P);
348   
349   //! parametrization
350   //! In the local coordinate system of the circle
351   //! X (U) = Radius * Cos (U)
352   //! Y (U) = Radius * Sin (U)
353     static Standard_Real Parameter (const gp_Circ2d& C, const gp_Pnt2d& P);
354   
355     static Standard_Real Parameter (const gp_Elips& E, const gp_Pnt& P);
356   
357   //! parametrization
358   //! In the local coordinate system of the Ellipse
359   //! X (U) = MajorRadius * Cos (U)
360   //! Y (U) = MinorRadius * Sin (U)
361     static Standard_Real Parameter (const gp_Elips2d& E, const gp_Pnt2d& P);
362   
363     static Standard_Real Parameter (const gp_Hypr& H, const gp_Pnt& P);
364   
365   //! parametrization
366   //! In the local coordinate system of the Hyperbola
367   //! X (U) = MajorRadius * Ch (U)
368   //! Y (U) = MinorRadius * Sh (U)
369     static Standard_Real Parameter (const gp_Hypr2d& H, const gp_Pnt2d& P);
370   
371     static Standard_Real Parameter (const gp_Parab& Prb, const gp_Pnt& P);
372   
373   //! parametrization
374   //! In the local coordinate system of the parabola
375   //! Y**2 = (2*P) * X where P is the distance between the focus
376   //! and the directrix.
377     static Standard_Real Parameter (const gp_Parab2d& Prb, const gp_Pnt2d& P);
378   
379   Standard_EXPORT static Standard_Real LineParameter (const gp_Ax1& Pos, const gp_Pnt& P);
380   
381   //! parametrization
382   //! P (U) = L.Location() + U * L.Direction()
383   Standard_EXPORT static Standard_Real LineParameter (const gp_Ax2d& Pos, const gp_Pnt2d& P);
384   
385   Standard_EXPORT static Standard_Real CircleParameter (const gp_Ax2& Pos, const gp_Pnt& P);
386   
387   //! Pos is the Axis of the Circle
388   //! parametrization
389   //! In the local coordinate system of the circle
390   //! X (U) = Radius * Cos (U)
391   //! Y (U) = Radius * Sin (U)
392   Standard_EXPORT static Standard_Real CircleParameter (const gp_Ax22d& Pos, const gp_Pnt2d& P);
393   
394   Standard_EXPORT static Standard_Real EllipseParameter (const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt& P);
395   
396   //! Pos is the Axis of the Ellipse
397   //! parametrization
398   //! In the local coordinate system of the Ellipse
399   //! X (U) = MajorRadius * Cos (U)
400   //! Y (U) = MinorRadius * Sin (U)
401   Standard_EXPORT static Standard_Real EllipseParameter (const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt2d& P);
402   
403   Standard_EXPORT static Standard_Real HyperbolaParameter (const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt& P);
404   
405   //! Pos is the Axis of the Hyperbola
406   //! parametrization
407   //! In the local coordinate system of the Hyperbola
408   //! X (U) = MajorRadius * Ch (U)
409   //! Y (U) = MinorRadius * Sh (U)
410   Standard_EXPORT static Standard_Real HyperbolaParameter (const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt2d& P);
411   
412   Standard_EXPORT static Standard_Real ParabolaParameter (const gp_Ax2& Pos, const gp_Pnt& P);
413   
414   //! Pos is the mirror axis of the parabola
415   //! parametrization
416   //! In the local coordinate system of the parabola
417   //! Y**2 = (2*P) * X where P is the distance between the focus
418   //! and the directrix.
419   //! The following functions build  a 3d curve from a
420   //! 2d curve at a given position defined with an Ax2.
421   Standard_EXPORT static Standard_Real ParabolaParameter (const gp_Ax22d& Pos, const gp_Pnt2d& P);
422   
423   Standard_EXPORT static gp_Pnt To3d (const gp_Ax2& Pos, const gp_Pnt2d& P);
424   
425   Standard_EXPORT static gp_Vec To3d (const gp_Ax2& Pos, const gp_Vec2d& V);
426   
427   Standard_EXPORT static gp_Dir To3d (const gp_Ax2& Pos, const gp_Dir2d& V);
428   
429   Standard_EXPORT static gp_Ax1 To3d (const gp_Ax2& Pos, const gp_Ax2d& A);
430   
431   Standard_EXPORT static gp_Ax2 To3d (const gp_Ax2& Pos, const gp_Ax22d& A);
432   
433   Standard_EXPORT static gp_Lin To3d (const gp_Ax2& Pos, const gp_Lin2d& L);
434   
435   Standard_EXPORT static gp_Circ To3d (const gp_Ax2& Pos, const gp_Circ2d& C);
436   
437   Standard_EXPORT static gp_Elips To3d (const gp_Ax2& Pos, const gp_Elips2d& E);
438   
439   Standard_EXPORT static gp_Hypr To3d (const gp_Ax2& Pos, const gp_Hypr2d& H);
440   
441
442   //! These functions build a 3D geometric entity from a 2D geometric entity.
443   //! The "X Axis" and the "Y Axis" of the global coordinate
444   //! system (i.e. 2D space) are lined up respectively with the
445   //! "X Axis" and "Y Axis" of the 3D coordinate system, Pos.
446   Standard_EXPORT static gp_Parab To3d (const gp_Ax2& Pos, const gp_Parab2d& Prb);
447
448
449
450
451 protected:
452
453
454
455
456
457 private:
458
459
460
461
462
463 };
464
465
466 #include <ElCLib.lxx>
467
468
469
470
471
472 #endif // _ElCLib_HeaderFile