#include <ImageComposer_FuseOperator.h>
#include <LightApp_Application.h>
+#include <LightApp_DataOwner.h>
#include <LightApp_GVSelector.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_UpdateFlags.h>
// from one of the methods called below
setUpdateEnabled( false );
+ // store selected objects
+ QStringList aSelectedEntries = storeSelection();
+
if( ( flags & UF_Viewer ) )
updateGV( flags & UF_GV_Init,
flags & UF_GV_Forced );
if( ( flags & UF_Controls ) && getApp() )
getApp()->updateActions();
+ // restore selected objects
+ restoreSelection( aSelectedEntries );
+
setUpdateEnabled( true );
QApplication::restoreOverrideCursor();
{
return myIsUpdateEnabled;
}
+
+QStringList HYDROGUI_Module::storeSelection() const
+{
+ QStringList anEntryList;
+ if( LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr() )
+ {
+ SUIT_DataOwnerPtrList aList( true );
+ aSelectionMgr->selected( aList );
+
+ SUIT_DataOwnerPtrList::iterator anIter;
+ for( anIter = aList.begin(); anIter != aList.end(); anIter++ )
+ {
+ const LightApp_DataOwner* anOwner =
+ dynamic_cast<const LightApp_DataOwner*>( (*anIter).operator->() );
+ if( anOwner )
+ anEntryList.append( anOwner->entry() );
+ }
+ }
+ return anEntryList;
+}
+
+void HYDROGUI_Module::restoreSelection( const QStringList& theEntryList )
+{
+ if( LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr() )
+ {
+ SUIT_DataOwnerPtrList aList( true );
+ for( int anIndex = 0, aSize = theEntryList.size(); anIndex < aSize; anIndex++ )
+ aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( theEntryList[ anIndex ] ) ) );
+ aSelectionMgr->setSelected( aList );
+ }
+}