VTK
|
perform mathematical operations on data in field data arrays More...
#include <vtkArrayCalculator.h>
Public Types | |
typedef vtkDataSetAlgorithm | Superclass |
![]() | |
typedef vtkAlgorithm | Superclass |
![]() | |
typedef vtkObject | Superclass |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | RemoveAllVariables () |
virtual void | RemoveScalarVariables () |
virtual void | RemoveVectorVariables () |
virtual void | RemoveCoordinateScalarVariables () |
virtual void | RemoveCoordinateVectorVariables () |
virtual 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 | GetResultArrayType () |
virtual void | SetResultArrayType (int) |
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 () |
![]() | |
vtkDataObject * | GetInput () |
vtkPolyData * | GetPolyDataOutput () |
vtkStructuredPoints * | GetStructuredPointsOutput () |
vtkImageData * | GetImageDataOutput () |
vtkStructuredGrid * | GetStructuredGridOutput () |
vtkUnstructuredGrid * | GetUnstructuredGridOutput () |
vtkRectilinearGrid * | GetRectilinearGridOutput () |
vtkDataSet * | GetOutput () |
vtkDataSet * | GetOutput (int) |
void | SetInput (vtkDataObject *) |
void | SetInput (int, vtkDataObject *) |
void | SetInput (vtkDataSet *) |
void | SetInput (int, vtkDataSet *) |
void | AddInput (vtkDataObject *) |
void | AddInput (vtkDataSet *) |
void | AddInput (int, vtkDataSet *) |
void | AddInput (int, vtkDataObject *) |
virtual int | ProcessRequest (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) |
![]() | |
int | HasExecutive () |
vtkExecutive * | GetExecutive () |
virtual void | SetExecutive (vtkExecutive *executive) |
virtual int | ModifyRequest (vtkInformation *request, int when) |
vtkInformation * | GetInputPortInformation (int port) |
vtkInformation * | GetOutputPortInformation (int port) |
int | GetNumberOfInputPorts () |
int | GetNumberOfOutputPorts () |
void | UpdateProgress (double amount) |
vtkInformation * | GetInputArrayInformation (int idx) |
void | RemoveAllInputs () |
vtkDataObject * | GetOutputDataObject (int port) |
virtual void | RemoveInputConnection (int port, vtkAlgorithmOutput *input) |
int | GetNumberOfInputConnections (int port) |
int | GetTotalNumberOfInputConnections () |
vtkAlgorithmOutput * | GetInputConnection (int port, int index) |
virtual void | Update () |
virtual void | UpdateInformation () |
virtual void | UpdateWholeExtent () |
void | ConvertTotalInputToPortConnection (int ind, int &port, int &conn) |
virtual double | ComputePriority () |
int | ProcessRequest (vtkInformation *request, vtkCollection *inInfo, vtkInformationVector *outInfo) |
virtual int | ComputePipelineMTime (vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime) |
virtual vtkInformation * | GetInformation () |
virtual void | SetInformation (vtkInformation *) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
virtual void | SetAbortExecute (int) |
virtual int | GetAbortExecute () |
virtual void | AbortExecuteOn () |
virtual void | AbortExecuteOff () |
virtual void | SetProgress (double) |
virtual double | GetProgress () |
void | SetProgressText (const char *ptext) |
virtual char * | GetProgressText () |
virtual unsigned long | GetErrorCode () |
virtual void | SetInputArrayToProcess (int idx, int port, int connection, int fieldAssociation, const char *name) |
virtual void | SetInputArrayToProcess (int idx, int port, int connection, int fieldAssociation, int fieldAttributeType) |
virtual void | SetInputArrayToProcess (int idx, vtkInformation *info) |
virtual void | SetInputArrayToProcess (int idx, int port, int connection, const char *fieldAssociation, const char *attributeTypeorName) |
vtkDataObject * | GetInputDataObject (int port, int connection) |
virtual void | SetInputConnection (int port, vtkAlgorithmOutput *input) |
virtual void | SetInputConnection (vtkAlgorithmOutput *input) |
virtual void | AddInputConnection (int port, vtkAlgorithmOutput *input) |
virtual void | AddInputConnection (vtkAlgorithmOutput *input) |
vtkAlgorithmOutput * | GetOutputPort (int index) |
vtkAlgorithmOutput * | GetOutputPort () |
virtual void | SetReleaseDataFlag (int) |
virtual int | GetReleaseDataFlag () |
void | ReleaseDataFlagOn () |
void | ReleaseDataFlagOff () |
int | UpdateExtentIsEmpty (vtkDataObject *output) |
int | UpdateExtentIsEmpty (vtkInformation *pinfo, int extentType) |
![]() | |
virtual void | DebugOn () |
virtual void | DebugOff () |
unsigned char | GetDebug () |
void | SetDebug (unsigned char debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &os) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkArrayCalculator * | SafeDownCast (vtkObject *o) |
static vtkArrayCalculator * | New () |
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 |
int | ReplaceInvalidValues |
double | ReplacementValue |
int | CoordinateResults |
char ** | CoordinateScalarVariableNames |
char ** | CoordinateVectorVariableNames |
int * | SelectedCoordinateScalarComponents |
int ** | SelectedCoordinateVectorComponents |
int | NumberOfCoordinateScalarArrays |
int | NumberOfCoordinateVectorArrays |
int | ResultArrayType |
Additional Inherited Members | |
![]() | |
int | AbortExecute |
![]() | |
static vtkInformationIntegerKey * | PORT_REQUIREMENTS_FILLED () |
![]() | |
static vtkExecutive * | DefaultExecutivePrototype |
![]() |
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: + - * / ^ . build unit vectors: iHat, jHat, kHat (ie (1,0,0), (0,1,0), (0,0,1)) 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.
Definition at line 79 of file vtkArrayCalculator.h.
Definition at line 82 of file vtkArrayCalculator.h.
|
protected |
|
protected |
|
virtual |
Reimplemented from vtkDataSetAlgorithm.
|
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 vtkDataSetAlgorithm.
|
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 vtkDataSetAlgorithm.
|
static |
Reimplemented from vtkDataSetAlgorithm.
|
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 |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkDataSetAlgorithm.
|
virtual |
Set/Get the function to be evaluated.
|
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 |
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 |
Type of the result array. It is ignored if CoordinateResults is true. Initial value is VTK_DOUBLE.
|
virtual |
Type of the result array. It is ignored if CoordinateResults is true. Initial value is VTK_DOUBLE.
|
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 |
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 |
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 |
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 |
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 |
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).
|
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 160 of file vtkArrayCalculator.h.
|
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 162 of file vtkArrayCalculator.h.
|
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 164 of file vtkArrayCalculator.h.
|
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 166 of file vtkArrayCalculator.h.
|
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 168 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.
|
virtual |
Remove all the scalar variable names and their associated array names.
|
virtual |
Remove all the scalar variable names and their associated array names.
|
virtual |
Remove all the coordinate variables.
|
virtual |
Remove all the coordinate variables.
|
inline |
Methods to get information about the current variables.
Definition at line 192 of file vtkArrayCalculator.h.
char* vtkArrayCalculator::GetScalarArrayName | ( | int | i | ) |
Methods to get information about the current variables.
|
inline |
Methods to get information about the current variables.
Definition at line 194 of file vtkArrayCalculator.h.
char* vtkArrayCalculator::GetVectorArrayName | ( | int | i | ) |
Methods to get information about the current variables.
|
inline |
Methods to get information about the current variables.
Definition at line 196 of file vtkArrayCalculator.h.
char* vtkArrayCalculator::GetScalarVariableName | ( | int | i | ) |
Methods to get information about the current variables.
|
inline |
Methods to get information about the current variables.
Definition at line 198 of file vtkArrayCalculator.h.
char* vtkArrayCalculator::GetVectorVariableName | ( | int | i | ) |
Methods to get information about the current variables.
|
inline |
Methods to get information about the current variables.
Definition at line 200 of file vtkArrayCalculator.h.
int vtkArrayCalculator::GetSelectedScalarComponent | ( | int | i | ) |
Methods to get information about the current variables.
|
inline |
Methods to get information about the current variables.
Definition at line 202 of file vtkArrayCalculator.h.
int* vtkArrayCalculator::GetSelectedVectorComponents | ( | int | i | ) |
Methods to get information about the current variables.
|
virtual |
Methods to get information about the current variables.
|
virtual |
Methods to get information about the current variables.
|
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 |
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 |
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 |
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 |
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 |
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
|
protectedvirtual |
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.
|
protected |
Definition at line 226 of file vtkArrayCalculator.h.
|
protected |
Definition at line 227 of file vtkArrayCalculator.h.
|
protected |
Definition at line 228 of file vtkArrayCalculator.h.
|
protected |
Definition at line 229 of file vtkArrayCalculator.h.
|
protected |
Definition at line 230 of file vtkArrayCalculator.h.
|
protected |
Definition at line 231 of file vtkArrayCalculator.h.
|
protected |
Definition at line 232 of file vtkArrayCalculator.h.
|
protected |
Definition at line 233 of file vtkArrayCalculator.h.
|
protected |
Definition at line 234 of file vtkArrayCalculator.h.
|
protected |
Definition at line 235 of file vtkArrayCalculator.h.
|
protected |
Definition at line 236 of file vtkArrayCalculator.h.
|
protected |
Definition at line 237 of file vtkArrayCalculator.h.
|
protected |
Definition at line 239 of file vtkArrayCalculator.h.
|
protected |
Definition at line 240 of file vtkArrayCalculator.h.
|
protected |
Definition at line 242 of file vtkArrayCalculator.h.
|
protected |
Definition at line 243 of file vtkArrayCalculator.h.
|
protected |
Definition at line 244 of file vtkArrayCalculator.h.
|
protected |
Definition at line 245 of file vtkArrayCalculator.h.
|
protected |
Definition at line 246 of file vtkArrayCalculator.h.
|
protected |
Definition at line 247 of file vtkArrayCalculator.h.
|
protected |
Definition at line 248 of file vtkArrayCalculator.h.
|
protected |
Definition at line 250 of file vtkArrayCalculator.h.