Salome HOME
0021179: EDF 1654 SMESH GEOM: better look'n'feel
[modules/geom.git] / src / GroupGUI / GroupGUI_GroupDlg.cxx
index 4cc1e2cb56413d17893bd1ecad393fa6c2449448..d3c7e224a00ee1dcd9781f73f9594c43c287949a 100644 (file)
@@ -474,7 +474,7 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
         }
         myMainObj = anObj;
         myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
-        // activate subshapes selection by default
+        // activate sub-shapes selection by default
         myEditCurrentArgument = 0;
         activateSelection();
         updateState();
@@ -620,9 +620,23 @@ void GroupGUI_GroupDlg::showOnlySelected()
     aDisplayer->Erase(aSelList, /*forced=*/false, /*updateViewer=*/true);
   }
   else {
+    // Mantis issue 0021421: do not hide main shape, if explode on VERTEX
+    SALOME_View* view = GEOM_Displayer::GetActiveView();
+    if (view) {
+      CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
+      Handle(SALOME_InteractiveObject) io =
+        new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
+      if (view->isVisible(io)) myIsHiddenMain = true;
+    }
+
     aDisplayer->EraseAll(/*forced = false, updateViewer = true*/);
     aDisplayer->Display(aSelList, true);
 
+    // Mantis issue 0021421: do not hide main shape, if explode on VERTEX
+    if (getShapeType() == TopAbs_VERTEX && myIsHiddenMain) {
+      aDisplayer->Display(myMainObj);
+    }
+
     // for the case when selected ids were not displayed in the viewer: Mantis issue 0021367
     highlightSubShapes();
   }
@@ -807,13 +821,22 @@ void GroupGUI_GroupDlg::activateSelection()
       myIsShapeType) // check if shape type is already choosen by user
   {
     GEOM_Displayer* aDisplayer = getDisplayer();
-    SALOME_View* view = GEOM_Displayer::GetActiveView();
-    if (view) {
-      CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
-      Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
-      if (view->isVisible(io)) {
-        aDisplayer->Erase(myMainObj, false, false);
-        myIsHiddenMain = true;
+
+    // Mantis issue 0021421: do not hide main shape, if explode on VERTEX
+    if (getShapeType() == TopAbs_VERTEX) {
+      if (myIsHiddenMain)
+        aDisplayer->Display(myMainObj);
+    }
+    else {
+      SALOME_View* view = GEOM_Displayer::GetActiveView();
+      if (view) {
+        CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
+        Handle(SALOME_InteractiveObject) io =
+          new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
+        if (view->isVisible(io)) {
+          aDisplayer->Erase(myMainObj, false, false);
+          myIsHiddenMain = true;
+        }
       }
     }
 
@@ -973,7 +996,7 @@ void GroupGUI_GroupDlg::highlightSubShapes()
 
   SALOME_ListIO aSelList;
 
-  // To highlight the selected subshape in Object Browser, if it's already published under the main shape
+  // To highlight the selected sub-shape in Object Browser, if it's already published under the main shape
   GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId());
   QMap<int, QString> childsMap;
   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());