X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Dir.cpp;h=5c42d68a0d9e6afc35664479468a23ca8701ee89;hb=aa48919bb1ecb71f07d9ac5fcd1bad170e7ed547;hp=bf0941c31c09618517492ff3bef9e72ec96cc58d;hpb=84c21dd48f2b4be389dfa4042bc8084589c5e521;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Dir.cpp b/src/GeomAPI/GeomAPI_Dir.cpp index bf0941c31..5c42d68a0 100644 --- a/src/GeomAPI/GeomAPI_Dir.cpp +++ b/src/GeomAPI/GeomAPI_Dir.cpp @@ -1,16 +1,25 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAPI_Dir.cpp // Created: 23 Apr 2014 // Author: Mikhail PONIKAROV -#include +#include +#include -#include +#include -#define MY_DIR static_cast(myImpl) +#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 std::shared_ptr& theCoords) + : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z())) +{ +} double GeomAPI_Dir::x() const { @@ -26,3 +35,26 @@ double GeomAPI_Dir::z() const { return MY_DIR->Z(); } + +const std::shared_ptr GeomAPI_Dir::xyz() +{ + return std::shared_ptr(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z())); +} + +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()); +} +