<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Unfortunately I'm using parallel projection, and&nbsp;
SetUseHorizontalViewAngle&nbsp;() only works with perspective displays.<div><br></div><div>Larry<br><br><div><div id="SkyDrivePlaceholder"></div>&gt; From: clinton@elemtech.com<br>&gt; To: vtkusers@vtk.org<br>&gt; Date: Mon, 30 Jul 2012 12:40:55 -0600<br>&gt; CC: lkellogg19@hotmail.com<br>&gt; Subject: Re: [vtkusers] simple QVTKWidget resize issue<br>&gt; <br>&gt; On Sunday, July 29, 2012 12:55:28 AM Larry Kellogg wrote:<br>&gt; &gt; Hi Everyone,<br>&gt; &gt; I'm having a simple problem, but I can't find a solution.<br>&gt; &gt; In my application when I shrink the window vertically, vtk automatically<br>&gt; &gt; scales the view so that everything remains centered as it was.  But when I<br>&gt; &gt; shrink the window horizontally, nothing is resized and the model which used<br>&gt; &gt; to be centered nicely is now cut off on the sides.<br>&gt; &gt; <br>&gt; &gt; Is there a way to get QVTKWidget or a render window to resize the display<br>&gt; &gt; when the window is resized in both the vertical and horizontal directions. <br>&gt; &gt; If VTK doesn't have a way to do this, does anybody have any good<br>&gt; &gt; suggestions on how I could implement this myself? Thanks,<br>&gt; <br>&gt; You can add a callback and register it <br>&gt;   StartRenderCallback = vtkCallbackCommand::New();<br>&gt;   StartRenderCallback-&gt;SetCallback(MyView::StartRender);<br>&gt;   RenderWindow-&gt;AddObserver(vtkCommand::StartEvent, StartRenderCallback);<br>&gt; <br>&gt; ...<br>&gt; <br>&gt; And in your callback, switch between using the horizonal view angle depending <br>&gt; on the window size.<br>&gt; <br>&gt; void MyView::StartRender(vtkObject* caller, <br>&gt;                      unsigned long, void* clientdata, void*)<br>&gt; {<br>&gt;   vtkRenderWindow* win = vtkRenderWindow::SafeDownCast(caller);<br>&gt;   vtkRenderer* ren ....<br>&gt; <br>&gt;   // update the view angle<br>&gt;   int horiz_view = win-&gt;GetSize()[0] &lt; win-&gt;GetSize()[1];<br>&gt;   ren-&gt;GetActiveCamera()-&gt;SetUseHorizontalViewAngle(horiz_view);<br>&gt; }<br>&gt; <br>&gt; But perhaps this kind of thing can be added to VTK, with a flag to switch <br>&gt; beween vertical, horizontal or both.<br>&gt; <br>&gt; -- <br>&gt; Clinton Stimpson<br>&gt; Elemental Technologies, Inc<br>&gt; Computational Simulation Software, LLC<br>&gt; www.csimsoft.com<br>&gt; _______________________________________________<br>&gt; Powered by www.kitware.com<br>&gt; <br>&gt; Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>&gt; <br>&gt; Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; <br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<br></div></div>                                               </div></body>
</html>