This class is a box in R3 built of voxels ordered in a regular rectangular grid. Each voxel is of type T. More...
#include <voxel_structure.h>
Public Member Functions | |
void | build (const REAL bounds[6], int num_of_voxels[3]) |
Call this method before using an instance of this class. Parameter meaning is obvious. | |
void | clear () |
Release the memory allocated for the 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 position in the voxel array. | |
void | computeVoxelCenter (const int id3[3], REAL center[3]) const |
Computes the center of the voxel with given integer coordinates. | |
const float * | getBounds () const |
Returns the bounds of the voxel structure, which is pointer to the internal array of 6 doubles: (min_x, max_x, min_y, max_y, min_z, max_z). | |
void | getBounds (REAL b[6]) const |
Copies the bounds of the voxel structure to 'b'. | |
int | getNeighbors (const REAL *p, T **neighs) const |
Saves pointers to the voxels which are neighbors of the voxels which contains 'p'. The containing voxel is returned too. 'neighs' has to be an array of pointers with space for at least 27 pointers (27 = 3^3 which is the max number of neighbors). The. | |
int | getNumberOfVoxels () const |
Returns the total number of voxels. | |
const int * | getNumberOfVoxelsXYZ () const |
Returns the number of voxels 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. | |
T * | getVoxel (int x, int y, int z) const |
Returns a pointer to the voxel with integer id (x,y,z) or NULL if (x,y,z) is out of bounds. | |
const T * | getVoxels () const |
Returns the linear voxel array. | |
T * | getVoxels () |
Returns the linear voxel array. | |
const REAL * | getVoxelSpacing () const |
Returns the voxel spacing in x, y and z direction. That's the same as the voxel size along each axis. | |
VoxelStructure () | |
virtual | ~VoxelStructure () |
Protected Attributes | |
REAL | bounds_ [6] |
REAL | min_center_ [3] |
int | num_of_voxels_ [3] |
int | num_of_voxels_xy_plane_ |
REAL | spacing_ [3] |
int | total_num_of_voxels_ |
T * | voxels_ |
This class is a box in R3 built of voxels ordered in a regular rectangular grid. Each voxel is of type T.
Definition at line 50 of file voxel_structure.h.
pcl::recognition::VoxelStructure< T, REAL >::VoxelStructure | ( | ) | [inline] |
Definition at line 53 of file voxel_structure.h.
virtual pcl::recognition::VoxelStructure< T, REAL >::~VoxelStructure | ( | ) | [inline, virtual] |
Definition at line 54 of file voxel_structure.h.
void pcl::recognition::VoxelStructure< T, REAL >::build | ( | const REAL | bounds[6], |
int | num_of_voxels[3] | ||
) | [inline] |
Call this method before using an instance of this class. Parameter meaning is obvious.
Definition at line 43 of file voxel_structure.hpp.
void pcl::recognition::VoxelStructure< T, REAL >::clear | ( | ) | [inline] |
Release the memory allocated for the voxels.
Definition at line 62 of file voxel_structure.h.
void pcl::recognition::VoxelStructure< T, REAL >::compute3dId | ( | int | linear_id, |
int | id3d[3] | ||
) | const [inline] |
Converts a linear id to a 3D id, i.e., computes the integer 3D coordinates of a voxel from its position in the voxel array.
[in] | linear_id | the position of the voxel in the internal voxel array. |
[out] | id3d | an array of 3 integers for the integer coordinates of the voxel. |
Definition at line 91 of file voxel_structure.h.
void pcl::recognition::VoxelStructure< T, REAL >::computeVoxelCenter | ( | const int | id3[3], |
REAL | center[3] | ||
) | const [inline] |
Computes the center of the voxel with given integer coordinates.
[in] | id3 | the integer coordinates along the x, y and z axis. |
[out] | center |
Definition at line 114 of file voxel_structure.h.
const float* pcl::recognition::VoxelStructure< T, REAL >::getBounds | ( | ) | const [inline] |
Returns the bounds of the voxel structure, which is pointer to the internal array of 6 doubles: (min_x, max_x, min_y, max_y, min_z, max_z).
Definition at line 130 of file voxel_structure.h.
void pcl::recognition::VoxelStructure< T, REAL >::getBounds | ( | REAL | b[6] | ) | const [inline] |
Copies the bounds of the voxel structure to 'b'.
Definition at line 137 of file voxel_structure.h.
int pcl::recognition::VoxelStructure< T, REAL >::getNeighbors | ( | const REAL * | p, |
T ** | neighs | ||
) | const [inline] |
Saves pointers to the voxels which are neighbors of the voxels which contains 'p'. The containing voxel is returned too. 'neighs' has to be an array of pointers with space for at least 27 pointers (27 = 3^3 which is the max number of neighbors). The.
Definition at line 105 of file voxel_structure.hpp.
int pcl::recognition::VoxelStructure< T, REAL >::getNumberOfVoxels | ( | ) | const [inline] |
Returns the total number of voxels.
Definition at line 123 of file voxel_structure.h.
const int* pcl::recognition::VoxelStructure< T, REAL >::getNumberOfVoxelsXYZ | ( | ) | const [inline] |
Returns the number of voxels in x, y and z direction.
Definition at line 104 of file voxel_structure.h.
T * pcl::recognition::VoxelStructure< T, REAL >::getVoxel | ( | const REAL | p[3] | ) | [inline] |
Returns a pointer to the voxel which contains p or NULL if p is not inside the structure.
Definition at line 78 of file voxel_structure.hpp.
T * pcl::recognition::VoxelStructure< T, REAL >::getVoxel | ( | int | x, |
int | y, | ||
int | z | ||
) | const [inline] |
Returns a pointer to the voxel with integer id (x,y,z) or NULL if (x,y,z) is out of bounds.
Definition at line 93 of file voxel_structure.hpp.
const T* pcl::recognition::VoxelStructure< T, REAL >::getVoxels | ( | ) | const [inline] |
Returns the linear voxel array.
Definition at line 74 of file voxel_structure.h.
T* pcl::recognition::VoxelStructure< T, REAL >::getVoxels | ( | ) | [inline] |
Returns the linear voxel array.
Definition at line 81 of file voxel_structure.h.
const REAL* pcl::recognition::VoxelStructure< T, REAL >::getVoxelSpacing | ( | ) | const [inline] |
Returns the voxel spacing in x, y and z direction. That's the same as the voxel size along each axis.
Definition at line 149 of file voxel_structure.h.
REAL pcl::recognition::VoxelStructure< T, REAL >::bounds_[6] [protected] |
Definition at line 162 of file voxel_structure.h.
REAL pcl::recognition::VoxelStructure< T, REAL >::min_center_[3] [protected] |
Definition at line 164 of file voxel_structure.h.
int pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_[3] [protected] |
Definition at line 161 of file voxel_structure.h.
int pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_xy_plane_ [protected] |
Definition at line 161 of file voxel_structure.h.
REAL pcl::recognition::VoxelStructure< T, REAL >::spacing_[3] [protected] |
Definition at line 163 of file voxel_structure.h.
int pcl::recognition::VoxelStructure< T, REAL >::total_num_of_voxels_ [protected] |
Definition at line 161 of file voxel_structure.h.
T* pcl::recognition::VoxelStructure< T, REAL >::voxels_ [protected] |
Definition at line 160 of file voxel_structure.h.