From: asl Date: Wed, 18 Nov 2015 07:30:10 +0000 (+0300) Subject: refs #716: blinking land cover map on show/hide other objects X-Git-Tag: v1.5~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4b3c94634c8f0fdb61e8ccbc7fd5a78d292a58ca;p=modules%2Fhydro.git refs #716: blinking land cover map on show/hide other objects --- diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index 5e75369f..b7505b0c 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -509,7 +509,6 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer continue; } - QColor aColor; Handle(HYDROData_LandCoverMap) aLandCoverMap = Handle(HYDROData_LandCoverMap)::DownCast( aLandCoverMapShape->getObject() ); @@ -517,8 +516,12 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer continue; } - aLandCoverMapShape->setScalarMapModeEnabled( isLandCoverColoringOn ); - theViewer->getAISContext()->Redisplay( aLandCoverMapShape->getAISObject() ); + bool isScalarMode = aLandCoverMapShape->isScalarMapModeEnabled(); + if( isScalarMode != isLandCoverColoringOn ) + { + aLandCoverMapShape->setScalarMapModeEnabled( isLandCoverColoringOn ); + theViewer->getAISContext()->Redisplay( aLandCoverMapShape->getAISObject() ); + } } myToUpdateColorScale = false; diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx index de07a5b5..0a6b59ab 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx @@ -67,6 +67,11 @@ void HYDROGUI_ShapeLandCoverMap::update( bool theIsUpdateViewer, bool isDeactiva HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection ); } +bool HYDROGUI_ShapeLandCoverMap::isScalarMapModeEnabled() const +{ + return myIsScalarMapMode; +} + void HYDROGUI_ShapeLandCoverMap::setScalarMapModeEnabled( const bool theIsToEnable ) { myIsScalarMapMode = theIsToEnable; diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h index 9fdc6e83..263c2329 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h @@ -45,6 +45,7 @@ public: virtual void setVisible( const bool theState, const bool theIsUpdateViewer = true ); + bool isScalarMapModeEnabled() const; /** * Enable/disable scalar map coloring mode. * @param theIsToEnable if true - scalar map coloring mode willbe enbaled, if false - disabled