0027431: [Regression to 6.9.1] Huge tolerance obtained during intersection of cylinde...
[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   Standard_EXPORT 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
111   //! For elementary curves (lines, circles and conics) from the
112   //! gp package, computes:
113   //! -   the point P of parameter U, and
114   //! -   the first derivative vector V1 at this point.
115   //! The results P and V1 are either:
116   //! -   a gp_Pnt point and a gp_Vec vector, for a curve in 3D  space, or
117   //! -   a gp_Pnt2d point and a gp_Vec2d vector, for a curve in 2D space.
118   Standard_EXPORT static void D1 (const Standard_Real U, const gp_Lin& L, gp_Pnt& P, gp_Vec& V1);
119   
120     static void D1 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1);
121   
122     static void D1 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1);
123   
124     static void D1 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1);
125   
126     static void D1 (const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1);
127   
128   //! For elementary curves (circles and conics) from the gp
129   //! package, computes:
130   //! - the point P of parameter U, and
131   //! - the first and second derivative vectors V1 and V2 at this point.
132   //! The results, P, V1 and V2, are either:
133   //! -   a gp_Pnt point and two gp_Vec vectors, for a curve in 3D space, or
134   //! -   a gp_Pnt2d point and two gp_Vec2d vectors, for a curve in 2D space.
135   Standard_EXPORT static void D2 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
136   
137     static void D2 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
138   
139     static void D2 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
140   
141     static void D2 (const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
142   
143   //! For elementary curves (circles, ellipses and hyperbolae)
144   //! from the gp package, computes:
145   //! -   the point P of parameter U, and
146   //! -   the first, second and third derivative vectors V1, V2
147   //! and V3 at this point.
148   //! The results, P, V1, V2 and V3, are either:
149   //! -   a gp_Pnt point and three gp_Vec vectors, for a curve in 3D space, or
150   //! -   a gp_Pnt2d point and three gp_Vec2d vectors, for a curve in 2D space.
151   Standard_EXPORT static void D3 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
152   
153     static void D3 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
154   
155   Standard_EXPORT static void D3 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
156   
157
158   //! For elementary curves (lines, circles and conics) from
159   //! the gp package, computes the vector corresponding to
160   //! the Nth derivative at the point of parameter U. The result is either:
161   //! -   a gp_Vec vector for a curve in 3D space, or
162   //! -   a gp_Vec2d vector for a curve in 2D space.
163   //! In the following functions N is the order of derivation
164   //! and should be greater than 0
165   Standard_EXPORT static gp_Vec DN (const Standard_Real U, const gp_Lin& L, const Standard_Integer N);
166   
167     static gp_Vec DN (const Standard_Real U, const gp_Circ& C, const Standard_Integer N);
168   
169     static gp_Vec DN (const Standard_Real U, const gp_Elips& E, const Standard_Integer N);
170   
171     static gp_Vec DN (const Standard_Real U, const gp_Hypr& H, const Standard_Integer N);
172   
173     static gp_Vec DN (const Standard_Real U, const gp_Parab& Prb, const Standard_Integer N);
174   
175     static gp_Pnt2d Value (const Standard_Real U, const gp_Lin2d& L);
176   
177     static gp_Pnt2d Value (const Standard_Real U, const gp_Circ2d& C);
178   
179     static gp_Pnt2d Value (const Standard_Real U, const gp_Elips2d& E);
180   
181     static gp_Pnt2d Value (const Standard_Real U, const gp_Hypr2d& H);
182   
183     static gp_Pnt2d Value (const Standard_Real U, const gp_Parab2d& Prb);
184   
185     static void D1 (const Standard_Real U, const gp_Lin2d& L, gp_Pnt2d& P, gp_Vec2d& V1);
186   
187     static void D1 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1);
188   
189     static void D1 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1);
190   
191     static void D1 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1);
192   
193     static void D1 (const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1);
194   
195     static void D2 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
196   
197     static void D2 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
198   
199     static void D2 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
200   
201     static void D2 (const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
202   
203     static void D3 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
204   
205     static void D3 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
206   
207
208   //! In the following functions N is the order of derivation
209   //! and should be greater than 0
210     static void D3 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
211   
212     static gp_Vec2d DN (const Standard_Real U, const gp_Lin2d& L, const Standard_Integer N);
213   
214     static gp_Vec2d DN (const Standard_Real U, const gp_Circ2d& C, const Standard_Integer N);
215   
216     static gp_Vec2d DN (const Standard_Real U, const gp_Elips2d& E, const Standard_Integer N);
217   
218     static gp_Vec2d DN (const Standard_Real U, const gp_Hypr2d& H, const Standard_Integer N);
219   
220     static gp_Vec2d DN (const Standard_Real U, const gp_Parab2d& Prb, const Standard_Integer N);
221   
222   //! Curve evaluation
223   //! The following basis functions compute the derivatives on
224   //! elementary curves defined by their geometric characteristics.
225   //! These functions can be called without constructing a conic
226   //! from package gp. They are called by the previous functions.
227   //! Example :
228   //! A circle is defined by its position and its radius.
229   Standard_EXPORT static gp_Pnt LineValue (const Standard_Real U, const gp_Ax1& Pos);
230   
231   Standard_EXPORT static gp_Pnt CircleValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius);
232   
233   Standard_EXPORT static gp_Pnt EllipseValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
234   
235   Standard_EXPORT static gp_Pnt HyperbolaValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
236   
237   Standard_EXPORT static gp_Pnt ParabolaValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal);
238   
239   Standard_EXPORT static void LineD1 (const Standard_Real U, const gp_Ax1& Pos, gp_Pnt& P, gp_Vec& V1);
240   
241   Standard_EXPORT static void CircleD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, gp_Pnt& P, gp_Vec& V1);
242   
243   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);
244   
245   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);
246   
247   Standard_EXPORT static void ParabolaD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, gp_Pnt& P, gp_Vec& V1);
248   
249   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);
250   
251   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);
252   
253   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);
254   
255   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);
256   
257   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);
258   
259   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);
260   
261   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);
262   
263
264   //! In the following functions N is the order of derivation
265   //! and should be greater than 0
266   Standard_EXPORT static gp_Vec LineDN (const Standard_Real U, const gp_Ax1& Pos, const Standard_Integer N);
267   
268   Standard_EXPORT static gp_Vec CircleDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, const Standard_Integer N);
269   
270   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);
271   
272   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);
273   
274   Standard_EXPORT static gp_Vec ParabolaDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, const Standard_Integer N);
275   
276   Standard_EXPORT static gp_Pnt2d LineValue (const Standard_Real U, const gp_Ax2d& Pos);
277   
278   Standard_EXPORT static gp_Pnt2d CircleValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius);
279   
280   Standard_EXPORT static gp_Pnt2d EllipseValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
281   
282   Standard_EXPORT static gp_Pnt2d HyperbolaValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
283   
284   Standard_EXPORT static gp_Pnt2d ParabolaValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal);
285   
286   Standard_EXPORT static void LineD1 (const Standard_Real U, const gp_Ax2d& Pos, gp_Pnt2d& P, gp_Vec2d& V1);
287   
288   Standard_EXPORT static void CircleD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, gp_Pnt2d& P, gp_Vec2d& V1);
289   
290   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);
291   
292   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);
293   
294   Standard_EXPORT static void ParabolaD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, gp_Pnt2d& P, gp_Vec2d& V1);
295   
296   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);
297   
298   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);
299   
300   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);
301   
302   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);
303   
304   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);
305   
306   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);
307   
308
309   //! In the following functions N is the order of derivation
310   //! and should be greater than 0
311   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);
312   
313   Standard_EXPORT static gp_Vec2d LineDN (const Standard_Real U, const gp_Ax2d& Pos, const Standard_Integer N);
314   
315   Standard_EXPORT static gp_Vec2d CircleDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, const Standard_Integer N);
316   
317   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);
318   
319   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);
320   
321
322   //! The following functions compute the parametric value corresponding
323   //! to a given point on a elementary curve. The point should be on the
324   //! curve.
325   Standard_EXPORT static gp_Vec2d ParabolaDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, const Standard_Integer N);
326   
327
328   //! Computes the parameter value of the point P on the given curve.
329   //! Note: In its local coordinate system, the parametric
330   //! equation of the curve is given by the following:
331   //! -   for the line L: P(U) = Po + U*Vo
332   //! where Po is the origin and Vo the unit vector of its positioning axis.
333   //! -   for the circle C: X(U) = Radius*Cos(U), Y(U) = Radius*Sin(U)
334   //! -   for the ellipse E: X(U) = MajorRadius*Cos(U). Y(U) = MinorRadius*Sin(U)
335   //! -   for the hyperbola H: X(U) = MajorRadius*Ch(U), Y(U) = MinorRadius*Sh(U)
336   //! -   for the parabola Prb:
337   //! X(U) = U**2 / (2*p)
338   //! Y(U) = U
339   //! where p is the distance between the focus and the directrix.
340   //! Warning
341   //! The point P must be on the curve. These functions are
342   //! not protected, however, and if point P is not on the
343   //! curve, an exception may be raised.
344   static Standard_Real Parameter (const gp_Lin& L, const gp_Pnt& P);
345   
346   //! parametrization
347   //! P (U) = L.Location() + U * L.Direction()
348     static Standard_Real Parameter (const gp_Lin2d& L, const gp_Pnt2d& P);
349   
350     static Standard_Real Parameter (const gp_Circ& C, const gp_Pnt& P);
351   
352   //! parametrization
353   //! In the local coordinate system of the circle
354   //! X (U) = Radius * Cos (U)
355   //! Y (U) = Radius * Sin (U)
356     static Standard_Real Parameter (const gp_Circ2d& C, const gp_Pnt2d& P);
357   
358     static Standard_Real Parameter (const gp_Elips& E, const gp_Pnt& P);
359   
360   //! parametrization
361   //! In the local coordinate system of the Ellipse
362   //! X (U) = MajorRadius * Cos (U)
363   //! Y (U) = MinorRadius * Sin (U)
364     static Standard_Real Parameter (const gp_Elips2d& E, const gp_Pnt2d& P);
365   
366     static Standard_Real Parameter (const gp_Hypr& H, const gp_Pnt& P);
367   
368   //! parametrization
369   //! In the local coordinate system of the Hyperbola
370   //! X (U) = MajorRadius * Ch (U)
371   //! Y (U) = MinorRadius * Sh (U)
372     static Standard_Real Parameter (const gp_Hypr2d& H, const gp_Pnt2d& P);
373   
374     static Standard_Real Parameter (const gp_Parab& Prb, const gp_Pnt& P);
375   
376   //! parametrization
377   //! In the local coordinate system of the parabola
378   //! Y**2 = (2*P) * X where P is the distance between the focus
379   //! and the directrix.
380     static Standard_Real Parameter (const gp_Parab2d& Prb, const gp_Pnt2d& P);
381   
382   Standard_EXPORT static Standard_Real LineParameter (const gp_Ax1& Pos, const gp_Pnt& P);
383   
384   //! parametrization
385   //! P (U) = L.Location() + U * L.Direction()
386   Standard_EXPORT static Standard_Real LineParameter (const gp_Ax2d& Pos, const gp_Pnt2d& P);
387   
388   Standard_EXPORT static Standard_Real CircleParameter (const gp_Ax2& Pos, const gp_Pnt& P);
389   
390   //! Pos is the Axis of the Circle
391   //! parametrization
392   //! In the local coordinate system of the circle
393   //! X (U) = Radius * Cos (U)
394   //! Y (U) = Radius * Sin (U)
395   Standard_EXPORT static Standard_Real CircleParameter (const gp_Ax22d& Pos, const gp_Pnt2d& P);
396   
397   Standard_EXPORT static Standard_Real EllipseParameter (const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt& P);
398   
399   //! Pos is the Axis of the Ellipse
400   //! parametrization
401   //! In the local coordinate system of the Ellipse
402   //! X (U) = MajorRadius * Cos (U)
403   //! Y (U) = MinorRadius * Sin (U)
404   Standard_EXPORT static Standard_Real EllipseParameter (const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt2d& P);
405   
406   Standard_EXPORT static Standard_Real HyperbolaParameter (const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt& P);
407   
408   //! Pos is the Axis of the Hyperbola
409   //! parametrization
410   //! In the local coordinate system of the Hyperbola
411   //! X (U) = MajorRadius * Ch (U)
412   //! Y (U) = MinorRadius * Sh (U)
413   Standard_EXPORT static Standard_Real HyperbolaParameter (const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt2d& P);
414   
415   Standard_EXPORT static Standard_Real ParabolaParameter (const gp_Ax2& Pos, const gp_Pnt& P);
416   
417   //! Pos is the mirror axis of the parabola
418   //! parametrization
419   //! In the local coordinate system of the parabola
420   //! Y**2 = (2*P) * X where P is the distance between the focus
421   //! and the directrix.
422   //! The following functions build  a 3d curve from a
423   //! 2d curve at a given position defined with an Ax2.
424   Standard_EXPORT static Standard_Real ParabolaParameter (const gp_Ax22d& Pos, const gp_Pnt2d& P);
425   
426   Standard_EXPORT static gp_Pnt To3d (const gp_Ax2& Pos, const gp_Pnt2d& P);
427   
428   Standard_EXPORT static gp_Vec To3d (const gp_Ax2& Pos, const gp_Vec2d& V);
429   
430   Standard_EXPORT static gp_Dir To3d (const gp_Ax2& Pos, const gp_Dir2d& V);
431   
432   Standard_EXPORT static gp_Ax1 To3d (const gp_Ax2& Pos, const gp_Ax2d& A);
433   
434   Standard_EXPORT static gp_Ax2 To3d (const gp_Ax2& Pos, const gp_Ax22d& A);
435   
436   Standard_EXPORT static gp_Lin To3d (const gp_Ax2& Pos, const gp_Lin2d& L);
437   
438   Standard_EXPORT static gp_Circ To3d (const gp_Ax2& Pos, const gp_Circ2d& C);
439   
440   Standard_EXPORT static gp_Elips To3d (const gp_Ax2& Pos, const gp_Elips2d& E);
441   
442   Standard_EXPORT static gp_Hypr To3d (const gp_Ax2& Pos, const gp_Hypr2d& H);
443   
444
445   //! These functions build a 3D geometric entity from a 2D geometric entity.
446   //! The "X Axis" and the "Y Axis" of the global coordinate
447   //! system (i.e. 2D space) are lined up respectively with the
448   //! "X Axis" and "Y Axis" of the 3D coordinate system, Pos.
449   Standard_EXPORT static gp_Parab To3d (const gp_Ax2& Pos, const gp_Parab2d& Prb);
450
451
452
453
454 protected:
455
456
457
458
459
460 private:
461
462
463
464
465
466 };
467
468
469 #include <ElCLib.lxx>
470
471
472
473
474
475 #endif // _ElCLib_HeaderFile