+ SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+ myIsStorePositions = aResMgr->booleanValue("Study", "store_positions", true);
+ myIsEditEnabled = getApp()->isEditEnabled();
+ getApp()->setEditEnabled(false);
+
+ // this following row is caused by #187 bug.
+ // SALOME saves the dock widget positions before deactivateModule() and
+ // load it after the module activation. So, if the panel is visible before
+ // deactivate, it becomes visible after activate.
+ // In order to avoid the visible property panel, the widget position save is
+ // switch off in this module
+ aResMgr->setValue("Study", "store_positions", false);
+
+ // Synchronize displayed objects
+ if (mySelector && mySelector->viewer()) {
+ Handle(AIS_InteractiveContext) aContext = mySelector->viewer()->getAISContext();
+ XGUI_Displayer* aDisp = myWorkshop->displayer();
+ QObjectPtrList aObjList = aDisp->displayedObjects();
+
+ AIS_ListOfInteractive aList;
+ aContext->DisplayedObjects(aList);
+ AIS_ListIteratorOfListOfInteractive aLIt;
+ Handle(AIS_InteractiveObject) anAISIO;
+ foreach (ObjectPtr aObj, aObjList) {
+ AISObjectPtr aPrs = aDisp->getAISObject(aObj);
+ Handle(AIS_InteractiveObject) aAIS = aPrs->impl<Handle(AIS_InteractiveObject)>();
+ bool aFound = false;
+ for (aLIt.Initialize(aList); aLIt.More(); aLIt.Next()) {
+ anAISIO = aLIt.Value();
+ if (anAISIO.Access() == aAIS.Access()) {
+ aFound = true;
+ break;
+ }
+ }
+ if (!aFound) {
+ aObj->setDisplayed(false);
+ //aDisp->erase(aObj, false);
+ }
+ }
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ }
+ myProxyViewer->activateViewer(true);