[Paraview] TimerEvents not fired while dragging mouse in vtkRenderWindow
Joachim Pouderoux
joachim.pouderoux at kitware.com
Sun Nov 12 23:02:15 EST 2017
Kolja,
As it is a VTK Python related question, please address this issue to the
VTK mailing list instead.
Best,
*Joachim Pouderoux*, PhD
*Technical Expert - Scientific Computing Team*
*Kitware SAS <http://www.kitware.fr>*
2017-11-12 17:15 GMT+01:00 Kolja Petersen <petersenkolja at gmail.com>:
> Heya,
> I paste some code below, which displays an empty vtkRenderWindow with an
> interactor. The interactor fires a TimerEvent every 100ms as printed by the
> Observer.
> The problem: when I press a mouse button in the vtkRenderWindow, the
> TimerEvents stop to be reported, although I need to process data
> periodically in my application as a reaction to those TimerEvents.
>
> Why are no TimerEvents fired when a button is pressed, and how can I
> change this behaviour?
> Thank you
> Kolja
>
> import vtk
>
> class Observer(object):
> def __init__(self):
> self.cnt=0
> def __call__(self,caller,evt):
> self.cnt+=1
> print "count %d %s" % (self.cnt,evt)
>
> ren1 = vtk.vtkRenderer()
> ren1.SetBackground(0.1, 0.2, 0.4)
>
> renWin = vtk.vtkRenderWindow()
> renWin.AddRenderer(ren1)
> renWin.SetSize(300, 300)
>
> iren = vtk.vtkRenderWindowInteractor()
> iren.SetRenderWindow(renWin)
>
> style = vtk.vtkInteractorStyleTrackballCamera()
> iren.SetInteractorStyle(style)
>
> iren.Initialize()
> observer=Observer()
> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)
> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer)
> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer)
> iren.CreateRepeatingTimer(100)
> iren.Start()
>
>
>
>
> _______________________________________________
> 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 ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171113/fdbea91c/attachment.html>
More information about the ParaView
mailing list