From 5d50f7036320ddc848bdc4473bef34aeebb75e0c Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sat, 14 Nov 2020 23:21:46 +0100 Subject: [PATCH] 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... --- src/HYDROGUI/HYDROGUI_ZLayers.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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; } -- 2.39.2