From 46031c54ca317544b25567fb45534231b8950b65 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Thu, 9 Oct 2014 12:53:40 +0000 Subject: [PATCH] added GetClosestEdgeBase from space/index/index2/closest_2d.h which is going to be removed --- 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 573979dd..d51b32f5 100644 --- a/vcg/complex/algorithms/closest.h +++ b/vcg/complex/algorithms/closest.h @@ -494,6 +494,23 @@ namespace vcg { }; + /// this is for meshes with 2D coordinates + template + typename MESH::FaceType * GetClosestEdgeBase( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, + const typename GRID::ScalarType _maxDist,typename GRID::ScalarType & _minDist, + typename GRID::CoordType &_closestPt) + { + typedef typename GRID::ScalarType ScalarType; + typedef Point3 Point3x; + typedef FaceTmark MarkerFace; + MarkerFace mf; + mf.SetMesh(&mesh); + vcg::PointSegment2DEPFunctor PDistFunct; + _minDist=_maxDist; + return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt)); + } + + } // end namespace tri } // end namespace vcg