ParaView
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkPythonCalculator Class Reference

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

#include <vtkPythonCalculator.h>

Inheritance diagram for vtkPythonCalculator:
Inheritance graph
[legend]
Collaboration diagram for vtkPythonCalculator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetArrayAssociation (int)
virtual int GetArrayAssociation ()
virtual void SetCopyArrays (bool)
virtual bool GetCopyArrays ()
virtual void CopyArraysOn ()
virtual void CopyArraysOff ()
virtual void SetExpression (const char *)
virtual char * GetExpression ()
virtual void SetArrayName (const char *)
virtual char * GetArrayName ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkPythonCalculatorSafeDownCast (vtkObject *o)
static vtkPythonCalculatorNew ()
static void ExecuteScript (void *)

Protected Member Functions

 vtkPythonCalculator ()
 ~vtkPythonCalculator ()
void Exec (const char *, const char *)
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

Detailed Description

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 37 of file vtkPythonCalculator.h.


Constructor & Destructor Documentation

vtkPythonCalculator::vtkPythonCalculator ( ) [protected]
vtkPythonCalculator::~vtkPythonCalculator ( ) [protected]

Member Function Documentation

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

Reimplemented from vtkProgrammableFilter.

static int vtkPythonCalculator::IsTypeOf ( const char *  type) [static]

Reimplemented from vtkProgrammableFilter.

virtual int vtkPythonCalculator::IsA ( const char *  type) [virtual]

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

void vtkPythonCalculator::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

virtual void vtkPythonCalculator::SetArrayAssociation ( int  ) [virtual]

Which field data to get the arrays from. See vtkDataObject::FieldAssociations for choices. The default is FIELD_ASSOCIATION_POINTS.

virtual int vtkPythonCalculator::GetArrayAssociation ( ) [virtual]

Which field data to get the arrays from. See vtkDataObject::FieldAssociations for choices. The default is FIELD_ASSOCIATION_POINTS.

virtual void vtkPythonCalculator::SetCopyArrays ( bool  ) [virtual]

Controls whether the input arrays are copied to the output. True by default.

Reimplemented from vtkProgrammableFilter.

virtual bool vtkPythonCalculator::GetCopyArrays ( ) [virtual]

Controls whether the input arrays are copied to the output. True by default.

Reimplemented from vtkProgrammableFilter.

virtual void vtkPythonCalculator::CopyArraysOn ( ) [virtual]

Controls whether the input arrays are copied to the output. True by default.

Reimplemented from vtkProgrammableFilter.

virtual void vtkPythonCalculator::CopyArraysOff ( ) [virtual]

Controls whether the input arrays are copied to the output. True by default.

Reimplemented from vtkProgrammableFilter.

virtual void vtkPythonCalculator::SetExpression ( const char *  ) [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 char* vtkPythonCalculator::GetExpression ( ) [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 void vtkPythonCalculator::SetArrayName ( const char *  ) [virtual]

Set the name of the output array.

virtual char* vtkPythonCalculator::GetArrayName ( ) [virtual]

Set the name of the output array.

static void vtkPythonCalculator::ExecuteScript ( void *  ) [static]

For internal use only.

void vtkPythonCalculator::Exec ( const char *  ,
const char *   
) [protected]

For internal use only.

virtual int vtkPythonCalculator::FillOutputPortInformation ( int  port,
vtkInformation info 
) [protected, virtual]

Reimplemented from vtkProgrammableFilter.

virtual int vtkPythonCalculator::FillInputPortInformation ( int  port,
vtkInformation info 
) [protected, virtual]

Reimplemented from vtkProgrammableFilter.

virtual int vtkPythonCalculator::RequestDataObject ( vtkInformation request,
vtkInformationVector **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

Reimplemented from vtkProgrammableFilter.


Member Data Documentation

Definition at line 95 of file vtkPythonCalculator.h.

char* vtkPythonCalculator::ArrayName [protected]

Definition at line 96 of file vtkPythonCalculator.h.

Definition at line 97 of file vtkPythonCalculator.h.

Reimplemented from vtkProgrammableFilter.

Definition at line 98 of file vtkPythonCalculator.h.


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