VTK  9.0.2
vtkQtAnnotationLayersModelAdapter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtAnnotationLayersModelAdapter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
32 #ifndef vtkQtAnnotationLayersModelAdapter_h
33 #define vtkQtAnnotationLayersModelAdapter_h
34 
35 #include "vtkConfigure.h"
36 #include "vtkGUISupportQtModule.h" // For export macro
38 
40 class vtkSelection;
41 
42 class VTKGUISUPPORTQT_EXPORT vtkQtAnnotationLayersModelAdapter : public vtkQtAbstractModelAdapter
43 {
44  Q_OBJECT
45 
46 public:
47  vtkQtAnnotationLayersModelAdapter(QObject* parent = nullptr);
48  vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject* parent = nullptr);
50 
52 
56  vtkDataObject* GetVTKDataObject() const override;
58 
60 
64  const QModelIndexList qmil) const;
65  virtual QItemSelection VTKAnnotationLayersToQItemSelection(vtkAnnotationLayers* vtkann) const;
66  vtkSelection* QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const override;
67  QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection* vtksel) const override;
69 
70  void SetKeyColumnName(const char* name) override;
71  void SetColorColumnName(const char* name) override;
72 
74 
78  vtkAnnotationLayers* annotationLayers() const { return this->Annotations; }
79  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
80  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
81  Qt::ItemFlags flags(const QModelIndex& index) const override;
82  QVariant headerData(
83  int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
84  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
85  QModelIndex parent(const QModelIndex& index) const override;
86  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
87  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
88  /*
89  Qt::DropActions supportedDropActions() const;
90  Qt::DropActions supportedDragActions() const;
91  bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
92  bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
93  virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column,
94  const QModelIndex & parent) ; virtual QMimeData * mimeData ( const QModelIndexList & indexes )
95  const; virtual QStringList mimeTypes () const ;
96  */
97 private:
99 
100  bool noAnnotationsCheck() const;
101 
102  vtkAnnotationLayers* Annotations;
103 
105  void operator=(const vtkQtAnnotationLayersModelAdapter&) = delete;
106 };
107 
108 #endif
109 // VTK-HeaderTest-Exclude: vtkQtAnnotationLayersModelAdapter.h
Stores a ordered collection of annotation sets.
general representation of visualization data
Definition: vtkDataObject.h:60
Superclass for Qt model adapters.
Adapts annotations to a Qt item model.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void SetKeyColumnName(const char *name) override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
virtual QItemSelection VTKAnnotationLayersToQItemSelection(vtkAnnotationLayers *vtkann) const
vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers *ann, QObject *parent=nullptr)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
virtual vtkAnnotationLayers * QModelIndexListToVTKAnnotationLayers(const QModelIndexList qmil) const
Selection conversion from VTK land to Qt land.
void SetColorColumnName(const char *name) override
Qt::ItemFlags flags(const QModelIndex &index) const override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
vtkSelection * QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const override
Selection conversion from VTK land to Qt land.
void setAnnotationLayers(vtkAnnotationLayers *annotations)
Set up the model based on the current table.
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
vtkDataObject * GetVTKDataObject() const override
vtkQtAnnotationLayersModelAdapter(QObject *parent=nullptr)
QModelIndex parent(const QModelIndex &index) const override
QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection *vtksel) const override
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:58
@ orientation
Definition: vtkX3D.h:268
@ value
Definition: vtkX3D.h:226
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
@ data
Definition: vtkX3D.h:321