From b193746b06765a92905212495a7e6ccc3adcfdc0 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 24 Dec 2015 12:16:53 +0300 Subject: [PATCH] Update procedure of removing constraints in SolveSpaceSolver (issue #1161) --- .../SolveSpaceSolver_Storage.cpp | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp index d8cb75f57..892396a35 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp @@ -937,39 +937,14 @@ Slvs_hConstraint SolveSpaceSolver_Storage::updateConstraint(const Slvs_Constrain bool SolveSpaceSolver_Storage::removeConstraint(const Slvs_hConstraint& theConstraintID) { - bool aResult = true; int aPos = Search(theConstraintID, myConstraints); if (aPos >= 0 && aPos < (int)myConstraints.size()) { Slvs_Constraint aConstraint = myConstraints[aPos]; myConstraints.erase(myConstraints.begin() + aPos); myConstrMaxID = myConstraints.empty() ? SLVS_E_UNKNOWN : myConstraints.back().h; myNeedToResolve = true; - - // Remove all entities - Slvs_hEntity anEntities[6] = {aConstraint.ptA, aConstraint.ptB, - aConstraint.entityA, aConstraint.entityB, - aConstraint.entityC, aConstraint.entityD}; - for (int i = 0; i < 6; i++) - if (anEntities[i] != SLVS_E_UNKNOWN) - aResult = removeEntity(anEntities[i]) && aResult; - // remove temporary fixed point, if available - if (myDuplicatedConstraint) { - // Check the duplicated constraints are still available - myDuplicatedConstraint = false; - std::vector::const_iterator anIt1 = myConstraints.begin(); - std::vector::const_iterator anIt2 = myConstraints.begin(); - for (; anIt1 != myConstraints.end() && !myDuplicatedConstraint; anIt1++) - for (anIt2 = anIt1+1; anIt2 != myConstraints.end() && !myDuplicatedConstraint; anIt2++) { - if (anIt1->type != anIt2->type) - continue; - if (anIt1->ptA == anIt2->ptA && anIt1->ptB == anIt2->ptB && - anIt1->entityA == anIt2->entityA && anIt1->entityB == anIt2->entityB && - anIt1->entityC == anIt2->entityC && anIt1->entityD == anIt2->entityD) - myDuplicatedConstraint = true; - } - } } - return aResult; + return true; } const Slvs_Constraint& SolveSpaceSolver_Storage::getConstraint(const Slvs_hConstraint& theConstraintID) const -- 2.39.2