[vtkusers] timer example

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


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


More information about the vtkusers mailing list