[Paraview] TimerEvents not fired while dragging mouse in vtkRenderWindow

Kolja Petersen petersenkolja at gmail.com
Sun Nov 12 11:15:40 EST 2017


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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171112/d9bd24b7/attachment.html>


More information about the ParaView mailing list