From 4d678ea7cf2977099c0147d004402066632e240b Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 17 Nov 2015 11:26:34 +0300 Subject: [PATCH] patch on regression in land cover map coloring and transparency --- src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx | 14 +++++-------- src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx | 22 --------------------- src/HYDROGUI/HYDROGUI_Shape.cxx | 2 +- src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx | 1 + 4 files changed, 7 insertions(+), 32 deletions(-) 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() -- 2.39.2