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))
17 GeomAPI_Dir2d::GeomAPI_Dir2d(const boost::shared_ptr<GeomAPI_XY>& theCoords)
18 : GeomAPI_Interface(new gp_Dir2d(theCoords->x(), theCoords->y()))
22 double GeomAPI_Dir2d::x() const
27 double GeomAPI_Dir2d::y() const
32 const boost::shared_ptr<GeomAPI_XY> GeomAPI_Dir2d::xy()
34 return boost::shared_ptr<GeomAPI_XY>(new GeomAPI_XY(MY_DIR->X(), MY_DIR->Y()));
37 double GeomAPI_Dir2d::dot(const boost::shared_ptr<GeomAPI_Dir2d>& theArg) const
39 return MY_DIR->Dot(theArg->impl<gp_Dir2d>());
42 double GeomAPI_Dir2d::cross(const boost::shared_ptr<GeomAPI_Dir2d>& theArg) const
44 return MY_DIR->XY().Crossed(theArg->impl<gp_Dir2d>().XY());