Point Cloud Library (PCL)
1.9.1
|
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();
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>
OctreeT * octree_
Reference to octree class.
OctreeIteratorBase(OctreeT *octree_arg, unsigned int max_depth_arg=0)
Constructor.
This file defines compatibility wrappers for low level I/O functions.
OctreeFixedDepthIterator(OctreeT *octree_arg, unsigned int fixed_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
unsigned int max_octree_depth_
Maximum octree depth.
OctreeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
void reset()
Reset the iterator to the first leaf in the breadth first way.
OctreeNode * operator*() const
*operator.
OctreeT::LeafNode LeafNode
virtual node_type_t getNodeType() const =0
Pure virtual method for receiving the type of octree node (branch or leaf)
char getNodeConfiguration() const
Get bit pattern of children configuration of current node.
LeafContainer & getLeafContainer()
Method for retrieving a single leaf container from the octree leaf node.
OctreeLeafNodeDepthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
OctreeLeafNodeDepthFirstIterator & operator++()
Preincrement operator.
OctreeNode * getCurrentOctreeNode() const
Get the current octree node.
OctreeIteratorBase(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state)
Constructor.
OctreeDepthFirstIterator & operator=(const OctreeDepthFirstIterator &src)
Copy assignment.
std::deque< IteratorState > FIFO_
FIFO list.
OctreeFixedDepthIterator(const OctreeFixedDepthIterator &other)
Copy Constructor.
bool isLeafNode() const
check if current node is a branch node
OctreeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::vector< IteratorState > &stack=std::vector< IteratorState >())
Constructor.
Abstract octree node class
OctreeIteratorBase< OctreeT >::LeafNode LeafNode
OctreeLeafNodeBreadthFirstIterator & operator++()
Preincrement operator.
OctreeLeafNodeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
void reset()
Reset the iterator to the root node of the octree.
IteratorState * current_state_
Pointer to current iterator state.
bool operator!=(const OctreeIteratorBase &other) const
Inequal comparison operator.
OctreeFixedDepthIterator & operator=(const OctreeFixedDepthIterator &src)
Copy assignment.
const LeafContainer & getLeafContainer() const
Method for retrieving a single leaf container from the octree leaf node.
void skipChildVoxels()
Skip all child voxels of current node and return to parent node.
bool isBranchNode() const
check if current node is a branch node
virtual ~OctreeIteratorBase()
Empty deconstructor.
Abstract octree iterator class
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::vector< IteratorState > &stack=std::vector< IteratorState >())
Constructor.
virtual void reset()
Reset the iterator to the root node of the octree.
OctreeDepthFirstIterator & operator++()
Preincrement operator.
void reset()
Reset the iterator to the root node of the octree.
virtual unsigned long getNodeID() const
get a integer identifier for current node (note: identifier depends on tree depth).
OctreeBreadthFirstIterator(const OctreeBreadthFirstIterator &other)
Copy Constructor.
Octree leaf node iterator class.
std::vector< IteratorState > stack_
Stack structure.
OctreeDepthFirstIterator(const OctreeDepthFirstIterator &other)
Copy Constructor.
const BranchContainer & getBranchContainer() const
Method for retrieving the container from an octree branch node.
OctreeFixedDepthIterator()
Empty constructor.
bool operator==(const OctreeIteratorBase &other) const
Equal comparison operator.
Octree leaf node iterator class.
OctreeT::BranchContainer BranchContainer
OctreeBreadthFirstIterator & operator++()
Preincrement operator.
BranchContainer & getBranchContainer()
Method for retrieving the container from an octree branch node.
unsigned int getCurrentOctreeDepth() const
Get the current depth level of octree.
OctreeNode * operator*() const
*operator.
OctreeIteratorBase(unsigned int max_depth_arg=0)
Empty constructor.
OctreeIteratorBase< OctreeT >::LeafNode LeafNode
OctreeIteratorBase< OctreeT >::BranchNode BranchNode
OctreeT::BranchNode BranchNode
void reset()
Reset the iterator to the first node at the current depth.
OctreeT::LeafContainer LeafContainer
OctreeIteratorBase< OctreeT >::BranchNode BranchNode
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg=0)
Constructor.
OctreeDepthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
unsigned int fixed_depth_
Given level of the node to be iterated.
OctreeBreadthFirstIterator & operator=(const OctreeBreadthFirstIterator &src)
Copy operator.
OctreeBreadthFirstIterator(OctreeT *octree_arg, unsigned int max_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
const OctreeKey & getCurrentOctreeKey() const
Get octree key for the current iterator octree node.
void reset()
Reset iterator.