NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Public Slots | |
void | SetSelectedNode (mitk::DataNode::Pointer item) |
Slot for signal when user wants to set a node as current selected node. More... | |
Signals | |
void | OnSelectionChanged (const mitk::DataNode *) |
Throw a signal when the _DataNode selection changed. More... | |
Public Member Functions | |
DataStorageCheckableComboBox (QWidget *parent=0, bool _AutoSelectNewNodes=false) | |
Ctor for an empty combobox. Use setDataStorage and setPredicate afterwards. More... | |
DataStorageCheckableComboBox (mitk::DataStorage *_DataStorage, const mitk::NodePredicateBase *_Predicate, QWidget *parent=0, bool _AutoSelectNewNodes=false) | |
Ctor for constructing QmitkDataStorageComboBox with given DataStorageComboBox and given _Predicate. More... | |
~DataStorageCheckableComboBox () | |
Standard Dtor. Nothing to do here. More... | |
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. More... | |
mitk::DataStorage::Pointer | GetDataStorage () const |
Get the DataStorage this ComboBox listens to. More... | |
const mitk::NodePredicateBase::ConstPointer | GetPredicate () const |
Return the predicate (may be NULL) that is responsible for the _DataNode selection of this ComboBox. More... | |
virtual mitk::DataNode::Pointer | GetNode (int index) const |
Returns the _DataNode at Index index or 0 if the index is out of bounds. More... | |
virtual std::vector < mitk::DataNode * > | GetSelectedNodes () const |
Returns all selected nodes, or empty list if there are none. More... | |
mitk::DataStorage::SetOfObjects::ConstPointer | GetNodes () const |
Returns all nodes that are stored in this combobox. More... | |
virtual bool | GetAutoSelectNewItems () |
void | SetDataStorage (mitk::DataStorage *dataStorage) |
Set the DataStorage this ComboBox should listen to. More... | |
void | SetPredicate (const mitk::NodePredicateBase *_Predicate) |
Set the predicate for this ComboBox. (QmitkDataStorageComboBox is now owner of the predicate) More... | |
virtual void | AddNode (const mitk::DataNode *_DataNode) |
virtual void | RemoveNode (int index) |
virtual void | RemoveNode (const mitk::DataNode *_DataNode) |
virtual void | SetNode (int index, const mitk::DataNode *_DataNode) |
virtual void | SetNode (const mitk::DataNode *_DataNode, const mitk::DataNode *_OtherDataNode) |
virtual void | SetAutoSelectNewItems (bool _AutoSelectNewItems) |
virtual void | OnDataNodeDeleteOrModified (const itk::Object *caller, const itk::EventObject &event) |
Called when a node is deleted or the name property of the node was modified. Calls RemoveNode or SetNode then. More... | |
Protected Member Functions | |
bool | HasIndex (unsigned int index) const |
Checks if the given index is within the range of the m_Nodes vector. More... | |
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 to the combobox. More... | |
void | Init () |
Init-function this class with the given dataStorage and _Predicate. This function is called by all ctors. More... | |
virtual void | Reset () |
Reset function whenever datastorage or predicate changes. More... | |
Protected Attributes | |
mitk::WeakPointer < mitk::DataStorage > | m_DataStorage |
mitk::NodePredicateBase::ConstPointer | m_Predicate |
Holds the predicate that is responsible for the _DataNode selection of this ComboBox. If the predicate is 0, every _DataNode will be selected. More... | |
std::vector< mitk::DataNode * > | m_Nodes |
std::vector< long > | m_NodesModifiedObserverTags |
Holds the tags of the node-modified observers. (must be updated everytime m_Nodes changes) More... | |
std::vector< long > | m_NodesDeleteObserverTags |
Holds the tags of the node-modified observers. (must be updated everytime m_Nodes changes) More... | |
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 node whenever the name property of a node changed. More... | |
bool | m_BlockEvents |
Event function guard. Each function which is called by an event mechanism first checks if this is true in order to avoid endless loops. More... | |
bool | m_AutoSelectNewNodes |
If set to "true" new Nodes will be automatically selected. More... | |
niftk::DataStorageCheckableComboBox::DataStorageCheckableComboBox | ( | QWidget * | parent = 0 , |
bool | _AutoSelectNewNodes = false |
||
) |
Ctor for an empty combobox. Use setDataStorage and setPredicate afterwards.
niftk::DataStorageCheckableComboBox::DataStorageCheckableComboBox | ( | mitk::DataStorage * | _DataStorage, |
const mitk::NodePredicateBase * | _Predicate, | ||
QWidget * | parent = 0 , |
||
bool | _AutoSelectNewNodes = false |
||
) |
Ctor for constructing QmitkDataStorageComboBox with given DataStorageComboBox and given _Predicate.
niftk::DataStorageCheckableComboBox::~DataStorageCheckableComboBox | ( | ) |
Standard Dtor. Nothing to do here.
|
virtual |
Adds a node to the ComboBox. Gets called everytime a DataStorage Add Event was thrown.
|
virtual |
Seaches for a given node and returns a valid index or -1 if the node was not found.
|
virtual |
Returns the AutoSelectNewItems.
mitk::DataStorage::Pointer niftk::DataStorageCheckableComboBox::GetDataStorage | ( | ) | const |
Get the DataStorage this ComboBox listens to.
|
virtual |
Returns the _DataNode at Index index or 0 if the index is out of bounds.
mitk::DataStorage::SetOfObjects::ConstPointer niftk::DataStorageCheckableComboBox::GetNodes | ( | ) | const |
Returns all nodes that are stored in this combobox.
const mitk::NodePredicateBase::ConstPointer niftk::DataStorageCheckableComboBox::GetPredicate | ( | ) | const |
Return the predicate (may be NULL) that is responsible for the _DataNode selection of this ComboBox.
|
virtual |
Returns all selected nodes, or empty list if there are none.
|
protected |
Checks if the given index is within the range of the m_Nodes vector.
|
protected |
Init-function this class with the given dataStorage and _Predicate. This function is called by all ctors.
|
protectedvirtual |
Inserts a new node at the given index. If the index does not exist, the _DataNode is simply appended to the combobox.
This function is used by AddNode() and SetNode() because they just to the same:
property of the node because this is the only thing we are interested in !!!!!
|
virtual |
Called when a node is deleted or the name property of the node was modified. Calls RemoveNode or SetNode then.
|
signal |
Throw a signal when the _DataNode selection changed.
Removes a node from the ComboBox at a specified index (if the index exists). Gets called when a DataStorage Remove Event was thrown.
|
virtual |
Removes a node from the ComboBox. Gets called when a DataStorage Remove Event was thrown.
Reset function whenever datastorage or predicate changes.
|
virtual |
Sets AutoSelectNewItems flag. If set to true new Nodes will be automatically selected. Default is false.
void niftk::DataStorageCheckableComboBox::SetDataStorage | ( | mitk::DataStorage * | dataStorage | ) |
Set the DataStorage this ComboBox should listen to.
If DataStorage is 0 nothing will be shown. If DataStorage is re-set the combobox will be resetted.
|
virtual |
Set a _DataNode in the ComboBox at the specified index (if the index exists). Internally the method just calls RemoveNode(unsigned int)
|
virtual |
Replaces a _DataNode in the combobox by an _OtherDataNode. Internally the method just calls SetNode(unsigned int, mitk::DataNode*)
void niftk::DataStorageCheckableComboBox::SetPredicate | ( | const mitk::NodePredicateBase * | _Predicate | ) |
Set the predicate for this ComboBox. (QmitkDataStorageComboBox is now owner of the predicate)
If predicate is NULL all nodes will be selected. If predicate changes the whole combobox will be resetted.
|
slot |
Slot for signal when user wants to set a node as current selected node.
|
protected |
If set to "true" new Nodes will be automatically selected.
|
protected |
Event function guard. Each function which is called by an event mechanism first checks if this is true in order to avoid endless loops.
|
protected |
Pointer to the DataStorage from which the nodes are selected (remember: in BlueBerry there might be more than one DataStorage).
|
protected |
Holds all selected Nodes. Dont hold smart pointer as we are in a GUI class.
|
protected |
Holds the tags of the node-modified observers. (must be updated everytime m_Nodes changes)
|
protected |
Holds the tags of the node-modified observers. (must be updated everytime m_Nodes changes)
|
protected |
Holds the predicate that is responsible for the _DataNode selection of this ComboBox. If the predicate is 0, every _DataNode will be selected.
|
protected |
Maps a a specific node to (Name-)property. This is needed because we have to find the assiociated node whenever the name property of a node changed.