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 -------------------------------------------------------------------------*/
31 #ifndef vtkQtAnnotationLayersModelAdapter_h
32 #define vtkQtAnnotationLayersModelAdapter_h
33 
34 #include "vtkGUISupportQtModule.h" // For export macro
36 
38 class vtkSelection;
39 
41 {
42  Q_OBJECT
43 
44 public:
45  vtkQtAnnotationLayersModelAdapter(QObject *parent = 0);
46  vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject *parent = 0);
48 
50 
51  virtual void SetVTKDataObject(vtkDataObject *data);
52  virtual vtkDataObject* GetVTKDataObject() const;
54 
56 
57  virtual vtkAnnotationLayers* QModelIndexListToVTKAnnotationLayers(
58  const QModelIndexList qmil) const;
59  virtual QItemSelection VTKAnnotationLayersToQItemSelection(
60  vtkAnnotationLayers *vtkann) const;
62  const QModelIndexList qmil) const;
63  virtual QItemSelection VTKIndexSelectionToQItemSelection(
64  vtkSelection *vtksel) const;
66 
67  virtual void SetKeyColumnName(const char* name);
68  virtual void SetColorColumnName(const char* name);
69 
71 
72  void setAnnotationLayers(vtkAnnotationLayers* annotations);
73  vtkAnnotationLayers* annotationLayers() const { return this->Annotations; }
74  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
75  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
76  Qt::ItemFlags flags(const QModelIndex &index) const;
77  QVariant headerData(int section, Qt::Orientation orientation,
78  int role = Qt::DisplayRole) const;
79  QModelIndex index(int row, int column,
80  const QModelIndex &parent = QModelIndex()) const;
81  QModelIndex parent(const QModelIndex &index) const;
82  int rowCount(const QModelIndex &parent = QModelIndex()) const;
83  int columnCount(const QModelIndex &parent = QModelIndex()) const;
84 /*
85  Qt::DropActions supportedDropActions() const;
86  Qt::DropActions supportedDragActions() const;
87  bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
88  bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
89  virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) ;
90  virtual QMimeData * mimeData ( const QModelIndexList & indexes ) const;
91  virtual QStringList mimeTypes () const ;
92 */
93 private:
95 
96  bool noAnnotationsCheck() const;
97 
98  vtkAnnotationLayers* Annotations;
99 
101  void operator=(const vtkQtAnnotationLayersModelAdapter&); // Not implemented.
102 };
103 
104 #endif
Adapts annotations to a Qt item model.
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:44
virtual vtkSelection * QModelIndexListToVTKIndexSelection(const QModelIndexList qmil) const =0
virtual void SetColorColumnName(const char *name)=0
virtual vtkDataObject * GetVTKDataObject() const =0
#define VTKGUISUPPORTQT_EXPORT
virtual QItemSelection VTKIndexSelectionToQItemSelection(vtkSelection *vtksel) const =0
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
general representation of visualization data
Definition: vtkDataObject.h:64