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