Point Cloud Library (PCL)  1.14.0-dev
List of all members | Classes | Public Member Functions | Protected Attributes
pcl::recognition::BVH< UserData > Class Template Reference

This class is an implementation of bounding volume hierarchies. More...

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

+ Collaboration diagram for pcl::recognition::BVH< UserData >:

Classes

class  BoundedObject
 
class  Node
 

Public Member Functions

 BVH ()
 
virtual ~BVH ()
 
void build (std::vector< BoundedObject * > &objects)
 Creates the tree. More...
 
void clear ()
 Frees the memory allocated by this object. More...
 
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. More...
 

Protected Attributes

Noderoot_
 
std::vector< BoundedObject * > * sorted_objects_
 

Detailed Description

template<class UserData>
class pcl::recognition::BVH< UserData >

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.

Definition at line 65 of file bvh.h.

Constructor & Destructor Documentation

◆ BVH()

template<class UserData >
pcl::recognition::BVH< UserData >::BVH ( )
inline

Definition at line 213 of file bvh.h.

◆ ~BVH()

template<class UserData >
virtual pcl::recognition::BVH< UserData >::~BVH ( )
inlinevirtual

Definition at line 219 of file bvh.h.

Member Function Documentation

◆ build()

template<class UserData >
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.

Definition at line 231 of file bvh.h.

◆ clear()

template<class UserData >
void pcl::recognition::BVH< UserData >::clear ( )
inline

Frees the memory allocated by this object.

After that, you have to call build to use the tree again.

Definition at line 249 of file bvh.h.

◆ getInputObjects()

template<class UserData >
const std::vector<BoundedObject*>* pcl::recognition::BVH< UserData >::getInputObjects ( ) const
inline

Definition at line 256 of file bvh.h.

◆ intersect()

template<class UserData >
bool pcl::recognition::BVH< UserData >::intersect ( const float  box[6],
std::list< BoundedObject * > &  intersected_objects 
) const
inline

Pushes back in 'intersected_objects' the bounded objects intersected by the input 'box' and returns true.

Returns false if no objects are intersected.

Definition at line 264 of file bvh.h.

References pcl::recognition::BVH< UserData >::Node::getLeftChild(), pcl::recognition::BVH< UserData >::Node::getObject(), pcl::recognition::BVH< UserData >::Node::getRightChild(), pcl::recognition::BVH< UserData >::Node::hasChildren(), and pcl::recognition::BVH< UserData >::Node::intersect().

Member Data Documentation

◆ root_

template<class UserData >
Node* pcl::recognition::BVH< UserData >::root_
protected

Definition at line 301 of file bvh.h.

◆ sorted_objects_

template<class UserData >
std::vector<BoundedObject*>* pcl::recognition::BVH< UserData >::sorted_objects_
protected

Definition at line 302 of file bvh.h.


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