added if (!l->Elem()->IsD()) test on each element

This commit is contained in:
Nico Pietroni 2005-02-08 17:49:38 +00:00
parent 5613d4c584
commit 06adb386ad
1 changed files with 22 additions and 14 deletions

View File

@ -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<SCALAR> & 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<SCALAR> & 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());
}
}
}
}