+
+ // do it before the transaction finish to make just created/removed objects know dependencies
+ // and reference from composite feature is removed automatically
+ FeaturePtr anOwnerFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
+ if (anOwnerFeature.get()) {
+ aData->addBackReference(anOwnerFeature, id(), false);
+ }
+ ADD_BACK_REF(theObject);
+ owner()->data()->sendAttributeUpdated(this);
+ } else if (theObject.get() == NULL) {
+ REMOVE_BACK_REF(anObject);
+ myRef->Set(myRef->Label()); // reference to itself means that object is null
+ myID->Set(""); // feature is identified by the empty ID