VTK  9.3.20240424
vtkQtAnnotationLayersModelAdapter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
16#ifndef vtkQtAnnotationLayersModelAdapter_h
17#define vtkQtAnnotationLayersModelAdapter_h
18
19#include "vtkGUISupportQtModule.h" // For export macro
21
22VTK_ABI_NAMESPACE_BEGIN
24class vtkSelection;
25
27{
28 Q_OBJECT
29
30public:
31 vtkQtAnnotationLayersModelAdapter(QObject* parent = nullptr);
34
36
39 void SetVTKDataObject(vtkDataObject* data) override;
42
44
47 virtual vtkAnnotationLayers* QModelIndexListToVTKAnnotationLayers(QModelIndexList qmil) const;
48 virtual QItemSelection VTKAnnotationLayersToQItemSelection(vtkAnnotationLayers* vtkann) const;
49 vtkSelection* QModelIndexListToVTKIndexSelection(QModelIndexList qmil) const override;
50 QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection* vtksel) const override;
52
53 void SetKeyColumnName(const char* name) override;
54 void SetColorColumnName(const char* name) override;
55
57
61 vtkAnnotationLayers* annotationLayers() const { return this->Annotations; }
62 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
63 bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
64 Qt::ItemFlags flags(const QModelIndex& index) const override;
65 QVariant headerData(
66 int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
67 QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
68 QModelIndex parent(const QModelIndex& index) const override;
69 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
70 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
71 /*
72 Qt::DropActions supportedDropActions() const;
73 Qt::DropActions supportedDragActions() const;
74 bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
75 bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
76 virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column,
77 const QModelIndex & parent) ; virtual QMimeData * mimeData ( const QModelIndexList & indexes )
78 const; virtual QStringList mimeTypes () const ;
79 */
80private:
82
83 bool noAnnotationsCheck() const;
84
85 vtkAnnotationLayers* Annotations;
86
88 void operator=(const vtkQtAnnotationLayersModelAdapter&) = delete;
89};
90
91VTK_ABI_NAMESPACE_END
92#endif
93// VTK-HeaderTest-Exclude: vtkQtAnnotationLayersModelAdapter.h
Stores a ordered collection of annotation sets.
general representation of visualization data
Superclass for Qt model adapters.
Adapts annotations to a Qt item model.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Set up the model based on the current table.
void SetKeyColumnName(const char *name) override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Set up the model based on the current table.
virtual QItemSelection VTKAnnotationLayersToQItemSelection(vtkAnnotationLayers *vtkann) const
Selection conversion from VTK land to Qt land.
vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers *ann, QObject *parent=nullptr)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Set up the model based on the current table.
void SetColorColumnName(const char *name) override
Qt::ItemFlags flags(const QModelIndex &index) const override
Set up the model based on the current table.
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Set up the model based on the current table.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Set up the model based on the current table.
void setAnnotationLayers(vtkAnnotationLayers *annotations)
Set up the model based on the current table.
vtkDataObject * GetVTKDataObject() const override
Set/Get the VTK data object as input to this adapter.
virtual vtkAnnotationLayers * QModelIndexListToVTKAnnotationLayers(QModelIndexList qmil) const
Selection conversion from VTK land to Qt land.
void SetVTKDataObject(vtkDataObject *data) override
Set/Get the VTK data object as input to this adapter.
vtkSelection * QModelIndexListToVTKIndexSelection(QModelIndexList qmil) const override
Selection conversion from VTK land to Qt land.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Set up the model based on the current table.
vtkQtAnnotationLayersModelAdapter(QObject *parent=nullptr)
QModelIndex parent(const QModelIndex &index) const override
Set up the model based on the current table.
vtkAnnotationLayers * annotationLayers() const
Set up the model based on the current table.
QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection *vtksel) const override
Selection conversion from VTK land to Qt land.
data object that represents a "selection" in VTK.