]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Events/Events_Loop.cpp
Salome HOME
Resolve constraint only when all events have been processed by the PlaneGCSSolver
[modules/shaper.git] / src / Events / Events_Loop.cpp
index 013e0a02d6e9e0952e76a42db5da0c165b2046f9..181f588a2f0e230b1897484f9e444647ca952466 100644 (file)
@@ -171,6 +171,7 @@ void Events_Loop::flush(const Events_ID& theID)
 {
   if (!myFlushActive)
     return;
+  bool hasEventsToFlush = !myGroups.empty();
   std::map<char*, std::shared_ptr<Events_Message> >::iterator aMyGroup;
   for(aMyGroup = myGroups.find(theID.eventText());
     aMyGroup != myGroups.end(); aMyGroup = myGroups.find(theID.eventText()))
@@ -206,6 +207,11 @@ void Events_Loop::flush(const Events_ID& theID)
       }
     }
   }
+  if (hasEventsToFlush && myGroups.empty()) { // no more messages left in the queue, so, finalize the sketch processing
+    static Events_ID anID = Events_Loop::eventByName("SketchPrepared");
+    std::shared_ptr<Events_Message> aMsg(new Events_Message(anID, this));
+    Events_Loop::loop()->send(aMsg, false);
+  }
 }
 
 void Events_Loop::eraseMessages(const Events_ID& theID)