vtkArrayCalculator Class Reference

#include <vtkArrayCalculator.h>

Inheritance diagram for vtkArrayCalculator:

Inheritance graph
[legend]
Collaboration diagram for vtkArrayCalculator:

Collaboration graph
[legend]

List of all members.


Detailed Description

perform mathematical operations on data in field data arrays

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.

The functions that this array calculator understands is:

 standard operations: + - * / ^ .
 access vector components: iHat, jHat, kHat
 abs
 acos
 asin
 atan
 ceil
 cos
 cosh
 exp
 floor
 log
 mag
 min
 max
 norm
 sign
 sin
 sinh
 sqrt
 tan
 tanh
 
Note that some of these operations work on scalars, some on vectors, and some on both (e.g., you can multiply a scalar times a vector). The operations are performed tuple-wise (i.e., tuple-by-tuple). The user must specify which arrays to use as vectors and/or scalars, and the name of the output data array.

See also:
vtkFunctionParser
Examples:
vtkArrayCalculator (Examples)
Tests:
vtkArrayCalculator (Tests)

Definition at line 79 of file vtkArrayCalculator.h.


Public Types

typedef vtkDataSetAlgorithm Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void RemoveAllVariables ()
void RemoveScalarVariables ()
void RemoveVectorVariables ()
void RemoveCoordinateScalarVariables ()
void RemoveCoordinateVectorVariables ()
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 AddCoordinateScalarVariable (const char *variableName, int component=0)
void AddCoordinateVectorVariable (const char *variableName, int component0=0, int component1=1, int component2=2)
void SetResultArrayName (const char *name)
virtual char * GetResultArrayName ()
virtual int GetCoordinateResults ()
virtual void SetCoordinateResults (int)
virtual void CoordinateResultsOn ()
virtual void CoordinateResultsOff ()
virtual void SetAttributeMode (int)
virtual int GetAttributeMode ()
void SetAttributeModeToDefault ()
void SetAttributeModeToUsePointData ()
void SetAttributeModeToUseCellData ()
void SetAttributeModeToUseVertexData ()
void SetAttributeModeToUseEdgeData ()
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 ()
virtual void SetReplaceInvalidValues (int)
virtual int GetReplaceInvalidValues ()
virtual void ReplaceInvalidValuesOn ()
virtual void ReplaceInvalidValuesOff ()
virtual void SetReplacementValue (double)
virtual double GetReplacementValue ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkArrayCalculatorSafeDownCast (vtkObject *o)
static vtkArrayCalculatorNew ()

Protected Member Functions

 vtkArrayCalculator ()
 ~vtkArrayCalculator ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)

Protected Attributes

char * Function
char * ResultArrayName
char ** ScalarArrayNames
char ** VectorArrayNames
char ** ScalarVariableNames
char ** VectorVariableNames
int NumberOfScalarArrays
int NumberOfVectorArrays
int AttributeMode
int * SelectedScalarComponents
int ** SelectedVectorComponents
vtkFunctionParserFunctionParser
int ReplaceInvalidValues
double ReplacementValue
int CoordinateResults
char ** CoordinateScalarVariableNames
char ** CoordinateVectorVariableNames
int * SelectedCoordinateScalarComponents
int ** SelectedCoordinateVectorComponents
int NumberOfCoordinateScalarArrays
int NumberOfCoordinateVectorArrays

Member Typedef Documentation

Reimplemented from vtkDataSetAlgorithm.

Definition at line 82 of file vtkArrayCalculator.h.


Constructor & Destructor Documentation

vtkArrayCalculator::vtkArrayCalculator (  )  [protected]

vtkArrayCalculator::~vtkArrayCalculator (  )  [protected]


Member Function Documentation

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

Reimplemented from vtkDataSetAlgorithm.

static int vtkArrayCalculator::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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkDataSetAlgorithm.

virtual int vtkArrayCalculator::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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkDataSetAlgorithm.

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

Reimplemented from vtkDataSetAlgorithm.

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 vtkDataSetAlgorithm.

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

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

Reimplemented from vtkDataSetAlgorithm.

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::AddCoordinateScalarVariable ( const char *  variableName,
int  component = 0 
)

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

void vtkArrayCalculator::AddCoordinateVectorVariable ( const char *  variableName,
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 int vtkArrayCalculator::GetCoordinateResults (  )  [virtual]

Set whether to output results as coordinates. ResultArrayName will be ignored. Outputing as coordinates is only valid with vector results and if the AttributeMode is AttributeModeToUsePointData. If a valid output can't be made, an error will occur.

virtual void vtkArrayCalculator::SetCoordinateResults ( int   )  [virtual]

Set whether to output results as coordinates. ResultArrayName will be ignored. Outputing as coordinates is only valid with vector results and if the AttributeMode is AttributeModeToUsePointData. If a valid output can't be made, an error will occur.

virtual void vtkArrayCalculator::CoordinateResultsOn (  )  [virtual]

Set whether to output results as coordinates. ResultArrayName will be ignored. Outputing as coordinates is only valid with vector results and if the AttributeMode is AttributeModeToUsePointData. If a valid output can't be made, an error will occur.

virtual void vtkArrayCalculator::CoordinateResultsOff (  )  [virtual]

Set whether to output results as coordinates. ResultArrayName will be ignored. Outputing as coordinates is only valid with vector results and if the AttributeMode is AttributeModeToUsePointData. If a valid output can't be made, an error will occur.

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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

Definition at line 153 of file vtkArrayCalculator.h.

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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

Definition at line 155 of file vtkArrayCalculator.h.

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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

Definition at line 157 of file vtkArrayCalculator.h.

void vtkArrayCalculator::SetAttributeModeToUseVertexData (  )  [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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

Definition at line 159 of file vtkArrayCalculator.h.

void vtkArrayCalculator::SetAttributeModeToUseEdgeData (  )  [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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

Definition at line 161 of file vtkArrayCalculator.h.

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). For graphs you can set the filter to use vertex data (AttributeModeToUseVertexData) or edge data (AttributeModeToUseEdgeData).

void vtkArrayCalculator::RemoveAllVariables (  ) 

Remove all the variable names and their associated array names.

void vtkArrayCalculator::RemoveScalarVariables (  ) 

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

void vtkArrayCalculator::RemoveVectorVariables (  ) 

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

void vtkArrayCalculator::RemoveCoordinateScalarVariables (  ) 

Remove all the coordinate variables.

void vtkArrayCalculator::RemoveCoordinateVectorVariables (  ) 

Remove all the coordinate variables.

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

Methods to get information about the current variables.

Definition at line 185 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 187 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 189 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 191 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 193 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 195 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.

virtual void vtkArrayCalculator::SetReplaceInvalidValues ( int   )  [virtual]

When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. Otherwise an error will be reported

virtual int vtkArrayCalculator::GetReplaceInvalidValues (  )  [virtual]

When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. Otherwise an error will be reported

virtual void vtkArrayCalculator::ReplaceInvalidValuesOn (  )  [virtual]

When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. Otherwise an error will be reported

virtual void vtkArrayCalculator::ReplaceInvalidValuesOff (  )  [virtual]

When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. Otherwise an error will be reported

virtual void vtkArrayCalculator::SetReplacementValue ( double   )  [virtual]

When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. Otherwise an error will be reported

virtual double vtkArrayCalculator::GetReplacementValue (  )  [virtual]

When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. Otherwise an error will be reported

virtual int vtkArrayCalculator::RequestData ( vtkInformation ,
vtkInformationVector **  ,
vtkInformationVector  
) [protected, virtual]

This is called within ProcessRequest when a request asks the algorithm to do its work. This is the method you should override to do whatever the algorithm is designed to do. This happens during the fourth pass in the pipeline execution process.

Reimplemented from vtkDataSetAlgorithm.


Member Data Documentation

char* vtkArrayCalculator::Function [protected]

Definition at line 219 of file vtkArrayCalculator.h.

Definition at line 220 of file vtkArrayCalculator.h.

Definition at line 221 of file vtkArrayCalculator.h.

Definition at line 222 of file vtkArrayCalculator.h.

Definition at line 223 of file vtkArrayCalculator.h.

Definition at line 224 of file vtkArrayCalculator.h.

Definition at line 225 of file vtkArrayCalculator.h.

Definition at line 226 of file vtkArrayCalculator.h.

Definition at line 227 of file vtkArrayCalculator.h.

Definition at line 228 of file vtkArrayCalculator.h.

Definition at line 229 of file vtkArrayCalculator.h.

Definition at line 230 of file vtkArrayCalculator.h.

Definition at line 232 of file vtkArrayCalculator.h.

Definition at line 233 of file vtkArrayCalculator.h.

Definition at line 235 of file vtkArrayCalculator.h.

Definition at line 236 of file vtkArrayCalculator.h.

Definition at line 237 of file vtkArrayCalculator.h.

Definition at line 238 of file vtkArrayCalculator.h.

Definition at line 239 of file vtkArrayCalculator.h.

Definition at line 240 of file vtkArrayCalculator.h.

Definition at line 241 of file vtkArrayCalculator.h.


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

Generated on Sat Dec 27 13:16:58 2008 for VTK by  doxygen 1.5.6