From fb4b09b106ef988a917dd3ec519cd2250a2866ae Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 6 Jul 2012 12:41:34 +0000 Subject: [PATCH] Implementation of the issue "0021671: EDF 1829 GEOM : Bring to front selected objects (continuation)" --- src/OBJECT/SALOME_AISShape.hxx | 2 ++ src/SOCC/SOCC_ViewModel.cxx | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/OBJECT/SALOME_AISShape.hxx b/src/OBJECT/SALOME_AISShape.hxx index 0064e61de..f986ae746 100755 --- a/src/OBJECT/SALOME_AISShape.hxx +++ b/src/OBJECT/SALOME_AISShape.hxx @@ -81,6 +81,8 @@ Standard_EXPORT SALOME_AISShape(const TopoDS_Shape& shape); Standard_EXPORT virtual Handle_SALOME_InteractiveObject getIO() = 0; Standard_EXPORT virtual Standard_Boolean hasIO() = 0; Standard_EXPORT virtual Standard_Boolean isTopLevel() = 0; +Standard_EXPORT virtual Standard_Boolean switchTopLevel() = 0; +Standard_EXPORT virtual Standard_Boolean toActivate() = 0; Standard_EXPORT virtual void setTopLevel(Standard_Boolean) = 0; Standard_EXPORT virtual Standard_CString getName() = 0; Standard_EXPORT virtual void setName(const Standard_CString aName) = 0; diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 4f6d4f87d..2d586ee02 100755 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -395,7 +395,11 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) #if OCC_VERSION_LARGE > 0x06050200 Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast(anAIS); if ( !aSh.IsNull() ) { - ic->SetZLayer( aSh, aSh->isTopLevel() ? getTopLayerId() : 0 ); + bool top = (aSh->isTopLevel() && aSh->switchTopLevel()); + ic->SetZLayer( aSh, top ? getTopLayerId() : 0 ); + if(!aSh->toActivate()) { + ic->Deactivate( aSh ); + } } #endif //Register anAIS (if it has an entry) in entry2aisobjects map -- 2.39.2