X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Update.h;h=060b5c9d965cb36a18b4cf9f06db23053e44989e;hb=530f5aff42069e844c4a4ef164088ea23ba0e2dd;hp=9eed59029039bf88b463321f05250b3ed0a973a0;hpb=c226a781a4ceda6053101f63fd3d621a18838706;p=modules%2Fshaper.git diff --git a/src/Model/Model_Update.h b/src/Model/Model_Update.h index 9eed59029..060b5c9d9 100644 --- a/src/Model/Model_Update.h +++ b/src/Model/Model_Update.h @@ -16,6 +16,8 @@ class ModelAPI_Object; class ModelAPI_Feature; +class ModelAPI_CompositeFeature; +class Model_Objects; /**\class Model_Update * \ingroup DataModel @@ -23,14 +25,21 @@ class ModelAPI_Feature; */ class Model_Update : public Events_Listener { - /// created features during this transaction: must be updated all the time - std::set > myJustCreated; - /// updated features during this transaction: must be updated in the end of transaction - std::set > myJustUpdated; - /// to know that all next updates are caused by this execution - bool myIsExecuted; - /// to know execute or not automatically all update - bool myIsAutomatic; + /// Features and results that were modified and not yet processed. + /// The second set is the objects that causes this object is modified + std::map, std::set > > + myModified; + /// features that must be additionally processed after execution of finish operation + std::set > myWaitForFinish; + /// to know that some parameter was changed during this operation (to enable update expressions) + bool myIsParamUpdated; + /// to execute features on finish if preview is needed only on finish operation + bool myIsFinish; + /// try if processing is currently performed + bool myIsProcessed; + /// set that contains features that must be executed only on finish of the operation + std::set > myProcessOnFinish; + public: /// Is called only once, on startup of the application @@ -40,13 +49,18 @@ class Model_Update : public Events_Listener MODEL_EXPORT virtual void processEvent(const std::shared_ptr& theMessage); protected: - /// updates all features in the document and then - in sub-documents - void updateInDoc(std::shared_ptr theDoc); - /// Recoursively checks and updates the feature if needed (calls the execute method) + /// Appends the new modified feature to the myModified, clears myProcessed if needed + /// Returns true if some feature really was marked as modified + /// theReason is the object that causes modification of this feature + void addModified( + std::shared_ptr theFeature, std::shared_ptr theReason); + + /// Recoursively checks and updates features if needed (calls the execute method) /// Returns true if feature was updated. - void updateFeature(std::shared_ptr theFeature); + bool processFeature(std::shared_ptr theFeature); /// Updates the selection and parametrical arguments before the later feature analysis + /// Returns true if something really was updated void updateArguments(std::shared_ptr theFeature); /// Sends the redisplay events for feature and results, updates the updated status @@ -54,12 +68,19 @@ protected: const ModelAPI_ExecState theState); /// On operation start/end/abort the "Just" fileds must be cleared and processed in the right way - /// \param theTotalUpdate force to updates everything that has been changed in this operation - void processOperation(const bool theTotalUpdate, const bool theFinish = false); + /// \param theFinish is true for start, close or abort transaction: all objects must be processed + void processFeatures(); /// Performs the feature execution /// \returns the status of execution void executeFeature(std::shared_ptr theFeature); + + /// Updates the properties of object because of stability state changes + void updateStability(void* theSender); + + /// Returns true if theFeature modification was caused by theReason (may be feature of result of this feature) + bool isReason( + std::shared_ptr& theFeature, std::shared_ptr theReason); }; #endif