42 #include <pcl/octree/octree_key.h>
43 #include <pcl/octree/octree_nodes.h>
52 #pragma GCC system_header
74 template <
typename OctreeT>
273 ret =
octree_->getBranchBitPattern(*current_branch);
291 return leaf_node->getContainer();
306 return leaf_node->getContainer();
321 return branch_node->getContainer();
336 return branch_node->getContainer();
342 virtual unsigned long
345 unsigned long id = 0;
354 id =
static_cast<unsigned long>(key.
x) << (depth * 2) |
355 static_cast<unsigned long>(key.
y) << (depth * 1) |
356 static_cast<unsigned long>(key.
z) << (depth * 0);
380 template <
typename OctreeT>
412 const std::vector<IteratorState>& stack = std::vector<IteratorState>())
485 template <
typename OctreeT>
516 const std::deque<IteratorState>& fifo = std::deque<IteratorState>())
584 template <
typename OctreeT>
615 const std::deque<IteratorState>& fifo = std::deque<IteratorState>())
617 octree_arg, fixed_depth_arg, current_state, fifo)
672 template <
typename OctreeT>
711 const std::vector<IteratorState>& stack = std::vector<IteratorState>())
774 template <
typename OctreeT>
806 const std::deque<IteratorState>& fifo = std::deque<IteratorState>());
847 #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(OctreeT *octree_arg, uindex_t max_depth_arg, IteratorState *current_state, const std::deque< IteratorState > &fifo=std::deque< IteratorState >())
Constructor.
void reset()
Reset the iterator to the root node of the octree.
OctreeBreadthFirstIterator(uindex_t max_depth_arg=0)
Empty constructor.
std::deque< IteratorState > FIFO_
FIFO list.
OctreeBreadthFirstIterator operator++(int)
postincrement operator.
typename OctreeIteratorBase< OctreeT >::BranchNode BranchNode
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.
OctreeDepthFirstIterator(OctreeT *octree_arg, uindex_t 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(uindex_t max_depth_arg=0)
Empty constructor.
OctreeFixedDepthIterator(OctreeT *octree_arg, uindex_t 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.
OctreeFixedDepthIterator(const OctreeFixedDepthIterator &other)
Copy Constructor.
OctreeFixedDepthIterator & operator=(const OctreeFixedDepthIterator &src)
Copy assignment.
uindex_t fixed_depth_
Given level of the node to be iterated.
Abstract octree iterator class
char getNodeConfiguration() const
Get bit pattern of children configuration of current node.
virtual OctreeNode * operator*() const
*operator.
OctreeIteratorBase(uindex_t max_depth_arg)
Constructor.
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.
OctreeIteratorBase(OctreeT *octree_arg, uindex_t max_depth_arg, IteratorState *current_state)
Constructor.
uindex_t max_octree_depth_
Maximum octree depth.
uindex_t getCurrentOctreeDepth() const
Get the current depth level of octree.
OctreeIteratorBase()
Empty constructor.
OctreeIteratorBase(OctreeT *octree_arg, uindex_t max_depth_arg)
Constructor.
bool isBranchNode() const
check if current node is a branch node
OctreeIteratorBase(OctreeT *octree_arg)
Constructor.
OctreeNode * getCurrentOctreeNode() const
Get the current octree node.
const LeafContainer & getLeafContainer() const
Method for retrieving a single leaf container from the octree leaf node.
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.
virtual ~OctreeIteratorBase()=default
Empty deconstructor.
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.
virtual OctreeIteratorBase & operator++()=0
Preincrement operator.
void reset()
Reset iterator.
std::forward_iterator_tag iterator_category
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(uindex_t max_depth_arg=0)
Empty constructor.
void reset()
Reset the iterator to the first leaf in the breadth first way.
OctreeLeafNodeBreadthFirstIterator & operator++()
Preincrement operator.
OctreeNode * operator*() const override
*operator.
Octree leaf node iterator class.
OctreeLeafNodeDepthFirstIterator & operator++()
Preincrement operator.
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, uindex_t max_depth_arg, IteratorState *current_state, const std::vector< IteratorState > &stack=std::vector< IteratorState >())
Constructor.
OctreeLeafNodeDepthFirstIterator operator++(int)
postincrement operator.
OctreeNode * operator*() const override
*operator.
OctreeLeafNodeDepthFirstIterator(OctreeT *octree_arg, uindex_t max_depth_arg=0)
Constructor.
void reset()
Reset the iterator to the root node of the octree.
OctreeLeafNodeDepthFirstIterator(uindex_t max_depth_arg=0)
Empty constructor.
Abstract octree node class
virtual node_type_t getNodeType() const =0
Pure virtual method for retrieving the type of octree node (branch or leaf)
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
IteratorState(OctreeNode *node, const OctreeKey &key, uindex_t depth)