#include <itkTreeIteratorBase.h>
Public Types | |
enum | { UNDEFIND = 0, PREORDER = 1, INORDER = 2, POSTORDER = 3, LEVELORDER = 4, CHILD = 5, ROOT = 6, LEAF = 7 } |
Public Member Functions | |
virtual bool | Add (TTreeType &subTree) |
virtual bool | Add (int position, ValueType element) |
virtual bool | Add (ValueType element) |
virtual int | ChildPosition (ValueType element) const |
virtual TreeIteratorBase < TTreeType > * | Children () |
virtual TreeIteratorBase < TTreeType > * | Clone ()=0 |
virtual int | Count () |
virtual int | CountChildren () const |
virtual bool | Disconnect () |
virtual const ValueType & | Get () const |
virtual TreeIteratorBase < TTreeType > * | GetChild (int number) const |
const TreeNodeType * | GetParent () const |
virtual TTreeType * | GetSubTree () const |
TTreeType * | GetTree () const |
virtual int | GetType () const =0 |
void | GoToBegin () |
virtual bool | GoToChild (int number=0) |
void | GoToEnd () |
virtual bool | GoToParent () |
virtual bool | HasChild (int number=0) const |
virtual bool | HasParent () const |
bool | IsAtBegin (void) const |
bool | IsAtEnd (void) const |
virtual bool | IsLeaf () const |
virtual bool | IsRoot () const |
void | operator++ (int) |
Self & | operator++ () |
const Self & | operator= (const Self &iterator) |
virtual TreeIteratorBase < TTreeType > * | Parents () |
bool | Remove () |
virtual bool | RemoveChild (int number) |
void | Set (ValueType element) |
virtual | ~TreeIteratorBase () |
virtual const TreeNodeType * | GetNode () const |
virtual TreeNodeType * | GetNode () |
const TreeNodeType * | GetRoot () const |
TreeNodeType * | GetRoot () |
Protected Member Functions | |
virtual bool | HasNext () const =0 |
virtual const ValueType & | Next ()=0 |
TreeIteratorBase (const TTreeType *tree, const TreeNodeType *start) | |
TreeIteratorBase (TTreeType *tree, const TreeNodeType *start) | |
Protected Attributes | |
TreeNodeType * | m_Begin |
TreeNodeType * | m_End |
TreeNodeType * | m_Position |
const TreeNodeType * | m_Root |
TTreeType * | m_Tree |
This class provides the base implementation for tree iterators
Events will notify interested observers about tree changes. These events all derive from TreeChangeEvent. They are:
All those events have a member GetChangePosition(), which returns an iterator to the position that has changd. Please note that this iterator may not be fully functional, but you should always be able to use its Get() method to retrieve the thing it points to.
Definition at line 42 of file itkTreeIteratorBase.h.
typedef TreeIteratorBase itk::TreeIteratorBase< TTreeType >::Self |
Typedefs
Reimplemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, and itk::PostOrderTreeIterator< TTreeType >.
Definition at line 47 of file itkTreeIteratorBase.h.
typedef TTreeType::TreeNodeType itk::TreeIteratorBase< TTreeType >::TreeNodeType |
Reimplemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
Definition at line 49 of file itkTreeIteratorBase.h.
typedef TTreeType::ValueType itk::TreeIteratorBase< TTreeType >::ValueType |
Reimplemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
Definition at line 48 of file itkTreeIteratorBase.h.
anonymous enum |
Enumerations
Definition at line 162 of file itkTreeIteratorBase.h.
virtual itk::TreeIteratorBase< TTreeType >::~TreeIteratorBase | ( | ) | [inline, virtual] |
Definition at line 200 of file itkTreeIteratorBase.h.
itk::TreeIteratorBase< TTreeType >::TreeIteratorBase | ( | TTreeType * | tree, | |
const TreeNodeType * | start | |||
) | [protected] |
Constructors
itk::TreeIteratorBase< TTreeType >::TreeIteratorBase | ( | const TTreeType * | tree, | |
const TreeNodeType * | start | |||
) | [protected] |
Constructors
virtual bool itk::TreeIteratorBase< TTreeType >::Add | ( | TTreeType & | subTree | ) | [virtual] |
Add a subtree
virtual bool itk::TreeIteratorBase< TTreeType >::Add | ( | int | position, | |
ValueType | element | |||
) | [virtual] |
Add an element at a given position
virtual bool itk::TreeIteratorBase< TTreeType >::Add | ( | ValueType | element | ) | [virtual] |
Add an element to the tree
virtual int itk::TreeIteratorBase< TTreeType >::ChildPosition | ( | ValueType | element | ) | const [virtual] |
Return the current ChildPosition of an element
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::Children | ( | ) | [virtual] |
Return a list of children
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::Clone | ( | ) | [pure virtual] |
Clone the iterator
Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
virtual int itk::TreeIteratorBase< TTreeType >::Count | ( | ) | [virtual] |
Count the number of nodes
virtual int itk::TreeIteratorBase< TTreeType >::CountChildren | ( | ) | const [virtual] |
Count the number of children
virtual bool itk::TreeIteratorBase< TTreeType >::Disconnect | ( | ) | [virtual] |
Disconnect the tree
virtual const ValueType& itk::TreeIteratorBase< TTreeType >::Get | ( | ) | const [virtual] |
Get a value
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::GetChild | ( | int | number | ) | const [virtual] |
Return a list of child
virtual const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetNode | ( | ) | const [virtual] |
Get the current node
virtual TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetNode | ( | ) | [virtual] |
Get the current node
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetParent | ( | ) | const |
Return the first parent found
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetRoot | ( | ) | const |
Get the root
TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetRoot | ( | ) |
Get the root
virtual TTreeType* itk::TreeIteratorBase< TTreeType >::GetSubTree | ( | ) | const [virtual] |
Get the subtree
TTreeType* itk::TreeIteratorBase< TTreeType >::GetTree | ( | ) | const |
Get the tree
virtual int itk::TreeIteratorBase< TTreeType >::GetType | ( | ) | const [pure virtual] |
Get the type of iterator
Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
void itk::TreeIteratorBase< TTreeType >::GoToBegin | ( | void | ) | [inline] |
Move an iterator to the beginning of the tree
Definition at line 134 of file itkTreeIteratorBase.h.
virtual bool itk::TreeIteratorBase< TTreeType >::GoToChild | ( | int | number = 0 |
) | [virtual] |
Go to the specified child
Reimplemented in itk::ChildTreeIterator< TTreeType >.
void itk::TreeIteratorBase< TTreeType >::GoToEnd | ( | void | ) | [inline] |
Move an iterator to the end of the tree.
Definition at line 140 of file itkTreeIteratorBase.h.
virtual bool itk::TreeIteratorBase< TTreeType >::GoToParent | ( | ) | [virtual] |
Go to the parent
Reimplemented in itk::ChildTreeIterator< TTreeType >.
virtual bool itk::TreeIteratorBase< TTreeType >::HasChild | ( | int | number = 0 |
) | const [virtual] |
Return true if the current node has a child
virtual bool itk::TreeIteratorBase< TTreeType >::HasNext | ( | ) | const [protected, pure virtual] |
virtual bool itk::TreeIteratorBase< TTreeType >::HasParent | ( | ) | const [virtual] |
Return true if the current node has a parent
bool itk::TreeIteratorBase< TTreeType >::IsAtBegin | ( | void | ) | const [inline] |
Is the iterator at the beginning of the tree?
Definition at line 146 of file itkTreeIteratorBase.h.
bool itk::TreeIteratorBase< TTreeType >::IsAtEnd | ( | void | ) | const [inline] |
Is the iterator at the end of the tree?. The iterator is at the end if it points to NULL
Definition at line 153 of file itkTreeIteratorBase.h.
virtual bool itk::TreeIteratorBase< TTreeType >::IsLeaf | ( | ) | const [virtual] |
Return true if the current node is a leaf
virtual bool itk::TreeIteratorBase< TTreeType >::IsRoot | ( | ) | const [virtual] |
Return true if the current node is a root
virtual const ValueType& itk::TreeIteratorBase< TTreeType >::Next | ( | ) | [protected, pure virtual] |
Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
Referenced by itk::TreeIteratorBase< TTreeType >::operator++().
void itk::TreeIteratorBase< TTreeType >::operator++ | ( | int | ) | [inline] |
operator++
Definition at line 183 of file itkTreeIteratorBase.h.
Self& itk::TreeIteratorBase< TTreeType >::operator++ | ( | ) | [inline] |
operator++
Definition at line 175 of file itkTreeIteratorBase.h.
const Self& itk::TreeIteratorBase< TTreeType >::operator= | ( | const Self & | iterator | ) | [inline] |
operator =
Definition at line 190 of file itkTreeIteratorBase.h.
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::Parents | ( | ) | [virtual] |
Return a list of parents
bool itk::TreeIteratorBase< TTreeType >::Remove | ( | ) |
Remove the current node from the tree
virtual bool itk::TreeIteratorBase< TTreeType >::RemoveChild | ( | int | number | ) | [virtual] |
Remove a child
void itk::TreeIteratorBase< TTreeType >::Set | ( | ValueType | element | ) |
Set the current value of the node
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Begin [mutable, protected] |
Definition at line 210 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::IsAtBegin(), and itk::TreeIteratorBase< TTreeType >::operator=().
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_End [mutable, protected] |
Definition at line 211 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::GoToEnd(), itk::TreeIteratorBase< TTreeType >::IsAtEnd(), and itk::TreeIteratorBase< TTreeType >::operator=().
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Position [mutable, protected] |
Definition at line 209 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::GoToEnd(), itk::TreeIteratorBase< TTreeType >::IsAtBegin(), itk::TreeIteratorBase< TTreeType >::IsAtEnd(), and itk::TreeIteratorBase< TTreeType >::operator=().
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Root [protected] |
Definition at line 212 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::operator=().
TTreeType* itk::TreeIteratorBase< TTreeType >::m_Tree [protected] |
Definition at line 213 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::operator=().