From: asl Date: Tue, 17 Nov 2015 08:26:34 +0000 (+0300) Subject: patch on regression in land cover map coloring and transparency X-Git-Tag: v1.5~29^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4d678ea7cf2977099c0147d004402066632e240b;p=modules%2Fhydro.git patch on regression in land cover map coloring and transparency --- diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx index 777ebf39..cb073ade 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx @@ -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 ); diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index aa5a6fe7..acbfad37 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -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() ); } diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 133873a9..ba8a9d8f 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -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() ), diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx index 450a195e..de07a5b5 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx @@ -41,6 +41,7 @@ HYDROGUI_ShapeLandCoverMap::HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* t myDisplayer( theDisplayer ), myIsScalarMapMode( theIsScalarMode ) { + setFillingColor( QColor(), false, false ); } HYDROGUI_ShapeLandCoverMap::~HYDROGUI_ShapeLandCoverMap()