[vtkusers] timer example

Dominik Szczerba domi at vision.ee.ethz.ch
Thu Nov 9 10:11:54 EST 2006


Oh great, iren->Initialize() finally removes a segfault on 
iren->CreateRepeatingTimer(10L). But still, how do I register my callback 
with it so it is fired every 10ms? The docu doesnt say too much about it...
thanks a lot,
Dominik

On Thursday 09 November 2006 15:10, David Cole wrote:
> Are you calling iren->Initialize() prior to CreateTimer?
> 
> On X, the render window interactor needs an App context before trying to add
> a timer event...
> 
> 
> On 11/9/06, Dominik Szczerba <domi at vision.ee.ethz.ch> wrote:
> >
> > Hi,
> >
> > The following is a simple example of a timer event invoked over a mouse
> > move:
> >
> > class MyIdleCommand : public vtkCommand{
> > public:
> >   void Execute(vtkObject* caller, unsigned long eventId, void* callData){
> >          cerr << "idle()" << endl;
> >   }
> > };
> >
> > in main:
> > ...
> > MyIdleCommand* command3 = new MyIdleCommand;
> > ...
> > iren->CreateTimer(VTKI_TIMER_UPDATE);
> > iren->AddObserver(vtkCommand::MouseMoveEvent, command3);
> >
> >
> > It works just fine, but is not much usefull: I want to figure out how to
> > make
> > it call my command every N miliceconds instead. I tried to replace
> > MouseMoveEvent with e.g. TimerEvent but it doesnt work.
> >
> > Note that
> >
> > int id = iren->CreateRepeatingTimer(10L);
> >
> > segfaults, as once reported.
> >
> > I cannot google anything out. I would appreciate if anyone could give me a
> > short hint how to get it running.
> >
> > Regards,
> > Dominik
> >
> >
> >
> > --
> > Dominik Szczerba, Ph.D.
> > Computer Vision Lab CH-8092 Zurich
> > http://www.vision.ee.ethz.ch/~domi
> >
> >
> > _______________________________________________
> > 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/4c768e34/attachment.pgp>


More information about the vtkusers mailing list