]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0022472: EDF 2690 Reduce Study: Delete cyclic dependency
authormpa <mpa@opencascade.com>
Wed, 2 Jul 2014 12:14:57 +0000 (16:14 +0400)
committermpa <mpa@opencascade.com>
Wed, 2 Jul 2014 12:14:57 +0000 (16:14 +0400)
src/DependencyTree/CMakeLists.txt
src/DependencyTree/DependencyTree_ViewModel.cxx
src/DependencyTree/DependencyTree_ViewModel.h
src/GEOMGUI/GeometryGUI.cxx

index 7a4cce20388ad11d9196c1f25d1c52d9a004e9ec..9cff0967531f3923cbb44af0434a803f077dfbf2 100644 (file)
@@ -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 ---
index 3c03d67acd88f7d2e847d3ec905f04d487eda13a..e6c853008bd140760a7284ef01928bbd197e482c 100644 (file)
@@ -31,7 +31,7 @@
 
 // GEOM includes
 #include <GEOM_Displayer.h>
-#include <GEOMToolsGUI_ReduceStudyDlg.h>
+#include <GeometryGUI_Operations.h>
 
 // QT includes
 #include <QMenu>
@@ -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<DependencyTree_View*>( 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<GeometryGUI*>( 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 ) );
     }
   }
 }
index ffc3d76079583a7d52a2f47320b68c82e437b0e5..9bac8cbce8ca0bba3a61c95a3c0e63cc4a91157e 100644 (file)
@@ -41,7 +41,6 @@ private slots:
 
   void          onShowSelected();
   void          onShowOnlySelected();
-  void          onReduceStudy();
 
 };
 
index c3cba1b416c5cf9af85c2116402d0b227262fd1c..43e865ae9e7153d9abadb4bed5e73d98a4ee0cf9 100644 (file)
@@ -65,6 +65,8 @@
 #include <SVTK_InteractorStyle.h>
 #include <SVTK_ViewModel.h>
 
+#include <GraphicsView_Viewer.h>
+
 #include <SalomeApp_Application.h>
 #include <SalomeApp_DataObject.h>
 #include <SalomeApp_Study.h>
@@ -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<int> 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);
   }