From: azv Date: Thu, 24 Nov 2016 10:01:29 +0000 (+0300) Subject: Update tolerance for deciding the parameters are same to prevent frequent updates... X-Git-Tag: V_2.6.0~60 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d1e7fd66bc66e74c6ae5bbab299836d0ed9713bd;p=modules%2Fshaper.git Update tolerance for deciding the parameters are same to prevent frequent updates from the solver (issue #1883) --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 90e25c458..b26213dcc 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -672,6 +672,8 @@ void PlaneGCSSolver_Storage::refresh(bool theFixedOnly) const { //blockEvents(true); + const double aTol = 1000. * tolerance; // tolerance to prevent frequent updates + std::map::const_iterator anIt = myAttributeMap.begin(); std::list aParams; std::list::const_iterator aParIt; @@ -698,8 +700,8 @@ void PlaneGCSSolver_Storage::refresh(bool theFixedOnly) const std::shared_ptr aPoint2D = std::dynamic_pointer_cast(anIt->first); if (aPoint2D) { - if ((isUpd[0] && fabs(aPoint2D->x() - aCoords[0]) > tolerance) || - (isUpd[1] && fabs(aPoint2D->y() - aCoords[1]) > tolerance) || isExternal) { + if ((isUpd[0] && fabs(aPoint2D->x() - aCoords[0]) > aTol) || + (isUpd[1] && fabs(aPoint2D->y() - aCoords[1]) > aTol) || isExternal) { // Find points coincident with this one (probably not in GID_OUTOFGROUP) CoincidentPointsMap::const_iterator aCoincIt = myCoincidentPoints.begin(); for (; aCoincIt != myCoincidentPoints.end(); ++aCoincIt) @@ -729,7 +731,7 @@ void PlaneGCSSolver_Storage::refresh(bool theFixedOnly) const } AttributeDoublePtr aScalar = std::dynamic_pointer_cast(anIt->first); if (aScalar && !isExternal) { - if (isUpd[0] && fabs(aScalar->value() - aCoords[0]) > tolerance) + if (isUpd[0] && fabs(aScalar->value() - aCoords[0]) > aTol) aScalar->setValue(aCoords[0]); continue; }