X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Lin.cpp;h=d3f44a404aedef61c6d26e1c8625bf2a247f79d6;hb=696c11e9e4cb089e1c5496dac79420147d85496a;hp=5d31b18df67c33084c6726d907becdf8b253a288;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Lin.cpp b/src/GeomAPI/GeomAPI_Lin.cpp index 5d31b18df..d3f44a404 100644 --- a/src/GeomAPI/GeomAPI_Lin.cpp +++ b/src/GeomAPI/GeomAPI_Lin.cpp @@ -107,14 +107,21 @@ const std::shared_ptr GeomAPI_Lin::intersect( new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); } -const std::shared_ptr GeomAPI_Lin::project( - const std::shared_ptr& thePoint) const +double GeomAPI_Lin::projParam( + const std::shared_ptr& thePoint) const { const gp_XYZ& aDir = MY_LIN->Direction().XYZ(); const gp_XYZ& aLoc = MY_LIN->Location().XYZ(); const gp_XYZ& aPnt = thePoint->impl().XYZ(); - double aParam = aDir.Dot(aPnt - aLoc); + return aDir.Dot(aPnt - aLoc); +} +const std::shared_ptr GeomAPI_Lin::project( + const std::shared_ptr& thePoint) const +{ + const gp_XYZ& aDir = MY_LIN->Direction().XYZ(); + const gp_XYZ& aLoc = MY_LIN->Location().XYZ(); + double aParam = projParam(thePoint); gp_XYZ aResult = aLoc + aDir * aParam; return std::shared_ptr(new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); }