From 17623f1cbe762ae6cbe52f4fa502a9d703b47a13 Mon Sep 17 00:00:00 2001 From: ponchio Date: Thu, 23 Sep 2004 13:44:25 +0000 Subject: [PATCH] Removed SetSafeBBox. SetBBox is now safe enough. --- vcg/space/index/grid_static_ptr.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/vcg/space/index/grid_static_ptr.h b/vcg/space/index/grid_static_ptr.h index 93c17eeb..03b0108c 100644 --- a/vcg/space/index/grid_static_ptr.h +++ b/vcg/space/index/grid_static_ptr.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.7 2004/09/09 12:44:39 fasano +included stdio.h + Revision 1.6 2004/09/09 08:39:29 ganovelli minor changes for gcc @@ -229,21 +232,17 @@ class GridStaticPtr last = *(g+1); } - /// Setta il bounding box della griglia + /// Set the bounding box of the grid + ///We need some extra space for numerical precision. void SetBBox( const Box3x & b ) { bbox = b; + float t = bbox.Diag()/100.0; + if(t = 0) t = 0.0000001; + bbox.Offset(t); dim = b.max - b.min; } - void SetSafeBBox( const Box3x & b ) - { - Box3x btmp=b; - btmp.InflateFix(0.01); - bbox = btmp; - dim = bbox.max - bbox.min; - } - /// Dato un punto 3d ritorna l'indice del box corrispondente inline void PToIP(const Point3x & p, Point3i &pi ) const { @@ -403,9 +402,9 @@ class GridStaticPtr bb.Intersect(bbox); if(! bb.IsNull() ) { + Box3i ib; // Boundig box in voxels BoxToIBox( bb,ib ); - int x,y,z; for(z=ib.min[2];z<=ib.max[2];++z) {