This class is an implementation of bounding volume hierarchies. Use the build method to construct the data structure. To use the class, construct an std::vector of pointers to BVH::BoundedObject objects and pass it to the build method. BVH::BoundedObject is a template class, so you can save user-defined data in it. More...
#include <bvh.h>
Classes | |
class | BoundedObject |
class | Node |
Public Member Functions | |
void | build (std::vector< BoundedObject * > &objects) |
Creates the tree. No need to call clear, it's called within the method. 'objects' is a vector of pointers to bounded objects which have to have valid bounds and centroids. Use the getData method of BoundedObject to retrieve the user-defined data saved in the object. Note that vector will be sorted within the method! | |
BVH () | |
void | clear () |
Frees the memory allocated by this object. After that, you have to call build to use the tree again. | |
const std::vector < BoundedObject * > * | getInputObjects () const |
bool | intersect (const float box[6], std::list< BoundedObject * > &intersected_objects) const |
Pushes back in 'intersected_objects' the bounded objects intersected by the input 'box' and returns true. Returns false if no objects are intersected. | |
virtual | ~BVH () |
Protected Attributes | |
Node * | root_ |
std::vector< BoundedObject * > * | sorted_objects_ |
This class is an implementation of bounding volume hierarchies. Use the build method to construct the data structure. To use the class, construct an std::vector of pointers to BVH::BoundedObject objects and pass it to the build method. BVH::BoundedObject is a template class, so you can save user-defined data in it.
The tree is built such that each leaf contains exactly one object.
pcl::recognition::BVH< UserData >::BVH | ( | ) | [inline] |
virtual pcl::recognition::BVH< UserData >::~BVH | ( | ) | [inline, virtual] |
void pcl::recognition::BVH< UserData >::build | ( | std::vector< BoundedObject * > & | objects | ) | [inline] |
Creates the tree. No need to call clear, it's called within the method. 'objects' is a vector of pointers to bounded objects which have to have valid bounds and centroids. Use the getData method of BoundedObject to retrieve the user-defined data saved in the object. Note that vector will be sorted within the method!
The tree is built such that each leaf contains exactly one object.
void pcl::recognition::BVH< UserData >::clear | ( | ) | [inline] |
const std::vector<BoundedObject*>* pcl::recognition::BVH< UserData >::getInputObjects | ( | ) | const [inline] |
bool pcl::recognition::BVH< UserData >::intersect | ( | const float | box[6], |
std::list< BoundedObject * > & | intersected_objects | ||
) | const [inline] |
Node* pcl::recognition::BVH< UserData >::root_ [protected] |
std::vector<BoundedObject*>* pcl::recognition::BVH< UserData >::sorted_objects_ [protected] |