Salome HOME
Make reordered event not grouped
authormpv <mpv@opencascade.com>
Mon, 7 Sep 2015 12:17:47 +0000 (15:17 +0300)
committermpv <mpv@opencascade.com>
Mon, 7 Sep 2015 12:17:47 +0000 (15:17 +0300)
src/Model/Model_Events.cpp
src/Model/Model_Events.h
src/ModelAPI/ModelAPI_Events.cpp
src/ModelAPI/ModelAPI_Events.h

index fb5b650d1e068cfdaa3e22588461e65e9e19ba45..7847f99b10a4fca3e4a00a30ba3ed87f84637df6 100644 (file)
@@ -107,15 +107,8 @@ void Model_ObjectDeletedMessage::Join(const std::shared_ptr<Events_MessageGroup>
 Model_OrderUpdatedMessage::Model_OrderUpdatedMessage(
     const std::shared_ptr<ModelAPI_Document>& theDoc, const std::string& theGroup)
     : ModelAPI_OrderUpdatedMessage(messageId(), 0),
-      myDoc(theDoc)
+      myDoc(theDoc), myGroup(theGroup)
 {
-  if (!theGroup.empty())
-    myGroups.insert(theGroup);
-}
-
-std::shared_ptr<Events_MessageGroup> Model_OrderUpdatedMessage::newEmpty()
-{
-  return std::shared_ptr<Model_OrderUpdatedMessage>(new Model_OrderUpdatedMessage(myDoc, ""));
 }
 
 const Events_ID Model_OrderUpdatedMessage::messageId()
@@ -123,13 +116,3 @@ const Events_ID Model_OrderUpdatedMessage::messageId()
   static Events_ID MY_ID = Events_Loop::eventByName(EVENT_ORDER_UPDATED);
   return MY_ID;
 }
-
-void Model_OrderUpdatedMessage::Join(const std::shared_ptr<Events_MessageGroup>& theJoined)
-{
-  std::shared_ptr<Model_OrderUpdatedMessage> aJoined = 
-    std::dynamic_pointer_cast<Model_OrderUpdatedMessage>(theJoined);
-  std::set<std::string>::iterator aGIter = aJoined->myGroups.begin();
-  for (; aGIter != aJoined->myGroups.end(); aGIter++) {
-    myGroups.insert(*aGIter);
-  }
-}
index 7b5ffdce1931af717d0388e6b04dc7bf370ce38a..97f4170a4c8f7eadda1d44a5919d9b2207aaadbd 100644 (file)
@@ -91,7 +91,7 @@ class Model_ObjectDeletedMessage : public ModelAPI_ObjectDeletedMessage
 class Model_OrderUpdatedMessage : public ModelAPI_OrderUpdatedMessage
 {
   std::shared_ptr<ModelAPI_Document> myDoc;  ///< document owner of the feature
-  std::set<std::string> myGroups;  ///< group identifiers that contained the deleted feature
+  std::string myGroup;  ///< group identifier that contained the deleted feature
 
   /// Use ModelAPI for creation of this event.
   Model_OrderUpdatedMessage(const std::shared_ptr<ModelAPI_Document>& theDoc,
@@ -106,19 +106,13 @@ class Model_OrderUpdatedMessage : public ModelAPI_OrderUpdatedMessage
   }
 
   /// Returns the group where the objects were reordered
-  virtual const std::set<std::string>& groups() const
+  virtual const std::string& group() const
   {
-    return myGroups;
+    return myGroup;
   }
 
-  /// Returns the new empty message of this type
-  virtual std::shared_ptr<Events_MessageGroup> newEmpty();
-
   /// Returns the identifier of this message
   virtual const Events_ID messageId();
-
-  /// Appends to this message the given one
-  virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined);
 };
 
 #endif
index 06068c8b6301404f97e9fb505e1e00a9b76e5b26..85c6c02b7bad6e0e65224fd0adff8299cff9bd0c 100644 (file)
@@ -36,7 +36,7 @@ ModelAPI_ObjectDeletedMessage::~ModelAPI_ObjectDeletedMessage()
 
 ModelAPI_OrderUpdatedMessage::ModelAPI_OrderUpdatedMessage(const Events_ID theID,
                                                              const void* theSender)
-    : Events_MessageGroup(theID, theSender)
+    : Events_Message(theID, theSender)
 {
 
 }
index ae84e6cbc606cc96b62992e6d1f275e21530a827..ef253f5bedc6e1a603f891550343505b5b5dde10 100644 (file)
@@ -101,7 +101,7 @@ public:
 };
 
 /// Message that order changed (used for Object Browser update)
-class MODELAPI_EXPORT ModelAPI_OrderUpdatedMessage : public Events_MessageGroup
+class MODELAPI_EXPORT ModelAPI_OrderUpdatedMessage : public Events_Message
 {
 protected:
   /// Creates an empty message
@@ -114,16 +114,10 @@ public:
   virtual std::shared_ptr<ModelAPI_Document> document() const = 0;
 
   /// Returns the groups where the objects were reordered
-  virtual const std::set<std::string>& groups() const = 0;
-
-  /// Creates the new empty message of this kind
-  virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
+  virtual const std::string& group() const = 0;
 
   /// Returns the identifier of the kind of a message
   virtual const Events_ID messageId() = 0;
-
-  /// Appenad to this message the given one.
-  virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined) = 0;
 };
 
 /// Allows to create ModelAPI messages