From dbcf1539af60b7e4b1da03e99e7da6891d5cdb4e Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 3 Sep 2015 12:21:05 +0300 Subject: [PATCH] Fix for the problem of update of BOP created on CompSolid every time (like Group objects selection) --- src/Model/Model_Update.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 244aa6867..116a55daf 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -380,6 +380,23 @@ void Model_Update::redisplayWithResults(FeaturePtr theFeature, const ModelAPI_Ex aRes->data()->setUpdateID(theFeature->data()->updateID()); } ModelAPI_EventCreator::get()->sendUpdated(aRes, EVENT_DISP); + // iterate sub-bodies of compsolid + ResultCompSolidPtr aComp = std::dynamic_pointer_cast(aRes); + if (aComp.get()) { + int aNumSub = aComp->numberOfSubs(); + for(int a = 0; a < aNumSub; a++) { + ResultPtr aSub = aComp->subResult(a); + if (!aSub->isDisabled()) {// update state only for enabled results (Placement Result Part may make the original Part Result as invalid) + aSub->data()->execState(theState); + if (theState == ModelAPI_StateDone) // feature become "done", so execution changed results + myUpdated[aSub] = myModification; + } + if (theFeature->data()->updateID() > aSub->data()->updateID()) { + aSub->data()->setUpdateID(theFeature->data()->updateID()); + } + ModelAPI_EventCreator::get()->sendUpdated(aSub, EVENT_DISP); + } + } } // to redisplay "presentable" feature (for ex. distance constraint) ModelAPI_EventCreator::get()->sendUpdated(theFeature, EVENT_DISP); -- 2.39.2