1 // File: GeomAPI_XYZ.cpp
2 // Created: 23 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #include<GeomAPI_XYZ.h>
9 #define MY_XYZ static_cast<gp_XYZ*>(myImpl)
11 GeomAPI_XYZ::GeomAPI_XYZ(const double theX, const double theY, const double theZ)
12 : GeomAPI_Interface(new gp_XYZ(theX, theY, theZ))
15 double GeomAPI_XYZ::x() const
20 double GeomAPI_XYZ::y() const
25 double GeomAPI_XYZ::z() const
30 void GeomAPI_XYZ::setX(const double theX)
32 return MY_XYZ->SetX(theX);
35 void GeomAPI_XYZ::setY(const double theY)
37 return MY_XYZ->SetY(theY);
40 void GeomAPI_XYZ::setZ(const double theZ)
42 return MY_XYZ->SetZ(theZ);
45 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::added(
46 const boost::shared_ptr<GeomAPI_XYZ>& theArg)
48 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() + theArg->x(),
49 MY_XYZ->Y() + theArg->y(), MY_XYZ->Z() + theArg->z()));
53 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::decreased(
54 const boost::shared_ptr<GeomAPI_XYZ>& theArg)
56 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() - theArg->x(),
57 MY_XYZ->Y() - theArg->y(), MY_XYZ->Z() - theArg->z()));
61 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::multiplied(const double theArg)
63 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg,
64 MY_XYZ->Y() * theArg, MY_XYZ->Z() * theArg));
68 double GeomAPI_XYZ::dot(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const
70 return MY_XYZ->Dot(theArg->impl<gp_XYZ>());
73 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::cross(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const
75 gp_XYZ aResult = MY_XYZ->Crossed(theArg->impl<gp_XYZ>());
76 return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z()));
79 double GeomAPI_XYZ::distance(const boost::shared_ptr<GeomAPI_XYZ>& theOther) const
81 gp_XYZ aResult(theOther->x() - x(), theOther->y() - y(), theOther->z() - z());
82 return aResult.Modulus();