[vtkusers] CreateRepeatingTimer Loop with memory

mmusy marco.musy at gmail.com
Wed Nov 21 05:54:04 EST 2018


..maybe it's "dirty" but one may achieve the same with using global variables
(var in the example).

BTW, the vtkInteractorStyleTrackballCamera has a weird behaviour in rotating
the scene.



from __future__ import print_function
import vtk

var = 0

class vtkTimerCallback():
   def __init__(self):
       self.timer_count = 0
 
   def execute(self,obj,event):
       global var
       print(self.timer_count, var)
       self.actor.SetPosition(self.timer_count, self.timer_count,0);
       iren = obj
       iren.GetRenderWindow().Render()
       self.timer_count += 1
       var += 1 
 
def main():
...


if __name__ == '__main__':
   main()



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list