From 475907b0fc15df6367aaa0b564d14b692602b8db Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 17 Jan 2017 17:16:22 +0300 Subject: [PATCH] Issue #1965: Redisplay sketch object in case it was created outside GUI --- src/PartSet/PartSet_SketcherMgr.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 81945bbd4..ccd18aed0 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -903,6 +903,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) // Display sketcher objects QStringList anInfo; + Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); + const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) { FeaturePtr aFeature = myCurrentSketch->subFeature(i); #ifdef DEBUG_SKETCHER_ENTITIES @@ -911,9 +913,16 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) std::list aResults = aFeature->results(); std::list::const_iterator aIt; for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { - (*aIt)->setDisplayed(true); + if ((*aIt)->isDisplayed()) + // Display object if it was created outside of GUI + aECreator->sendUpdated((*aIt), EVENT_DISP); + else + (*aIt)->setDisplayed(true); } - aFeature->setDisplayed(true); + if (aFeature->isDisplayed()) + aECreator->sendUpdated(aFeature, EVENT_DISP); + else + aFeature->setDisplayed(true); } #ifdef DEBUG_SKETCHER_ENTITIES QString anInfoStr = anInfo.join(";\t"); -- 2.39.2