X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_OperationMgr.cpp;h=efc2ce9d51237e4490d6a8803b3243843bed21ad;hb=73b63afd03a150740406d8c5cebf45ac5125f2e3;hp=229801de9664c36f3b383a1716fc703d01a4bb04;hpb=39542b37664439ffc0bd754c74a72853997102f6;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 229801de9..efc2ce9d5 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -9,6 +9,7 @@ #include "ModuleBase_Operation.h" #include "ModuleBase_IWorkshop.h" #include "ModuleBase_IModule.h" +#include #include "ModuleBase_OperationDescription.h" #include "ModuleBase_OperationFeature.h" @@ -290,12 +291,13 @@ bool XGUI_OperationMgr::isGrantedOperation(ModuleBase_Operation* theOperation) 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(); @@ -411,6 +413,20 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent) 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;