42 #include <pcl/octree/octree_key.h>
43 #include <pcl/octree/octree_nodes.h>
52 #pragma GCC system_header
70 template <
typename OctreeT>
111 unsigned int max_depth_arg,
250 ret =
octree_->getBranchBitPattern(*current_branch);
268 return leaf_node->getContainer();
283 return leaf_node->getContainer();
298 return branch_node->getContainer();
313 return branch_node->getContainer();
319 virtual unsigned long
322 unsigned long id = 0;
330 unsigned int depth =
octree_->getTreeDepth();
331 id =
static_cast<unsigned long>(key.
x) << (depth * 2) |
332 static_cast<unsigned long>(key.
y) << (depth * 1) |
333 static_cast<unsigned long>(key.
z) << (depth * 0);
357 template <
typename OctreeT>
375 unsigned int max_depth_arg = 0);
387 unsigned int max_depth_arg,
389 const std::vector<IteratorState>& stack = std::vector<IteratorState>())
462 template <
typename OctreeT>
480 unsigned int max_depth_arg = 0);
492 unsigned int max_depth_arg,
494 const std::deque<IteratorState>& fifo = std::deque<IteratorState>())
562 template <
typename OctreeT>
579 unsigned int fixed_depth_arg = 0);
592 unsigned int fixed_depth_arg,
594 const std::deque<IteratorState>& fifo = std::deque<IteratorState>())
596 octree_arg, fixed_depth_arg, current_state, fifo)
626 reset(
unsigned int fixed_depth_arg);
651 template <
typename OctreeT>
672 unsigned int max_depth_arg = 0)
688 unsigned int max_depth_arg,
690 const std::vector<IteratorState>& stack = std::vector<IteratorState>())
753 template <
typename OctreeT>
770 unsigned int max_depth_arg = 0);
783 unsigned int max_depth_arg,
785 const std::deque<IteratorState>& fifo = std::deque<IteratorState>());
811 #include <pcl/octree/impl/octree_iterator.hpp>
typename OctreeIteratorBase< OctreeT >::LeafNode LeafNode
OctreeBreadthFirstIterator & operator=(const OctreeBreadthFirstIterator &src)
Copy operator.
OctreeBreadthFirstIterator(const OctreeBreadthFirstIterator &other)
Copy Constructor.
OctreeBreadthFirstIterator & operator++()
Preincrement operator.
OctreeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
void reset()
Reset the iterator to the root node of the octree.
std::deque< IteratorState > FIFO_
FIFO list.
OctreeBreadthFirstIterator operator++(int)
postincrement operator.
OctreeBreadthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
typename OctreeIteratorBase< OctreeT >::BranchNode BranchNode
OctreeDepthFirstIterator(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.
typename OctreeIteratorBase< OctreeT >::BranchNode BranchNode
typename OctreeIteratorBase< OctreeT >::LeafNode LeafNode
OctreeDepthFirstIterator(const OctreeDepthFirstIterator &other)
Copy Constructor.
std::vector< IteratorState > stack_
Stack structure.
void skipChildVoxels()
Skip all child voxels of current node and return to parent node.
OctreeDepthFirstIterator & operator++()
Preincrement operator.
OctreeDepthFirstIterator & operator=(const OctreeDepthFirstIterator &src)
Copy assignment.
OctreeDepthFirstIterator operator++(int)
postincrement operator.
virtual void reset()
Reset the iterator to the root node of the octree.
OctreeFixedDepthIterator(OctreeT *octree_arg, unsigned int fixed_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
void reset()
Reset the iterator to the first node at the current depth.
OctreeFixedDepthIterator()
Empty constructor.
unsigned int fixed_depth_
Given level of the node to be iterated.
OctreeFixedDepthIterator(const OctreeFixedDepthIterator &other)
Copy Constructor.
OctreeFixedDepthIterator & operator=(const OctreeFixedDepthIterator &src)
Copy assignment.
Abstract octree iterator class
OctreeNode * operator*() const
*operator.
unsigned int max_octree_depth_
Maximum octree depth.
char getNodeConfiguration() const
Get bit pattern of children configuration of current node.
OctreeT * octree_
Reference to octree class.
const OctreeKey & getCurrentOctreeKey() const
Get octree key for the current iterator octree node.
typename OctreeT::BranchNode BranchNode
LeafContainer & getLeafContainer()
Method for retrieving a single leaf container from the octree leaf node.
virtual ~OctreeIteratorBase()
Empty deconstructor.
bool isBranchNode() const
check if current node is a branch node
OctreeNode * getCurrentOctreeNode() const
Get the current octree node.
const LeafContainer & getLeafContainer() const
Method for retrieving a single leaf container from the octree leaf node.
OctreeIteratorBase(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state)
Constructor.
virtual unsigned long getNodeID() const
get a integer identifier for current node (note: identifier depends on tree depth).
typename OctreeT::LeafNode LeafNode
BranchContainer & getBranchContainer()
Method for retrieving the container from an octree branch node.
OctreeIteratorBase(unsigned int max_depth_arg=0)
Empty constructor.
OctreeIteratorBase(OctreeT *octree_arg, unsigned int max_depth_arg=0)
Constructor.
bool operator==(const OctreeIteratorBase &other) const
Equal comparison operator.
bool operator!=(const OctreeIteratorBase &other) const
Inequal comparison operator.
typename OctreeT::BranchContainer BranchContainer
IteratorState * current_state_
Pointer to current iterator state.
void reset()
Reset iterator.
unsigned int getCurrentOctreeDepth() const
Get the current depth level of octree.
const BranchContainer & getBranchContainer() const
Method for retrieving the container from an octree branch node.
typename OctreeT::LeafContainer LeafContainer
bool isLeafNode() const
check if current node is a branch node
Octree leaf node iterator class.
OctreeLeafNodeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
void reset()
Reset the iterator to the first leaf in the breadth first way.
OctreeLeafNodeBreadthFirstIterator & operator++()
Preincrement operator.
Octree leaf node iterator class.
OctreeLeafNodeDepthFirstIterator & operator++()
Preincrement operator.
OctreeLeafNodeDepthFirstIterator operator++(int)
postincrement operator.
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg=0)
Constructor.
void reset()
Reset the iterator to the root node of the octree.
OctreeNode * operator*() const
*operator.
OctreeLeafNodeDepthFirstIterator(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.
Abstract octree node class
virtual node_type_t getNodeType() const =0
Pure virtual method for receiving the type of octree node (branch or leaf)