<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [vtkusers] layered renderers</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I may have figured this out.&nbsp; Try setting the interactorstyle on your render window with something similar to the following.&nbsp; If i comment out the last 3 lines only 1 of my layers interacts.&nbsp; See if that helps<BR>
<BR>
<BR>
set iact [[$renderWidget&nbsp; GetRenderWindow] GetInteractor]<BR>
set renWin2 [$renderWidget GetRenderWindow]<BR>
vtkInteractorStyleTrackballCamera style<BR>
$iact SetInteractorStyle style<BR>
$iact SetRenderWindow $renWin2<BR>
$iact SetDesiredUpdateRate 0<BR>
<BR>
<BR>
Rob<BR>
<BR>
<BR>
I tried precisely that. Without success.<BR>
Maybe there is some detail I overlooked.<BR>
DO you have any example-code ?<BR>
<BR>
Kind regards,<BR>
oliver<BR>
<BR>
2008/4/9, CLEMENTS, ROBERT &lt;rclement@kent.edu&gt;:<BR>
&gt;<BR>
&gt;&nbsp; I to have had similar problems but&nbsp; it seems that using something similar<BR>
&gt; to below;<BR>
&gt;<BR>
&gt; ren4 SetActiveCamera [ren2 GetActiveCamera]<BR>
&gt;<BR>
&gt; makes both layers react to the same input.&nbsp; Hope this helps .<BR>
&gt;<BR>
&gt; Rob<BR>
&gt;<BR>
&gt;<BR>
&gt; Hello Steve,<BR>
&gt; I am glad someone else has the same problems to solve ;)<BR>
&gt; However, I fear you are right : The books do not contain any<BR>
&gt; documentation on this. I even searched the archives without success.<BR>
&gt; There is only one rudimentary CPP example.<BR>
&gt; Anyway, I will try to do the same as you are doing and<BR>
&gt; work myself through it. So maybe we can help each other out ?<BR>
&gt;<BR>
&gt; Kind regards,<BR>
&gt; Oliver<BR>
&gt;<BR>
&gt; 2008/4/8, Steve Chall &lt;stevec@renci.org&gt;:<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; &gt;Message: 18<BR>
&gt; &gt; &gt;Date: Tue, 8 Apr 2008 14:12:32 +0200<BR>
&gt; &gt; &gt;From: &quot;Oliver Kania&quot; &lt;ptw.freiburg@googlemail.com&gt;<BR>
&gt; &gt; &gt;Subject: [vtkusers] Multiple rendering layers reacting to interaction<BR>
&gt; &gt; &gt;To: vtkusers@vtk.org<BR>
&gt; &gt; &gt;Message-ID:<BR>
&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;e22fb1100804080512q2b1ad655oee6f3581183bfb60@mail.gmail.com&gt;<BR>
&gt; &gt; &gt;Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;Hello,<BR>
&gt; &gt; &gt;my application has several layers :<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;vtkRenderer RenderImage2 = new vtkRenderer();<BR>
&gt; &gt; &gt;vtkRenderer RenderImage = new vtkRenderer();<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt; RenderImage.SetLayer(0);<BR>
&gt; &gt; &gt; RenderImage2.SetLayer(1);<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt; RenderImage.SetInteractive(1);<BR>
&gt; &gt; &gt; RenderImage2.SetInteractive(1);<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;&nbsp; RenderImage.SetBackground(0.0, 0.0, 0.3);<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;&nbsp; vtkRenderWindow renWin = new vtkRenderWindow();<BR>
&gt; &gt; &gt;&nbsp; renWin.SetNumberOfLayers(2);<BR>
&gt; &gt; &gt;&nbsp; renWin.AddRenderer(RenderImage2);<BR>
&gt; &gt; &gt;&nbsp; renWin.AddRenderer(RenderImage);<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();<BR>
&gt; &gt; &gt;iren.SetRenderWindow(renWin);<BR>
&gt; &gt; &gt;//set image mode interaction style<BR>
&gt; &gt; &gt;vtkInteractorStyleImage interactor = new vtkInteractorStyleImage();<BR>
&gt; &gt; &gt;ren.SetInteractorStyle(interactor);<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;What I find is that only one layer reacts to interaction.<BR>
&gt; &gt; &gt;Since I used SetInteractive(), I was expecting that both layers do<BR>
&gt; react.<BR>
&gt; &gt; &gt;More generally, I want to have an arbitrary number of layers that do<BR>
&gt; &gt; &gt;react to the same interaction. Maybe it is somehow possible to link<BR>
&gt; &gt; &gt;the cameras of the renderers ?<BR>
&gt; &gt; &gt;(I tried Renderer1.setCamera(Renderer2.getCamera()) but that does<BR>
&gt; &gt; &gt;not work)<BR>
&gt; &gt; &gt;<BR>
&gt; &gt; &gt;kind regards,<BR>
&gt; &gt; &gt;Oliver<BR>
&gt; &gt;<BR>
&gt; &gt; Thank you, Oliver, for bringing layered rendering to my attention.&nbsp; This<BR>
&gt; &gt; sounds like it could resolve some visibility issues I'm experiencing.<BR>
&gt; &gt; However, I can't seem to find very much documentation on this<BR>
&gt; &gt; feature.&nbsp; I've<BR>
&gt; &gt; bought and looked through the books, read the code in vtkRenderer.h, and<BR>
&gt; &gt; checked online, and pretty much all I've found out is that layers are<BR>
&gt; &gt; numbered and all but the bottom are transparent.&nbsp; I can and, if<BR>
&gt; necessary,<BR>
&gt; &gt; will work through it empirically, i.e., by writing code and seeing what<BR>
&gt; &gt; happens.&nbsp; But it would be valuable and probably much more efficient if<BR>
&gt; &gt; there<BR>
&gt; &gt; were some more thorough documentation than what I've found thus far.<BR>
&gt; Can<BR>
&gt; &gt; anyone point me to it?&nbsp; Admittedly, once again I may have just<BR>
&gt; overlooked<BR>
&gt; &gt; something obvious, but if so I'd appreciate someone shaking me out of my<BR>
&gt; &gt; tunnel vision.&nbsp; Thanks all.<BR>
&gt; &gt;<BR>
&gt; &gt; -Steve<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; _______________________________________________<BR>
&gt; &gt; This is the private VTK discussion list.<BR>
&gt; &gt; Please keep messages on-topic. Check the FAQ at:<BR>
&gt; &gt; <A HREF="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>
&gt; &gt; Follow this link to subscribe/unsubscribe:<BR>
&gt; &gt; <A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
&gt; &gt;<BR>
&gt;<BR>
&gt;<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>