I ended up copying vtkInteractorStyleImage and vtkInteractorStyleTrackballCamera and deleting the methods that enabled rotation. I renamed them and did all the following required name changes. Since I'm using QVTKWidget, I got the interactor (iren = qvtkWidget->GetRenderWindow()->GetInteractor();) and then set the interactor style from there (iren->SetInteractorStyle(istyle);). It seemed to work decently. A little annoying to do but what work, works, I suppose.<br>
<br>-Tina<br><br><div class="gmail_quote">On Mon, Jun 22, 2009 at 2:06 PM, kent williams <span dir="ltr"><<a href="mailto:nkwmailinglists@gmail.com">nkwmailinglists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I was attempting to answer Tina Zhang's question, because I thought I<br>
knew most of the answer; turns out the method I thought would work<br>
dead-ends before it gets where she wants to go.<br>
<br>
My first response was 'Oh, you just get a handle on the<br>
InteractorStyle and configure it to suppress rotation!'<br>
<br>
But it turns out, there are two problems with this idea.<br>
<br>
1) The vtkInteractorStyleImage has no methods to e.g. suppress the<br>
rotation action.<br>
2) You could write your own class with vtkInteractorStyleImage and<br>
redefine the event handlers, but ... there's no method to set the<br>
InteractorStyle for vtkImageViewer2. You can get it but you can't set<br>
it!<br>
<br>
I think I hit this dead end a year or so ago, and started using<br>
vtkinria3d, because their analog to vtkImageViewer2 DOES let you<br>
suppress and redefine the event bindings.<br>
<br>
The fact of the matter is that despite all the things using<br>
vtkImageViewer2 does to you, its stock configuration doesn't fit every<br>
possible application, and it seems resistant to customization, so much<br>
so that I think most people throw up their hands and either hack the<br>
vtkImageViewer2 source code into their own custom class, or just give<br>
up.<br>
<br>
On Mon, Jun 22, 2009 at 12:08 PM, Tina Zhang<<a href="mailto:zhang.tina.t@gmail.com">zhang.tina.t@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'm using ImageViewer2 to display dicom images; how would I disable rotation<br>
> but keep zoom and pan?<br>
><br>
> -Tina<br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br>