Salome HOME
Using test for testing number of sub-shapes.
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintAngle.cpp
index 6138e3062cf3cb2f0b00ca4d6935a7edd35900b2..f4207163b241f406bbe39f35116326f883fbaf44 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 #include <SketchSolver_ConstraintAngle.h>
 #include <SketchSolver_Manager.h>
 
@@ -6,6 +8,10 @@
 #include <GeomAPI_Pnt2d.h>
 #include <GeomAPI_XY.h>
 
+#include <ModelAPI_AttributeInteger.h>
+
+#include <SketchPlugin_ConstraintAngle.h>
+
 #include <cmath>
 
 void SketchSolver_ConstraintAngle::getAttributes(
@@ -14,6 +20,7 @@ void SketchSolver_ConstraintAngle::getAttributes(
   SketchSolver_Constraint::getAttributes(theValue, theAttributes);
 
   myAngle = theValue;
+  myType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
 }
 
 
@@ -28,4 +35,10 @@ void SketchSolver_ConstraintAngle::adjustConstraint()
   myAngle = aConstraint->value();
   aBuilder->adjustConstraint(aConstraint);
   myStorage->addConstraint(myBaseConstraint, aConstraint);
+
+  int aType = myBaseConstraint->integer(SketchPlugin_ConstraintAngle::TYPE_ID())->value();
+  if (aType != myType) {
+    myType = aType;
+    myStorage->setNeedToResolve(true);
+  }
 }