1 // File: GeomAPI_Dir.cpp
2 // Created: 23 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #include <GeomAPI_Dir.h>
6 #include <GeomAPI_XYZ.h>
10 #define MY_DIR static_cast<gp_Dir*>(myImpl)
12 GeomAPI_Dir::GeomAPI_Dir(const double theX, const double theY, const double theZ)
13 : GeomAPI_Interface(new gp_Dir(theX, theY, theZ))
17 GeomAPI_Dir::GeomAPI_Dir(const boost::shared_ptr<GeomAPI_XYZ>& theCoords)
18 : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z()))
22 double GeomAPI_Dir::x() const
27 double GeomAPI_Dir::y() const
32 double GeomAPI_Dir::z() const
37 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_Dir::xyz()
39 return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z()));
42 double GeomAPI_Dir::dot(const boost::shared_ptr<GeomAPI_Dir>& theArg) const
44 return MY_DIR->Dot(theArg->impl<gp_Dir>());
47 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_Dir::cross(
48 const boost::shared_ptr<GeomAPI_Dir>& theArg) const
50 gp_XYZ aResult = MY_DIR->XYZ().Crossed(theArg->impl<gp_Dir>().XYZ());
51 return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z()));