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 "QVTKWin32Header.h" 00035 #include "vtkQtAbstractModelAdapter.h" 00036 00037 class vtkAnnotationLayers; 00038 class vtkSelection; 00039 00040 class QVTK_EXPORT vtkQtAnnotationLayersModelAdapter : public vtkQtAbstractModelAdapter 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 vtkQtAnnotationLayersModelAdapter(QObject *parent = 0); 00046 vtkQtAnnotationLayersModelAdapter(vtkAnnotationLayers* ann, QObject *parent = 0); 00047 ~vtkQtAnnotationLayersModelAdapter(); 00048 00050 00051 virtual void SetVTKDataObject(vtkDataObject *data); 00052 virtual vtkDataObject* GetVTKDataObject() const; 00054 00056 00057 virtual vtkAnnotationLayers* QModelIndexListToVTKAnnotationLayers( 00058 const QModelIndexList qmil) const; 00059 virtual QItemSelection VTKAnnotationLayersToQItemSelection( 00060 vtkAnnotationLayers *vtkann) const; 00061 virtual vtkSelection* QModelIndexListToVTKIndexSelection( 00062 const QModelIndexList qmil) const; 00063 virtual QItemSelection VTKIndexSelectionToQItemSelection( 00064 vtkSelection *vtksel) const; 00066 00067 virtual void SetKeyColumnName(const char* name); 00068 virtual void SetColorColumnName(const char* name); 00069 00071 00072 void setAnnotationLayers(vtkAnnotationLayers* annotations); 00073 vtkAnnotationLayers* annotationLayers() const { return this->Annotations; } 00074 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 00075 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); 00076 Qt::ItemFlags flags(const QModelIndex &index) const; 00077 QVariant headerData(int section, Qt::Orientation orientation, 00078 int role = Qt::DisplayRole) const; 00079 QModelIndex index(int row, int column, 00080 const QModelIndex &parent = QModelIndex()) const; 00081 QModelIndex parent(const QModelIndex &index) const; 00082 int rowCount(const QModelIndex &parent = QModelIndex()) const; 00083 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: 00095 00096 bool noAnnotationsCheck() const; 00097 00098 vtkAnnotationLayers* Annotations; 00099 00100 vtkQtAnnotationLayersModelAdapter(const vtkQtAnnotationLayersModelAdapter &); // Not implemented 00101 void operator=(const vtkQtAnnotationLayersModelAdapter&); // Not implemented. 00102 }; 00103 00104 #endif