Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Member Functions | Protected Attributes
pcl::recognition::VoxelStructure< T, REAL > Class Template Reference

This class is a box in R3 built of voxels ordered in a regular rectangular grid. More...

#include <pcl/recognition/ransac_based/voxel_structure.h>

+ Inheritance diagram for pcl::recognition::VoxelStructure< T, REAL >:

Public Member Functions

 VoxelStructure ()
 
virtual ~VoxelStructure ()
 
void build (const REAL bounds[6], int num_of_voxels[3])
 Call this method before using an instance of this class. More...
 
void clear ()
 Release the memory allocated for the voxels. More...
 
T * getVoxel (const REAL p[3])
 Returns a pointer to the voxel which contains p or NULL if p is not inside the structure. More...
 
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. More...
 
const T * getVoxels () const
 Returns the linear voxel array. More...
 
T * getVoxels ()
 Returns the linear voxel array. More...
 
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. More...
 
const int * getNumberOfVoxelsXYZ () const
 Returns the number of voxels in x, y and z direction. More...
 
void computeVoxelCenter (const int id3[3], REAL center[3]) const
 Computes the center of the voxel with given integer coordinates. More...
 
int getNumberOfVoxels () const
 Returns the total number of voxels. More...
 
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). More...
 
void getBounds (REAL b[6]) const
 Copies the bounds of the voxel structure to 'b'. More...
 
const REAL * getVoxelSpacing () const
 Returns the voxel spacing in x, y and z direction. More...
 
int getNeighbors (const REAL *p, T **neighs) const
 Saves pointers to the voxels which are neighbors of the voxels which contains 'p'. More...
 

Protected Attributes

T * voxels_
 
int num_of_voxels_ [3]
 
int num_of_voxels_xy_plane_
 
int total_num_of_voxels_
 
REAL bounds_ [6]
 
REAL spacing_ [3]
 
REAL min_center_ [3]
 

Detailed Description

template<class T, typename REAL = float>
class pcl::recognition::VoxelStructure< T, REAL >

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 47 of file voxel_structure.h.

Constructor & Destructor Documentation

◆ VoxelStructure()

template<class T , typename REAL = float>
pcl::recognition::VoxelStructure< T, REAL >::VoxelStructure ( )
inline

Definition at line 50 of file voxel_structure.h.

◆ ~VoxelStructure()

template<class T , typename REAL = float>
virtual pcl::recognition::VoxelStructure< T, REAL >::~VoxelStructure ( )
inlinevirtual

Member Function Documentation

◆ build()

template<class T , typename REAL >
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 51 of file voxel_structure.hpp.

◆ clear()

template<class T , typename REAL = float>
void pcl::recognition::VoxelStructure< T, REAL >::clear ( )
inline

Release the memory allocated for the voxels.

Definition at line 59 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::voxels_.

Referenced by pcl::recognition::VoxelStructure< T, REAL >::~VoxelStructure().

◆ compute3dId()

template<class T , typename REAL = float>
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.

Parameters
[in]linear_idthe position of the voxel in the internal voxel array.
[out]id3dan array of 3 integers for the integer coordinates of the voxel.

Definition at line 88 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_, and pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_xy_plane_.

◆ computeVoxelCenter()

template<class T , typename REAL = float>
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.

Parameters
[in]id3the integer coordinates along the x, y and z axis.
[out]center

Definition at line 111 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::min_center_, and pcl::recognition::VoxelStructure< T, REAL >::spacing_.

◆ getBounds() [1/2]

template<class T , typename REAL = float>
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 127 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::bounds_.

◆ getBounds() [2/2]

template<class T , typename REAL = float>
void pcl::recognition::VoxelStructure< T, REAL >::getBounds ( REAL  b[6]) const
inline

Copies the bounds of the voxel structure to 'b'.

Definition at line 134 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::bounds_.

◆ getNeighbors()

template<class T , typename REAL >
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 110 of file voxel_structure.hpp.

◆ getNumberOfVoxels()

template<class T , typename REAL = float>
int pcl::recognition::VoxelStructure< T, REAL >::getNumberOfVoxels ( ) const
inline

Returns the total number of voxels.

Definition at line 120 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::total_num_of_voxels_.

◆ getNumberOfVoxelsXYZ()

template<class T , typename REAL = float>
const int* pcl::recognition::VoxelStructure< T, REAL >::getNumberOfVoxelsXYZ ( ) const
inline

Returns the number of voxels in x, y and z direction.

Definition at line 101 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_.

◆ getVoxel() [1/2]

template<class T , typename REAL >
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 85 of file voxel_structure.hpp.

◆ getVoxel() [2/2]

template<class T , typename REAL >
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 99 of file voxel_structure.hpp.

◆ getVoxels() [1/2]

template<class T , typename REAL = float>
T* pcl::recognition::VoxelStructure< T, REAL >::getVoxels ( )
inline

Returns the linear voxel array.

Definition at line 78 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::voxels_.

◆ getVoxels() [2/2]

template<class T , typename REAL = float>
const T* pcl::recognition::VoxelStructure< T, REAL >::getVoxels ( ) const
inline

Returns the linear voxel array.

Definition at line 71 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::voxels_.

◆ getVoxelSpacing()

template<class T , typename REAL = float>
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 146 of file voxel_structure.h.

References pcl::recognition::VoxelStructure< T, REAL >::spacing_.

Member Data Documentation

◆ bounds_

template<class T , typename REAL = float>
REAL pcl::recognition::VoxelStructure< T, REAL >::bounds_[6]
protected

◆ min_center_

template<class T , typename REAL = float>
REAL pcl::recognition::VoxelStructure< T, REAL >::min_center_[3]
protected

◆ num_of_voxels_

template<class T , typename REAL = float>
int pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_[3]
protected

◆ num_of_voxels_xy_plane_

template<class T , typename REAL = float>
int pcl::recognition::VoxelStructure< T, REAL >::num_of_voxels_xy_plane_
protected

◆ spacing_

template<class T , typename REAL = float>
REAL pcl::recognition::VoxelStructure< T, REAL >::spacing_[3]
protected

◆ total_num_of_voxels_

template<class T , typename REAL = float>
int pcl::recognition::VoxelStructure< T, REAL >::total_num_of_voxels_
protected

◆ voxels_

template<class T , typename REAL = float>
T* pcl::recognition::VoxelStructure< T, REAL >::voxels_
protected

The documentation for this class was generated from the following files: