ITK
5.1.0
Insight Toolkit
|
#include <itkTreeIteratorBase.h>
Public Types | |
using | ChildIdentifier = typename TreeNodeType::ChildIdentifier |
using | NodeType = TreeIteratorBaseNodeEnum |
using | Self = TreeIteratorBase |
using | TreeNodeType = typename TTreeType::TreeNodeType |
using | ValueType = typename TTreeType::ValueType |
Public Member Functions | |
virtual bool | Add (int position, ValueType element) |
virtual bool | Add (TTreeType &subTree) |
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 |
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 () const |
bool | IsAtEnd () const |
virtual bool | IsLeaf () const |
virtual bool | IsRoot () const |
virtual TreeIteratorBase< TTreeType > * | Parents () |
bool | Remove () |
virtual bool | RemoveChild (int number) |
void | Set (ValueType element) |
TreeNodeType * | m_Position |
TreeNodeType * | m_Begin |
const TreeNodeType * | m_Root |
TTreeType * | m_Tree |
Self & | operator++ () |
void | operator++ (int) |
Self & | operator= (const Self &iterator) |
virtual | ~TreeIteratorBase ()=default |
TreeIteratorBase (TTreeType *tree, const TreeNodeType *start) | |
TreeIteratorBase (const TTreeType *tree, const TreeNodeType *start) | |
virtual bool | HasNext () const =0 |
virtual const ValueType & | Next ()=0 |
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 58 of file itkTreeIteratorBase.h.
using itk::TreeIteratorBase< TTreeType >::ChildIdentifier = typename TreeNodeType::ChildIdentifier |
Definition at line 65 of file itkTreeIteratorBase.h.
using itk::TreeIteratorBase< TTreeType >::NodeType = TreeIteratorBaseNodeEnum |
Backwards compatibility for enum values
Definition at line 68 of file itkTreeIteratorBase.h.
using itk::TreeIteratorBase< TTreeType >::Self = TreeIteratorBase |
Typedefs
Definition at line 62 of file itkTreeIteratorBase.h.
using itk::TreeIteratorBase< TTreeType >::TreeNodeType = typename TTreeType::TreeNodeType |
Definition at line 64 of file itkTreeIteratorBase.h.
using itk::TreeIteratorBase< TTreeType >::ValueType = typename TTreeType::ValueType |
Definition at line 63 of file itkTreeIteratorBase.h.
|
virtualdefault |
operator++
|
protected |
Constructors
|
protected |
operator++
|
virtual |
Add an element at a given position
|
virtual |
Add a subtree
|
virtual |
Add an element to the tree
|
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::PreOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< 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::PreOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
|
inline |
Move an iterator to the beginning of the tree
Definition at line 194 of file itkTreeIteratorBase.h.
|
virtual |
Go to the specified child
Reimplemented in itk::ChildTreeIterator< TTreeType >.
|
inline |
Move an iterator to the end of the tree.
Definition at line 201 of file itkTreeIteratorBase.h.
|
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 |
operator++
Implemented in itk::LevelOrderTreeIterator< TTreeType >, itk::ChildTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
|
virtual |
Return true if the current node has a parent
|
inline |
Is the iterator at the beginning of the tree?
Definition at line 208 of file itkTreeIteratorBase.h.
|
inline |
Is the iterator at the end of the tree?
Definition at line 215 of file itkTreeIteratorBase.h.
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 |
operator++
Implemented in itk::LevelOrderTreeIterator< TTreeType >, itk::ChildTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.
|
inline |
operator++
Definition at line 226 of file itkTreeIteratorBase.h.
|
inline |
operator++
Definition at line 235 of file itkTreeIteratorBase.h.
|
inline |
operator =
Definition at line 242 of file itkTreeIteratorBase.h.
References itk::TreeIteratorBase< TTreeType >::m_Begin, itk::TreeIteratorBase< TTreeType >::m_Position, itk::TreeIteratorBase< TTreeType >::m_Root, and itk::TreeIteratorBase< TTreeType >::m_Tree.
|
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 |
operator++
Definition at line 264 of file itkTreeIteratorBase.h.
Referenced by itk::LeafTreeIterator< TTreeType >::LeafTreeIterator(), itk::TreeIteratorBase< TTreeType >::operator=(), itk::PostOrderTreeIterator< TTreeType >::PostOrderTreeIterator(), and itk::RootTreeIterator< TTreeType >::RootTreeIterator().
|
mutableprotected |
operator++
Definition at line 263 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::operator=(), itk::PostOrderTreeIterator< TTreeType >::PostOrderTreeIterator(), and itk::RootTreeIterator< TTreeType >::RootTreeIterator().
|
protected |
operator++
Definition at line 265 of file itkTreeIteratorBase.h.
Referenced by itk::LeafTreeIterator< TTreeType >::FindNextNode(), itk::TreeIteratorBase< TTreeType >::operator=(), and itk::RootTreeIterator< TTreeType >::RootTreeIterator().
|
protected |
operator++
Definition at line 266 of file itkTreeIteratorBase.h.
Referenced by itk::TreeIteratorBase< TTreeType >::operator=().