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 static_cast<gp_Dir2d*>(myImpl)
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 double GeomAPI_Dir2d::dot(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const
41 return MY_DIR->Dot(theArg->impl<gp_Dir2d>());
44 double GeomAPI_Dir2d::cross(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const
46 return MY_DIR->XY().Crossed(theArg->impl<gp_Dir2d>().XY());