1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_Update.hxx
4 // Created: 25 Jun 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_Update_H_
8 #define Model_Update_H_
11 #include <ModelAPI_Data.h>
12 #include "Events_Listener.h"
17 class ModelAPI_Object;
18 class ModelAPI_Feature;
20 /**\class Model_Update
22 * \brief Updates the results of features when it is needed.
24 class Model_Update : public Events_Listener
26 /// updated features during this transaction: must be updated immediately
27 std::set<std::shared_ptr<ModelAPI_Object> > myJustUpdated;
28 /// to know that all next updates are caused by this execution
30 /// to know execute or not automatically all update
32 /// to know that some parameter was changed during this operation
33 bool myIsParamUpdated;
36 /// Is called only once, on startup of the application
39 /// Processes the feature argument update: executes the results
40 MODEL_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
43 /// Recoursively checks and updates the feature if needed (calls the execute method)
44 /// Returns true if feature was updated.
45 void updateFeature(std::shared_ptr<ModelAPI_Feature> theFeature,
46 std::set<std::shared_ptr<ModelAPI_Feature> >& theProcessed);
48 /// Updates the selection and parametrical arguments before the later feature analysis
49 /// Returns true if something really was updated
50 void updateArguments(std::shared_ptr<ModelAPI_Feature> theFeature);
52 /// Sends the redisplay events for feature and results, updates the updated status
53 void redisplayWithResults(std::shared_ptr<ModelAPI_Feature> theFeature,
54 const ModelAPI_ExecState theState);
56 /// On operation start/end/abort the "Just" fileds must be cleared and processed in the right way
57 /// \param theTotalUpdate force to updates everything that has been changed in this operation
58 void processOperation(const bool theTotalUpdate, const bool theFinish = false);
60 /// Performs the feature execution
61 /// \returns the status of execution
62 void executeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);