<div dir="ltr"><div>I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" with<br>iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried 10.0 instead of 100000.)<br></div><div><br></div><div>Still no TimerEvents are reported as long as the mouse button is pressed.</div><div><br></div><div>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?</div><div>Thank you</div><div>Kolja</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin <span dir="ltr"><<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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).</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen <span dir="ltr"><<a href="mailto:petersenkolja@gmail.com" target="_blank">petersenkolja@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><span style="font-size:12.8px">Heya,</span><br style="font-size:12.8px"><span style="font-size:12.8px">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.</span><br style="font-size:12.8px"><span style="font-size:12.8px">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.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Why are no TimerEvents fired while a button is pressed, and how can I change this behaviour?</span><br style="font-size:12.8px"><span style="font-size:12.8px">Thank you</span><br style="font-size:12.8px"><span style="font-size:12.8px">Kolja</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">import vtk</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">class Observer(object):</span><br style="font-size:12.8px"><span style="font-size:12.8px">  def __init__(self):</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self.cnt=0</span><br style="font-size:12.8px"><span style="font-size:12.8px">  def __call__(self,caller,evt):</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self.cnt+=1</span><br style="font-size:12.8px"><span style="font-size:12.8px">    print "count %d %s" % (self.cnt,evt)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">ren1 = vtk.vtkRenderer()</span><br style="font-size:12.8px"><span style="font-size:12.8px">ren1.SetBackground(0.1, 0.2, 0.4)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">renWin = vtk.vtkRenderWindow()</span><br style="font-size:12.8px"><span style="font-size:12.8px">renWin.AddRenderer(ren1)</span><br style="font-size:12.8px"><span style="font-size:12.8px">renWin.SetSize(300, 300)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">iren = vtk.vtkRenderWindowInteractor(</span><span style="font-size:12.8px"><wbr>)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.SetRenderWindow(renWin)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">style = vtk.</span><span style="font-size:12.8px">vtkInteractorStyleTrackbal<wbr>lCam</span><span style="font-size:12.8px">era()</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.SetInteractorStyle(style)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">iren.Initialize()</span><br style="font-size:12.8px"><span style="font-size:12.8px">observer=Observer()</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><span style="font-size:12.8px">vtkComman<wbr>d.TimerEvent,</span><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><span style="font-size:12.8px">vtkComman<wbr>d.MouseMoveEvent,</span><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><span style="font-size:12.8px">vtkComman<wbr>d.InteractionEvent,</span><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.CreateRepeatingTimer(100)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.Start()</span><br></div><div id="m_-5995428116567439952m_5020402281578617109DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid #d3d4de">
        <tbody><tr>
      <td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" style="width:46px;height:29px" width="46" height="29"></a></td>
                <td style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virenfrei. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:#4453ea" target="_blank">www.avast.com</a>            </td>
        </tr>
</tbody></table>
<a href="#m_-5995428116567439952_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-5995428116567439952gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div><a href="https://maps.google.com/?q=28+Corporate+Drive+Clifton+Park+NY+12065&entry=gmail&source=g">28 Corporate Drive</a><br><a href="https://maps.google.com/?q=28+Corporate+Drive+Clifton+Park+NY+12065&entry=gmail&source=g">Clifton Park NY 12065</a><br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">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.</span></div></div></div></div></div>
</font></span></div>
</blockquote></div><br></div>