From: azv Date: Fri, 17 Apr 2015 08:45:29 +0000 (+0300) Subject: Issue #479: Conflicting constraints on multi-coincidence with the fixed point X-Git-Tag: V_1.1.0~13^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b88e3bc4aca98808bee5a0bcccc76f11ec04a409;p=modules%2Fshaper.git Issue #479: Conflicting constraints on multi-coincidence with the fixed point --- diff --git a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp index bfa65c19e..4f1b07f8f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp @@ -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 anAttrList = + myBaseConstraint->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); + std::list::iterator anIt = anAttrList.begin(); + for (; anIt != anAttrList.end(); anIt++) { + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(*anIt); + if (!aRefAttr || aRefAttr->isObject()) + continue; + myCoincidentPoints.insert(aRefAttr->attr()); + } +} + bool SketchSolver_ConstraintCoincidence::remove(ConstraintPtr theConstraint) { cleanErrorMsg(); diff --git a/src/SketchSolver/SketchSolver_ConstraintCoincidence.h b/src/SketchSolver/SketchSolver_ConstraintCoincidence.h index e8cbb8e40..a5c885ade 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCoincidence.h +++ b/src/SketchSolver/SketchSolver_ConstraintCoincidence.h @@ -41,6 +41,10 @@ public: /// \brief Append all data of coincidence constaint to the current void attach(std::shared_ptr 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);