From 70b0ad241ea65582f22baabf817f84cd9a28bb58 Mon Sep 17 00:00:00 2001 From: akl Date: Wed, 23 Jul 2014 11:57:20 +0400 Subject: [PATCH] Improving graphical 'Unpublish' functionality to hide also references of the given objects. It is done according to 17816 note in 0022472 (EDF 2690 GEOM: Keep only some terminal objects and its parents) issue. --- src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 7 +++++++ src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 2ca503aae..6cc902366 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -590,6 +590,13 @@ void GEOMToolsGUI::OnUnpublishObject() { _PTR(AttributeDrawable) aDrw = B->FindOrCreateAttribute( obj, "AttributeDrawable" ); aDrw->SetDrawable( false ); disp->EraseWithChildren(IObject); + // hide references if any + std::vector< _PTR(SObject) > vso = aStudy->FindDependances(obj); + for ( int i = 0; i < vso.size(); i++ ) { + _PTR(SObject) refObj = vso[i]; + aDrw = B->FindOrCreateAttribute( refObj, "AttributeDrawable" ); + aDrw->SetDrawable( false ); + } } // if ( obj ) } // iterator aSelMgr->clearSelected(); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx index 514a5f200..17c3a2b3f 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx @@ -340,6 +340,13 @@ void GEOMToolsGUI_PublishDlg::clickOnApply() { item->setData(0,Qt::CheckStateRole,QVariant()); } } + // show references if any + std::vector< _PTR(SObject) > vso = aStudy->FindDependances(SO); + for ( int i = 0; i < vso.size(); i++ ) { + _PTR(SObject) refObj = vso[i]; + aDrw = aBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" ); + aDrw->SetDrawable( true ); + } } } toProcess.clear(); -- 2.39.2