<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Dean,<br>
<br>
I have tried ren->ResetCamera() after adding the actors, it displays OK but with the default scaling (i.e. camera position etc), just the same as if I do it initially and never change the camera.<br>
<br>
Cheers<br>
Gib<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF778521"><font color="#000000" size="2" face="Tahoma"><b>From:</b> DL I [inglis.dl@gmail.com]<br>
<b>Sent:</b> Wednesday, 18 November 2015 9:10 a.m.<br>
<b>To:</b> Gib Bogle<br>
<b>Cc:</b> Ken Martin; vtkusers@vtk.org<br>
<b>Subject:</b> Re: [vtkusers] QVTKWidget camera problem<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div><span style="font-family:tahoma,sans-serif"><span style="color:rgb(0,0,0)">Hi Gib,<br>
<br>
</span></span></div>
<span style="font-family:tahoma,sans-serif"><span style="color:rgb(0,0,0)">maybe try removing
<font size="2"><br>
</font></span></span>
<pre style="margin:0px; text-indent:0px"><span style="font-family:tahoma,sans-serif"><span style="color:rgb(0,0,0)"><font size="2">iren-><span style="font-style:italic">Initialize</span>(); <br></font></span></span></pre>
<pre style="margin:0px; text-indent:0px"><span style="font-family:tahoma,sans-serif"><span style="color:rgb(0,0,0)"><font size="2">and calling <br></font></span></span><font size="3" face="Courier New"><span style="color:rgb(0,0,0)"><span style="font-family:tahoma,sans-serif"><font size="2">ren->ResetCamera();
after you have added the actor(s)?</font></span><br></span></font></pre>
<pre style="margin:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:rgb(0,0,0)"><br></span></font></pre>
<pre style="margin:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:rgb(0,0,0)">- Dean<br></span></font></pre>
<pre style="margin:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:rgb(0,0,0)"><br></span></font></pre>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Nov 17, 2015 at 3:03 PM, Gib Bogle <span dir="ltr">
<<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Thanks for the suggestions, Ken. Neither had any effect, unfortunately.<br>
<br>
Cheers<br>
Gib<br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" size="2" face="Tahoma"><b>From:</b> Ken Martin [<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>]<br>
<b>Sent:</b> Wednesday, 18 November 2015 8:28 a.m.<br>
<b>To:</b> Gib Bogle<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] QVTKWidget camera problem<br>
</font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>
<div dir="ltr">renderer->ResetCameraClippingRange() maybe? That and camera->OrthogonalizeViewUp() are the two common things to try when manual camera changes do not work.
<div><br>
</div>
<div>Thanks</div>
<div>Ken</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Nov 17, 2015 at 2:15 PM, Gib Bogle <span dir="ltr">
<<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><font size="3" face="Arial">I have now established conclusively that adjusting the camera setup with SetPosition and SetFocalPoint stops the scene from being displayed, while any
movement of the mouse with a button down restores display.<br>
<br>
<span style="color:#c0c0c0"></span><font face="Courier New"><span style="color:#800000">qvtkWidget</span><span style="color:#c0c0c0">
</span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#808000">new</span><span style="color:#c0c0c0">
</span><span style="color:#800080">QVTKWidget</span><span style="color:#000000">(</span><span style="color:#000000">page</span><span style="color:#000000">,</span><span style="color:#800080">QFlag</span><span style="color:#000000">(</span><span style="color:#000080">0</span><span style="color:#000000">));</span></font></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:#800000"><span style="color:#800080">QVBoxLayout</span><span style="color:#c0c0c0"> </span><span style="color:#000000">*</span><span style="color:#000000">layout</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#808000">new</span><span style="color:#c0c0c0"> </span><span style="color:#800080">QVBoxLayout</span><span style="color:#000000">;</span>
l<span style="color:#000000">ayout</span><span style="color:#000000">-></span>addWidget<span style="color:#000000">(</span><span style="color:#800000">qvtkWidget</span><span style="color:#000000">);</span>
</span></font><span style="color:#c0c0c0"></span><span style="color:#800000">page_VTK</span><span style="color:#000000">-></span>setLayout<span style="color:#000000">(</span><span style="color:#000000">layout</span><span style="color:#000000">);</span>
<font size="3" face="Courier New"><span style="color:#800000">ren</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkRenderer</span><span style="color:#000000">::</span>New<span style="color:#000000">();</span><span style="color:#c0c0c0"> </span></font></pre>
<font size="3" face="Courier New"></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:#800000">renWin</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#800000">qvtkWidget</span><span style="color:#000000">-></span><span style="font-style:italic; color:#000000">GetRenderWindow</span><span style="color:#000000">();</span></font></pre>
<font size="3" face="Courier New"></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:#800000">renWin</span><span style="color:#000000">-></span><span style="font-style:italic; color:#000000">AddRenderer</span><span style="color:#000000">(</span><span style="color:#800000">ren</span><span style="color:#000000">);</span></font></pre>
<font size="3" face="Courier New"><span style="color:#c0c0c0"></span><span style="color:#800000">ren</span><span style="color:#000000">-></span>ResetCamera<span style="color:#000000">();</span><span style="color:#c0c0c0">
</span><span style="color:#800000"><br>
iren</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0">
</span><span style="color:#800000">qvtkWidget</span><span style="color:#000000">-></span><span style="font-style:italic; color:#000000">GetInteractor</span><span style="color:#000000">();</span>
</font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:#800080">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#800080">MouseInteractorStyle4</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#000000">style</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#800080">MouseInteractorStyle4</span><span style="color:#000000">>::</span>New<span style="color:#000000">();</span></font></pre>
<font size="3" face="Courier New"></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:#800000">iren</span><span style="color:#000000">-></span><span style="font-style:italic; color:#000000">SetInteractorStyle</span><span style="color:#000000">(</span><span style="color:#c0c0c0"> </span><span style="color:#000000">style</span><span style="color:#c0c0c0"> </span><span style="color:#000000">);</span></font></pre>
<font size="3" face="Courier New"></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3" face="Courier New"><span style="color:#800000">iren</span><span style="color:#000000">-></span><span style="font-style:italic; color:#000000">Initialize</span><span style="color:#000000">();</span></font></pre>
<font size="3" face="Courier New"></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3"><font face="Courier New"><span style="color:#800000">ren</span><span style="color:#000000">-></span>GetActiveCamera<span style="color:#000000">()-></span>SetPosition<span style="color:#000000">(</span><span style="color:#000080">0</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000080">0</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000080">0</span><span style="color:#000000">);</span>
<span style="color:#c0c0c0"></span><span style="color:#800000">ren</span><span style="color:#000000">-></span>GetActiveCamera<span style="color:#000000">()-></span>SetFocalPoint<span style="color:#000000">(</span><span style="color:#000000">x0</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000000">x0</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000000">x0</span><span style="color:#000000">);</span></font>
</font><pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font size="3"><br></font></pre></pre>
<font size="3" face="Arial">If I remove the last two lines the scene is centred OK, but not at the scale I want. I can play with Zoom(), but SetFocalPoint(x0,x0,x0) ensures that I get the desired scaling directly.<br>
Is this the expected behaviour? I'm wondering if it is the result of using the QVTKWidget "default" camera instead of creating a new one to use (please excuse deficiencies in my understanding). Is Zoom() the only way to achieve what I want?</font><br>
</div>
</div>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>Ken Martin PhD
<div>Chairman & CFO<br>
Kitware Inc.<br>
28 Corporate Drive<br>
Clifton Park NY 12065<br>
518 371 3971
<div><br>
</div>
<div><span style="font-size:10pt; font-family:Tahoma,sans-serif">This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the
original message. Thank you.</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>