[vtkusers] timer example
David Cole
david.cole at kitware.com
Thu Nov 9 09:10:55 EST 2006
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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061109/0cb8f4a8/attachment.htm>
More information about the vtkusers
mailing list