Salome HOME
Optimize performance while editing sketch (case for issue #1692)
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintFixed.cpp
index 5ce8df01451b11df3fb24310dccea6d5b1a68dce..c048a85287324e3010c904ca5bf8757179b67793 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.
@@ -97,11 +100,14 @@ bool SketchSolver_ConstraintFixed::remove()
   if (myBaseConstraint && myFixedAttribute) {
     if (myFixedAttribute->isObject())
       aFeature = ModelAPI_Feature::feature(myFixedAttribute->object());
-    else
-      myStorage->update(AttributePtr(myFixedAttribute), myGroupID);
+    else {
+      if (myFixedAttribute->attr().get())
+        myStorage->update(AttributePtr(myFixedAttribute), myGroupID);
+    }
   }
   if (aFeature)
     myStorage->update(aFeature, myGroupID);
+  myStorage->setNeedToResolve(true);
 
   // Remove constraint or base feature
   if (myBaseConstraint) {