ModuleBase_Preferences::VIEWER_SECTION, "point-selection-sensitivity");
pref->addItem(tr("Edge"), sensitivityGroup, SUIT_PreferenceMgr::DblSpin,
ModuleBase_Preferences::VIEWER_SECTION, "edge-selection-sensitivity");
+
+ int highlightGroup = pref->addItem(tr("Additional highlighting"), viewTab);
+ pref->setItemProperty("columns", 2, highlightGroup);
+ pref->addItem(tr("In 3d mode"), highlightGroup,
+ SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "highlighting-3d");
+ pref->addItem(tr("In 2d mode"), highlightGroup,
+ SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "highlighting-2d");
+
pref->retrieve();
}
this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
connect(aViewer, SIGNAL(keyPress(ModuleBase_IViewWindow*, QKeyEvent*)),
- this, SIGNAL(keyPress(ModuleBase_IViewWindow*, QKeyEvent*)));
+ this, SLOT(onKeyPress(ModuleBase_IViewWindow*, QKeyEvent*)));
connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
- this, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
+ this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
#ifdef HAVE_SALOME
void XGUI_ViewerProxy::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
{
- updateHighlight();
+ if (myIs2dMode) {
+ bool aHighlight2d =
+ ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true);
+ if (aHighlight2d || myShowHighlight)
+ updateHighlight();
+ else
+ eraseHighlight();
+ }
+ else {
+ bool aHighlight3d =
+ ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false);
+ if (aHighlight3d || myShowHighlight)
+ updateHighlight();
+ else
+ eraseHighlight();
+ }
emit mouseMove(theWnd, theEvent);
}
+
+void XGUI_ViewerProxy::onKeyPress(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
+{
+ myShowHighlight = theEvent->key() == Qt::Key_H;
+ emit keyPress(theWnd, theEvent);
+}
+
+void XGUI_ViewerProxy::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
+{
+ if (theEvent->key() == Qt::Key_H) {
+ myShowHighlight = false;
+ }
+ emit keyRelease(theWnd, theEvent);
+}
#endif
//***************************************