1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Dir.cpp
4 // Created: 23 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #include <GeomAPI_Dir.h>
8 #include <GeomAPI_XYZ.h>
12 #define MY_DIR static_cast<gp_Dir*>(myImpl)
14 GeomAPI_Dir::GeomAPI_Dir(const double theX, const double theY, const double theZ)
15 : GeomAPI_Interface(new gp_Dir(theX, theY, theZ))
19 GeomAPI_Dir::GeomAPI_Dir(const std::shared_ptr<GeomAPI_XYZ>& theCoords)
20 : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z()))
24 double GeomAPI_Dir::x() const
29 double GeomAPI_Dir::y() const
34 double GeomAPI_Dir::z() const
39 const std::shared_ptr<GeomAPI_XYZ> GeomAPI_Dir::xyz()
41 return std::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z()));
44 double GeomAPI_Dir::dot(const std::shared_ptr<GeomAPI_Dir>& theArg) const
46 return MY_DIR->Dot(theArg->impl<gp_Dir>());
49 const std::shared_ptr<GeomAPI_XYZ> GeomAPI_Dir::cross(
50 const std::shared_ptr<GeomAPI_Dir>& theArg) const
52 gp_XYZ aResult = MY_DIR->XYZ().Crossed(theArg->impl<gp_Dir>().XYZ());
53 return std::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z()));