Salome HOME
Pipe validator fix
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMulti.cpp
index 404c5df7fb455fc6d0707e592d7ae33f00bc5450..6f05e9a53ad43150f4543638dc83e808fbf35264 100644 (file)
@@ -10,6 +10,7 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Line.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 
 void SketchSolver_ConstraintMulti::getEntities(std::list<EntityWrapperPtr>& theEntities)
 {
@@ -100,8 +101,7 @@ void SketchSolver_ConstraintMulti::update(bool isForce)
   updateLocal();
   if (isForce)
     myAdjusted = false;
-  // update parent object
-  SketchSolver_Constraint::update();
+  adjustConstraint();
 }
 
 void SketchSolver_ConstraintMulti::adjustConstraint()
@@ -159,7 +159,8 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
         aPoints.push_back(aFeature->attribute(SketchPlugin_Line::END_ID()));
       } else if (aFeature->getKind() == SketchPlugin_Circle::ID())
         aPoints.push_back(aFeature->attribute(SketchPlugin_Circle::CENTER_ID()));
-      else if (aFeature->getKind() == SketchPlugin_Point::ID())
+      else if (aFeature->getKind() == SketchPlugin_Point::ID() ||
+               aFeature->getKind() == SketchPlugin_IntersectionPoint::ID())
         aPoints.push_back(aFeature->attribute(SketchPlugin_Point::COORD_ID()));
 
       std::list<AttributePtr>::iterator aPtIt = aPoints.begin();
@@ -183,3 +184,9 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
 
   myAdjusted = true;
 }
+
+bool SketchSolver_ConstraintMulti::isUsed(FeaturePtr theFeature) const
+{
+  return myFeatures.find(theFeature) != myFeatures.end() ||
+         SketchSolver_Constraint::isUsed(theFeature);
+}