]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Objects.cpp
Salome HOME
Implementation of Partition movement using new result creation, with different data...
[modules/shaper.git] / src / Model / Model_Objects.cpp
index bec8764981b61c836d663b56105a010969f0b36f..9e4e270ac0e02706ae5e4bf060bc5792f1e13dcf 100644 (file)
@@ -799,18 +799,11 @@ std::shared_ptr<ModelAPI_ResultPart> Model_Objects::createPart(
 }
 
 std::shared_ptr<ModelAPI_ResultPart> Model_Objects::copyPart(
-    const std::shared_ptr<ModelAPI_Result>& theOldPart, 
-    const std::shared_ptr<ModelAPI_ResultPart>& theOrigin, const int theIndex)
+    const std::shared_ptr<ModelAPI_ResultPart>& theOrigin,
+    const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
 {
-  std::shared_ptr<ModelAPI_ResultPart> aResult;
-  if (theOldPart.get()) {
-    aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(theOldPart);
-  }
-  if (!aResult) {
-    aResult = std::shared_ptr<ModelAPI_ResultPart>(new Model_ResultPart);
-    aResult->setDoc(myDoc);
-    aResult->setData(theOrigin->data());
-  }
+  std::shared_ptr<ModelAPI_ResultPart> aResult = createPart(theFeatureData, theIndex);
+  aResult->data()->reference(Model_ResultPart::BASE_REF_ID())->setValue(theOrigin);
   return aResult;
 }