From e56886a35d3f758790eef713c7d042930ed1afbf Mon Sep 17 00:00:00 2001 From: sbh Date: Wed, 24 Sep 2014 17:11:01 +0400 Subject: [PATCH] Isssue #149 #147 Restart operation issue resolved --- src/ModuleBase/ModuleBase_IOperation.h | 2 +- src/PartSet/PartSet_OperationSketch.cpp | 2 +- src/PartSet/PartSet_OperationSketch.h | 2 +- src/XGUI/XGUI_OperationMgr.cpp | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IOperation.h b/src/ModuleBase/ModuleBase_IOperation.h index bc10a14c4..583f8ece4 100644 --- a/src/ModuleBase/ModuleBase_IOperation.h +++ b/src/ModuleBase/ModuleBase_IOperation.h @@ -63,7 +63,7 @@ Q_OBJECT * the operation is not granted. * The method has to be redefined for granted operations. */ - virtual bool isGranted() const { return false; } + virtual bool isGranted(ModuleBase_IOperation* theOperation) const { return false; } /** * Must return True if the operation's feature is valid. diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index acd79461d..1a90c5b88 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -253,7 +253,7 @@ void PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape) } -bool PartSet_OperationSketch::isValid(ModuleBase_IOperation* theOperation) const +bool PartSet_OperationSketch::isGranted(ModuleBase_IOperation* theOperation) const { PartSet_OperationSketchBase* aPreviewOp = dynamic_cast(theOperation); return aPreviewOp != NULL; diff --git a/src/PartSet/PartSet_OperationSketch.h b/src/PartSet/PartSet_OperationSketch.h index cc1151877..0cdf593ac 100644 --- a/src/PartSet/PartSet_OperationSketch.h +++ b/src/PartSet/PartSet_OperationSketch.h @@ -38,7 +38,7 @@ Q_OBJECT virtual ~PartSet_OperationSketch(); /// Returns True if the given operation is a Sketcher operation - virtual bool isValid(ModuleBase_IOperation* theOperation) const; + virtual bool isGranted(ModuleBase_IOperation* theOperation) const; /// Returns the operation local selection mode diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 4220b3bd0..b47463fc6 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -135,11 +135,10 @@ void XGUI_OperationMgr::resumeOperation(ModuleBase_Operation* theOperation) bool XGUI_OperationMgr::canStartOperation(ModuleBase_Operation* theOperation) { - return true; - /*bool aCanStart = true; + bool aCanStart = true; ModuleBase_Operation* aCurrentOp = currentOperation(); if (aCurrentOp) { - if (!theOperation->isGranted()) { + if (!aCurrentOp->isGranted(theOperation)) { if (canAbortOperation()) { aCurrentOp->abort(); } else { @@ -147,7 +146,7 @@ bool XGUI_OperationMgr::canStartOperation(ModuleBase_Operation* theOperation) } } } - return aCanStart;*/ + return aCanStart; } -- 2.39.2