From 8a15a0e33d66265062645148da6947d8418ccb9b Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 2 Jun 2016 16:51:10 +0300 Subject: [PATCH] Incorrect conflict message appears --- .../PlaneGCSSolver/PlaneGCSSolver_Storage.cpp | 22 ++++++++++--------- src/SketchSolver/SketchSolver_Group.cpp | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) 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(); -- 2.39.2