[vtkusers] Specifying a vtkRenderWindowInteractor
Vidyadhar
vidyadhar at lucidindia.com
Wed Jun 25 23:22:37 EDT 2008
My experience is that second approach creates a vtkWindow without parent and
Start method does not exit till you close that window. First approach is
suitable if a window is already created (say windows form or some control
window) which is assigned to be parent of render window. So first approach
is suitable for embedding render window in other GUI controls while second
approach is suitable for console application.
HTH
Vidyadhar
----- Original Message -----
From: "Phil Goddard" <philgoddard at telus.net>
To: <vtkusers at vtk.org>
Sent: Wednesday, June 25, 2008 10:20 AM
Subject: [vtkusers] Specifying a vtkRenderWindowInteractor
>
> 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.
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list