]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #479: Conflicting constraints on multi-coincidence with the fixed point
authorazv <azv@opencascade.com>
Fri, 17 Apr 2015 08:45:29 +0000 (11:45 +0300)
committerazv <azv@opencascade.com>
Fri, 17 Apr 2015 08:45:29 +0000 (11:45 +0300)
src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp
src/SketchSolver/SketchSolver_ConstraintCoincidence.h

index bfa65c19ec3f50ccf8afdd0621f378d76f86df67..4f1b07f8f8697c6f580352644fc871fb2c7ef2cf 100644 (file)
@@ -103,6 +103,22 @@ void SketchSolver_ConstraintCoincidence::addConstraint(ConstraintPtr theConstrai
   myExtraCoincidence[aNewConstr] = theConstraint;
 }
 
+void SketchSolver_ConstraintCoincidence::process()
+{
+  SketchSolver_Constraint::process();
+
+  // Fill the list of coincident points
+  std::list<AttributePtr> anAttrList =
+      myBaseConstraint->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
+  std::list<AttributePtr>::iterator anIt = anAttrList.begin();
+  for (; anIt != anAttrList.end(); anIt++) {
+    AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anIt);
+    if (!aRefAttr || aRefAttr->isObject())
+      continue;
+    myCoincidentPoints.insert(aRefAttr->attr());
+  }
+}
+
 bool SketchSolver_ConstraintCoincidence::remove(ConstraintPtr theConstraint)
 {
   cleanErrorMsg();
index e8cbb8e402759896ac983a6bc8221e20ceef874c..a5c885ade5863fccdce77842f18904c6acb5ff5a 100644 (file)
@@ -41,6 +41,10 @@ public:
   /// \brief Append all data of coincidence constaint to the current
   void attach(std::shared_ptr<SketchSolver_ConstraintCoincidence> theConstraint);
 
+protected:
+  /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
+  virtual void process();
+
 private:
   /// \brief Creates new coincidence constraint
   Slvs_hConstraint addConstraint(Slvs_hEntity thePoint1, Slvs_hEntity thePoint2);