Point Cloud Library (PCL) 1.15.0
Loading...
Searching...
No Matches
pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar > Class Template Reference

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

Inheritance diagram for pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >:
Collaboration diagram for pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >:

Classes

class  Node

Public Member Functions

 SimpleOctree ()
virtual ~SimpleOctree ()
void clear ()
void build (const Scalar *bounds, Scalar voxel_size, NodeDataCreator *node_data_creator)
 Creates an empty octree with bounds at least as large as the ones provided as input and with leaf size equal to 'voxel_size'.
NodecreateLeaf (Scalar x, Scalar y, Scalar z)
 Creates the leaf containing p = (x, y, z) and returns a pointer to it, however, only if p lies within the octree bounds!
NodegetFullLeaf (int i, int j, int k)
 Since the leaves are aligned in a rectilinear grid, each leaf has a unique id.
NodegetFullLeaf (Scalar x, Scalar y, Scalar z)
 Returns a pointer to the full leaf, i.e., one having a data pbject, containing p = (x, y, z) or NULL if no such leaf exists.
std::vector< Node * > & getFullLeaves ()
const std::vector< Node * > & getFullLeaves () const
NodegetRoot ()
const Scalar * getBounds () const
void getBounds (Scalar b[6]) const
Scalar getVoxelSize () const

Protected Member Functions

void insertNeighbors (Node *node)

Protected Attributes

Scalar voxel_size_ {0.0f}
Scalar bounds_ [6] {}
int tree_levels_ {0}
Noderoot_ {nullptr}
std::vector< Node * > full_leaves_
NodeDataCreator * node_data_creator_ {nullptr}

Detailed Description

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
class pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >

Definition at line 58 of file simple_octree.h.

Constructor & Destructor Documentation

◆ SimpleOctree()

template<typename NodeData, typename NodeDataCreator, typename Scalar>
pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::SimpleOctree ( )
inlinedefault

◆ ~SimpleOctree()

template<typename NodeData, typename NodeDataCreator, typename Scalar>
pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::~SimpleOctree ( )
inlinevirtual

Definition at line 187 of file simple_octree.hpp.

References clear().

Member Function Documentation

◆ build()

template<typename NodeData, typename NodeDataCreator, typename Scalar>
void pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::build ( const Scalar * bounds,
Scalar voxel_size,
NodeDataCreator * node_data_creator )
inline

Creates an empty octree with bounds at least as large as the ones provided as input and with leaf size equal to 'voxel_size'.

Definition at line 204 of file simple_octree.hpp.

References bounds_, clear(), node_data_creator_, root_, tree_levels_, and voxel_size_.

◆ clear()

template<typename NodeData, typename NodeDataCreator, typename Scalar>
void pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::clear ( )
inline

Definition at line 194 of file simple_octree.hpp.

References full_leaves_, and root_.

Referenced by build(), and ~SimpleOctree().

◆ createLeaf()

template<typename NodeData, typename NodeDataCreator, typename Scalar>
SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node * pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::createLeaf ( Scalar x,
Scalar y,
Scalar z )
inline

Creates the leaf containing p = (x, y, z) and returns a pointer to it, however, only if p lies within the octree bounds!

A more general version which allows p to be out of bounds is not implemented yet. The method returns NULL if p is not within the root bounds. If the leaf containing p already exists nothing happens and method just returns a pointer to the leaf. Note that for a new created leaf, the method also creates its data object.

Definition at line 250 of file simple_octree.hpp.

References bounds_, pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node::createChildren(), full_leaves_, pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node::getCenter(), pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node::getChild(), pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node::hasData(), insertNeighbors(), node_data_creator_, root_, pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node::setData(), and tree_levels_.

◆ getBounds() [1/2]

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
const Scalar * pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getBounds ( ) const
inline

Definition at line 188 of file simple_octree.h.

◆ getBounds() [2/2]

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
void pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getBounds ( Scalar b[6]) const
inline

Definition at line 191 of file simple_octree.h.

◆ getFullLeaf() [1/2]

template<typename NodeData, typename NodeDataCreator, typename Scalar>
SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node * pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getFullLeaf ( int i,
int j,
int k )
inline

Since the leaves are aligned in a rectilinear grid, each leaf has a unique id.

The method returns the full leaf, i.e., the one having a data object, with id [i, j, k] or NULL is no such leaf exists.

Definition at line 289 of file simple_octree.hpp.

References bounds_, getFullLeaf(), and voxel_size_.

Referenced by getFullLeaf(), and insertNeighbors().

◆ getFullLeaf() [2/2]

template<typename NodeData, typename NodeDataCreator, typename Scalar>
SimpleOctree< NodeData, NodeDataCreator, Scalar >::Node * pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getFullLeaf ( Scalar x,
Scalar y,
Scalar z )
inline

◆ getFullLeaves() [1/2]

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
std::vector< Node * > & pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getFullLeaves ( )
inline

Definition at line 179 of file simple_octree.h.

◆ getFullLeaves() [2/2]

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
const std::vector< Node * > & pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getFullLeaves ( ) const
inline

Definition at line 182 of file simple_octree.h.

◆ getRoot()

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
Node * pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getRoot ( )
inline

Definition at line 185 of file simple_octree.h.

◆ getVoxelSize()

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
Scalar pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::getVoxelSize ( ) const
inline

Definition at line 194 of file simple_octree.h.

◆ insertNeighbors()

template<typename NodeData, typename NodeDataCreator, typename Scalar>
void pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::insertNeighbors ( Node * node)
inlineprotected

Member Data Documentation

◆ bounds_

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
Scalar pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::bounds_[6] {}
protected

Definition at line 201 of file simple_octree.h.

Referenced by build(), createLeaf(), getFullLeaf(), and getFullLeaf().

◆ full_leaves_

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
std::vector<Node*> pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::full_leaves_
protected

Definition at line 204 of file simple_octree.h.

Referenced by clear(), and createLeaf().

◆ node_data_creator_

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
NodeDataCreator* pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::node_data_creator_ {nullptr}
protected

Definition at line 205 of file simple_octree.h.

Referenced by build(), and createLeaf().

◆ root_

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
Node* pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::root_ {nullptr}
protected

Definition at line 203 of file simple_octree.h.

Referenced by build(), clear(), createLeaf(), and getFullLeaf().

◆ tree_levels_

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
int pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::tree_levels_ {0}
protected

Definition at line 202 of file simple_octree.h.

Referenced by build(), createLeaf(), and getFullLeaf().

◆ voxel_size_

template<typename NodeData, typename NodeDataCreator, typename Scalar = float>
Scalar pcl::recognition::SimpleOctree< NodeData, NodeDataCreator, Scalar >::voxel_size_ {0.0f}
protected

Definition at line 201 of file simple_octree.h.

Referenced by build(), getFullLeaf(), and insertNeighbors().


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