// event: feature is added
static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
ModelAPI_EventCreator::get()->sendUpdated(aFeature, anEvent);
+ aFeature->setDisabled(false); // by default created feature is enabled
setCurrentFeature(aFeature); // after all this feature stays in the document, so make it current
} else { // feature must be executed
// no creation event => updater not working, problem with remove part
for(int a = aSize - 1; a >= 0; a--) {
FeaturePtr aFeature =
std::dynamic_pointer_cast<ModelAPI_Feature>(object(ModelAPI_Feature::group(), a, true));
+
+ // check this before passed become enabled: the current feature is enabled!
+ if (aFeature == theCurrent) aPassed = true;
+
if (aFeature->setDisabled(!aPassed)) {
// state of feature is changed => so feature become updated
static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
ModelAPI_EventCreator::get()->sendUpdated(aFeature, anUpdateEvent);
}
- // check this only after passed become enabled: the current feature is enabled!
- if (aFeature == theCurrent) aPassed = true;
}
}
void Model_Update::updateArguments(FeaturePtr theFeature) {
static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
+ if (theFeature->isDisabled()) // nothing to do with disabled feature
+ return;
bool aJustUpdated = false;
ModelAPI_ExecState aState = ModelAPI_StateDone;
// check the parameters: values can be changed
{
// check all features this feature depended on (recursive call of updateFeature)
static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
+
+ if (theFeature->isDisabled()) // nothing to do with disabled feature
+ return;
bool aJustUpdated = false;
if (theFeature) {