1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_XY.cpp
4 // Created: 30 May 2014
5 // Author: Artem ZHIDKOV
11 #define MY_XY implPtr<gp_XY>()
13 GeomAPI_XY::GeomAPI_XY(const double theX, const double theY)
14 : GeomAPI_Interface(new gp_XY(theX, theY))
18 double GeomAPI_XY::x() const
23 double GeomAPI_XY::y() const
28 void GeomAPI_XY::setX(const double theX)
30 return MY_XY->SetX(theX);
33 void GeomAPI_XY::setY(const double theY)
35 return MY_XY->SetY(theY);
38 const std::shared_ptr<GeomAPI_XY> GeomAPI_XY::added(const std::shared_ptr<GeomAPI_XY>& theArg)
40 std::shared_ptr<GeomAPI_XY> aResult(new GeomAPI_XY(
41 MY_XY->X() + theArg->x(), MY_XY->Y() + theArg->y()));
45 const std::shared_ptr<GeomAPI_XY> GeomAPI_XY::decreased(
46 const std::shared_ptr<GeomAPI_XY>& theArg)
48 std::shared_ptr<GeomAPI_XY> aResult(new GeomAPI_XY(
49 MY_XY->X() - theArg->x(), MY_XY->Y() - theArg->y()));
53 const std::shared_ptr<GeomAPI_XY> GeomAPI_XY::multiplied(const double theArg)
55 std::shared_ptr<GeomAPI_XY> aResult(new GeomAPI_XY(MY_XY->X() * theArg, MY_XY->Y() * theArg));
59 double GeomAPI_XY::dot(const std::shared_ptr<GeomAPI_XY>& theArg) const
61 return MY_XY->Dot(theArg->impl<gp_XY>());
64 double GeomAPI_XY::cross(const std::shared_ptr<GeomAPI_XY>& theArg) const
66 return MY_XY->Crossed(theArg->impl<gp_XY>());
69 double GeomAPI_XY::distance(const std::shared_ptr<GeomAPI_XY>& theOther) const
71 gp_XY aResult(theOther->x() - x(), theOther->y() - y());
72 return aResult.Modulus();