VTK
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 
55  void SetVTKDataObject(vtkDataObject *data) override;
56  vtkDataObject* GetVTKDataObject() const override;
58 
60 
63  virtual vtkAnnotationLayers* QModelIndexListToVTKAnnotationLayers(
64  const QModelIndexList qmil) const;
65  virtual QItemSelection VTKAnnotationLayersToQItemSelection(
66  vtkAnnotationLayers *vtkann) const;
68  const QModelIndexList qmil) const override;
69  QItemSelection VTKIndexSelectionToQItemSelection(
70  vtkSelection *vtksel) const override;
72 
73  void SetKeyColumnName(const char* name) override;
74  void SetColorColumnName(const char* name) override;
75 
77 
80  void setAnnotationLayers(vtkAnnotationLayers* annotations);
81  vtkAnnotationLayers* annotationLayers() const { return this->Annotations; }
82  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
83  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
84  Qt::ItemFlags flags(const QModelIndex &index) const override;
85  QVariant headerData(int section, Qt::Orientation orientation,
86  int role = Qt::DisplayRole) const override;
87  QModelIndex index(int row, int column,
88  const QModelIndex &parent = QModelIndex()) const override;
89  QModelIndex parent(const QModelIndex &index) const override;
90  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
91  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
92 /*
93  Qt::DropActions supportedDropActions() const;
94  Qt::DropActions supportedDragActions() const;
95  bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
96  bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
97  virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) ;
98  virtual QMimeData * mimeData ( const QModelIndexList & indexes ) const;
99  virtual QStringList mimeTypes () const ;
100 */
101 private:
103 
104  bool noAnnotationsCheck() const;
105 
106  vtkAnnotationLayers* Annotations;
107 
109  void operator=(const vtkQtAnnotationLayersModelAdapter&) = delete;
110 };
111 
112 #endif
vtkAnnotationLayers * annotationLayers() const
Set up the model based on the current table.
Adapts annotations to a Qt item model.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:63
virtual vtkSelection * QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const =0
Selection conversion from VTK land to Qt land.
virtual void SetColorColumnName(const char *name)=0
virtual vtkDataObject * GetVTKDataObject() const =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.
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.
general representation of visualization data
Definition: vtkDataObject.h:64