]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #141 fix: Undo for constraints
authorazv <azv@opencascade.com>
Wed, 17 Sep 2014 07:58:44 +0000 (11:58 +0400)
committerazv <azv@opencascade.com>
Wed, 17 Sep 2014 07:58:44 +0000 (11:58 +0400)
The "Delete" message should be send before "Update" message

src/Model/Model_Document.cpp
src/SketchSolver/SketchSolver_ConstraintManager.cpp

index 9057ab82ffd1eee2a582310b9258a2d6c51a617d..d2fcb36eb017c9553fc8e2e014f312ae215eb7e1 100644 (file)
@@ -729,9 +729,9 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated)
       aFIter.Next();
       myObjs.UnBind(aLab);
       // event: model is updated
-      if (aFeature->isInHistory()) {
+      //if (aFeature->isInHistory()) {
         ModelAPI_EventCreator::get()->sendDeleted(aThis, ModelAPI_Feature::group());
-      }
+      //}
       // results of this feature must be redisplayed (hided)
       static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
       const std::list<boost::shared_ptr<ModelAPI_Result> >& aResults = aFeature->results();
@@ -752,10 +752,10 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated)
   aLoop->activateFlushes(true);
 
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+  aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
   if (theMarkUpdated) {
     aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
   }
-  aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   boost::static_pointer_cast<Model_Session>(Model_Session::get())
     ->setCheckTransactions(true);
index 45ead10f90573f29441694def0d530052c93cb13..ea7a29bcd06c7c652db7efdb5a2d5bdea132fdb0 100644 (file)
@@ -110,7 +110,8 @@ void SketchSolver_ConstraintManager::processEvent(
     // Find SketchPlugin_Sketch::ID() in groups. The constraint groups should be updated when an object removed from Sketch
     std::set<std::string>::const_iterator aFGrIter;
     for (aFGrIter = aFeatureGroups.begin(); aFGrIter != aFeatureGroups.end(); aFGrIter++)
-      if (aFGrIter->compare(ModelAPI_ResultConstruction::group()) == 0)
+      if (aFGrIter->compare(ModelAPI_ResultConstruction::group()) == 0 ||
+          aFGrIter->compare(ModelAPI_Feature::group()) == 0)
         break;
 
     if (aFGrIter != aFeatureGroups.end()) {