X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintFixed.cpp;h=13c2fa50dc47e3dc377e92f84dc4b78bb969c926;hb=682438a4bfd569dd672e736f30e325345c49943e;hp=cddafdb1252b8605df55e0d496b9e7d6c9c76f63;hpb=f387a286673e6be6e5c065f3bbf3c19ed5981a30;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintFixed.cpp b/src/SketchSolver/SketchSolver_ConstraintFixed.cpp index cddafdb12..13c2fa50d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintFixed.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintFixed.cpp @@ -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()); } 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,8 +97,14 @@ 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);