X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_XYZ.cpp;h=22588c1ed63e303885758c2868472c2e5cd9635b;hb=fe3678a85238df2b57ea18b341003ebef176e287;hp=3cc18eeb166de29e93f99f67f330ef3928eaf620;hpb=773b6bcbbd4a811340e699667014b13185f80dbc;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_XYZ.cpp b/src/GeomAPI/GeomAPI_XYZ.cpp index 3cc18eeb1..22588c1ed 100644 --- a/src/GeomAPI/GeomAPI_XYZ.cpp +++ b/src/GeomAPI/GeomAPI_XYZ.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAPI_XYZ.cpp // Created: 23 Apr 2014 // Author: Mikhail PONIKAROV @@ -6,11 +8,12 @@ #include -#define MY_XYZ static_cast(myImpl) +#define MY_XYZ implPtr() GeomAPI_XYZ::GeomAPI_XYZ(const double theX, const double theY, const double theZ) - : GeomAPI_Interface(new gp_XYZ(theX, theY, theZ)) -{} + : GeomAPI_Interface(new gp_XYZ(theX, theY, theZ)) +{ +} double GeomAPI_XYZ::x() const { @@ -42,33 +45,42 @@ void GeomAPI_XYZ::setZ(const double theZ) return MY_XYZ->SetZ(theZ); } -const boost::shared_ptr GeomAPI_XYZ::added( - const boost::shared_ptr& theArg) +const std::shared_ptr GeomAPI_XYZ::added( + const std::shared_ptr& theArg) +{ + std::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() + theArg->x(), + MY_XYZ->Y() + theArg->y(), MY_XYZ->Z() + theArg->z())); + return aResult; +} + +const std::shared_ptr GeomAPI_XYZ::decreased( + const std::shared_ptr& theArg) { - boost::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() + theArg->x(), - MY_XYZ->Y() + theArg->y(), MY_XYZ->Z() + theArg->z())); + std::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() - theArg->x(), + MY_XYZ->Y() - theArg->y(), MY_XYZ->Z() - theArg->z())); return aResult; } -const boost::shared_ptr GeomAPI_XYZ::multiplied(const double theArg) +const std::shared_ptr GeomAPI_XYZ::multiplied(const double theArg) { - boost::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg, - MY_XYZ->Y() * theArg, MY_XYZ->Z() * theArg)); + std::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg, + MY_XYZ->Y() * theArg, MY_XYZ->Z() * theArg)); return aResult; } -double GeomAPI_XYZ::dot(const boost::shared_ptr& theArg) const +double GeomAPI_XYZ::dot(const std::shared_ptr& theArg) const { return MY_XYZ->Dot(theArg->impl()); } -const boost::shared_ptr GeomAPI_XYZ::cross(const boost::shared_ptr& theArg) const +const std::shared_ptr GeomAPI_XYZ::cross( + const std::shared_ptr& theArg) const { gp_XYZ aResult = MY_XYZ->Crossed(theArg->impl()); - return boost::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); + return std::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); } -double GeomAPI_XYZ::distance(const boost::shared_ptr& theOther) const +double GeomAPI_XYZ::distance(const std::shared_ptr& theOther) const { gp_XYZ aResult(theOther->x() - x(), theOther->y() - y(), theOther->z() - z()); return aResult.Modulus();