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::multiplied(const double theArg)
55 boost::shared_ptr<GeomAPI_XYZ> aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg,
56 MY_XYZ->Y() * theArg, MY_XYZ->Z() * theArg));
60 double GeomAPI_XYZ::dot(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const
62 return MY_XYZ->Dot(theArg->impl<gp_XYZ>());
65 const boost::shared_ptr<GeomAPI_XYZ> GeomAPI_XYZ::cross(const boost::shared_ptr<GeomAPI_XYZ>& theArg) const
67 gp_XYZ aResult = MY_XYZ->Crossed(theArg->impl<gp_XYZ>());
68 return boost::shared_ptr<GeomAPI_XYZ>(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z()));
71 double GeomAPI_XYZ::distance(const boost::shared_ptr<GeomAPI_XYZ>& theOther) const
73 gp_XYZ aResult(theOther->x() - x(), theOther->y() - y(), theOther->z() - z());
74 return aResult.Modulus();