From: azv Date: Thu, 2 Jul 2015 12:39:13 +0000 (+0300) Subject: Avoid excessive recalculations when the group is not changed X-Git-Tag: V_1.3.0~125 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dc3aa7dd575fd59e0744a24172d714873de6da61;p=modules%2Fshaper.git Avoid excessive recalculations when the group is not changed --- diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index 27f7b76d1..c1d0558f4 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -140,8 +140,21 @@ bool SketchSolver_Constraint::checkAttributesChanged(ConstraintPtr theConstraint if (aRefAttr->isObject()) { FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object()); std::map::iterator aFIt = myFeatureMap.find(aFeature); - if (aFeature && (aFIt == myFeatureMap.end() || aCurAttrs.find(aFIt->second) == aCurAttrs.end())) - return true; + if (aFeature) { + if (aFIt == myFeatureMap.end()) + return true; + // Additional check the points of entity + if (aCurAttrs.find(aFIt->second) == aCurAttrs.end()) { + Slvs_Entity anEntity = myStorage->getEntity(aFIt->second); + bool isFound = false; + for (int i = 0; i < 4 && !isFound; i++) + if (anEntity.point[i] != SLVS_E_UNKNOWN && + aCurAttrs.find(anEntity.point[i]) != aCurAttrs.end()) + isFound = true; + if (!isFound) + return true; + } + } } else if (aRefAttr->attr()) { std::map::iterator anAIt = myAttributeMap.find(aRefAttr->attr()); if (anAIt == myAttributeMap.end() || aCurAttrs.find(anAIt->second) == aCurAttrs.end())