From: mpv Date: Tue, 16 Aug 2016 12:23:21 +0000 (+0300) Subject: Improve the copy feature: make initialized attributes and internal content due in... X-Git-Tag: V_2.5.0~137^2~37^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=457b5e1d4368db3aead4592ad2b254bc47949f51;p=modules%2Fshaper.git Improve the copy feature: make initialized attributes and internal content due in accordance with the attributes stored in the data tree --- diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 60714f8be..7fb08b88d 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -638,15 +638,10 @@ void Model_Data::copyTo(std::shared_ptr theTarget) { TDF_Label aTargetRoot = std::dynamic_pointer_cast(theTarget)->label(); copyAttrs(myLab, aTargetRoot); - // make initialized the initialized attributes - std::map >::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 aTData = std::dynamic_pointer_cast(theTarget); + aTData->myAttrs.clear(); + theTarget->owner()->initAttributes(); // reinit feature attributes } bool Model_Data::isInHistory()