1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Pnt2d.h
4 // Created: 29 May 2014
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAPI_Pnt2d_H_
8 #define GeomAPI_Pnt2d_H_
10 #include <GeomAPI_Interface.h>
17 /**\class GeomAPI_Pnt2d
19 * \brief 2D point defined by two coordinates
22 class GeomAPI_Pnt2d : public GeomAPI_Interface
25 /// Creation of point by coordinates
27 GeomAPI_Pnt2d(const double theX, const double theY);
28 /// Creation of point by coordinates
30 GeomAPI_Pnt2d(const std::shared_ptr<GeomAPI_XY>& theCoords);
32 /// returns X coordinate
35 /// returns Y coordinate
41 void setX(const double theX);
44 void setY(const double theY);
46 /// Returns the 3D point
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);
52 /// returns coordinates of the point
54 const std::shared_ptr<GeomAPI_XY> xy();
56 /// Distance between two points
58 double distance(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
60 /// Returns whether the distance between two points is less then precision confusion
62 bool isEqual(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;