Salome HOME
Added new geometrical objects
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pnt2d.cpp
1 // File:        GeomAPI_Pnt2d.cpp
2 // Created:     29 May 2014
3 // Author:      Artem ZHIDKOV
4
5 #include<GeomAPI_Pnt2d.h>
6 #include<GeomAPI_XYZ.h>
7
8 #include<gp_Pnt2d.hxx>
9
10 #define MY_PNT2D static_cast<gp_Pnt2d*>(myImpl)
11
12 GeomAPI_Pnt2d::GeomAPI_Pnt2d(const double theX, const double theY)
13   : GeomAPI_Interface(new gp_Pnt2d(theX, theY))
14 {}
15
16 double GeomAPI_Pnt2d::x() const
17 {
18   return MY_PNT2D->X();
19 }
20
21 double GeomAPI_Pnt2d::y() const
22 {
23   return MY_PNT2D->Y();
24 }
25
26 void GeomAPI_Pnt2d::setX(const double theX)
27 {
28   return MY_PNT2D->SetX(theX);
29 }
30
31 void GeomAPI_Pnt2d::setY(const double theY)
32 {
33   return MY_PNT2D->SetY(theY);
34 }
35
36 double GeomAPI_Pnt2d::distance(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const
37 {
38   return MY_PNT2D->Distance(theOther->impl<gp_Pnt2d>());
39 }