From: Paul RASCLE Date: Sun, 27 Sep 2020 18:06:41 +0000 (+0200) Subject: bug in GUI calculation case or complete case: Graphic3D_GraphicDriver::insertLayerBef... X-Git-Tag: SH_V2_2_0~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e10540448006932a3664214f8a530aa8d600722c;p=modules%2Fhydro.git bug in GUI calculation case or complete case: Graphic3D_GraphicDriver::insertLayerBefore, Layer with the LayerId already exists (!myLayerId.IsBound(theNewLayerId)) --- 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;