39 #ifndef PCL_OCTREE_ITERATOR_HPP_ 40 #define PCL_OCTREE_ITERATOR_HPP_ 45 #include <pcl/common/common.h> 52 template<
typename OctreeT>
61 template<
typename OctreeT>
70 template<
typename OctreeT>
76 template<
typename OctreeT>
95 stack_.push_back(stack_entry);
103 template<
typename OctreeT>
110 unsigned char current_depth =
stack_.back ().depth_;
113 while (
stack_.size () && (
stack_.back ().depth_ >= current_depth))
128 template<
typename OctreeT>
145 unsigned char child_idx;
152 for (child_idx = 0; child_idx < 8; ++child_idx)
157 if (this->
octree_->branchHasChild(*current_branch, child_idx))
162 stack_entry.
node_ = this->
octree_->getBranchChildPtr(*current_branch, child_idx);
164 stack_.push_back(stack_entry);
184 template<
typename OctreeT>
195 template<
typename OctreeT>
206 template<
typename OctreeT>
212 template<
typename OctreeT>
228 FIFO_.push_back(FIFO_entry);
235 template<
typename OctreeT>
252 unsigned char child_idx;
259 for (child_idx = 0; child_idx < 8 ; ++child_idx)
263 if (this->
octree_->branchHasChild(*current_branch, child_idx))
266 current_key.
pushBranch (static_cast<unsigned char> (child_idx));
268 FIFO_entry.
node_ = this->
octree_->getBranchChildPtr(*current_branch, child_idx);
270 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.