X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pnt.cpp;h=29fe933a668f87ddfab4985fbf3ff1b910e12c6a;hb=0448acdd8e8c1e1638a2cf861e42e915966b2034;hp=d9bc12b6f5704927313f93c22b19f43e20822e22;hpb=3d7368386762b057fff327d24d0079b4a73c3004;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())); +}