]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Improve the copy feature: make initialized attributes and internal content due in...
authormpv <mpv@opencascade.com>
Tue, 16 Aug 2016 12:23:21 +0000 (15:23 +0300)
committermpv <mpv@opencascade.com>
Tue, 16 Aug 2016 12:23:21 +0000 (15:23 +0300)
src/Model/Model_Data.cpp

index 60714f8becb2a6d490c21542327ee6954207acbf..7fb08b88dc82847763cfcd804cc33619f44d54c0 100644 (file)
@@ -638,15 +638,10 @@ void Model_Data::copyTo(std::shared_ptr<ModelAPI_Data> theTarget)
 {
   TDF_Label aTargetRoot = std::dynamic_pointer_cast<Model_Data>(theTarget)->label();
   copyAttrs(myLab, aTargetRoot);
-  // make initialized the initialized attributes
-  std::map<std::string, std::shared_ptr<ModelAPI_Attribute> >::iterator aMyIter = myAttrs.begin();
-  for(; aMyIter != myAttrs.end(); aMyIter++) {
-    if (aMyIter->second->isInitialized()) {
-      AttributePtr aTargetAttr = theTarget->attribute(aMyIter->first);
-      if (aTargetAttr)
-        aTargetAttr->setInitialized();
-    }
-  }
+  // reinitialize Model_Attributes by TDF_Attributes set
+  std::shared_ptr<Model_Data> aTData = std::dynamic_pointer_cast<Model_Data>(theTarget);
+  aTData->myAttrs.clear();
+  theTarget->owner()->initAttributes(); // reinit feature attributes
 }
 
 bool Model_Data::isInHistory()