]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Improve performance of sketch solver by disabling by default the search of failed...
authorazv <azv@opencascade.com>
Thu, 17 Sep 2015 13:49:13 +0000 (16:49 +0300)
committerazv <azv@opencascade.com>
Thu, 17 Sep 2015 13:50:07 +0000 (16:50 +0300)
src/SketchSolver/SketchSolver_Group.cpp
src/SketchSolver/SketchSolver_Solver.cpp
src/SketchSolver/SketchSolver_Solver.h

index 560550f6ec0a99103cef32da62fe291ee0f6e924..cc60f0c2555e6479934dcbb1b65086b31313bbbf 100644 (file)
@@ -549,6 +549,7 @@ bool SketchSolver_Group::resolveConstraints()
   bool aResolved = false;
   if (myStorage->isNeedToResolve() && !isEmpty()) {
     myConstrSolver.setGroupID(myID);
+    myConstrSolver.calculateFailedConstraints(false);
     myStorage->initializeSolver(myConstrSolver);
 
     int aResult = SLVS_RESULT_OKAY;
@@ -572,6 +573,7 @@ bool SketchSolver_Group::resolveConstraints()
             isLastChance = true;
           } else
             aNbTemp = myStorage->deleteTemporaryConstraint();
+          myConstrSolver.calculateFailedConstraints(true); // something failed => need to find it
           myStorage->initializeSolver(myConstrSolver);
         }
       }
index a14fa2365b42cc740ecaca5bcf2a3e25544ba8b6..36979d7474e67dceab857105e0fdd64155b1a5c4 100644 (file)
@@ -27,7 +27,7 @@ SketchSolver_Solver::SketchSolver_Solver()
 
   // If the set of constraints is inconsistent,
   // the failed field will contain wrong constraints
-  myEquationsSystem.calculateFaileds = 1;
+  myEquationsSystem.calculateFaileds = 0;
 }
 
 SketchSolver_Solver::~SketchSolver_Solver()
index 46e83afd0bf8f6b9eaffdbab6f8bccde08cde368..f90d71fd2f816d3f66f38e41585137e8324eb645 100644 (file)
@@ -75,6 +75,11 @@ class SketchSolver_Solver
    */
   void setDraggedParameters(const Slvs_hParam* theDragged);
 
+  /** \brief Set or unset the flag which allows to find all failed constraints
+   */
+  void calculateFailedConstraints(bool theSic)
+  { myEquationsSystem.calculateFaileds = theSic ? 1 : 0; }
+
   /** \brief Solve the set of equations
    *  \return identifier whether solution succeeded
    */