+ aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelectionList::typeId());
+ for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) {
+ std::shared_ptr<ModelAPI_AttributeSelectionList> aSel =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*aRefsIter);
+ for(int a = aSel->size() - 1; a >= 0; a--) {
+ std::shared_ptr<ModelAPI_AttributeSelection> aSelAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(aSel->value(a));
+ if (aSelAttr) {
+ ObjectPtr aContext = aSelAttr->context();
+ // update argument onlt if the referenced object is changed
+ if (aContext.get() && isUpdated(aContext) && !aContext->isDisabled()) {
+ if (aState == ModelAPI_StateDone)
+ aState = ModelAPI_StateMustBeUpdated;
+ if (!aSelAttr->update()) {
+ if (!aFactory->isNotObligatory(
+ theFeature->getKind(), theFeature->data()->id(aSel)) &&
+ aFactory->isCase(theFeature, theFeature->data()->id(aSel)))
+ aState = ModelAPI_StateInvalidArgument;
+ }
+ }
+ }
+ }
+ }
+ //}
+ if (aJustUpdated && myJustCreated.find(theFeature) == myJustCreated.end())
+ myJustUpdated.insert(theFeature);
+ if (aState != ModelAPI_StateDone)
+ theFeature->data()->execState(aState);
+}
+
+void Model_Update::updateFeature(FeaturePtr theFeature)
+{
+ // check all features this feature depended on (recursive call of updateFeature)
+ static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
+
+ if (theFeature->data()->execState() == ModelAPI_StateInvalidArgument)
+ return;
+ bool aJustUpdated = false;
+
+ if (theFeature) {
+ if (myIsAutomatic && theFeature->data()->execState() == ModelAPI_StateMustBeUpdated)
+ aJustUpdated = true;
+
+ ModelAPI_ExecState aState = ModelAPI_StateDone;
+