VTK
vtkQtListView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtListView.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 vtkQtListView_h
33 #define vtkQtListView_h
34 
35 #include "vtkViewsQtModule.h" // For export macro
36 #include "vtkQtView.h"
37 
38 #include <QPointer> // Needed for the internal list view
39 #include <QImage> // Needed for the icon methods
40 #include "vtkSmartPointer.h" // Needed for member variables
41 
42 class vtkApplyColors;
44 class QItemSelection;
45 class QSortFilterProxyModel;
46 class QListView;
48 
49 class VTKVIEWSQT_EXPORT vtkQtListView : public vtkQtView
50 {
51 Q_OBJECT
52 
53 public:
54  static vtkQtListView *New();
55  vtkTypeMacro(vtkQtListView, vtkQtView);
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
64  virtual QWidget* GetWidget();
65 
66  enum
67  {
68  FIELD_DATA = 0,
69  POINT_DATA = 1,
70  CELL_DATA = 2,
71  VERTEX_DATA = 3,
72  EDGE_DATA = 4,
73  ROW_DATA = 5,
74  };
75 
77 
81  vtkGetMacro(FieldType, int);
82  void SetFieldType(int);
84 
88  void SetEnableDragDrop(bool);
89 
94 
102 
104 
107  void SetColorArrayName(const char* name);
108  const char* GetColorArrayName();
110 
112 
115  void SetColorByArray(bool vis);
117  vtkBooleanMacro(ColorByArray, bool);
119 
123  void SetVisibleColumn(int col);
124 
128  void SetFilterRegExp(const QRegExp& pattern);
129 
131 
134  void SetIconSheet(QImage sheet);
135  void SetIconSize(int w, int h);
136  void SetIconSheetSize(int w, int h);
137  void SetIconArrayName(const char* name);
139 
140  virtual void ApplyViewTheme(vtkViewTheme* theme);
141 
145  virtual void Update();
146 
147 protected:
150 
153 
154 private slots:
155  void slotQtSelectionChanged(const QItemSelection&,const QItemSelection&);
156 
157 private:
158  void SetVTKSelection();
159 
160  vtkMTimeType LastSelectionMTime;
161  vtkMTimeType LastInputMTime;
162  vtkMTimeType LastMTime;
163 
164  vtkSetStringMacro(ColorArrayNameInternal);
165  vtkGetStringMacro(ColorArrayNameInternal);
166  vtkSetStringMacro(IconIndexArrayNameInternal);
167  vtkGetStringMacro(IconIndexArrayNameInternal);
168 
169  QPointer<QListView> ListView;
170  vtkQtTableModelAdapter* TableAdapter;
171  QSortFilterProxyModel* TableSorter;
172  char* ColorArrayNameInternal;
173  char* IconIndexArrayNameInternal;
174  char* VisibleColumnName;
175  bool SortSelectionToTop;
176  bool ApplyRowColors;
177  int FieldType;
178  int VisibleColumn;
179 
180  vtkSmartPointer<vtkDataObjectToTable> DataObjectToTable;
182 
183  vtkQtListView(const vtkQtListView&) VTK_DELETE_FUNCTION;
184  void operator=(const vtkQtListView&) VTK_DELETE_FUNCTION;
185 
186 };
187 
188 #endif
apply colors to a data set.
extract field data as a table
The superclass for all representations.
a simple class to control print indentation
Definition: vtkIndent.h:40
A VTK view based on a Qt List view.
Definition: vtkQtListView.h:50
virtual void RemoveRepresentationInternal(vtkDataRepresentation *rep)
void SetColorArrayName(const char *name)
The array to use for coloring items in view.
void SetEnableDragDrop(bool)
Enable drag and drop on this widget.
void SetVisibleColumn(int col)
The column to display.
void SetAlternatingRowColors(bool)
Have the view alternate its row colors.
void SetIconArrayName(const char *name)
void SetFilterRegExp(const QRegExp &pattern)
The column used to filter on.
const char * GetColorArrayName()
virtual void ApplyViewTheme(vtkViewTheme *theme)
void SetIconSheetSize(int w, int h)
void SetFieldType(int)
bool GetColorByArray()
void SetIconSize(int w, int h)
void SetIconSheet(QImage sheet)
Set the icon ivars.
virtual QWidget * GetWidget()
Get the main container of this view (a QWidget).
void SetDecorationStrategy(int)
The strategy for how to decorate rows.
virtual void Update()
Updates the view.
void SetColorByArray(bool vis)
Whether to color vertices.
static vtkQtListView * New()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void AddRepresentationInternal(vtkDataRepresentation *rep)
Adapts a table to a Qt item model.
Superclass for Qt widget-based views.
Definition: vtkQtView.h:32
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:49
@ name
Definition: vtkX3D.h:219
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248