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
#include <HYDROData_Region.h>
#include <LightApp_Application.h>
-#include <LightApp_Study.h>
+#include <LightApp_Displayer.h>
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewManager.h>
// 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<SALOME_View*>( vmod );
- if ( vf )
- vf->EraseAll( true );
- }
-
- LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( aModule->getApp()->activeStudy() );
- if ( aStudy )
- aStudy->setVisibilityStateForAll( Qtx::HiddenState );
- }
+ LightApp_Displayer().EraseAll( true );
}
bool isFoundImage = false;