Skip to content

Calculator ​

Introduction ​

vtkCalculator - a filter that computes derived quantities from input arrays

vtkCalculator evaluates a formula over the arrays of its input dataset and stores the result in a new array of the shallow-copied output. The formula is an object whose getArrays() method declares the input and output arrays. Its evaluate() method fills the output arrays.

Methods ​

augmentInputArrays ​

Add the array specifiers that are implicitly available at the given location, on top of the ones the caller asked for. Point coordinates are appended when the field data is associated with points or graph vertices.

ArgumentTypeRequiredDescription
locnFieldDataTypesYes
arraysInArray[IArraySpec]Yes

createSimpleFormulaObject ​

Build a formula object that applies singleValueFormula tuple by tuple.

The formula is called with one argument per input array followed by the tuple index and a scratch output tuple. It must return a number when the output has a single component and a tuple otherwise.

ArgumentTypeRequiredDescription
locnFieldDataTypesYes
arrNamesArray[String]Yesnames of the input arrays
resultNameStringYesname of the array to create
singleValueFormulaYes
optionsISimpleFormulaOptionsNo(default: {})

extend ​

Method used to decorate a given object (publicAPI+model) with vtkCalculator characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesICalculatorInitialValuesNo(default: {})

getFormula ​

Get the formula currently applied by the filter.

newInstance ​

Method used to create a new instance of vtkCalculator

ArgumentTypeRequiredDescription
initialValuesICalculatorInitialValuesNofor pre-setting some of its content

prepareArrays ​

Fetch the input arrays and allocate the output arrays described by arraySpec. Entries are null where a specifier could not be resolved.

ArgumentTypeRequiredDescription
arraySpecIArraySpecsYes
inDataYes
outDataYes

requestData ​

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setFormula ​

Set the formula to apply.

ArgumentTypeRequiredDescription
formulaIFormulaYes

setFormulaSimple ​

Shorthand for setFormula(createSimpleFormulaObject(...)).

ArgumentTypeRequiredDescription
locnFieldDataTypesYes
arrNamesArray[String]Yesnames of the input arrays
resultNameStringYesname of the array to create
formulaYes
optionsISimpleFormulaOptionsNo(default: {})