From: azv Date: Thu, 24 Dec 2015 09:16:53 +0000 (+0300) Subject: Update procedure of removing constraints in SolveSpaceSolver (issue #1161) X-Git-Tag: V_2.1.0~75 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b193746b06765a92905212495a7e6ccc3adcfdc0;p=modules%2Fshaper.git Update procedure of removing constraints in SolveSpaceSolver (issue #1161) --- 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