Salome HOME
Added the system of reinitialization of attributes instead of re-creation of them...
[modules/shaper.git] / src / Model / Model_AttributeSelectionList.cpp
index e97a2ee4918331235f52a227afc75931a4e2f9fb..856db04473f8860fe7d6c5f7152ecba4d4a0ba10 100644 (file)
@@ -288,16 +288,23 @@ bool Model_AttributeSelectionList::isInitialized()
 
 Model_AttributeSelectionList::Model_AttributeSelectionList(TDF_Label& theLabel)
 {
-  myIsInitialized = theLabel.FindAttribute(TDataStd_Integer::GetID(), mySize) == Standard_True;
+  myLab = theLabel;
+  reinit();
+}
+
+void Model_AttributeSelectionList::reinit()
+{
+  myIsInitialized = myLab.FindAttribute(TDataStd_Integer::GetID(), mySize) == Standard_True;
   if (!myIsInitialized) {
-    mySize = TDataStd_Integer::Set(theLabel, 0);
-    mySelectionType = TDataStd_Comment::Set(theLabel, "");
+    mySize = TDataStd_Integer::Set(myLab, 0);
+    mySelectionType = TDataStd_Comment::Set(myLab, "");
   } else { // recollect mySubs
-    theLabel.FindAttribute(TDataStd_Comment::GetID(), mySelectionType);
+    myLab.FindAttribute(TDataStd_Comment::GetID(), mySelectionType);
   }
   myIsCashed = false;
 }
 
+
 void Model_AttributeSelectionList::cashValues(const bool theEnabled)
 {
   myIsCashed = theEnabled;