VTK  9.1.0
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 "vtkGUISupportQtModule.h" // For export macro
37
39class vtkSelection;
40
42{
43 Q_OBJECT
44
45public:
46 vtkQtAnnotationLayersModelAdapter(QObject* parent = nullptr);
49
51
57
59
63 const QModelIndexList qmil) const;
64 virtual QItemSelection VTKAnnotationLayersToQItemSelection(vtkAnnotationLayers* vtkann) const;
65 vtkSelection* QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const override;
66 QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection* vtksel) const override;
68
69 void SetKeyColumnName(const char* name) override;
70 void SetColorColumnName(const char* name) override;
71
73
77 vtkAnnotationLayers* annotationLayers() const { return this->Annotations; }
78 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
79 bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
80 Qt::ItemFlags flags(const QModelIndex& index) const override;
81 QVariant headerData(
82 int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
83 QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
84 QModelIndex parent(const QModelIndex& index) const override;
85 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
86 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
87 /*
88 Qt::DropActions supportedDropActions() const;
89 Qt::DropActions supportedDragActions() const;
90 bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
91 bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
92 virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column,
93 const QModelIndex & parent) ; virtual QMimeData * mimeData ( const QModelIndexList & indexes )
94 const; virtual QStringList mimeTypes () const ;
95 */
96private:
98
99 bool noAnnotationsCheck() const;
100
101 vtkAnnotationLayers* Annotations;
102
104 void operator=(const vtkQtAnnotationLayersModelAdapter&) = delete;
105};
106
107#endif
108// VTK-HeaderTest-Exclude: vtkQtAnnotationLayersModelAdapter.h
Stores a ordered collection of annotation sets.
general representation of visualization data
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.
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.
vtkDataObject * GetVTKDataObject() const override
Set/Get the VTK data object as input to this adapter.
virtual vtkAnnotationLayers * QModelIndexListToVTKAnnotationLayers(const 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.
vtkSelection * QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const override
Selection conversion from VTK land to Qt land.
vtkQtAnnotationLayersModelAdapter(QObject *parent=nullptr)
QModelIndex parent(const QModelIndex &index) const override
Set up the model based on the current table.
vtkAnnotationLayers * annotationLayers() const
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:163
@ 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