VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQtAnnotationLayersModelAdapter.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00031 #ifndef vtkQtAnnotationLayersModelAdapter_h 00032 #define vtkQtAnnotationLayersModelAdapter_h 00033 00034 #include "vtkGUISupportQtModule.h" // For export macro 00035 #include "QVTKWin32Header.h" 00036 #include "vtkQtAbstractModelAdapter.h" 00037 00038 class vtkAnnotationLayers; 00039 class vtkSelection; 00040 00041 class VTKGUISUPPORTQT_EXPORT vtkQtAnnotationLayersModelAdapter : public vtkQtAbstractModelAdapter 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 vtkQtAnnotationLayersModelAdapter(QObject *parent = 0); 00047 vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject *parent = 0); 00048 ~vtkQtAnnotationLayersModelAdapter(); 00049 00051 00052 virtual void SetVTKDataObject(vtkDataObject *data); 00053 virtual vtkDataObject* GetVTKDataObject() const; 00055 00057 00058 virtual vtkAnnotationLayers* QModelIndexListToVTKAnnotationLayers( 00059 const QModelIndexList qmil) const; 00060 virtual QItemSelection VTKAnnotationLayersToQItemSelection( 00061 vtkAnnotationLayers *vtkann) const; 00062 virtual vtkSelection* QModelIndexListToVTKIndexSelection( 00063 const QModelIndexList qmil) const; 00064 virtual QItemSelection VTKIndexSelectionToQItemSelection( 00065 vtkSelection *vtksel) const; 00067 00068 virtual void SetKeyColumnName(const char* name); 00069 virtual void SetColorColumnName(const char* name); 00070 00072 00073 void setAnnotationLayers(vtkAnnotationLayers* annotations); 00074 vtkAnnotationLayers* annotationLayers() const { return this->Annotations; } 00075 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 00076 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); 00077 Qt::ItemFlags flags(const QModelIndex &index) const; 00078 QVariant headerData(int section, Qt::Orientation orientation, 00079 int role = Qt::DisplayRole) const; 00080 QModelIndex index(int row, int column, 00081 const QModelIndex &parent = QModelIndex()) const; 00082 QModelIndex parent(const QModelIndex &index) const; 00083 int rowCount(const QModelIndex &parent = QModelIndex()) const; 00084 int columnCount(const QModelIndex &parent = QModelIndex()) const; 00085 /* 00086 Qt::DropActions supportedDropActions() const; 00087 Qt::DropActions supportedDragActions() const; 00088 bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex()); 00089 bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex()); 00090 virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) ; 00091 virtual QMimeData * mimeData ( const QModelIndexList & indexes ) const; 00092 virtual QStringList mimeTypes () const ; 00093 */ 00094 private: 00096 00097 bool noAnnotationsCheck() const; 00098 00099 vtkAnnotationLayers* Annotations; 00100 00101 vtkQtAnnotationLayersModelAdapter(const vtkQtAnnotationLayersModelAdapter &); // Not implemented 00102 void operator=(const vtkQtAnnotationLayersModelAdapter&); // Not implemented. 00103 }; 00104 00105 #endif