From: azv Date: Mon, 5 Sep 2016 10:32:17 +0000 (+0300) Subject: The set of constraints must be resolved when copies of multi-constraint used in other... X-Git-Tag: V_2.5.0~59^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b50f8f57fc0aa336a30b773dedeb766774d3a1b7;p=modules%2Fshaper.git The set of constraints must be resolved when copies of multi-constraint used in other constraints and change their position (issue #1608) --- diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index f89f31421..df18477ed 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -132,9 +132,16 @@ void SketchSolver_ConstraintMulti::adjustConstraint() for (; aSIt != aSubs.end(); ++aSIt) { if ((*aSIt)->type() != ENTITY_POINT) continue; - std::list aParameters = (*aSIt)->parameters(); - aXCoord = aParameters.front()->value(); - aYCoord = aParameters.back()->value(); + AttributePoint2DPtr aPoint = + std::dynamic_pointer_cast((*aSIt)->baseAttribute()); + if (aPoint) { + aXCoord = aPoint->x(); + aYCoord = aPoint->y(); + } else { + std::list aParameters = (*aSIt)->parameters(); + aXCoord = aParameters.front()->value(); + aYCoord = aParameters.back()->value(); + } getRelative(aXCoord, aYCoord, aXCoord, aYCoord); aX.push_back(aXCoord); aY.push_back(aYCoord); diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 106ba9b33..0e4211a3a 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -392,7 +392,7 @@ bool SketchSolver_Group::resolveConstraints() myStorage->refresh(); updateMultiConstraints(myConstraints); if (myStorage->isNeedToResolve()) // multi-constraints updated some parameters, need to store them - myStorage->refresh(); + resolveConstraints(); if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) { getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue("");