ParaView
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
vtkPythonProgrammableFilter Class Reference

Executes a user supplied python script on its input dataset to produce an output dataset. More...

#include <vtkPythonProgrammableFilter.h>

Inheritance diagram for vtkPythonProgrammableFilter:
Inheritance graph
[legend]
Collaboration diagram for vtkPythonProgrammableFilter:
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)
void ClearParameters ()
virtual void SetScript (const char *)
virtual char * GetScript ()
virtual void SetInformationScript (const char *)
virtual char * GetInformationScript ()
virtual void SetUpdateExtentScript (const char *)
virtual char * GetUpdateExtentScript ()
void SetParameterInternal (const char *name, const char *value)
void SetParameter (const char *name, const char *value)
void SetParameter (const char *name, const int value)
void SetParameter (const char *name, const double value)
void SetParameter (const char *name, const double value1, const double value2, const double value3)
virtual void SetOutputDataSetType (int)
virtual int GetOutputDataSetType ()
virtual void SetPythonPath (const char *)
virtual char * GetPythonPath ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static
vtkPythonProgrammableFilter
SafeDownCast (vtkObject *o)
static
vtkPythonProgrammableFilter
New ()
static void ExecuteScript (void *)

Protected Member Functions

void Exec (const char *, const char *)
virtual int FillOutputPortInformation (int port, vtkInformation *info)
virtual int FillInputPortInformation (int port, vtkInformation *info)
virtual int RequestInformation (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int RequestUpdateExtent (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int RequestDataObject (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)

Protected Attributes

char * Script
char * InformationScript
char * UpdateExtentScript
char * PythonPath
int OutputDataSetType

Friends

class vtkPythonProgrammableFilterObserver
static vtkPVPythonInterpretorGetGlobalPipelineInterpretor ()
 vtkPythonProgrammableFilter ()
 ~vtkPythonProgrammableFilter ()

Detailed Description

Executes a user supplied python script on its input dataset to produce an output dataset.

This filter will execute a python script to produce an output dataset. An new interpretor is created at the beginning of RequestInformation(). The state of the python interpretor is preserved until the next execution of RequestInformation(). After the interpretor is creates the vtk module is imported with "from paraview import vtk".

Then the interpretor runs the InformationScript during RequestInformation(). This script is run in a python function called RequestInformation(). An argument named self that refers to the programmable filter is passed to the function. The interpretor also runs the Script during RequestData(). This script is run in a python function called RequestData(). An argument named self that refers to the programmable filter is passed to the function. Furthermore, a set of parameters passed with the SetParameter() call are defined as Python variables inside both scripts. This allows the developer to keep the scripts the same but change their behaviour using parameters.

Caveat:
Note that this algorithm sets the output extent translator to be vtkOnePieceExtentTranslator. This means that all processes will ask for the whole extent. This behaviour can be overridden in InformationScript.

Definition at line 53 of file vtkPythonProgrammableFilter.h.


Constructor & Destructor Documentation

vtkPythonProgrammableFilter::vtkPythonProgrammableFilter ( ) [protected]

Returns the Python interp that should be used by all pipeline objects. The interp is created this first time this function is called and it is destroyed when vtkPVSessionBase invokes the ExitEvent. BTX

vtkPythonProgrammableFilter::~vtkPythonProgrammableFilter ( ) [protected]

Returns the Python interp that should be used by all pipeline objects. The interp is created this first time this function is called and it is destroyed when vtkPVSessionBase invokes the ExitEvent. BTX


Member Function Documentation

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

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

virtual void vtkPythonProgrammableFilter::SetScript ( const char *  ) [virtual]

Set the text of the python script to execute.

virtual char* vtkPythonProgrammableFilter::GetScript ( ) [virtual]

Set the text of the python script to execute.

virtual void vtkPythonProgrammableFilter::SetInformationScript ( const char *  ) [virtual]

Set the text of the python script to execute in RequestInformation().

virtual char* vtkPythonProgrammableFilter::GetInformationScript ( ) [virtual]

Set the text of the python script to execute in RequestInformation().

virtual void vtkPythonProgrammableFilter::SetUpdateExtentScript ( const char *  ) [virtual]

Set the text of the python script to execute in RequestUpdateExtent().

virtual char* vtkPythonProgrammableFilter::GetUpdateExtentScript ( ) [virtual]

Set the text of the python script to execute in RequestUpdateExtent().

void vtkPythonProgrammableFilter::SetParameterInternal ( const char *  name,
const char *  value 
)

Set a name-value parameter that will be available to the script when it is run

void vtkPythonProgrammableFilter::SetParameter ( const char *  name,
const char *  value 
)

Set a name-value parameter that will be available to the script when it is run

void vtkPythonProgrammableFilter::SetParameter ( const char *  name,
const int  value 
)

Set a name-value parameter that will be available to the script when it is run

void vtkPythonProgrammableFilter::SetParameter ( const char *  name,
const double  value 
)

Set a name-value parameter that will be available to the script when it is run

void vtkPythonProgrammableFilter::SetParameter ( const char *  name,
const double  value1,
const double  value2,
const double  value3 
)

Set a name-value parameter that will be available to the script when it is run

void vtkPythonProgrammableFilter::ClearParameters ( )

Clear all name-value parameters

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

For internal use only.

virtual void vtkPythonProgrammableFilter::SetOutputDataSetType ( int  ) [virtual]

Changes the output data set type. Allowable values are defined in vtkType.h

virtual int vtkPythonProgrammableFilter::GetOutputDataSetType ( ) [virtual]

Changes the output data set type. Allowable values are defined in vtkType.h

virtual void vtkPythonProgrammableFilter::SetPythonPath ( const char *  ) [virtual]

A semi-colon (;) separated list of directories to add to the python library search path.

virtual char* vtkPythonProgrammableFilter::GetPythonPath ( ) [virtual]

A semi-colon (;) separated list of directories to add to the python library search path.

static vtkPVPythonInterpretor* vtkPythonProgrammableFilter::GetGlobalPipelineInterpretor ( ) [static]

Returns the Python interp that should be used by all pipeline objects. The interp is created this first time this function is called and it is destroyed when vtkPVSessionBase invokes the ExitEvent. BTX

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

For internal use only.

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

Reimplemented from vtkProgrammableFilter.

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

Reimplemented from vtkProgrammableFilter.

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

Creates whatever output data set type is selected.

Reimplemented from vtkProgrammableFilter.

virtual int vtkPythonProgrammableFilter::RequestInformation ( vtkInformation request,
vtkInformationVector **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

Reimplemented from vtkProgrammableFilter.

virtual int vtkPythonProgrammableFilter::RequestUpdateExtent ( vtkInformation request,
vtkInformationVector **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

Reimplemented from vtkProgrammableFilter.


Friends And Related Function Documentation

friend class vtkPythonProgrammableFilterObserver [friend]

Definition at line 158 of file vtkPythonProgrammableFilter.h.


Member Data Documentation

Definition at line 145 of file vtkPythonProgrammableFilter.h.

Definition at line 146 of file vtkPythonProgrammableFilter.h.

Definition at line 147 of file vtkPythonProgrammableFilter.h.

Definition at line 148 of file vtkPythonProgrammableFilter.h.

Definition at line 149 of file vtkPythonProgrammableFilter.h.


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