<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Dear Mark,<br>I'd really appreciate if you send more detailed information.<br><br>I can't figure out how to make a vtkRenderWindowInteractor receive AnimationCueTickEvents. I did add an observer, but from browsing the sources it seems that vtkRenderWindowInteractor does not event make an attempt to handle AnimationCueTickEvents.<br><br>The story is a different one, if I make a vtkAnimationCue observe AnimationCueTickEvents. Those events are perfectly handled, but the interactivity is lost. Could you make clear, possibly with a code example, what you meant by adding an observer to vtkRenderWindowInteractor to handle AnimationCueTickEvents?<br><br>Regards,<br>Guido<br><br>&gt; Date: Thu, 10 Sep 2009 17:06:39 +0100<br>&gt; Subject: Re: [vtkusers] Animation without polling?<br>&gt; From: mark.gooding@gmail.com<br>&gt; To: guidorodriguez1952@hotmail.com<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; you shouldn't have to write a complete vtkRenderWindowInteractor, just<br>&gt; add an observe to handle AnimationCueTickEvents<br>&gt; <br>&gt; http://www.vtk.org/doc/nightly/html/classvtkCommand.html<br>&gt; <br>&gt; i'll try to send you more detailed information later. I don't have my<br>&gt; software which did animation to hand right now.<br>&gt; <br>&gt; Mark<br>&gt; <br>&gt; <br>&gt; 2009/9/10 Guido Rodriguez &lt;guidorodriguez1952@hotmail.com&gt;:<br>&gt; &gt; Dear VTK users/developers,<br>&gt; &gt; I ask for guidance, how animated visualization is done right with VTK. What<br>&gt; &gt; I have in mind is an application which calculates, let's say, a temperature<br>&gt; &gt; field, which changes in time. Whenever the field is completely calculated<br>&gt; &gt; for the next time step, the visualization should be updated. In parallel,<br>&gt; &gt; the user should be able to work with the mouse/key controls to rotate the<br>&gt; &gt; view, zoom, interact with 3D widgets, etc.<br>&gt; &gt;<br>&gt; &gt; The obvious way would be to run VTK in one thread, and the calculation in<br>&gt; &gt; another. Each finished calculation step would notify VTK to update. But it<br>&gt; &gt; doesn't work like this. At least not with the X windows system. When I call<br>&gt; &gt; some pipeline's Update() function from a different thread, I get an "invalid<br>&gt; &gt; thread access".<br>&gt; &gt;<br>&gt; &gt; Next attempt. I implement an event buffer, which is written to by the<br>&gt; &gt; calculation thread, and which is read from by the VTK thread. This works<br>&gt; &gt; like a charm. Now VTK can check whether an update is necessary and get the<br>&gt; &gt; required data from the event buffer. But _when_ does VTK check for updates?<br>&gt; &gt; I can't seem to find a solution which sets VTK to sleep until either a<br>&gt; &gt; mouse/key event happens or until the calculation thread releases some lock,<br>&gt; &gt; simply because any VTK callback waiting for notification from a different<br>&gt; &gt; thread would stop VTK from reacting to mouse/key events during this period.<br>&gt; &gt;<br>&gt; &gt; The only solution I can see is to add a timer event like every 10 ms, which<br>&gt; &gt; checks the event buffer for updates. This works, but is it recommended?<br>&gt; &gt; Threading libraries have introduced locks and notification to avoid the<br>&gt; &gt; overhead from polling at interactive rates for events that may occur only<br>&gt; &gt; every few seconds. How can good multithreading programming styles be applied<br>&gt; &gt; to VTK?<br>&gt; &gt;<br>&gt; &gt; I hope the problem is clear. Can a different thread trigger pipeline updates<br>&gt; &gt; under X windows? Or do I have to write my own vtkRenderWindowInteractor?<br>&gt; &gt;<br>&gt; &gt; Regards,<br>&gt; &gt; Guido<br>&gt; &gt; ________________________________<br>&gt; &gt; With Windows Live, you can organize, edit, and share your photos.<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;<br>&gt; &gt; Visit other Kitware open-source projects at<br>&gt; &gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;<br>&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; &gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;<br>&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; &gt;<br>&gt; &gt;<br><br /><hr />Share your memories online with anyone you want <a href='http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1' target='_new'>anyone you want.</a></body>
</html>