X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_OCCDisplayer.cxx;h=de674e8b413e1688fcd0962af2b346c3449ba316;hb=ef936bf277f0a8a4904b80e3bb8d83a316418d1a;hp=feed7992d67883154a4baa224d5ff72824a839de;hpb=988bd1963f29e4e923cf3fd6c06cf9033f7670ae;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index feed7992..de674e8b 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -294,7 +294,7 @@ void HYDROGUI_OCCDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs, } } else if ( !aCtx.IsNull() ) { // TODO: determine if this code is necessary (added as a fix for issue# 359) - aCtx->UpdateSelected(); + aCtx->UpdateSelected(true); } UpdateColorScale( aViewer ); @@ -325,6 +325,7 @@ void HYDROGUI_OCCDisplayer::purgeObjects( const int theViewerId ) if ( !anOwnerObj.IsNull() && anOwnerObj->IsRemoved() ) module()->removeObjectShape( (size_t)aViewer, anOwnerObj ); } + UpdateColorScale( aViewer ); } QString HYDROGUI_OCCDisplayer::GetType() const @@ -420,14 +421,33 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer OCCViewer_ViewWindow* aWnd = dynamic_cast( theViewer->getViewManager()->getActiveView() ); Handle(V3d_View) aView = aWnd->getViewPort()->getView(); + + HYDROGUI_Module* aModule = module(); int aViewerId = (size_t)theViewer;//TODO: check if viewer id is correct - bool isLandCoverColoringOn = module()->isLandCoversScalarMapModeOn( aViewerId ); + bool isLandCoverColoringOn = aModule->isLandCoversScalarMapModeOn( aViewerId ); - QList aLandCoverMapShapes = module()->getObjectShapes( aViewerId, KIND_LAND_COVER_MAP ); - QList aBathShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY ); - - bool isDisplayColorScale = !aBathShapes.empty() || isLandCoverColoringOn; + QList aLandCoverMapShapes = aModule->getObjectShapes( aViewerId, KIND_LAND_COVER_MAP ); + QList aBathShapes = aModule->getObjectShapes( aViewerId, KIND_BATHYMETRY ); + bool isDisplayColorScale = false; + foreach (HYDROGUI_Shape* shape, aLandCoverMapShapes) + { + if (aModule->isObjectVisible(aViewerId, shape->getObject())) + { + isDisplayColorScale = true; + break; + } + } + if (!isDisplayColorScale) + foreach (HYDROGUI_Shape* shape, aBathShapes) + { + if (aModule->isObjectVisible(aViewerId, shape->getObject())) + { + isDisplayColorScale = true; + break; + } + } + Standard_Real aColorScaleMin = 0, aColorScaleMax = 1; // Get range @@ -491,14 +511,14 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer aCtx->Display( aColorScale, Standard_False ); } - aCtx->Update( aColorScale ); + aCtx->Update( aColorScale, true ); } } } else { if ( !aCtx.IsNull() && aCtx->IsDisplayed( aColorScale ) ) { - aCtx->Erase( aColorScale ); + aCtx->Erase( aColorScale, true ); } }