vtkSortedTableStreamer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkSortedTableStreamer_h
15 #define vtkSortedTableStreamer_h
16 
17 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" // needed for export macro
18 #include "vtkSmartPointer.h" // for vtkSmartPointer
19 #include "vtkTableAlgorithm.h"
20 #include <utility> // for std::pair
21 
22 class vtkDataArray;
23 class vtkIdTypeArray;
25 class vtkPartitionedDataSet;
26 class vtkStringArray;
27 class vtkTable;
29 
31 {
32 private:
33  class InternalsBase;
34  template <class T>
35  class Internals;
36  InternalsBase* Internal;
37 
38 public:
39  static void PrintInfo(vtkTable* input);
41 
45  static bool TestInternalClasses();
46  static vtkSortedTableStreamer* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  int FillInputPortInformation(int port, vtkInformation* info) override;
55 
57 
60  vtkGetMacro(Block, vtkIdType);
61  vtkSetMacro(Block, vtkIdType);
63 
65 
68  vtkGetMacro(BlockSize, vtkIdType);
69  vtkSetMacro(BlockSize, vtkIdType);
71 
73 
76  vtkGetMacro(SelectedComponent, int);
77  vtkSetMacro(SelectedComponent, int);
79 
81 
85  vtkSetMacro(ShowFieldData, bool);
86  vtkGetMacro(ShowFieldData, bool);
87  vtkBooleanMacro(ShowFieldData, bool);
89 
91 
94  void SetController(vtkMultiProcessController*);
95  vtkGetObjectMacro(Controller, vtkMultiProcessController);
97 
101  const char* GetColumnNameToSort();
102 
103  // Update column to sort has well as invalidating the pre-processing
104  void SetColumnNameToSort(const char* columnName);
105 
106  // Choose if the sorting order should be inverted or not
107  void SetInvertOrder(int newValue);
108  vtkGetMacro(InvertOrder, int);
109 
110 protected:
112  ~vtkSortedTableStreamer() override;
113 
115 
116  void CreateInternalIfNeeded(vtkTable* input, vtkDataArray* data);
117  vtkDataArray* GetDataArrayToProcess(vtkTable* input);
118 
120 
123  vtkGetStringMacro(ColumnToSort);
124  vtkSetStringMacro(ColumnToSort);
126 
130 
132  bool ShowFieldData = false;
135 
136 private:
138  void operator=(const vtkSortedTableStreamer&) = delete;
139 
140  vtkSmartPointer<vtkTable> MergeBlocks(vtkPartitionedDataSet* cd);
141 
145  void PopulateFieldDataArrays(vtkPartitionedDataSet* ptd, vtkSmartPointer<vtkTable> outTable);
146 
147  vtkSmartPointer<vtkUnsignedIntArray> GenerateCompositeIndexArray(
148  vtkPartitionedDataSet* cd, vtkIdType maxSize);
149  vtkSmartPointer<vtkStringArray> GenerateBlockNameArray(vtkPartitionedDataSet* cd);
150  vtkSmartPointer<vtkIdTypeArray> GenerateBlockIndicesArray(
151  vtkPartitionedDataSet* cd, vtkStringArray* blockNames, vtkIdType maxSize);
152 };
153 
154 #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 &)