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.
| Argument | Type | Required | Description |
|---|---|---|---|
locn | FieldDataTypes | Yes | |
arraysIn | Array[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.
| Argument | Type | Required | Description |
|---|---|---|---|
locn | FieldDataTypes | Yes | |
arrNames | Array[String] | Yes | names of the input arrays |
resultName | String | Yes | name of the array to create |
singleValueFormula | Yes | ||
options | ISimpleFormulaOptions | No | (default: {}) |
extend
Method used to decorate a given object (publicAPI+model) with vtkCalculator characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ICalculatorInitialValues | No | (default: {}) |
getFormula
Get the formula currently applied by the filter.
newInstance
Method used to create a new instance of vtkCalculator
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ICalculatorInitialValues | No | for 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.
| Argument | Type | Required | Description |
|---|---|---|---|
arraySpec | IArraySpecs | Yes | |
inData | Yes | ||
outData | Yes |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setFormula
Set the formula to apply.
| Argument | Type | Required | Description |
|---|---|---|---|
formula | IFormula | Yes |
setFormulaSimple
Shorthand for setFormula(createSimpleFormulaObject(...)).
| Argument | Type | Required | Description |
|---|---|---|---|
locn | FieldDataTypes | Yes | |
arrNames | Array[String] | Yes | names of the input arrays |
resultName | String | Yes | name of the array to create |
formula | Yes | ||
options | ISimpleFormulaOptions | No | (default: {}) |