[vtkusers] Specifying a vtkRenderWindowInteractor

Phil Goddard philgoddard at telus.net
Wed Jun 25 00:50:49 EDT 2008


 
I've noticed that the examples use two different approaches to setting
interactors (shown below).

Can anyone comment one whether the approaches are equivalent?
When would I use one instead of the other?
Is either a "right", "better", or "more modern" approach?

Approach One:
vtkRenderWindow *window = vtkRenderWindow::New();
vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();
window->SetInteractor(interactor);
window->Render();

Approach Two:
vtkRenderWindow *renWin = vtkRenderWindow::New();
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
iren->Initialize();  // Some examples have an Initialize and some do not --
why?
iren->Start(); 

Thanks
Phil.





More information about the vtkusers mailing list