[vtkusers] Re: timer example

Dominik Szczerba domi at vision.ee.ethz.ch
Thu Nov 9 19:14:17 EST 2006


Hi Goodwin,
So where is a vtkHover widget in your codelet? It is pretty much what I had myself
 - with an exception of Initialize() first not being called at all, then being called in a wrong place
(before setRenderWindow). Then there was a typo in my code, using a vtkRenderer in place
of RenderInteractor. So 3 words, not one as I stated. You guys saved me out of quite some
frustration.
Thanks a lot,
Dominik

On Thursday 09 November 2006 18:28, Goodwin Lawlor 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
> 

-- 
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061110/d09b91b9/attachment-0001.pgp>


More information about the vtkusers mailing list