]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1965: Redisplay sketch object in case it was created outside GUI
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 17 Jan 2017 14:16:22 +0000 (17:16 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 17 Jan 2017 14:16:22 +0000 (17:16 +0300)
src/PartSet/PartSet_SketcherMgr.cpp

index 81945bbd47f3d1625bacd730172936e98d31d288..ccd18aed06d71d54fbe0cc7bfe22897e8b049710 100755 (executable)
@@ -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<ResultPtr> aResults = aFeature->results();
     std::list<ResultPtr>::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");