VTK  9.1.0
vtkReduceTable.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkReduceTable.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=========================================================================*/
36#ifndef vtkReduceTable_h
37#define vtkReduceTable_h
38
39#include "vtkInfovisCoreModule.h" // For export macro
40#include "vtkTableAlgorithm.h"
41
42#include <map> // For ivar
43#include <set> // For ivar
44#include <vector> // For ivar
45
46class vtkVariant;
47
48class VTKINFOVISCORE_EXPORT vtkReduceTable : public vtkTableAlgorithm
49{
50public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56
61 vtkGetMacro(IndexColumn, vtkIdType);
62 vtkSetMacro(IndexColumn, vtkIdType);
64
66
70 vtkGetMacro(NumericalReductionMethod, int);
71 vtkSetMacro(NumericalReductionMethod, int);
73
75
79 vtkGetMacro(NonNumericalReductionMethod, int);
80 vtkSetMacro(NonNumericalReductionMethod, int);
82
89
95
99 enum
100 {
103 MODE
104 };
105
106protected:
108 ~vtkReduceTable() override;
109
111
117
123
128
134 void PopulateDataColumn(vtkTable* input, vtkTable* output, vtkIdType col);
135
141 std::vector<vtkIdType> oldRows);
142
148 std::vector<vtkIdType> oldRows);
149
155 std::vector<vtkIdType> oldRows);
156
158 std::set<vtkVariant> IndexValues;
159 std::map<vtkVariant, std::vector<vtkIdType>> NewRowToOldRowsMap;
160 std::map<vtkIdType, int> ColumnReductionMethods;
161
164
165private:
166 vtkReduceTable(const vtkReduceTable&) = delete;
167 void operator=(const vtkReduceTable&) = delete;
168};
169
170#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
combine some of the rows of a table
int GetReductionMethodForColumn(vtkIdType col)
Get the method that should be used to combine the values within the specified column.
std::map< vtkIdType, int > ColumnReductionMethods
int NumericalReductionMethod
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int NonNumericalReductionMethod
std::map< vtkVariant, std::vector< vtkIdType > > NewRowToOldRowsMap
void AccumulateIndexValues(vtkTable *input)
Find the distinct values in the input table's index column.
void SetReductionMethodForColumn(vtkIdType col, int method)
Set the method that should be used to combine the values within the specified column.
void ReduceValuesToMedian(vtkTable *input, vtkTable *output, vtkIdType row, vtkIdType col, std::vector< vtkIdType > oldRows)
Find the median of a series of values from the input table and store it in the output table.
~vtkReduceTable() override
static vtkReduceTable * New()
void ReduceValuesToMean(vtkTable *input, vtkTable *output, vtkIdType row, vtkIdType col, std::vector< vtkIdType > oldRows)
Find the mean of a series of values from the input table and store it in the output table.
void ReduceValuesToMode(vtkTable *input, vtkTable *output, vtkIdType row, vtkIdType col, std::vector< vtkIdType > oldRows)
Find the mode of a series of values from the input table and store it in the output table.
std::set< vtkVariant > IndexValues
void PopulateDataColumn(vtkTable *input, vtkTable *output, vtkIdType col)
Populate a non-index column of the output table.
vtkIdType IndexColumn
void PopulateIndexColumn(vtkTable *output)
Populate the index column of the output table.
void InitializeOutputTable(vtkTable *input, vtkTable *output)
Initialize the output table to have the same types of columns as the input table, but no rows.
Superclass for algorithms that produce only vtkTables as output.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
A atomic type representing the union of many types.
Definition: vtkVariant.h:145
int vtkIdType
Definition: vtkType.h:332