Salome HOME
Added the system of reinitialization of attributes instead of re-creation of them...
[modules/shaper.git] / src / Model / Model_AttributeRefList.cpp
index 36d11541c50724c82befa3355af40875bee1e31a..9d6f25ff36d448b2f70d7b97a68b77eb3e4b2935 100644 (file)
@@ -343,11 +343,17 @@ void Model_AttributeRefList::remove(const std::set<int>& theIndices)
 
 Model_AttributeRefList::Model_AttributeRefList(TDF_Label& theLabel)
 {
-  myIsInitialized = theLabel.FindAttribute(TDataStd_ReferenceList::GetID(), myRef) == Standard_True;
+  myLab = theLabel;
+  reinit();
+}
+
+void Model_AttributeRefList::reinit()
+{
+  myIsInitialized = myLab.FindAttribute(TDataStd_ReferenceList::GetID(), myRef) == Standard_True;
   if (!myIsInitialized) {
-    myRef = TDataStd_ReferenceList::Set(theLabel);
+    myRef = TDataStd_ReferenceList::Set(myLab);
   }
-  if (!theLabel.FindAttribute(TDataStd_ExtStringList::GetID(), myExtDocRef)) {
-    myExtDocRef = TDataStd_ExtStringList::Set(theLabel);
+  if (!myLab.FindAttribute(TDataStd_ExtStringList::GetID(), myExtDocRef)) {
+    myExtDocRef = TDataStd_ExtStringList::Set(myLab);
   }
 }