Commit 09ef95d3 authored by Karthik Krishnan's avatar Karthik Krishnan
Browse files

ENH: Fix bug #4631.

parent e4197f74
......@@ -26,7 +26,7 @@
#import <Carbon/Carbon.h>
vtkCxxRevisionMacro(vtkCarbonRenderWindowInteractor, "1.21");
vtkCxxRevisionMacro(vtkCarbonRenderWindowInteractor, "1.22");
vtkStandardNewMacro(vtkCarbonRenderWindowInteractor);
void (*vtkCarbonRenderWindowInteractor::ClassExitMethod)(void *)
......@@ -279,7 +279,7 @@ vtkCarbonRenderWindowInteractor::~vtkCarbonRenderWindowInteractor()
void vtkCarbonRenderWindowInteractor::Start()
{
// Let the compositing handle the event loop if it wants to.
if (this->HasObserver(vtkCommand::StartEvent))
if (this->HasObserver(vtkCommand::StartEvent) && !this->HandleEventLoop)
{
this->InvokeEvent(vtkCommand::StartEvent,NULL);
return;
......
......@@ -25,7 +25,7 @@
#endif
//----------------------------------------------------------------------------
vtkCxxRevisionMacro(vtkCocoaRenderWindowInteractor, "1.15");
vtkCxxRevisionMacro(vtkCocoaRenderWindowInteractor, "1.16");
vtkStandardNewMacro(vtkCocoaRenderWindowInteractor);
//----------------------------------------------------------------------------
......@@ -264,7 +264,7 @@ vtkCocoaRenderWindowInteractor::~vtkCocoaRenderWindowInteractor()
void vtkCocoaRenderWindowInteractor::Start()
{
// Let the compositing handle the event loop if it wants to.
if (this->HasObserver(vtkCommand::StartEvent))
if (this->HasObserver(vtkCommand::StartEvent) && !this->HandleEventLoop)
{
this->InvokeEvent(vtkCommand::StartEvent,NULL);
return;
......
......@@ -17,7 +17,7 @@
#include "vtkObjectFactory.h"
#include "vtkRenderWindowInteractor.h"
vtkCxxRevisionMacro(vtkInteractorEventRecorder, "1.10");
vtkCxxRevisionMacro(vtkInteractorEventRecorder, "1.11");
vtkStandardNewMacro(vtkInteractorEventRecorder);
float vtkInteractorEventRecorder::StreamVersion = 1.0;
......@@ -97,6 +97,11 @@ void vtkInteractorEventRecorder::SetEnabled(int enabling)
i->AddObserver(vtkCommand::AnyEvent, this->EventCallbackCommand,
this->Priority);
// Make sure that the interactor does not exit in response
// to a StartEvent. The Interactor has code to allow others to handle
// the event look of they want to
i->HandleEventLoop = 1;
this->InvokeEvent(vtkCommand::EnableEvent,NULL);
}
......@@ -113,6 +118,7 @@ void vtkInteractorEventRecorder::SetEnabled(int enabling)
// don't listen for events any more
this->Interactor->RemoveObserver(this->EventCallbackCommand);
this->Interactor->HandleEventLoop = 0;
this->InvokeEvent(vtkCommand::DisableEvent,NULL);
}
......
......@@ -27,7 +27,7 @@
#include "vtkObserverMediator.h"
#include <vtkstd/map>
vtkCxxRevisionMacro(vtkRenderWindowInteractor, "1.118");
vtkCxxRevisionMacro(vtkRenderWindowInteractor, "1.119");
// PIMPL'd class to keep track of timers. It maps the ids returned by CreateTimer()
// to the platform-specific representation for timer ids.
......@@ -106,6 +106,7 @@ vtkRenderWindowInteractor::vtkRenderWindowInteractor()
this->TimerMap = new vtkTimerIdMap;
this->TimerDuration = 10;
this->ObserverMediator = 0;
this->HandleEventLoop = false;
}
//----------------------------------------------------------------------
......
......@@ -56,9 +56,13 @@ class vtkInteractorObserver;
class vtkRenderWindow;
class vtkRenderer;
class vtkObserverMediator;
class vtkInteractorEventRecorder;
class VTK_RENDERING_EXPORT vtkRenderWindowInteractor : public vtkObject
{
//BTX
friend class vtkInteractorEventRecorder;
//ETX
public:
static vtkRenderWindowInteractor *New();
vtkTypeRevisionMacro(vtkRenderWindowInteractor,vtkObject);
......@@ -468,6 +472,11 @@ protected:
virtual int InternalDestroyTimer(int platformTimerId);
int GetCurrentTimerId();
//ETX
// Force the interactor to handle the Start() event loop, ignoring any
// overrides. (Overrides are registered by observing StartEvent on the
// interactor.)
int HandleEventLoop;
private:
vtkRenderWindowInteractor(const vtkRenderWindowInteractor&); // Not implemented.
......
......@@ -48,7 +48,7 @@ VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND,UINT,WPARAM,LPARAM,
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkCxxRevisionMacro(vtkWin32RenderWindowInteractor, "1.100");
vtkCxxRevisionMacro(vtkWin32RenderWindowInteractor, "1.101");
vtkStandardNewMacro(vtkWin32RenderWindowInteractor);
#endif
......@@ -101,7 +101,7 @@ vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor()
void vtkWin32RenderWindowInteractor::Start()
{
// Let the compositing handle the event loop if it wants to.
if (this->HasObserver(vtkCommand::StartEvent))
if (this->HasObserver(vtkCommand::StartEvent) && !this->HandleEventLoop)
{
this->InvokeEvent(vtkCommand::StartEvent,NULL);
return;
......
......@@ -27,7 +27,7 @@
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
vtkCxxRevisionMacro(vtkXRenderWindowInteractor, "1.129");
vtkCxxRevisionMacro(vtkXRenderWindowInteractor, "1.130");
vtkStandardNewMacro(vtkXRenderWindowInteractor);
// Initialize static members:
......@@ -191,7 +191,7 @@ void vtkXRenderWindowInteractor::BreakXtLoop(vtkObject*, unsigned long,
void vtkXRenderWindowInteractor::Start()
{
// Let the compositing handle the event loop if it wants to.
if (this->HasObserver(vtkCommand::StartEvent))
if (this->HasObserver(vtkCommand::StartEvent) && !this->HandleEventLoop)
{
this->InvokeEvent(vtkCommand::StartEvent,NULL);
return;
......
......@@ -28,7 +28,7 @@
#include <string.h>
#include <vtkTk.h>
vtkCxxRevisionMacro(vtkXRenderWindowTclInteractor, "1.52");
vtkCxxRevisionMacro(vtkXRenderWindowTclInteractor, "1.53");
vtkStandardNewMacro(vtkXRenderWindowTclInteractor);
// steal the first three elements of the TkMainInfo stuct
......@@ -144,7 +144,7 @@ static void vtkBreakTclLoop(void *iren)
void vtkXRenderWindowTclInteractor::Start()
{
// Let the compositing handle the event loop if it wants to.
if (this->HasObserver(vtkCommand::StartEvent))
if (this->HasObserver(vtkCommand::StartEvent) && !this->HandleEventLoop)
{
this->InvokeEvent(vtkCommand::StartEvent,NULL);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment