Salome HOME
Update SketchPlugin_Projection feature (issue #1459)
[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_Pnt2d : public GeomAPI_Interface
23 {
24  public:
25   /// Creation of point by coordinates
26   GEOMAPI_EXPORT 
27   GeomAPI_Pnt2d(const double theX, const double theY);
28   /// Creation of point by coordinates
29   GEOMAPI_EXPORT 
30   GeomAPI_Pnt2d(const std::shared_ptr<GeomAPI_XY>& theCoords);
31
32   /// returns X coordinate
33   GEOMAPI_EXPORT 
34   double x() const;
35   /// returns Y coordinate
36   GEOMAPI_EXPORT 
37   double y() const;
38
39   /// sets X coordinate
40   GEOMAPI_EXPORT 
41   void setX(const double theX);
42   /// sets Y coordinate
43   GEOMAPI_EXPORT 
44   void setY(const double theY);
45
46   /// Returns the 3D point
47   GEOMAPI_EXPORT 
48   std::shared_ptr<GeomAPI_Pnt> to3D(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
49                                       const std::shared_ptr<GeomAPI_Dir>& theDirX,
50                                       const std::shared_ptr<GeomAPI_Dir>& theDirY);
51
52   /// returns coordinates of the point
53   GEOMAPI_EXPORT 
54   const std::shared_ptr<GeomAPI_XY> xy();
55
56   /// Distance between two points
57   GEOMAPI_EXPORT 
58   double distance(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
59
60   /// Returns whether the distance between two points is less then precision confusion
61   GEOMAPI_EXPORT 
62   bool isEqual(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
63 };
64
65 #endif
66