ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkPythonProgrammableFilter Class Reference

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

#include <vtkPythonProgrammableFilter.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)
 
void ClearParameters ()
 Clear all name-value parameters. More...
 
void SetNumberOfInputPorts (int numberOfInputPorts)
 Set the number of input ports This function is explicitly exposed to enable a vtkClientServerInterpreter to call it. More...
 
virtual void SetScript (const char *)
 Set the text of the python script to execute. More...
 
virtual char * GetScript ()
 Set the text of the python script to execute. More...
 
virtual void SetInformationScript (const char *)
 Set the text of the python script to execute in RequestInformation(). More...
 
virtual char * GetInformationScript ()
 Set the text of the python script to execute in RequestInformation(). More...
 
virtual void SetUpdateExtentScript (const char *)
 Set the text of the python script to execute in RequestUpdateExtent(). More...
 
virtual char * GetUpdateExtentScript ()
 Set the text of the python script to execute in RequestUpdateExtent(). More...
 
void SetParameterInternal (const char *name, const char *value)
 Set a name-value parameter that will be available to the script when it is run. More...
 
void SetParameter (const char *name, const char *value)
 Set a name-value parameter that will be available to the script when it is run. More...
 
void SetParameter (const char *name, int value)
 Set a name-value parameter that will be available to the script when it is run. More...
 
void SetParameter (const char *name, double value)
 Set a name-value parameter that will be available to the script when it is run. More...
 
void SetParameter (const char *name, double value1, double value2)
 Set a name-value parameter that will be available to the script when it is run. More...
 
void SetParameter (const char *name, double value1, double value2, double value3)
 Set a name-value parameter that will be available to the script when it is run. More...
 
void AddParameter (const char *name, const char *value)
 To support repeatable-parameters. More...
 
void ClearParameter (const char *name)
 To support repeatable-parameters. More...
 
virtual void SetOutputDataSetType (int)
 Changes the output data set type. More...
 
virtual int GetOutputDataSetType ()
 Changes the output data set type. More...
 
virtual void SetPythonPath (const char *)
 A semi-colon (;) separated list of directories to add to the python library search path. More...
 
virtual char * GetPythonPath ()
 A semi-colon (;) separated list of directories to add to the python library search path. More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkPythonProgrammableFilterSafeDownCast (vtkObject *o)
 
static vtkPythonProgrammableFilterNew ()
 
static void ExecuteScript (void *)
 For internal use only. More...
 

Protected Member Functions

 vtkPythonProgrammableFilter ()
 
 ~vtkPythonProgrammableFilter ()
 
void Exec (const char *, 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)
 Creates whatever output data set type is selected. More...
 
virtual int RequestInformation (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 
virtual int RequestUpdateExtent (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 
virtual int ProcessRequest (vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
 We want to temporarilly cache request to be used in the Python code so we override this method to store request for later use since otherwise we won't have access to it. More...
 

Protected Attributes

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

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.

Definition at line 49 of file vtkPythonProgrammableFilter.h.

Member Typedef Documentation

◆ Superclass

typedef vtkProgrammableFilter vtkPythonProgrammableFilter::Superclass

Definition at line 52 of file vtkPythonProgrammableFilter.h.

Constructor & Destructor Documentation

◆ vtkPythonProgrammableFilter()

vtkPythonProgrammableFilter::vtkPythonProgrammableFilter ( )
protected

◆ ~vtkPythonProgrammableFilter()

vtkPythonProgrammableFilter::~vtkPythonProgrammableFilter ( )
protected

Member Function Documentation

◆ GetClassName()

virtual const char* vtkPythonProgrammableFilter::GetClassName ( )
virtual

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ PrintSelf()

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

◆ New()

static vtkPythonProgrammableFilter* vtkPythonProgrammableFilter::New ( )
static

◆ SetScript()

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

Set the text of the python script to execute.

◆ GetScript()

virtual char* vtkPythonProgrammableFilter::GetScript ( )
virtual

Set the text of the python script to execute.

◆ SetInformationScript()

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

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

◆ GetInformationScript()

virtual char* vtkPythonProgrammableFilter::GetInformationScript ( )
virtual

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

◆ SetUpdateExtentScript()

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

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

◆ GetUpdateExtentScript()

virtual char* vtkPythonProgrammableFilter::GetUpdateExtentScript ( )
virtual

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

◆ SetParameterInternal()

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.

◆ SetParameter() [1/5]

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.

◆ SetParameter() [2/5]

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

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

◆ SetParameter() [3/5]

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

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

◆ SetParameter() [4/5]

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

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

◆ SetParameter() [5/5]

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

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

◆ AddParameter()

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

To support repeatable-parameters.

◆ ClearParameter()

void vtkPythonProgrammableFilter::ClearParameter ( const char *  name)

To support repeatable-parameters.

◆ ClearParameters()

void vtkPythonProgrammableFilter::ClearParameters ( )

Clear all name-value parameters.

◆ ExecuteScript()

static void vtkPythonProgrammableFilter::ExecuteScript ( void *  )
static

For internal use only.

◆ SetOutputDataSetType()

virtual void vtkPythonProgrammableFilter::SetOutputDataSetType ( int  )
virtual

Changes the output data set type.

Allowable values are defined in vtkType.h

◆ GetOutputDataSetType()

virtual int vtkPythonProgrammableFilter::GetOutputDataSetType ( )
virtual

Changes the output data set type.

Allowable values are defined in vtkType.h

◆ SetPythonPath()

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

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

◆ GetPythonPath()

virtual char* vtkPythonProgrammableFilter::GetPythonPath ( )
virtual

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

◆ SetNumberOfInputPorts()

void vtkPythonProgrammableFilter::SetNumberOfInputPorts ( int  numberOfInputPorts)
inline

Set the number of input ports This function is explicitly exposed to enable a vtkClientServerInterpreter to call it.

Definition at line 130 of file vtkPythonProgrammableFilter.h.

◆ Exec()

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

For internal use only.

◆ FillOutputPortInformation()

virtual int vtkPythonProgrammableFilter::FillOutputPortInformation ( int  port,
vtkInformation *  info 
)
protectedvirtual

◆ FillInputPortInformation()

virtual int vtkPythonProgrammableFilter::FillInputPortInformation ( int  port,
vtkInformation *  info 
)
protectedvirtual

◆ RequestDataObject()

virtual int vtkPythonProgrammableFilter::RequestDataObject ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protectedvirtual

Creates whatever output data set type is selected.

◆ RequestInformation()

virtual int vtkPythonProgrammableFilter::RequestInformation ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protectedvirtual

◆ RequestUpdateExtent()

virtual int vtkPythonProgrammableFilter::RequestUpdateExtent ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protectedvirtual

◆ ProcessRequest()

virtual int vtkPythonProgrammableFilter::ProcessRequest ( vtkInformation *  request,
vtkInformationVector **  inInfo,
vtkInformationVector *  outInfo 
)
protectedvirtual

We want to temporarilly cache request to be used in the Python code so we override this method to store request for later use since otherwise we won't have access to it.

Member Data Documentation

◆ Script

char* vtkPythonProgrammableFilter::Script
protected

Definition at line 169 of file vtkPythonProgrammableFilter.h.

◆ InformationScript

char* vtkPythonProgrammableFilter::InformationScript
protected

Definition at line 170 of file vtkPythonProgrammableFilter.h.

◆ UpdateExtentScript

char* vtkPythonProgrammableFilter::UpdateExtentScript
protected

Definition at line 171 of file vtkPythonProgrammableFilter.h.

◆ PythonPath

char* vtkPythonProgrammableFilter::PythonPath
protected

Definition at line 172 of file vtkPythonProgrammableFilter.h.

◆ OutputDataSetType

int vtkPythonProgrammableFilter::OutputDataSetType
protected

Definition at line 173 of file vtkPythonProgrammableFilter.h.


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