-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
if (anUpdated.get()) {
if (addModified(anUpdated, FeaturePtr()))
aSomeModified = true;
- if (myUpdateBlocked) { // execute this feature anyway to show the current result
- /*if (!anUpdated->isStable() && anUpdated->results().size() && (
- anUpdated->firstResult()->groupName() == ModelAPI_ResultBody::group() ||
- anUpdated->firstResult()->groupName() == ModelAPI_ResultPart::group())) {
- if (aFactory->validate(anUpdated)) {
- executeFeature(anUpdated);
- redisplayWithResults(anUpdated, ModelAPI_StateNothing, false);
- static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- aLoop->flush(EVENT_DISP);
- }
- }*/
- }
} else {
// process the updated result as update of features that refers to this result
const std::set<std::shared_ptr<ModelAPI_Attribute> >&
if (!isPostponedMain) {
bool aDoExecute = true;
if (myUpdateBlocked) {
- if (!theFeature->isStable()) {
+ if (!theFeature->isStable() || (theFeature->getKind().size() > 6 &&
+ theFeature->getKind().substr(0, 6) == "Sketch")) { // automatic update sketch elements
aDoExecute = true;
} else if (theFeature->results().size()) { // execute only not persistent results features
aDoExecute = !theFeature->isPersistentResult();
bool isObligatory = !aFactory->isNotObligatory(
theFeature->getKind(), theFeature->data()->id(aSel)) &&
aFactory->isCase(theFeature, theFeature->data()->id(aSel));
- if (isObligatory)
+ if (isObligatory ||
+ // #24260 : sketch plane was selected, but selection becomes wrong, make it invalid
+ (theFeature->getKind() == "Sketch" && aSel->id() == "External"))
aState = ModelAPI_StateInvalidArgument;
}
}
bool isObligatory = aFactory->isCase(theFeature, theFeature->data()->id(aSel));
if (isObligatory)
aState = ModelAPI_StateInvalidArgument;
- } else if (theFeature->getKind() == "Sketch" && aSel->id() == "External" &&
- aSel->isInitialized()) {
+ } else if (aSel->isInitialized()) {
// #19703 : if sketch plane was selected, but after context disappears, it must become invalid
aSel->update();
if (aSel->isInvalid()) {