On Tue, Dec 11, 2012 at 6:49 PM, srikanth bhattad <span dir="ltr"><<a href="mailto:srikanthviit@gmail.com" target="_blank">srikanthviit@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><div class="gmail_quote">Hi, I am a newbie in VTK coding. I have VTK 5.10 installed on my PC running windows XP.. I am trying to develop an application where I need to blink or glow or change the color of an actor. I am trying out on one of the demo example cone4 that came with the source code. My apologies if its a stupid question but I was wondering if I can change the properties of actor like color while it is rendered and running the window-interactor. Since from what I have understood, once the interactor runs, the actor can be moved but I cant seem to change its properties since it continues the interactor loop. I have a snippet of the code I am running, may be it might help to understand what I intend to do. The cone moves and changes color at every iteration (2 second per iteration). But if I also simultaneously want to interact which I try to do by uncommenting the highlighted text, it wont serve the purpose. Any thoughts of how I can accomplish this blinking actor. I would really appreciate your help.<br>
<br><div>Thanks,<br>Srikanth<br></div></div></blockquote><div><br></div><div>You should almost never have code after the interactor->Start() call. You need to use callbacks/events. Here is an example of using a timer to call a callback function: <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation</a> . Inside the callback you can do whatever you want, including change the color of an actor (<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ColorAnActor">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ColorAnActor</a>).</div>
<div><br></div><div>David</div></div>