Handle(Prs3d_Drawer) ModuleBase_IViewer::DefaultHighlightDrawer;
ModuleBase_IViewer::ModuleBase_IViewer(QObject* theParent)
- : QObject(theParent), myIs2dMode(false)
+ : QObject(theParent), myIs2dMode(false), myShowHighlight(false)
{
}
// \param theText is a title
virtual void setColorScaleTitle(const QString& theText) = 0;
+ /// Switches On additional highlight for objects preselection
+ void showSelectionHighlight() {
+ myShowHighlight = true;
+ }
+
+ /// Switches Off additional highlight for objects preselection
+ void hideSelectionHighlight() {
+ myShowHighlight = false;
+ }
+
static Handle(Prs3d_Drawer) DefaultHighlightDrawer;
signals:
QMap<Handle(V3d_View), double> myWindowScale;
bool myIs2dMode;
+
+ bool myShowHighlight;
};
#endif
else if (theEvent->type() == QEvent::KeyPress) {
QKeyEvent* aKeyEvent = dynamic_cast<QKeyEvent*>(theEvent);
myOperationMgr->setSHIFTPressed(aKeyEvent->modifiers() & Qt::ShiftModifier);
- switch (aKeyEvent->key()) {
- case Qt::Key_Escape:
- isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent);
- break;
- default:
- break;
- }
+ isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent);
}
}
if (!isAccepted)
isAccepted = true;
}
}
- }
- break;
- break;
- default:
+ }
+ break;
+ case Qt::Key_H:
+ if ((theEvent->modifiers() == Qt::NoModifier))
+ myWorkshop->viewer()->hideSelectionHighlight();
+ break;
+ default:
isAccepted = false;
break;
}
}
}
break;
+ case Qt::Key_H:
+ if ((theEvent->modifiers() == Qt::NoModifier))
+ myWorkshop->viewer()->showSelectionHighlight();
+ break;
}
return isAccepted;
}
XGUI_ViewerProxy::XGUI_ViewerProxy(XGUI_Workshop* theParent)
: ModuleBase_IViewer(theParent),
- myWorkshop(theParent), myShowHighlight(false)
+ myWorkshop(theParent)
{
}
ResultPtr myResult;
AIS_ListOfInteractive myHighlights;
- bool myShowHighlight;
};
#endif