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))
16 double GeomAPI_XYZ::x() const
21 double GeomAPI_XYZ::y() const
26 double GeomAPI_XYZ::z() const
31 void GeomAPI_XYZ::setX(const double theX)
33 return MY_XYZ->SetX(theX);
36 void GeomAPI_XYZ::setY(const double theY)
38 return MY_XYZ->SetY(theY);
41 void GeomAPI_XYZ::setZ(const double theZ)
43 return MY_XYZ->SetZ(theZ);
46 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::added(
47 const boost::shared_ptr<GeomAPI_XYZ>& theArg)
49 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() + theArg->x(),
50 MY_XYZ->Y() + theArg->y(), MY_XYZ->Z() + theArg->z()));
54 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::decreased(
55 const boost::shared_ptr<GeomAPI_XYZ>& theArg)
57 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() - theArg->x(),
58 MY_XYZ->Y() - theArg->y(), MY_XYZ->Z() - theArg->z()));
62 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::multiplied(const double theArg)
64 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg,
65 MY_XYZ->Y() * theArg, MY_XYZ->Z() * theArg));
69 double GeomAPI_XYZ::dot(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const
71 return MY_XYZ->Dot(theArg->impl<gp_XYZ>());
74 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::cross(
75 const boost::shared_ptr<GeomAPI_XYZ>& theArg) const
77 gp_XYZ aResult = MY_XYZ->Crossed(theArg->impl<gp_XYZ>());
78 return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z()));
81 double GeomAPI_XYZ::distance(const boost::shared_ptr<GeomAPI_XYZ>& theOther) const
83 gp_XYZ aResult(theOther->x() - x(), theOther->y() - y(), theOther->z() - z());
84 return aResult.Modulus();