From d41a88bfe53d26f9280c056688491c5b2469758b Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 29 Jan 2009 00:17:31 +0000 Subject: [PATCH] added handy constructor with the base mesh to vertex/face marker functors --- vcg/complex/trimesh/closest.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vcg/complex/trimesh/closest.h b/vcg/complex/trimesh/closest.h index 589de46a..564e4032 100644 --- a/vcg/complex/trimesh/closest.h +++ b/vcg/complex/trimesh/closest.h @@ -146,6 +146,7 @@ namespace vcg { MESH_TYPE *m; public: Tmark(){} + Tmark( MESH_TYPE *m) {SetMesh(m);} void UnMarkAll(){m->UnMarkAll();} bool IsMarked(OBJ_TYPE* obj){return (m->IsMarked(obj));} void Mark(OBJ_TYPE* obj){m->Mark(obj);} @@ -155,7 +156,11 @@ namespace vcg { template class FaceTmark:public Tmark - {}; + { + public: + FaceTmark() {} + FaceTmark(MESH_TYPE *m) {this->SetMesh(m);} + }; template class VertTmark @@ -164,6 +169,7 @@ namespace vcg { typedef typename MESH_TYPE::VertexType VertexType; VertTmark(){} + VertTmark(MESH_TYPE *){} void UnMarkAll(){} bool IsMarked(VertexType*) { return false; } void Mark(VertexType*){} @@ -195,8 +201,7 @@ namespace vcg { typedef Point3 Point3x; typedef FaceTmark MarkerFace; - MarkerFace mf; - mf.SetMesh(&mesh); + MarkerFace mf(&mesh); vcg::face::PointDistanceFunctor FDistFunct; _minDist=_maxDist; typename MESH::FaceType* bestf= gr.GetClosest(FDistFunct, mf, _p, _maxDist, _minDist, _closestPt);