add index-to-box conversion

This commit is contained in:
Massimiliano Corsini 2009-01-15 15:30:07 +00:00
parent d0ad7cbacc
commit a7c15f807d
1 changed files with 16 additions and 1 deletions

View File

@ -153,6 +153,21 @@ public:
p += bbox.min;
}
/* Given a cell index return the corresponding box
* @param integer coordinates pi of the cell
* @return b is the corresponding box in <ScalarType> coordinates
*/
inline void IPiToBox(const Point3i & pi, Box3x & b ) const
{
CoordType p;
p[0] = ((ScalarType)pi[0])*voxel[0];
p[1] = ((ScalarType)pi[1])*voxel[1];
p[2] = ((ScalarType)pi[2])*voxel[2];
p += bbox.min;
b.min = p;
b.max = (p + voxel);
}
// Same of above but for the case that you just want to transform
// from a space to the other.
inline void IPfToPf(const CoordType & pi, CoordType &p ) const