#include "ModuleBase_Operation.h"
#include "ModuleBase_IWorkshop.h"
#include "ModuleBase_IModule.h"
+#include <ModuleBase_IViewer.h>
#include "ModuleBase_OperationDescription.h"
#include "ModuleBase_OperationFeature.h"
return isGranted;
}
-bool XGUI_OperationMgr::canStartOperation(QString theId)
+bool XGUI_OperationMgr::canStartOperation(const QString& theId, const bool isAdditionallyGranted)
{
bool aCanStart = true;
ModuleBase_Operation* aCurrentOp = currentOperation();
if (aCurrentOp) {
- if (!aCurrentOp->isGranted(theId)) {
+ bool aGranted = aCurrentOp->isGranted(theId) || isAdditionallyGranted;
+ if (!aGranted) {
if (canStopOperation(aCurrentOp)) {
if (myIsApplyEnabled && aCurrentOp->isModified())
aCurrentOp->commit();
emit keyEnterReleased();
commitOperation();
}
+ case Qt::Key_N:
+ case Qt::Key_P: {
+ bool noModifiers = (theEvent->modifiers() == Qt::NoModifier);
+ if (noModifiers) {
+ ModuleBase_IViewer* aViewer = myWorkshop->viewer();
+ Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+ Handle(V3d_View) aView = aViewer->activeView();
+ if ((theEvent->key() == Qt::Key_N))
+ aContext->HilightNextDetected(aView);
+ else if ((theEvent->key() == Qt::Key_P))
+ aContext->HilightPreviousDetected(aView);
+ }
+ }
+
break;
default:
isAccepted = false;