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 -------------------------------------------------------------------------*/
31 #ifndef vtkQtListView_h
32 #define vtkQtListView_h
33 
34 #include "vtkViewsQtModule.h" // For export macro
35 #include "QVTKWin32Header.h"
36 #include "vtkQtView.h"
37 
38 #include <QPointer>
39 #include <QImage>
40 #include <QSortFilterProxyModel>
42 #include "vtkSmartPointer.h"
43 
44 class vtkApplyColors;
46 class QItemSelection;
47 class QListView;
49 
51 {
52 Q_OBJECT
53 
54 public:
55  static vtkQtListView *New();
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
62  virtual QWidget* GetWidget();
63 
64  enum
65  {
66  FIELD_DATA = 0,
67  POINT_DATA = 1,
68  CELL_DATA = 2,
69  VERTEX_DATA = 3,
70  EDGE_DATA = 4,
71  ROW_DATA = 5,
72  };
73 
75 
77  vtkGetMacro(FieldType, int);
78  void SetFieldType(int);
80 
82  void SetEnableDragDrop(bool);
83 
86 
91 
93 
94  void SetColorArrayName(const char* name);
95  const char* GetColorArrayName();
97 
99 
100  void SetColorByArray(bool vis);
102  vtkBooleanMacro(ColorByArray, bool);
104 
106  void SetVisibleColumn(int col);
107 
109  void SetFilterRegExp(const QRegExp& pattern);
110 
112 
114  void SetIconSheet(QImage sheet);
115  void SetIconSize(int w, int h);
116  void SetIconSheetSize(int w, int h);
117  void SetIconArrayName(const char* name);
119 
120  virtual void ApplyViewTheme(vtkViewTheme* theme);
121 
123  virtual void Update();
124 
125 protected:
128 
131 
132 private slots:
133  void slotQtSelectionChanged(const QItemSelection&,const QItemSelection&);
134 
135 private:
136  void SetVTKSelection();
137 
138  unsigned long LastSelectionMTime;
139  unsigned long LastInputMTime;
140  unsigned long LastMTime;
141 
142  vtkSetStringMacro(ColorArrayNameInternal);
143  vtkGetStringMacro(ColorArrayNameInternal);
144  vtkSetStringMacro(IconIndexArrayNameInternal);
145  vtkGetStringMacro(IconIndexArrayNameInternal);
146 
147  QPointer<QListView> ListView;
148  vtkQtTableModelAdapter* TableAdapter;
149  QSortFilterProxyModel* TableSorter;
150  char* ColorArrayNameInternal;
151  char* IconIndexArrayNameInternal;
152  char* VisibleColumnName;
153  bool SortSelectionToTop;
154  bool ApplyRowColors;
155  int FieldType;
156  int VisibleColumn;
157 
158  vtkSmartPointer<vtkDataObjectToTable> DataObjectToTable;
160 
161  vtkQtListView(const vtkQtListView&); // Not implemented.
162  void operator=(const vtkQtListView&); // Not implemented.
163 
164 };
165 
166 #endif
vtkQtListView::SetFieldType
void SetFieldType(int)
vtkQtListView::SetIconArrayName
void SetIconArrayName(const char *name)
vtkQtListView::GetColorByArray
bool GetColorByArray()
vtkgl::h
GLfloat GLfloat GLfloat GLfloat h
Definition: vtkgl.h:14364
vtkQtListView::New
static vtkQtListView * New()
vtkQtListView::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSmartPointer< vtkDataObjectToTable >
vtkQtListView::AddRepresentationInternal
virtual void AddRepresentationInternal(vtkDataRepresentation *rep)
vtkApplyColors
apply colors to a data set.
Definition: vtkApplyColors.h:86
vtkQtListView::SetIconSize
void SetIconSize(int w, int h)
vtkQtListView::Update
virtual void Update()
vtkQtListView::SetColorArrayName
void SetColorArrayName(const char *name)
vtkQtListView::SetDecorationStrategy
void SetDecorationStrategy(int)
vtkQtListView::SetFilterRegExp
void SetFilterRegExp(const QRegExp &pattern)
vtkQtAbstractModelAdapter.h
vtkQtListView::SetIconSheet
void SetIconSheet(QImage sheet)
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkViewsQtModule.h
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:72
VTKVIEWSQT_EXPORT
#define VTKVIEWSQT_EXPORT
Definition: vtkViewsQtModule.h:15
vtkQtListView::SetAlternatingRowColors
void SetAlternatingRowColors(bool)
vtkQtListView::vtkQtListView
vtkQtListView()
vtkQtListView::GetColorArrayName
const char * GetColorArrayName()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkQtListView::GetWidget
virtual QWidget * GetWidget()
vtkSmartPointer.h
vtkQtListView::SetColorByArray
void SetColorByArray(bool vis)
vtkgl::pattern
GLubyte * pattern
Definition: vtkgl.h:14438
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkQtListView
A VTK view based on a Qt List view.
Definition: vtkQtListView.h:51
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkQtListView::SetIconSheetSize
void SetIconSheetSize(int w, int h)
vtkQtView.h
vtkQtListView::~vtkQtListView
~vtkQtListView()
vtkQtListView::SetEnableDragDrop
void SetEnableDragDrop(bool)
vtkQtListView::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *theme)
vtkQtTableModelAdapter
Adapts a table to a Qt item model.
Definition: vtkQtTableModelAdapter.h:47
vtkQtView
Superclass for Qt widget-based views.
Definition: vtkQtView.h:32
vtkDataObjectToTable
extract field data as a table
Definition: vtkDataObjectToTable.h:41
vtkQtListView::SetVisibleColumn
void SetVisibleColumn(int col)
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkQtListView::RemoveRepresentationInternal
virtual void RemoveRepresentationInternal(vtkDataRepresentation *rep)