]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/SketchSolver_Constraint.h
Salome HOME
Optimize performance of the sketch solver
[modules/shaper.git] / src / SketchSolver / SketchSolver_Constraint.h
index f4a15db60ff19e3445a04d1c3c420ffa7134cae6..974143246cff2f493fdf6547bc8941660265fd9f 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <SketchPlugin_Constraint.h>
 
+#include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeRefAttr.h>
 
 #include <string>
@@ -223,8 +224,10 @@ public:
 
   virtual void adjustConstraint()
   {
+    AttributeDoublePtr aValueAttr = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
+        myBaseConstraint->attribute(SketchPlugin_Constraint::VALUE()));
     Slvs_Constraint aConstraint = myStorage->getConstraint(mySlvsConstraints.front());
-    aConstraint.valA *= 2.0;
+    aConstraint.valA = 2.0 * aValueAttr->value();
     myStorage->updateConstraint(aConstraint);
   }
 };