From 06adb386ad4f86f0e7e44373595e719020942270 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Tue, 8 Feb 2005 17:49:38 +0000 Subject: [PATCH] added if (!l->Elem()->IsD()) test on each element --- vcg/complex/trimesh/closest.h | 36 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/vcg/complex/trimesh/closest.h b/vcg/complex/trimesh/closest.h index 4060cd22..b9f83be7 100644 --- a/vcg/complex/trimesh/closest.h +++ b/vcg/complex/trimesh/closest.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.4 2005/01/28 12:00:33 cignoni +small gcc compiling issues for namespaces + Revision 1.3 2005/01/24 11:47:23 cignoni Now used also by the official Metro Removed using namespace (NEVER IN HEADERS!) @@ -128,17 +131,19 @@ void Closest( MESH & mesh, const Point3 & p, GRID & gr, SCALAR & mdist, A2UGridLink *first, *last, *l; gr.Grid( gx, gy, gz, first, last ); for(l=first;l!=last;++l) - + if (!l->Elem()->IsD()) + { if( ! mesh.IsMarked( &*(l->Elem())) ) - { - if( face::PointDistance((*(l->Elem())), p, error, q) ) { - bestq = q; - bestf = l->Elem(); - } + if( face::PointDistance((*(l->Elem())), p, error, q) ) + { + bestq = q; + bestf = l->Elem(); + } - mesh.Mark( &*(l->Elem()) ); - } + mesh.Mark( &*(l->Elem()) ); + } + } } else { @@ -156,14 +161,17 @@ void Closest( MESH & mesh, const Point3 & p, GRID & gr, SCALAR & mdist, A2UGridLink *first, *last, *l; gr.Grid( ix, iy, iz, first, last ); for(l=first;l!=last;++l) - if( ! mesh.IsMarked( &*(l->Elem())) ) + if (!l->Elem()->IsD()) { - if( vcg::face::PointDistance((*(l->Elem())), p, error, q) ) + if( ! mesh.IsMarked( &*(l->Elem())) ) { - bestq = q; - bestf = l->Elem(); - } - mesh.Mark(&*l->Elem()); + if( vcg::face::PointDistance((*(l->Elem())), p, error, q) ) + { + bestq = q; + bestf = l->Elem(); + } + mesh.Mark(&*l->Elem()); + } } } }