]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #433: Mirror constraint problem
authorazv <azv@opencascade.com>
Thu, 2 Apr 2015 06:24:09 +0000 (09:24 +0300)
committerazv <azv@opencascade.com>
Thu, 2 Apr 2015 06:24:29 +0000 (09:24 +0300)
The empty items are removed from mirroring list

src/SketchSolver/SketchSolver_ConstraintGroup.cpp

index f54067afa647d3c20c62e7a9d85a5bff5a328ade..6462775d46f17a05ea0c0154febb262994f98cf8 100644 (file)
@@ -662,6 +662,22 @@ bool SketchSolver_ConstraintGroup::changeMirrorConstraint(
 
   std::list<ObjectPtr> aBaseList = aBaseRefList->list();
   std::list<ObjectPtr> aMirroredList = aMirroredRefList->list();
+  // remove all empty items
+  std::list<ObjectPtr>::iterator anIt = aBaseList.begin();
+  std::list<ObjectPtr>::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;