VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQtListView.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 __vtkQtListView_h 00032 #define __vtkQtListView_h 00033 00034 #include "vtkViewsQtModule.h" // For export macro 00035 #include "QVTKWin32Header.h" 00036 #include "vtkQtView.h" 00037 00038 #include <QPointer> 00039 #include <QImage> 00040 #include <QSortFilterProxyModel> 00041 #include "vtkQtAbstractModelAdapter.h" 00042 #include "vtkSmartPointer.h" 00043 00044 class vtkApplyColors; 00045 class vtkDataObjectToTable; 00046 class QItemSelection; 00047 class QListView; 00048 class vtkQtTableModelAdapter; 00049 00050 class VTKVIEWSQT_EXPORT vtkQtListView : public vtkQtView 00051 { 00052 Q_OBJECT 00053 00054 public: 00055 static vtkQtListView *New(); 00056 vtkTypeMacro(vtkQtListView, vtkQtView); 00057 void PrintSelf(ostream& os, vtkIndent indent); 00058 00062 virtual QWidget* GetWidget(); 00063 00064 enum 00065 { 00066 FIELD_DATA = 0, 00067 POINT_DATA = 1, 00068 CELL_DATA = 2, 00069 VERTEX_DATA = 3, 00070 EDGE_DATA = 4, 00071 ROW_DATA = 5, 00072 }; 00073 00075 00077 vtkGetMacro(FieldType, int); 00078 void SetFieldType(int); 00080 00082 void SetEnableDragDrop(bool); 00083 00085 void SetAlternatingRowColors(bool); 00086 00090 void SetDecorationStrategy(int); 00091 00093 00094 void SetColorArrayName(const char* name); 00095 const char* GetColorArrayName(); 00097 00099 00100 void SetColorByArray(bool vis); 00101 bool GetColorByArray(); 00102 vtkBooleanMacro(ColorByArray, bool); 00104 00106 void SetVisibleColumn(int col); 00107 00109 void SetFilterRegExp(const QRegExp& pattern); 00110 00112 00114 void SetIconSheet(QImage sheet); 00115 void SetIconSize(int w, int h); 00116 void SetIconSheetSize(int w, int h); 00117 void SetIconArrayName(const char* name); 00119 00120 virtual void ApplyViewTheme(vtkViewTheme* theme); 00121 00123 virtual void Update(); 00124 00125 protected: 00126 vtkQtListView(); 00127 ~vtkQtListView(); 00128 00129 virtual void AddRepresentationInternal(vtkDataRepresentation* rep); 00130 virtual void RemoveRepresentationInternal(vtkDataRepresentation* rep); 00131 00132 private slots: 00133 void slotQtSelectionChanged(const QItemSelection&,const QItemSelection&); 00134 00135 private: 00136 void SetVTKSelection(); 00137 00138 unsigned long LastSelectionMTime; 00139 unsigned long LastInputMTime; 00140 unsigned long LastMTime; 00141 00142 vtkSetStringMacro(ColorArrayNameInternal); 00143 vtkGetStringMacro(ColorArrayNameInternal); 00144 vtkSetStringMacro(IconIndexArrayNameInternal); 00145 vtkGetStringMacro(IconIndexArrayNameInternal); 00146 00147 QPointer<QListView> ListView; 00148 vtkQtTableModelAdapter* TableAdapter; 00149 QSortFilterProxyModel* TableSorter; 00150 char* ColorArrayNameInternal; 00151 char* IconIndexArrayNameInternal; 00152 char* VisibleColumnName; 00153 bool SortSelectionToTop; 00154 bool ApplyRowColors; 00155 int FieldType; 00156 int VisibleColumn; 00157 00158 vtkSmartPointer<vtkDataObjectToTable> DataObjectToTable; 00159 vtkSmartPointer<vtkApplyColors> ApplyColors; 00160 00161 vtkQtListView(const vtkQtListView&); // Not implemented. 00162 void operator=(const vtkQtListView&); // Not implemented. 00163 00164 }; 00165 00166 #endif