#include <Config_PropManager.h>
#include <Config_ModuleReader.h>
+#include <AIS_ListOfInteractive.hxx>
+#include <AIS_ListIteratorOfListOfInteractive.hxx>
+
#include <QDockWidget>
#include <QAction>
#include <QTimer>
myWorkshop->objectBrowser()->rebuildDataTree();
myWorkshop->updateCommandStatus();
myIsOpened = false;
- QTimer::singleShot(1000, myWorkshop, SLOT(displayAllResults()));
+ // the display all results is not necessary anymore, it was commented in XGUI_Workshop,
+ // so it should be commented here
+ //QTimer::singleShot(1000, myWorkshop, SLOT(displayAllResults()));
}
else
myWorkshop->updateCommandStatus();
// 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));
+ }
+
return isDone;
}
if (theMgr->getType() == OCCViewer_Viewer::Type()) {
OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
if (mySelector->viewer() == aViewer) {
- myWorkshop->displayer()->eraseAll(false);
+ XGUI_Displayer* aDisp = myWorkshop->displayer();
+ QObjectPtrList aObjects = aDisp->displayedObjects();
+ foreach(ObjectPtr aObj, aObjects)
+ aObj->setDisplayed(false);
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
myProxyViewer->setSelector(0);
delete mySelector;
mySelector = 0;
theInfo.text,
theInfo.toolTip,
theInfo.icon,
- theInfo.shortcut);
+ theInfo.shortcut,
+ theInfo.checkable);
}
//******************************************************
//******************************************************
void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
{
- myWorkshop->contextMenuMgr()->addViewerItems(theMenu);
+ myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
}