18 #ifndef itkTreeIteratorBase_h
19 #define itkTreeIteratorBase_h
41 template<
typename TTreeType >
67 virtual bool Add(ValueType element);
70 virtual bool Add(
int position, ValueType element);
73 virtual bool Add(TTreeType & subTree);
76 virtual const ValueType & Get()
const;
79 virtual TTreeType * GetSubTree()
const;
82 virtual bool IsLeaf()
const;
85 virtual bool IsRoot()
const;
88 virtual NodeType GetType()
const = 0;
91 virtual bool GoToChild(ChildIdentifier number = 0);
94 virtual bool GoToParent();
97 void Set(ValueType element);
100 virtual bool HasChild(
int number = 0)
const;
103 virtual int ChildPosition(ValueType element)
const;
106 virtual bool RemoveChild(
int number);
109 virtual int CountChildren()
const;
112 virtual bool HasParent()
const;
115 virtual bool Disconnect();
133 virtual TreeNodeType * GetNode();
135 virtual const TreeNodeType * GetNode()
const;
138 TreeNodeType * GetRoot();
140 const TreeNodeType * GetRoot()
const;
143 TTreeType * GetTree()
const;
146 const TreeNodeType * GetParent()
const;
155 bool IsAtBegin()
const {
return ( m_Position == m_Begin ); }
159 bool IsAtEnd()
const {
return ( m_Position == m_End ); }
183 if(
this != &iterator)
187 m_End = iterator.
m_End;
210 virtual bool HasNext()
const = 0;
216 #ifndef ITK_MANUAL_INSTANTIATION
217 #include "itkTreeIteratorBase.hxx"
typename TTreeType::ValueType ValueType
typename TreeNodeType::ChildIdentifier ChildIdentifier
Self & operator=(const Self &iterator)
This class provides the base implementation for tree iterators.
typename TTreeType::TreeNodeType TreeNodeType
TreeNodeType * m_Position
const TreeNodeType * m_Root