From: vsv Date: Tue, 17 Jan 2017 14:16:22 +0000 (+0300) Subject: Issue #1965: Redisplay sketch object in case it was created outside GUI X-Git-Tag: V_2.7.0~330 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=475907b0fc15df6367aaa0b564d14b692602b8db;p=modules%2Fshaper.git Issue #1965: Redisplay sketch object in case it was created outside GUI --- 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");