VTK
|
combine some of the rows of a table More...
#include <vtkReduceTable.h>
combine some of the rows of a table
Collapses the rows of the input table so that one particular column (the IndexColumn) does not contain any duplicate values. Thus the output table will have the same columns as the input table, but potentially fewer rows. One example use of this class would be to generate a summary table from a table of observations. When two or more rows of the input table share a value in the IndexColumn, the values from these rows will be combined on a column-by-column basis. By default, such numerical values will be reduced to their mean, and non-numerical values will be reduced to their mode. This default behavior can be changed by calling SetNumericalReductionMethod() or SetNonNumericalReductionMethod(). You can also specify the reduction method to use for a particular column by calling SetReductionMethodForColumn().
Definition at line 50 of file vtkReduceTable.h.
Reimplemented from vtkTableAlgorithm.
Definition at line 54 of file vtkReduceTable.h.
anonymous enum |
Enum for methods of reduction
Definition at line 90 of file vtkReduceTable.h.
vtkReduceTable::vtkReduceTable | ( | ) | [protected] |
vtkReduceTable::~vtkReduceTable | ( | ) | [protected] |
static vtkReduceTable* vtkReduceTable::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkTableAlgorithm.
static int vtkReduceTable::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkTableAlgorithm.
virtual int vtkReduceTable::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkTableAlgorithm.
static vtkReduceTable* vtkReduceTable::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkTableAlgorithm.
virtual vtkObjectBase* vtkReduceTable::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkTableAlgorithm.
vtkReduceTable* vtkReduceTable::NewInstance | ( | ) | const |
Reimplemented from vtkTableAlgorithm.
void vtkReduceTable::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkTableAlgorithm.
virtual vtkIdType vtkReduceTable::GetIndexColumn | ( | ) | [virtual] |
Get/Set the column that will be used to reduce the input table. Any rows sharing a value in this column will be collapsed into a single row in the output table.
virtual void vtkReduceTable::SetIndexColumn | ( | vtkIdType | ) | [virtual] |
Get/Set the column that will be used to reduce the input table. Any rows sharing a value in this column will be collapsed into a single row in the output table.
virtual int vtkReduceTable::GetNumericalReductionMethod | ( | ) | [virtual] |
Get/Set the method that should be used to combine numerical values.
virtual void vtkReduceTable::SetNumericalReductionMethod | ( | int | ) | [virtual] |
Get/Set the method that should be used to combine numerical values.
virtual int vtkReduceTable::GetNonNumericalReductionMethod | ( | ) | [virtual] |
Get/Set the method that should be used to combine non-numerical values.
virtual void vtkReduceTable::SetNonNumericalReductionMethod | ( | int | ) | [virtual] |
Get/Set the method that should be used to combine non-numerical values.
Get the method that should be used to combine the values within the specified column. Returns -1 if no method has been set for this particular column.
void vtkReduceTable::SetReductionMethodForColumn | ( | vtkIdType | col, |
int | method | ||
) |
Set the method that should be used to combine the values within the specified column.
int vtkReduceTable::RequestData | ( | vtkInformation * | request, |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkTableAlgorithm.
void vtkReduceTable::InitializeOutputTable | ( | vtkTable * | input, |
vtkTable * | output | ||
) | [protected] |
Initialize the output table to have the same types of columns as the input table, but no rows.
void vtkReduceTable::AccumulateIndexValues | ( | vtkTable * | input | ) | [protected] |
Find the distinct values in the input table's index column. This function also populates the mapping of new row IDs to old row IDs.
void vtkReduceTable::PopulateIndexColumn | ( | vtkTable * | output | ) | [protected] |
Populate the index column of the output table.
void vtkReduceTable::PopulateDataColumn | ( | vtkTable * | input, |
vtkTable * | output, | ||
vtkIdType | col | ||
) | [protected] |
Populate a non-index column of the output table. This involves potentially combining multiple values from the input table into a single value for the output table.
void vtkReduceTable::ReduceValuesToMean | ( | vtkTable * | input, |
vtkTable * | output, | ||
vtkIdType | row, | ||
vtkIdType | col, | ||
std::vector< vtkIdType > | oldRows | ||
) | [protected] |
Find the mean of a series of values from the input table and store it in the output table.
void vtkReduceTable::ReduceValuesToMedian | ( | vtkTable * | input, |
vtkTable * | output, | ||
vtkIdType | row, | ||
vtkIdType | col, | ||
std::vector< vtkIdType > | oldRows | ||
) | [protected] |
Find the median of a series of values from the input table and store it in the output table.
void vtkReduceTable::ReduceValuesToMode | ( | vtkTable * | input, |
vtkTable * | output, | ||
vtkIdType | row, | ||
vtkIdType | col, | ||
std::vector< vtkIdType > | oldRows | ||
) | [protected] |
Find the mode of a series of values from the input table and store it in the output table.
vtkIdType vtkReduceTable::IndexColumn [protected] |
Definition at line 148 of file vtkReduceTable.h.
std::set<vtkVariant> vtkReduceTable::IndexValues [protected] |
Definition at line 149 of file vtkReduceTable.h.
std::map<vtkVariant, std::vector<vtkIdType> > vtkReduceTable::NewRowToOldRowsMap [protected] |
Definition at line 150 of file vtkReduceTable.h.
std::map<vtkIdType, int> vtkReduceTable::ColumnReductionMethods [protected] |
Definition at line 151 of file vtkReduceTable.h.
int vtkReduceTable::NumericalReductionMethod [protected] |
Definition at line 153 of file vtkReduceTable.h.
int vtkReduceTable::NonNumericalReductionMethod [protected] |
Definition at line 154 of file vtkReduceTable.h.