From: azv Date: Thu, 2 Jun 2016 13:51:10 +0000 (+0300) Subject: Incorrect conflict message appears X-Git-Tag: V_2.3.1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a15a0e33d66265062645148da6947d8418ccb9b;p=modules%2Fshaper.git Incorrect conflict message appears --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 84dc0c972..423812008 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -239,18 +239,20 @@ bool PlaneGCSSolver_Storage::remove(ConstraintWrapperPtr theConstraint) bool PlaneGCSSolver_Storage::remove(EntityWrapperPtr theEntity) { bool isFullyRemoved = SketchSolver_Storage::remove(theEntity); - if (theEntity->type() == ENTITY_ARC) { - // remove arc additional constraints - std::map >::iterator - aFound = myArcConstraintMap.find(theEntity); - if (aFound != myArcConstraintMap.end()) { - myRemovedConstraints.insert(myRemovedConstraints.end(), - aFound->second.begin(), aFound->second.end()); - myArcConstraintMap.erase(aFound); + if (isFullyRemoved) { + if (theEntity->type() == ENTITY_ARC) { + // remove arc additional constraints + std::map >::iterator + aFound = myArcConstraintMap.find(theEntity); + if (aFound != myArcConstraintMap.end()) { + myRemovedConstraints.insert(myRemovedConstraints.end(), + aFound->second.begin(), aFound->second.end()); + myArcConstraintMap.erase(aFound); + } } + if (theEntity->id() == myEntityLastID) + --myEntityLastID; } - if (isFullyRemoved && theEntity->id() == myEntityLastID) - --myEntityLastID; return isFullyRemoved; } diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 19a4a30fe..bd07463b3 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -377,10 +377,11 @@ bool SketchSolver_Group::resolveConstraints() updateMultiConstraints(myConstraints); if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) { getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(""); + std::set aConflicting = myConflictingConstraints; myConflictingConstraints.clear(); myPrevResult = STATUS_OK; // the error message should be changed before sending the message - sendMessage(EVENT_SOLVER_REPAIRED, myConflictingConstraints); + sendMessage(EVENT_SOLVER_REPAIRED, aConflicting); } } else { mySketchSolver->undo();