aNewAttr->setID(id());
mySize->Set(aNewTag);
aNewAttr->setValue(theContext, theSubShape, theTemporarily);
+ if (theTemporarily)
+ myTmpAttr = aNewAttr;
+ else
+ myTmpAttr.reset();
owner()->data()->sendAttributeUpdated(this);
}
aOldAttr->setObject(owner());
REMOVE_BACK_REF(aOldAttr->context());
aLab.ForgetAllAttributes(Standard_True);
+ myTmpAttr.reset();
owner()->data()->sendAttributeUpdated(this);
}
}
std::shared_ptr<ModelAPI_AttributeSelection>
Model_AttributeSelectionList::value(const int theIndex)
{
+ if (myTmpAttr.get() && theIndex == size() - 1) {
+ return myTmpAttr;
+ }
TDF_Label aLabel = mySize->Label().FindChild(theIndex + 1);
// create a new attribute each time, by demand
// supporting of old attributes is too slow (synch each time) and buggy on redo
{
if (mySize->Get() != 0) {
mySize->Set(0);
+ myTmpAttr.reset();
TDF_ChildIterator aSubIter(mySize->Label());
for(; aSubIter.More(); aSubIter.Next()) {
TDF_Label aLab = aSubIter.Value();
{
Handle(TDataStd_Integer) mySize; ///< Contains size of this list
Handle(TDataStd_Comment) mySelectionType; ///< Contains current type name (same as selection attribute)
+ std::shared_ptr<Model_AttributeSelection> myTmpAttr; ///< temporary attribute (the last one)
public:
/// Adds the new reference to the end of the list
/// \param theContext object where the sub-shape was selected