Salome HOME
PAL10100 - just computed mesh must be selected in VTK
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index 4d9cb4fcd46a2f72a60d9b9e1cac10c1edb1eaf4..d8a0416d1925bc366a50ac709d5e5ebf52f167ec 100644 (file)
@@ -1268,10 +1268,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case 701:                                    // COMPUTE MESH
     {
       if(checkLock(aStudy)) break;
-      if ( vtkwnd ) {
-       LightApp_SelectionMgr *Sel = selectionMgr();
-       SALOME_ListIO selected; Sel->selectedObjects( selected );
 
+      LightApp_SelectionMgr *Sel = selectionMgr();
+      SALOME_ListIO selected; Sel->selectedObjects( selected );
+
+      if ( vtkwnd ) {
        int nbSel = selected.Extent();
        if (nbSel != 1){
          break;
@@ -1364,6 +1365,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
                              tr("SMESH_BUT_OK"));
       }
       updateObjBrowser();
+      Sel->setSelectedObjects( selected );
       break;
     }
 
@@ -2560,12 +2562,14 @@ void SMESHGUI::initialize( CAM_Application* app )
   createPopupItem( 801, OB, mesh );                        // CREATE_GROUP
   createPopupItem( 802, OB, subMesh );                     // CONSTRUCT_GROUP
   popupMgr()->insert( separator(), -1, 0 );
-  createPopupItem( 1100, OB, hypo, "&& $hasReference={false}" );   // EDIT HYPOTHESIS
+  createPopupItem( 1100, OB, hypo, "" /*"&& $hasReference={false}"*/ );   // EDIT HYPOTHESIS
   createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
-  createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "&& $hasReference={false}" ); // RENAME
+  createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "" /*"&& $hasReference={false}"*/ ); // RENAME
   popupMgr()->insert( separator(), -1, 0 );
-  createPopupItem( 125, OB, mesh );                        // EXPORT_MED
-  createPopupItem( 126, OB, mesh );                        // EXPORT_UNV
+
+  QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
+  createPopupItem( 125, OB, mesh, only_one_non_empty );    // EXPORT_MED
+  createPopupItem( 126, OB, mesh, only_one_non_empty );    // EXPORT_UNV
   createPopupItem( 33, OB, subMesh + " " + group );        // DELETE
   popupMgr()->insert( separator(), -1, 0 );