17 #ifndef __itkPostOrderTreeIterator_h
18 #define __itkPostOrderTreeIterator_h
24 template <
class TTreeType>
59 template <
class TTreeType>
77 template <
class TTreeType>
86 template <
class TTreeType>
90 if(const_cast<TreeNodeType* >(FindNextNode()) !=
NULL)
98 template <
class TTreeType>
102 this->m_Position =
const_cast<TreeNodeType*
>(FindNextNode());
103 return this->m_Position->Get();
107 template <
class TTreeType>
111 if ( this->m_Position ==
NULL || this->m_Position == this->m_Root )
117 if ( sister !=
NULL )
119 return FindMostRightLeaf( sister );
122 return this->m_Position->GetParent();
127 template <
class TTreeType>
131 if ( !node->HasParent() )
137 int childPosition = parent->ChildPosition( node );
138 int lastChildPosition = parent->CountChildren() - 1;
140 while ( childPosition < lastChildPosition )
142 TreeNodeType* sister = parent->GetChild( childPosition + 1);
144 if ( sister !=
NULL )
154 template <
class TTreeType>
158 while ( node->HasChildren() )
161 int childCount = node->CountChildren();
166 helpNode = node->GetChild( i );
169 while ( helpNode ==
NULL && i < childCount );
171 if ( helpNode ==
NULL )
181 template <
class TTreeType>