Section: Visualization Toolkit Parallel Classes
.SECTION Example class MyProcess: public vtkProcess ... vtkMultiProcessController *c; MyProcess *p=new MyProcess::New(); p->SetArgs(argc,argv); // some parameters specific to the process p->SetX(10.0); // ... c->SetSingleProcess(p); c->SingleMethodExecute(); int returnValue=p->GetReturnValue();
To create an instance of class vtkProcess, simply invoke its constructor as follows
obj = vtkProcess
obj
is an instance of the vtkProcess class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkProcess = obj.NewInstance ()
vtkProcess = obj.SafeDownCast (vtkObject o)
obj.Execute ()
vtkMultiProcessController = obj.GetController ()
- Give access to the controller that launched the process.
Initial value is NULL.
obj.SetController (vtkMultiProcessController aController)
- This method should not be called directly but set by the controller
itself.
int = obj.GetReturnValue ()
- Value set at the end of a call to Execute.