46 template<
class T,
typename REAL =
float>
55 build (
const REAL bounds[6],
int num_of_voxels[3]);
67 getVoxel (
int x,
int y,
int z)
const;
166 #include <pcl/recognition/impl/ransac_based/voxel_structure.hpp>
This class is a box in R3 built of voxels ordered in a regular rectangular grid.
void build(const REAL bounds[6], int num_of_voxels[3])
Call this method before using an instance of this class.
const REAL * getVoxelSpacing() const
Returns the voxel spacing in x, y and z direction.
T * getVoxel(const REAL p[3])
Returns a pointer to the voxel which contains p or NULL if p is not inside the structure.
const float * getBounds() const
Returns the bounds of the voxel structure, which is pointer to the internal array of 6 doubles: (min_...
int getNumberOfVoxels() const
Returns the total number of voxels.
void compute3dId(int linear_id, int id3d[3]) const
Converts a linear id to a 3D id, i.e., computes the integer 3D coordinates of a voxel from its positi...
const int * getNumberOfVoxelsXYZ() const
Returns the number of voxels in x, y and z direction.
const T * getVoxels() const
Returns the linear voxel array.
int num_of_voxels_xy_plane_
void clear()
Release the memory allocated for the voxels.
int getNeighbors(const REAL *p, T **neighs) const
Saves pointers to the voxels which are neighbors of the voxels which contains 'p'.
T * getVoxels()
Returns the linear voxel array.
void computeVoxelCenter(const int id3[3], REAL center[3]) const
Computes the center of the voxel with given integer coordinates.
void getBounds(REAL b[6]) const
Copies the bounds of the voxel structure to 'b'.
virtual ~VoxelStructure()