]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Isssue #149 #147 Restart operation issue resolved
authorsbh <sergey.belash@opencascade.com>
Wed, 24 Sep 2014 13:11:01 +0000 (17:11 +0400)
committersbh <sergey.belash@opencascade.com>
Wed, 24 Sep 2014 13:11:01 +0000 (17:11 +0400)
src/ModuleBase/ModuleBase_IOperation.h
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h
src/XGUI/XGUI_OperationMgr.cpp

index bc10a14c4e0dc3d29d5f80e53ce9f37f36fb2908..583f8ece43af27e5110487d55cd047770273fa48 100644 (file)
@@ -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.
index acd79461dc773c4fb58ba4c62a7b4c97329fe1e3..1a90c5b88a493e925cb94276bfeb78b7d4b30c1b 100644 (file)
@@ -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<PartSet_OperationSketchBase*>(theOperation);
   return aPreviewOp != NULL;
index cc11518779a435404e7f152dbb846b0ab72f21bc..0cdf593ac3ee572ceb2cab4cc56dec06078a6c2a 100644 (file)
@@ -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
index 4220b3bd03e6be6c402f854548f9bd244d83d7ac..b47463fc6589dcc1ec4305c0be76f34ea72e381d 100644 (file)
@@ -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;
 }