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);
+}
+
void Model_AttributeSelectionList::removeTemporaryValues()
{
if (myTmpAttr.get()) {
// (if attribute is deleted and created, the abort updates attriute and makes the Attr invalid)
std::shared_ptr<Model_AttributeSelection> aNewAttr =
std::shared_ptr<Model_AttributeSelection>(new Model_AttributeSelection(aLabel));
- aNewAttr->setID(id());
if (owner()) {
aNewAttr->setObject(owner());
aNewAttr->setParent(this);
}
+ aNewAttr->setID(id());
return aNewAttr;
}
}
Model_AttributeSelectionList::Model_AttributeSelectionList(TDF_Label& theLabel)
+: myLab(theLabel),
+ myIsGeometricalSelection(false)
{
- myLab = theLabel;
reinit();
}
}
}
}
+
+void Model_AttributeSelectionList::setGeometricalSelection(const bool theIsGeometricalSelection)
+{
+ myIsGeometricalSelection = theIsGeometricalSelection;
+ // TODO: update list accodring to the flag:
+ // false - all objects with same geometry must be splited in separate.
+ // true - all objets with same geometry must be combined into single.
+}