diff --git a/vcg/complex/algorithms/closest.h b/vcg/complex/algorithms/closest.h index e6fa0faf..2b3924e9 100644 --- a/vcg/complex/algorithms/closest.h +++ b/vcg/complex/algorithms/closest.h @@ -180,6 +180,23 @@ namespace vcg { return (gr.template GetClosest(fn,mv,_p,_maxDist,_minDist,_closestPt)); } + template + typename MESH::VertexType * GetClosestVertexScale( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, + const typename MESH::CoordType & center, const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist ) + { + typedef typename GRID::ScalarType ScalarType; + typedef Point3 Point3x; + typedef VertTmark MarkerVert; + MarkerVert mv; + mv.SetMesh(&mesh); + typedef vcg::vertex::PointScaledDistanceFunctor VDistFunct; + VDistFunct fn; + fn.Cen() = center; + _minDist=_maxDist; + Point3x _closestPt; + return (gr.template GetClosest(fn,mv,_p,_maxDist,_minDist,_closestPt)); + } + template typename MESH::VertexType * GetClosestVertexNormal( MESH & mesh,GRID & gr,const typename MESH::VertexType & _p, const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist )