VTK  9.3.1
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 
39  void SetVTKDataObject(vtkDataObject* data) override;
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 
60  void setAnnotationLayers(vtkAnnotationLayers* annotations);
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
vtkAnnotationLayers * annotationLayers() const
Set up the model based on the current table.
Adapts annotations to a Qt item model.
virtual vtkSelection * QModelIndexListToVTKIndexSelection(QModelIndexList qmil) const =0
Selection conversion from VTK land to Qt land.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:49
virtual void SetColorColumnName(const char *name)=0
virtual vtkDataObject * GetVTKDataObject() const =0
Set/Get the VTK data object as input to this adapter.
Superclass for Qt model adapters.
virtual void SetKeyColumnName(const char *name)=0
Stores a ordered collection of annotation sets.
virtual void SetVTKDataObject(vtkDataObject *data)=0
Set/Get the VTK data object as input to this adapter.
virtual QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection *vtksel) const =0
Selection conversion from VTK land to Qt land.
general representation of visualization data
Definition: vtkDataObject.h:54