The VT is stored in each grid cell.
BoundinBox3D bb(VectorD<3>(10,10,10), VectorD<3>(100,100,100)); typdef Grid3D<Ints> Grid; Grid grid(5, bb, 0.0);
BoundingBoxD<3> bb(VectorD<3>(20.2,20.3,20.5), VectorD<3>(31.3,32.5,38.9)); for (Grid::IndexIterator it= grid.voxels_begin(bb); it != grid.voxels_end(bb); ++it) { it->push_back(1); }
Public Types | |
typedef VT | Voxel |
The type stored in each voxel. | |
Public Member Functions | |
BoundingBoxD< 3 > | get_bounding_box () const |
unsigned int | get_number_of_voxels (unsigned int i) const |
Return the number of voxels in a certain direction. | |
VectorD< 3 > | get_unit_cell () const |
Return the unit cell. | |
const Voxel & | get_voxel (const VectorD< 3 > &v) const |
Grid3D () | |
An empty grid. | |
Grid3D (float side, const BoundingBoxD< 3 > &bb, Voxel def=Voxel()) | |
Initialize the grid. | |
Grid3D (int xd, int yd, int zd, const BoundingBoxD< 3 > &bb, Voxel def=Voxel()) | |
Initialize the grid. | |
const Voxel | operator[] (const VectorD< 3 > &v) const |
Get the data in a particular cell. | |
Voxel & | operator[] (const VectorD< 3 > &v) |
Get the data in a particular cell. | |
void | set_bounding_box (const BoundingBoxD< 3 > &bb3) |
Change the bounding box but not the grid or contents. | |
Voxel iterators | |
These iterators go through a range of voxels in the grid. These voxels include any that touch or are contained in the shape passed to the begin/end calls.
The value type is the contents of the voxel. | |
AllVoxelConstIterator | voxels_begin () const |
AllVoxelIterator | voxels_begin () |
VoxelConstIterator | voxels_begin (const BoundingBoxD< 3 > &bb) const |
VoxelIterator | voxels_begin (const BoundingBoxD< 3 > &bb) |
AllVoxelConstIterator | voxels_end () const |
AllVoxelIterator | voxels_end () |
VoxelConstIterator | voxels_end (const BoundingBoxD< 3 > &bb) const |
VoxelIterator | voxels_end (const BoundingBoxD< 3 > &bb) |
IMP::algebra::Grid3D< VT >::Grid3D | ( | int | xd, | |
int | yd, | |||
int | zd, | |||
const BoundingBoxD< 3 > & | bb, | |||
Voxel | def = Voxel() | |||
) |
Initialize the grid.
[in] | xd | The number of voxels in the x direction |
[in] | yd | The number of voxels in the y direction |
[in] | zd | The number of voxels in the z direction |
[in] | bb | The bounding box. |
[in] | def | The default value for the voxels |
IMP::algebra::Grid3D< VT >::Grid3D | ( | float | side, | |
const BoundingBoxD< 3 > & | bb, | |||
Voxel | def = Voxel() | |||
) |
Initialize the grid.
[in] | side | The side length for the voxels |
[in] | bb | The bounding box. Note that the final bounding box might be slightly different as the actual grid size must be divisible by the voxel side. |
[in] | def | The default value for the voxels |