40 #ifndef PCL_OCTREE_ITERATOR_H
41 #define PCL_OCTREE_ITERATOR_H
47 #include <pcl/octree/octree_nodes.h>
48 #include <pcl/octree/octree_key.h>
54 #pragma GCC system_header
75 template<
typename OctreeT>
76 class OctreeIteratorBase :
public std::iterator<std::forward_iterator_tag, const OctreeNode, void,
77 const OctreeNode*, const OctreeNode&>
116 unsigned int max_depth_arg,
259 ret =
octree_->getBranchBitPattern (*current_branch);
278 return leaf_node->getContainer();
293 return leaf_node->getContainer();
299 const BranchContainer&
308 return branch_node->getContainer();
323 return branch_node->getContainer();
329 virtual unsigned long
332 unsigned long id = 0;
341 unsigned int depth =
octree_->getTreeDepth ();
342 id =
static_cast<unsigned long> (key.
x) << (depth * 2)
343 |
static_cast<unsigned long> (key.
y) << (depth * 1)
344 |
static_cast<unsigned long> (key.
z) << (depth * 0);
367 template<
typename OctreeT>
398 unsigned int max_depth_arg,
400 const std::vector<IteratorState>& stack = std::vector<IteratorState> ())
475 template<
typename OctreeT>
505 unsigned int max_depth_arg,
507 const std::deque<IteratorState>& fifo = std::deque<IteratorState> ())
578 template<
typename OctreeT>
607 unsigned int fixed_depth_arg,
609 const std::deque<IteratorState>& fifo = std::deque<IteratorState> ())
640 reset (
unsigned int fixed_depth_arg);
664 template<
typename OctreeT>
701 unsigned int max_depth_arg,
703 const std::vector<IteratorState>& stack = std::vector<IteratorState> ())
767 template<
typename OctreeT>
797 unsigned int max_depth_arg,
799 const std::deque<IteratorState>& fifo = std::deque<IteratorState> ());
826 #include <pcl/octree/impl/octree_iterator.hpp>
OctreeNode * operator*() const
*operator.
OctreeBreadthFirstIterator & operator=(const OctreeBreadthFirstIterator &src)
Copy operator.
void reset()
Reset iterator.
bool operator==(const OctreeIteratorBase &other) const
Equal comparison operator.
void reset()
Reset the iterator to the first node at the current depth.
OctreeNode * getCurrentOctreeNode() const
Get the current octree node.
const BranchContainer & getBranchContainer() const
Method for retrieving the container from an octree branch node.
const LeafContainer & getLeafContainer() const
Method for retrieving a single leaf container from the octree leaf node.
This file defines compatibility wrappers for low level I/O functions.
virtual node_type_t getNodeType() const =0
Pure virtual method for receiving the type of octree node (branch or leaf)
OctreeT::LeafContainer LeafContainer
std::deque< IteratorState > FIFO_
FIFO list.
OctreeLeafNodeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
OctreeIteratorBase(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state)
Constructor.
std::vector< IteratorState > stack_
Stack structure.
IteratorState * current_state_
Pointer to current iterator state.
OctreeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::vector< IteratorState > &stack=std::vector< IteratorState >())
Constructor.
OctreeT::BranchNode BranchNode
OctreeFixedDepthIterator & operator=(const OctreeFixedDepthIterator &src)
Copy assignment.
OctreeFixedDepthIterator(const OctreeFixedDepthIterator &other)
Copy Constructor.
LeafContainer & getLeafContainer()
Method for retrieving a single leaf container from the octree leaf node.
OctreeNode * operator*() const
*operator.
unsigned int max_octree_depth_
Maximum octree depth.
unsigned int fixed_depth_
Given level of the node to be iterated.
void reset()
Reset the iterator to the root node of the octree.
void reset()
Reset the iterator to the root node of the octree.
virtual void reset()
Reset the iterator to the root node of the octree.
const OctreeKey & getCurrentOctreeKey() const
Get octree key for the current iterator octree node.
virtual unsigned long getNodeID() const
get a integer identifier for current node (note: identifier depends on tree depth).
OctreeT::BranchContainer BranchContainer
OctreeIteratorBase< OctreeT >::LeafNode LeafNode
OctreeIteratorBase< OctreeT >::BranchNode BranchNode
OctreeIteratorBase(unsigned int max_depth_arg=0)
Empty constructor.
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::vector< IteratorState > &stack=std::vector< IteratorState >())
Constructor.
OctreeDepthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
bool isLeafNode() const
check if current node is a branch node
Octree leaf node iterator class.
OctreeLeafNodeDepthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
OctreeBreadthFirstIterator(const OctreeBreadthFirstIterator &other)
Copy Constructor.
OctreeFixedDepthIterator(OctreeT *octree_arg, unsigned int fixed_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
void skipChildVoxels()
Skip all child voxels of current node and return to parent node.
void reset()
Reset the iterator to the first leaf in the breadth first way.
OctreeFixedDepthIterator()
Empty constructor.
unsigned int getCurrentOctreeDepth() const
Get the current depth level of octree.
OctreeDepthFirstIterator(const OctreeDepthFirstIterator &other)
Copy Constructor.
OctreeBreadthFirstIterator & operator++()
Preincrement operator.
OctreeT * octree_
Reference to octree class.
OctreeDepthFirstIterator & operator++()
Preincrement operator.
OctreeT::LeafNode LeafNode
Abstract octree iterator class
OctreeDepthFirstIterator & operator=(const OctreeDepthFirstIterator &src)
Copy assignment.
OctreeIteratorBase< OctreeT >::BranchNode BranchNode
char getNodeConfiguration() const
Get bit pattern of children configuration of current node.
virtual ~OctreeIteratorBase()
Empty deconstructor.
bool operator!=(const OctreeIteratorBase &other) const
Inequal comparison operator.
OctreeIteratorBase< OctreeT >::LeafNode LeafNode
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg=0)
Constructor.
OctreeLeafNodeBreadthFirstIterator & operator++()
Preincrement operator.
OctreeBreadthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
OctreeLeafNodeDepthFirstIterator & operator++()
Preincrement operator.
Abstract octree node class
OctreeIteratorBase(OctreeT *octree_arg, unsigned int max_depth_arg=0)
Constructor.
Octree leaf node iterator class.
bool isBranchNode() const
check if current node is a branch node
BranchContainer & getBranchContainer()
Method for retrieving the container from an octree branch node.
OctreeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.