]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/SketchSolver_ConstraintMirror.cpp
Salome HOME
Issue #2077: mirror constraint is destroyed
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMirror.cpp
index 80cb647d874e80cae6625eab771336bb4a49107a..89bc973b27c7fe1402683af303393bbd05b806d8 100644 (file)
@@ -62,6 +62,13 @@ void SketchSolver_ConstraintMirror::getAttributes(
       myFeatures.insert(aFeature);
     }
   }
+  // add mirrored features to the list
+  aList = aMirroredRefList->list();
+  for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
+    FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
+    if (aFeature)
+      myFeatures.insert(aFeature);
+  }
 }
 
 void SketchSolver_ConstraintMirror::process()
@@ -86,7 +93,8 @@ void SketchSolver_ConstraintMirror::process()
 void SketchSolver_ConstraintMirror::update()
 {
   cleanErrorMsg();
-  adjustConstraint();
+  remove();
+  process();
 }
 
 void SketchSolver_ConstraintMirror::adjustConstraint()
@@ -131,16 +139,6 @@ void SketchSolver_ConstraintMirror::blockEvents(bool isBlocked)
   for (; anIt != myFeatures.end(); ++anIt)
     (*anIt)->data()->blockSendAttributeUpdated(isBlocked);
 
-  AttributeRefListPtr aMirroredRefList =
-      myBaseConstraint->reflist(SketchPlugin_Constraint::ENTITY_C());
-  std::list<ObjectPtr> aMirroredList = aMirroredRefList->list();
-  std::list<ObjectPtr>::iterator aMIt = aMirroredList.begin();
-  for (; aMIt != aMirroredList.end(); ++aMIt) {
-    FeaturePtr aMirrored = ModelAPI_Feature::feature(*aMIt);
-    aMirrored->data()->blockSendAttributeUpdated(isBlocked);
-  }
-
-
   SketchSolver_Constraint::blockEvents(isBlocked);
 }