<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello fellow VTK users,<br>
<br>
This is to inform the mailing list that the correct solution was to
add a vtkTransformFilter at the start of my pipeline to transform
the geometry accordingly.<br>
<br>
However, this uncovered a bug in vtkProp3D::GetCenter() (using VTK
6.1).<br>
<br>
The problem was that vtkProp3D::GetCenter() was calling
this->GetBounds(), but then using its own Bounds member, and in
the case of the 3 classes:<br>
vtkAxisActor, vtkCubeAxesActor, vtkPolarAxesActor<br>
they have their own Bounds member. At first I thought that the call
to GetBounds() was useless, but then I thought that perhaps it was
being used to initialize the Bounds (although no comment indicated
this, I've seen this code pattern before). So I left it there, but
it was nevertheless using the wrong bounds to calculate the center
point and was causing the rotation code to rotate about the wrong
center (my interactor uses the center of all visible actors instead
of the origin).<br>
<br>
Looking at the code further, I couldn't see any good reason why
these 3 classes would have their own bounds member anyway since
they're all ultimately derived from vkProp3D and hence can use it's
bounds.<br>
<br>
So in addition to fixing vtkProp3D to not assume it's Bounds is the
correct one to use (because GetBounds() is virtual and "could"
return some other bounds in some other derived class), I also got
rid of the Bounds member in these 3 classes to make them use the
vtkProp3D class's Bounds.<br>
<br>
Everything works correctly in my application, so I'm submitting
these changes to the community at large in case it's useful to
someone else.<br>
If someone else can review them to ensure that my assumptions are
correct, that would be great and as soon as I have a free moment,
I'll add them into GitLab.<br>
<br>
I hope this saves someone else some time.<br>
<br>
<div class="moz-cite-prefix">On 4/8/2015 12:33 PM, Serge Lalonde
wrote:<br>
</div>
<blockquote cite="mid:55255857.5030709@infolytica.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
Hello VTK users,<br>
<br>
I would like to set a global transformation to my entire scene to
translate the model that the viewer is examining into a different
coordinate frame.<br>
Has anyone done this before?<br>
<br>
I found 3 APIs in vtkCamera that look promising, but they each
have some problems:<br>
<ul>
<li>
<title>Snippet</title>
SetUserTransform()</li>
<li>SetUserViewTransform()</li>
<li>SetModelTransformMatrix()</li>
</ul>
<p>What's the difference between them and in what circumstances
should each be used? The documentation is not specific.<br>
</p>
<p>The problem with using SetUserTransform() and
SetUserViewTransform() is that ResetCamera() doesn't take them
into effect, so the model is shifted.<br>
The problem with SetModelTransformMatrix() is that the
interactor's rotation center is no longer the model center since
the model transformation doesn't seem to be applied (but I can
probably fix that).<br>
</p>
<p>One hint that maybe this is the wrong approach is that the
vtkCubeAxesActor I use to display the bounds never changes it's
axes coordinates (they're not transformed).<br>
</p>
<p>So would a better approach be to add a vtkTransformFilter to
the root of my pipeline?<br>
</p>
<p>Thanks for any tips you may share.<br>
<title>Snippet</title>
</p>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<title>Signature</title>
<a moz-do-not-send="true" href="http:://www.infolytica.com">www.infolytica.com
</a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239 </div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Search the list archives at: <a class="moz-txt-link-freetext" href="http://markmail.org/search/?q=vtkusers">http://markmail.org/search/?q=vtkusers</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<title>Signature</title>
<a href="http:://www.infolytica.com">www.infolytica.com </a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239
</div>
</body>
</html>