Salome HOME
Naming now stores primitives on tags 11+.
[modules/shaper.git] / src / Model / Model_AttributeSelectionList.cpp
index 7575ca2f91bb0237a965e3d38927b3fb5dc1f96b..9fb4124075eac962de1a6d8b15a7770541194003 100644 (file)
@@ -110,8 +110,24 @@ void Model_AttributeSelectionList::append(const GeomPointPtr& thePoint, const st
   aNewAttr->setID(id());
   mySize->Set(aNewTag);
   aNewAttr->selectSubShape(theType, thePoint);
-  if (selectionType().empty())
-    setSelectionType(aNewAttr->value()->shapeTypeStr());
+  owner()->data()->sendAttributeUpdated(this);
+}
+
+void Model_AttributeSelectionList::append(const std::string& theType,
+  const std::string& theContextName, const int theIndex)
+{
+  int aNewTag = mySize->Get() + 1;
+  TDF_Label aNewLab = mySize->Label().FindChild(aNewTag);
+
+  std::shared_ptr<Model_AttributeSelection> aNewAttr =
+    std::shared_ptr<Model_AttributeSelection>(new Model_AttributeSelection(aNewLab));
+  if (owner()) {
+    aNewAttr->setObject(owner());
+    aNewAttr->setParent(this);
+  }
+  aNewAttr->setID(id());
+  mySize->Set(aNewTag);
+  aNewAttr->selectSubShape(theType, theContextName, theIndex);
   owner()->data()->sendAttributeUpdated(this);
 }