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 = 0);
48  vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject *parent = 0);
50 
52 
55  virtual void SetVTKDataObject(vtkDataObject *data);
56  virtual vtkDataObject* GetVTKDataObject() const;
58 
60 
63  virtual vtkAnnotationLayers* QModelIndexListToVTKAnnotationLayers(
64  const QModelIndexList qmil) const;
65  virtual QItemSelection VTKAnnotationLayersToQItemSelection(
66  vtkAnnotationLayers *vtkann) const;
68  const QModelIndexList qmil) const;
69  virtual QItemSelection VTKIndexSelectionToQItemSelection(
70  vtkSelection *vtksel) const;
72 
73  virtual void SetKeyColumnName(const char* name);
74  virtual void SetColorColumnName(const char* name);
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;
83  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
84  Qt::ItemFlags flags(const QModelIndex &index) const;
85  QVariant headerData(int section, Qt::Orientation orientation,
86  int role = Qt::DisplayRole) const;
87  QModelIndex index(int row, int column,
88  const QModelIndex &parent = QModelIndex()) const;
89  QModelIndex parent(const QModelIndex &index) const;
90  int rowCount(const QModelIndex &parent = QModelIndex()) const;
91  int columnCount(const QModelIndex &parent = QModelIndex()) const;
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&) VTK_DELETE_FUNCTION;
110 };
111 
112 #endif
vtkAnnotationLayers * annotationLayers() const
Set up the model based on the current table.
Adapts annotations to a Qt item model.
A node in a selection tree.
Definition: vtkSelection.h:43
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