octomap 1.9.8
Loading...
Searching...
No Matches
octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base Class Reference

Base class for OcTree iterators. More...

#include <OcTreeBaseImpl.h>

Inheritance diagram for octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base:
Collaboration diagram for octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base:

Data Structures

struct  StackElement
 Element on the internal recursion stack of the iterator. More...

Public Member Functions

point3d getCoordinate () const
 return the center coordinate of the current node
unsigned getDepth () const
 return depth of the current node
OcTreeKey getIndexKey () const
const OcTreeKeygetKey () const
double getSize () const
double getX () const
double getY () const
double getZ () const
 iterator_base ()
 Default ctor, only used for the end-iterator.
 iterator_base (const iterator_base &other)
 Copy constructor of the iterator.
 iterator_base (OcTreeBaseImpl< NodeType, INTERFACE > const *ptree, uint8_t depth=0)
 Constructor of the iterator.
bool operator!= (const iterator_base &other) const
 Comparison between iterators. First compares the tree, then stack size and top element of stack.
NodeTypeoperator* ()
 Return the current node in the octree which the iterator is referring to.
const NodeTypeoperator* () const
 Return the current node in the octree which the iterator is referring to.
NodeTypeoperator-> ()
 Ptr operator will return the current node in the octree which the iterator is referring to.
NodeType const * operator-> () const
 Ptr operator will return the current node in the octree which the iterator is referring to.
iterator_baseoperator= (const iterator_base &other)
bool operator== (const iterator_base &other) const
 Comparison between iterators. First compares the tree, then stack size and top element of stack.

Data Fields

OcTreeKey elements
 STL member.

Protected Member Functions

void singleIncrement ()
 One step of depth-first tree traversal. How this is used depends on the actual iterator.

Protected Attributes

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

Detailed Description

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

Base class for OcTree iterators.

So far, all iterator's are const with respect to the tree. This file is included within OcTreeBaseImpl.h, you should probably not include this directly.

Constructor & Destructor Documentation

◆ iterator_base() [1/3]

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

Default ctor, only used for the end-iterator.

◆ iterator_base() [2/3]

template<class NODE, class INTERFACE>
octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::iterator_base ( OcTreeBaseImpl< NodeType, INTERFACE > const * ptree,
uint8_t depth = 0 )
inline

Constructor of the iterator.

Initializes the iterator with the default constructor (= end() iterator) if tree is empty or NULL.

Parameters
ptreeOcTreeBaseImpl on which the iterator is used on
depthMaximum depth to traverse the tree. 0 (default): unlimited

◆ iterator_base() [3/3]

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

Copy constructor of the iterator.

References octomap::OcTreeBaseImpl< NODE, INTERFACE >::OcTreeBaseImpl().

Member Function Documentation

◆ getCoordinate()

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

return the center coordinate of the current node

◆ getDepth()

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

return depth of the current node

◆ getIndexKey()

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

◆ getKey()

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

◆ getSize()

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getSize ( ) const
inline

◆ getX()

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getX ( ) const
inline

◆ getY()

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getY ( ) const
inline

◆ getZ()

template<class NODE, class INTERFACE>
double octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::getZ ( ) const
inline

◆ operator!=()

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

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

◆ operator*() [1/2]

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

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

◆ operator*() [2/2]

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

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

◆ operator->() [1/2]

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

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

◆ operator->() [2/2]

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

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

◆ operator=()

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

◆ operator==()

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

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

◆ singleIncrement()

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

One step of depth-first tree traversal. How this is used depends on the actual iterator.

Field Documentation

◆ elements

OcTreeKey std::vector< OcTreeKey >::elements
inherited

STL member.

◆ maxDepth

template<class NODE, class INTERFACE>
uint8_t octomap::OcTreeBaseImpl< NODE, INTERFACE >::iterator_base::maxDepth
protected

Maximum depth for depth-limited queries.

Referenced by octomap::OcTreeBaseImpl< NODE, INTERFACE >::leaf_bbx_iterator::leaf_bbx_iterator().

◆ stack

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

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

◆ tree

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

Octree this iterator is working on.


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