From: azv Date: Wed, 27 May 2015 10:42:21 +0000 (+0300) Subject: Issue #567: Wrong result during mirror on different lines X-Git-Tag: V_1.2.0~57 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=22c958f95818d06abaa1661eb33636d69ec4b706;p=modules%2Fshaper.git Issue #567: Wrong result during mirror on different lines --- diff --git a/src/SketchSolver/SketchSolver_ConstraintMirror.cpp b/src/SketchSolver/SketchSolver_ConstraintMirror.cpp index 591fa555e..ed446cd91 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMirror.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMirror.cpp @@ -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 aMirrorList = myStorage->getConstraintsByType(SLVS_C_SYMMETRIC_LINE); std::list::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); diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 794eb1a3f..cc24d79f2 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -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); + } } } }