Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# vtkArrayCalculator Class Reference

`#include <vtkArrayCalculator.h>`

Inheritance diagram for vtkArrayCalculator:

[legend]
Collaboration diagram for vtkArrayCalculator:

[legend]
List of all members.

## Detailed Description

perform mathematical operations on data in field data arrays

Date:
  2002/01/22 15:29:02

Revision:
  1.11

vtkArrayCalculator performs operations on vectors or scalars in field data arrays. It uses vtkFunctionParser to do the parsing and to evaluate the function for each entry in the input arrays. The arrays used in a given function must be all in point data or all in cell data. The resulting array will be stored as a field data array. The result array can either be stored in a new array or it can overwrite an existing array.

See also:
  vtkFunctionParser

Created by:
  - Henderson, Amy

CVS contributions (if > 5%):
  - Henderson, Amy (91%)

CVS logs (CVSweb):
  - .`cxx` (`/Graphics/vtkArrayCalculator.cxx)`
  - .`h` (`/Graphics/vtkArrayCalculator.h)`

Examples:
  vtkArrayCalculator (Examples)

Tests:
  vtkArrayCalculator (Tests)

Definition at line 60 of file vtkArrayCalculator.h.

## Public Types

typedef vtkDataSetToDataSetFilter | Superclass

## Public Methods

virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
void | RemoveAllVariables ()
void | SetFunction (const char *function)
virtual char * | GetFunction ()
void | AddScalarArrayName (const char *arrayName, int component=0)
void | AddVectorArrayName (const char *arrayName, int component0=0, int component1=1, int component2=2)
void | AddScalarVariable (const char *variableName, const char *arrayName, int component=0)
void | AddVectorVariable (const char *variableName, const char *arrayName, int component0=0, int component1=1, int component2=2)
void | SetResultArrayName (const char *name)
virtual char * | GetResultArrayName ()
virtual void | SetAttributeMode (int)
virtual int | GetAttributeMode ()
void | SetAttributeModeToDefault ()
void | SetAttributeModeToUsePointData ()
void | SetAttributeModeToUseCellData ()
const char * | GetAttributeModeAsString ()
char ** | GetScalarArrayNames ()
char * | GetScalarArrayName (int i)
char ** | GetVectorArrayNames ()
char * | GetVectorArrayName (int i)
char ** | GetScalarVariableNames ()
char * | GetScalarVariableName (int i)
char ** | GetVectorVariableNames ()
char * | GetVectorVariableName (int i)
int * | GetSelectedScalarComponents ()
int | GetSelectedScalarComponent (int i)
int ** | GetSelectedVectorComponents ()
int * | GetSelectedVectorComponents (int i)
virtual int | GetNumberOfScalarArrays ()
virtual int | GetNumberOfVectorArrays ()

## Static Public Methods

int | IsTypeOf (const char *type)
vtkArrayCalculator * | SafeDownCast (vtkObject *o)
vtkArrayCalculator * | New ()

## Protected Methods

| vtkArrayCalculator ()
| ~vtkArrayCalculator ()
void | Execute ()

## Protected Attributes

char * | Function
char * | ResultArrayName
char ** | ScalarArrayNames
char ** | VectorArrayNames
char ** | ScalarVariableNames
char ** | VectorVariableNames
int | NumberOfScalarArrays
int | NumberOfVectorArrays
int | AttributeMode
int * | SelectedScalarComponents
int ** | SelectedVectorComponents
vtkFunctionParser * | FunctionParser

## Member Typedef Documentation

typedef vtkDataSetToDataSetFilter vtkArrayCalculator::Superclass

| Reimplemented from vtkDataSetToDataSetFilter. Definition at line 63 of file vtkArrayCalculator.h.

## Constructor & Destructor Documentation

vtkArrayCalculator::vtkArrayCalculator | ( |  | ) | `[protected]`

vtkArrayCalculator::~vtkArrayCalculator | ( |  | ) | `[protected]`

## Member Function Documentation

virtual const char* vtkArrayCalculator::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkDataSetToDataSetFilter.

int vtkArrayCalculator::IsTypeOf | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkDataSetToDataSetFilter.

virtual int vtkArrayCalculator::IsA | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkDataSetToDataSetFilter.

vtkArrayCalculator* vtkArrayCalculator::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkDataSetToDataSetFilter.

void vtkArrayCalculator::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 vtkDataSetToDataSetFilter.

vtkArrayCalculator* vtkArrayCalculator::New | ( |  | ) | `[static]`

| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. Reimplemented from vtkObject.

void vtkArrayCalculator::SetFunction | ( | const char * | function | ) |

| Set/Get the function to be evaluated.

virtual char* vtkArrayCalculator::GetFunction | ( |  | ) | `[virtual]`

| Set/Get the function to be evaluated.

void vtkArrayCalculator::AddScalarArrayName | ( | const char * | arrayName,
|  | int | component = 0
| ) |

| Add an array name to the list of arrays used in the function and specify which components of the array to use in evaluating the function. The array name must match the name in the function. Use AddScalarVariable or AddVectorVariable to use a variable name different from the array name.

void vtkArrayCalculator::AddVectorArrayName | ( | const char * | arrayName,
|  | int | component0 = 0,
|  | int | component1 = 1,
|  | int | component2 = 2
| ) |

| Add an array name to the list of arrays used in the function and specify which components of the array to use in evaluating the function. The array name must match the name in the function. Use AddScalarVariable or AddVectorVariable to use a variable name different from the array name.

void vtkArrayCalculator::AddScalarVariable | ( | const char * | variableName,
|  | const char * | arrayName,
|  | int | component = 0
| ) |

| Add a variable name, a corresponding array name, and which components of the array to use.

void vtkArrayCalculator::AddVectorVariable | ( | const char * | variableName,
|  | const char * | arrayName,
|  | int | component0 = 0,
|  | int | component1 = 1,
|  | int | component2 = 2
| ) |

| Add a variable name, a corresponding array name, and which components of the array to use.

void vtkArrayCalculator::SetResultArrayName | ( | const char * | name | ) |

| Set the name of the array in which to store the result of evaluating this function. If this is the name of an existing array, that array will be overwritten. Otherwise a new array will be created with the specified name.

virtual char* vtkArrayCalculator::GetResultArrayName | ( |  | ) | `[virtual]`

| Set the name of the array in which to store the result of evaluating this function. If this is the name of an existing array, that array will be overwritten. Otherwise a new array will be created with the specified name.

virtual void vtkArrayCalculator::SetAttributeMode | ( | int |  | ) | `[virtual]`

| Control whether the filter operates on point data or cell data. By default (AttributeModeToDefault), the filter uses point data. Alternatively you can explicitly set the filter to use point data (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData).

virtual int vtkArrayCalculator::GetAttributeMode | ( |  | ) | `[virtual]`

| Control whether the filter operates on point data or cell data. By default (AttributeModeToDefault), the filter uses point data. Alternatively you can explicitly set the filter to use point data (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData).

void vtkArrayCalculator::SetAttributeModeToDefault | ( |  | ) | `[inline]`

| Control whether the filter operates on point data or cell data. By default (AttributeModeToDefault), the filter uses point data. Alternatively you can explicitly set the filter to use point data (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData). Definition at line 112 of file vtkArrayCalculator.h. References VTK_ATTRIBUTE_MODE_DEFAULT.

void vtkArrayCalculator::SetAttributeModeToUsePointData | ( |  | ) | `[inline]`

| Control whether the filter operates on point data or cell data. By default (AttributeModeToDefault), the filter uses point data. Alternatively you can explicitly set the filter to use point data (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData). Definition at line 114 of file vtkArrayCalculator.h. References VTK_ATTRIBUTE_MODE_USE_POINT_DATA.

void vtkArrayCalculator::SetAttributeModeToUseCellData | ( |  | ) | `[inline]`

| Control whether the filter operates on point data or cell data. By default (AttributeModeToDefault), the filter uses point data. Alternatively you can explicitly set the filter to use point data (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData). Definition at line 116 of file vtkArrayCalculator.h. References VTK_ATTRIBUTE_MODE_USE_CELL_DATA.

const char* vtkArrayCalculator::GetAttributeModeAsString | ( |  | ) |

| Control whether the filter operates on point data or cell data. By default (AttributeModeToDefault), the filter uses point data. Alternatively you can explicitly set the filter to use point data (AttributeModeToUsePointData) or cell data (AttributeModeToUseCellData).

void vtkArrayCalculator::RemoveAllVariables | ( |  | ) |

| Remove all the variable names and their associated array names.

char** vtkArrayCalculator::GetScalarArrayNames | ( |  | ) | `[inline]`

| Methods to get information about the current variables. Definition at line 126 of file vtkArrayCalculator.h.

char* vtkArrayCalculator::GetScalarArrayName | ( | int | i | ) |

| Methods to get information about the current variables.

char** vtkArrayCalculator::GetVectorArrayNames | ( |  | ) | `[inline]`

| Methods to get information about the current variables. Definition at line 128 of file vtkArrayCalculator.h.

char* vtkArrayCalculator::GetVectorArrayName | ( | int | i | ) |

| Methods to get information about the current variables.

char** vtkArrayCalculator::GetScalarVariableNames | ( |  | ) | `[inline]`

| Methods to get information about the current variables. Definition at line 130 of file vtkArrayCalculator.h.

char* vtkArrayCalculator::GetScalarVariableName | ( | int | i | ) |

| Methods to get information about the current variables.

char** vtkArrayCalculator::GetVectorVariableNames | ( |  | ) | `[inline]`

| Methods to get information about the current variables. Definition at line 132 of file vtkArrayCalculator.h.

char* vtkArrayCalculator::GetVectorVariableName | ( | int | i | ) |

| Methods to get information about the current variables.

int* vtkArrayCalculator::GetSelectedScalarComponents | ( |  | ) | `[inline]`

| Methods to get information about the current variables. Definition at line 134 of file vtkArrayCalculator.h.

int vtkArrayCalculator::GetSelectedScalarComponent | ( | int | i | ) |

| Methods to get information about the current variables.

int** vtkArrayCalculator::GetSelectedVectorComponents | ( |  | ) | `[inline]`

| Methods to get information about the current variables. Definition at line 136 of file vtkArrayCalculator.h.

int* vtkArrayCalculator::GetSelectedVectorComponents | ( | int | i | ) |

| Methods to get information about the current variables.

virtual int vtkArrayCalculator::GetNumberOfScalarArrays | ( |  | ) | `[virtual]`

| Methods to get information about the current variables.

virtual int vtkArrayCalculator::GetNumberOfVectorArrays | ( |  | ) | `[virtual]`

| Methods to get information about the current variables.

void vtkArrayCalculator::Execute | ( |  | ) | `[protected, virtual]`

| This method is the old style execute method Reimplemented from vtkSource.

## Member Data Documentation

char* vtkArrayCalculator::Function`[protected]`

| Definition at line 148 of file vtkArrayCalculator.h.

char* vtkArrayCalculator::ResultArrayName`[protected]`

| Definition at line 149 of file vtkArrayCalculator.h.

char** vtkArrayCalculator::ScalarArrayNames`[protected]`

| Definition at line 150 of file vtkArrayCalculator.h.

char** vtkArrayCalculator::VectorArrayNames`[protected]`

| Definition at line 151 of file vtkArrayCalculator.h.

char** vtkArrayCalculator::ScalarVariableNames`[protected]`

| Definition at line 152 of file vtkArrayCalculator.h.

char** vtkArrayCalculator::VectorVariableNames`[protected]`

| Definition at line 153 of file vtkArrayCalculator.h.

int vtkArrayCalculator::NumberOfScalarArrays`[protected]`

| Definition at line 154 of file vtkArrayCalculator.h.

int vtkArrayCalculator::NumberOfVectorArrays`[protected]`

| Definition at line 155 of file vtkArrayCalculator.h.

int vtkArrayCalculator::AttributeMode`[protected]`

| Definition at line 156 of file vtkArrayCalculator.h.

int* vtkArrayCalculator::SelectedScalarComponents`[protected]`

| Definition at line 157 of file vtkArrayCalculator.h.

int** vtkArrayCalculator::SelectedVectorComponents`[protected]`

| Definition at line 158 of file vtkArrayCalculator.h.

vtkFunctionParser* vtkArrayCalculator::FunctionParser`[protected]`

| Definition at line 159 of file vtkArrayCalculator.h.

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

- Graphics/vtkArrayCalculator.h