From 583b28e164755633833a1bef4337323c5d2cdfd0 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 2 Apr 2015 09:24:09 +0300 Subject: [PATCH] Issue #433: Mirror constraint problem The empty items are removed from mirroring list --- .../SketchSolver_ConstraintGroup.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp index f54067afa..6462775d4 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp @@ -662,6 +662,22 @@ bool SketchSolver_ConstraintGroup::changeMirrorConstraint( std::list aBaseList = aBaseRefList->list(); std::list aMirroredList = aMirroredRefList->list(); + // remove all empty items + std::list::iterator anIt = aBaseList.begin(); + std::list::iterator aTmpIt; + while (anIt != aBaseList.end()) { + aTmpIt = anIt; + anIt++; + if (!(*aTmpIt)) + aBaseList.erase(aTmpIt); + } + anIt = aMirroredList.begin(); + while (anIt != aMirroredList.end()) { + aTmpIt = anIt; + anIt++; + if (!(*aTmpIt)) + aMirroredList.erase(aTmpIt); + } if (aBaseList.empty() || aBaseList.size() != aMirroredList.size()) return false; -- 2.39.2