[vtkusers] Mouse Wheel Event: Update

Dr. Gianni Lazzarato lazzadrgi at libero.it
Thu Apr 22 18:46:18 EDT 2004


thank you very very much Mathieu,   i will try your new example tomorrow
because it is 00.45 in italy....
i want my bed now....  :)
see you soon and thanks another

Dr. Gianni Lazzarato



----- Original Message -----
From: "Mathieu Malaterre" <mathieu.malaterre at kitware.com>
To: "Dr. Gianni Lazzarato" <lazzadrgi at libero.it>
Cc: <vtkusers at vtk.org>
Sent: Thursday, April 22, 2004 10:42 PM
Subject: Re: [vtkusers] Mouse Wheel Event: Update


> Gianni,
>
> My mistake there is already a default behaviour for MouseWheel event.
> So you need to remove them first:
>
> iren.RemoveObservers("MouseWheelForwardEvent")
>
> For instance:
>
> import vtk
> from vtk.util.misc import vtkGetDataRoot
> VTK_DATA_ROOT = vtkGetDataRoot()
>
> reader = vtk.vtkVolume16Reader()
> reader.SetDataDimensions(64, 64)
> reader.SetDataByteOrderToLittleEndian()
> reader.SetFilePrefix(VTK_DATA_ROOT + "/Data/headsq/quarter")
> reader.SetImageRange(1, 93)
> reader.SetDataSpacing(3.2, 3.2, 1.5)
>
> slice = 0
> def foo(obj, evt):
>     global slice
>     slice += 1
>     viewer.SetZSlice( slice )
>     #viewer.GetRenderer().ResetCameraClippingRange()
>     #print viewer.GetRenderer().GetActiveCamera().GetParallelProjection()
>     viewer.Render()
>
> iren = vtk.vtkRenderWindowInteractor()
>
> viewer = vtk.vtkImageViewer2()
> viewer.SetInput ( reader.GetOutput() )
> viewer.SetupInteractor (iren)
>
> iren.RemoveObservers("MouseWheelForwardEvent")
> iren.AddObserver("MouseWheelForwardEvent", foo)
>
> iren.Initialize()
> iren.Start()
>
>
>
> Sorry for troubles
> Mathieu
>
> Mathieu Malaterre wrote:
> > I have added two new events:
> >
> > MouseWheelForwardEvent
> > MouseWheelBackwardEvent
> >
> > Then you just use them as any others command event.
> >
> >
> > Just remove the '#' comment in this example:
> > http://vtk.org/pipermail/vtkusers/2003-September/019884.html
> >
> > Mathieu
> > Ps: You need VTK from cvs...
> >
> >
> > Dr. Gianni Lazzarato wrote:
> >
> >> hi to all User,
> >>
> >>                    are there some examples, in tcl or c++, regarding
> >> mouse wheel event in vtk?  If i remember rigth
> >> M. Malaterre was interested in this topic, time ago.
> >> Where can i found these examples? Maybe in vtkusers archive?
> >>
> >> thank you very much in advance for the answers.
> >>
> >> Dr. Gianni Lazzarato
> >
> >
> >
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>





More information about the vtkusers mailing list