Changed the name of the Distance from point to plane

from DistancePointPlane
to     SignedDistancePointPlane
to underline the fact that it is SIGNED!!!
This commit is contained in:
Paolo Cignoni 2012-01-18 11:44:42 +00:00
parent 86617dd872
commit f4cf3b9221
3 changed files with 5 additions and 5 deletions

View File

@ -234,7 +234,7 @@ static void VertexFromPlane(MeshType &m, const Plane3<ScalarType> &pl)
{ {
VertexIterator vi; VertexIterator vi;
for(vi=m.vert.begin();vi!=m.vert.end();++vi) if(!(*vi).IsD()) for(vi=m.vert.begin();vi!=m.vert.end();++vi) if(!(*vi).IsD())
(*vi).Q() =DistancePlanePoint(pl,(*vi).cP()); (*vi).Q() =SignedDistancePlanePoint(pl,(*vi).cP());
} }
static void VertexFromGaussianCurvature(MeshType &m) static void VertexFromGaussianCurvature(MeshType &m)

View File

@ -341,7 +341,7 @@ namespace vcg {
const ScalarType EPS = ScalarType( 0.000001); const ScalarType EPS = ScalarType( 0.000001);
ScalarType b,b0,b1,b2; ScalarType b,b0,b1,b2;
// Calcolo distanza punto piano // Calcolo distanza punto piano
ScalarType d = DistancePlanePoint( fPlane, q ); ScalarType d = SignedDistancePlanePoint( fPlane, q );
if( d>dist || d<-dist ) // Risultato peggiore: niente di fatto if( d>dist || d<-dist ) // Risultato peggiore: niente di fatto
return false; return false;

View File

@ -141,15 +141,15 @@ typedef Plane3<float> Plane3f;
typedef Plane3<double> Plane3d; typedef Plane3<double> Plane3d;
///Distance plane - point and vv. (Move these function to somewhere else) ///Distance plane - point and vv. (Move these function to somewhere else)
template<class T> T DistancePlanePoint(const Plane3<T,true> & plane, const Point3<T> & point) template<class T> T SignedDistancePlanePoint(const Plane3<T,true> & plane, const Point3<T> & point)
{ {
return plane.Direction().dot(point) - plane.Offset(); return plane.Direction().dot(point) - plane.Offset();
} }
template<class T> T DistancePointPlane(const Point3<T> & point, const Plane3<T,true> & plane) template<class T> T SignedDistancePointPlane(const Point3<T> & point, const Plane3<T,true> & plane)
{ {
return DistancePlanePoint(plane, point); return SignedDistancePlanePoint(plane, point);
} }
} // end namespace } // end namespace