[vtkusers] layered renderers

Steve Chall stevec at renci.org
Tue Apr 8 15:45:17 EDT 2008


>Message: 18
>Date: Tue, 8 Apr 2008 14:12:32 +0200
>From: "Oliver Kania" <ptw.freiburg at googlemail.com>
>Subject: [vtkusers] Multiple rendering layers reacting to interaction
>To: vtkusers at vtk.org
>Message-ID:
>	<e22fb1100804080512q2b1ad655oee6f3581183bfb60 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hello,
>my application has several layers :
>
>vtkRenderer RenderImage2 = new vtkRenderer();
>vtkRenderer RenderImage = new vtkRenderer();
>
> RenderImage.SetLayer(0);
> RenderImage2.SetLayer(1);
>
> RenderImage.SetInteractive(1);
> RenderImage2.SetInteractive(1);
>
>
>  RenderImage.SetBackground(0.0, 0.0, 0.3);
>
>  vtkRenderWindow renWin = new vtkRenderWindow();
>  renWin.SetNumberOfLayers(2);
>  renWin.AddRenderer(RenderImage2);
>  renWin.AddRenderer(RenderImage);
>
>vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
>iren.SetRenderWindow(renWin);
>//set image mode interaction style
>vtkInteractorStyleImage interactor = new vtkInteractorStyleImage();
>ren.SetInteractorStyle(interactor);
>
>What I find is that only one layer reacts to interaction.
>Since I used SetInteractive(), I was expecting that both layers do react.
>More generally, I want to have an arbitrary number of layers that do
>react to the same interaction. Maybe it is somehow possible to link
>the cameras of the renderers ?
>(I tried Renderer1.setCamera(Renderer2.getCamera()) but that does
>not work)
>
>kind regards,
>Oliver

Thank you, Oliver, for bringing layered rendering to my attention.  This
sounds like it could resolve some visibility issues I'm experiencing.
However, I can't seem to find very much documentation on this feature.  I've
bought and looked through the books, read the code in vtkRenderer.h, and
checked online, and pretty much all I've found out is that layers are
numbered and all but the bottom are transparent.  I can and, if necessary,
will work through it empirically, i.e., by writing code and seeing what
happens.  But it would be valuable and probably much more efficient if there
were some more thorough documentation than what I've found thus far.  Can
anyone point me to it?  Admittedly, once again I may have just overlooked
something obvious, but if so I'd appreciate someone shaking me out of my
tunnel vision.  Thanks all.

-Steve





More information about the vtkusers mailing list