corrected bounds check in the cell scan in _IsInHTable

This commit is contained in:
Paolo Cignoni 2006-08-31 13:26:17 +00:00
parent 7fb7f4b401
commit be5317d84c
1 changed files with 12 additions and 13 deletions
vcg/space/index

View File

@ -30,6 +30,10 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.21 2006/08/23 15:23:05 marfr960
added comments
corrected bad reference in void Grid( const Point3i & _c, CellIterator & first, CellIterator & last )
Revision 1.20 2006/07/26 08:12:56 pietroni Revision 1.20 2006/07/26 08:12:56 pietroni
added InitEmpty Function added InitEmpty Function
@ -269,21 +273,16 @@ namespace vcg{
return false; return false;
std::pair<IteHtable, IteHtable> p = hash_table.equal_range(h); std::pair<IteHtable, IteHtable> p = hash_table.equal_range(h);
IteHtable i = p.first;
bool found = false; bool found = false;
if ( ((*i).second.CellN() == cell) ) IteHtable i;
found = true; for (i = p.first; i != p.second; i++)
else
{ {
do { if ( ((*i).second.CellN() == cell) )
i++; {
if ((*i).second.CellN() == cell) found = true;
{ break;
found = true; }
break;
}
} while (i != p.second);
} }
if (!found) /// the scan is terminated and if (!found) /// the scan is terminated and
@ -386,7 +385,7 @@ namespace vcg{
OBJITER i; OBJITER i;
Box3x b; Box3x b;
Box3x &bbox = this->bbox; Box3x &bbox = this->bbox;
CoordType &dim = this->dim; CoordType &dim = this->dim;
Point3i &siz = this->siz; Point3i &siz = this->siz;
CoordType &voxel = this->voxel; CoordType &voxel = this->voxel;