From 4b3c94634c8f0fdb61e8ccbc7fd5a78d292a58ca Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 18 Nov 2015 10:30:10 +0300 Subject: [PATCH] refs #716: blinking land cover map on show/hide other objects --- src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx | 9 ++++++--- src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx | 5 +++++ src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) 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 -- 2.39.2