24 bool autoSelectNewNodes )
35 QWidget* parent,
bool autoSelectNewNodes )
78 return this->
GetNode(this->currentIndex());
85 int currentIndex = -1;
86 for (
int i = 0; i < static_cast<int>(
m_Nodes.size()); i++)
88 if (
m_Nodes[i] == node.GetPointer())
94 if (currentIndex == -1)
103 this->setCurrentIndex(currentIndex);
109 if(index > 0 && this->
HasIndex(index))
135 this->removeItem(index);
146 if(index > 0 && this->
HasIndex(index))
149 if( dataNode == this->
m_Nodes.at(index-1 ) )
154 this->setItemText(index, QString::fromStdString( dataNodeNameStr) );
190 this->setItemText(0, zeroEntryString);
197 return m_CurrentPath;
204 m_CurrentPath = path;
virtual void SetSelectedNode(const mitk::DataNode::Pointer &node)
Sets the combo box to the index that contains the specified node, or 0 if the node cannot be found...
virtual void SetNode(int index, const mitk::DataNode *dataNode) override
Set a DataNode in the ComboBox at the specified index (if the index exists). Internally the method ju...
std::map< mitk::DataNode *, const mitk::BaseProperty * > m_PropertyToNode
Maps a a specific node to (Name-)property. This is needed because we have to find the assiociated nod...
Data management class that handles 'was created by' relations.
virtual mitk::DataNode::Pointer GetSelectedNode() const override
Returns the selected DataNode or NULL if there is none, or the current index is zero.
std::vector< long > m_NodesModifiedObserverTags
Holds the tags of the node-modified observers. (must be updated everytime m_Nodes changes) ...
Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
std::vector< mitk::DataNode * > m_Nodes
bool HasIndex(unsigned int index) const
Checks if the given index is within range.
~QmitkDataStorageComboBoxWithSelectNone()
Nothing to do.
virtual void InsertNode(int index, const mitk::DataNode *_DataNode)
Inserts a new node at the given index. If the index does not exist, the _DataNode is simply appended ...
static const QString ZERO_ENTRY_STRING
Stores the string that will be present on index 0, currently equal to "please select".
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
virtual int Find(const mitk::DataNode *_DataNode) const
Seaches for a given node and returns a valid index or -1 if the node was not found.
virtual QString currentValue() const
Get the current file path.
virtual void RemoveNode(int index) override
Removes a node from the ComboBox at a specified index (if the index exists). Gets called when a DataS...
Abstract base class for properties.
virtual std::string GetValueAsString() const
virtual mitk::DataNode::Pointer GetNode(int index) const override
Retrieves the node at a given index, where if index is zero, will always return NULL.
virtual void setCurrentValue(const QString &path)
Set the current file path.
virtual void Reset() override
Reset function whenever datastorage or predicate changes.
std::vector< long > m_NodesDeleteObserverTags
Holds the tags of the node-modified observers. (must be updated everytime m_Nodes changes) ...
virtual void InsertNode(int index, const mitk::DataNode *dataNode) override
Inserts a new node at the given index, unless index is 0, which is silently ignored.
virtual void Reset()
Reset function whenever datastorage or predicate changes.
void SetZeroEntryText(const QString &zeroEntryString)
Set the string that will be present on index 0.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
QmitkDataStorageComboBoxWithSelectNone(QWidget *parent=nullptr, bool autoSelectNewNodes=false)
Calls base class constructor.
Class for nodes of the DataTree.
virtual int Find(const mitk::DataNode *dataNode) const override
Searches for a given node, returning the index if found.