From c097e6edd5fa7d21483b03f1c324236c50399b45 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Wed, 21 Dec 2011 16:13:07 +0000 Subject: [PATCH] added GetClosestVertexScale --- vcg/complex/algorithms/closest.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 )