18 #ifndef itkPreOrderTreeIterator_h 19 #define itkPreOrderTreeIterator_h 26 template<
typename TTreeType >
27 class LeafTreeIterator;
29 template<
typename TTreeType >
51 const ValueType &
Next();
68 template<
typename TTreeType >
74 template<
typename TTreeType >
82 template<
typename TTreeType >
86 if ( const_cast< TreeNodeType * >(
FindNextNode() ) != ITK_NULLPTR )
95 template<
typename TTreeType >
105 template<
typename TTreeType >
128 if ( parent && parent->ChildPosition(this->m_Root) >= 0 )
133 int childPosition = parent->ChildPosition(child);
134 int lastChildPosition = parent->CountChildren() - 1;
136 while ( childPosition < lastChildPosition )
140 if ( help != ITK_NULLPTR )
147 while ( parent->HasParent() )
150 parent =
dynamic_cast< TreeNodeType *
>( parent->GetParent() );
153 if ( parent->ChildPosition(this->m_Root) >= 0 )
158 childPosition = parent->ChildPosition(child);
159 lastChildPosition = parent->CountChildren() - 1;
161 while ( childPosition < lastChildPosition )
165 if ( help != ITK_NULLPTR )
175 template<
typename TTreeType >
TTreeType::TreeNodeType TreeNodeType
TreeIteratorBase< TTreeType > * Clone()
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Superclass::TreeNodeType TreeNodeType
PreOrderTreeIterator(const TTreeType *tree, const TreeNodeType *start=nullptr)
const TreeNodeType * FindNextNode() const
TreeIteratorBase< TTreeType > Superclass
This class provides the base implementation for tree iterators.
TTreeType::ValueType ValueType
TreeNodeType * m_Position
Superclass::NodeType NodeType