]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update merging two Coincidence constraints (issue #955)
authorazv <azv@opencascade.com>
Wed, 16 Sep 2015 06:26:05 +0000 (09:26 +0300)
committerazv <azv@opencascade.com>
Wed, 16 Sep 2015 06:26:40 +0000 (09:26 +0300)
src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp

index 205c744e9c30794e40f9294dbd6147e0eb09425d..1bfa09e72119f7c9243d16e529221c9e1b9fb800 100644 (file)
@@ -3,6 +3,7 @@
 #include <SketchSolver_Group.h>
 
 #include <SketchPlugin_Point.h>
+#include <GeomDataAPI_Point2D.h>
 
 #include <map>
 
@@ -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<AttributePtr> anAttrList =
+              aFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
+          std::list<AttributePtr>::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()) {