Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created: 2009-01-21
0002 // 
0003 // Copyright (c) 2009-2013 OPEN CASCADE SAS
0004 // 
0005 // This file is part of commercial software by OPEN CASCADE SAS, 
0006 // furnished in accordance with the terms and conditions of the contract 
0007 // and with the inclusion of this copyright notice. 
0008 // This file or any part thereof may not be provided or otherwise 
0009 // made available to any third party. 
0010 // 
0011 // No ownership title to the software is transferred hereby. 
0012 // 
0013 // OPEN CASCADE SAS makes no representation or warranties with respect to the 
0014 // performance of this software, and specifically disclaims any responsibility 
0015 // for any damages, special or consequential, connected with its use. 
0016 
0017 #ifndef _Geom2dConvert_PPoint_HeaderFile
0018 #define _Geom2dConvert_PPoint_HeaderFile
0019 
0020 #include <gp_Pnt2d.hxx>
0021 #include <gp_Vec2d.hxx>
0022 
0023 class Adaptor2d_Curve2d;
0024 
0025 //! Class representing a point on curve, with 2D coordinate and the tangent
0026 class Geom2dConvert_PPoint
0027 {
0028 public:
0029   //! Empty constructor.
0030   Standard_EXPORT inline Geom2dConvert_PPoint ()
0031     : myParameter (::RealLast()),
0032       myPoint     (0., 0.),
0033       myD1        (0., 0.) {}
0034 
0035   //! Constructor.
0036   Standard_EXPORT inline Geom2dConvert_PPoint (const Standard_Real theParameter,
0037                                                const gp_XY&        thePoint,
0038                                                const gp_XY&        theD1)
0039     : myParameter (theParameter),
0040       myPoint     (thePoint),
0041       myD1        (theD1) {}
0042 
0043   //! Constructor.
0044   Standard_EXPORT Geom2dConvert_PPoint (const Standard_Real      theParameter,
0045                                         const Adaptor2d_Curve2d& theAdaptor);
0046 
0047   //! Compute the distance betwwen two 2d points.
0048   inline Standard_Real        Dist      (const Geom2dConvert_PPoint& theOth) const
0049   { return myPoint.Distance(theOth.myPoint); }
0050 
0051   //! Query the parmeter value.
0052   inline Standard_Real        Parameter () const { return myParameter; }
0053 
0054   //! Query the point location.
0055   inline const gp_XY&         Point     () const { return myPoint.XY(); }
0056 
0057   //! Query the first derivatives.
0058   inline const gp_XY&         D1        () const { return myD1.XY(); }
0059     
0060   //! Change the value of the derivative at the point.
0061   inline void                 SetD1     (const gp_XY& theD1)
0062   { myD1.SetXY (theD1); }
0063 
0064   //! Compare two values of this type.
0065   Standard_EXPORT Standard_Boolean operator == (const Geom2dConvert_PPoint&) const;
0066 
0067   //! Compare two values of this type.
0068   Standard_EXPORT Standard_Boolean operator != (const Geom2dConvert_PPoint&) const;
0069 
0070 private:
0071   Standard_Real    myParameter; //! Parameter value
0072   gp_Pnt2d  myPoint; //! Point location
0073   gp_Vec2d  myD1;    //! derivatives by parameter (components of the tangent).
0074 };
0075 
0076 #endif