From ec6769ca1253d91c847027b5d36c800d9b5ed793 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 16 Sep 2015 09:26:05 +0300 Subject: [PATCH] Update merging two Coincidence constraints (issue #955) --- .../SketchSolver_ConstraintCoincidence.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp index 205c744e9..1bfa09e72 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp @@ -3,6 +3,7 @@ #include #include +#include #include @@ -187,8 +188,18 @@ void SketchSolver_ConstraintCoincidence::addConstraint(ConstraintPtr theConstrai anEntity = myGroup->getFeatureId(aFeature); if (anEntity == SLVS_E_UNKNOWN) anEntity = changeEntity(aFeature, anEntType); - else + else { myFeatureMap[aFeature] = anEntity; + // Obtain relations between attributes of the feature and SolveSpace entities + std::list anAttrList = + aFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); + std::list::iterator anIt = anAttrList.begin(); + for (; anIt != anAttrList.end(); ++anIt) { + Slvs_hEntity anAttrID = myGroup->getAttributeId(*anIt); + if (anAttrID != SLVS_E_UNKNOWN) + myAttributeMap[*anIt] = anAttrID; + } + } } // If the feature is a point, add it to the list of coincident points if (aFeature->getKind() == SketchPlugin_Point::ID()) { -- 2.39.2