Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pnt2d.h
1 // File:        GeomAPI_Pnt2d.h
2 // Created:     29 May 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef GeomAPI_Pnt2d_HeaderFile
6 #define GeomAPI_Pnt2d_HeaderFile
7
8 #include <GeomAPI_Interface.h>
9 #include <boost/shared_ptr.hpp>
10
11 class GeomAPI_XY;
12
13 /**\class GeomAPI_Pnt2d
14  * \ingroup DataModel
15  * \brief 2D point defined by two coordinates
16  */
17
18 class GEOMAPI_EXPORT GeomAPI_Pnt2d: public GeomAPI_Interface
19 {
20 public:
21   /// Creation of point by coordinates
22   GeomAPI_Pnt2d(const double theX, const double theY);
23   /// Creation of point by coordinates
24   GeomAPI_Pnt2d(const boost::shared_ptr<GeomAPI_XY>& theCoords);
25
26   /// returns X coordinate
27   double x() const;
28   /// returns Y coordinate
29   double y() const;
30
31   /// sets X coordinate
32   void setX(const double theX);
33   /// sets Y coordinate
34   void setY(const double theY);
35
36   /// returns coordinates of the point
37   const boost::shared_ptr<GeomAPI_XY> xy();
38
39   /// Distance between two points
40   double distance(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
41 };
42
43 #endif
44