diff --git a/vcg/simplex/face/distance.h b/vcg/simplex/face/distance.h index c1d398a4..db845640 100644 --- a/vcg/simplex/face/distance.h +++ b/vcg/simplex/face/distance.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.8 2005/09/14 12:58:44 pietroni +changed min calls to Min of math.h of vcglib + Revision 1.7 2005/09/14 09:58:32 pietroni removed vcg::math::Min definition generate warnings @@ -224,7 +227,21 @@ namespace vcg { //dist = Distance(p,q); return true; } - + + class PointDistanceFunctor { + public: + template + inline bool operator () (const FACETYPE & f, const Point3 & p, SCALARTYPE & minDist, Point3 & q) { + const Point3 fp = Point3::Construct(p); + Point3 fq; + typename FACETYPE::ScalarType md = (typename FACETYPE::ScalarType)(minDist); + const bool ret = PointDistance(f, fp, md, fq); + minDist = (SCALARTYPE)(md); + q = Point3::Construct(fq); + return (ret); + } + }; + } // end namespace face } // end namespace vcg