[vtkusers] vtkImageInteractorStyle question about zoom

David Doria daviddoria at gmail.com
Tue Nov 29 07:34:02 EST 2011


On Tue, Nov 29, 2011 at 6:59 AM, Hikaruchan
<Sandra.Schroetter.fl at ait.ac.at> wrote:
> hi!
>
> maybe it is a too simple question, but I don't get it. I am using the
> vtkInteractorStyleImage for my 2D Views. In this style, the user is able to
> zoom in and out with the mouse wheel. But the problem is, that the user can
> zoom endlessly, so I wanted to make that for example, the user can scroll (=
> zoom) in each direction until a maximum/minimum scaling is reached. If the
> max (or min) scale is reached, the image should not be zoomed anymore. But I
> don't know how to do this.
>
> Actually I tried to make a callback function, which works fine, but I don't
> now how to tell vtk not to zoom anymore.
>
> Would be glad if someone could give me some suggestions about this topic.
>
> dear
>
> hikaruchan

You should subclass the interactorStyle and reimplement OnMouseMove ()
most likely.

This should get you started:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents

David



More information about the vtkusers mailing list