#include "HYDROGUI_ShowHideOp.h"
+#include <GraphicsView_Viewer.h>
+
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Operations.h"
#include "HYDROGUI_Tool.h"
#include "HYDROGUI_UpdateFlags.h"
#include <HYDROData_Iterator.h>
-#include <HYDROData_Object.h>
+#include <HYDROData_Entity.h>
+
+#include <LightApp_Application.h>
+
+#include <OCCViewer_ViewModel.h>
+
+#include <SUIT_ViewManager.h>
HYDROGUI_ShowHideOp::HYDROGUI_ShowHideOp( HYDROGUI_Module* theModule, int theId )
: HYDROGUI_Operation( theModule ),
{
HYDROGUI_Operation::startOperation();
- size_t aViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
+ size_t aViewId = HYDROGUI_Tool::GetActiveViewId( module() );
// for all objects
if( myId == ShowOnlyId || myId == ShowAllId || myId == HideAllId )
HYDROData_Iterator anIterator( doc() );
for( ; anIterator.More(); anIterator.Next() )
{
- Handle(HYDROData_Object) anObject = anIterator.Current();
+ Handle(HYDROData_Entity) anObject = anIterator.Current();
if( !anObject.IsNull() )
module()->setObjectVisible( aViewId, anObject, aVisibility );
}
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() )
module()->setObjectVisible( aViewId, anObject, aVisibility );
}
}
- module()->update( UF_Viewer );
+ 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( anUpdateFlags );
commit();
}