1 // File: Model_Update.hxx
2 // Created: 25 Jun 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef Model_Update_H_
6 #define Model_Update_H_
9 #include "Events_Listener.h"
10 #include <boost/shared_ptr.hpp>
14 class ModelAPI_Object;
15 class ModelAPI_Feature;
17 /**\class Model_Update
19 * \brief Updates the results of features when it is needed.
21 class Model_Update : public Events_Listener
23 ///< initial set of updated features that must be processed
24 std::set<boost::shared_ptr<ModelAPI_Object> > myInitial;
25 ///< already updated and processed features and modificated feature flag
26 std::map<boost::shared_ptr<ModelAPI_Object>, bool> myUpdated;
27 ///< to know that all next updates are caused by this execution
30 /// Is called only once, on startup of the application
33 /// Processes the feature argument update: executes the results
34 MODEL_EXPORT virtual void processEvent(const Events_Message* theMessage);
37 /// Recoursively checks and updates the feature if needed (calls the execute method)
38 /// Returns true if feature was updated.
39 bool updateFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
41 /// Recoursively checks and updates the object (result or feature) if needed (calls updateFeature)
42 /// Returns true if object was updated.
43 bool updateObject(boost::shared_ptr<ModelAPI_Object> theObject);