VTK  9.2.6
vtkQtTableView.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkQtTableView.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-------------------------------------------------------------------------*/
37
38#ifndef vtkQtTableView_h
39#define vtkQtTableView_h
40
41#include "vtkQtView.h"
42#include "vtkViewsQtModule.h" // For export macro
43
44#include "vtkSmartPointer.h" // Needed for member variables
45#include <QPointer> // Needed to hold the view
46
48class vtkApplyColors;
50class vtkIdTypeArray;
51class QItemSelection;
52class QSortFilterProxyModel;
53class QTableView;
55
56class VTKVIEWSQT_EXPORT vtkQtTableView : public vtkQtView
57{
58 Q_OBJECT
59
60public:
62 vtkTypeMacro(vtkQtTableView, vtkQtView);
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
71 QWidget* GetWidget() override;
72
77
82
83 enum
84 {
91 };
92
94
98 vtkGetMacro(FieldType, int);
99 void SetFieldType(int);
101
106
112
114
119 void SetShowAll(bool);
120 vtkGetMacro(ShowAll, bool);
122
124
128 vtkSetStringMacro(ColumnName);
129 vtkGetStringMacro(ColumnName);
131
132 void SetColumnVisibility(const QString& name, bool status);
133
139
145
147
150 void SetSortSelectionToTop(bool value);
151 vtkGetMacro(SortSelectionToTop, bool);
153
155
159 void SetApplyRowColors(bool value);
160 vtkGetMacro(ApplyRowColors, bool);
162
166 void Update() override;
167
169
172 void SetColorArrayName(const char* name);
173 const char* GetColorArrayName();
175
177
180 void SetColorByArray(bool vis);
182 vtkBooleanMacro(ColorByArray, bool);
184
188 void ApplyViewTheme(vtkViewTheme* theme) override;
189
190 enum
191 {
195 };
196
198
207 virtual void SetSelectionBehavior(int type);
208 virtual int GetSelectionBehavior();
210
220
221protected:
223 ~vtkQtTableView() override;
224
227
228private Q_SLOTS:
229 void slotQtSelectionChanged(const QItemSelection&, const QItemSelection&);
230
231private:
232 void SetVTKSelection();
233 vtkMTimeType LastSelectionMTime;
234 vtkMTimeType LastInputMTime;
235 vtkMTimeType LastMTime;
236
237 vtkSetStringMacro(ColorArrayNameInternal);
238 vtkGetStringMacro(ColorArrayNameInternal);
239
240 QPointer<QTableView> TableView;
241 vtkQtTableModelAdapter* TableAdapter;
242 QSortFilterProxyModel* TableSorter;
243 int FieldType;
244 bool ShowAll;
245 char* ColumnName;
246 bool InSelectionChanged;
247 bool SortSelectionToTop;
248 bool ApplyRowColors;
249 char* ColorArrayNameInternal;
250
254
255 vtkQtTableView(const vtkQtTableView&) = delete;
256 void operator=(const vtkQtTableView&) = delete;
257};
258
259#endif
Add an array to the output indicating membership within an input selection.
apply colors to a data set.
extract field data as a table
The superclass for all representations.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:40
Adapts a table to a Qt item model.
void SetColumnVisibility(const QString &name, bool status)
QWidget * GetWidget() override
Get the main container of this view (a QWidget).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkQtTableView() override
void SetEnableDragDrop(bool)
Enable drag and drop on this widget.
bool GetColorByArray()
Whether to color vertices.
const char * GetColorArrayName()
The array to use for coloring items in view.
void SetFieldType(int)
The field type to copy into the output table.
void SetSplitMultiComponentColumns(bool value)
Set whether or not the table view should split multi-component columns into multiple single-component...
void ApplyViewTheme(vtkViewTheme *theme) override
Apply a view theme to this view.
void SetShowVerticalHeaders(bool)
Have the view show/hide its column headers.
void SetSortSelectionToTop(bool value)
Whether or not to sort selections that the view receives to the top.
void AddRepresentationInternal(vtkDataRepresentation *rep) override
bool GetSplitMultiComponentColumns()
Get whether or not the table view splits multi-component columns into multiple single-component colum...
void SetColorByArray(bool vis)
Whether to color vertices.
void SetShowHorizontalHeaders(bool)
Have the view show/hide its row headers.
virtual void SetSelectionBehavior(int type)
The selection mode for this view.
virtual void GetSelectedItems(vtkIdTypeArray *arr)
Fills the array with the selected items of the view.
void SetSortingEnabled(bool)
Whether the table allows individual columns to be sorted upon Sorting is enabled by default (turn off...
static vtkQtTableView * New()
virtual int GetSelectionBehavior()
The selection mode for this view.
void SetShowAll(bool)
Whether or not to display all columns from the input table or to use the ColumnName provided.
void Update() override
Updates the view.
void SetColorArrayName(const char *name)
The array to use for coloring items in view.
void RemoveRepresentationInternal(vtkDataRepresentation *rep) override
void SetApplyRowColors(bool value)
Whether or not to add an icon to the row header denoting the color of an annotated row.
Hold a reference to a vtkObjectBase instance.
Sets theme colors for a graphical view.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287