Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::DataStorageSelection Class Reference

#include <mitkDataStorageSelection.h>

Inheritance diagram for mitk::DataStorageSelection:
Collaboration diagram for mitk::DataStorageSelection:

Public Types

typedef std::vector< mitk::DataNode * > Nodes
 
typedef Message1< const mitk::DataNode * > DataNodeEvent
 

Public Member Functions

 mitkClassMacroItkParent (DataStorageSelection, itk::Object)
 
 mitkNewMacro2Param (DataStorageSelection, DataStorage *, bool)
 
 mitkNewMacro3Param (DataStorageSelection, DataStorage *, NodePredicateBase *, bool)
 
virtual ~DataStorageSelection ()
 
mitk::DataStorage::Pointer GetDataStorage () const
 
mitk::NodePredicateBase::Pointer GetPredicate () const
 
unsigned int GetSize () const
 
mitk::DataNode::Pointer GetNode (unsigned int index) const
 
mitk::DataNode::Pointer GetNode () const
 
std::vector< mitk::DataNode * > GetNodes () const
 
bool DoesAutoAddNodes () const
 
DataStorageSelectionoperator= (mitk::DataNode *node)
 
DataStorageSelectionoperator= (mitk::DataNode::Pointer node)
 
virtual void SetDataStorage (mitk::DataStorage *_DataStorage)
 
virtual void SetPredicate (mitk::NodePredicateBase *_Predicate)
 
virtual void AddNode (const mitk::DataNode *node)
 
virtual void RemoveNode (const mitk::DataNode *node)
 
virtual void RemoveAllNodes ()
 
virtual void ObjectChanged (const itk::Object *caller, const itk::EventObject &event)
 

Public Attributes

DataNodeEvent NodeChanged
 
DataNodeEvent NodeAdded
 
DataNodeEvent NodeRemoved
 
Message2< const mitk::DataNode *, const mitk::BaseProperty * > PropertyChanged
 

Protected Member Functions

 DataStorageSelection (mitk::DataStorage *_DataStorage, bool _AutoAddNodes)
 
 DataStorageSelection (mitk::DataStorage *_DataStorage, mitk::NodePredicateBase *_Predicate, bool _AutoAddNodes)
 
mitk::DataNode::Pointer FindNode (const mitk::BaseProperty *prop) const
 
mitk::DataNode::Pointer FindNode (const mitk::PropertyList *propList) const
 
void Reset ()
 
void RemoveListener (mitk::DataNode *node)
 
void AddListener (mitk::DataNode *node)
 

Protected Attributes

mitk::DataStoragem_DataStorage
 
unsigned int m_DataStorageDeletedTag
 
mitk::NodePredicateBase::Pointer m_Predicate
 
std::vector< mitk::DataNode * > m_Nodes
 
std::map< mitk::DataNode *, unsigned long > m_NodeModifiedObserverTags
 Maps a node to a modified observer tag. More...
 
std::map< mitk::PropertyList *, unsigned long > m_PropertyListModifiedObserverTags
 Maps a propertylist to a modified observer tag. More...
 
std::map< mitk::PropertyList *, unsigned long > m_PropertyListDeletedObserverTags
 Maps a propertylist to a delete observer tag. More...
 
std::map< mitk::BaseProperty *, unsigned long > m_PropertyModifiedObserverTags
 Maps a property to a modified observer tag. More...
 
std::map< mitk::BaseProperty *, unsigned long > m_PropertyDeletedObserverTags
 Maps a property to a delete observer tag. More...
 
bool m_SelfCall
 
bool m_AutoAddNodes
 

Detailed Description

Definition at line 33 of file mitkDataStorageSelection.h.

Member Typedef Documentation

Definition at line 36 of file mitkDataStorageSelection.h.

Constructor & Destructor Documentation

mitk::DataStorageSelection::DataStorageSelection ( mitk::DataStorage _DataStorage,
bool  _AutoAddNodes 
)
protected

Definition at line 24 of file mitkDataStorageSelection.cpp.

References SetDataStorage().

mitk::DataStorageSelection::DataStorageSelection ( mitk::DataStorage _DataStorage,
mitk::NodePredicateBase _Predicate,
bool  _AutoAddNodes 
)
protected

Definition at line 30 of file mitkDataStorageSelection.cpp.

References SetDataStorage().

mitk::DataStorageSelection::~DataStorageSelection ( )
virtual

Definition at line 38 of file mitkDataStorageSelection.cpp.

References SetDataStorage().

Member Function Documentation

void mitk::DataStorageSelection::AddListener ( mitk::DataNode node)
protected

Adds listeners for modified/delete event, for the propertylists modified/delete and for the modified/delete event of each property and stores listener tags

Definition at line 306 of file mitkDataStorageSelection.cpp.

References mitk::PropertyList::GetMap(), mitk::DataNode::GetPropertyList(), m_NodeModifiedObserverTags, m_PropertyDeletedObserverTags, m_PropertyListDeletedObserverTags, m_PropertyListModifiedObserverTags, m_PropertyModifiedObserverTags, mitk::New(), and ObjectChanged().

Referenced by AddNode().

void mitk::DataStorageSelection::AddNode ( const mitk::DataNode node)
virtual

Add a node (if not already there)

Definition at line 124 of file mitkDataStorageSelection.cpp.

References AddListener(), m_Nodes, m_Predicate, m_SelfCall, NodeAdded, and mitk::Message1< T, A >::Send().

Referenced by operator=(), Reset(), and SetDataStorage().

bool mitk::DataStorageSelection::DoesAutoAddNodes ( ) const
See also
m_AutoAddNodes

Definition at line 54 of file mitkDataStorageSelection.cpp.

References m_AutoAddNodes.

mitk::DataNode::Pointer mitk::DataStorageSelection::FindNode ( const mitk::BaseProperty prop) const
protected

Find a node in the list by the given prop

Definition at line 223 of file mitkDataStorageSelection.cpp.

References m_Nodes.

Referenced by ObjectChanged().

mitk::DataNode::Pointer mitk::DataStorageSelection::FindNode ( const mitk::PropertyList propList) const
protected

Find a node in the list by the given proplist

Definition at line 241 of file mitkDataStorageSelection.cpp.

References m_Nodes.

mitk::DataStorage::Pointer mitk::DataStorageSelection::GetDataStorage ( ) const

Get the DataStorage.

Definition at line 44 of file mitkDataStorageSelection.cpp.

References m_DataStorage.

mitk::DataNode::Pointer mitk::DataStorageSelection::GetNode ( unsigned int  index) const

Get node at a specific model index.

Definition at line 48 of file mitkDataStorageSelection.cpp.

References m_Nodes.

mitk::DataNode::Pointer mitk::DataStorageSelection::GetNode ( ) const

Returns the first node, same as calling GetNode(0)

Definition at line 47 of file mitkDataStorageSelection.cpp.

std::vector< mitk::DataNode * > mitk::DataStorageSelection::GetNodes ( ) const

Returns a copy of the node-vector

Definition at line 53 of file mitkDataStorageSelection.cpp.

References m_Nodes.

mitk::NodePredicateBase::Pointer mitk::DataStorageSelection::GetPredicate ( ) const

Get the predicate.

Definition at line 45 of file mitkDataStorageSelection.cpp.

References m_Predicate.

unsigned int mitk::DataStorageSelection::GetSize ( ) const

Returns the size of this selection

Definition at line 46 of file mitkDataStorageSelection.cpp.

References m_Nodes.

mitk::DataStorageSelection::mitkClassMacroItkParent ( DataStorageSelection  ,
itk::Object   
)
mitk::DataStorageSelection::mitkNewMacro2Param ( DataStorageSelection  ,
DataStorage ,
bool   
)
mitk::DataStorageSelection::mitkNewMacro3Param ( DataStorageSelection  ,
DataStorage ,
NodePredicateBase ,
bool   
)
void mitk::DataStorageSelection::ObjectChanged ( const itk::Object *  caller,
const itk::EventObject &  event 
)
virtual

Called whenever an itk Object this class holds gets deleted or modified

Definition at line 182 of file mitkDataStorageSelection.cpp.

References FindNode(), m_SelfCall, NodeChanged, PropertyChanged, mitk::Message1< T, A >::Send(), and SetDataStorage().

Referenced by AddListener(), and SetDataStorage().

DataStorageSelection & mitk::DataStorageSelection::operator= ( mitk::DataNode node)

Removes all nodes, sets node as new first element

Definition at line 55 of file mitkDataStorageSelection.cpp.

References AddNode(), and RemoveAllNodes().

DataStorageSelection & mitk::DataStorageSelection::operator= ( mitk::DataNode::Pointer  node)

Removes all nodes, sets node as new first element

Definition at line 62 of file mitkDataStorageSelection.cpp.

void mitk::DataStorageSelection::RemoveAllNodes ( )
virtual

Removes a node

Definition at line 169 of file mitkDataStorageSelection.cpp.

References m_Nodes, and RemoveNode().

Referenced by operator=(), and Reset().

void mitk::DataStorageSelection::RemoveListener ( mitk::DataNode node)
protected

If a node is already in this list, all listeners will be removed

Definition at line 281 of file mitkDataStorageSelection.cpp.

References m_NodeModifiedObserverTags, m_PropertyDeletedObserverTags, m_PropertyListDeletedObserverTags, m_PropertyListModifiedObserverTags, and m_PropertyModifiedObserverTags.

Referenced by RemoveNode().

void mitk::DataStorageSelection::RemoveNode ( const mitk::DataNode node)
virtual

Removes a node

Definition at line 148 of file mitkDataStorageSelection.cpp.

References m_Nodes, m_SelfCall, NodeRemoved, RemoveListener(), and mitk::Message1< T, A >::Send().

Referenced by RemoveAllNodes(), and SetDataStorage().

void mitk::DataStorageSelection::Reset ( )
protected

Removes all nodes and fill the vector again

Definition at line 255 of file mitkDataStorageSelection.cpp.

References AddNode(), mitk::DataStorage::GetAll(), mitk::DataStorage::GetSubset(), m_AutoAddNodes, m_DataStorage, m_Predicate, and RemoveAllNodes().

Referenced by SetDataStorage(), and SetPredicate().

void mitk::DataStorageSelection::SetPredicate ( mitk::NodePredicateBase _Predicate)
virtual

Sets the predicate. QmitkDataStorageTableModel is owner of the predicate!

Definition at line 114 of file mitkDataStorageSelection.cpp.

References m_Predicate, and Reset().

Member Data Documentation

bool mitk::DataStorageSelection::m_AutoAddNodes
protected

Saves if new nodes are automatically added to this selection

Definition at line 188 of file mitkDataStorageSelection.h.

Referenced by DoesAutoAddNodes(), Reset(), and SetDataStorage().

mitk::DataStorage* mitk::DataStorageSelection::m_DataStorage
protected

Pointer to the DataStorage from which the nodes are selected

Definition at line 147 of file mitkDataStorageSelection.h.

Referenced by GetDataStorage(), Reset(), and SetDataStorage().

unsigned int mitk::DataStorageSelection::m_DataStorageDeletedTag
protected

DeleteTag for the DataStorage

Definition at line 151 of file mitkDataStorageSelection.h.

Referenced by SetDataStorage().

std::map<mitk::DataNode *, unsigned long> mitk::DataStorageSelection::m_NodeModifiedObserverTags
protected

Maps a node to a modified observer tag.

Definition at line 164 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

std::vector<mitk::DataNode *> mitk::DataStorageSelection::m_Nodes
protected

Holds all selected Nodes.

Definition at line 160 of file mitkDataStorageSelection.h.

Referenced by AddNode(), FindNode(), GetNode(), GetNodes(), GetSize(), RemoveAllNodes(), and RemoveNode().

mitk::NodePredicateBase::Pointer mitk::DataStorageSelection::m_Predicate
protected

Holds the predicate that defines this SubSet of Nodes. If m_Predicate is NULL all Nodes will be selected.

Definition at line 156 of file mitkDataStorageSelection.h.

Referenced by AddNode(), GetPredicate(), Reset(), and SetPredicate().

std::map<mitk::BaseProperty *, unsigned long> mitk::DataStorageSelection::m_PropertyDeletedObserverTags
protected

Maps a property to a delete observer tag.

Definition at line 180 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

std::map<mitk::PropertyList *, unsigned long> mitk::DataStorageSelection::m_PropertyListDeletedObserverTags
protected

Maps a propertylist to a delete observer tag.

Definition at line 172 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

std::map<mitk::PropertyList *, unsigned long> mitk::DataStorageSelection::m_PropertyListModifiedObserverTags
protected

Maps a propertylist to a modified observer tag.

Definition at line 168 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

std::map<mitk::BaseProperty *, unsigned long> mitk::DataStorageSelection::m_PropertyModifiedObserverTags
protected

Maps a property to a modified observer tag.

Definition at line 176 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

bool mitk::DataStorageSelection::m_SelfCall
protected

If set to true no event processing will be performed

Definition at line 184 of file mitkDataStorageSelection.h.

Referenced by AddNode(), ObjectChanged(), and RemoveNode().

DataNodeEvent mitk::DataStorageSelection::NodeAdded

Definition at line 40 of file mitkDataStorageSelection.h.

Referenced by AddNode().

DataNodeEvent mitk::DataStorageSelection::NodeChanged

Definition at line 39 of file mitkDataStorageSelection.h.

Referenced by ObjectChanged().

DataNodeEvent mitk::DataStorageSelection::NodeRemoved

Definition at line 41 of file mitkDataStorageSelection.h.

Referenced by RemoveNode().

Message2<const mitk::DataNode *, const mitk::BaseProperty *> mitk::DataStorageSelection::PropertyChanged

Definition at line 42 of file mitkDataStorageSelection.h.

Referenced by ObjectChanged().


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