@@ -86,22 +86,36 @@ namespace pcl
86
86
87
87
/* * \brief Empty constructor.
88
88
*/
89
+ OctreeIteratorBase () :
90
+ octree_ (0 ), current_state_(0 ), max_octree_depth_(0 )
91
+ {}
92
+
89
93
explicit
90
- OctreeIteratorBase (unsigned int max_depth_arg = 0 ) :
94
+ OctreeIteratorBase (unsigned int max_depth_arg) :
91
95
octree_ (0 ), current_state_(0 ), max_octree_depth_(max_depth_arg)
92
- {
93
- this ->reset ();
94
- }
96
+ {}
95
97
96
98
/* * \brief Constructor.
97
99
* \param[in] octree_arg Octree to be iterated. Initially the iterator is set to its root node.
98
100
* \param[in] max_depth_arg Depth limitation during traversal
99
101
*/
100
102
explicit
101
- OctreeIteratorBase (OctreeT* octree_arg, unsigned int max_depth_arg = 0 ) :
102
- octree_ (octree_arg), current_state_(0 ), max_octree_depth_(max_depth_arg)
103
+ OctreeIteratorBase (OctreeT* octree_arg) :
104
+ octree_ (octree_arg),
105
+ current_state_ (0 ),
106
+ max_octree_depth_ (octree_arg? octree_->getTreeDepth () : 0)
107
+ {}
108
+
109
+ /* * \brief Constructor.
110
+ * \param[in] octree_arg Octree to be iterated. Initially the iterator is set to its root node.
111
+ * \param[in] max_depth_arg Depth limitation during traversal
112
+ */
113
+ OctreeIteratorBase (OctreeT* octree_arg, unsigned int max_depth_arg) :
114
+ octree_ (octree_arg),
115
+ current_state_(0 ),
116
+ // max_octree_depth_(octree_? std::min (max_depth_arg, octree_->getTreeDepth ()) : 0)
117
+ max_octree_depth_(max_depth_arg)
103
118
{
104
- this ->reset ();
105
119
}
106
120
107
121
/* * \brief Constructor.
@@ -156,10 +170,10 @@ namespace pcl
156
170
inline void reset ()
157
171
{
158
172
current_state_ = 0 ;
159
- if (octree_ && (!max_octree_depth_))
160
- {
161
- max_octree_depth_ = octree_->getTreeDepth ();
162
- }
173
+ // if (octree_ && (!max_octree_depth_))
174
+ // {
175
+ // max_octree_depth_ = octree_->getTreeDepth();
176
+ // }
163
177
}
164
178
165
179
/* * \brief Get octree key for the current iterator octree node
@@ -578,6 +592,10 @@ namespace pcl
578
592
template <typename OctreeT>
579
593
class OctreeFixedDepthIterator : public OctreeBreadthFirstIterator <OctreeT>
580
594
{
595
+ protected:
596
+
597
+ using OctreeIteratorBase<OctreeT>::max_octree_depth_;
598
+
581
599
public:
582
600
583
601
// public typedefs
@@ -608,30 +626,29 @@ namespace pcl
608
626
IteratorState* current_state,
609
627
const std::deque<IteratorState>& fifo = std::deque<IteratorState> ())
610
628
: OctreeBreadthFirstIterator<OctreeT> (octree_arg, fixed_depth_arg, current_state, fifo)
611
- , fixed_depth_ (fixed_depth_arg)
612
629
{}
613
630
614
631
/* * \brief Copy Constructor.
615
632
* \param[in] other Another OctreeFixedDepthIterator to copy from
616
633
*/
617
- OctreeFixedDepthIterator (const OctreeFixedDepthIterator& other)
618
- : OctreeBreadthFirstIterator<OctreeT> (other)
619
- {
620
- this ->fixed_depth_ = other.fixed_depth_ ;
621
- }
634
+ // OctreeFixedDepthIterator (const OctreeFixedDepthIterator& other)
635
+ // : OctreeBreadthFirstIterator<OctreeT> (other)
636
+ // {
637
+ // this->fixed_depth_ = other.fixed_depth_;
638
+ // }
622
639
623
640
/* * \brief Copy assignment.
624
641
* \param[in] src the iterator to copy into this
625
642
* \return pointer to the current octree node
626
643
*/
627
- inline OctreeFixedDepthIterator&
628
- operator = (const OctreeFixedDepthIterator& src)
629
- {
630
- OctreeBreadthFirstIterator<OctreeT>::operator = (src);
631
- this ->fixed_depth_ = src.fixed_depth_ ;
644
+ // inline OctreeFixedDepthIterator&
645
+ // operator = (const OctreeFixedDepthIterator& src)
646
+ // {
647
+ // OctreeBreadthFirstIterator<OctreeT>::operator= (src);
648
+ // this->fixed_depth_ = src.fixed_depth_;
632
649
633
- return (*this );
634
- }
650
+ // return (*this);
651
+ // }
635
652
636
653
/* * \brief Reset the iterator to the first node at the depth given as parameter
637
654
* \param[in] fixed_depth_arg Depth level during traversal
@@ -644,14 +661,14 @@ namespace pcl
644
661
void
645
662
reset ()
646
663
{
647
- this ->reset (fixed_depth_ );
664
+ this ->reset (max_octree_depth_ );
648
665
}
649
666
650
667
protected:
651
668
using OctreeBreadthFirstIterator<OctreeT>::FIFO_;
652
669
653
670
/* * \brief Given level of the node to be iterated */
654
- unsigned int fixed_depth_;
671
+ // unsigned int fixed_depth_;
655
672
};
656
673
657
674
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
0 commit comments