// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
//
#include <GeomAPI_Lin.h>
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()));
}