|
ParaView
|
Encapsulates a single instance of a python interpretor. More...
#include <vtkPVPythonInterpretor.h>


Public Member Functions | |
| virtual const char * | GetClassName () |
| virtual int | IsA (const char *type) |
| void | PrintSelf (ostream &os, vtkIndent indent) |
| int | PyMain (int argc, char **argv) |
| int | InitializeSubInterpretor (int argc, char **argv) |
| void | MakeCurrent () |
| void | RunSimpleString (const char *const script) |
| void | RunSimpleFile (const char *const filename) |
| void | ReleaseControl () |
| void | FlushMessages () |
| void | ClearMessages () |
| void | AddPythonPath (const char *) |
| void | ExecuteInitFromGUI () |
| virtual void | SetCaptureStreams (bool) |
| virtual bool | GetCaptureStreams () |
Static Public Member Functions | |
| static vtkPVPythonInterpretor * | New () |
| static int | IsTypeOf (const char *type) |
| static vtkPVPythonInterpretor * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
| vtkPVPythonInterpretor () | |
| ~vtkPVPythonInterpretor () | |
| virtual void | InitializeInternal () |
| void | AddPythonPathInternal (const char *path) |
| virtual void | SetExecutablePath (const char *) |
| void | DumpError (const char *string) |
| void | DumpOutput (const char *string) |
| vtkStdString | GetInputLine () |
| void | DetachActiveSessionObserver () |
Protected Attributes | |
| char * | ExecutablePath |
| bool | CaptureStreams |
| bool | ActiveSessionObserverAttached |
Friends | |
| struct | vtkPVPythonInterpretorWrapper |
Encapsulates a single instance of a python interpretor.
Encapsulates a python interpretor. It also initializes the interpretor with the paths to the paraview libraries and modules. This object can represent the main interpretor or any sub-interpretor.
Definition at line 35 of file vtkPVPythonInterpretor.h.
| vtkPVPythonInterpretor::vtkPVPythonInterpretor | ( | ) | [protected] |
| vtkPVPythonInterpretor::~vtkPVPythonInterpretor | ( | ) | [protected] |
| static vtkPVPythonInterpretor* vtkPVPythonInterpretor::New | ( | ) | [static] |
Reimplemented from vtkObject.
Reimplemented in vtkPVPythonInteractiveInterpretor.
| virtual const char* vtkPVPythonInterpretor::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkObject.
Reimplemented in vtkPVPythonInteractiveInterpretor.
| static int vtkPVPythonInterpretor::IsTypeOf | ( | const char * | type | ) | [static] |
Reimplemented from vtkObject.
Reimplemented in vtkPVPythonInteractiveInterpretor.
| virtual int vtkPVPythonInterpretor::IsA | ( | const char * | type | ) | [virtual] |
Reimplemented from vtkObject.
Reimplemented in vtkPVPythonInteractiveInterpretor.
| static vtkPVPythonInterpretor* vtkPVPythonInterpretor::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkObject.
Reimplemented in vtkPVPythonInteractiveInterpretor.
| void vtkPVPythonInterpretor::PrintSelf | ( | ostream & | os, |
| vtkIndent | indent | ||
| ) | [virtual] |
Reimplemented from vtkObject.
Reimplemented in vtkPVPythonInteractiveInterpretor.
Initializes python and starts the interprestor's event loop i.e. call Py_Main().
Initializes python and create a sub-interpretor context. Subinterpretors don't get argc/argv, however, argv[0] is used to set the executable path if not already set. The executable path is used to locate paraview python modules. This method calls ReleaseControl() at the end of the call, hence the newly created interpretor is not the active interpretor when the control returns. Use MakeCurrent() to make it active.
| void vtkPVPythonInterpretor::MakeCurrent | ( | ) |
This method will make the sub-interpretor represented by this object the active one. A MakeCurrent() call must have a corresponding ReleaseControl() to avoid deadlocks.
| void vtkPVPythonInterpretor::RunSimpleString | ( | const char *const | script | ) |
Helper function that executes a script using PyRun_SimpleString() - handles some pesky details with DOS line endings. This method calls MakeCurrent() at the start and ReleaseControl() at the end, hence the interpretor will not be the active one when the control returns from this call.
| void vtkPVPythonInterpretor::RunSimpleFile | ( | const char *const | filename | ) |
Helper function that calls execfile().
| void vtkPVPythonInterpretor::ReleaseControl | ( | ) |
Call in a subinterpretter to pause it and return control to the main interpretor. A MakeCurrent() call must have a corresponding ReleaseControl() to avoid deadlocks.
| virtual void vtkPVPythonInterpretor::SetCaptureStreams | ( | bool | ) | [virtual] |
In some cases, the application may want to capture the output/error streams dumped by the python interpretor. When enabled, the streams are captured and output/error is collected which can be flushed by FlushMessages. vtkCommand::ErrorEvent is fired when data is received on stderr and vtkCommand::WarningEvent is fired when data is received on stdout. from the python interpretor. Event data for both the events is the text received. This flag can be changed only before the interpretor is initialized. Changing it afterwards has no effect.
| virtual bool vtkPVPythonInterpretor::GetCaptureStreams | ( | ) | [virtual] |
In some cases, the application may want to capture the output/error streams dumped by the python interpretor. When enabled, the streams are captured and output/error is collected which can be flushed by FlushMessages. vtkCommand::ErrorEvent is fired when data is received on stderr and vtkCommand::WarningEvent is fired when data is received on stdout. from the python interpretor. Event data for both the events is the text received. This flag can be changed only before the interpretor is initialized. Changing it afterwards has no effect.
| void vtkPVPythonInterpretor::FlushMessages | ( | ) |
Flush any errors received from the python interpretor to the vtkOutputWindow. Applicable only if CaptureStreams was true when the interpretor was initialized.
| void vtkPVPythonInterpretor::ClearMessages | ( | ) |
Clears all received messages. Unlike FlushMessages, this call does not dump it on the vtkOutputWindow. Applicable only if CaptureStreams was true when the interpretor was initialized.
| void vtkPVPythonInterpretor::AddPythonPath | ( | const char * | ) |
Add a directory to python path. Can be called only after InitializeSubInterpretor().
| void vtkPVPythonInterpretor::ExecuteInitFromGUI | ( | ) |
Call this method to initialize the interpretor for ParaView GUI applications. This is typically called right after InitializeSubInterpretor().
| virtual void vtkPVPythonInterpretor::InitializeInternal | ( | ) | [protected, virtual] |
Initialize the interpretor.
Reimplemented in vtkPVPythonInteractiveInterpretor.
| void vtkPVPythonInterpretor::AddPythonPathInternal | ( | const char * | path | ) | [protected] |
| virtual void vtkPVPythonInterpretor::SetExecutablePath | ( | const char * | ) | [protected, virtual] |
| void vtkPVPythonInterpretor::DumpError | ( | const char * | string | ) | [protected] |
| void vtkPVPythonInterpretor::DumpOutput | ( | const char * | string | ) | [protected] |
| vtkStdString vtkPVPythonInterpretor::GetInputLine | ( | ) | [protected] |
| void vtkPVPythonInterpretor::DetachActiveSessionObserver | ( | ) | [protected] |
friend struct vtkPVPythonInterpretorWrapper [friend] |
Definition at line 121 of file vtkPVPythonInterpretor.h.
char* vtkPVPythonInterpretor::ExecutablePath [protected] |
Definition at line 116 of file vtkPVPythonInterpretor.h.
bool vtkPVPythonInterpretor::CaptureStreams [protected] |
Definition at line 117 of file vtkPVPythonInterpretor.h.
bool vtkPVPythonInterpretor::ActiveSessionObserverAttached [protected] |
Declare that DetachActiveSessionObserver() should be called at close time. CAUTION: This must be set to true when paraview.servermanager.InitFromGUI() get called.
Definition at line 138 of file vtkPVPythonInterpretor.h.
1.7.5.1