From: akl Date: Tue, 29 Apr 2014 06:59:48 +0000 (+0400) Subject: Additional variable with visibility state of main shape at opening 'Create/Edit group... X-Git-Tag: V7_4_0rc1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=15ea376466e71cc59ed3782044bf9c6b5a685b1f;p=modules%2Fgeom.git Additional variable with visibility state of main shape at opening 'Create/Edit group' dialog was added in order to restore it after closing dialog. --- diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index 8ccd2afec..fa50a5357 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -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; diff --git a/src/GroupGUI/GroupGUI_GroupDlg.h b/src/GroupGUI/GroupGUI_GroupDlg.h index 8b1391f3e..fe43e2221 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.h +++ b/src/GroupGUI/GroupGUI_GroupDlg.h @@ -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;