18 #ifndef __itkInOrderTreeIterator_h
19 #define __itkInOrderTreeIterator_h
25 template<
class TTreeType >
64 template<
class TTreeType >
70 template<
class TTreeType >
76 template<
class TTreeType >
84 template<
class TTreeType >
87 if ( const_cast< TreeNodeType * >( FindNextNode() ) !=
NULL )
96 template<
class TTreeType >
100 this->m_Position =
const_cast< TreeNodeType *
>( FindNextNode() );
101 return this->m_Position->Get();
106 template<
class TTreeType >
110 if ( this->m_Position ==
NULL )
115 if ( this->m_Position->HasChildren() )
117 return this->m_Position->GetChild(0);
120 if ( !this->m_Position->HasParent() )
128 int childPosition = parent->ChildPosition(child);
129 int lastChildPosition = parent->CountChildren() - 1;
131 while ( childPosition < lastChildPosition )
133 TreeNodeType *help = parent->GetChild(childPosition + 1);
141 while ( parent->HasParent() )
144 parent = parent->GetParent();
147 if ( parent->ChildPosition(this->m_Root) >= 0 )
151 childPosition = parent->ChildPosition(child);
152 lastChildPosition = parent->CountChildren() - 1;
154 while ( childPosition < lastChildPosition )
156 TreeNodeType *help = parent->GetChild(childPosition + 1);
167 template<
class TTreeType >