]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Re-entrant operation: Horizontal constraint creation.
authornds <nds@opencascade.com>
Wed, 18 Nov 2015 15:36:55 +0000 (18:36 +0300)
committernds <nds@opencascade.com>
Wed, 18 Nov 2015 15:37:25 +0000 (18:37 +0300)
Scenario: create contour, start horizontal constraint, select lines one after another. On the 3rd line, the operation is not restarted anymore.
Another scenario corrected:
Create a polyline
click on vertical constraint
click on first segment => V constraint added
click on another segment => V constraint added
click in the the background (not on a entitity)

=> Green OK disappear and sometimes the message : Modification of data structure outside of the transaction

src/PartSet/PartSet_SketcherReetntrantMgr.cpp
src/PartSet/PartSet_SketcherReetntrantMgr.h

index 5239265c75d5c0a0e6559bf5dcd4cf07d6f8a372..c749c930df6f3b9a78e742e381c14dfea350c063 100755 (executable)
@@ -30,7 +30,8 @@ PartSet_SketcherReetntrantMgr::PartSet_SketcherReetntrantMgr(ModuleBase_IWorksho
   myWorkshop(theWorkshop),
   myRestartingMode(RM_None),
   myIsFlagsBlocked(false),
-  myIsInternalEditOperation(false)
+  myIsInternalEditOperation(false),
+  myNoMoreWidgetsAttribute("")
 {
 }
 
@@ -176,6 +177,15 @@ void PartSet_SketcherReetntrantMgr::onNoMoreWidgets(const std::string& thePrevio
   if (!isActiveMgr())
     return;
 
+  // we should avoid processing of the signal about no more widgets attributes and 
+  // do this after the restart operaion is finished if it was called
+  // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
+  // if it should be called after restart
+  if (myIsFlagsBlocked) {
+    myNoMoreWidgetsAttribute = thePreviousAttributeID;
+    return;
+  }
+
   ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
                                                        (myWorkshop->currentOperation());
   if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
@@ -339,11 +349,20 @@ void PartSet_SketcherReetntrantMgr::restartOperation()
     ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(
                                                                   myWorkshop->currentOperation());
     if (aFOperation) {
+      myNoMoreWidgetsAttribute = "";
       myIsFlagsBlocked = true;
       aFOperation->commit();
       module()->launchOperation(aFOperation->id());
       myIsFlagsBlocked = false;
       resetFlags();
+      // we should avoid processing of the signal about no more widgets attributes and 
+      // do this after the restart operaion is finished if it was called
+      // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
+      // if it should be called after restart
+      if (!myNoMoreWidgetsAttribute.empty()) {
+        onNoMoreWidgets(myNoMoreWidgetsAttribute);
+        myNoMoreWidgetsAttribute = "";
+      }
     }
   }
 }
index 2d76dd63757233801cdd809f281de8e3afacc591..ebdb0eb16b55b1178f40af4d356ec7845e1fcb9c 100755 (executable)
@@ -155,6 +155,7 @@ private:
   FeaturePtr myInternalFeature;
   QWidget* myInternalWidget;
   ModuleBase_ModelWidget* myInternalActiveWidget;
+  std::string myNoMoreWidgetsAttribute;
 };
 
 #endif