Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator Class Reference

Detailed Description

template<class NODE, class INTERFACE>
class octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator

Bounding-box leaf iterator.

This iterator will traverse all leaf nodes within a given bounding box (axis-aligned). See below for example usage. Note that the non-trivial call to tree->end_leafs_bbx() should be done only once for efficiency!

for(OcTreeTYPE::leaf_bbx_iterator it = tree->begin_leafs_bbx(min,max),
end=tree->end_leafs_bbx(); it!= end; ++it)
{
//manipulate node, e.g.:
std::cout << "Node center: " << it.getCoordinate() << std::endl;
std::cout << "Node size: " << it.getSize() << std::endl;
std::cout << "Node value: " << it->getValue() << std::endl;
}

Definition at line 330 of file OcTreeBaseImpl.h.

#include <mrpt/otherlibs/octomap/OcTreeBaseImpl.h>

Inheritance diagram for octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator:
Inheritance graph

Public Member Functions

 leaf_bbx_iterator ()
 
 leaf_bbx_iterator (OcTreeBaseImpl< NodeType, INTERFACE > const *tree, const point3d &min, const point3d &max, unsigned char depth=0)
 Constructor of the iterator. More...
 
 leaf_bbx_iterator (OcTreeBaseImpl< NodeType, INTERFACE > const *tree, const OcTreeKey &min, const OcTreeKey &max, unsigned char depth=0)
 Constructor of the iterator. More...
 
 leaf_bbx_iterator (const leaf_bbx_iterator &other)
 
leaf_bbx_iterator operator++ (int)
 postfix increment operator of iterator (it++) More...
 
leaf_bbx_iteratoroperator++ ()
 prefix increment operator of iterator (++it) More...
 
bool operator== (const iterator_base &other) const
 Comparison between iterators. First compares the tree, then stack size and top element of stack. More...
 
bool operator!= (const iterator_base &other) const
 Comparison between iterators. First compares the tree, then stack size and top element of stack. More...
 
NodeType const * operator-> () const
 Ptr operator will return the current node in the octree which the iterator is referring to. More...
 
NodeTypeoperator-> ()
 Ptr operator will return the current node in the octree which the iterator is referring to. More...
 
const NodeTypeoperator* () const
 Return the current node in the octree which the iterator is referring to. More...
 
NodeTypeoperator* ()
 Return the current node in the octree which the iterator is referring to. More...
 
point3d getCoordinate () const
 return the center coordinate of the current node More...
 
double getX () const
 
double getY () const
 
double getZ () const
 
double getSize () const
 
unsigned getDepth () const
 return depth of the current node More...
 
const OcTreeKeygetKey () const
 
OcTreeKey getIndexKey () const
 

Protected Member Functions

void singleIncrement ()
 

Protected Attributes

OcTreeKey minKey
 
OcTreeKey maxKey
 
OcTreeBaseImpl< NodeType, INTERFACE > const * tree
 Octree this iterator is working on. More...
 
unsigned char maxDepth
 Maximum depth for depth-limited queries. More...
 
std::stack< StackElement, std::vector< StackElement > > stack
 Internal recursion stack. Apparently a stack of vector works fastest here. More...
 

Constructor & Destructor Documentation

template<class NODE, class INTERFACE>
octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::leaf_bbx_iterator ( )
inline

Definition at line 332 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::leaf_bbx_iterator ( OcTreeBaseImpl< NodeType, INTERFACE > const *  tree,
const point3d min,
const point3d max,
unsigned char  depth = 0 
)
inline

Constructor of the iterator.

The bounding box corners min and max are converted into an OcTreeKey first.

Note
Due to rounding and discretization effects, nodes may be traversed that have float coordinates appearing outside of the (float) bounding box. However, the node's complete volume will include the bounding box coordinate. For a more exact control, use the constructor with OcTreeKeys instead.
Parameters
treeOcTreeBaseImpl on which the iterator is used on
minMinimum point3d of the axis-aligned boundingbox
maxMaximum point3d of the axis-aligned boundingbox
depthMaximum depth to traverse the tree. 0 (default): unlimited

Definition at line 348 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::leaf_bbx_iterator ( OcTreeBaseImpl< NodeType, INTERFACE > const *  tree,
const OcTreeKey min,
const OcTreeKey max,
unsigned char  depth = 0 
)
inline

Constructor of the iterator.

This version uses the exact keys as axis-aligned bounding box (including min and max).

Parameters
treeOcTreeBaseImpl on which the iterator is used on
minMinimum OcTreeKey to be included in the axis-aligned boundingbox
maxMaximum OcTreeKey to be included in the axis-aligned boundingbox
depthMaximum depth to traverse the tree. 0 (default): unlimited

Definition at line 374 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::leaf_bbx_iterator ( const leaf_bbx_iterator other)
inline

Definition at line 382 of file OcTreeBaseImpl.h.

Member Function Documentation

template<class NODE, class INTERFACE>
point3d octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getCoordinate ( ) const
inlineinherited

return the center coordinate of the current node

Definition at line 118 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
unsigned octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getDepth ( ) const
inlineinherited

return depth of the current node

Definition at line 139 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
OcTreeKey octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getIndexKey ( ) const
inlineinherited
Returns
the OcTreeKey of the current node, for nodes with depth != maxDepth

Definition at line 145 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
const OcTreeKey& octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getKey ( ) const
inlineinherited
Returns
the OcTreeKey of the current node

Definition at line 142 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getSize ( ) const
inlineinherited
Returns
the side if the volume occupied by the current node

Definition at line 136 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getX ( ) const
inlineinherited
Returns
single coordinate of the current node

Definition at line 123 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getY ( ) const
inlineinherited
Returns
single coordinate of the current node

Definition at line 127 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getZ ( ) const
inlineinherited
Returns
single coordinate of the current node

Definition at line 131 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
bool octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::operator!= ( const iterator_base other) const
inlineinherited

Comparison between iterators. First compares the tree, then stack size and top element of stack.

Definition at line 87 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
const NodeType& octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::operator* ( void  ) const
inlineinherited

Return the current node in the octree which the iterator is referring to.

Definition at line 111 of file OcTreeBaseImpl.h.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::sizeLookupTable, and octomap::OcTreeBaseImpl< NODE, INTERFACE >::tree_depth.

template<class NODE, class INTERFACE>
NodeType& octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::operator* ( void  )
inlineinherited

Return the current node in the octree which the iterator is referring to.

Definition at line 115 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
leaf_bbx_iterator octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::operator++ ( int  )
inline

postfix increment operator of iterator (it++)

Definition at line 390 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
leaf_bbx_iterator& octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::operator++ ( )
inline

prefix increment operator of iterator (++it)

Definition at line 397 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
NodeType const* octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::operator-> ( void  ) const
inlineinherited

Ptr operator will return the current node in the octree which the iterator is referring to.

Definition at line 103 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
NodeType* octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::operator-> ( void  )
inlineinherited

Ptr operator will return the current node in the octree which the iterator is referring to.

Definition at line 107 of file OcTreeBaseImpl.h.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::resolution.

template<class NODE, class INTERFACE>
bool octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::operator== ( const iterator_base other) const
inlineinherited

Comparison between iterators. First compares the tree, then stack size and top element of stack.

Definition at line 79 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
void octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::singleIncrement ( )
inlineprotected

Member Data Documentation

template<class NODE, class INTERFACE>
unsigned char octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::maxDepth
protectedinherited

Maximum depth for depth-limited queries.

Definition at line 184 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
OcTreeKey octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::maxKey
protected

Definition at line 448 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
OcTreeKey octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::minKey
protected

Definition at line 447 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
std::stack<StackElement,std::vector<StackElement> > octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::stack
protectedinherited

Internal recursion stack. Apparently a stack of vector works fastest here.

Definition at line 187 of file OcTreeBaseImpl.h.

template<class NODE, class INTERFACE>
OcTreeBaseImpl<NodeType,INTERFACE> const* octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::tree
protectedinherited

Octree this iterator is working on.

Definition at line 183 of file OcTreeBaseImpl.h.




Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN:Unversioned directory at Tue Jun 28 11:46:25 UTC 2016