octomap  1.9.7
iterator_base Class Reference

Base class for OcTree iterators. More...

+ Inheritance diagram for iterator_base:
+ Collaboration diagram for 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 More...
 
unsigned getDepth () const
 return depth of the current node More...
 
OcTreeKey getIndexKey () const
 
const OcTreeKey & getKey () const
 
double getSize () const
 
double getX () const
 
double getY () const
 
double getZ () const
 
 iterator_base ()
 Default ctor, only used for the end-iterator. More...
 
 iterator_base (const iterator_base &other)
 Copy constructor of the iterator. More...
 
 iterator_base (OcTreeBaseImpl< NodeType, INTERFACE > const *ptree, uint8_t depth=0)
 Constructor of the iterator. 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 & operator* ()
 Return the current node in the octree which the iterator is referring to. More...
 
const NodeType & operator* () const
 Return the current node in the octree which the iterator is referring to. More...
 
NodeType * operator-> ()
 Ptr operator will return the current node in the octree which the iterator is referring to. More...
 
NodeType const * operator-> () const
 Ptr operator will return the current node in the octree which the iterator is referring to. More...
 
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. More...
 

Protected Member Functions

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

Protected Attributes

uint8_t 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...
 
OcTreeBaseImpl< NodeType, INTERFACE > const * tree
 Octree this iterator is working on. More...
 

Detailed Description

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]

iterator_base::iterator_base ( )
inline

Default ctor, only used for the end-iterator.

◆ iterator_base() [2/3]

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

References iterator_base::StackElement::depth, iterator_base::StackElement::key, maxDepth, iterator_base::StackElement::node, stack, and tree.

◆ iterator_base() [3/3]

iterator_base::iterator_base ( const iterator_base other)
inline

Copy constructor of the iterator.

Member Function Documentation

◆ getCoordinate()

point3d iterator_base::getCoordinate ( ) const
inline

return the center coordinate of the current node

References stack, and tree.

◆ getDepth()

unsigned iterator_base::getDepth ( ) const
inline

return depth of the current node

References stack.

◆ getIndexKey()

OcTreeKey iterator_base::getIndexKey ( ) const
inline
Returns
the OcTreeKey of the current node, for nodes with depth != maxDepth

References octomap::computeIndexKey(), stack, and tree.

◆ getKey()

const OcTreeKey& iterator_base::getKey ( ) const
inline
Returns
the OcTreeKey of the current node

References stack.

◆ getSize()

double iterator_base::getSize ( ) const
inline
Returns
the side of the volume occupied by the current node

References stack, and tree.

◆ getX()

double iterator_base::getX ( ) const
inline
Returns
single coordinate of the current node

References stack, and tree.

◆ getY()

double iterator_base::getY ( ) const
inline
Returns
single coordinate of the current node

References stack, and tree.

◆ getZ()

double iterator_base::getZ ( ) const
inline
Returns
single coordinate of the current node

References stack, and tree.

◆ operator!=()

bool iterator_base::operator!= ( const iterator_base other) const
inline

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

References stack, and tree.

◆ operator*() [1/2]

NodeType& iterator_base::operator* ( )
inline

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

References stack.

◆ operator*() [2/2]

const NodeType& iterator_base::operator* ( ) const
inline

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

References stack.

◆ operator->() [1/2]

NodeType* iterator_base::operator-> ( )
inline

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

References stack.

◆ operator->() [2/2]

NodeType const* iterator_base::operator-> ( ) const
inline

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

References stack.

◆ operator=()

iterator_base& iterator_base::operator= ( const iterator_base other)
inline

References maxDepth, stack, and tree.

◆ operator==()

bool iterator_base::operator== ( const iterator_base other) const
inline

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

References stack, and tree.

◆ singleIncrement()

void iterator_base::singleIncrement ( )
inlineprotected

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

References octomap::computeChildKey(), iterator_base::StackElement::depth, iterator_base::StackElement::key, maxDepth, iterator_base::StackElement::node, stack, and tree.

Referenced by tree_iterator::operator++(), and leaf_iterator::operator++().

Field Documentation

◆ maxDepth

uint8_t iterator_base::maxDepth
protected

Maximum depth for depth-limited queries.

Referenced by iterator_base(), leaf_bbx_iterator::leaf_bbx_iterator(), operator=(), and singleIncrement().

◆ stack

◆ tree


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