From: azv Date: Thu, 2 Apr 2015 06:24:09 +0000 (+0300) Subject: Issue #433: Mirror constraint problem X-Git-Tag: V_1.1.0~63^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=583b28e164755633833a1bef4337323c5d2cdfd0;p=modules%2Fshaper.git Issue #433: Mirror constraint problem The empty items are removed from mirroring list --- 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;