[vtkusers] Re: timer example
David Cole
david.cole at kitware.com
Thu Nov 9 12:42:47 EST 2006
Also....
I just added VTK/Rendering/Testing/Cxx/TestInteractorTimers.cxx as a test of
multiple simultaneously running timers. Please get it from CVS if you can
and try it out.
Let me know if you encounter any problems with it.
HTH,
David
On 11/9/06, Goodwin Lawlor <goodwin.lawlor at ucd.ie> wrote:
>
> Dominik Szczerba wrote:
> > According to the docu, the vtkHoverWidget is used to invoke an event
> when
> > hovering in a render window. Do you propose to use a zero threshold to
> > simulate an idle function? That sounds like an overkill for what I need.
> Iren
> > allows for timers, is there really no way to regularly trigger arbitrary
> > commands just like iren->AddObserver(vtkCommand::MouseMoveEvent,
> myCommand)
> > does on a mouse movement?
>
> Hi Dominik,
>
> I meant vtkHoverWidget is the only that uses a repeating timer at the
> moment. Here a (slightly buggy) but quick tcl example to illustrate:
>
> package require vtk
> wm withdraw .
>
> set val 10
>
> vtkTextActor txt
> txt SetInput $val
> txt SetMinimumSize 100 100
> txt ScaledTextOn
>
> vtkRenderer ren
> ren AddActor txt
>
> vtkRenderWindow renwin
> renwin AddRenderer ren
>
> vtkRenderWindowInteractor iren
> iren SetRenderWindow renwin
> iren Initialize
>
> iren CreateRepeatingTimer 1000
> iren AddObserver TimerEvent {if {$val == 0} exit}
> iren AddObserver TimerEvent {txt SetInput [incr val -1]; txt
> Modified; renwin Render}
>
> hth
>
> Goodwin
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061109/2843d44c/attachment.htm>
More information about the vtkusers
mailing list