[vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow
petersenkolja at gmail.com
Wed Nov 15 05:26:11 EST 2017
I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)"
iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried
10.0 instead of 100000.)
Still no TimerEvents are reported as long as the mouse button is pressed.
How are events consumed? My understanding is that AddObserver(...) adds
just another listener, and that all listeners registered for a specific
event are invoked one after the other. Which function would "consume"
events in an interactor style? Is it possible to circumvent the consuming
of events, or to re-emit the event after it has been consumed?
On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin <ken.martin at kitware.com> wrote:
> I suspect timer events are fired but something else is consuming them.
> Probably in the interactor style. Try adding your timer events with a
> higher priority like 10.0 (third argument).
> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen <petersenkolja at gmail.com>
>> I paste some code below, which displays an empty vtkRenderWindow with an
>> interactor. The interactor fires a TimerEvent every 100ms as printed by the
>> The problem: as long as 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 while a button is pressed, and how can I
>> change this behaviour?
>> Thank you
>> import vtk
>> class Observer(object):
>> def __init__(self):
>> def __call__(self,caller,evt):
>> print "count %d %s" % (self.cnt,evt)
>> ren1 = vtk.vtkRenderer()
>> ren1.SetBackground(0.1, 0.2, 0.4)
>> renWin = vtk.vtkRenderWindow()
>> renWin.SetSize(300, 300)
>> iren = vtk.vtkRenderWindowInteractor()
>> style = vtk.vtkInteractorStyleTrackballCamera()
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virenfrei.
>> Powered by www.kitware.com
>> Visit other Kitware open-source projects at
>> Please keep messages on-topic and check the VTK FAQ at:
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>> Follow this link to subscribe/unsubscribe:
> Ken Martin PhD
> Distinguished Engineer
> Kitware Inc.
> 28 Corporate Drive
> Clifton Park NY 12065
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee. Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers