#include <ModuleBase_ActionInfo.h>
#include <ModuleBase_IModule.h>
+#include <ModelAPI_Tools.h>
+
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_OCCSelector.h>
ViewManagerList OCCViewManagers;
application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers);
if (OCCViewManagers.size() > 0) {
- mySelector = createSelector(OCCViewManagers.first());
+ onViewManagerAdded(OCCViewManagers.first());
}
}
// it should be performed after the selector creation in order to have AISContext
XGUI_Displayer* aDisp = myWorkshop->displayer();
QObjectPtrList aObjList = aDisp->displayedObjects();
+ if (myHighlightPointAspect.IsNull()) {
+ Handle(AIS_Trihedron) aTrihedron = mySelector->viewer()->getTrihedron();
+ myHighlightPointAspect =
+ new Graphic3d_AspectMarker3d(aTrihedron->getHighlightPointAspect()->Aspect().operator*());
+ }
+ if (myOldSelectionColor.size() == 0)
+ myOldSelectionColor = aDisp->selectionColor();
+
AIS_ListOfInteractive aList;
aContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aLIt;
}
// Delete selector because it has to be redefined on next activation
if (mySelector) {
+ if (!myHighlightPointAspect.IsNull()) {
+ Handle(AIS_Trihedron) aTrihedron = mySelector->viewer()->getTrihedron();
+ aTrihedron->getHighlightPointAspect()->SetAspect(myHighlightPointAspect);
+ myHighlightPointAspect.Nullify();
+ }
+ myWorkshop->displayer()->setSelectionColor(myOldSelectionColor);
myProxyViewer->setSelector(0);
delete mySelector;
mySelector = 0;
aResMgr->setValue("Study", "store_positions", myIsStorePositions);
getApp()->setEditEnabled(myIsEditEnabled);
+ myOldSelectionColor.clear();
+
// Post-processing for LoadScriptId to remove created(if it was created) SALOME Object Browser
disconnect(getApp()->action(LightApp_Application::UserID+1), SIGNAL(triggered(bool)),
this, SLOT(onScriptLoaded()));
if (mySelector->viewer() == aViewer) {
XGUI_Displayer* aDisp = myWorkshop->displayer();
QObjectPtrList aObjects = aDisp->displayedObjects();
- foreach(ObjectPtr aObj, aObjects)
+ ResultPtr aRes;
+ foreach(ObjectPtr aObj, aObjects) {
aObj->setDisplayed(false);
+ aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
+ if (aRes.get()) {
+ while (aRes = ModelAPI_Tools::bodyOwner(aRes)) {
+ aRes->setDisplayed(false);
+ }
+ }
+ }
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
myProxyViewer->setSelector(0);
delete mySelector;
{
if (theMgr->getType() == OCCViewer_Viewer::Type()) {
OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
+
+ if (myHighlightPointAspect.IsNull()) {
+ Handle(AIS_Trihedron) aTrihedron = aViewer->getTrihedron();
+ myHighlightPointAspect =
+ new Graphic3d_AspectMarker3d(aTrihedron->getHighlightPointAspect()->Aspect().operator*());
+ }
SHAPERGUI_OCCSelector* aSelector = new SHAPERGUI_OCCSelector(aViewer,
getApp()->selectionMgr());
#ifdef SALOME_PATCH_FOR_CTRL_WHEEL
aSel->setEnabled(aSel == aSelector);
}
myProxyViewer->setSelector(aSelector);
+
+ if (myOldSelectionColor.size() == 0)
+ myOldSelectionColor = myWorkshop->displayer()->selectionColor();
+
+ std::vector<int> aColor = Config_PropManager::color("Visualization", "selection_color");
+ myWorkshop->displayer()->setSelectionColor(aColor);
return aSelector;
}
return 0;
}
aProp->setValue(aValue);
+ if ((theSection == "Visualization") && (theParam == "selection_color")) {
+ std::vector<int> aColor = Config_PropManager::color("Visualization", "selection_color");
+ myWorkshop->displayer()->setSelectionColor(aColor);
+ }
+
myWorkshop->displayer()->redisplayObjects();
}