Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tangent presentation correction
[modules/shaper.git]
/
src
/
Model
/
Model_Update.cpp
diff --git
a/src/Model/Model_Update.cpp
b/src/Model/Model_Update.cpp
index 7360d0d1ef51fe79f1dfe65b332b765b4fb75301..51eba966c182977e5787340582512cc134b426e3 100644
(file)
--- a/
src/Model/Model_Update.cpp
+++ b/
src/Model/Model_Update.cpp
@@
-67,8
+67,11
@@
void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
static const Events_ID kOpStartEvent = aLoop->eventByName("StartOperation");
bool isAutomaticChanged = false;
if (theMessage->eventID() == kChangedEvent) { // automatic and manual rebuild flag is changed
static const Events_ID kOpStartEvent = aLoop->eventByName("StartOperation");
bool isAutomaticChanged = false;
if (theMessage->eventID() == kChangedEvent) { // automatic and manual rebuild flag is changed
- isAutomatic =
- Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true";
+ bool aPropVal =
+ Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true";
+ if (aPropVal == isAutomatic)
+ return;// nothing to
+ isAutomatic = aPropVal;
} else if (theMessage->eventID() == kRebuildEvent) { // the rebuild command
if (isAutomatic == false) {
isAutomaticChanged = true;
} else if (theMessage->eventID() == kRebuildEvent) { // the rebuild command
if (isAutomatic == false) {
isAutomaticChanged = true;
@@
-82,6
+85,8
@@
void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
std::set<ObjectPtr>::const_iterator anObjIter = anObjs.cbegin();
for(; anObjIter != anObjs.cend(); anObjIter++) {
myJustCreatedOrUpdated.insert(*anObjIter);
std::set<ObjectPtr>::const_iterator anObjIter = anObjs.cbegin();
for(; anObjIter != anObjs.cend(); anObjIter++) {
myJustCreatedOrUpdated.insert(*anObjIter);
+ // TODO(mpv): check the next line. Came into dev 0.6.1 from BR_PYTHON_PLUGIN
+ // (*anObjIter)->data()->mustBeUpdated(true); // object must be updated because it was changed
}
if (theMessage->eventID() == kMovedEvent)
return; // this event is for solver update, not here
}
if (theMessage->eventID() == kMovedEvent)
return; // this event is for solver update, not here
@@
-153,7
+158,7
@@
void Model_Update::updateInDoc(std::shared_ptr<ModelAPI_Document> theDoc)
// all sub-documents one by one
std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(theDoc);
if (aDoc) {
// all sub-documents one by one
std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(theDoc);
if (aDoc) {
- const std::set<std::string>
& aSubs = aDoc->subDocuments(
);
+ const std::set<std::string>
aSubs = aDoc->subDocuments(true
);
for(std::set<std::string>::iterator aSub = aSubs.begin(); aSub != aSubs.end(); aSub++) {
DocumentPtr aSubDoc = theDoc->subDocument(*aSub);
if (aSubDoc) {
for(std::set<std::string>::iterator aSub = aSubs.begin(); aSub != aSubs.end(); aSub++) {
DocumentPtr aSubDoc = theDoc->subDocument(*aSub);
if (aSubDoc) {
@@
-254,7
+259,8
@@
bool Model_Update::updateFeature(FeaturePtr theFeature)
std::shared_ptr<ModelAPI_AttributeSelection> aSel =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*aRefsIter);
if (!aSel->update()) { // this must be done on execution since it may be long operation
std::shared_ptr<ModelAPI_AttributeSelection> aSel =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*aRefsIter);
if (!aSel->update()) { // this must be done on execution since it may be long operation
- if (!aFactory->isNotObligatory(theFeature->getKind(), theFeature->data()->id(aSel)))
+ if (!aFactory->isNotObligatory(theFeature->getKind(), theFeature->data()->id(aSel)) &&
+ aFactory->isCase(theFeature, theFeature->data()->id(aSel)))
aState = ModelAPI_StateInvalidArgument;
}
}
aState = ModelAPI_StateInvalidArgument;
}
}
@@
-268,7
+274,8
@@
bool Model_Update::updateFeature(FeaturePtr theFeature)
if (aSelAttr) {
if (!aSelAttr->update()) {
if (!aFactory->isNotObligatory(
if (aSelAttr) {
if (!aSelAttr->update()) {
if (!aFactory->isNotObligatory(
- theFeature->getKind(), theFeature->data()->id(aSel)))
+ theFeature->getKind(), theFeature->data()->id(aSel)) &&
+ aFactory->isCase(theFeature, theFeature->data()->id(aSel)))
aState = ModelAPI_StateInvalidArgument;
}
}
aState = ModelAPI_StateInvalidArgument;
}
}
@@
-329,7
+336,9
@@
bool Model_Update::updateFeature(FeaturePtr theFeature)
} else { // for automatically updated features (on abort, etc) it is necessary to redisplay anyway
redisplayWithResults(theFeature, ModelAPI_StateNothing);
}
} else { // for automatically updated features (on abort, etc) it is necessary to redisplay anyway
redisplayWithResults(theFeature, ModelAPI_StateNothing);
}
- } else { // returns also true is results were updated: for sketch that refers to sub-features but results of sub-features were changed
+ } else {
+ // returns also true is results were updated: for sketch that
+ // refers to sub-features but results of sub-features were changed
const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = theFeature->results();
std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
for (; aRIter != aResults.cend(); aRIter++) {
const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = theFeature->results();
std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
for (; aRIter != aResults.cend(); aRIter++) {