]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #716: blinking land cover map on show/hide other objects
authorasl <asl@opencascade.com>
Wed, 18 Nov 2015 07:30:10 +0000 (10:30 +0300)
committerasl <asl@opencascade.com>
Wed, 18 Nov 2015 07:30:10 +0000 (10:30 +0300)
src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx
src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx
src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h

index 5e75369fa92e3febdcebbdffee2624b854b113bc..b7505b0c0d19a980056972e8ba9df22c9b1ffa2a 100644 (file)
@@ -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;
index de07a5b555496cf2dde81591a3fec57647b5b384..0a6b59abe3394840719ac12413ed4943f8e4c2c0 100644 (file)
@@ -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;
index 9fdc6e831d81507aed66a7b26381d9d1d54e3ea5..263c23294b2478a3e6bcdf65011cd56eff45604b 100644 (file)
@@ -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