Salome HOME
Simplification of environment due to SALOME standards
[modules/shaper.git] / src / Model / Model_Events.cpp
index a87fc9fb8a320d05b9569d0953b20fd624a22997..7847f99b10a4fca3e4a00a30ba3ed87f84637df6 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        Model_Events.cxx
 // Created:     10 Apr 2014
 // Author:      Mikhail PONIKAROV
@@ -25,6 +27,14 @@ void Model_EventCreator::sendDeleted(const std::shared_ptr<ModelAPI_Document>& t
   Events_Loop::loop()->send(aMsg, true);
 }
 
+void Model_EventCreator::sendReordered(const std::shared_ptr<ModelAPI_Document>& theDoc,
+                                       const std::string& theGroup) const
+{
+  std::shared_ptr<Model_OrderUpdatedMessage> aMsg(
+    new Model_OrderUpdatedMessage(theDoc, theGroup));
+  Events_Loop::loop()->send(aMsg, true);
+}
+
 Model_EventCreator::Model_EventCreator()
 {
   ModelAPI_EventCreator::set(this);
@@ -92,3 +102,17 @@ void Model_ObjectDeletedMessage::Join(const std::shared_ptr<Events_MessageGroup>
     myGroups.insert(*aGIter);
   }
 }
+
+/////////////////////// REORDERED MESSAGE /////////////////////////////
+Model_OrderUpdatedMessage::Model_OrderUpdatedMessage(
+    const std::shared_ptr<ModelAPI_Document>& theDoc, const std::string& theGroup)
+    : ModelAPI_OrderUpdatedMessage(messageId(), 0),
+      myDoc(theDoc), myGroup(theGroup)
+{
+}
+
+const Events_ID Model_OrderUpdatedMessage::messageId()
+{
+  static Events_ID MY_ID = Events_Loop::eventByName(EVENT_ORDER_UPDATED);
+  return MY_ID;
+}