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 
40 class VTKREMOTINGVIEWS_EXPORT vtkSpreadSheetView : public vtkPVView
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 
160  virtual bool GetColumnVisibility(vtkIdType index);
161 
163 
169  virtual vtkVariant GetValue(vtkIdType row, vtkIdType col);
170  virtual vtkVariant GetValueByName(vtkIdType row, const char* columnName);
172 
176  virtual bool IsRowSelected(vtkIdType row);
177 
181  virtual bool IsAvailable(vtkIdType row);
182 
186  virtual bool IsDataValid(vtkIdType row, vtkIdType col);
187 
188  //***************************************************************************
189  // Forwarded to vtkSortedTableStreamer.
194  void SetColumnNameToSort(const char*);
195  void SetColumnNameToSort() { this->SetColumnNameToSort(NULL); }
196 
201  void SetInvertSortOrder(bool);
202 
207  void SetBlockSize(vtkIdType val);
208 
212  virtual bool Export(vtkCSVExporter* exporter);
213 
217  void ClearCache();
218  using Superclass::ClearCache;
219 
220  // INTERNAL METHOD. Don't call directly.
221  vtkTable* FetchBlockCallback(vtkIdType blockindex);
222 
223 protected:
225  ~vtkSpreadSheetView() override;
226 
233  int StreamToClient();
234 
235  void OnRepresentationUpdated();
236 
237  virtual vtkTable* FetchBlock(vtkIdType blockindex);
238 
246 
247  unsigned long CRMICallbackTag;
248  unsigned long PRMICallbackTag;
249  vtkTypeUInt32 Identifier;
250 
251  enum
252  {
253  FETCH_BLOCK_TAG = 394732
254  };
255 
256 private:
257  vtkSpreadSheetView(const vtkSpreadSheetView&) = delete;
258  void operator=(const vtkSpreadSheetView&) = delete;
259 
260  class vtkInternals;
261  friend class vtkInternals;
262  vtkInternals* Internals;
263  bool SomethingUpdated;
264 
265  int FieldAssociation;
266 };
267 
268 #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()
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
vtkMarkSelectedRows is used by vtkSpreadSheetView to marks rows from the vtkTable generated by vtkSor...
exporter used by certain views to export data as a CSV file.
void PrintSelf(ostream &os, vtkIndent indent) override
void StillRender() override
Triggers a high-resolution render.
A generic filter that can reduce any type of dataset using any reduction algorithm.