]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
patch on regression in land cover map coloring and transparency
authorasl <asl@opencascade.com>
Tue, 17 Nov 2015 08:26:34 +0000 (11:26 +0300)
committerasl <asl@opencascade.com>
Tue, 17 Nov 2015 08:26:34 +0000 (11:26 +0300)
src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx
src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx
src/HYDROGUI/HYDROGUI_Shape.cxx
src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx

index 777ebf39782efe16c250ac0db4ed4d962ec2da7c..cb073ade21cd7d91db68e65683ac16b88f1179f9 100644 (file)
@@ -440,15 +440,11 @@ void HYDROGUI_LandCoverMapOp::onCreatePreview()
 
   if ( aViewManager && myPreviewPrs && !myEditedObject.IsNull() )
   {
-    TopoDS_Shape aLandCoverMapShape = myEditedObject->GetShape();
-    if( !aLandCoverMapShape.IsNull() )
-    {
-      if ( myOperationId == RemoveLandCoverId ||
-           myOperationId == MergeLandCoverId ||
-           myOperationId == ChangeLandCoverTypeId )
-        myPreviewPrs->setSelectionMode( AIS_Shape::SelectionMode( TopAbs_FACE ) ); 
-      myPreviewPrs->setShape( aLandCoverMapShape );      
-    }
+    myPreviewPrs->update( false, false );      
+    if ( myOperationId == RemoveLandCoverId ||
+         myOperationId == MergeLandCoverId ||
+         myOperationId == ChangeLandCoverTypeId )
+      myPreviewPrs->setSelectionMode( AIS_Shape::SelectionMode( TopAbs_FACE ) ); 
   }
   
   module()->update( UF_OCCViewer | UF_FitAll );
index aa5a6fe75924d97bef3f89c4c341c6815c807feb..acbfad377df92a493000a37f511e301762ee98b2 100644 (file)
@@ -516,28 +516,6 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
       continue;
     }
     
-    QColor aUndefinedColor( Qt::gray );
-    aColor = aUndefinedColor;
-    // TODO
-    //QColor aColor = isLandCoverColoringOn ? aUndefinedColor : aLandCoverMap->GetFillingColor();
-    
-    if ( isLandCoverColoringOn && !aTable.IsNull() ) {
-      QString aStricklerType = "";
-        // TODO
-        //aLandCoverMap->GetStricklerType().toLatin1().constData();
-     
-      if ( aTable->HasType( aStricklerType ) ) {
-        double aStricklerCoeff = aTable->Get( aStricklerType, 0 );
-        Quantity_Color aShapeColor;
-        if ( aColorScale->FindColor( aStricklerCoeff, aShapeColor ) ) {
-          aColor = QColor( aShapeColor.Red() * 255, 
-                           aShapeColor.Green() * 255,
-                           aShapeColor.Blue() * 255 );
-        }
-      }
-    }    
-    
-    aLandCoverMapShape->setFillingColor( aColor, true, true );
     aLandCoverMapShape->setScalarMapModeEnabled( isLandCoverColoringOn );
     theViewer->getAISContext()->Redisplay( aLandCoverMapShape->getAISObject() );
   }
index 133873a9189fd2aa1e3dcabcf38361f86d46e435..ba8a9d8fb85d1094aedfa3ac9270371762d13660 100644 (file)
@@ -561,7 +561,7 @@ void HYDROGUI_Shape::updateShape( const bool theToDisplay,
   const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes();
   if ( !anAttributes.IsNull() )
   {
-    if ( myDisplayMode == AIS_Shaded )
+    if ( myDisplayMode == AIS_Shaded && myFillingColor.isValid() )
     {
       Quantity_Color aFillingColor( getQuantityColorVal( myFillingColor.red() ), 
                                     getQuantityColorVal( myFillingColor.green() ),
index 450a195e7525a4e0e580cdede2acfca2d3d4757f..de07a5b555496cf2dde81591a3fec57647b5b384 100644 (file)
@@ -41,6 +41,7 @@ HYDROGUI_ShapeLandCoverMap::HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* t
   myDisplayer( theDisplayer ),
   myIsScalarMapMode( theIsScalarMode )
 {
+  setFillingColor( QColor(), false, false );
 }
 
 HYDROGUI_ShapeLandCoverMap::~HYDROGUI_ShapeLandCoverMap()