MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkUSZoneManagementWidget Class Reference

Shows a table of the zone nodes and allows to change properties and add and delete zone nodes. More...

#include <QmitkUSZoneManagementWidget.h>

Inheritance diagram for QmitkUSZoneManagementWidget:

Public Slots

void RemoveSelectedRows ()
 Removes all rows from the data model which are selected in the table.
 
void OnStartAddingZone ()
 Creates a new zone node and activates the data interactor on this node. This slot has to be called whenever a new zone should be added. Interactions are active then, so the user can create the zone.
 
void OnAbortAddingZone ()
 Aborts the creation of a new zone and deletes the corresponding node.
 
void OnResetZones ()
 Removes all nodes from the data model.
 

Signals

void ZoneAdded ()
 Emitted whenever a new zone was added to the data model.
 
void ZoneRemoved ()
 Emitted whenever a new zone was removed from the data mode.
 

Public Member Functions

 QmitkUSZoneManagementWidget (QWidget *parent=nullptr)
 
 ~QmitkUSZoneManagementWidget () override
 
void SetStateMachineFilename (const std::string &filename)
 Sets the state machine file for being used by the mitk::USZonesInteractor.
 
void SetDataStorage (mitk::DataStorage::Pointer dataStorage, const char *baseNodeName="Zones")
 Setter for the DataStorage where the zone nodes will be stored. The nodes will be derivates of the node specified by the base node name.
 
void SetDataStorage (mitk::DataStorage::Pointer dataStorage, itk::SmartPointer< mitk::DataNode > baseNode)
 Setter for the DataStorage where the zone nodes will be stored. The nodes will be derivates of the base nodes.
 
mitk::DataStorage::SetOfObjects::ConstPointer GetZoneNodes ()
 Get all zone nodes from the data storage.
 

Protected Slots

void OnSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 
void OnZoneSizeSliderValueChanged (int value)
 Updates zone radius according to the value of the zone size slider.
 
void OnRowInsertion (const QModelIndex &parent, int start, int end)
 Updates maximum number of added zones and selects the last row of the table. It is called every time a row was added to the data model.
 
void OnDataChanged (const QModelIndex &topLeft, const QModelIndex &)
 Updates the zone size slider when data was changed. It is called every time a row was changed in the data model.
 

Protected Attributes

QmitkUSZonesDataModelm_ZonesDataModel
 
itk::SmartPointer< mitk::USZonesInteractorm_Interactor
 
mitk::DataStorage::Pointer m_DataStorage
 
mitk::DataNode::Pointer m_BaseNode
 
std::string m_StateMachineFileName
 

Detailed Description

Shows a table of the zone nodes and allows to change properties and add and delete zone nodes.

A data node interactor (mitk::USZonesInteractor) is used for creating new zone nodes and a QTableModel (QmitkUSZonesDataModel) is used for handling the zones data.

When using the widget, one has to call OnStartAddingZone() every time he wants the interaction for adding new zone nodes to be active.

Definition at line 43 of file QmitkUSZoneManagementWidget.h.

Constructor & Destructor Documentation

◆ QmitkUSZoneManagementWidget()

QmitkUSZoneManagementWidget::QmitkUSZoneManagementWidget ( QWidget * parent = nullptr)
explicit

Definition at line 26 of file QmitkUSZoneManagementWidget.cpp.

◆ ~QmitkUSZoneManagementWidget()

QmitkUSZoneManagementWidget::~QmitkUSZoneManagementWidget ( )
override

Definition at line 49 of file QmitkUSZoneManagementWidget.cpp.

Member Function Documentation

◆ GetZoneNodes()

mitk::DataStorage::SetOfObjects::ConstPointer QmitkUSZoneManagementWidget::GetZoneNodes ( )

Get all zone nodes from the data storage.

Definition at line 104 of file QmitkUSZoneManagementWidget.cpp.

◆ OnAbortAddingZone

void QmitkUSZoneManagementWidget::OnAbortAddingZone ( )
slot

Aborts the creation of a new zone and deletes the corresponding node.

Definition at line 163 of file QmitkUSZoneManagementWidget.cpp.

◆ OnDataChanged

void QmitkUSZoneManagementWidget::OnDataChanged ( const QModelIndex & topLeft,
const QModelIndex &  )
protectedslot

Updates the zone size slider when data was changed. It is called every time a row was changed in the data model.

Definition at line 217 of file QmitkUSZoneManagementWidget.cpp.

◆ OnResetZones

void QmitkUSZoneManagementWidget::OnResetZones ( )
slot

Removes all nodes from the data model.

Definition at line 175 of file QmitkUSZoneManagementWidget.cpp.

◆ OnRowInsertion

void QmitkUSZoneManagementWidget::OnRowInsertion ( const QModelIndex & parent,
int start,
int end )
protectedslot

Updates maximum number of added zones and selects the last row of the table. It is called every time a row was added to the data model.

Definition at line 208 of file QmitkUSZoneManagementWidget.cpp.

◆ OnSelectionChanged

void QmitkUSZoneManagementWidget::OnSelectionChanged ( const QItemSelection & selected,
const QItemSelection & deselected )
protectedslot

Definition at line 186 of file QmitkUSZoneManagementWidget.cpp.

◆ OnStartAddingZone

void QmitkUSZoneManagementWidget::OnStartAddingZone ( )
slot

Creates a new zone node and activates the data interactor on this node. This slot has to be called whenever a new zone should be added. Interactions are active then, so the user can create the zone.

Definition at line 141 of file QmitkUSZoneManagementWidget.cpp.

◆ OnZoneSizeSliderValueChanged

void QmitkUSZoneManagementWidget::OnZoneSizeSliderValueChanged ( int value)
protectedslot

Updates zone radius according to the value of the zone size slider.

Parameters
valuenew radius of the zone

Definition at line 200 of file QmitkUSZoneManagementWidget.cpp.

◆ RemoveSelectedRows

void QmitkUSZoneManagementWidget::RemoveSelectedRows ( )
slot

Removes all rows from the data model which are selected in the table.

Definition at line 118 of file QmitkUSZoneManagementWidget.cpp.

◆ SetDataStorage() [1/2]

void QmitkUSZoneManagementWidget::SetDataStorage ( mitk::DataStorage::Pointer dataStorage,
const char * baseNodeName = "Zones" )

Setter for the DataStorage where the zone nodes will be stored. The nodes will be derivates of the node specified by the base node name.

Parameters
dataStoragedata storage where the zone nodes will be stored
baseNodeNameoptional name of the node which will be the source node of all zone nodes (defaults "Zones")

Definition at line 62 of file QmitkUSZoneManagementWidget.cpp.

◆ SetDataStorage() [2/2]

void QmitkUSZoneManagementWidget::SetDataStorage ( mitk::DataStorage::Pointer dataStorage,
itk::SmartPointer< mitk::DataNode > baseNode )

Setter for the DataStorage where the zone nodes will be stored. The nodes will be derivates of the base nodes.

Parameters
dataStoragedata storage where the zone nodes will be stored
baseNodedata node which will be the source node of all zone nodes

◆ SetStateMachineFilename()

void QmitkUSZoneManagementWidget::SetStateMachineFilename ( const std::string & filename)

Sets the state machine file for being used by the mitk::USZonesInteractor.

Parameters
filenamename of the state machine file

Definition at line 56 of file QmitkUSZoneManagementWidget.cpp.

◆ ZoneAdded

void QmitkUSZoneManagementWidget::ZoneAdded ( )
signal

Emitted whenever a new zone was added to the data model.

◆ ZoneRemoved

void QmitkUSZoneManagementWidget::ZoneRemoved ( )
signal

Emitted whenever a new zone was removed from the data mode.

Member Data Documentation

◆ m_BaseNode

mitk::DataNode::Pointer QmitkUSZoneManagementWidget::m_BaseNode
protected

Definition at line 140 of file QmitkUSZoneManagementWidget.h.

◆ m_DataStorage

mitk::DataStorage::Pointer QmitkUSZoneManagementWidget::m_DataStorage
protected

Definition at line 139 of file QmitkUSZoneManagementWidget.h.

◆ m_Interactor

itk::SmartPointer<mitk::USZonesInteractor> QmitkUSZoneManagementWidget::m_Interactor
protected

Definition at line 138 of file QmitkUSZoneManagementWidget.h.

◆ m_StateMachineFileName

std::string QmitkUSZoneManagementWidget::m_StateMachineFileName
protected

Definition at line 142 of file QmitkUSZoneManagementWidget.h.

◆ m_ZonesDataModel

QmitkUSZonesDataModel* QmitkUSZoneManagementWidget::m_ZonesDataModel
protected

Definition at line 136 of file QmitkUSZoneManagementWidget.h.


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