From b0494784bfbd2e6f5d970ec03a847d1282050494 Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 2 Jul 2014 16:14:57 +0400 Subject: [PATCH] 0022472: EDF 2690 Reduce Study: Delete cyclic dependency --- src/DependencyTree/CMakeLists.txt | 2 -- .../DependencyTree_ViewModel.cxx | 18 ++++-------------- src/DependencyTree/DependencyTree_ViewModel.h | 1 - src/GEOMGUI/GeometryGUI.cxx | 5 ++++- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/DependencyTree/CMakeLists.txt b/src/DependencyTree/CMakeLists.txt index 7a4cce203..9cff09675 100644 --- a/src/DependencyTree/CMakeLists.txt +++ b/src/DependencyTree/CMakeLists.txt @@ -32,7 +32,6 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/OBJECT ${PROJECT_SOURCE_DIR}/src/GEOMUtils ${PROJECT_SOURCE_DIR}/src/GEOMClient - ${PROJECT_SOURCE_DIR}/src/GEOMToolsGUI ${PROJECT_BINARY_DIR}/idl ) @@ -51,7 +50,6 @@ SET(_link_LIBRARIES ${GUI_GraphicsView} GEOM GEOMBase - GEOMToolsGUI ) # --- headers --- diff --git a/src/DependencyTree/DependencyTree_ViewModel.cxx b/src/DependencyTree/DependencyTree_ViewModel.cxx index 3c03d67ac..e6c853008 100644 --- a/src/DependencyTree/DependencyTree_ViewModel.cxx +++ b/src/DependencyTree/DependencyTree_ViewModel.cxx @@ -31,7 +31,7 @@ // GEOM includes #include -#include +#include // QT includes #include @@ -113,18 +113,6 @@ void DependencyTree_ViewModel::onShowOnlySelected() } } -//================================================================================= -// function : onReduceStudy() -// purpose : slot for showing dialog box "Reduce Study" -//================================================================================= -void DependencyTree_ViewModel::onReduceStudy() -{ - DependencyTree_View* viewPort = dynamic_cast( getActiveViewPort() ); - QDialog* dlg = new GEOMToolsGUI_ReduceStudyDlg( viewPort ); - if( dlg != NULL ) - dlg->show(); -} - //================================================================================= // function : contextMenuPopup() // purpose : process calling of context menu popup @@ -137,12 +125,14 @@ void DependencyTree_ViewModel::contextMenuPopup( QMenu* theMenu ) { int aNbSelected = viewPort->nbSelected(); if( aNbSelected > 0 ) { + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + GeometryGUI* aGeomGUI = dynamic_cast( app->module( "Geometry" ) ); theMenu->clear(); theMenu->addAction( tr( "MEN_DISPLAY" ), this, SLOT( onShowSelected() ) ); theMenu->addAction( tr( "MEN_DISPLAY_ONLY" ), this, SLOT( onShowOnlySelected() ) ); theMenu->addAction( tr( "MEN_REBUILD_THE_TREE"), viewPort, SLOT( onRebuildModel() ) ); theMenu->addSeparator(); - theMenu->addAction( tr( "MEN_REDUCE_STUDY" ), this, SLOT( onReduceStudy() ) ); + theMenu->addAction( aGeomGUI->action( GEOMOp::OpReduceStudy ) ); } } } diff --git a/src/DependencyTree/DependencyTree_ViewModel.h b/src/DependencyTree/DependencyTree_ViewModel.h index ffc3d7607..9bac8cbce 100644 --- a/src/DependencyTree/DependencyTree_ViewModel.h +++ b/src/DependencyTree/DependencyTree_ViewModel.h @@ -41,7 +41,6 @@ private slots: void onShowSelected(); void onShowOnlySelected(); - void onReduceStudy(); }; diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index c3cba1b41..43e865ae9 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -65,6 +65,8 @@ #include #include +#include + #include #include #include @@ -433,6 +435,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam ) SUIT_ViewWindow* window = desk->activeWindow(); bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); + bool ViewDep = ( window && window->getViewManager()->getType() == GraphicsView_Viewer::Type() ); // if current viewframe is not of OCC and not of VTK type - return immediately // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example) QList NotViewerDependentCommands; @@ -447,7 +450,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam ) << GEOMOp::OpPointMarker << GEOMOp::OpCreateFolder << GEOMOp::OpSortChildren; - if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommands.contains( id ) ) { + if ( !ViewOCC && !ViewVTK && !ViewDep && !NotViewerDependentCommands.contains( id ) ) { // activate OCC viewer getApp()->getViewManager(OCCViewer_Viewer::Type(), /*create=*/true); }