|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Manages a selection of DataNode objects from a DataStorage. More...
#include <mitkDataStorageSelection.h>


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 |
| Get the associated DataStorage. More... | |
| mitk::NodePredicateBase::Pointer | GetPredicate () const |
| Get the predicate used for filtering nodes. More... | |
| unsigned int | GetSize () const |
| Returns the number of nodes in this selection. More... | |
| mitk::DataNode::Pointer | GetNode (unsigned int index) const |
| Get a node at a specific index. More... | |
| mitk::DataNode::Pointer | GetNode () const |
| Returns the first node in the selection. More... | |
| std::vector< mitk::DataNode * > | GetNodes () const |
| Returns a copy of the internal node vector. More... | |
| bool | DoesAutoAddNodes () const |
| Query whether nodes are automatically added from the DataStorage. More... | |
| DataStorageSelection & | operator= (mitk::DataNode *node) |
| Remove all nodes and set a raw pointer as the sole element. More... | |
| DataStorageSelection & | operator= (mitk::DataNode::Pointer node) |
| Remove all nodes and set a smart pointer as the sole element. More... | |
| virtual void | SetDataStorage (mitk::DataStorage *_DataStorage) |
| Set or change the associated DataStorage. More... | |
| virtual void | SetPredicate (mitk::NodePredicateBase *_Predicate) |
| Set or change the filter predicate. More... | |
| virtual void | AddNode (const mitk::DataNode *node) |
| Add a node to the selection if it is not already present. More... | |
| virtual void | RemoveNode (const mitk::DataNode *node) |
| Remove a node from the selection. More... | |
| virtual void | RemoveAllNodes () |
| Remove all nodes from the selection. More... | |
| virtual void | ObjectChanged (const itk::Object *caller, const itk::EventObject &event) |
| Callback invoked when an observed ITK object is deleted or modified. More... | |
Public Attributes | |
| DataNodeEvent | NodeChanged |
| Event fired when a node in the selection is modified. More... | |
| DataNodeEvent | NodeAdded |
| Event fired when a node is added to the selection. More... | |
| DataNodeEvent | NodeRemoved |
| Event fired when a node is removed from the selection. More... | |
| Message2< const mitk::DataNode *, const mitk::BaseProperty * > | PropertyChanged |
| Event fired when a property on a selected node changes. More... | |
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::DataStorage * | m_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 |
Manages a selection of DataNode objects from a DataStorage.
Observes a DataStorage for node additions and removals, optionally filtering by a NodePredicateBase. Fires events (NodeChanged, NodeAdded, NodeRemoved, PropertyChanged) when the selection or its properties change.
Nodes can be automatically added when they appear in the DataStorage (if AutoAddNodes is enabled), or manually added/removed.
Definition at line 42 of file mitkDataStorageSelection.h.
| typedef Message1<const mitk::DataNode *> mitk::DataStorageSelection::DataNodeEvent |
Definition at line 46 of file mitkDataStorageSelection.h.
| typedef std::vector<mitk::DataNode *> mitk::DataStorageSelection::Nodes |
Definition at line 45 of file mitkDataStorageSelection.h.
|
protected |
|
protected |
|
override |
|
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
|
virtual |
Add a node to the selection if it is not already present.
| [in] | node | The node to add. |
| bool mitk::DataStorageSelection::DoesAutoAddNodes | ( | ) | const |
Query whether nodes are automatically added from the DataStorage.
|
protected |
Find a node in the list by the given prop
|
protected |
Find a node in the list by the given proplist
| mitk::DataStorage::Pointer mitk::DataStorageSelection::GetDataStorage | ( | ) | const |
Get the associated DataStorage.
| mitk::DataNode::Pointer mitk::DataStorageSelection::GetNode | ( | ) | const |
Returns the first node in the selection.
Equivalent to calling GetNode(0).
| mitk::DataNode::Pointer mitk::DataStorageSelection::GetNode | ( | unsigned int | index | ) | const |
Get a node at a specific index.
| [in] | index | The zero-based index. |
| std::vector<mitk::DataNode *> mitk::DataStorageSelection::GetNodes | ( | ) | const |
Returns a copy of the internal node vector.
| mitk::NodePredicateBase::Pointer mitk::DataStorageSelection::GetPredicate | ( | ) | const |
Get the predicate used for filtering nodes.
| unsigned int mitk::DataStorageSelection::GetSize | ( | ) | const |
Returns the number of nodes in this selection.
| mitk::DataStorageSelection::mitkClassMacroItkParent | ( | DataStorageSelection | , |
| itk::Object | |||
| ) |
| mitk::DataStorageSelection::mitkNewMacro2Param | ( | DataStorageSelection | , |
| DataStorage * | , | ||
| bool | |||
| ) |
| mitk::DataStorageSelection::mitkNewMacro3Param | ( | DataStorageSelection | , |
| DataStorage * | , | ||
| NodePredicateBase * | , | ||
| bool | |||
| ) |
|
virtual |
Callback invoked when an observed ITK object is deleted or modified.
| [in] | caller | The object that triggered the event. |
| [in] | event | The event descriptor. |
| DataStorageSelection& mitk::DataStorageSelection::operator= | ( | mitk::DataNode * | node | ) |
Remove all nodes and set a raw pointer as the sole element.
| [in] | node | The node to set. |
| DataStorageSelection& mitk::DataStorageSelection::operator= | ( | mitk::DataNode::Pointer | node | ) |
Remove all nodes and set a smart pointer as the sole element.
| [in] | node | The node to set. |
|
virtual |
Remove all nodes from the selection.
|
protected |
If a node is already in this list, all listeners will be removed
|
virtual |
Remove a node from the selection.
| [in] | node | The node to remove. |
|
protected |
Removes all nodes and fill the vector again
|
virtual |
Set or change the associated DataStorage.
| [in] | _DataStorage | Pointer to the new DataStorage, or nullptr to detach. |
|
virtual |
Set or change the filter predicate.
Ownership of the predicate is taken by this class.
| [in] | _Predicate | The new predicate, or nullptr to accept all nodes. |
|
protected |
Saves if new nodes are automatically added to this selection
Definition at line 238 of file mitkDataStorageSelection.h.
|
protected |
Pointer to the DataStorage from which the nodes are selected
Definition at line 197 of file mitkDataStorageSelection.h.
|
protected |
DeleteTag for the DataStorage
Definition at line 201 of file mitkDataStorageSelection.h.
|
protected |
Maps a node to a modified observer tag.
Definition at line 214 of file mitkDataStorageSelection.h.
|
protected |
Holds all selected Nodes.
Definition at line 210 of file mitkDataStorageSelection.h.
|
protected |
Holds the predicate that defines this SubSet of Nodes. If m_Predicate is nullptr all Nodes will be selected.
Definition at line 206 of file mitkDataStorageSelection.h.
|
protected |
Maps a property to a delete observer tag.
Definition at line 230 of file mitkDataStorageSelection.h.
|
protected |
Maps a propertylist to a delete observer tag.
Definition at line 222 of file mitkDataStorageSelection.h.
|
protected |
Maps a propertylist to a modified observer tag.
Definition at line 218 of file mitkDataStorageSelection.h.
|
protected |
Maps a property to a modified observer tag.
Definition at line 226 of file mitkDataStorageSelection.h.
|
protected |
If set to true no event processing will be performed
Definition at line 234 of file mitkDataStorageSelection.h.
| DataNodeEvent mitk::DataStorageSelection::NodeAdded |
Event fired when a node is added to the selection.
Definition at line 51 of file mitkDataStorageSelection.h.
| DataNodeEvent mitk::DataStorageSelection::NodeChanged |
Event fired when a node in the selection is modified.
Definition at line 49 of file mitkDataStorageSelection.h.
| DataNodeEvent mitk::DataStorageSelection::NodeRemoved |
Event fired when a node is removed from the selection.
Definition at line 53 of file mitkDataStorageSelection.h.
| Message2<const mitk::DataNode *, const mitk::BaseProperty *> mitk::DataStorageSelection::PropertyChanged |
Event fired when a property on a selected node changes.
Definition at line 55 of file mitkDataStorageSelection.h.