Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / Model / Model_AttributeSelectionList.cpp
index 31a2e6473fac8d178f86dc21c3fcad510c595558..e1cb750aab27fc804b051e4c8539dc277be2c0f9 100644 (file)
@@ -34,6 +34,16 @@ int Model_AttributeSelectionList::size()
   return mySize->Get();
 }
 
+int Model_AttributeSelectionList::selectionType()
+{
+  return (int) mySelectionType->Get();
+}
+
+void Model_AttributeSelectionList::setSelectionType(int theType)
+{
+  mySelectionType->Set((double) theType);
+}
+
 boost::shared_ptr<ModelAPI_AttributeSelection> 
   Model_AttributeSelectionList::value(const int theIndex)
 {
@@ -43,6 +53,7 @@ boost::shared_ptr<ModelAPI_AttributeSelection>
 void Model_AttributeSelectionList::clear()
 {
   if (!mySubs.empty()) {
+    mySize->Set(0);
     mySubs.clear();
     TDF_ChildIterator aSubIter(mySize->Label());
     for(; aSubIter.More(); aSubIter.Next()) {
@@ -57,6 +68,7 @@ Model_AttributeSelectionList::Model_AttributeSelectionList(TDF_Label& theLabel)
   myIsInitialized = theLabel.FindAttribute(TDataStd_Integer::GetID(), mySize) == Standard_True;
   if (!myIsInitialized) {
     mySize = TDataStd_Integer::Set(theLabel, 0);
+    mySelectionType = TDataStd_Real::Set(theLabel, 0);
   } else { // recollect mySubs
     int aNum = mySize->Get();
     TDF_ChildIterator aSubIter(theLabel);