Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:14:13

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 //! Provides functions for basic geometric computations on
0050 //! elementary curves such as conics and lines in 2D and 3D space.
0051 //! This includes:
0052 //! -   calculation of a point or derived vector on a 2D or
0053 //! 3D curve where:
0054 //! -   the curve is provided by the gp package, or
0055 //! defined in reference form (as in the gp package),
0056 //! and
0057 //! -   the point is defined by a parameter,
0058 //! -   evaluation of the parameter corresponding to a point
0059 //! on a 2D or 3D curve from gp,
0060 //! -   various elementary computations which allow you to
0061 //! position parameterized values within the period of a curve.
0062 //! Notes:
0063 //! -   ElCLib stands for Elementary Curves Library.
0064 //! -   If the curves provided by the gp package are not
0065 //! explicitly parameterized, they still have an implicit
0066 //! parameterization, analogous to that which they infer
0067 //! for the equivalent Geom or Geom2d curves.
0068 class ElCLib
0069 {
0070 public:
0071   DEFINE_STANDARD_ALLOC
0072 
0073   //! Return a value in the range <UFirst, ULast> by
0074   //! adding or removing the period <ULast - UFirst> to
0075   //! <U>.
0076   //! ATTENTION!!!
0077   //!   It is expected but not checked that (ULast > UFirst)
0078   Standard_EXPORT static double InPeriod(const double U, const double UFirst, const double ULast);
0079 
0080   //! Adjust U1 and U2 in the parametric range UFirst
0081   //! Ulast of a periodic curve, where ULast -
0082   //! UFirst is its period. To do this, this function:
0083   //! -   sets U1 in the range [ UFirst, ULast ] by
0084   //! adding/removing the period to/from the value U1, then
0085   //! -   sets U2 in the range [ U1, U1 + period ] by
0086   //! adding/removing the period to/from the value U2.
0087   //! Precision is used to test the equalities.
0088   Standard_EXPORT static void AdjustPeriodic(const double UFirst,
0089                                              const double ULast,
0090                                              const double Precision,
0091                                              double&      U1,
0092                                              double&      U2);
0093 
0094   //! For elementary curves (lines, circles and conics) from
0095   //! the gp package, computes the point of parameter U.
0096   //! The result is either:
0097   //! -   a gp_Pnt point for a curve in 3D space, or
0098   //! -   a gp_Pnt2d point for a curve in 2D space.
0099   static gp_Pnt Value(const double U, const gp_Lin& L);
0100 
0101   static gp_Pnt Value(const double U, const gp_Circ& C);
0102 
0103   static gp_Pnt Value(const double U, const gp_Elips& E);
0104 
0105   static gp_Pnt Value(const double U, const gp_Hypr& H);
0106 
0107   static gp_Pnt Value(const double U, const gp_Parab& Prb);
0108 
0109   //! For elementary curves (lines, circles and conics) from the
0110   //! gp package, computes:
0111   //! -   the point P of parameter U, and
0112   //! -   the first derivative vector V1 at this point.
0113   //! The results P and V1 are either:
0114   //! -   a gp_Pnt point and a gp_Vec vector, for a curve in 3D space, or
0115   //! -   a gp_Pnt2d point and a gp_Vec2d vector, for a curve in 2D space.
0116   static void D1(const double U, const gp_Lin& L, gp_Pnt& P, gp_Vec& V1);
0117 
0118   static void D1(const double U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1);
0119 
0120   static void D1(const double U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1);
0121 
0122   static void D1(const double U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1);
0123 
0124   static void D1(const double U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1);
0125 
0126   //! For elementary curves (circles and conics) from the gp
0127   //! package, computes:
0128   //! - the point P of parameter U, and
0129   //! - the first and second derivative vectors V1 and V2 at this point.
0130   //! The results, P, V1 and V2, are either:
0131   //! -   a gp_Pnt point and two gp_Vec vectors, for a curve in 3D space, or
0132   //! -   a gp_Pnt2d point and two gp_Vec2d vectors, for a curve in 2D space.
0133   static void D2(const double U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0134 
0135   static void D2(const double U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0136 
0137   static void D2(const double U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0138 
0139   static void D2(const double U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
0140 
0141   //! For elementary curves (circles, ellipses and hyperbolae)
0142   //! from the gp package, computes:
0143   //! -   the point P of parameter U, and
0144   //! -   the first, second and third derivative vectors V1, V2
0145   //! and V3 at this point.
0146   //! The results, P, V1, V2 and V3, are either:
0147   //! -   a gp_Pnt point and three gp_Vec vectors, for a curve in 3D space, or
0148   //! -   a gp_Pnt2d point and three gp_Vec2d vectors, for a curve in 2D space.
0149   static void D3(const double U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0150 
0151   static void D3(const double U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0152 
0153   static void D3(const double U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
0154 
0155   //! For elementary curves (lines, circles and conics) from
0156   //! the gp package, computes the vector corresponding to
0157   //! the Nth derivative at the point of parameter U. The result is either:
0158   //! -   a gp_Vec vector for a curve in 3D space, or
0159   //! -   a gp_Vec2d vector for a curve in 2D space.
0160   //! In the following functions N is the order of derivation
0161   //! and should be greater than 0
0162   static gp_Vec DN(const double U, const gp_Lin& L, const int N);
0163 
0164   static gp_Vec DN(const double U, const gp_Circ& C, const int N);
0165 
0166   static gp_Vec DN(const double U, const gp_Elips& E, const int N);
0167 
0168   static gp_Vec DN(const double U, const gp_Hypr& H, const int N);
0169 
0170   static gp_Vec DN(const double U, const gp_Parab& Prb, const int N);
0171 
0172   static gp_Pnt2d Value(const double U, const gp_Lin2d& L);
0173 
0174   static gp_Pnt2d Value(const double U, const gp_Circ2d& C);
0175 
0176   static gp_Pnt2d Value(const double U, const gp_Elips2d& E);
0177 
0178   static gp_Pnt2d Value(const double U, const gp_Hypr2d& H);
0179 
0180   static gp_Pnt2d Value(const double U, const gp_Parab2d& Prb);
0181 
0182   static void D1(const double U, const gp_Lin2d& L, gp_Pnt2d& P, gp_Vec2d& V1);
0183 
0184   static void D1(const double U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1);
0185 
0186   static void D1(const double U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1);
0187 
0188   static void D1(const double U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1);
0189 
0190   static void D1(const double U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1);
0191 
0192   static void D2(const double U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0193 
0194   static void D2(const double U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0195 
0196   static void D2(const double U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0197 
0198   static void D2(const double U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
0199 
0200   static void D3(const double     U,
0201                  const gp_Circ2d& C,
0202                  gp_Pnt2d&        P,
0203                  gp_Vec2d&        V1,
0204                  gp_Vec2d&        V2,
0205                  gp_Vec2d&        V3);
0206 
0207   static void D3(const double      U,
0208                  const gp_Elips2d& E,
0209                  gp_Pnt2d&         P,
0210                  gp_Vec2d&         V1,
0211                  gp_Vec2d&         V2,
0212                  gp_Vec2d&         V3);
0213 
0214   //! In the following functions N is the order of derivation
0215   //! and should be greater than 0
0216   static void D3(const double     U,
0217                  const gp_Hypr2d& H,
0218                  gp_Pnt2d&        P,
0219                  gp_Vec2d&        V1,
0220                  gp_Vec2d&        V2,
0221                  gp_Vec2d&        V3);
0222 
0223   static gp_Vec2d DN(const double U, const gp_Lin2d& L, const int N);
0224 
0225   static gp_Vec2d DN(const double U, const gp_Circ2d& C, const int N);
0226 
0227   static gp_Vec2d DN(const double U, const gp_Elips2d& E, const int N);
0228 
0229   static gp_Vec2d DN(const double U, const gp_Hypr2d& H, const int N);
0230 
0231   static gp_Vec2d DN(const double U, const gp_Parab2d& Prb, const int N);
0232 
0233   //! Curve evaluation
0234   //! The following basis functions compute the derivatives on
0235   //! elementary curves defined by their geometric characteristics.
0236   //! These functions can be called without constructing a conic
0237   //! from package gp. They are called by the previous functions.
0238   //! Example :
0239   //! A circle is defined by its position and its radius.
0240   Standard_EXPORT static gp_Pnt LineValue(const double U, const gp_Ax1& Pos);
0241 
0242   Standard_EXPORT static gp_Pnt CircleValue(const double U, const gp_Ax2& Pos, const double Radius);
0243 
0244   Standard_EXPORT static gp_Pnt EllipseValue(const double  U,
0245                                              const gp_Ax2& Pos,
0246                                              const double  MajorRadius,
0247                                              const double  MinorRadius);
0248 
0249   Standard_EXPORT static gp_Pnt HyperbolaValue(const double  U,
0250                                                const gp_Ax2& Pos,
0251                                                const double  MajorRadius,
0252                                                const double  MinorRadius);
0253 
0254   Standard_EXPORT static gp_Pnt ParabolaValue(const double  U,
0255                                               const gp_Ax2& Pos,
0256                                               const double  Focal);
0257 
0258   Standard_EXPORT static void LineD1(const double U, const gp_Ax1& Pos, gp_Pnt& P, gp_Vec& V1);
0259 
0260   Standard_EXPORT static void CircleD1(const double  U,
0261                                        const gp_Ax2& Pos,
0262                                        const double  Radius,
0263                                        gp_Pnt&       P,
0264                                        gp_Vec&       V1);
0265 
0266   Standard_EXPORT static void EllipseD1(const double  U,
0267                                         const gp_Ax2& Pos,
0268                                         const double  MajorRadius,
0269                                         const double  MinorRadius,
0270                                         gp_Pnt&       P,
0271                                         gp_Vec&       V1);
0272 
0273   Standard_EXPORT static void HyperbolaD1(const double  U,
0274                                           const gp_Ax2& Pos,
0275                                           const double  MajorRadius,
0276                                           const double  MinorRadius,
0277                                           gp_Pnt&       P,
0278                                           gp_Vec&       V1);
0279 
0280   Standard_EXPORT static void ParabolaD1(const double  U,
0281                                          const gp_Ax2& Pos,
0282                                          const double  Focal,
0283                                          gp_Pnt&       P,
0284                                          gp_Vec&       V1);
0285 
0286   Standard_EXPORT static void CircleD2(const double  U,
0287                                        const gp_Ax2& Pos,
0288                                        const double  Radius,
0289                                        gp_Pnt&       P,
0290                                        gp_Vec&       V1,
0291                                        gp_Vec&       V2);
0292 
0293   Standard_EXPORT static void EllipseD2(const double  U,
0294                                         const gp_Ax2& Pos,
0295                                         const double  MajorRadius,
0296                                         const double  MinorRadius,
0297                                         gp_Pnt&       P,
0298                                         gp_Vec&       V1,
0299                                         gp_Vec&       V2);
0300 
0301   Standard_EXPORT static void HyperbolaD2(const double  U,
0302                                           const gp_Ax2& Pos,
0303                                           const double  MajorRadius,
0304                                           const double  MinorRadius,
0305                                           gp_Pnt&       P,
0306                                           gp_Vec&       V1,
0307                                           gp_Vec&       V2);
0308 
0309   Standard_EXPORT static void ParabolaD2(const double  U,
0310                                          const gp_Ax2& Pos,
0311                                          const double  Focal,
0312                                          gp_Pnt&       P,
0313                                          gp_Vec&       V1,
0314                                          gp_Vec&       V2);
0315 
0316   Standard_EXPORT static void CircleD3(const double  U,
0317                                        const gp_Ax2& Pos,
0318                                        const double  Radius,
0319                                        gp_Pnt&       P,
0320                                        gp_Vec&       V1,
0321                                        gp_Vec&       V2,
0322                                        gp_Vec&       V3);
0323 
0324   Standard_EXPORT static void EllipseD3(const double  U,
0325                                         const gp_Ax2& Pos,
0326                                         const double  MajorRadius,
0327                                         const double  MinorRadius,
0328                                         gp_Pnt&       P,
0329                                         gp_Vec&       V1,
0330                                         gp_Vec&       V2,
0331                                         gp_Vec&       V3);
0332 
0333   Standard_EXPORT static void HyperbolaD3(const double  U,
0334                                           const gp_Ax2& Pos,
0335                                           const double  MajorRadius,
0336                                           const double  MinorRadius,
0337                                           gp_Pnt&       P,
0338                                           gp_Vec&       V1,
0339                                           gp_Vec&       V2,
0340                                           gp_Vec&       V3);
0341 
0342   //! In the following functions N is the order of derivation
0343   //! and should be greater than 0
0344   Standard_EXPORT static gp_Vec LineDN(const double U, const gp_Ax1& Pos, const int N);
0345 
0346   Standard_EXPORT static gp_Vec CircleDN(const double  U,
0347                                          const gp_Ax2& Pos,
0348                                          const double  Radius,
0349                                          const int     N);
0350 
0351   Standard_EXPORT static gp_Vec EllipseDN(const double  U,
0352                                           const gp_Ax2& Pos,
0353                                           const double  MajorRadius,
0354                                           const double  MinorRadius,
0355                                           const int     N);
0356 
0357   Standard_EXPORT static gp_Vec HyperbolaDN(const double  U,
0358                                             const gp_Ax2& Pos,
0359                                             const double  MajorRadius,
0360                                             const double  MinorRadius,
0361                                             const int     N);
0362 
0363   Standard_EXPORT static gp_Vec ParabolaDN(const double  U,
0364                                            const gp_Ax2& Pos,
0365                                            const double  Focal,
0366                                            const int     N);
0367 
0368   Standard_EXPORT static gp_Pnt2d LineValue(const double U, const gp_Ax2d& Pos);
0369 
0370   Standard_EXPORT static gp_Pnt2d CircleValue(const double    U,
0371                                               const gp_Ax22d& Pos,
0372                                               const double    Radius);
0373 
0374   Standard_EXPORT static gp_Pnt2d EllipseValue(const double    U,
0375                                                const gp_Ax22d& Pos,
0376                                                const double    MajorRadius,
0377                                                const double    MinorRadius);
0378 
0379   Standard_EXPORT static gp_Pnt2d HyperbolaValue(const double    U,
0380                                                  const gp_Ax22d& Pos,
0381                                                  const double    MajorRadius,
0382                                                  const double    MinorRadius);
0383 
0384   Standard_EXPORT static gp_Pnt2d ParabolaValue(const double    U,
0385                                                 const gp_Ax22d& Pos,
0386                                                 const double    Focal);
0387 
0388   Standard_EXPORT static void LineD1(const double U, const gp_Ax2d& Pos, gp_Pnt2d& P, gp_Vec2d& V1);
0389 
0390   Standard_EXPORT static void CircleD1(const double    U,
0391                                        const gp_Ax22d& Pos,
0392                                        const double    Radius,
0393                                        gp_Pnt2d&       P,
0394                                        gp_Vec2d&       V1);
0395 
0396   Standard_EXPORT static void EllipseD1(const double    U,
0397                                         const gp_Ax22d& Pos,
0398                                         const double    MajorRadius,
0399                                         const double    MinorRadius,
0400                                         gp_Pnt2d&       P,
0401                                         gp_Vec2d&       V1);
0402 
0403   Standard_EXPORT static void HyperbolaD1(const double    U,
0404                                           const gp_Ax22d& Pos,
0405                                           const double    MajorRadius,
0406                                           const double    MinorRadius,
0407                                           gp_Pnt2d&       P,
0408                                           gp_Vec2d&       V1);
0409 
0410   Standard_EXPORT static void ParabolaD1(const double    U,
0411                                          const gp_Ax22d& Pos,
0412                                          const double    Focal,
0413                                          gp_Pnt2d&       P,
0414                                          gp_Vec2d&       V1);
0415 
0416   Standard_EXPORT static void CircleD2(const double    U,
0417                                        const gp_Ax22d& Pos,
0418                                        const double    Radius,
0419                                        gp_Pnt2d&       P,
0420                                        gp_Vec2d&       V1,
0421                                        gp_Vec2d&       V2);
0422 
0423   Standard_EXPORT static void EllipseD2(const double    U,
0424                                         const gp_Ax22d& Pos,
0425                                         const double    MajorRadius,
0426                                         const double    MinorRadius,
0427                                         gp_Pnt2d&       P,
0428                                         gp_Vec2d&       V1,
0429                                         gp_Vec2d&       V2);
0430 
0431   Standard_EXPORT static void HyperbolaD2(const double    U,
0432                                           const gp_Ax22d& Pos,
0433                                           const double    MajorRadius,
0434                                           const double    MinorRadius,
0435                                           gp_Pnt2d&       P,
0436                                           gp_Vec2d&       V1,
0437                                           gp_Vec2d&       V2);
0438 
0439   Standard_EXPORT static void ParabolaD2(const double    U,
0440                                          const gp_Ax22d& Pos,
0441                                          const double    Focal,
0442                                          gp_Pnt2d&       P,
0443                                          gp_Vec2d&       V1,
0444                                          gp_Vec2d&       V2);
0445 
0446   Standard_EXPORT static void CircleD3(const double    U,
0447                                        const gp_Ax22d& Pos,
0448                                        const double    Radius,
0449                                        gp_Pnt2d&       P,
0450                                        gp_Vec2d&       V1,
0451                                        gp_Vec2d&       V2,
0452                                        gp_Vec2d&       V3);
0453 
0454   Standard_EXPORT static void EllipseD3(const double    U,
0455                                         const gp_Ax22d& Pos,
0456                                         const double    MajorRadius,
0457                                         const double    MinorRadius,
0458                                         gp_Pnt2d&       P,
0459                                         gp_Vec2d&       V1,
0460                                         gp_Vec2d&       V2,
0461                                         gp_Vec2d&       V3);
0462 
0463   //! In the following functions N is the order of derivation
0464   //! and should be greater than 0
0465   Standard_EXPORT static void HyperbolaD3(const double    U,
0466                                           const gp_Ax22d& Pos,
0467                                           const double    MajorRadius,
0468                                           const double    MinorRadius,
0469                                           gp_Pnt2d&       P,
0470                                           gp_Vec2d&       V1,
0471                                           gp_Vec2d&       V2,
0472                                           gp_Vec2d&       V3);
0473 
0474   Standard_EXPORT static gp_Vec2d LineDN(const double U, const gp_Ax2d& Pos, const int N);
0475 
0476   Standard_EXPORT static gp_Vec2d CircleDN(const double    U,
0477                                            const gp_Ax22d& Pos,
0478                                            const double    Radius,
0479                                            const int       N);
0480 
0481   Standard_EXPORT static gp_Vec2d EllipseDN(const double    U,
0482                                             const gp_Ax22d& Pos,
0483                                             const double    MajorRadius,
0484                                             const double    MinorRadius,
0485                                             const int       N);
0486 
0487   Standard_EXPORT static gp_Vec2d HyperbolaDN(const double    U,
0488                                               const gp_Ax22d& Pos,
0489                                               const double    MajorRadius,
0490                                               const double    MinorRadius,
0491                                               const int       N);
0492 
0493   //! The following functions compute the parametric value corresponding
0494   //! to a given point on a elementary curve. The point should be on the
0495   //! curve.
0496   Standard_EXPORT static gp_Vec2d ParabolaDN(const double    U,
0497                                              const gp_Ax22d& Pos,
0498                                              const double    Focal,
0499                                              const int       N);
0500 
0501   //! Computes the parameter value of the point P on the given curve.
0502   //! Note: In its local coordinate system, the parametric
0503   //! equation of the curve is given by the following:
0504   //! -   for the line L: P(U) = Po + U*Vo
0505   //! where Po is the origin and Vo the unit vector of its positioning axis.
0506   //! -   for the circle C: X(U) = Radius*std::cos(U), Y(U) = Radius*Sin(U)
0507   //! -   for the ellipse E: X(U) = MajorRadius*std::cos(U). Y(U) = MinorRadius*Sin(U)
0508   //! -   for the hyperbola H: X(U) = MajorRadius*Ch(U), Y(U) = MinorRadius*Sh(U)
0509   //! -   for the parabola Prb:
0510   //! X(U) = U**2 / (2*p)
0511   //! Y(U) = U
0512   //! where p is the distance between the focus and the directrix.
0513   //! Warning
0514   //! The point P must be on the curve. These functions are
0515   //! not protected, however, and if point P is not on the
0516   //! curve, an exception may be raised.
0517   static double Parameter(const gp_Lin& L, const gp_Pnt& P);
0518 
0519   //! parametrization
0520   //! P (U) = L.Location() + U * L.Direction()
0521   static double Parameter(const gp_Lin2d& L, const gp_Pnt2d& P);
0522 
0523   static double Parameter(const gp_Circ& C, const gp_Pnt& P);
0524 
0525   //! parametrization
0526   //! In the local coordinate system of the circle
0527   //! X (U) = Radius * Cos (U)
0528   //! Y (U) = Radius * Sin (U)
0529   static double Parameter(const gp_Circ2d& C, const gp_Pnt2d& P);
0530 
0531   static double Parameter(const gp_Elips& E, const gp_Pnt& P);
0532 
0533   //! parametrization
0534   //! In the local coordinate system of the Ellipse
0535   //! X (U) = MajorRadius * Cos (U)
0536   //! Y (U) = MinorRadius * Sin (U)
0537   static double Parameter(const gp_Elips2d& E, const gp_Pnt2d& P);
0538 
0539   static double Parameter(const gp_Hypr& H, const gp_Pnt& P);
0540 
0541   //! parametrization
0542   //! In the local coordinate system of the Hyperbola
0543   //! X (U) = MajorRadius * Ch (U)
0544   //! Y (U) = MinorRadius * Sh (U)
0545   static double Parameter(const gp_Hypr2d& H, const gp_Pnt2d& P);
0546 
0547   static double Parameter(const gp_Parab& Prb, const gp_Pnt& P);
0548 
0549   //! parametrization
0550   //! In the local coordinate system of the parabola
0551   //! Y**2 = (2*P) * X where P is the distance between the focus
0552   //! and the directrix.
0553   static double Parameter(const gp_Parab2d& Prb, const gp_Pnt2d& P);
0554 
0555   Standard_EXPORT static double LineParameter(const gp_Ax1& Pos, const gp_Pnt& P);
0556 
0557   //! parametrization
0558   //! P (U) = L.Location() + U * L.Direction()
0559   Standard_EXPORT static double LineParameter(const gp_Ax2d& Pos, const gp_Pnt2d& P);
0560 
0561   Standard_EXPORT static double CircleParameter(const gp_Ax2& Pos, const gp_Pnt& P);
0562 
0563   //! Pos is the Axis of the Circle
0564   //! parametrization
0565   //! In the local coordinate system of the circle
0566   //! X (U) = Radius * Cos (U)
0567   //! Y (U) = Radius * Sin (U)
0568   Standard_EXPORT static double CircleParameter(const gp_Ax22d& Pos, const gp_Pnt2d& P);
0569 
0570   Standard_EXPORT static double EllipseParameter(const gp_Ax2& Pos,
0571                                                  const double  MajorRadius,
0572                                                  const double  MinorRadius,
0573                                                  const gp_Pnt& P);
0574 
0575   //! Pos is the Axis of the Ellipse
0576   //! parametrization
0577   //! In the local coordinate system of the Ellipse
0578   //! X (U) = MajorRadius * Cos (U)
0579   //! Y (U) = MinorRadius * Sin (U)
0580   Standard_EXPORT static double EllipseParameter(const gp_Ax22d& Pos,
0581                                                  const double    MajorRadius,
0582                                                  const double    MinorRadius,
0583                                                  const gp_Pnt2d& P);
0584 
0585   Standard_EXPORT static double HyperbolaParameter(const gp_Ax2& Pos,
0586                                                    const double  MajorRadius,
0587                                                    const double  MinorRadius,
0588                                                    const gp_Pnt& P);
0589 
0590   //! Pos is the Axis of the Hyperbola
0591   //! parametrization
0592   //! In the local coordinate system of the Hyperbola
0593   //! X (U) = MajorRadius * Ch (U)
0594   //! Y (U) = MinorRadius * Sh (U)
0595   Standard_EXPORT static double HyperbolaParameter(const gp_Ax22d& Pos,
0596                                                    const double    MajorRadius,
0597                                                    const double    MinorRadius,
0598                                                    const gp_Pnt2d& P);
0599 
0600   Standard_EXPORT static double ParabolaParameter(const gp_Ax2& Pos, const gp_Pnt& P);
0601 
0602   //! Pos is the mirror axis of the parabola
0603   //! parametrization
0604   //! In the local coordinate system of the parabola
0605   //! Y**2 = (2*P) * X where P is the distance between the focus
0606   //! and the directrix.
0607   //! The following functions build a 3d curve from a
0608   //! 2d curve at a given position defined with an Ax2.
0609   Standard_EXPORT static double ParabolaParameter(const gp_Ax22d& Pos, const gp_Pnt2d& P);
0610 
0611   Standard_EXPORT static gp_Pnt To3d(const gp_Ax2& Pos, const gp_Pnt2d& P);
0612 
0613   Standard_EXPORT static gp_Vec To3d(const gp_Ax2& Pos, const gp_Vec2d& V);
0614 
0615   Standard_EXPORT static gp_Dir To3d(const gp_Ax2& Pos, const gp_Dir2d& V);
0616 
0617   Standard_EXPORT static gp_Ax1 To3d(const gp_Ax2& Pos, const gp_Ax2d& A);
0618 
0619   Standard_EXPORT static gp_Ax2 To3d(const gp_Ax2& Pos, const gp_Ax22d& A);
0620 
0621   Standard_EXPORT static gp_Lin To3d(const gp_Ax2& Pos, const gp_Lin2d& L);
0622 
0623   Standard_EXPORT static gp_Circ To3d(const gp_Ax2& Pos, const gp_Circ2d& C);
0624 
0625   Standard_EXPORT static gp_Elips To3d(const gp_Ax2& Pos, const gp_Elips2d& E);
0626 
0627   Standard_EXPORT static gp_Hypr To3d(const gp_Ax2& Pos, const gp_Hypr2d& H);
0628 
0629   //! These functions build a 3D geometric entity from a 2D geometric entity.
0630   //! The "X Axis" and the "Y Axis" of the global coordinate
0631   //! system (i.e. 2D space) are lined up respectively with the
0632   //! "X Axis" and "Y Axis" of the 3D coordinate system, Pos.
0633   Standard_EXPORT static gp_Parab To3d(const gp_Ax2& Pos, const gp_Parab2d& Prb);
0634 };
0635 
0636 #include <ElCLib.lxx>
0637 
0638 #endif // _ElCLib_HeaderFile