Added the method GetClosestFaceNormal, that use the functor PointNormalDistanceFunctor.

This commit is contained in:
Paolo Cignoni 2009-05-23 20:10:48 +00:00
parent cb7b4db79c
commit a0a965f17c
1 changed files with 16 additions and 0 deletions

View File

@ -252,6 +252,22 @@ namespace vcg {
return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt)); return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt));
} }
template <class MESH, class GRID>
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<MESH> MarkerFace;
MarkerFace mf;
mf.SetMesh(&mesh);
typedef vcg::face::PointNormalDistanceFunctor<typename MESH::VertexType> PDistFunct;
PDistFunct fn;
_minDist=_maxDist;
//return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt.P()));
return (gr.template GetClosest <PDistFunct,MarkerFace>(fn,mf,_p,_maxDist,_minDist,_closestPt));
}
template <class MESH, class GRID> template <class MESH, class GRID>
typename MESH::VertexType * GetClosestVertex( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, typename MESH::VertexType * GetClosestVertex( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist ) const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist )