From: sbh Date: Wed, 24 Sep 2014 13:11:01 +0000 (+0400) Subject: Isssue #149 #147 Restart operation issue resolved X-Git-Tag: V_0.4.4~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e56886a35d3f758790eef713c7d042930ed1afbf;p=modules%2Fshaper.git Isssue #149 #147 Restart operation issue resolved --- 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; }