-//function : Distance
-//purpose :
-//=======================================================================
-Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
- const gp_Sphere& aSph)
-{
- Standard_Real aD;
- //
- const gp_Pnt& aLoc=aSph.Location();
- aD=aLoc.Distance(aP);
- //
- return aD;
-}
-//=======================================================================
-//function : Distance
-//purpose :
-//=======================================================================
-Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
- const gp_Cylinder& aCyl)
-{
- Standard_Real aD;
- //
- const gp_Ax1& aAxis=aCyl.Axis();
- gp_Lin aLin(aAxis);
- aD=aLin.Distance(aP);
- //
- return aD;
-}
-//=======================================================================
-//function : Distance
-//purpose :
-//=======================================================================
-Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
- const gp_Pln& aPL)
-{
- Standard_Real aD;
- //
- const gp_Ax3& aPos=aPL.Position();
- const gp_Pnt& aLoc=aPos.Location ();
- const gp_Dir& aDir=aPos.Direction();
- //
- aD= (aDir.X() * (aP.X() - aLoc.X()) +
- aDir.Y() * (aP.Y() - aLoc.Y()) +
- aDir.Z() * (aP.Z() - aLoc.Z()));
- return aD;
-}
-//=======================================================================