From be5317d84cb842f187a753b6a0fca674bd9c548c Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Thu, 31 Aug 2006 13:26:17 +0000 Subject: [PATCH] corrected bounds check in the cell scan in _IsInHTable --- vcg/space/index/spatial_hashing.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/vcg/space/index/spatial_hashing.h b/vcg/space/index/spatial_hashing.h index fc61eff5..a422c52d 100644 --- a/vcg/space/index/spatial_hashing.h +++ b/vcg/space/index/spatial_hashing.h @@ -30,6 +30,10 @@ History $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 added InitEmpty Function @@ -269,21 +273,16 @@ namespace vcg{ return false; std::pair p = hash_table.equal_range(h); - IteHtable i = p.first; bool found = false; - if ( ((*i).second.CellN() == cell) ) - found = true; - else + IteHtable i; + for (i = p.first; i != p.second; i++) { - do { - i++; - if ((*i).second.CellN() == cell) - { - found = true; - break; - } - } while (i != p.second); + if ( ((*i).second.CellN() == cell) ) + { + found = true; + break; + } } if (!found) /// the scan is terminated and @@ -386,7 +385,7 @@ namespace vcg{ OBJITER i; Box3x b; - Box3x &bbox = this->bbox; + Box3x &bbox = this->bbox; CoordType &dim = this->dim; Point3i &siz = this->siz; CoordType &voxel = this->voxel;