From: asl Date: Wed, 14 Dec 2005 06:45:20 +0000 (+0000) Subject: PAL10810 - "Display", "Erase", "Display only" on root objects X-Git-Tag: T_Before_Join_BR_3_1_0deb~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ba08289aee93b054051fbf68167bb63e27120af8;p=modules%2Fvisu.git PAL10810 - "Display", "Erase", "Display only" on root objects --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 13ec0762..4284985d 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -610,9 +610,11 @@ OnDisplayPrs() if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs"); QApplication::setOverrideCursor(Qt::waitCursor); - SALOME_ListIO aList; + SALOME_ListIO aSel, aList; LightApp_SelectionMgr* mgr = GetSelectionMgr(this); - mgr->selectedObjects(aList); + mgr->selectedObjects( aSel ); + + extractContainers( aSel, aList ); Handle(SALOME_InteractiveObject) anIO; for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { @@ -686,9 +688,11 @@ OnErasePrs() if (vw) vw->unHighlightAll(); - SALOME_ListIO aList; + SALOME_ListIO aList, aSel; LightApp_SelectionMgr* mgr = GetSelectionMgr(this); - mgr->selectedObjects(aList); + mgr->selectedObjects( aSel ); + + extractContainers( aSel, aList ); Handle(SALOME_InteractiveObject) anIO; for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { @@ -2493,16 +2497,17 @@ createPopupMenus() QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")"; QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)"; QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")"; + QString aComponent = "( selcount=1 and canBeDisplayed )"; - QString anEraseRule = "selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible + - " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + ")))"; + QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible + + " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent; - QString aDisplayRule = "selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible + - " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + ")))"; + QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible + + " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or" + aComponent; - QString aDOnlyRule = "selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})" + QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})" " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or" - " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'}))))"; + " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent; mgr->setRule( action( VISU_ERASE ), anEraseRule, true ); mgr->setRule( action( VISU_DISPLAY ), aDisplayRule, true ); diff --git a/src/VISUGUI/VisuGUI_Displayer.cxx b/src/VISUGUI/VisuGUI_Displayer.cxx index bcfffa77..68d8f28b 100644 --- a/src/VISUGUI/VisuGUI_Displayer.cxx +++ b/src/VISUGUI/VisuGUI_Displayer.cxx @@ -224,6 +224,9 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie if( CORBA::is_nil( anObj ) ) return false; + if( study->isComponent( entry ) ) + return true; + if( viewer_type==SVTK_Viewer::Type() ) { VISU::Prs3d_i* thePrs = dynamic_cast( VISU::GetServant( anObj ).in() );