From: adv Date: Fri, 31 Jan 2014 07:44:43 +0000 (+0000) Subject: Displaying of objects corrected (Bug #359). X-Git-Tag: BR_hydro_v_1_0~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a0e4728a0ad699198c29fca409b9139e34fc3a7;p=modules%2Fhydro.git Displaying of objects corrected (Bug #359). --- diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index 3dbe862c..46449869 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -200,6 +200,10 @@ void HYDROGUI_OCCDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs, } } } + else if ( aCtx.IsNull() ) + { + aCtx->UpdateSelected(); + } } void HYDROGUI_OCCDisplayer::purgeObjects( const int theViewerId ) diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index c5f3bbd2..3fed9548 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -408,14 +408,15 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer, void HYDROGUI_Shape::setVisible( const bool theState, const bool theIsUpdateViewer ) { - if ( myIsVisible == theState ) - return; - myIsVisible = theState; if ( myShape.IsNull() ) return; + if ( ( myIsVisible && myContext->IsDisplayed( myShape ) ) || + ( !myIsVisible && !myContext->IsDisplayed( myShape ) ) ) + return; + if ( myIsVisible ) myContext->Display( myShape, theIsUpdateViewer ); else diff --git a/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx b/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx index 05f5fb25..d754a33a 100644 --- a/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include @@ -109,18 +109,7 @@ void HYDROGUI_ShowHideOp::startOperation() // For occ viewer we do the additional step to hide objects from other modules if ( anOCCManager != NULL && !aVisibility ) - { - if ( SUIT_ViewModel* vmod = anOCCManager->getViewModel() ) - { - SALOME_View* vf = dynamic_cast( vmod ); - if ( vf ) - vf->EraseAll( true ); - } - - LightApp_Study* aStudy = dynamic_cast( aModule->getApp()->activeStudy() ); - if ( aStudy ) - aStudy->setVisibilityStateForAll( Qtx::HiddenState ); - } + LightApp_Displayer().EraseAll( true ); } bool isFoundImage = false;