static const Events_ID kOpStartEvent = aLoop->eventByName("StartOperation");
aLoop->registerListener(this, kOpStartEvent);
+ /* not needed now with history line
Config_PropManager::registerProp("Model update", "automatic_rebuild", "Rebuild immediately",
- Config_Prop::Boolean, "false");
+ Config_Prop::Boolean, "false");*/
myIsAutomatic = true;
// Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true";
myIsParamUpdated = false;
std::cout<<"****** Event "<<theMessage->eventID().eventText()<<std::endl;
#endif
if (theMessage->eventID() == kChangedEvent) { // automatic and manual rebuild flag is changed
- bool aPropVal =
+ /*bool aPropVal =
Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true";
if (aPropVal != myIsAutomatic) { // something is changed
// myIsAutomatic = aPropVal;
if (myIsAutomatic) // higher level of automatization => to rebuild
processOperation(false);
- }
+ }*/
+ return;
} else if (theMessage->eventID() == kRebuildEvent) { // the rebuild command
processOperation(true);
} else if (theMessage->eventID() == kCreatedEvent || theMessage->eventID() == kUpdatedEvent ||
if (theFeature->isDisabled())
return;
- // to optimize with NDS: how to update sketch state if sketch is not executed on apply of sub-element
+ // do not execute the composite that contains the current
//CompositeFeaturePtr aMain = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theFeature);
- //if (aMain.get() && aMain->isSub(theFeature->document()->currentFeature(false))) // do no update the composite that contains the current
- // return;
+ //bool isPostponedMain = aMain.get() && aMain->isSub(theFeature->document()->currentFeature(false));
#ifdef DEB_UPDATE
std::cout<<"Update Feature "<<theFeature->name()<<std::endl;
if (aJustUpdated) {
ModelAPI_ExecState aState = theFeature->data()->execState();
if (aFactory->validate(theFeature)) {
- #ifdef DEB_UPDATE
- std::cout<<"Execute Feature "<<theFeature->name()<<std::endl;
- #endif
- executeFeature(theFeature);
+ //if (!isPostponedMain) {
+ #ifdef DEB_UPDATE
+ std::cout<<"Execute Feature "<<theFeature->name()<<std::endl;
+ #endif
+ executeFeature(theFeature);
+ //}
} else {
#ifdef DEB_UPDATE
std::cout<<"Feature is not valid, erase results "<<theFeature->name()<<std::endl;
} else { // preview is not needed => make state Done
if (theFeature->data()->execState() == ModelAPI_StateMustBeUpdated) {
theFeature->data()->execState(ModelAPI_StateDone);
- if (aJustUpdated) // store that it must be updated on finish
+ if (aJustUpdated) {// store that it must be updated on finish
myUpdated[theFeature] = myModification;
+ aFactory->validate(theFeature); // need to be validated to update the "Apply" state if not previewed
+ }
}
}
}