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 )