From: Paul RASCLE Date: Sat, 14 Nov 2020 22:21:46 +0000 (+0100) Subject: Still an error on ZLayers related to edit CalculationCase The call to createViewManag... X-Git-Tag: SH_V2_2_0~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d50f7036320ddc848bdc4473bef34aeebb75e0c;p=modules%2Fhydro.git Still an error on ZLayers related to edit CalculationCase The call to createViewManager induces the bug: 5 calls in HYDRO related to edition. The bug is related to the change introduced in Occt 1c728f2d6d660 (0030668: Visualization - revise adding ZLayer API) 20190715 The old implementation uses a try catch in occt, reproduced here. Access to layer order is not possible in these temporary view managers. Previous correction: solve bugs #22296, #22298: Error on ZLayers (Graphic3d_GraphicDriver::InsertLayerBefore) on second study... is still useful to allow ZLayers order changes on second study... --- diff --git a/src/HYDROGUI/HYDROGUI_ZLayers.cxx b/src/HYDROGUI/HYDROGUI_ZLayers.cxx index d44736bd..fe1f1d45 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers.cxx +++ b/src/HYDROGUI/HYDROGUI_ZLayers.cxx @@ -74,9 +74,18 @@ int CreateTopZLayer( const Handle(V3d_Viewer)& theViewer3d ) DEBTRACE("CreateTopZLayer"); int aTopZLayer = Graphic3d_ZLayerId_Top; - if ( theViewer3d && !theViewer3d->AddZLayer( aTopZLayer ) ) { - aTopZLayer = Graphic3d_ZLayerId_Top; - } + if ( theViewer3d ) //&& !theViewer3d->AddZLayer( aTopZLayer ) ) { + { + try + { + theViewer3d->AddZLayer( aTopZLayer ); + } + catch (...) + { + DEBTRACE("Add ZLayer not possible"); + aTopZLayer = Graphic3d_ZLayerId_Top; + } + } DEBTRACE(" aTopZLayer: " << aTopZLayer); return aTopZLayer; }