VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkReduceTable Class Reference

combine some of the rows of a table More...

#include <vtkReduceTable.h>

Inheritance diagram for vtkReduceTable:
Inheritance graph
[legend]
Collaboration diagram for vtkReduceTable:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkTableAlgorithm Superclass
enum  { MEAN, MEDIAN, MODE }

Public Member Functions

virtual int IsA (const char *type)
vtkReduceTableNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
int GetReductionMethodForColumn (vtkIdType col)
void SetReductionMethodForColumn (vtkIdType col, int method)
virtual vtkIdType GetIndexColumn ()
virtual void SetIndexColumn (vtkIdType)
virtual int GetNumericalReductionMethod ()
virtual void SetNumericalReductionMethod (int)
virtual int GetNonNumericalReductionMethod ()
virtual void SetNonNumericalReductionMethod (int)

Static Public Member Functions

static vtkReduceTableNew ()
static int IsTypeOf (const char *type)
static vtkReduceTableSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkReduceTable ()
 ~vtkReduceTable ()
int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void InitializeOutputTable (vtkTable *input, vtkTable *output)
void AccumulateIndexValues (vtkTable *input)
void PopulateIndexColumn (vtkTable *output)
void PopulateDataColumn (vtkTable *input, vtkTable *output, vtkIdType col)
void ReduceValuesToMean (vtkTable *input, vtkTable *output, vtkIdType row, vtkIdType col, std::vector< vtkIdType > oldRows)
void ReduceValuesToMedian (vtkTable *input, vtkTable *output, vtkIdType row, vtkIdType col, std::vector< vtkIdType > oldRows)
void ReduceValuesToMode (vtkTable *input, vtkTable *output, vtkIdType row, vtkIdType col, std::vector< vtkIdType > oldRows)

Protected Attributes

vtkIdType IndexColumn
std::set< vtkVariantIndexValues
std::map< vtkVariant,
std::vector< vtkIdType > > 
NewRowToOldRowsMap
std::map< vtkIdType, intColumnReductionMethods
int NumericalReductionMethod
int NonNumericalReductionMethod

Detailed Description

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().

Tests:
vtkReduceTable (Tests)

Definition at line 50 of file vtkReduceTable.h.


Member Typedef Documentation

Reimplemented from vtkTableAlgorithm.

Definition at line 54 of file vtkReduceTable.h.


Member Enumeration Documentation

anonymous enum

Enum for methods of reduction

Enumerator:
MEAN 
MEDIAN 
MODE 

Definition at line 90 of file vtkReduceTable.h.


Constructor & Destructor Documentation


Member Function Documentation

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.

Reimplemented from vtkTableAlgorithm.

virtual vtkObjectBase* vtkReduceTable::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkTableAlgorithm.

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.

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.

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.

Get/Set the method that should be used to combine non-numerical values.

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.

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.


Member Data Documentation

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.

Definition at line 151 of file vtkReduceTable.h.

Definition at line 153 of file vtkReduceTable.h.

Definition at line 154 of file vtkReduceTable.h.


The documentation for this class was generated from the following file: