[vtkusers] How to open multiple VTK windows at once?

Jérôme jerome.velut at gmail.com
Thu Aug 20 07:59:02 EDT 2009


Hi,

I never used it, but maybe you can try to execute one thread per rendering.
I think there is a vtkMultiThread object, or something like that, that
allows several function calls in different threads. That's the first idea.

Second idea : You can use several renderer in a renderwindow. Just set the
viewports (size of the renderer). Finally, you won't have 2 windows, but
only one with 2 areas. But in this case, you have to implement the whole
rendering pipeline.

HTH.

Jerome

2009/8/20 Maxima Mustermann <Maxima.M at gmx.de>

> Hi,
>
> I want to show 2 images at once in 2 separate windows but that does not
> seem to be possible.
> When I open the first viewer, the interactor takes control over the program
> and the other viewer opens only when I have closed the first one.
> To be true, I don't really need an interactor (I only want to show the
> image), but without interactor the window disappears immediately.
>
> My code:
>
> vtkImageViewer2* viewerA = vtkImageViewer2::New();
> vtkRenderWindowInteractor* interactorA = vtkRenderWindowInteractor::New();
> viewerA->SetupInteractor(interactorA);
>
> vtkImageViewer2* viewerB = vtkImageViewer2::New();
> vtkRenderWindowInteractor* interactorB = vtkRenderWindowInteractor::New();
> viewerB->SetupInteractor(interactorB);
>
> viewerA->SetInput(imageA);
> viewerB->SetInput(imageB);
>
> viewerA->Render();
> interactorA->Start();
>
> viewerB->Render();
> interactorB->Start();
>
> This is a *very* simple problem, but I did not found a corresponding topic
> in the FAQ or the mailing list.
> I want to keep my code as simple as possible, so if there is a way I would
> prefer to do it without the use of additional GUI toolkits.
>
> Thank you very much.
> --
> Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
> für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090820/0038eb44/attachment.htm>


More information about the vtkusers mailing list