Hi Jean,<div><br></div><div>Thank you for the Qt timer link. </div><div><br></div><div>I basically have a device thread that runs at a higher rate compared to the main app thread.</div><div>In an event callback function of my device thread I try to set a flag indicating whether the window should be repainted or not. My approach is similar to the one suggested by David in </div>
<div><a href="http://public.kitware.com/pipermail/vtkusers/2004-April/073618.html">http://public.kitware.com/pipermail/vtkusers/2004-April/073618.html</a>
</div><div><br></div><div>But, this fails because at some point that device thread tries to fetch the variable that is locked by the application thread. So far, I tried using the timer event /observer approach for the interactor. Will try this with the Qt timer instead.</div>
<div><br></div><div>Is there any other way to address this without resorting to the Qt timer ?</div><div><br></div><div>I may not be able to post the entire code at this point but would try to do so soon.</div><div><br></div>
<div>Thanks,</div><div>Tanu</div><div><br></div><div><br><br><div class="gmail_quote">On Fri, May 4, 2012 at 2:08 PM, Jean-Christophe Fillion-Robin <span dir="ltr"><<a href="mailto:jchris.fillionr@kitware.com" target="_blank">jchris.fillionr@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Taru, <div><br></div><div>If possible, it would be helpful if you could share some code (gist or github?)</div><div>
<br></div><div>For Qt timer based approach you could probably look at the following [1] </div><div><br>

</div><div>Hth</div><div>Jc</div><div><br></div><div>[1] <a href="https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp#L66" target="_blank">https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp#L66</a></div>


<div><br><br><div class="gmail_quote"><div><div class="h5">On Fri, May 4, 2012 at 1:39 PM, Taru S <span dir="ltr"><<a href="mailto:twrkmail@gmail.com" target="_blank">twrkmail@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><div><span>Hello All,</span><div><br></div><div>I have integrated an external device with VTK. When interacting using the external device things work fine for a few seconds but the attempt to re-render the GUI (qt based) window fail after a while. </div>



<div><br></div><div>I am using a vtk timer based approach to re-render the window in the main application thread and use Mutex locks to set and unset the variables in the device and application threads.</div><div>
<br></div><div>The issue seems to occur when the device thread attempts to read the variable that is locked for update by the application thread. The prog throws a Qt exception at this point.</div><div><br></div>
<div>Could someone please help me with this issue and suggest a workaround. I tried creating a Qt based timer as well but for some reason it is not getting invoked.</div><div><br></div><div>Your help will be greatly appreciated.</div>



<div><br></div><div>Thanks,</div><div>Tanu</div>
</div></div><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br><br>
</font></span></div>
</blockquote></div><br></div>