ITK
4.3.0
Insight Segmentation and Registration Toolkit
|
#include <itkTreeIteratorBase.h>
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.
Public Types | |
typedef TreeNodeType::ChildIdentifier | ChildIdentifier |
enum | NodeType { UNDEFIND = 0, PREORDER = 1, INORDER = 2, POSTORDER = 3, LEVELORDER = 4, CHILD = 5, ROOT = 6, LEAF = 7 } |
typedef TreeIteratorBase | Self |
typedef TTreeType::TreeNodeType | TreeNodeType |
typedef TTreeType::ValueType | ValueType |
Public Member Functions | |
virtual bool | Add (ValueType element) |
virtual bool | Add (int position, ValueType element) |
virtual bool | Add (TTreeType &subTree) |
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 |
virtual TreeNodeType * | GetNode () |
virtual const TreeNodeType * | GetNode () const |
const TreeNodeType * | GetParent () const |
TreeNodeType * | GetRoot () |
const TreeNodeType * | GetRoot () const |
virtual TTreeType * | GetSubTree () const |
TTreeType * | GetTree () const |
virtual NodeType | GetType () const =0 |
void | GoToBegin () |
virtual bool | GoToChild (ChildIdentifier 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 |
const Self & | operator= (const Self &iterator) |
virtual TreeIteratorBase < TTreeType > * | Parents () |
bool | Remove () |
virtual bool | RemoveChild (int number) |
void | Set (ValueType element) |
virtual | ~TreeIteratorBase () |
Self & | operator++ () |
void | operator++ (int) |
Protected Member Functions | |
virtual bool | HasNext () const =0 |
virtual const ValueType & | Next ()=0 |
TreeIteratorBase (TTreeType *tree, const TreeNodeType *start) | |
TreeIteratorBase (const TTreeType *tree, const TreeNodeType *start) | |
Protected Attributes | |
TreeNodeType * | m_Begin |
TreeNodeType * | m_End |
TreeNodeType * | m_Position |
const TreeNodeType * | m_Root |
TTreeType * | m_Tree |
typedef TreeNodeType::ChildIdentifier itk::TreeIteratorBase< TTreeType >::ChildIdentifier |
Definition at line 50 of file itkTreeIteratorBase.h.
typedef TreeIteratorBase itk::TreeIteratorBase< TTreeType >::Self |
Typedefs
Definition at line 47 of file itkTreeIteratorBase.h.
typedef TTreeType::TreeNodeType itk::TreeIteratorBase< TTreeType >::TreeNodeType |
Definition at line 49 of file itkTreeIteratorBase.h.
typedef TTreeType::ValueType itk::TreeIteratorBase< TTreeType >::ValueType |
Definition at line 48 of file itkTreeIteratorBase.h.
enum itk::TreeIteratorBase::NodeType |
Enumerations
Definition at line 53 of file itkTreeIteratorBase.h.
|
inlinevirtual |
Definition at line 193 of file itkTreeIteratorBase.h.
|
protected |
Constructors
|
protected |
Constructors
|
virtual |
Add an element to the tree
|
virtual |
Add an element at a given position
|
virtual |
Add a subtree
|
virtual |
Return the current ChildPosition of an element
|
virtual |
Return a list of children
|
pure virtual |
Clone the iterator
Implemented in itk::LevelOrderTreeIterator< TTreeType >, itk::ChildTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::RootTreeIterator< TTreeType >, and itk::PreOrderTreeIterator< TTreeType >.
|
virtual |
Count the number of nodes
|
virtual |
Count the number of children
|
virtual |
Disconnect the tree
|
virtual |
Get a value
|
virtual |
Return a list of child
|
virtual |
Get the current node
Referenced by itk::LeafTreeIterator< TTreeType >::FindNextNode().
|
virtual |
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetParent | ( | ) | const |
Return the first parent found
TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetRoot | ( | ) |
Get the root
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetRoot | ( | ) | const |
|
virtual |
Get the subtree
TTreeType* itk::TreeIteratorBase< TTreeType >::GetTree | ( | ) | const |
Get the tree
|
pure virtual |
Get the type of iterator
Implemented in itk::LevelOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::RootTreeIterator< TTreeType >, and itk::PreOrderTreeIterator< TTreeType >.
|
inline |
Move an iterator to the beginning of the tree
Definition at line 149 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::m_Begin, and itk::TreeIteratorBase< TTreeType >::m_Position.
|
virtual |
Go to the specified child
Reimplemented in itk::ChildTreeIterator< TTreeType >.
|
inline |
Move an iterator to the end of the tree.
Definition at line 152 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::m_End, and itk::TreeIteratorBase< TTreeType >::m_Position.
|
virtual |
Go to the parent
Reimplemented in itk::ChildTreeIterator< TTreeType >.
|
virtual |
Return true if the current node has a child
Referenced by itk::LeafTreeIterator< TTreeType >::FindNextNode().
|
protectedpure virtual |
|
virtual |
Return true if the current node has a parent
|
inline |
Is the iterator at the beginning of the tree?
Definition at line 155 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::m_Begin, and itk::TreeIteratorBase< TTreeType >::m_Position.
|
inline |
Is the iterator at the end of the tree?. The iterator is at the end if it points to NULL
Definition at line 159 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::m_End, and itk::TreeIteratorBase< TTreeType >::m_Position.
Referenced by itk::LeafTreeIterator< TTreeType >::FindNextNode().
|
virtual |
Return true if the current node is a leaf
|
virtual |
Return true if the current node is a root
|
protectedpure virtual |
Implemented in itk::LevelOrderTreeIterator< TTreeType >, itk::ChildTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::RootTreeIterator< TTreeType >, and itk::PreOrderTreeIterator< TTreeType >.
Referenced by itk::TreeIteratorBase< TTreeType >::operator++().
|
inline |
operator++
Definition at line 166 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::Next().
|
inline |
operator++
Definition at line 175 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::Next().
|
inline |
operator =
Definition at line 183 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::m_Begin, itk::TreeIteratorBase< TTreeType >::m_End, itk::TreeIteratorBase< TTreeType >::m_Position, itk::TreeIteratorBase< TTreeType >::m_Root, and itk::TreeIteratorBase< TTreeType >::m_Tree.
Referenced by itk::ChildTreeIterator< TTreeType >::operator=(), and itk::LevelOrderTreeIterator< TTreeType >::operator=().
|
virtual |
Return a list of parents
bool itk::TreeIteratorBase< TTreeType >::Remove | ( | ) |
Remove the current node from the tree
|
virtual |
Remove a child
void itk::TreeIteratorBase< TTreeType >::Set | ( | ValueType | element | ) |
Set the current value of the node
|
mutableprotected |
Definition at line 203 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::IsAtBegin(), itk::LeafTreeIterator< TTreeType >::LeafTreeIterator(), itk::TreeIteratorBase< TTreeType >::operator=(), itk::PostOrderTreeIterator< TTreeType >::PostOrderTreeIterator(), and itk::RootTreeIterator< TTreeType >::RootTreeIterator().
|
mutableprotected |
Definition at line 204 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::GoToEnd(), itk::TreeIteratorBase< TTreeType >::IsAtEnd(), and itk::TreeIteratorBase< TTreeType >::operator=().
|
mutableprotected |
Definition at line 202 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::GoToEnd(), itk::TreeIteratorBase< TTreeType >::IsAtBegin(), itk::TreeIteratorBase< TTreeType >::IsAtEnd(), itk::TreeIteratorBase< TTreeType >::operator=(), itk::PostOrderTreeIterator< TTreeType >::PostOrderTreeIterator(), and itk::RootTreeIterator< TTreeType >::RootTreeIterator().
|
protected |
Definition at line 205 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::operator=(), and itk::RootTreeIterator< TTreeType >::RootTreeIterator().
|
protected |
Definition at line 206 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::operator=().