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 
56  vtkDataObject* GetVTKDataObject() const override;
58 
60 
64  const QModelIndexList qmil) const;
65  virtual QItemSelection VTKAnnotationLayersToQItemSelection(
66  vtkAnnotationLayers *vtkann) const;
68  const QModelIndexList qmil) const override;
70  vtkSelection *vtksel) const override;
72 
73  void SetKeyColumnName(const char* name) override;
74  void SetColorColumnName(const char* name) override;
75 
77 
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
vtkQtAnnotationLayersModelAdapter::GetVTKDataObject
vtkDataObject * GetVTKDataObject() const override
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkQtAnnotationLayersModelAdapter
Adapts annotations to a Qt item model.
Definition: vtkQtAnnotationLayersModelAdapter.h:43
vtkQtAnnotationLayersModelAdapter::VTKAnnotationLayersToQItemSelection
virtual QItemSelection VTKAnnotationLayersToQItemSelection(vtkAnnotationLayers *vtkann) const
vtkQtAnnotationLayersModelAdapter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
vtkQtAnnotationLayersModelAdapter::SetKeyColumnName
void SetKeyColumnName(const char *name) override
vtkQtAnnotationLayersModelAdapter::vtkQtAnnotationLayersModelAdapter
vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers *ann, QObject *parent=nullptr)
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:64
vtkQtAnnotationLayersModelAdapter::vtkQtAnnotationLayersModelAdapter
vtkQtAnnotationLayersModelAdapter(QObject *parent=nullptr)
vtkQtAbstractModelAdapter.h
vtkQtAnnotationLayersModelAdapter::SetVTKDataObject
void SetVTKDataObject(vtkDataObject *data) override
Set/Get the VTK data object as input to this adapter.
vtkQtAnnotationLayersModelAdapter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
vtkQtAnnotationLayersModelAdapter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
vtkAnnotationLayers
Stores a ordered collection of annotation sets.
Definition: vtkAnnotationLayers.h:43
vtkQtAnnotationLayersModelAdapter::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
vtkQtAbstractModelAdapter
Superclass for Qt model adapters.
Definition: vtkQtAbstractModelAdapter.h:46
vtkQtAnnotationLayersModelAdapter::QModelIndexListToVTKIndexSelection
vtkSelection * QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const override
Selection conversion from VTK land to Qt land.
vtkQtAnnotationLayersModelAdapter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkQtAnnotationLayersModelAdapter::setAnnotationLayers
void setAnnotationLayers(vtkAnnotationLayers *annotations)
Set up the model based on the current table.
vtkQtAnnotationLayersModelAdapter::parent
QModelIndex parent(const QModelIndex &index) const override
vtkQtAnnotationLayersModelAdapter::SetColorColumnName
void SetColorColumnName(const char *name) override
vtkQtAnnotationLayersModelAdapter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:262
vtkQtAnnotationLayersModelAdapter::annotationLayers
vtkAnnotationLayers * annotationLayers() const
Definition: vtkQtAnnotationLayersModelAdapter.h:81
vtkQtAnnotationLayersModelAdapter::VTKIndexSelectionToQItemSelection
QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection *vtksel) const override
vtkQtAnnotationLayersModelAdapter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
vtkQtAnnotationLayersModelAdapter::QModelIndexListToVTKAnnotationLayers
virtual vtkAnnotationLayers * QModelIndexListToVTKAnnotationLayers(const QModelIndexList qmil) const
Selection conversion from VTK land to Qt land.
vtkQtAnnotationLayersModelAdapter::~vtkQtAnnotationLayersModelAdapter
~vtkQtAnnotationLayersModelAdapter() override
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkX3D::index
@ index
Definition: vtkX3D.h:246