1 // File: GeomAPI_XY.cpp
2 // Created: 30 May 2014
3 // Author: Artem ZHIDKOV
9 #define MY_XY static_cast<gp_XY*>(myImpl)
11 GeomAPI_XY::GeomAPI_XY(const double theX, const double theY)
12 : GeomAPI_Interface(new gp_XY(theX, theY))
16 double GeomAPI_XY::x() const
21 double GeomAPI_XY::y() const
26 void GeomAPI_XY::setX(const double theX)
28 return MY_XY->SetX(theX);
31 void GeomAPI_XY::setY(const double theY)
33 return MY_XY->SetY(theY);
36 const boost::shared_ptr<GeomAPI_XY> GeomAPI_XY::added(const boost::shared_ptr<GeomAPI_XY>& theArg)
38 boost::shared_ptr<GeomAPI_XY> aResult(new GeomAPI_XY(MY_XY->X() + theArg->x(), MY_XY->Y() + theArg->y()));
42 const boost::shared_ptr<GeomAPI_XY> GeomAPI_XY::multiplied(const double theArg)
44 boost::shared_ptr<GeomAPI_XY> aResult(new GeomAPI_XY(MY_XY->X() * theArg, MY_XY->Y() * theArg));
48 double GeomAPI_XY::dot(const boost::shared_ptr<GeomAPI_XY>& theArg) const
50 return MY_XY->Dot(theArg->impl<gp_XY>());
53 double GeomAPI_XY::cross(const boost::shared_ptr<GeomAPI_XY>& theArg) const
55 return MY_XY->Crossed(theArg->impl<gp_XY>());
58 double GeomAPI_XY::distance(const boost::shared_ptr<GeomAPI_XY>& theOther) const
60 gp_XY aResult(theOther->x() - x(), theOther->y() - y());
61 return aResult.Modulus();