#include <ModelAPI_Events.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_Result.h>
#include <ModelAPI_Validator.h>
#include <Events_Loop.h>
aMustbeUpdated = true;
}
}
+ // reference to attribute or object
+ list<boost::shared_ptr<ModelAPI_Attribute> > aRefAttrs = theFeature->data()->attributes(
+ ModelAPI_AttributeRefAttr::type());
+ for (aRefsIter = aRefAttrs.begin(); aRefsIter != aRefAttrs.end(); aRefsIter++) {
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*aRefsIter);
+ if (!aRef) continue;
+ if (aRef->isObject()) {
+ boost::shared_ptr<ModelAPI_Object> aSub = aRef->object();
+ if (updateObject(aSub)) {
+ aMustbeUpdated = true;
+ }
+ } else if (aRef->attr()) { // reference to the attribute
+ boost::shared_ptr<ModelAPI_Object> aSub = aRef->attr()->owner();
+ if (updateObject(aSub)) {
+ aMustbeUpdated = true;
+ }
+ }
+ }
// lists of references
aRefs = theFeature->data()->attributes(ModelAPI_AttributeRefList::type());
for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) {