XGUI_Displayer* aDisp = myWorkshop->displayer();
QObjectPtrList aObjList = aDisp->displayedObjects();
+ 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) {
+ 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()));
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();
}
}
+//**************************************************************
+std::vector<int> XGUI_Displayer::selectionColor() const
+{
+ std::vector<int> aColor;
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull()) {
+ Quantity_Color aQColor = aContext->SelectionStyle()->Color();
+ aColor.push_back((int)(aQColor.Red() * 255));
+ aColor.push_back((int)(aQColor.Green() * 255));
+ aColor.push_back((int)(aQColor.Blue() * 255));
+ }
+ return aColor;
+}
+
+
//**************************************************************
Handle(SelectMgr_AndFilter) XGUI_Displayer::GetFilter()
{
/// Returns scale of active view
double getViewScale() const;
+ /// Set color of selection
+ /// \param theColor R,G,B values of color
void setSelectionColor(const std::vector<int>& theColor);
+ /// Returns current selection color
+ std::vector<int> selectionColor() const;
+
signals:
/// Signal on object display
/// \param theObject a data object