vtkSpreadSheetView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSpreadSheetView.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
24 #ifndef vtkSpreadSheetView_h
25 #define vtkSpreadSheetView_h
26 
27 #include "vtkPVView.h"
28 #include "vtkRemotingViewsModule.h" //needed for exports
29 
30 #include <string> // for std::string
31 
32 class vtkCSVExporter;
35 class vtkReductionFilter;
37 class vtkTable;
38 class vtkVariant;
39 
41 {
42 public:
43  static vtkSpreadSheetView* New();
44  vtkTypeMacro(vtkSpreadSheetView, vtkPVView);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
52  vtkSetMacro(Identifier, vtkTypeUInt32);
53  vtkGetMacro(Identifier, vtkTypeUInt32);
55 
60  void StillRender() override { this->StreamToClient(); }
61 
67  void InteractiveRender() override { this->StreamToClient(); }
68 
72  void Update() override;
73 
75 
80  void SetShowExtractedSelection(bool);
81  vtkBooleanMacro(ShowExtractedSelection, bool);
82  vtkGetMacro(ShowExtractedSelection, bool);
84 
86 
89  vtkSetMacro(GenerateCellConnectivity, bool);
90  vtkGetMacro(GenerateCellConnectivity, bool);
91  vtkBooleanMacro(GenerateCellConnectivity, bool);
93 
95 
99  vtkSetMacro(FieldAssociation, int);
100  vtkGetMacro(FieldAssociation, int);
102 
104 
108  void HideColumnByName(const char* columnName);
109  bool IsColumnHiddenByName(const char* columnName);
110  void ClearHiddenColumnsByName();
111 
112  void HideColumnByLabel(const char* columnLabel);
113  bool IsColumnHiddenByLabel(const std::string& columnLabel);
114  void ClearHiddenColumnsByLabel();
116 
121  virtual vtkIdType GetNumberOfColumns();
122 
127  virtual vtkIdType GetNumberOfRows();
128 
133  virtual const char* GetColumnName(vtkIdType index);
134 
136 
139  virtual bool IsColumnInternal(vtkIdType index);
140  virtual bool IsColumnInternal(const char* columnName);
142 
144 
153  virtual std::string GetColumnLabel(vtkIdType index);
154  virtual std::string GetColumnLabel(const char* columnName);
156 
161  vtkIdType GetColumnByName(const char* columnName);
162 
166  virtual bool GetColumnVisibility(vtkIdType index);
167 
169 
175  virtual vtkVariant GetValue(vtkIdType row, vtkIdType col);
176  virtual vtkVariant GetValueByName(vtkIdType row, const char* columnName);
178 
182  virtual bool IsRowSelected(vtkIdType row);
183 
187  virtual bool IsAvailable(vtkIdType row);
188 
192  virtual bool IsDataValid(vtkIdType row, vtkIdType col);
193 
194  //***************************************************************************
195  // Forwarded to vtkSortedTableStreamer.
200  void SetColumnNameToSort(const char*);
201  void SetColumnNameToSort() { this->SetColumnNameToSort(nullptr); }
202 
207  void SetInvertSortOrder(bool);
208 
213  void SetBlockSize(vtkIdType val);
214 
218  virtual bool Export(vtkCSVExporter* exporter);
219 
223  void ClearCache();
224  using Superclass::ClearCache;
225 
226  // INTERNAL METHOD. Don't call directly.
227  vtkTable* FetchBlockCallback(vtkIdType blockindex);
228 
229 protected:
231  ~vtkSpreadSheetView() override;
232 
239  int StreamToClient();
240 
241  void OnRepresentationUpdated();
242 
243  virtual vtkTable* FetchBlock(vtkIdType blockindex);
244 
252 
253  unsigned long CRMICallbackTag;
254  unsigned long PRMICallbackTag;
255  vtkTypeUInt32 Identifier;
256 
257  enum
258  {
259  FETCH_BLOCK_TAG = 394732
260  };
261 
262 private:
263  vtkSpreadSheetView(const vtkSpreadSheetView&) = delete;
264  void operator=(const vtkSpreadSheetView&) = delete;
265 
266  class vtkInternals;
267  friend class vtkInternals;
268  vtkInternals* Internals;
269  bool SomethingUpdated;
270 
271  int FieldAssociation;
272 };
273 
274 #endif
vtkTypeUInt32 Identifier
return a sorted subset of the original table
void InteractiveRender() override
Triggers a interactive render.
Moves data from the server root node to the client.
static vtkView * New()
#define VTKREMOTINGVIEWS_EXPORT
vtkReductionFilter * ReductionFilter
vtkSpreadSheetView is a vtkPVView subclass for a view used to show any data as a spreadsheet.
void Update() override
Overridden to not call Update() directly on the input representations, instead use ProcessViewRequest...
int vtkIdType
vtkMarkSelectedRows * TableSelectionMarker
virtual void ClearCache(vtkPVDataRepresentation *)
Called by vtkPVDataRepresentation whenever vtkPVDataRepresentation::MarkModified is called...
baseclass for all ParaView views.
Definition: vtkPVView.h:44
ValueType GetValue(vtkIdType valueIdx) const
vtkClientServerMoveData * DeliveryFilter
vtkSortedTableStreamer * TableStreamer
unsigned long CRMICallbackTag
unsigned long PRMICallbackTag
mark rows that are selected as such.
exporter used by certain views to export data as CSV.
void PrintSelf(ostream &os, vtkIndent indent) override
void StillRender() override
Triggers a high-resolution render.
index
A generic filter that can reduce any type of dataset using any reduction algorithm.