Class leaf_iterator

Inheritance Relationships

Base Type

Class Documentation

class leaf_iterator : public iterator_base<NodeType>

Iterator to iterate over all leafs of the tree. Inner nodes are skipped. See below for example usage. Note that the non-trivial call to tree->end_leafs() should be done only once for efficiency!

for(OcTreeTYPE::leaf_iterator it = tree->begin_leafs(),
       end=tree->end_leafs(); 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;
}

Public Functions

inline leaf_iterator()
inline leaf_iterator(OcTreeBaseImpl<NodeType, INTERFACE> const *ptree, uint8_t depth = 0)

Constructor of the iterator.

Parameters:
  • ptree – OcTreeBaseImpl on which the iterator is used on

  • depth – Maximum depth to traverse the tree. 0 (default): unlimited

inline leaf_iterator(const leaf_iterator &other)
inline leaf_iterator operator++(int)

postfix increment operator of iterator (it++)

inline leaf_iterator &operator++()

prefix increment operator of iterator (++it)