ParaView
|
Evaluates a Python expression vtkPythonCalculator uses Python to calculate an expression. More...
#include <vtkPythonCalculator.h>
Inherits vtkProgrammableFilter.
Public Types | |
typedef vtkProgrammableFilter | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetArrayAssociation (int) |
Which field data to get the arrays from. More... | |
virtual int | GetArrayAssociation () |
Which field data to get the arrays from. More... | |
virtual void | SetCopyArrays (bool) |
Controls whether the input arrays are copied to the output. More... | |
virtual bool | GetCopyArrays () |
Controls whether the input arrays are copied to the output. More... | |
virtual void | CopyArraysOn () |
Controls whether the input arrays are copied to the output. More... | |
virtual void | CopyArraysOff () |
Controls whether the input arrays are copied to the output. More... | |
virtual void | SetExpression (const char *) |
Set the text of the python expression to execute. More... | |
virtual char * | GetExpression () |
Set the text of the python expression to execute. More... | |
virtual void | SetArrayName (const char *) |
Set the name of the output array. More... | |
virtual char * | GetArrayName () |
Set the name of the output array. More... | |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkPythonCalculator * | SafeDownCast (vtkObject *o) |
static vtkPythonCalculator * | New () |
static void | ExecuteScript (void *) |
For internal use only. More... | |
Protected Member Functions | |
vtkPythonCalculator () | |
~vtkPythonCalculator () | |
void | Exec (const char *) |
For internal use only. More... | |
virtual int | FillOutputPortInformation (int port, vtkInformation *info) |
virtual int | FillInputPortInformation (int port, vtkInformation *info) |
virtual int | RequestDataObject (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) |
Protected Attributes | |
char * | Expression |
char * | ArrayName |
int | ArrayAssociation |
bool | CopyArrays |
Evaluates a Python expression vtkPythonCalculator uses Python to calculate an expression.
This filter depends heavily on the numpy and paraview.vtk modules. To use the parallel functions, mpi4py is also necessary. The expression is evaluated and the resulting scalar value or numpy array is added to the output as an array. See numpy and paraview.vtk documentation for the list of available functions.
This filter tries to make it easy for the user to write expressions by defining certain variables. The filter tries to assign each array to a variable of the same name. If the name of the array is not a valid Python variable, it has to be accessed through a dictionary called arrays (i.e. arrays['array_name']). The points can be accessed using the points variable.
Definition at line 39 of file vtkPythonCalculator.h.
typedef vtkProgrammableFilter vtkPythonCalculator::Superclass |
Definition at line 42 of file vtkPythonCalculator.h.
|
protected |
|
protected |
|
virtual |
|
static |
|
virtual |
|
static |
void vtkPythonCalculator::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
|
static |
|
virtual |
Which field data to get the arrays from.
See vtkDataObject::FieldAssociations for choices. The default is FIELD_ASSOCIATION_POINTS.
|
virtual |
Which field data to get the arrays from.
See vtkDataObject::FieldAssociations for choices. The default is FIELD_ASSOCIATION_POINTS.
|
virtual |
Controls whether the input arrays are copied to the output.
True by default.
|
virtual |
Controls whether the input arrays are copied to the output.
True by default.
|
virtual |
Controls whether the input arrays are copied to the output.
True by default.
|
virtual |
Controls whether the input arrays are copied to the output.
True by default.
|
virtual |
Set the text of the python expression to execute.
This expression must return a scalar value (which is converted to an array) or a numpy array.
|
virtual |
Set the text of the python expression to execute.
This expression must return a scalar value (which is converted to an array) or a numpy array.
|
virtual |
Set the name of the output array.
|
virtual |
Set the name of the output array.
|
static |
For internal use only.
|
protected |
For internal use only.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Definition at line 106 of file vtkPythonCalculator.h.
|
protected |
Definition at line 107 of file vtkPythonCalculator.h.
|
protected |
Definition at line 108 of file vtkPythonCalculator.h.
|
protected |
Definition at line 109 of file vtkPythonCalculator.h.