[vtkusers] Re: timer example

Dominik Szczerba domi at vision.ee.ethz.ch
Thu Nov 9 16:36:42 EST 2006


Aaarrrgggs, I was missing only one word in my code!

iren->AddObserver(vtkCommand::TimerEvent, command3);

and NOT as I was doing by some stupid mistake:

ren1->AddObserver(vtkCommand::TimerEvent, command3);

(with iren vtkRenderWindowInteractor and ren1 a vtkRenderer)

Unfortunately there was no compilation error message.

David, Goodwin, thanks a lot, your examples were most helpful to put me on the right track.

regards,
Dominik

PS.

On Thursday 09 November 2006 18:42, David Cole wrote:
> 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
> >
> 

-- 
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/20061109/becca905/attachment.pgp>


More information about the vtkusers mailing list