13#ifndef QmitkUSZonesDataModel_h
14#define QmitkUSZonesDataModel_h
16#include <mitkCommon.h>
17#include <mitkDataNode.h>
18#include <mitkDataStorage.h>
19#include <mitkNumericTypes.h>
21#include <QAbstractTableModel>
46 void SetDataStorage(mitk::DataStorage::Pointer dataStorage, mitk::DataNode::Pointer baseNode);
48 void AddNode(
const mitk::DataNode*);
53 int rowCount (
const QModelIndex & parent = QModelIndex() )
const override;
56 int columnCount (
const QModelIndex & parent = QModelIndex() )
const override;
59 QVariant
headerData (
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
62 Qt::ItemFlags
flags (
const QModelIndex & index )
const override;
65 QVariant
data (
const QModelIndex & index,
int role = Qt::DisplayRole )
const override;
68 bool setData (
const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override;
71 bool insertRows (
int row,
int count,
const QModelIndex& parent = QModelIndex() )
override;
74 bool removeRows (
int row,
int count,
const QModelIndex& parent = QModelIndex() )
override;
79 virtual bool removeRows (
int row,
int count,
const QModelIndex& parent,
bool removeFromDataStorage );
88 mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerAddNode;
89 mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerChangeNode;
90 mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerRemoveNode;
Implementation of the QAbstractTableModel for ultrasound risk zones. This class manages the data mode...
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Return names for the columns, numbers for the rows and invalid for DisplayRole.
DataNodeVector m_ZoneNodes
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Return model data of the selected cell.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Return number of columns (3) of the model.
mitk::DataStorage::Pointer m_DataStorage
void SetDataStorage(mitk::DataStorage::Pointer dataStorage, mitk::DataNode::Pointer baseNode)
Set data storage and base node for the zone nodes of this model. The node event listeners will only r...
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Remove given rows from the model.
QmitkUSZonesDataModel(QObject *parent=nullptr)
void RemoveNode(const mitk::DataNode *)
Qt::ItemFlags flags(const QModelIndex &index) const override
Return selectable and enabled for column 1 (size); selectable, enabled and editable for every other c...
void AddNode(const mitk::DataNode *)
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Set model data for the selected cell.
std::vector< mitk::DataNode::Pointer > DataNodeVector
~QmitkUSZonesDataModel() override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Return number of rows of the model.
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Insert empty rows into the model (creates zone nodes).
mitk::DataNode::Pointer m_BaseNode
void ChangeNode(const mitk::DataNode *)