Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pnt.cpp
1 // File:        GeomAPI_Pnt.cpp
2 // Created:     23 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include<GeomAPI_Pnt.h>
6 #include<GeomAPI_XYZ.h>
7
8 #include<gp_Pnt.hxx>
9
10 #define MY_PNT static_cast<gp_Pnt*>(myImpl)
11
12 GeomAPI_Pnt::GeomAPI_Pnt(const double theX, const double theY, const double theZ)
13   : GeomAPI_Interface(new gp_Pnt(theX, theY, theZ))
14 {}
15
16 GeomAPI_Pnt::GeomAPI_Pnt(const boost::shared_ptr<GeomAPI_XYZ>& theCoords)
17   : GeomAPI_Interface(new gp_Pnt(theCoords->x(), theCoords->y(), theCoords->z()))
18 {}
19
20 double GeomAPI_Pnt::x() const
21 {
22   return MY_PNT->X();
23 }
24
25 double GeomAPI_Pnt::y() const
26 {
27   return MY_PNT->Y();
28 }
29
30 double GeomAPI_Pnt::z() const
31 {
32   return MY_PNT->Z();
33 }
34
35 void GeomAPI_Pnt::setX(const double theX)
36 {
37   return MY_PNT->SetX(theX);
38 }
39
40 void GeomAPI_Pnt::setY(const double theY)
41 {
42   return MY_PNT->SetY(theY);
43 }
44
45 void GeomAPI_Pnt::setZ(const double theZ)
46 {
47   return MY_PNT->SetZ(theZ);
48 }
49
50 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_Pnt::xyz() 
51 {
52   return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(MY_PNT->X(), MY_PNT->Y(), MY_PNT->Z()));
53 }