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(
void)
const {
return ( m_Position == m_Begin ); }
159 bool IsAtEnd(
void)
const {
return ( m_Position == m_End ); }
185 if(
this != &iterator)
189 m_End = iterator.
m_End;
212 virtual bool HasNext()
const = 0;
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkTreeIteratorBase.hxx"
bool IsAtBegin(void) const
TreeNodeType::ChildIdentifier ChildIdentifier
TTreeType::TreeNodeType TreeNodeType
TTreeType::ValueType ValueType
virtual ~TreeIteratorBase()
Self & operator=(const Self &iterator)
This class provides the base implementation for tree iterators.
TreeNodeType * m_Position
const TreeNodeType * m_Root