From e10540448006932a3664214f8a530aa8d600722c Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 27 Sep 2020 20:06:41 +0200 Subject: [PATCH] bug in GUI calculation case or complete case: Graphic3D_GraphicDriver::insertLayerBefore, Layer with the LayerId already exists (!myLayerId.IsBound(theNewLayerId)) --- src/HYDROGUI/HYDROGUI_ZLayers.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ZLayers.cxx b/src/HYDROGUI/HYDROGUI_ZLayers.cxx index 1d7ca667..d3aa9fc8 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers.cxx +++ b/src/HYDROGUI/HYDROGUI_ZLayers.cxx @@ -20,6 +20,7 @@ #include #include #include +#include void SetZLayerForPrs( const Handle(PrsMgr_Presentation)& thePrs, int theLayerId ); @@ -67,10 +68,10 @@ void SetZLayerSettings( const Handle(V3d_Viewer)& theViewer3d, int theLayerId, b int CreateTopZLayer( const Handle(V3d_Viewer)& theViewer3d ) { - int aTopZLayer = -1; + int aTopZLayer = Graphic3d_ZLayerId_Top; if ( theViewer3d && !theViewer3d->AddZLayer( aTopZLayer ) ) { - aTopZLayer = -1; + aTopZLayer = Graphic3d_ZLayerId_Top; } return aTopZLayer; @@ -78,7 +79,7 @@ int CreateTopZLayer( const Handle(V3d_Viewer)& theViewer3d ) HYDROGUI_ZLayersIterator::HYDROGUI_ZLayersIterator( const Handle(V3d_Viewer)& theViewer ) - : myIndex( 0 ), myNewZLayer( -1 ), myViewer( theViewer ) + : myIndex( 0 ), myNewZLayer( Graphic3d_ZLayerId_Top ), myViewer( theViewer ) { Init( theViewer ); } @@ -120,7 +121,7 @@ void HYDROGUI_ZLayersIterator::Next() int HYDROGUI_ZLayersIterator::TopLayer() const { - int aTopLayer = -1; + int aTopLayer = Graphic3d_ZLayerId_Top; if ( myNewZLayer >= 0 ) { aTopLayer = myNewZLayer; -- 2.39.2