Salome HOME
Merge remote-tracking branch 'remotes/origin/GeomAPI'
[modules/shaper.git] / src / GeomAPI / GeomAPI_Dir.cpp
1 // File:        GeomAPI_Dir.cpp
2 // Created:     23 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include <GeomAPI_Dir.h>
6 #include <GeomAPI_XYZ.h>
7
8 #include <gp_Dir.hxx>
9
10 #define MY_DIR static_cast<gp_Dir*>(myImpl)
11
12 GeomAPI_Dir::GeomAPI_Dir(const double theX, const double theY, const double theZ)
13   : GeomAPI_Interface(new gp_Dir(theX, theY, theZ))
14 {}
15
16 GeomAPI_Dir::GeomAPI_Dir(const boost::shared_ptr<GeomAPI_XYZ>& theCoords)
17   : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z()))
18 {}
19
20 double GeomAPI_Dir::x() const
21 {
22   return MY_DIR->X();
23 }
24
25 double GeomAPI_Dir::y() const
26 {
27   return MY_DIR->Y();
28 }
29
30 double GeomAPI_Dir::z() const
31 {
32   return MY_DIR->Z();
33 }
34
35 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_Dir::xyz() 
36 {
37   return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z()));
38 }