<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SK" link="blue" vlink="purple">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi Robert,<br>
</p>
<p>thanks for the reply, it makes sense. From your experience, would you say it is worth the effort for ~6 views? Would you say the performance improvement is noticeable and worth the extra effort? I did some experiments, and I get a bit of a delay on interaction;
 between the mouse down and  the scene starting to rotate (using stock vtkInteractorStyleTrackballCamera for now). I am guessing it may be the FindPokedRenderer() taking time to figure out which renderer the interaction falls into... Some of my viewports also
 have a vtkOrientationMarkerWidget, which creates its own renderer, and a couple views have overlay (non-interactive) renderer as well, so the total number of renderers is even higher, maybe 12 altogether.</p>
<p>Thank you!</p>
<p>Miro<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Róbert Špir <spir.robert@gmail.com><br>
<b>Sent:</b> Thursday, December 8, 2016 8:49:10 PM<br>
<b>To:</b> Miroslav Drahos; vtkusers@vtk.org<br>
<b>Subject:</b> RE: [vtkusers] interactor with one renwin and multiple renderers</font>
<div> </div>
</div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Hi Miro,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I’m doing similar task. You can derive your own interactorstyle class from one of the vtkInteractorStyle classes. There you can override
 mouse and key event functions and using this->Interactor->FindPokedRenderer(mouseX, mouseY); you can detect to which of the multiple renderers the user clicked and handle the interaction according to your needs.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Robert<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> vtkusers [mailto:vtkusers-bounces@vtk.org]
<b>On Behalf Of </b>Miroslav Drahos<br>
<b>Sent:</b> Thursday, December 8, 2016 10:44 PM<br>
<b>To:</b> vtkusers@vtk.org<br>
<b>Subject:</b> [vtkusers] interactor with one renwin and multiple renderers<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p><span style="font-family:"Calibri",sans-serif;color:black">Hi VTK folks,<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">I am trying to optimize my application, and am thinking to replace multiple QVTKWidget2 instances with only one widget + multiple viewports/renderers. Then I could issue only one expensive call to
 vtkRenderWindow::Render() and re-draw everything.<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">I saw the example for multiple viewports (<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports" id="LPlnk960727">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports</a>)
 and it all looks very straightforward, but...<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">How do I handle interaction? Let's say in a typical quad view setup of a medical application, with 3 orthogonal slices and one 3D view there are different interactor styles needed. But it is the
 renderwindow that provides interactor, so in the tiled version I would end up with only one common interactor/interactor style.<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">Any advice is greatly appreciated!<o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif;color:black">Miro<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>