X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pnt.cpp;h=29fe933a668f87ddfab4985fbf3ff1b910e12c6a;hb=60e95a5502a6940c6c27ce5d561b3c684b0b0a4f;hp=d9bc12b6f5704927313f93c22b19f43e20822e22;hpb=3efd29f07fa128246690fd24a3439048b5e95878;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Pnt.cpp b/src/GeomAPI/GeomAPI_Pnt.cpp index d9bc12b6f..29fe933a6 100644 --- a/src/GeomAPI/GeomAPI_Pnt.cpp +++ b/src/GeomAPI/GeomAPI_Pnt.cpp @@ -8,8 +8,11 @@ #include #include #include +#include #include +#include +#include #define MY_PNT static_cast(myImpl) @@ -82,3 +85,13 @@ void GeomAPI_Pnt::translate(const std::shared_ptr& theDir, double t aVec.Multiply(theDist); MY_PNT->Translate(aVec); } + +std::shared_ptr GeomAPI_Pnt::to2D(const std::shared_ptr& thePln) const +{ + double aA, aB, aC, aD; + thePln->coefficients(aA, aB, aC, aD); + gp_Pln aPln(aA, aB, aC, aD); + + gp_Pnt2d aRes = ProjLib::Project(aPln, *MY_PNT); + return std::shared_ptr(new GeomAPI_Pnt2d(aRes.X(), aRes.Y())); +}