VTK  9.3.0
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 
22 VTK_ABI_NAMESPACE_BEGIN
24 class vtkSelection;
25 
26 class VTKGUISUPPORTQT_EXPORT vtkQtAnnotationLayersModelAdapter : public vtkQtAbstractModelAdapter
27 {
28  Q_OBJECT
29 
30 public:
31  vtkQtAnnotationLayersModelAdapter(QObject* parent = nullptr);
32  vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject* parent = nullptr);
34 
36 
40  vtkDataObject* GetVTKDataObject() const 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  */
80 private:
82 
83  bool noAnnotationsCheck() const;
84 
85  vtkAnnotationLayers* Annotations;
86 
88  void operator=(const vtkQtAnnotationLayersModelAdapter&) = delete;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
93 // VTK-HeaderTest-Exclude: vtkQtAnnotationLayersModelAdapter.h
Stores a ordered collection of annotation sets.
general representation of visualization data
Definition: vtkDataObject.h:55
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.
vtkAnnotationLayers * annotationLayers() const
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.
vtkSelection * QModelIndexListToVTKIndexSelection(QModelIndexList qmil) const override
Selection conversion from VTK land to Qt land.
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.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Set up the model based on the current table.
vtkDataObject * GetVTKDataObject() const override
Set/Get the VTK data object as input to this adapter.
vtkQtAnnotationLayersModelAdapter(QObject *parent=nullptr)
QModelIndex parent(const QModelIndex &index) const override
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.
Definition: vtkSelection.h:50
@ orientation
Definition: vtkX3D.h:262
@ value
Definition: vtkX3D.h:220
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
@ data
Definition: vtkX3D.h:315