FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anUpdatedIter);
if (aFeature.get()) {
// execute not-previewed feature on "apply"
- if (!aFeature->isPreviewNeeded() && myJustUpdated.find(aFeature) != myJustUpdated.end()) {
+ if (!aFeature->isPreviewNeeded()) {
static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
if (aFactory->validate(aFeature)) {
executeFeature(aFeature);
}
// remove macro on apply
if (aFeature->isMacro()) {
- myJustUpdated.erase(aFeature); // to avoid the map update problems on "remove"
aFeature->document()->removeFeature(aFeature);
+ myJustUpdated.erase(aFeature);
+ }
+ // to avoid the map update problems on "remove"
+ if (myJustUpdated.find(aFeature) == myJustUpdated.end()) {
anUpdatedIter = myJustUpdated.begin();
} else {
anUpdatedIter++;
}
if (isAutomaticChanged) myIsAutomatic = false;
- // make just updated clear after each processing: it is not needed anymore, update causes
- // execute immideately
- //myJustUpdated.clear(); // just before myIsExecuted = false because after myJustUpdated will be processed again
myIsExecuted = false;
// flush to update display
std::shared_ptr<ModelAPI_Result> aRes = *aRIter;
aRes->data()->execState(theState);
if (theFeature->data()->updateID() > aRes->data()->updateID()) {
- myJustUpdated.insert(aRes);
aRes->data()->setUpdateID(theFeature->data()->updateID());
}
ModelAPI_EventCreator::get()->sendUpdated(aRes, EVENT_DISP);