Salome HOME
Revert "Make the copies fixed in multi-rotation, multi-translation (issue #1471)"
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintFixed.cpp
index 36dfca58a964a5f2114ae9dcfee46cf5847917fe..13c2fa50dc47e3dc377e92f84dc4b78bb969c926 100644 (file)
@@ -55,6 +55,9 @@ void SketchSolver_ConstraintFixed::fixFeature(EntityWrapperPtr theFeature)
     myStorage->update(theFeature->baseAttribute(), GID_OUTOFGROUP);
   else if (theFeature->baseFeature())
     myStorage->update(theFeature->baseFeature(), GID_OUTOFGROUP);
+
+  if (myBaseConstraint)
+    myStorage->addConstraint(myBaseConstraint, std::list<ConstraintWrapperPtr>());
 }
 
 void SketchSolver_ConstraintFixed::getAttributes(
@@ -66,7 +69,7 @@ void SketchSolver_ConstraintFixed::getAttributes(
   EntityWrapperPtr aSolverEntity;
   if (myBaseFeature) {
     // The feature is fixed.
-    myStorage->update(myBaseFeature, myGroupID);
+    myStorage->update(myBaseFeature/*, myGroupID*/);
     aSolverEntity = myStorage->entity(myBaseFeature);
   } else if (myBaseConstraint) {
     // Constraint Fixed is added by user.
@@ -94,12 +97,16 @@ bool SketchSolver_ConstraintFixed::remove()
   cleanErrorMsg();
   // Move fixed entities back to the current group
   FeaturePtr aFeature = myBaseFeature;
-  if (myBaseConstraint && myFixedAttribute && myFixedAttribute->isObject())
-    aFeature = ModelAPI_Feature::feature(myFixedAttribute->object());
+  if (myBaseConstraint && myFixedAttribute) {
+    if (myFixedAttribute->isObject())
+      aFeature = ModelAPI_Feature::feature(myFixedAttribute->object());
+    else {
+      if (myFixedAttribute->attr().get())
+        myStorage->update(AttributePtr(myFixedAttribute), myGroupID);
+    }
+  }
   if (aFeature)
     myStorage->update(aFeature, myGroupID);
-  else if (myFixedAttribute)
-    myStorage->update(myFixedAttribute, myGroupID);
 
   // Remove constraint or base feature
   if (myBaseConstraint) {