From: azv Date: Thu, 16 Apr 2015 04:24:45 +0000 (+0300) Subject: CRash when move circle with Radius constraint X-Git-Tag: V_1.1.0~23^2~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e8b1e9bddca0d41e27e812e4c4c9fa58a48629f;p=modules%2Fshaper.git CRash when move circle with Radius constraint --- diff --git a/src/SketchSolver/SketchSolver_ConstraintRigid.cpp b/src/SketchSolver/SketchSolver_ConstraintRigid.cpp index 3ab5794b2..d13285362 100644 --- a/src/SketchSolver/SketchSolver_ConstraintRigid.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintRigid.cpp @@ -239,6 +239,13 @@ void SketchSolver_ConstraintRigid::fixCircle(const Slvs_Entity& theCircle) fixPoint(theCircle.point[0]); if (isFixRadius) { + // Search the radius is already fixed + std::list aDiamConstr = myStorage->getConstraintsByType(SLVS_C_DIAMETER); + std::list::const_iterator aDiamIter = aDiamConstr.begin(); + for (; aDiamIter != aDiamConstr.end(); aDiamIter++) + if (aDiamIter->entityA == theCircle.h) + return; + // Fix radius of a circle AttributeDoublePtr aRadiusAttr = std::dynamic_pointer_cast( myFeatureMap.begin()->first->attribute(SketchPlugin_Circle::RADIUS_ID())); @@ -312,7 +319,7 @@ void SketchSolver_ConstraintRigid::fixArc(const Slvs_Entity& theArc) std::list aDiamConstraints = myStorage->getConstraintsByType(SLVS_C_DIAMETER); std::list::iterator anIt = aDiamConstraints.begin(); for (; anIt != aDiamConstraints.end() && !isExists; anIt++) - if (anIt->entityA == myFeatureMap.begin()->second) + if (anIt->entityA == theArc.h) isExists = true; if (!isExists) { Slvs_Constraint aFixedR = Slvs_MakeConstraint(SLVS_E_UNKNOWN, myGroup->getId(), SLVS_C_DIAMETER,