From: azv Date: Tue, 5 Jul 2016 07:38:25 +0000 (+0300) Subject: Update radii of dependent circles used in multi-rotation/multi-translation (issue... X-Git-Tag: V_2.5.0~241 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a6389f6e5d8aeb8158d014364345f5024503d85f;p=modules%2Fshaper.git Update radii of dependent circles used in multi-rotation/multi-translation (issue #1606) --- diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index 6f05e9a53..206e8c11e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -113,19 +113,19 @@ void SketchSolver_ConstraintMulti::adjustConstraint() return; } - FeaturePtr aFeature; + FeaturePtr anOriginal, aFeature; std::list anObjectList = aRefList->list(); std::list::iterator anObjIt = anObjectList.begin(); while (anObjIt != anObjectList.end()) { - aFeature = ModelAPI_Feature::feature(*anObjIt++); - if (!aFeature) + anOriginal = ModelAPI_Feature::feature(*anObjIt++); + if (!anOriginal) continue; // Fill lists of coordinates of points composing a feature std::list aX, aY; std::list::iterator aXIt, aYIt; double aXCoord, aYCoord; - EntityWrapperPtr anEntity = myStorage->entity(aFeature); + EntityWrapperPtr anEntity = myStorage->entity(anOriginal); std::list aSubs = anEntity->subEntities(); std::list::const_iterator aSIt = aSubs.begin(); for (; aSIt != aSubs.end(); ++aSIt) { @@ -157,9 +157,12 @@ void SketchSolver_ConstraintMulti::adjustConstraint() } else if (aFeature->getKind() == SketchPlugin_Line::ID()) { aPoints.push_back(aFeature->attribute(SketchPlugin_Line::START_ID())); aPoints.push_back(aFeature->attribute(SketchPlugin_Line::END_ID())); - } else if (aFeature->getKind() == SketchPlugin_Circle::ID()) + } else if (aFeature->getKind() == SketchPlugin_Circle::ID()) { aPoints.push_back(aFeature->attribute(SketchPlugin_Circle::CENTER_ID())); - else if (aFeature->getKind() == SketchPlugin_Point::ID() || + // update circle's radius + aFeature->real(SketchPlugin_Circle::RADIUS_ID())->setValue( + anOriginal->real(SketchPlugin_Circle::RADIUS_ID())->value()); + } else if (aFeature->getKind() == SketchPlugin_Point::ID() || aFeature->getKind() == SketchPlugin_IntersectionPoint::ID()) aPoints.push_back(aFeature->attribute(SketchPlugin_Point::COORD_ID()));