From babf5d97fe0898a8fe0dd7390bceb5f861349ad1 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 30 Aug 2016 11:10:15 +0300 Subject: [PATCH] Optimize performance while editing sketch (case for issue #1692) Update only groups of entities which should be recalculated or consist of Fixed constraints only. --- src/SketchSolver/SketchSolver_Group.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 2dbb20336..e8dfdc975 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -430,14 +430,15 @@ bool SketchSolver_Group::resolveConstraints() aResolved = true; } else if (!isGroupEmpty) { - // Check there are constraints Fixed. If they exist, update parameters by stored values + // Check if the group contains only constraints Fixed, update parameters by stored values + aResolved = true; ConstraintConstraintMap::iterator aCIt = myConstraints.begin(); for (; aCIt != myConstraints.end(); ++aCIt) - if (aCIt->first->getKind() == SketchPlugin_ConstraintRigid::ID()) { - aResolved = true; + if (aCIt->first->getKind() != SketchPlugin_ConstraintRigid::ID()) { + aResolved = false; break; } - if (aCIt != myConstraints.end()) + if (aCIt == myConstraints.end()) myStorage->refresh(); } removeTemporaryConstraints(); -- 2.39.2