[vtkusers] How to override event bindings for vtkImageViewer2? (was Re: How to disable rotation)

Tina Zhang zhang.tina.t at gmail.com
Tue Jun 23 13:19:35 EDT 2009


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.

-Tina

On Mon, Jun 22, 2009 at 2:06 PM, kent williams <nkwmailinglists at gmail.com>wrote:

> I was attempting to answer Tina Zhang's question, because I thought I
> knew most of the answer; turns out the method I thought would work
> dead-ends before it gets where she wants to go.
>
> My first response was 'Oh, you just get a handle on the
> InteractorStyle and configure it to suppress rotation!'
>
> But it turns out, there are two problems with this idea.
>
> 1) The vtkInteractorStyleImage has no methods to e.g. suppress the
> rotation action.
> 2) You could write your own class with vtkInteractorStyleImage and
> redefine the event handlers, but ... there's no method to set the
> InteractorStyle for vtkImageViewer2.  You can get it but you can't set
> it!
>
> I think I hit this dead end a year or so ago, and started using
> vtkinria3d, because their analog to vtkImageViewer2 DOES let you
> suppress and redefine the event bindings.
>
> The fact of the matter is that despite all the things using
> vtkImageViewer2 does to you, its stock configuration doesn't fit every
> possible application, and it seems resistant to customization, so much
> so that I think most people throw up their hands and either hack the
> vtkImageViewer2 source code into their own custom class, or just give
> up.
>
> On Mon, Jun 22, 2009 at 12:08 PM, Tina Zhang<zhang.tina.t at gmail.com>
> wrote:
> > Hi,
> >
> > I'm using ImageViewer2 to display dicom images; how would I disable
> rotation
> > but keep zoom and pan?
> >
> > -Tina
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090623/134c13e7/attachment.htm>


More information about the vtkusers mailing list