X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Events.h;h=f30c447904ecd73694bb3796e5fda090b6297861;hb=85a3a34f6b8a9e925f4055e874c1e7f8833f0ac3;hp=f0031e1a8e50d98b3f1e981a8691f1155b92802f;hpb=2c4f7de06341fa7af89f47ba405fe188f13e3600;p=modules%2Fshaper.git diff --git a/src/Model/Model_Events.h b/src/Model/Model_Events.h index f0031e1a8..f30c44790 100644 --- a/src/Model/Model_Events.h +++ b/src/Model/Model_Events.h @@ -9,65 +9,71 @@ #include /// Allovs to create ModelAPI messages -class Model_EventCreator : public ModelAPI_EventCreator { -public: +class Model_EventCreator : public ModelAPI_EventCreator +{ + public: /// creates created, updated or moved messages and sends to the loop - virtual void sendUpdated( - const ObjectPtr& theObject, const Events_ID& theEvent, const bool isGroupped = true) const; + virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent, + const bool isGroupped = true) const; /// creates deleted message and sends to the loop - virtual void sendDeleted( - const boost::shared_ptr& theDoc, const std::string& theGroup) const; + virtual void sendDeleted(const boost::shared_ptr& theDoc, + const std::string& theGroup) const; /// must be one per application, the constructor for internal usage only Model_EventCreator(); }; /// Message that feature was changed (used for Object Browser update): moved, updated and deleted -class Model_ObjectUpdatedMessage : public ModelAPI_ObjectUpdatedMessage { - std::set myObjects; ///< which feature is changed +class Model_ObjectUpdatedMessage : public ModelAPI_ObjectUpdatedMessage +{ + std::set myObjects; ///< which feature is changed /// Sender is not important, all information is located in the feature. /// Use ModelAPI for creation of this event. Used for creation, movement and edition events. - Model_ObjectUpdatedMessage( - const ObjectPtr& theObject, - const Events_ID& theEvent); + Model_ObjectUpdatedMessage(const ObjectPtr& theObject, const Events_ID& theEvent); friend class Model_EventCreator; -public: + public: /// Returns the feature that has been updated - virtual std::set objects() const; + virtual const std::set& objects() const; //! Creates a new empty group (to store it in the loop before flush) - virtual Events_MessageGroup* newEmpty(); + virtual boost::shared_ptr newEmpty(); //! Allows to join the given message with the current one - virtual void Join(Events_MessageGroup& theJoined); + virtual void Join(const boost::shared_ptr& theJoined); }; /// Message that feature was deleted (used for Object Browser update) -class Model_ObjectDeletedMessage : public ModelAPI_ObjectDeletedMessage { - boost::shared_ptr myDoc; ///< document owner of the feature - std::set myGroups; ///< group identifiers that contained the deleted feature +class Model_ObjectDeletedMessage : public ModelAPI_ObjectDeletedMessage +{ + boost::shared_ptr myDoc; ///< document owner of the feature + std::set myGroups; ///< group identifiers that contained the deleted feature /// Use ModelAPI for creation of this event. - Model_ObjectDeletedMessage( - const boost::shared_ptr& theDoc, const std::string& theGroup); + Model_ObjectDeletedMessage(const boost::shared_ptr& theDoc, + const std::string& theGroup); friend class Model_EventCreator; -public: + public: /// Returns the feature that has been updated - virtual boost::shared_ptr document() const {return myDoc;} + virtual boost::shared_ptr document() const + { + return myDoc; + } /// Returns the group where the feature was deleted - virtual const std::set& groups() const {return myGroups;} - - virtual Events_MessageGroup* newEmpty(); + virtual const std::set& groups() const + { + return myGroups; + } + virtual boost::shared_ptr newEmpty(); virtual const Events_ID messageId(); - virtual void Join(Events_MessageGroup& theJoined); + virtual void Join(const boost::shared_ptr& theJoined); }; #endif