]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Additional variable with visibility state of main shape at opening 'Create/Edit group...
authorakl <akl@opencascade.com>
Tue, 29 Apr 2014 06:59:48 +0000 (10:59 +0400)
committerakl <akl@opencascade.com>
Tue, 29 Apr 2014 06:59:48 +0000 (10:59 +0400)
src/GroupGUI/GroupGUI_GroupDlg.cxx
src/GroupGUI/GroupGUI_GroupDlg.h

index 8ccd2afec7efb1ecf1c3d22fd0a093ae488f2a03..fa50a5357c56a610d382f9c828b82ce11847c2b7 100644 (file)
@@ -78,7 +78,8 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
     myMode(mode),
     myBusy(false),
     myIsShapeType(false),
-    myIsHiddenMain(false)
+    myIsHiddenMain(false),
+    myWasHiddenMain(true)
 {
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
@@ -192,7 +193,10 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
 GroupGUI_GroupDlg::~GroupGUI_GroupDlg()
 {
   GEOM_Displayer* aDisplayer = getDisplayer();
-  if (myIsHiddenMain) {
+  if (myWasHiddenMain) {
+    aDisplayer->Erase(myMainObj);
+    myIsHiddenMain = true;
+  } else {
     aDisplayer->Display(myMainObj);
     myIsHiddenMain = false;
   }
@@ -238,8 +242,16 @@ void GroupGUI_GroupDlg::Init()
 
         GEOM::GEOM_IGroupOperations_var anOper = GEOM::GEOM_IGroupOperations::_narrow(getOperation());
         myMainObj = anOper->GetMainShape(myGroup);
-        if (!CORBA::is_nil(myMainObj))
+        if (!CORBA::is_nil(myMainObj)) {
           myMainName->setText(GEOMBase::GetName(myMainObj));
+          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)) myWasHiddenMain = false;
+          }
+        }
 
         setShapeType((TopAbs_ShapeEnum)anOper->GetType(myGroup));
 
@@ -521,6 +533,15 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
           myIsHiddenMain = false;
         }
         myMainObj = anObj;
+        if (!CORBA::is_nil(myMainObj)) {
+          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)) myWasHiddenMain = false;
+          }
+        }
         myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
         // activate sub-shapes selection by default
         myEditCurrentArgument = 0;
index 8b1391f3e0b60d17cc85441dd8f660e1217b0d19..fe43e22213ebbee9a33bb497ed58da0216ec7d16 100644 (file)
@@ -97,6 +97,7 @@ private:
   bool                                myBusy;
   bool                                myIsShapeType;
   bool                                myIsHiddenMain;
+  bool                                myWasHiddenMain;
   GEOM::GEOM_Object_var               myMainObj;
   GEOM::GEOM_Object_var               myGroup;
   GEOM::GEOM_Object_var               myInPlaceObj;