-ModelAPI_FeatureUpdatedMessage::ModelAPI_FeatureUpdatedMessage(
- const boost::shared_ptr<ModelAPI_Document>& theDoc,
- const boost::shared_ptr<ModelAPI_Feature>& theFeature, const Events_ID& theEvent)
- : Events_Message(theEvent, 0), myFeature(theFeature), myDoc(theDoc)
-{}
+/// Alone instance of the creator per application
+Model_EventCreator MY_CREATOR;
+
+/////////////////////// CREATOR /////////////////////////////
+void Model_EventCreator::sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent,
+ const bool isGroupped) const
+{
+ std::shared_ptr<Model_ObjectUpdatedMessage> aMsg(
+ new Model_ObjectUpdatedMessage(theObject, theEvent));
+ Events_Loop::loop()->send(aMsg, isGroupped);
+}
+
+void Model_EventCreator::sendDeleted(const std::shared_ptr<ModelAPI_Document>& theDoc,
+ const std::string& theGroup) const
+{
+ std::shared_ptr<Model_ObjectDeletedMessage> aMsg(
+ new Model_ObjectDeletedMessage(theDoc, theGroup));
+ 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);
+}
+
+/////////////////////// UPDATED MESSAGE /////////////////////////////
+Model_ObjectUpdatedMessage::Model_ObjectUpdatedMessage(const ObjectPtr& theObject,
+ const Events_ID& theEvent)
+ : ModelAPI_ObjectUpdatedMessage(theEvent, 0)
+{
+ if (theObject) {
+ myObjects.insert(theObject);
+ }
+}
+
+const std::set<ObjectPtr>& Model_ObjectUpdatedMessage::objects() const
+{
+ return myObjects;
+}