39 #ifndef PCL_OCTREE_ITERATOR_HPP_ 40 #define PCL_OCTREE_ITERATOR_HPP_ 47 template<
typename OctreeT>
56 template<
typename OctreeT>
65 template<
typename OctreeT>
71 template<
typename OctreeT>
90 stack_.push_back(stack_entry);
98 template<
typename OctreeT>
105 unsigned char current_depth =
stack_.back ().depth_;
108 while (
stack_.size () && (
stack_.back ().depth_ >= current_depth))
123 template<
typename OctreeT>
140 unsigned char child_idx;
147 for (child_idx = 0; child_idx < 8; ++child_idx)
152 if (this->
octree_->branchHasChild(*current_branch, child_idx))
157 stack_entry.
node_ = this->
octree_->getBranchChildPtr(*current_branch, child_idx);
159 stack_.push_back(stack_entry);
179 template<
typename OctreeT>
190 template<
typename OctreeT>
201 template<
typename OctreeT>
207 template<
typename OctreeT>
223 FIFO_.push_back(FIFO_entry);
230 template<
typename OctreeT>
247 unsigned char child_idx;
254 for (child_idx = 0; child_idx < 8 ; ++child_idx)
258 if (this->
octree_->branchHasChild(*current_branch, child_idx))
261 current_key.
pushBranch (static_cast<unsigned char> (child_idx));
263 FIFO_entry.
node_ = this->
octree_->getBranchChildPtr(*current_branch, child_idx);
265 FIFO_.push_back(FIFO_entry);
void reset()
Reset iterator.
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.
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.
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.
OctreeDepthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.
void skipChildVoxels()
Skip all child voxels of current node and return to parent node.
virtual ~OctreeBreadthFirstIterator()
Empty deconstructor.
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
virtual ~OctreeDepthFirstIterator()
Empty deconstructor.
OctreeBreadthFirstIterator(unsigned int max_depth_arg=0)
Empty constructor.