X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Dir.cpp;h=5c42d68a0d9e6afc35664479468a23ca8701ee89;hb=aa48919bb1ecb71f07d9ac5fcd1bad170e7ed547;hp=abe357b2bfc17e033ddd4af1644aa204ed3b3c5c;hpb=8a9a3ae0793503abf21a2c1b0a08d47d85449fc4;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Dir.cpp b/src/GeomAPI/GeomAPI_Dir.cpp index abe357b2b..5c42d68a0 100644 --- a/src/GeomAPI/GeomAPI_Dir.cpp +++ b/src/GeomAPI/GeomAPI_Dir.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAPI_Dir.cpp // Created: 23 Apr 2014 // Author: Mikhail PONIKAROV @@ -10,12 +12,14 @@ #define MY_DIR static_cast(myImpl) GeomAPI_Dir::GeomAPI_Dir(const double theX, const double theY, const double theZ) - : GeomAPI_Interface(new gp_Dir(theX, theY, theZ)) -{} + : GeomAPI_Interface(new gp_Dir(theX, theY, theZ)) +{ +} -GeomAPI_Dir::GeomAPI_Dir(const boost::shared_ptr& theCoords) - : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z())) -{} +GeomAPI_Dir::GeomAPI_Dir(const std::shared_ptr& theCoords) + : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z())) +{ +} double GeomAPI_Dir::x() const { @@ -32,12 +36,25 @@ double GeomAPI_Dir::z() const return MY_DIR->Z(); } -const boost::shared_ptr GeomAPI_Dir::xyz() +const std::shared_ptr GeomAPI_Dir::xyz() { - return boost::shared_ptr(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z())); + return std::shared_ptr(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z())); } -double GeomAPI_Dir::dot(const boost::shared_ptr& theArg) const +double GeomAPI_Dir::dot(const std::shared_ptr& theArg) const { return MY_DIR->Dot(theArg->impl()); } + +const std::shared_ptr GeomAPI_Dir::cross( + const std::shared_ptr& theArg) const +{ + gp_XYZ aResult = MY_DIR->XYZ().Crossed(theArg->impl().XYZ()); + return std::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); +} + +double GeomAPI_Dir::angle(const std::shared_ptr& theArg) const +{ + return MY_DIR->Angle(theArg->impl()); +} +