Orfeo Toolbox  4.2
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
itk::TreeContainer< TValue > Class Template Reference

A tree container. More...

#include <itkTreeContainer.h>

+ Inheritance diagram for itk::TreeContainer< TValue >:
+ Collaboration diagram for itk::TreeContainer< TValue >:

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef TreeIteratorBase< SelfIteratorType
 
typedef SmartPointer< SelfPointer
 
typedef PreOrderTreeIterator
< Self
PreOrderIteratorType
 
typedef TreeContainer< TValue > Self
 
typedef TreeContainerBase< TValue > Superclass
 
typedef TreeNode< ValueTypeTreeNodeType
 
typedef TValue ValueType
 
- Public Types inherited from itk::TreeContainerBase< TValue >
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef TreeContainerBase Self
 
typedef Object Superclass
 
typedef TValue ValueType
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

 TreeContainer (int defaultChildrenCount)
 
 TreeContainer (TreeContainer< TValue > &tree)
 
bool Add (const TValue child, const TValue parent)
 
bool Clear ()
 
bool Contains (const TValue element)
 
int Count () const
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
const TreeNodeTypeGetNode (TValue val) const
 
const TreeNodeTypeGetRoot () const
 
bool IsLeaf (const TValue element)
 
bool IsRoot (const TValue element)
 
bool operator== (TreeContainer< TValue > &tree)
 
virtual bool SetRoot (const TValue element)
 
bool SetRoot (IteratorType &pos)
 
virtual bool SetRoot (TreeNode< TValue > *node)
 
bool Swap (IteratorType &v, IteratorType &w)
 
- Public Member Functions inherited from itk::TreeContainerBase< TValue >
void SetSubtree (bool val)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary (void)
 
const MetaDataDictionaryGetMetaDataDictionary (void) const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName ()
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const ITK_OVERRIDE
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) ITK_OVERRIDE
 
virtual void UnRegister () const ITK_OVERRIDE
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 TreeContainer ()
 
virtual ~TreeContainer ()
 
void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::TreeContainerBase< TValue >
 TreeContainerBase ()
 
virtual ~TreeContainerBase ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
virtual ~Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
- Protected Member Functions inherited from itk::LightObject
 LightObject ()
 
virtual ~LightObject ()
 
virtual LightObject::Pointer InternalClone () const
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 

Protected Attributes

int m_DefaultChildrenCount
 
TreeNodeType::Pointer m_Root
 
- Protected Attributes inherited from itk::TreeContainerBase< TValue >
bool m_SubTree
 

Additional Inherited Members

- Protected Types inherited from itk::LightObject
typedef int InternalReferenceCountType
 

Detailed Description

template<typename TValue>
class itk::TreeContainer< TValue >

A tree container.

This class derives from the TreeContainerBase class. The class is templated over the type of the elements.

Template Parameters
TValueElement type stored at each location in the Tree.

Definition at line 38 of file itkTreeContainer.h.

Member Typedef Documentation

template<typename TValue>
typedef SmartPointer< const Self > itk::TreeContainer< TValue >::ConstPointer

Definition at line 46 of file itkTreeContainer.h.

template<typename TValue>
typedef TreeIteratorBase< Self > itk::TreeContainer< TValue >::IteratorType

Iterators typedef

Definition at line 51 of file itkTreeContainer.h.

template<typename TValue>
typedef SmartPointer< Self > itk::TreeContainer< TValue >::Pointer

Definition at line 45 of file itkTreeContainer.h.

template<typename TValue>
typedef PreOrderTreeIterator< Self > itk::TreeContainer< TValue >::PreOrderIteratorType

Definition at line 52 of file itkTreeContainer.h.

template<typename TValue>
typedef TreeContainer< TValue > itk::TreeContainer< TValue >::Self

Definition at line 44 of file itkTreeContainer.h.

template<typename TValue>
typedef TreeContainerBase< TValue > itk::TreeContainer< TValue >::Superclass

Standard typedefs

Definition at line 43 of file itkTreeContainer.h.

template<typename TValue>
typedef TreeNode< ValueType > itk::TreeContainer< TValue >::TreeNodeType

Definition at line 48 of file itkTreeContainer.h.

template<typename TValue>
typedef TValue itk::TreeContainer< TValue >::ValueType

Definition at line 47 of file itkTreeContainer.h.

Constructor & Destructor Documentation

template<typename TValue >
itk::TreeContainer< TValue >::TreeContainer ( int  dcc)

Constructor

Constructor with default children count

Definition at line 36 of file itkTreeContainer.hxx.

References NULL.

template<typename TValue>
itk::TreeContainer< TValue >::TreeContainer ( TreeContainer< TValue > &  tree)

Constructor

Constructor by adding a tree

Definition at line 45 of file itkTreeContainer.hxx.

References NULL.

template<typename TValue>
itk::TreeContainer< TValue >::TreeContainer ( )
protected

Constructor

Definition at line 27 of file itkTreeContainer.hxx.

template<typename TValue >
itk::TreeContainer< TValue >::~TreeContainer ( )
protectedvirtual

Destructor

Definition at line 54 of file itkTreeContainer.hxx.

Member Function Documentation

template<typename TValue>
bool itk::TreeContainer< TValue >::Add ( const TValue  child,
const TValue  parent 
)
template<typename TValue >
bool itk::TreeContainer< TValue >::Clear ( void  )
virtual

Clear the tree

Implements itk::TreeContainerBase< TValue >.

Definition at line 230 of file itkTreeContainer.hxx.

References itk::TreeIteratorBase< TTreeType >::Remove().

template<typename TValue>
bool itk::TreeContainer< TValue >::Contains ( const TValue  element)
virtual

Return true if the element is in the tree

Return true if the tree contains this element

Implements itk::TreeContainerBase< TValue >.

Definition at line 141 of file itkTreeContainer.hxx.

References itk::TreeIteratorBase< TTreeType >::Get(), itk::TreeIteratorBase< TTreeType >::GoToBegin(), and itk::TreeIteratorBase< TTreeType >::IsAtEnd().

template<typename TValue >
int itk::TreeContainer< TValue >::Count ( ) const
virtual

Return the number of elements in the tree

Count the number of nodes in the tree

Implements itk::TreeContainerBase< TValue >.

Definition at line 80 of file itkTreeContainer.hxx.

References itk::TreeIteratorBase< TTreeType >::GoToBegin(), and itk::TreeIteratorBase< TTreeType >::IsAtEnd().

template<typename TValue>
virtual::itk::LightObject::Pointer itk::TreeContainer< TValue >::CreateAnother ( void  ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

template<typename TValue>
virtual const char* itk::TreeContainer< TValue >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::TreeContainerBase< TValue >.

Reimplemented in itk::SpatialObjectTreeContainer< TDimension >.

template<typename TValue>
const TreeNode< TValue > * itk::TreeContainer< TValue >::GetNode ( TValue  val) const
template<typename TValue>
const TreeNodeType* itk::TreeContainer< TValue >::GetRoot ( ) const
inlinevirtual

Get the root

Implements itk::TreeContainerBase< TValue >.

Definition at line 97 of file itkTreeContainer.h.

Referenced by itk::TreeContainer< TValue >::operator==().

template<typename TValue>
bool itk::TreeContainer< TValue >::IsLeaf ( const TValue  element)
virtual

Return true if the element is a leaf

Return true if the given element is a leaf of the tree

Implements itk::TreeContainerBase< TValue >.

Definition at line 182 of file itkTreeContainer.hxx.

References itk::TreeIteratorBase< TTreeType >::Get(), itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::IsAtEnd(), and itk::TreeIteratorBase< TTreeType >::IsLeaf().

template<typename TValue>
bool itk::TreeContainer< TValue >::IsRoot ( const TValue  element)
virtual

Return true if the element is a root

Return true of the node containing the element is the root

Implements itk::TreeContainerBase< TValue >.

Definition at line 206 of file itkTreeContainer.hxx.

References itk::TreeIteratorBase< TTreeType >::Get(), itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::HasParent(), and itk::TreeIteratorBase< TTreeType >::IsAtEnd().

template<typename TValue>
static Pointer itk::TreeContainer< TValue >::New ( )
static

Method for creation through the object factory.

template<typename TValue>
bool itk::TreeContainer< TValue >::operator== ( TreeContainer< TValue > &  tree)
template<typename TValue >
void itk::TreeContainer< TValue >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual
template<typename TValue>
bool itk::TreeContainer< TValue >::SetRoot ( const TValue  element)
virtual

Set the root as an element

Set the root of the tree

Implements itk::TreeContainerBase< TValue >.

Definition at line 60 of file itkTreeContainer.hxx.

Referenced by itk::SpatialObjectTreeContainer< TDimension >::SetRoot().

template<typename TValue>
bool itk::TreeContainer< TValue >::SetRoot ( IteratorType pos)

The the root as an iterator position

Set the root of the tree from the iterator position

Definition at line 259 of file itkTreeContainer.hxx.

References itk::TreeNode< TValue >::AddChild(), itk::TreeIteratorBase< TTreeType >::GetNode(), itk::TreeNode< TValue >::GetParent(), NULL, itk::TreeNode< TValue >::Remove(), and itk::TreeNode< TValue >::SetParent().

template<typename TValue>
bool itk::TreeContainer< TValue >::SetRoot ( TreeNode< TValue > *  node)
virtual

Set the root as a tree node

Set the root of the tree

Implements itk::TreeContainerBase< TValue >.

Definition at line 71 of file itkTreeContainer.hxx.

template<typename TValue >
bool itk::TreeContainer< TValue >::Swap ( IteratorType v,
IteratorType w 
)

Member Data Documentation

template<typename TValue>
int itk::TreeContainer< TValue >::m_DefaultChildrenCount
protected

Definition at line 112 of file itkTreeContainer.h.

template<typename TValue>
TreeNodeType::Pointer itk::TreeContainer< TValue >::m_Root
protected

The documentation for this class was generated from the following files:

Generated at Sat Oct 11 2014 17:02:23 for Orfeo Toolbox with doxygen 1.8.3.1