]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp
Salome HOME
Issue #2971: Naming issue in a group when loading a dump file
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintCoincidence.cpp
index 2c4d8eed34c4ba26b201246f51442f8a96a4b7ce..4bac7dd1fda160092024b66cad9bc7fc5ed99d92 100644 (file)
@@ -76,15 +76,9 @@ static void getPointOwnerAndParent(const AttributeRefAttrPtr theRefAttr,
   if (thePoint) {
     theOwner = ModelAPI_Feature::feature(thePoint->owner());
     if (theOwner) {
-      std::string aParentRefID;
-      if (theOwner->getKind() == SketchPlugin_Line::ID())
-        aParentRefID = SketchPlugin_Line::PARENT_ID();
-      else if (theOwner->getKind() == SketchPlugin_Point::ID())
-        aParentRefID = SketchPlugin_Point::PARENT_ID();
-      if (!aParentRefID.empty()) {
-        AttributeReferencePtr aParentRef = theOwner->reference(aParentRefID);
-        theParent = aParentRef ? ModelAPI_Feature::feature(aParentRef->value()) : FeaturePtr();
-      }
+      AttributeReferencePtr aParentRef =
+          theOwner->reference(SketchPlugin_SketchEntity::PARENT_ID());
+      theParent = aParentRef ? ModelAPI_Feature::feature(aParentRef->value()) : FeaturePtr();
     }
   }
 }