aContext->DefaultDrawer()->UIsoAspect()->SetNumber(0);
ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle();
+
+
// Commented out according to discussion in bug #2825
//Handle(Prs3d_Drawer) aSelStyle = aContext->SelectionStyle();
//double aDeflection =
return aContext;
}
+//**************************************************************
+void XGUI_Displayer::setSelectionColor(const std::vector<int>& theColor)
+{
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull()) {
+ Quantity_Color aQColor(theColor[0] / 255.,
+ theColor[1] / 255.,
+ theColor[2] / 255., Quantity_TOC_RGB);
+ aContext->SelectionStyle()->SetColor(aQColor);
+ aContext->HighlightStyle(Prs3d_TypeOfHighlight_LocalSelected)->SetColor(aQColor);
+ }
+}
+
+
//**************************************************************
Handle(SelectMgr_AndFilter) XGUI_Displayer::GetFilter()
{
Config_PropManager::registerProp("Visualization", "result_field_color", "Field color",
Config_Prop::Color, ModelAPI_ResultField::DEFAULT_COLOR());
+ Config_PropManager::registerProp("Visualization", "selection_color", "Selection color",
+ Config_Prop::Color, "255,255,255");
+
if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "face-selection", true))
myViewerSelMode.append(TopAbs_FACE);
if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "edge-selection", true))
// Calling of loadCustomProps before activating module is required
// by Config_PropManger to restore user-defined path to plugins
ModuleBase_Preferences::loadCustomProps();
+ std::vector<int> aColor;
+ try {
+ aColor = Config_PropManager::color("Visualization", "selection_color");
+ }
+ catch (...) {
+ }
+ if (aColor.size() == 3)
+ myDisplayer->setSelectionColor(aColor);
+
createModule();
#ifndef HAVE_SALOME
ModuleBase_Preferences::editPreferences(aModif);
if (aModif.size() > 0) {
QString aSection;
- foreach (ModuleBase_Pref aPref, aModif)
- {
+ foreach (ModuleBase_Pref aPref, aModif) {
aSection = aPref.first;
if (aSection == ModuleBase_Preferences::VIEWER_SECTION) {
myMainWindow->viewer()->updateFromResources();
myMainWindow->menuObject()->updateFromResources();
}
}
+ std::vector<int> aColor;
+ try {
+ aColor = Config_PropManager::color("Visualization", "selection_color");
+ }
+ catch (...) {
+ }
+ if (aColor.size() == 3)
+ displayer()->setSelectionColor(aColor);
+
displayer()->redisplayObjects();
}
}