Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:26

0001 // Created on: 1991-09-10
0002 // Created by: Michel Chauvat
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ElCLib_HeaderFile
0018 #define _ElCLib_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Pnt.hxx>
0025 #include <gp_Vec.hxx>
0026 #include <gp_Pnt2d.hxx>
0027 #include <gp_Vec2d.hxx>
0028 class gp_Pnt;
0029 class gp_Lin;
0030 class gp_Circ;
0031 class gp_Elips;
0032 class gp_Hypr;
0033 class gp_Parab;
0034 class gp_Vec;
0035 class gp_Lin2d;
0036 class gp_Circ2d;
0037 class gp_Elips2d;
0038 class gp_Hypr2d;
0039 class gp_Parab2d;
0040 class gp_Pnt2d;
0041 class gp_Vec2d;
0042 class gp_Ax1;
0043 class gp_Ax2;
0044 class gp_Ax2d;
0045 class gp_Ax22d;
0046 class gp_Dir;
0047 class gp_Dir2d;
0048 
0049 
0050 //! Provides functions for basic geometric computations on
0051 //! elementary curves such as conics and lines in 2D and 3D space.
0052 //! This includes:
0053 //! -   calculation of a point or derived vector on a 2D or
0054 //! 3D curve where:
0055 //! -   the curve is provided by the gp package, or
0056 //! defined in reference form (as in the gp package),
0057 //! and
0058 //! -   the point is defined by a parameter,
0059 //! -   evaluation of the parameter corresponding to a point
0060 //! on a 2D or 3D curve from gp,
0061 //! -   various elementary computations which allow you to
0062 //! position parameterized values within the period of a curve.
0063 //! Notes:
0064 //! -   ElCLib stands for Elementary Curves Library.
0065 //! -   If the curves provided by the gp package are not
0066 //! explicitly parameterized, they still have an implicit
0067 //! parameterization, analogous to that which they infer
0068 //! for the equivalent Geom or Geom2d curves.
0069 class ElCLib 
0070 {
0071 public:
0072 
0073   DEFINE_STANDARD_ALLOC
0074 
0075   
0076   //! Return a value in   the  range <UFirst, ULast>  by
0077   //! adding or removing the period <ULast -  UFirst> to
0078   //! <U>.
0079   //! ATTENTION!!!
0080   //!   It is expected but not checked that (ULast > UFirst)
0081   Standard_EXPORT static Standard_Real InPeriod (const Standard_Real U, const Standard_Real UFirst, const Standard_Real ULast);
0082   
0083   //! Adjust U1 and  U2 in the  parametric range  UFirst
0084   //! Ulast of a periodic curve, where ULast -
0085   //! UFirst is its period. To do this, this function:
0086   //! -   sets U1 in the range [ UFirst, ULast ] by
0087   //! adding/removing the period to/from the value U1, then
0088   //! -   sets U2 in the range [ U1, U1 + period ] by
0089   //! adding/removing the period to/from the value U2.
0090   //! Precision is used to test the equalities.
0091   Standard_EXPORT static void AdjustPeriodic (const Standard_Real UFirst, const Standard_Real ULast, const Standard_Real Precision, Standard_Real& U1, Standard_Real& U2);
0092   
0093   //! For elementary curves (lines, circles and conics) from
0094   //! the gp package, computes the point of parameter U.
0095   //! The result is either:
0096   //! -   a gp_Pnt point for a curve in 3D space, or
0097   //! -   a gp_Pnt2d point for a curve in 2D space.
0098   static gp_Pnt Value (const Standard_Real U, const gp_Lin& L);
0099   
0100   static gp_Pnt Value (const Standard_Real U, const gp_Circ& C);
0101   
0102   static gp_Pnt Value (const Standard_Real U, const gp_Elips& E);
0103   
0104   static gp_Pnt Value (const Standard_Real U, const gp_Hypr& H);
0105   
0106   static gp_Pnt Value (const Standard_Real U, const gp_Parab& Prb);
0107 
0108   //! For elementary curves (lines, circles and conics) from the
0109   //! gp package, computes:
0110   //! -   the point P of parameter U, and
0111   //! -   the first derivative vector V1 at this point.
0112   //! The results P and V1 are either:
0113   //! -   a gp_Pnt point and a gp_Vec vector, for a curve in 3D  space, or
0114   //! -   a gp_Pnt2d point and a gp_Vec2d vector, for a curve in 2D space.
0115   static void D1 (const Standard_Real U, const gp_Lin& L, gp_Pnt& P, gp_Vec& V1);
0116   
0117   static void D1 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1);
0118   
0119   static void D1 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1);
0120   
0121   static void D1 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1);
0122   
0123   static void D1 (const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1);
0124   
0125   //! For elementary curves (circles and conics) from the gp
0126   //! package, computes:
0127   //! - the point P of parameter U, and
0128   //! - the first and second derivative vectors V1 and V2 at this point.
0129   //! The results, P, V1 and V2, are either:
0130   //! -   a gp_Pnt point and two gp_Vec vectors, for a curve in 3D space, or
0131   //! -   a gp_Pnt2d point and two gp_Vec2d vectors, for a curve in 2D space.
0132   static void D2 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0133   
0134   static void D2 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0135   
0136   static void D2 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0137   
0138   static void D2 (const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0139   
0140   //! For elementary curves (circles, ellipses and hyperbolae)
0141   //! from the gp package, computes:
0142   //! -   the point P of parameter U, and
0143   //! -   the first, second and third derivative vectors V1, V2
0144   //! and V3 at this point.
0145   //! The results, P, V1, V2 and V3, are either:
0146   //! -   a gp_Pnt point and three gp_Vec vectors, for a curve in 3D space, or
0147   //! -   a gp_Pnt2d point and three gp_Vec2d vectors, for a curve in 2D space.
0148   static void D3 (const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0149   
0150   static void D3 (const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0151   
0152   static void D3 (const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0153 
0154   //! For elementary curves (lines, circles and conics) from
0155   //! the gp package, computes the vector corresponding to
0156   //! the Nth derivative at the point of parameter U. The result is either:
0157   //! -   a gp_Vec vector for a curve in 3D space, or
0158   //! -   a gp_Vec2d vector for a curve in 2D space.
0159   //! In the following functions N is the order of derivation
0160   //! and should be greater than 0
0161   static gp_Vec DN (const Standard_Real U, const gp_Lin& L, const Standard_Integer N);
0162   
0163   static gp_Vec DN (const Standard_Real U, const gp_Circ& C, const Standard_Integer N);
0164   
0165   static gp_Vec DN (const Standard_Real U, const gp_Elips& E, const Standard_Integer N);
0166   
0167   static gp_Vec DN (const Standard_Real U, const gp_Hypr& H, const Standard_Integer N);
0168   
0169   static gp_Vec DN (const Standard_Real U, const gp_Parab& Prb, const Standard_Integer N);
0170   
0171   static gp_Pnt2d Value (const Standard_Real U, const gp_Lin2d& L);
0172   
0173   static gp_Pnt2d Value (const Standard_Real U, const gp_Circ2d& C);
0174   
0175   static gp_Pnt2d Value (const Standard_Real U, const gp_Elips2d& E);
0176   
0177   static gp_Pnt2d Value (const Standard_Real U, const gp_Hypr2d& H);
0178   
0179   static gp_Pnt2d Value (const Standard_Real U, const gp_Parab2d& Prb);
0180   
0181   static void D1 (const Standard_Real U, const gp_Lin2d& L, gp_Pnt2d& P, gp_Vec2d& V1);
0182 
0183   static void D1 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1);
0184 
0185   static void D1 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1);
0186 
0187   static void D1 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1);
0188 
0189   static void D1 (const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1);
0190 
0191   static void D2 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0192 
0193   static void D2 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0194 
0195   static void D2 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0196 
0197   static void D2 (const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0198 
0199   static void D3 (const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
0200 
0201   static void D3 (const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
0202 
0203   //! In the following functions N is the order of derivation
0204   //! and should be greater than 0
0205     static void D3 (const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
0206   
0207     static gp_Vec2d DN (const Standard_Real U, const gp_Lin2d& L, const Standard_Integer N);
0208   
0209     static gp_Vec2d DN (const Standard_Real U, const gp_Circ2d& C, const Standard_Integer N);
0210   
0211     static gp_Vec2d DN (const Standard_Real U, const gp_Elips2d& E, const Standard_Integer N);
0212   
0213     static gp_Vec2d DN (const Standard_Real U, const gp_Hypr2d& H, const Standard_Integer N);
0214   
0215     static gp_Vec2d DN (const Standard_Real U, const gp_Parab2d& Prb, const Standard_Integer N);
0216   
0217   //! Curve evaluation
0218   //! The following basis functions compute the derivatives on
0219   //! elementary curves defined by their geometric characteristics.
0220   //! These functions can be called without constructing a conic
0221   //! from package gp. They are called by the previous functions.
0222   //! Example :
0223   //! A circle is defined by its position and its radius.
0224   Standard_EXPORT static gp_Pnt LineValue (const Standard_Real U, const gp_Ax1& Pos);
0225   
0226   Standard_EXPORT static gp_Pnt CircleValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius);
0227   
0228   Standard_EXPORT static gp_Pnt EllipseValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
0229   
0230   Standard_EXPORT static gp_Pnt HyperbolaValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
0231   
0232   Standard_EXPORT static gp_Pnt ParabolaValue (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal);
0233   
0234   Standard_EXPORT static void LineD1 (const Standard_Real U, const gp_Ax1& Pos, gp_Pnt& P, gp_Vec& V1);
0235   
0236   Standard_EXPORT static void CircleD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, gp_Pnt& P, gp_Vec& V1);
0237   
0238   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);
0239   
0240   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);
0241   
0242   Standard_EXPORT static void ParabolaD1 (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, gp_Pnt& P, gp_Vec& V1);
0243   
0244   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);
0245   
0246   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);
0247   
0248   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);
0249   
0250   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);
0251   
0252   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);
0253   
0254   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);
0255   
0256   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);
0257   
0258 
0259   //! In the following functions N is the order of derivation
0260   //! and should be greater than 0
0261   Standard_EXPORT static gp_Vec LineDN (const Standard_Real U, const gp_Ax1& Pos, const Standard_Integer N);
0262   
0263   Standard_EXPORT static gp_Vec CircleDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Radius, const Standard_Integer N);
0264   
0265   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);
0266   
0267   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);
0268   
0269   Standard_EXPORT static gp_Vec ParabolaDN (const Standard_Real U, const gp_Ax2& Pos, const Standard_Real Focal, const Standard_Integer N);
0270   
0271   Standard_EXPORT static gp_Pnt2d LineValue (const Standard_Real U, const gp_Ax2d& Pos);
0272   
0273   Standard_EXPORT static gp_Pnt2d CircleValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius);
0274   
0275   Standard_EXPORT static gp_Pnt2d EllipseValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
0276   
0277   Standard_EXPORT static gp_Pnt2d HyperbolaValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
0278   
0279   Standard_EXPORT static gp_Pnt2d ParabolaValue (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal);
0280   
0281   Standard_EXPORT static void LineD1 (const Standard_Real U, const gp_Ax2d& Pos, gp_Pnt2d& P, gp_Vec2d& V1);
0282   
0283   Standard_EXPORT static void CircleD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, gp_Pnt2d& P, gp_Vec2d& V1);
0284   
0285   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);
0286   
0287   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);
0288   
0289   Standard_EXPORT static void ParabolaD1 (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, gp_Pnt2d& P, gp_Vec2d& V1);
0290   
0291   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);
0292   
0293   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);
0294   
0295   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);
0296   
0297   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);
0298   
0299   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);
0300   
0301   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);
0302   
0303 
0304   //! In the following functions N is the order of derivation
0305   //! and should be greater than 0
0306   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);
0307   
0308   Standard_EXPORT static gp_Vec2d LineDN (const Standard_Real U, const gp_Ax2d& Pos, const Standard_Integer N);
0309   
0310   Standard_EXPORT static gp_Vec2d CircleDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Radius, const Standard_Integer N);
0311   
0312   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);
0313   
0314   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);
0315   
0316 
0317   //! The following functions compute the parametric value corresponding
0318   //! to a given point on a elementary curve. The point should be on the
0319   //! curve.
0320   Standard_EXPORT static gp_Vec2d ParabolaDN (const Standard_Real U, const gp_Ax22d& Pos, const Standard_Real Focal, const Standard_Integer N);
0321   
0322 
0323   //! Computes the parameter value of the point P on the given curve.
0324   //! Note: In its local coordinate system, the parametric
0325   //! equation of the curve is given by the following:
0326   //! -   for the line L: P(U) = Po + U*Vo
0327   //! where Po is the origin and Vo the unit vector of its positioning axis.
0328   //! -   for the circle C: X(U) = Radius*Cos(U), Y(U) = Radius*Sin(U)
0329   //! -   for the ellipse E: X(U) = MajorRadius*Cos(U). Y(U) = MinorRadius*Sin(U)
0330   //! -   for the hyperbola H: X(U) = MajorRadius*Ch(U), Y(U) = MinorRadius*Sh(U)
0331   //! -   for the parabola Prb:
0332   //! X(U) = U**2 / (2*p)
0333   //! Y(U) = U
0334   //! where p is the distance between the focus and the directrix.
0335   //! Warning
0336   //! The point P must be on the curve. These functions are
0337   //! not protected, however, and if point P is not on the
0338   //! curve, an exception may be raised.
0339   static Standard_Real Parameter (const gp_Lin& L, const gp_Pnt& P);
0340   
0341   //! parametrization
0342   //! P (U) = L.Location() + U * L.Direction()
0343     static Standard_Real Parameter (const gp_Lin2d& L, const gp_Pnt2d& P);
0344   
0345     static Standard_Real Parameter (const gp_Circ& C, const gp_Pnt& P);
0346   
0347   //! parametrization
0348   //! In the local coordinate system of the circle
0349   //! X (U) = Radius * Cos (U)
0350   //! Y (U) = Radius * Sin (U)
0351     static Standard_Real Parameter (const gp_Circ2d& C, const gp_Pnt2d& P);
0352   
0353     static Standard_Real Parameter (const gp_Elips& E, const gp_Pnt& P);
0354   
0355   //! parametrization
0356   //! In the local coordinate system of the Ellipse
0357   //! X (U) = MajorRadius * Cos (U)
0358   //! Y (U) = MinorRadius * Sin (U)
0359     static Standard_Real Parameter (const gp_Elips2d& E, const gp_Pnt2d& P);
0360   
0361     static Standard_Real Parameter (const gp_Hypr& H, const gp_Pnt& P);
0362   
0363   //! parametrization
0364   //! In the local coordinate system of the Hyperbola
0365   //! X (U) = MajorRadius * Ch (U)
0366   //! Y (U) = MinorRadius * Sh (U)
0367     static Standard_Real Parameter (const gp_Hypr2d& H, const gp_Pnt2d& P);
0368   
0369     static Standard_Real Parameter (const gp_Parab& Prb, const gp_Pnt& P);
0370   
0371   //! parametrization
0372   //! In the local coordinate system of the parabola
0373   //! Y**2 = (2*P) * X where P is the distance between the focus
0374   //! and the directrix.
0375     static Standard_Real Parameter (const gp_Parab2d& Prb, const gp_Pnt2d& P);
0376   
0377   Standard_EXPORT static Standard_Real LineParameter (const gp_Ax1& Pos, const gp_Pnt& P);
0378   
0379   //! parametrization
0380   //! P (U) = L.Location() + U * L.Direction()
0381   Standard_EXPORT static Standard_Real LineParameter (const gp_Ax2d& Pos, const gp_Pnt2d& P);
0382   
0383   Standard_EXPORT static Standard_Real CircleParameter (const gp_Ax2& Pos, const gp_Pnt& P);
0384   
0385   //! Pos is the Axis of the Circle
0386   //! parametrization
0387   //! In the local coordinate system of the circle
0388   //! X (U) = Radius * Cos (U)
0389   //! Y (U) = Radius * Sin (U)
0390   Standard_EXPORT static Standard_Real CircleParameter (const gp_Ax22d& Pos, const gp_Pnt2d& P);
0391   
0392   Standard_EXPORT static Standard_Real EllipseParameter (const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt& P);
0393   
0394   //! Pos is the Axis of the Ellipse
0395   //! parametrization
0396   //! In the local coordinate system of the Ellipse
0397   //! X (U) = MajorRadius * Cos (U)
0398   //! Y (U) = MinorRadius * Sin (U)
0399   Standard_EXPORT static Standard_Real EllipseParameter (const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt2d& P);
0400   
0401   Standard_EXPORT static Standard_Real HyperbolaParameter (const gp_Ax2& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt& P);
0402   
0403   //! Pos is the Axis of the Hyperbola
0404   //! parametrization
0405   //! In the local coordinate system of the Hyperbola
0406   //! X (U) = MajorRadius * Ch (U)
0407   //! Y (U) = MinorRadius * Sh (U)
0408   Standard_EXPORT static Standard_Real HyperbolaParameter (const gp_Ax22d& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const gp_Pnt2d& P);
0409   
0410   Standard_EXPORT static Standard_Real ParabolaParameter (const gp_Ax2& Pos, const gp_Pnt& P);
0411   
0412   //! Pos is the mirror axis of the parabola
0413   //! parametrization
0414   //! In the local coordinate system of the parabola
0415   //! Y**2 = (2*P) * X where P is the distance between the focus
0416   //! and the directrix.
0417   //! The following functions build  a 3d curve from a
0418   //! 2d curve at a given position defined with an Ax2.
0419   Standard_EXPORT static Standard_Real ParabolaParameter (const gp_Ax22d& Pos, const gp_Pnt2d& P);
0420   
0421   Standard_EXPORT static gp_Pnt To3d (const gp_Ax2& Pos, const gp_Pnt2d& P);
0422   
0423   Standard_EXPORT static gp_Vec To3d (const gp_Ax2& Pos, const gp_Vec2d& V);
0424   
0425   Standard_EXPORT static gp_Dir To3d (const gp_Ax2& Pos, const gp_Dir2d& V);
0426   
0427   Standard_EXPORT static gp_Ax1 To3d (const gp_Ax2& Pos, const gp_Ax2d& A);
0428   
0429   Standard_EXPORT static gp_Ax2 To3d (const gp_Ax2& Pos, const gp_Ax22d& A);
0430   
0431   Standard_EXPORT static gp_Lin To3d (const gp_Ax2& Pos, const gp_Lin2d& L);
0432   
0433   Standard_EXPORT static gp_Circ To3d (const gp_Ax2& Pos, const gp_Circ2d& C);
0434   
0435   Standard_EXPORT static gp_Elips To3d (const gp_Ax2& Pos, const gp_Elips2d& E);
0436   
0437   Standard_EXPORT static gp_Hypr To3d (const gp_Ax2& Pos, const gp_Hypr2d& H);
0438   
0439 
0440   //! These functions build a 3D geometric entity from a 2D geometric entity.
0441   //! The "X Axis" and the "Y Axis" of the global coordinate
0442   //! system (i.e. 2D space) are lined up respectively with the
0443   //! "X Axis" and "Y Axis" of the 3D coordinate system, Pos.
0444   Standard_EXPORT static gp_Parab To3d (const gp_Ax2& Pos, const gp_Parab2d& Prb);
0445 
0446 
0447 
0448 
0449 protected:
0450 
0451 
0452 
0453 
0454 
0455 private:
0456 
0457 
0458 
0459 
0460 
0461 };
0462 
0463 
0464 #include <ElCLib.lxx>
0465 
0466 
0467 
0468 
0469 
0470 #endif // _ElCLib_HeaderFile