vtkSortedTableStreamer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSortedTableStreamer.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 =========================================================================*/
25 #ifndef vtkSortedTableStreamer_h
26 #define vtkSortedTableStreamer_h
27 
28 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" // needed for export macro
29 #include "vtkSmartPointer.h" // for vtkSmartPointer
30 #include "vtkTableAlgorithm.h"
31 #include <utility> // for std::pair
32 
34 class vtkDataArray;
36 class vtkStringArray;
37 class vtkTable;
39 class vtkIdTypeArray;
40 
42 {
43 private:
44  class InternalsBase;
45  template <class T>
46  class Internals;
47  InternalsBase* Internal;
48 
49 public:
50  static void PrintInfo(vtkTable* input);
52 
56  static bool TestInternalClasses();
57  static vtkSortedTableStreamer* New();
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
65  int FillInputPortInformation(int port, vtkInformation* info) override;
66 
68 
71  vtkGetMacro(Block, vtkIdType);
72  vtkSetMacro(Block, vtkIdType);
74 
76 
79  vtkGetMacro(BlockSize, vtkIdType);
80  vtkSetMacro(BlockSize, vtkIdType);
82 
84 
87  vtkGetMacro(SelectedComponent, int);
88  vtkSetMacro(SelectedComponent, int);
90 
92 
95  void SetController(vtkMultiProcessController*);
96  vtkGetObjectMacro(Controller, vtkMultiProcessController);
98 
102  const char* GetColumnNameToSort();
103 
104  // Update column to sort has well as invalidating the pre-processing
105  void SetColumnNameToSort(const char* columnName);
106 
107  // Choose if the sorting order should be inverted or not
108  void SetInvertOrder(int newValue);
109  vtkGetMacro(InvertOrder, int);
110 
111 protected:
113  ~vtkSortedTableStreamer() override;
114 
116 
117  void CreateInternalIfNeeded(vtkTable* input, vtkDataArray* data);
118  vtkDataArray* GetDataArrayToProcess(vtkTable* input);
119 
121 
124  vtkGetStringMacro(ColumnToSort);
125  vtkSetStringMacro(ColumnToSort);
127 
131 
135 
136 private:
138  void operator=(const vtkSortedTableStreamer&) = delete;
139 
141  vtkSmartPointer<vtkUnsignedIntArray> GenerateCompositeIndexArray(
142  vtkCompositeDataSet* cd, vtkIdType maxSize);
143  std::pair<vtkSmartPointer<vtkStringArray>, vtkSmartPointer<vtkIdTypeArray> >
144  GenerateBlockNameArray(vtkCompositeDataSet* cd, vtkIdType maxSize);
145 };
146 
147 #endif
return a sorted subset of the original table
static vtkTableAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
int vtkIdType
vtkMultiProcessController * Controller
#define VTKPVVTKEXTENSIONSFILTERSRENDERING_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void operator=(const vtkObjectBase &)