]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #567: Wrong result during mirror on different lines
authorazv <azv@opencascade.com>
Wed, 27 May 2015 10:42:21 +0000 (13:42 +0300)
committerazv <azv@opencascade.com>
Wed, 27 May 2015 10:43:11 +0000 (13:43 +0300)
src/SketchSolver/SketchSolver_ConstraintMirror.cpp
src/SketchSolver/SketchSolver_Group.cpp

index 591fa555e4e3d47b7ab0478934939f264baf9306..ed446cd91a47f620ad8e4859c1238b716691a9e7 100644 (file)
@@ -394,6 +394,8 @@ void SketchSolver_ConstraintMirror::adjustConstraint()
     aMirror = myStorage->getConstraint(*aConstrIter);
     if (aMirror.type != SLVS_C_SYMMETRIC_LINE)
       continue;
+    if (aMirror.entityA != aMirrorLine.h)
+      continue; // don't update another Mirror constraints
     Slvs_Constraint aPonCircA, aPonCircB;
     aPonCircA.h = SLVS_E_UNKNOWN;
     aPonCircB.h = SLVS_E_UNKNOWN;
@@ -416,6 +418,8 @@ void SketchSolver_ConstraintMirror::adjustConstraint()
   std::list<Slvs_Constraint> aMirrorList = myStorage->getConstraintsByType(SLVS_C_SYMMETRIC_LINE);
   std::list<Slvs_Constraint>::iterator aMirIter = aMirrorList.begin();
   for (; aMirIter != aMirrorList.end(); aMirIter++) {
+    if (aMirIter->entityA != aMirrorLine.h)
+      continue; // don't update another Mirror constraints
     if (aPointsOnCircles.find(aMirIter->ptA) != aPointsOnCircles.end())
       continue; // Avoid mirroring points on circles
     Slvs_Entity aBase = myStorage->getEntity(aMirIter->ptA);
index 794eb1a3f355ec24bee87d9065ff3c69cf2cf186..cc24d79f2fa81c8f1d33d4fec9e5bfd767decc92 100644 (file)
@@ -242,12 +242,14 @@ bool SketchSolver_Group::changeConstraint(
         theConstraint->attribute(SketchPlugin_ConstraintMirror::ENTITY_A()));
     if (aRefAttr && aRefAttr->isObject()) {
       FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object());
-      SolverConstraintPtr aConstraint =
-          SketchSolver_Builder::getInstance()->createRigidConstraint(aFeature);
-      if (aConstraint) {
-        aConstraint->setGroup(this);
-        aConstraint->setStorage(myStorage);
-        setTemporary(aConstraint);
+      if (aFeature) {
+        SolverConstraintPtr aConstraint =
+            SketchSolver_Builder::getInstance()->createRigidConstraint(aFeature);
+        if (aConstraint) {
+          aConstraint->setGroup(this);
+          aConstraint->setStorage(myStorage);
+          setTemporary(aConstraint);
+        }
       }
     }
   }