From a0a965f17ce400d52a40275caeb3ac97d22e642d Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Sat, 23 May 2009 20:10:48 +0000 Subject: [PATCH] Added the method GetClosestFaceNormal, that use the functor PointNormalDistanceFunctor. --- vcg/complex/trimesh/closest.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vcg/complex/trimesh/closest.h b/vcg/complex/trimesh/closest.h index f9c78637..5585081a 100644 --- a/vcg/complex/trimesh/closest.h +++ b/vcg/complex/trimesh/closest.h @@ -252,6 +252,22 @@ namespace vcg { return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt)); } + template + typename MESH::FaceType * GetClosestFaceNormal(MESH & mesh,GRID & gr,const typename MESH::VertexType & _p, + const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist, + typename GRID::CoordType &_closestPt) + { + typedef typename GRID::ScalarType ScalarType; + typedef FaceTmark MarkerFace; + MarkerFace mf; + mf.SetMesh(&mesh); + typedef vcg::face::PointNormalDistanceFunctor PDistFunct; + PDistFunct fn; + _minDist=_maxDist; + //return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt.P())); + return (gr.template GetClosest (fn,mf,_p,_maxDist,_minDist,_closestPt)); + } + template typename MESH::VertexType * GetClosestVertex( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist )