Salome HOME
Attaching a debug OCAF browser plugin
[modules/shaper.git] / src / Model / Model_Update.h
1 // File:        Model_Update.hxx
2 // Created:     25 Jun 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_Update_HeaderFile
6 #define Model_Update_HeaderFile
7
8 #include "Model.h"
9 #include "Events_Listener.h"
10 #include <boost/shared_ptr.hpp>
11 #include <set>
12 #include <map>
13
14 class ModelAPI_Feature;
15
16 /**\class Model_Update
17  * \ingroup DataModel
18  * \brief Updates the results of features when it is needed.
19  */
20 class Model_Update : public Events_Listener
21 {
22   ///< initial set of updated features that must be processed
23   std::set<boost::shared_ptr<ModelAPI_Feature> > myInitial;
24   ///< already updated and processed features and modificated feature flag
25   std::map<boost::shared_ptr<ModelAPI_Feature>, bool> myUpdated;
26 public:
27   /// Is called only once, on startup of the application
28   Model_Update();
29
30   /// Processes the feature argument update: executes the results
31   MODEL_EXPORT virtual void processEvent(const Events_Message* theMessage);
32
33 protected:
34   /// Recoursively checks and updates the feature if needed
35   /// Returns true if feature was updated.
36   bool updateFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
37 };
38
39 #endif