1 // File: GeomAPI_Dir2d.cpp
2 // Created: 23 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #include <GeomAPI_Dir2d.h>
6 #include <GeomAPI_XY.h>
8 #include <gp_Dir2d.hxx>
10 #define MY_DIR static_cast<gp_Dir2d*>(myImpl)
12 GeomAPI_Dir2d::GeomAPI_Dir2d(const double theX, const double theY)
13 : GeomAPI_Interface(new gp_Dir2d(theX, theY))
16 GeomAPI_Dir2d::GeomAPI_Dir2d(const boost::shared_ptr<GeomAPI_XY>& theCoords)
17 : GeomAPI_Interface(new gp_Dir2d(theCoords->x(), theCoords->y()))
20 double GeomAPI_Dir2d::x() const
25 double GeomAPI_Dir2d::y() const
30 const boost::shared_ptr<GeomAPI_XY> GeomAPI_Dir2d::xy()
32 return boost::shared_ptr<GeomAPI_XY>(new GeomAPI_XY(MY_DIR->X(), MY_DIR->Y()));
35 double GeomAPI_Dir2d::dot(const boost::shared_ptr<GeomAPI_Dir2d>& theArg) const
37 return MY_DIR->Dot(theArg->impl<gp_Dir2d>());
40 double GeomAPI_Dir2d::cross(const boost::shared_ptr<GeomAPI_Dir2d>& theArg) const
42 return MY_DIR->XY().Crossed(theArg->impl<gp_Dir2d>().XY());