1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Dir2d.cpp
4 // Created: 23 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #include <GeomAPI_Dir2d.h>
8 #include <GeomAPI_XY.h>
10 #include <gp_Dir2d.hxx>
12 #define MY_DIR implPtr<gp_Dir2d>()
14 GeomAPI_Dir2d::GeomAPI_Dir2d(const double theX, const double theY)
15 : GeomAPI_Interface(new gp_Dir2d(theX, theY))
19 GeomAPI_Dir2d::GeomAPI_Dir2d(const std::shared_ptr<GeomAPI_XY>& theCoords)
20 : GeomAPI_Interface(new gp_Dir2d(theCoords->x(), theCoords->y()))
24 double GeomAPI_Dir2d::x() const
29 double GeomAPI_Dir2d::y() const
34 const std::shared_ptr<GeomAPI_XY> GeomAPI_Dir2d::xy()
36 return std::shared_ptr<GeomAPI_XY>(new GeomAPI_XY(MY_DIR->X(), MY_DIR->Y()));
39 void GeomAPI_Dir2d::reverse()
44 double GeomAPI_Dir2d::dot(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const
46 return MY_DIR->Dot(theArg->impl<gp_Dir2d>());
49 double GeomAPI_Dir2d::cross(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const
51 return MY_DIR->XY().Crossed(theArg->impl<gp_Dir2d>().XY());
54 double GeomAPI_Dir2d::angle(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const
56 return MY_DIR->Angle(theArg->impl<gp_Dir2d>());