]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Bug #261: Problems with selection of GEOM objects in HYDRO module after opening of...
authormzn <mzn@opencascade.com>
Mon, 23 Dec 2013 07:38:48 +0000 (07:38 +0000)
committermzn <mzn@opencascade.com>
Mon, 23 Dec 2013 07:38:48 +0000 (07:38 +0000)
src/HYDROGUI/HYDROGUI_Module.cxx

index 8297a5ec06f570ce83554bf8549296f888167188..dfcc1921cd8442c5cde5a0503305d7cd17acc3ac 100644 (file)
@@ -64,6 +64,8 @@
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_UpdateFlags.h>
 
+#include <SalomeApp_Study.h>
+
 #include <OCCViewer_ViewFrame.h>
 #include <OCCViewer_ViewManager.h>
 #include <OCCViewer_ViewModel.h>
@@ -82,6 +84,9 @@
 #include <OCCViewer_ViewPort3d.h>
 
 #include <GEOMUtils.hxx>
+#include <GeometryGUI.h>
+
+#include <SALOMEDS_wrap.hxx>
 
 #include <QAction>
 #include <QApplication>
@@ -206,6 +211,21 @@ bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy )
     }
   }
 
+  // Load GEOM data
+  SalomeApp_Study* aStudy = 
+    dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
+  if ( aStudy ) {
+    SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() );
+    GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
+    if ( !aGeomEngine->_is_nil() && !aGeomEngine->_is_nil() ) {
+      SALOMEDS::StudyBuilder_var aStudyBuilder = aDSStudy->NewBuilder();
+      SALOMEDS::SComponent_wrap GEOM_var = aDSStudy->FindComponent( "GEOM" );
+      if( !GEOM_var->_is_nil() ) {
+        aStudyBuilder->LoadWith( GEOM_var, aGeomEngine );
+      }
+    }
+  }
+
   return aRes;
 }