<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks a lot David and Elvis,</div><div class=""><br class=""></div><div class="">I’ll try your suggestion tonight. And sorry for the rather stupid question. I’m both new to Python and VTK and at times struggling at different fronts, especially with oop. :)</div><div class="">David, actually, I need this updating mechanism to temporally smooth some movement of one of the actors and for this I need to store previous movements.</div><div class=""><br class=""></div><div class="">all the best</div><div class="">Andreas</div><br class="">
<br class=""><div><blockquote type="cite" class=""><div class="">Am 20.11.2018 um 22:24 schrieb David Gobbi <<a href="mailto:david.gobbi@gmail.com" class="">david.gobbi@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Basically what Elvis said: you can store whatever you want in the callback.</div><div class="">For example, you can do this:</div><div class=""><br class=""></div><div class=""> cb.actor = actor</div><div class=""> cb.mapper = mapper</div><div class=""><br class=""></div><div class="">And then in the callback execute() method, you can do whatever you want with cb.mapper, i.e. you can give the mapper a new input.</div><div class=""><br class=""></div><div class="">Whether you really want to do this, though, depends on exactly what you are trying to achieve at each iteration. If you just want to adjust the position or orientation, then it's best to just do something similar to what the example does. Actually getting the output and using it as the next input is computationally expensive, whereas changing the position and orientation of an actor is cheap.</div><div class=""><br class=""></div><div class="">If you are hoping to get the output of the Render() and feed it back into the mapper, that is actually impossible. The Render() draws to the screen, so its output is a 2D bitmap, which isn't something you can feed back into the pipeline as a replacement of the original polydata.</div><div class=""><br class=""></div><div class=""> David</div><div class=""><br class=""></div><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Nov 20, 2018 at 2:07 PM Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com" class="">elvis.stansvik@orexplore.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Den tis 20 nov. 2018 kl 21:49 skrev Andreas Pedroni <<a href="mailto:anpedroni@gmail.com" target="_blank" class="">anpedroni@gmail.com</a>>:<br class="">
><br class="">
> Dear list<br class="">
><br class="">
> Is there a way to use a RepeatingTimer as in this example: <a href="https://www.vtk.org/Wiki/VTK/Examples/Python/Animation" rel="noreferrer" target="_blank" class="">https://www.vtk.org/Wiki/VTK/Examples/Python/Animation</a> in which the loop for the animation (in the example the method execute()) can return output in each iteration that is used in the the next iteration? In other words, is there a way to use information that is calculated in one iteration for the next iteration? Sorry, I am not sure if the question is understandable.<br class="">
<br class="">
I think you have your answer right there in that example :) In each<br class="">
iteration, the self.timer_count field holds the output from the<br class="">
previous iteration.<br class="">
<br class="">
So yes, I think you can simply save the output from one iteration in a<br class="">
field of the callback class, and use that as input in the next<br class="">
iteration.<br class="">
<br class="">
Hope that makes sense.<br class="">
<br class="">
Cheers,<br class="">
Elvis<br class="">
<br class="">
><br class="">
> best<br class="">
> Andreas<br class="">
</blockquote></div></div></div>
</div></blockquote></div><br class=""></body></html>