X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Update.h;h=c5f27713841c6346db681b1140a9f777f6ae4155;hb=176403004ff97696f3c0b5f8bdf48692177fb34a;hp=ff3e67660b3b4875ad31bb3c8a1def6fe30fa858;hpb=32d1a4d19ab1a5d7c172e9660130fcf8ecb1e520;p=modules%2Fshaper.git diff --git a/src/Model/Model_Update.h b/src/Model/Model_Update.h index ff3e67660..c5f277138 100644 --- a/src/Model/Model_Update.h +++ b/src/Model/Model_Update.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: Model_Update.hxx // Created: 25 Jun 2014 // Author: Mikhail PONIKAROV @@ -6,13 +8,16 @@ #define Model_Update_H_ #include "Model.h" +#include #include "Events_Listener.h" -#include +#include #include #include class ModelAPI_Object; class ModelAPI_Feature; +class ModelAPI_CompositeFeature; +class Model_Objects; /**\class Model_Update * \ingroup DataModel @@ -20,32 +25,78 @@ class ModelAPI_Feature; */ class Model_Update : public Events_Listener { - /// initial set of updated features that must be processed - std::set > myInitial; - /// already updated and processed features and modificated feature flag - std::map, bool> myUpdated; - /// to know that all next updates are caused by this execution - bool isExecuted; - /// to know execute or not automatically all update - bool isAutomatic; - /// execute just created features for sure - bool isCreated; + /// 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 which arguments were modified by not-persistent changes. + /// So, these referencing arguments must be updated + /// due to these features info also before execution). + std::map, std::set > > + myNotPersistentRefs; + /// 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; + /// to avoid infinitive cycling: feature -> count of the processing periods during this update + std::map, int > myProcessed; + /// if preview in hte property panel is blocked and + /// any update is postponed until the end of operation + bool myIsPreviewBlocked; public: /// Is called only once, on startup of the application Model_Update(); /// Processes the feature argument update: executes the results - MODEL_EXPORT virtual void processEvent(const boost::shared_ptr& theMessage); + MODEL_EXPORT virtual void processEvent(const std::shared_ptr& theMessage); + +protected: + /// 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 + /// returns true if something reallsy was added to the modified and must be processed + bool addModified( + std::shared_ptr theFeature, std::shared_ptr theReason); - protected: - /// Recoursively checks and updates the feature if needed (calls the execute method) + /// Recoursively checks and updates features if needed (calls the execute method) /// Returns true if feature was updated. - bool updateFeature(boost::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 + void redisplayWithResults(std::shared_ptr theFeature, + const ModelAPI_ExecState theState); + + /// On operation start/end/abort the "Just" fileds must be cleared and processed in the right way + //! \param theFlushRedisplay a boolean value if the redisplay signal should be flushed + void processFeatures(const bool theFlushRedisplay = true); + + /// 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); + + /// Updates a selection attributes for the features that possible were affected by creation + /// or reorder of features upper in the history line (issue #1757) + void updateSelection(const std::set >& theObjects); - /// Recoursively checks and updates the object (result or feature) if needed (calls updateFeature) - /// Returns true if object was updated. - bool updateObject(boost::shared_ptr theObject); }; #endif