39 #ifndef PCL_OCTREE_ITERATOR_HPP_ 40 #define PCL_OCTREE_ITERATOR_HPP_ 42 #include <pcl/console/print.h> 49 template<
typename OctreeT>
58 template<
typename OctreeT>
67 template<
typename OctreeT>
86 stack_.push_back(stack_entry);
94 template<
typename OctreeT>
101 unsigned char current_depth =
stack_.back ().depth_;
104 while (
stack_.size () && (
stack_.back ().depth_ >= current_depth))
119 template<
typename OctreeT>
141 for (int8_t i = 7; i >= 0; --i)
143 const unsigned char child_idx = (
unsigned char) i;
146 if (this->
octree_->branchHasChild(*current_branch, child_idx))
151 stack_entry.
node_ = this->
octree_->getBranchChildPtr(*current_branch, child_idx);
153 stack_.push_back(stack_entry);
173 template<
typename OctreeT>
184 template<
typename OctreeT>
195 template<
typename OctreeT>
211 FIFO_.push_back(FIFO_entry);
218 template<
typename OctreeT>
235 unsigned char child_idx;
242 for (child_idx = 0; child_idx < 8 ; ++child_idx)
246 if (this->
octree_->branchHasChild(*current_branch, child_idx))
249 current_key.
pushBranch (static_cast<unsigned char> (child_idx));
251 FIFO_entry.
node_ = this->
octree_->getBranchChildPtr(*current_branch, child_idx);
253 FIFO_.push_back(FIFO_entry);
274 template<
typename OctreeT>
280 template<
typename OctreeT>
284 this->
reset (fixed_depth_arg);
288 template<
typename OctreeT>
306 PCL_WARN (
"[pcl::octree::FixedDepthIterator] The requested fixed depth was bigger than the octree's depth.\n");
307 PCL_WARN (
"[pcl::octree::FixedDepthIterator] fixed_depth = %d (instead of %d)\n", this->
octree_->getTreeDepth (),
fixed_depth_);
326 template<
typename OctreeT>
334 template<
typename OctreeT>
342 template<
typename OctreeT>
344 unsigned int max_depth_arg,
346 const std::deque<IteratorState>& fifo)
354 template<
typename OctreeT>
362 template<
typename OctreeT>
375 template<
typename OctreeT>
void reset()
Reset iterator.
void reset()
Reset the iterator to the first node at the current depth.
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)
std::deque< IteratorState > FIFO_
FIFO list.
OctreeLeafNodeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
std::vector< IteratorState > stack_
Stack structure.
IteratorState * current_state_
Pointer to current iterator state.
OctreeT::BranchNode BranchNode
void popBranch()
pop child node from octree key
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.
virtual void reset()
Reset the iterator to the root node of the octree.
unsigned int getCurrentOctreeDepth() const
Get the current depth level of octree.
OctreeDepthFirstIterator(unsigned int max_depth_arg=0)
Empty 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.
OctreeBreadthFirstIterator & operator++()
Preincrement operator.
OctreeT * octree_
Reference to octree class.
OctreeDepthFirstIterator & operator++()
Preincrement operator.
Abstract octree iterator class
void pushBranch(unsigned char childIndex)
push a child node to the octree key
OctreeLeafNodeBreadthFirstIterator & operator++()
Preincrement operator.
Octree leaf node iterator class.
OctreeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.