20 #ifndef QmitkDataStorageComboBox_h
21 #define QmitkDataStorageComboBox_h
59 QWidget *parent =
nullptr,
60 bool autoSelectNewNodes =
false);
84 virtual mitk::DataNode::Pointer
GetNode(
int index)
const;
92 mitk::DataStorage::SetOfObjects::ConstPointer
GetNodes()
const;
Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
bool HasIndex(unsigned int index) const
Checks if the given index is within the range of the m_Nodes vector.
void Init()
Init-function this class with the given data storage and predicate. This function is called by all ct...
virtual void RemoveNode(const mitk::DataNode *dataNode)
bool m_AutoSelectNewNodes
If set to "true" new Nodes will be automatically selected.
mitk::DataStorage::SetOfObjects::ConstPointer GetNodes() const
Returns all nodes that are stored in this combobox.
virtual void SetNode(int index, const mitk::DataNode *dataNode)
virtual int Find(const mitk::DataNode *dataNode) const
Searches for a given node and returns a valid index or -1 if the node was not found.
virtual void SetNode(const mitk::DataNode *dataNode, const mitk::DataNode *otherDataNode)
virtual mitk::DataNode::Pointer GetNode(int index) const
Returns the dataNode at Index index or 0 if the index is out of bounds.
virtual bool GetAutoSelectNewItems()
const mitk::NodePredicateBase::ConstPointer GetPredicate() const
Return the predicate (may be nullptr) that is responsible for the dataNode selection of this ComboBox...
mitk::NodePredicateBase::ConstPointer m_Predicate
Holds the predicate that is responsible for the dataNode selection of this ComboBox....
mitk::DataStorage::Pointer GetDataStorage() const
Get the DataStorage this ComboBox listens to.
void SetSelectedNode(const mitk::DataNode::Pointer &node)
Slot for signal when user wants to set a node as current selected node.
~QmitkDataStorageComboBox() override
Standard Dtor. Nothing to do here.
std::vector< long > m_DataNodePropertyListObserverTags
Holds the tags of the data node property observers.
void SetDataStorage(mitk::DataStorage *dataStorage)
Set the DataStorage this ComboBox should listen to.
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
void OnCurrentIndexChanged(int)
Slot for signal when the user selects another item.
virtual void RemoveNode(int index)
virtual void Reset()
Reset function whenever data storage or predicate changes.
void SetPredicate(const mitk::NodePredicateBase *predicate)
Set the predicate for this ComboBox. (QmitkDataStorageComboBox is now owner of the predicate)
std::vector< mitk::DataNode * > m_Nodes
QmitkDataStorageComboBox(QWidget *parent=nullptr, bool autoSelectNewNodes=false)
Ctor for an empty combobox. Use setDataStorage and setPredicate afterwards.
virtual mitk::DataNode::Pointer GetSelectedNode() const
Returns the selected dataNode or 0 if there is none.
void OnSelectionChanged(const mitk::DataNode *)
Throw a signal when the data node selection changed.
virtual void UpdateComboBoxText(const mitk::PropertyList *)
Update the combo box display text when a node's property list changes.
bool m_BlockEvents
Event function guard. Each function which is called by an event mechanism first checks if this is tru...
virtual void InsertNode(int index, const mitk::DataNode *dataNode)
Inserts a new node at the given index. If the index does not exist, the data node is simply appended ...
QmitkDataStorageComboBox(mitk::DataStorage *dataStorage, const mitk::NodePredicateBase *predicate, QWidget *parent=nullptr, bool autoSelectNewNodes=false)
Ctor for constructing QmitkDataStorageComboBox with given DataStorageComboBox and given predicate.
virtual void AddNode(const mitk::DataNode *dataNode)
virtual void OnPropertyListChanged(const itk::Object *caller, const itk::EventObject &event)
Called when the name property of the node was modified.
virtual void SetAutoSelectNewItems(bool autoSelectNewItems)
void RemoveNodeAndPropertyLists(int index)
Remove the node at the given index and unregister its property list observers.
std::vector< long > m_BaseDatapropertyListObserverTags
Holds the tags of the base data property observers.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Abstract base class for predicates used to filter DataNode objects in DataStorage queries.
Key-value list holding instances of BaseProperty.