Medical Imaging Interaction Toolkit  2018.4.99-18ddd2ed
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)
 
 ~DataStorageSelection () override
 
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 29 of file mitkDataStorageSelection.h.

Member Typedef Documentation

◆ DataNodeEvent

◆ Nodes

Definition at line 32 of file mitkDataStorageSelection.h.

Constructor & Destructor Documentation

◆ DataStorageSelection() [1/2]

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

Definition at line 20 of file mitkDataStorageSelection.cpp.

References SetDataStorage().

◆ DataStorageSelection() [2/2]

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

Definition at line 26 of file mitkDataStorageSelection.cpp.

References SetDataStorage().

◆ ~DataStorageSelection()

mitk::DataStorageSelection::~DataStorageSelection ( )
override

Definition at line 34 of file mitkDataStorageSelection.cpp.

References SetDataStorage().

Member Function Documentation

◆ AddListener()

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 302 of file mitkDataStorageSelection.cpp.

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

Referenced by AddNode().

◆ AddNode()

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

Add a node (if not already there)

Definition at line 120 of file mitkDataStorageSelection.cpp.

References AddListener(), m_Nodes, m_Predicate, m_SelfCall, and NodeAdded.

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

◆ DoesAutoAddNodes()

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

Definition at line 50 of file mitkDataStorageSelection.cpp.

References m_AutoAddNodes.

◆ FindNode() [1/2]

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 219 of file mitkDataStorageSelection.cpp.

References m_Nodes.

Referenced by ObjectChanged().

◆ FindNode() [2/2]

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 237 of file mitkDataStorageSelection.cpp.

References m_Nodes.

◆ GetDataStorage()

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

Get the DataStorage.

Definition at line 40 of file mitkDataStorageSelection.cpp.

References m_DataStorage.

◆ GetNode() [1/2]

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

Get node at a specific model index.

Definition at line 44 of file mitkDataStorageSelection.cpp.

References m_Nodes.

◆ GetNode() [2/2]

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

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

Definition at line 43 of file mitkDataStorageSelection.cpp.

◆ GetNodes()

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

Returns a copy of the node-vector

Definition at line 49 of file mitkDataStorageSelection.cpp.

References m_Nodes.

◆ GetPredicate()

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

Get the predicate.

Definition at line 41 of file mitkDataStorageSelection.cpp.

References m_Predicate.

◆ GetSize()

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

Returns the size of this selection

Definition at line 42 of file mitkDataStorageSelection.cpp.

References m_Nodes.

◆ mitkClassMacroItkParent()

mitk::DataStorageSelection::mitkClassMacroItkParent ( DataStorageSelection  ,
itk::Object   
)

◆ mitkNewMacro2Param()

mitk::DataStorageSelection::mitkNewMacro2Param ( DataStorageSelection  ,
DataStorage ,
bool   
)

◆ mitkNewMacro3Param()

mitk::DataStorageSelection::mitkNewMacro3Param ( DataStorageSelection  ,
DataStorage ,
NodePredicateBase ,
bool   
)

◆ ObjectChanged()

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 178 of file mitkDataStorageSelection.cpp.

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

Referenced by AddListener(), and SetDataStorage().

◆ operator=() [1/2]

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

Removes all nodes, sets node as new first element

Definition at line 51 of file mitkDataStorageSelection.cpp.

References AddNode(), and RemoveAllNodes().

◆ operator=() [2/2]

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

Removes all nodes, sets node as new first element

Definition at line 58 of file mitkDataStorageSelection.cpp.

◆ RemoveAllNodes()

void mitk::DataStorageSelection::RemoveAllNodes ( )
virtual

Removes a node

Definition at line 165 of file mitkDataStorageSelection.cpp.

References m_Nodes, and RemoveNode().

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

◆ RemoveListener()

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

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

Definition at line 277 of file mitkDataStorageSelection.cpp.

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

Referenced by RemoveNode().

◆ RemoveNode()

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

Removes a node

Definition at line 144 of file mitkDataStorageSelection.cpp.

References m_Nodes, m_SelfCall, NodeRemoved, and RemoveListener().

Referenced by RemoveAllNodes(), and SetDataStorage().

◆ Reset()

void mitk::DataStorageSelection::Reset ( )
protected

Removes all nodes and fill the vector again

Definition at line 251 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().

◆ SetDataStorage()

◆ SetPredicate()

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

Sets the predicate. QmitkDataStorageTableModel is owner of the predicate!

Definition at line 110 of file mitkDataStorageSelection.cpp.

References m_Predicate, and Reset().

Member Data Documentation

◆ m_AutoAddNodes

bool mitk::DataStorageSelection::m_AutoAddNodes
protected

Saves if new nodes are automatically added to this selection

Definition at line 184 of file mitkDataStorageSelection.h.

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

◆ m_DataStorage

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

Pointer to the DataStorage from which the nodes are selected

Definition at line 143 of file mitkDataStorageSelection.h.

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

◆ m_DataStorageDeletedTag

unsigned int mitk::DataStorageSelection::m_DataStorageDeletedTag
protected

DeleteTag for the DataStorage

Definition at line 147 of file mitkDataStorageSelection.h.

Referenced by SetDataStorage().

◆ m_NodeModifiedObserverTags

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

Maps a node to a modified observer tag.

Definition at line 160 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

◆ m_Nodes

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

Holds all selected Nodes.

Definition at line 156 of file mitkDataStorageSelection.h.

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

◆ m_Predicate

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

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

Definition at line 152 of file mitkDataStorageSelection.h.

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

◆ m_PropertyDeletedObserverTags

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

Maps a property to a delete observer tag.

Definition at line 176 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

◆ m_PropertyListDeletedObserverTags

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

Maps a propertylist to a delete observer tag.

Definition at line 168 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

◆ m_PropertyListModifiedObserverTags

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

Maps a propertylist to a modified observer tag.

Definition at line 164 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

◆ m_PropertyModifiedObserverTags

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

Maps a property to a modified observer tag.

Definition at line 172 of file mitkDataStorageSelection.h.

Referenced by AddListener(), and RemoveListener().

◆ m_SelfCall

bool mitk::DataStorageSelection::m_SelfCall
protected

If set to true no event processing will be performed

Definition at line 180 of file mitkDataStorageSelection.h.

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

◆ NodeAdded

DataNodeEvent mitk::DataStorageSelection::NodeAdded

Definition at line 36 of file mitkDataStorageSelection.h.

Referenced by AddNode().

◆ NodeChanged

DataNodeEvent mitk::DataStorageSelection::NodeChanged

Definition at line 35 of file mitkDataStorageSelection.h.

Referenced by ObjectChanged().

◆ NodeRemoved

DataNodeEvent mitk::DataStorageSelection::NodeRemoved

Definition at line 37 of file mitkDataStorageSelection.h.

Referenced by RemoveNode().

◆ PropertyChanged

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

Definition at line 38 of file mitkDataStorageSelection.h.

Referenced by ObjectChanged().


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