13 #ifndef QmitkRenderWindowDataStorageListModel_h
14 #define QmitkRenderWindowDataStorageListModel_h
106 QModelIndex
index(
int row,
int column,
const QModelIndex& parent = QModelIndex())
const override;
114 QModelIndex
parent(
const QModelIndex& child)
const override;
122 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
130 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
147 QVariant
data(
const QModelIndex& index,
int role)
const override;
160 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole)
override;
171 Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
205 QMimeData*
mimeData(
const QModelIndexList& indexes)
const override;
220 bool dropMimeData(
const QMimeData* data, Qt::DropAction action,
int row,
int column,
const QModelIndex& parent)
override;
260 void UpdateModelData();
262 std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
#define MITKRENDERWINDOWMANAGERUI_EXPORT
Abstract base class extending QAbstractItemModel for DataStorage-backed models.
List model that displays the layer stack for a specific render window with drag-and-drop support.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Set data for the given index and role (visibility toggling).
mitk::BaseRenderer::Pointer GetCurrentRenderer() const
Get the currently active base renderer.
void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer)
Set the list of controlled renderers and initialize layer data for all nodes.
QModelIndex parent(const QModelIndex &child) const override
Return the parent index (always invalid, since this is a flat list model).
QmitkRenderWindowDataStorageListModel(QObject *parent=nullptr)
Construct the list model.
void AddDataNodeToAllRenderer(mitk::DataNode *dataNode)
Insert the given data node into all controlled render windows at the top layer.
Qt::DropActions supportedDragActions() const override
Return supported drag actions (Copy and Move).
void NodeAdded(const mitk::DataNode *node) override
Called when a data node has been added to the data storage.
void NodeChanged(const mitk::DataNode *node) override
Called when a data node has been changed.
QMimeData * mimeData(const QModelIndexList &indexes) const override
Create MIME data for the given model indices.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of columns (always 1).
Qt::DropActions supportedDropActions() const override
Return supported drop actions (Copy and Move).
void SetCurrentRenderer(mitk::BaseRenderer *baseRenderer)
Set the current base renderer and refresh the model.
QStringList mimeTypes() const override
Return the list of supported MIME types for drag-and-drop.
Qt::ItemFlags flags(const QModelIndex &index) const override
Return item flags for the given index.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
Handle dropped MIME data to reorder layers.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of rows (layers) in the model.
void NodePredicateChanged() override
Called when the node predicate has been changed. Refreshes the model data.
void DataStorageChanged() override
Called when the data storage has been changed.
QVariant data(const QModelIndex &index, int role) const override
Return data for the given index and role.
void NodeRemoved(const mitk::DataNode *node) override
Called when a data node has been removed from the data storage. Refreshes the model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Create a model index for the given row and column.
Organizes the rendering process.
Central node class of the MITK data tree, associating a data object with properties and mappers.
std::vector< BaseRenderer * > RendererVector
std::map< int, DataNode::Pointer, std::greater< int > > LayerStack