[vtk-developers] Bug in vtkXRenderWindowInteractor or vtkInteractorEventRecorder?

Wilson, Andrew T atwilso at sandia.gov
Thu Mar 9 20:49:32 EST 2006


I'm trying to use vtkInteractorEventRecorder to capture and play back a
user's actions.  I've written a trivial program to try to test it, but
when I call SetEnabled(1) to try to make the recorder actually record,
the application puts up a render window and then exits immediately.


I've tracked it down to the following code right at the beginning of
vtkXRenderWindowInteractor::Start.  There's analogous code in
vtkWin32RenderWindowInteractor::Start.  I haven't checked the Mac code.


void vtkXRenderWindowInteractor::Start()
{
  // Let the compositing handle the event loop if it wants to.
  if (this->HasObserver(vtkCommand::StartEvent))
    {
    this->InvokeEvent(vtkCommand::StartEvent,NULL);
    return;
    }

Since vtkInteractorEventRecorder listens to *every* event, this test
returns true.  In this context this is clearly the wrong thing.  

What would be a good solution to this?  Perhaps a flag on the interactor
that a compositor can set if it wants to handle the event loop?  That
would seem like a clearer solution than assuming that anyone listening
for StartEvent wants to handle events.

-- Andy




More information about the vtk-developers mailing list