From 3b4558cc69fd711ef5aaed914a9bc8370972ad54 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 7 Dec 2005 12:56:51 +0000 Subject: [PATCH] Fix for Bug GVIEW10640 different navigation modes on the main and segmented view --- src/VVTK/VVTK_MainWindow.cxx | 19 +++++++++++++++---- src/VVTK/VVTK_MainWindow.h | 10 ++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/VVTK/VVTK_MainWindow.cxx b/src/VVTK/VVTK_MainWindow.cxx index 1a99a7ba..f71f4056 100644 --- a/src/VVTK/VVTK_MainWindow.cxx +++ b/src/VVTK/VVTK_MainWindow.cxx @@ -436,7 +436,6 @@ void VVTK_MainWindow1::OnSegmentationSwitch() } - //---------------------------------------------------------------------------- VVTK_MainWindow2 ::VVTK_MainWindow2(QWidget* theParent, @@ -444,14 +443,26 @@ VVTK_MainWindow2 SUIT_ResourceMgr* theResourceMgr, VISU_PickingSettings* thePickingSettings, QtxAction* theStyleSwitchAction): - VVTK_MainWindow(theParent,theName,theResourceMgr) + VVTK_MainWindow(theParent,theName,theResourceMgr), + myStyleSwitchAction(theStyleSwitchAction) { myInteractorStyle->SetPickingSettings(thePickingSettings); - - connect(theStyleSwitchAction, SIGNAL(toggled(bool)), this, SLOT(OnInteractorStyleSwitch(bool))); } VVTK_MainWindow2 ::~VVTK_MainWindow2() {} + +//---------------------------------------------------------------------------- +void +VVTK_MainWindow2 +::Initialize(SVTK_RenderWindowInteractor* theInteractor) +{ + VVTK_MainWindow::Initialize(theInteractor); + + if( myStyleSwitchAction->isOn() ) + PushInteractorStyle(myInteractorStyle.GetPointer()); + connect(myStyleSwitchAction, SIGNAL(toggled(bool)), this, SLOT(OnInteractorStyleSwitch(bool))); +} + diff --git a/src/VVTK/VVTK_MainWindow.h b/src/VVTK/VVTK_MainWindow.h index 608b8cc0..631bb94b 100644 --- a/src/VVTK/VVTK_MainWindow.h +++ b/src/VVTK/VVTK_MainWindow.h @@ -183,6 +183,16 @@ public: //! Destroy instance of the class virtual ~VVTK_MainWindow2(); + + //! Reimplement SVTK_MainWindow::Initialize + virtual + void + Initialize(SVTK_RenderWindowInteractor* theInteractor); + + protected: + // Refer to the VVTK_MainWindow1::myStyleSwitchAction instance + QtxAction* myStyleSwitchAction; + }; -- 2.39.2