]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
The set of constraints must be resolved when copies of multi-constraint used in other...
authorazv <azv@opencascade.com>
Mon, 5 Sep 2016 10:32:17 +0000 (13:32 +0300)
committerazv <azv@opencascade.com>
Mon, 5 Sep 2016 13:20:58 +0000 (16:20 +0300)
src/SketchSolver/SketchSolver_ConstraintMulti.cpp
src/SketchSolver/SketchSolver_Group.cpp

index f89f314211543a8131b0aefdc35dd4537c85465a..df18477ed2a034f9d7f4e5814a9a154ffa52974d 100644 (file)
@@ -132,9 +132,16 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
     for (; aSIt != aSubs.end(); ++aSIt) {
       if ((*aSIt)->type() != ENTITY_POINT)
         continue;
-      std::list<ParameterWrapperPtr> aParameters = (*aSIt)->parameters();
-      aXCoord = aParameters.front()->value();
-      aYCoord = aParameters.back()->value();
+      AttributePoint2DPtr aPoint =
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>((*aSIt)->baseAttribute());
+      if (aPoint) {
+        aXCoord = aPoint->x();
+        aYCoord = aPoint->y();
+      } else {
+        std::list<ParameterWrapperPtr> aParameters = (*aSIt)->parameters();
+        aXCoord = aParameters.front()->value();
+        aYCoord = aParameters.back()->value();
+      }
       getRelative(aXCoord, aYCoord, aXCoord, aYCoord);
       aX.push_back(aXCoord);
       aY.push_back(aYCoord);
index 106ba9b339f79dafb85f5d77ac4bff8599014276..0e4211a3a15cd18f540afbe250e629fa6716dc39 100644 (file)
@@ -392,7 +392,7 @@ bool SketchSolver_Group::resolveConstraints()
       myStorage->refresh();
       updateMultiConstraints(myConstraints);
       if (myStorage->isNeedToResolve()) // multi-constraints updated some parameters, need to store them
-        myStorage->refresh();
+        resolveConstraints();
 
       if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) {
         getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue("");