From 92d280bfed04a1b7082473ed42c328029f003d1b Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 8 Sep 2005 14:36:00 +0000 Subject: [PATCH] To improve SVTK package class hierarchy --- src/VISUGUI/VisuGUI.cxx | 2 +- src/VISUGUI/VisuGUI_Module.cxx | 15 ++++++++------- src/VISU_I/VISU_ViewManager_i.cc | 2 +- src/VVTK/VVTK_ViewModel.cxx | 10 +++++----- src/VVTK/VVTK_ViewWindow.cxx | 13 +++++++------ 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 9963f7cd..38f90691 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1566,7 +1566,7 @@ OnSweep() float aPercents = float(i)/aSteps; aPrsObject->SetMapScale(aPercents); aPrsObject->UpdateActor(aActor); - vw->getRenderWindow()->getRenderWindow()->Render(); + vw->getRenderWindow()->Render(); usleep(aTemp); } } diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 09da9b3c..89cdc342 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -48,6 +48,7 @@ #include "SVTK_ViewModel.h" #include "SVTK_ViewManager.h" #include "SVTK_Event.h" +#include "SVTK_View.h" #include "VisuGUI_Prs3dTools.h" @@ -412,31 +413,31 @@ VisuGUI_Module return; SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - SVTK_View* view = viewWindow->getView(); + SVTK_MainWindow* aMainWindow = viewWindow->getMainWindow(); int val; if ( pref == "speed_increment" ) { val = resMgr->integerValue( "VISU", pref, 10 ); - view->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val ); + aMainWindow->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val ); } else if ( pref == "spacemouse_func1_btn" ) { val = resMgr->integerValue( "VISU", pref, 1 ); - view->InvokeEvent( SVTK::SetSpaceMouseF1Event, &val ); + aMainWindow->InvokeEvent( SVTK::SetSpaceMouseF1Event, &val ); } else if ( pref == "spacemouse_func2_btn" ) { val = resMgr->integerValue( "VISU", pref, 2 ); - view->InvokeEvent( SVTK::SetSpaceMouseF2Event, &val ); + aMainWindow->InvokeEvent( SVTK::SetSpaceMouseF2Event, &val ); } else if ( pref == "spacemouse_func3_btn" ) { val = resMgr->integerValue( "VISU", pref, 10 ); - view->InvokeEvent( SVTK::SetSpaceMouseF3Event, &val ); + aMainWindow->InvokeEvent( SVTK::SetSpaceMouseF3Event, &val ); } else if ( pref == "spacemouse_func4_btn" ) { val = resMgr->integerValue( "VISU", pref, 11 ); - view->InvokeEvent( SVTK::SetSpaceMouseF4Event, &val ); + aMainWindow->InvokeEvent( SVTK::SetSpaceMouseF4Event, &val ); } else if ( pref == "spacemouse_func5_btn" ) { val = resMgr->integerValue( "VISU", pref, 9 ); - view->InvokeEvent( SVTK::SetSpaceMouseF5Event, &val ); + aMainWindow->InvokeEvent( SVTK::SetSpaceMouseF5Event, &val ); } } diff --git a/src/VISU_I/VISU_ViewManager_i.cc b/src/VISU_I/VISU_ViewManager_i.cc index 849322e4..b3b88b49 100644 --- a/src/VISU_I/VISU_ViewManager_i.cc +++ b/src/VISU_I/VISU_ViewManager_i.cc @@ -279,7 +279,7 @@ namespace VISU { { SVTK_ViewWindow* vf = GetViewWindow(theViewWindow); vf->getRenderer()->ResetCameraClippingRange(); - vf->getRenderWindow()->getRenderWindow()->Render(); + vf->getRenderWindow()->Render(); } VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs) diff --git a/src/VVTK/VVTK_ViewModel.cxx b/src/VVTK/VVTK_ViewModel.cxx index c1cd2bdb..cb58635a 100644 --- a/src/VVTK/VVTK_ViewModel.cxx +++ b/src/VVTK/VVTK_ViewModel.cxx @@ -68,7 +68,7 @@ VVTK_Viewer thePopup->insertSeparator(); if(TViewWindow* aView = dynamic_cast(myViewManager->getActiveView())){ - if ( !aView->getView()->getToolBar()->isVisible() ){ + if ( !aView->getMainWindow()->getToolBar()->isVisible() ){ thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) ); } } @@ -83,7 +83,7 @@ VVTK_Viewer QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(TViewWindow* aView = dynamic_cast(aViews.at(i))){ - aView->getView()->update(); + aView->getMainWindow()->Repaint(); } } } @@ -125,7 +125,7 @@ VVTK_Viewer for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){ if(TViewWindow* aView = dynamic_cast(aViewWindow)){ - aView->setBackgroundColor(theColor); + aView->getMainWindow()->setBackgroundColor(theColor); } } } @@ -150,7 +150,7 @@ VVTK_Viewer QPtrVector aViews = aViewManager->getViews(); for ( int i = 0; i < aViews.count(); i++ ){ if(TViewWindow* aView = dynamic_cast(aViews.at( i ))){ - aView->SetTrihedronSize( theSize ); + aView->getMainWindow()->SetTrihedronSize( theSize ); } } } @@ -184,7 +184,7 @@ VVTK_Viewer QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(TViewWindow* aView = dynamic_cast(aViews.at(i))){ - aView->getView()->getToolBar()->show(); + aView->getMainWindow()->getToolBar()->show(); } } } diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx index b7caabad..f20d526d 100755 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ b/src/VVTK/VVTK_ViewWindow.cxx @@ -34,14 +34,15 @@ VVTK_ViewWindow QSplitter* aSplitter = new QSplitter(Qt::Vertical,aWidget); // Create SVTK_View (successor of RenderWindowInteractor). - myView = new SVTK_View(aSplitter,"SVTK_View",aResourceMgr); + myMainWindow = new SVTK_MainWindow(aSplitter,"SVTK_MainWindow",aResourceMgr); + myView = new SVTK_View(myMainWindow); // important! : the default interactor style which is pushed is VVTK // see onSwitchIS() for details - myView->PushInteractorStyle(VVTK_InteractorStyle::New()); + myMainWindow->PushInteractorStyle(VVTK_InteractorStyle::New()); // create another toolbar - myToolBar = new QToolBar(myView); + myToolBar = new QToolBar(myMainWindow); myToolBar->setCloseMode(QDockWindow::Undocked); myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL")); @@ -93,9 +94,9 @@ VVTK_ViewWindow // if SVTK is a current one - pop it (remove from stack), below it there MUST BE // (logically) a VVTK interactor style. if ( theIsVVTKStyle ) - getView()->PopInteractorStyle(); + getMainWindow()->PopInteractorStyle(); else - getView()->PushInteractorStyle( SVTK_InteractorStyle::New() ); + getMainWindow()->PushInteractorStyle( SVTK_InteractorStyle::New() ); } void @@ -103,5 +104,5 @@ VVTK_ViewWindow ::OnSelectionModeSwitch(bool theIsSelectionOn) { Selection_Mode aMode = theIsSelectionOn? NodeSelection: ActorSelection; - getView()->SetSelectionMode(aMode); + getMainWindow()->SetSelectionMode(aMode); } -- 2.39.2