From: azv Date: Thu, 21 Apr 2016 12:28:33 +0000 (+0300) Subject: Radius dimension does not change the circle (issue #1399) X-Git-Tag: V_2.3.0~155 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a97fa0cbaf93211a1c314fdd15a574e1a8d8774;p=modules%2Fshaper.git Radius dimension does not change the circle (issue #1399) --- diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp index 8419b9a2e..3ee9d559a 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp @@ -35,15 +35,6 @@ SketchSolver_ConstraintType SolveSpaceSolver_ConstraintWrapper::type() const return ConstraintType::fromSolveSpace(mySlvsConstraint.type); } -void SolveSpaceSolver_ConstraintWrapper::setValue(const double& theValue) -{ - double aValue = theValue; - if (type() == CONSTRAINT_RADIUS) - aValue *= 2.0; // NOTE: SolveSpace uses constraint DIAMETER - - SketchSolver_IConstraintWrapper::setValue(aValue); -} - bool SolveSpaceSolver_ConstraintWrapper::isUsed(FeaturePtr theFeature) const { std::list::const_iterator anIt = myConstrained.begin(); diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.h b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.h index b7ff49992..e5c1deb6b 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.h +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.h @@ -39,9 +39,6 @@ public: /// \brief Return type of current entity virtual SketchSolver_ConstraintType type() const; - /// \brief Assign numeric parameter of constraint - virtual void setValue(const double& theValue); - /// \brief Verify the feature is used in the constraint virtual bool isUsed(FeaturePtr theFeature) const; /// \brief Verify the attribute is used in the constraint diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp index efbe1ad2d..e7b72775d 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp @@ -59,8 +59,9 @@ bool SolveSpaceSolver_Storage::update(ConstraintWrapperPtr theConstraint) aSlvsConstr = aConstraint->constraint(); // update value of constraint if exist - if (fabs(aSlvsConstr.valA - theConstraint->value()) > tolerance) { - aSlvsConstr.valA = theConstraint->value(); + double aCoeff = aSlvsConstr.type == SLVS_C_DIAMETER ? 2.0 : 1.0; + if (fabs(aSlvsConstr.valA - theConstraint->value() * aCoeff) > tolerance) { + aSlvsConstr.valA = theConstraint->value() * aCoeff; isUpdated = true; }