X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ShowHideOp.cxx;h=0fefdfae2fc3ba43046a7cf061cb8b22f856eb7b;hb=de7cf9bb0a7a41d6487013c87f4a54d0664cd303;hp=305af96e234f9eebc50c7951f09e45a2df0bacf5;hpb=fe02bb085711fbb88046f31bd30a4590d7263c7a;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx b/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx index 305af96e..0fefdfae 100644 --- a/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx @@ -22,13 +22,21 @@ #include "HYDROGUI_ShowHideOp.h" +#include + #include "HYDROGUI_Module.h" #include "HYDROGUI_Operations.h" #include "HYDROGUI_Tool.h" #include "HYDROGUI_UpdateFlags.h" #include -#include +#include + +#include + +#include + +#include HYDROGUI_ShowHideOp::HYDROGUI_ShowHideOp( HYDROGUI_Module* theModule, int theId ) : HYDROGUI_Operation( theModule ), @@ -55,6 +63,8 @@ void HYDROGUI_ShowHideOp::startOperation() { HYDROGUI_Operation::startOperation(); + size_t aViewId = HYDROGUI_Tool::GetActiveViewId( module() ); + // for all objects if( myId == ShowOnlyId || myId == ShowAllId || myId == HideAllId ) { @@ -62,9 +72,9 @@ void HYDROGUI_ShowHideOp::startOperation() HYDROData_Iterator anIterator( doc() ); for( ; anIterator.More(); anIterator.Next() ) { - Handle(HYDROData_Object) anObject = anIterator.Current(); + Handle(HYDROData_Entity) anObject = anIterator.Current(); if( !anObject.IsNull() ) - anObject->SetVisibility( aVisibility ); + module()->setObjectVisible( aViewId, anObject, aVisibility ); } } @@ -76,12 +86,27 @@ void HYDROGUI_ShowHideOp::startOperation() bool aVisibility = myId == ShowId || myId == ShowOnlyId; for( Standard_Integer anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ ) { - Handle(HYDROData_Object) anObject = aSeq.Value( anIndex ); + Handle(HYDROData_Entity) anObject = aSeq.Value( anIndex ); if( !anObject.IsNull() ) - anObject->SetVisibility( aVisibility ? true : false ); + module()->setObjectVisible( aViewId, anObject, aVisibility ); + } + } + + int anUpdateFlags = 0; + + SUIT_ViewManager* aViewMgr = module()->getApp()->activeViewManager(); + if ( aViewMgr ) + { + if ( aViewMgr->getType() == GraphicsView_Viewer::Type() ) + { + anUpdateFlags |= UF_Viewer; + } + else if ( aViewMgr->getType() == OCCViewer_Viewer::Type() ) + { + anUpdateFlags |= UF_OCCViewer; } } - module()->update( UF_Viewer ); + module()->update( anUpdateFlags ); commit(); }