<div dir="ltr">The interactor style may be doing a grab focus (which grabs all events until the motion is done). Try putting some printfs/breaks in the code that generates the timerevent in vtk. Then maybe you can follow the event and see who is consuming it etc,. <div><br></div><div>Or try commenting out all the GrabFocus() calls in the style you are using. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 15, 2017 at 11:42 AM, Kolja Petersen <span dir="ltr"><<a href="mailto:petersenkolja@gmail.com" target="_blank">petersenkolja@gmail.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">No, this is on Linux. Maybe you can try the code snippet yourself to see what I am talking about? The problem is not, that the TimerEvents are slowed down during mouse interaction, they are dropped completely.<div><br></div><div>How can the app be redesigned?</div><div>First, I need the standard behaviour of vtkRenderWindowInteractor to allow rotating, zooming, panning.</div><div>Second I need to update and redraw the scene repeatedly in constant intervals. Of course, I could trigger these events independent from VTK using a second thread. But these events need to operate on VTK objects from the main thread. Because VTK is not thread safe (which I have experienced by a number of segmentation faults when modifying VTK objects from different threads), I see absolutely no way to correctly process both 1) timer events and 2) user interaction events that block the timer events.</div><div>Kolja</div></div><div id="m_869865242780024731DAB4FAD8-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="" width="46" height="29" style="width:46px;height:29px"></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_869865242780024731_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 15, 2017 at 5:25 PM, David Cole <span dir="ltr"><<a href="mailto:DLRdave@aol.com" target="_blank">DLRdave@aol.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="auto">Is this on Windows? WM_TIMER events are notorious for not firing frequently when lots of other user events are also happening. If the mouse is captured, they may not fire at all. This is not something unique to VTK, it happens with just any Windows program.<div><br></div><div>You may need to consider redesigning a bit of your app if you must have code being executed regularly even during user interactions.</div><div><span class="m_869865242780024731HOEnZb"><font color="#888888"><br><br><div id="m_869865242780024731m_-7045443072964375499AppleMailSignature">David</div></font></span><div><div class="m_869865242780024731h5"><div><br>On Nov 15, 2017, at 5:26 AM, Kolja Petersen <<a href="mailto:petersenkolja@gmail.com" target="_blank">petersenkolja@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>I replaced the line "iren.AddObserver(vtk.vtkComma<wbr>nd.TimerEvent,observer)" with<br>iren.AddObserver(vtk.vtkComman<wbr>d.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="m_869865242780024731m_-7045443072964375499h5">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="m_869865242780024731m_-7045443072964375499h5"><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_869865242780024731m_-7045443072964375499m_-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_869865242780024731_m_-7045443072964375499_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="m_869865242780024731m_-7045443072964375499HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_869865242780024731m_-7045443072964375499m_-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" target="_blank">28 Corporate Drive</a><br><a href="https://maps.google.com/?q=28+Corporate+Drive+Clifton+Park+NY+12065&entry=gmail&source=g" target="_blank">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>
</div></blockquote><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a></span><br><span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a></span><br><span></span><br><span>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a></span><br><span></span><br><span>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br><span><a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a></span><br></div></blockquote></div></div></div></div></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_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>28 Corporate Drive<br>Clifton Park NY 12065<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>
</div>