]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESHGUI/SMESHGUI.cxx
Salome HOME
Issue 0020406: Time compilation when recompiling
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index effeeb30d40cc7c5a7c929e6bf168c623ae76fe1..dc4cd6c452670b1a3cab36145107b70a0b7bc5a0 100644 (file)
@@ -24,7 +24,7 @@
 //  Author : Nicolas REJNERI
 //  Module : SMESH
 //  $Header$
-//
+
 #include "SMESHGUI.h"
 
 #include "SMESH_Client.hxx"
@@ -2017,11 +2017,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         if ( !aHypothesis->_is_nil() )
         {
           CORBA::String_var aHypType = aHypothesis->GetName();
-          SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypType);
-          if (aCreator)
+          // BUG 0020378
+          //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypType);
+          SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypType);
+          if (aCreator) {
             aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop() );
-          else
-          {
+          }
+          else {
             // report error
           }
         }
@@ -3107,7 +3109,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   // Clipping
   //-------------------------------------------------
   popupMgr()->insert( action( 1134 ), -1, -1 );
-  popupMgr()->setRule( action( 1134 ), aMeshInVTK + "&& isVisible", true );
+  popupMgr()->setRule( action( 1134 ), aMeshInVTK + "&& selcount=1 && isVisible", true );
 
   popupMgr()->insert( separator(), -1, -1 );
 
@@ -3252,6 +3254,14 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
   action(  33)->setEnabled(true); // Delete: Key_Delete
   action(1101)->setEnabled(true); // Rename: Key_F2
 
+  //  0020210. Make SMESH_Gen update meshes at switching GEOM->SMESH
+  GetSMESHGen()->SetCurrentStudy(SALOMEDS::Study::_nil());
+  if ( SalomeApp_Study* s = dynamic_cast<SalomeApp_Study*>( study ))
+    if ( _PTR(Study) aStudy = s->studyDS()) {
+      GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
+      updateObjBrowser(); // objects can be removed
+    }
+
   return res;
 }