From: azv Date: Thu, 3 Mar 2016 13:36:38 +0000 (+0300) Subject: Translation problem (issue #1350) X-Git-Tag: V_2.2.0~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c18563d92e3adcaa7979701c72603b833d668312;p=modules%2Fshaper.git Translation problem (issue #1350) --- diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 6a2dc0a00..3fad1d4ad 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -196,6 +196,7 @@ bool SketchSolver_Group::changeConstraint( return true; } +// Update constraints if they contain specific feature static void updateMultiConstraints(ConstraintConstraintMap& theConstraints, FeaturePtr theFeature) { ConstraintConstraintMap::iterator aCIt = theConstraints.begin(); @@ -212,6 +213,18 @@ static void updateMultiConstraints(ConstraintConstraintMap& theConstraints, Feat } } +// Recalculate slave features of the Multi constraints +static void updateMultiConstraints(ConstraintConstraintMap& theConstraints) +{ + ConstraintConstraintMap::iterator aCIt = theConstraints.begin(); + for (; aCIt != theConstraints.end(); ++aCIt) { + SketchSolver_ConstraintType aType = aCIt->second->getType(); + if ((aType == CONSTRAINT_MULTI_ROTATION || + aType == CONSTRAINT_MULTI_TRANSLATION)) + std::dynamic_pointer_cast(aCIt->second)->update(true); + } +} + bool SketchSolver_Group::updateFeature(FeaturePtr theFeature) { if (!checkFeatureValidity(theFeature)) @@ -356,6 +369,7 @@ bool SketchSolver_Group::resolveConstraints() } if (aResult == STATUS_OK || aResult == STATUS_EMPTYSET) { // solution succeeded, store results into correspondent attributes myStorage->refresh(); + updateMultiConstraints(myConstraints); if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) { getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(""); // the error message should be changed before sending the message