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_EXPORT GeomAPI_Pnt2d : public GeomAPI_Interface
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);
30 /// returns X coordinate
32 /// returns Y coordinate
36 void setX(const double theX);
38 void setY(const double theY);
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);
45 /// returns coordinates of the point
46 const std::shared_ptr<GeomAPI_XY> xy();
48 /// Distance between two points
49 double distance(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
51 /// Returns whether the distance between two points is less then precision confusion
52 bool isEqual(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;