X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pnt.cpp;h=0cf67c2ad7ae7c5b506b685c7fc17d66fac336ee;hb=3d28bcbab2f3ed0e40295e64f4e836caebc19fca;hp=d9bc12b6f5704927313f93c22b19f43e20822e22;hpb=abcdb8af07666bf4ac9411fb73b19f395ee274bd;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Pnt.cpp b/src/GeomAPI/GeomAPI_Pnt.cpp index d9bc12b6f..0cf67c2ad 100644 --- a/src/GeomAPI/GeomAPI_Pnt.cpp +++ b/src/GeomAPI/GeomAPI_Pnt.cpp @@ -8,10 +8,13 @@ #include #include #include +#include #include +#include +#include -#define MY_PNT static_cast(myImpl) +#define MY_PNT implPtr() GeomAPI_Pnt::GeomAPI_Pnt(const double theX, const double theY, const double theZ) : GeomAPI_Interface(new gp_Pnt(theX, theY, theZ)) @@ -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())); +}