Salome HOME
Merge branch 'master' of newgeom:newgeom.git into BR_PYTHON_PLUGIN
[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_H_
6 #define GeomAPI_Pnt2d_H_
7
8 #include <GeomAPI_Interface.h>
9 #include <memory>
10
11 class GeomAPI_XY;
12 class GeomAPI_Pnt;
13 class GeomAPI_Dir;
14
15 /**\class GeomAPI_Pnt2d
16  * \ingroup DataModel
17  * \brief 2D point defined by two coordinates
18  */
19
20 class GEOMAPI_EXPORT GeomAPI_Pnt2d : public GeomAPI_Interface
21 {
22  public:
23   /// Creation of point by coordinates
24   GeomAPI_Pnt2d(const double theX, const double theY);
25   /// Creation of point by coordinates
26   GeomAPI_Pnt2d(const std::shared_ptr<GeomAPI_XY>& theCoords);
27
28   /// returns X coordinate
29   double x() const;
30   /// returns Y coordinate
31   double y() const;
32
33   /// sets X coordinate
34   void setX(const double theX);
35   /// sets Y coordinate
36   void setY(const double theY);
37
38   /// Returns the 3D point
39   std::shared_ptr<GeomAPI_Pnt> to3D(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
40                                       const std::shared_ptr<GeomAPI_Dir>& theDirX,
41                                       const std::shared_ptr<GeomAPI_Dir>& theDirY);
42
43   /// returns coordinates of the point
44   const std::shared_ptr<GeomAPI_XY> xy();
45
46   /// Distance between two points
47   double distance(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
48
49   /// Returns whether the distance between two points is less then precision confusion
50   bool isEqual(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
51 };
52
53 #endif
54