new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z()));
}
-const std::shared_ptr<GeomAPI_Pnt> GeomAPI_Lin::project(
- const std::shared_ptr<GeomAPI_Pnt>& thePoint) const
+double GeomAPI_Lin::projParam(
+ const std::shared_ptr<GeomAPI_Pnt>& thePoint) const
{
const gp_XYZ& aDir = MY_LIN->Direction().XYZ();
const gp_XYZ& aLoc = MY_LIN->Location().XYZ();
const gp_XYZ& aPnt = thePoint->impl<gp_Pnt>().XYZ();
- double aParam = aDir.Dot(aPnt - aLoc);
+ return aDir.Dot(aPnt - aLoc);
+}
+const std::shared_ptr<GeomAPI_Pnt> GeomAPI_Lin::project(
+ const std::shared_ptr<GeomAPI_Pnt>& 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<GeomAPI_Pnt>(new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z()));
}