Salome HOME
bos #29475 Merge branch 'CR29475'
[modules/shaper.git] / src / ModelAPI / ModelAPI_Session.h
index 42739259ca96f863d932a4b27af4672d54956de9..4cfd45aa6336bdb875661a5b3e73d35e1c663245 100644 (file)
@@ -40,6 +40,9 @@ class ModelAPI_FiltersFactory;
 
 class MODELAPI_EXPORT ModelAPI_Session
 {
+protected:
+  bool myIsLoading; ///< keeps the state of the loading of the document
+
  public:
   /// Returns the real implementation (the alone instance per application) of the plugin manager
   static std::shared_ptr<ModelAPI_Session> get();
@@ -49,6 +52,9 @@ class MODELAPI_EXPORT ModelAPI_Session
   //! \returns true if file was loaded successfully
   virtual bool load(const char* theFileName) = 0;
 
+  //! Returns true if a loading process is performed (so, no need to react on a new part creation)
+  virtual bool isLoading() { return myIsLoading; };
+
   //! Saves the OCAF document to the file.
   //! \param theFileName full name of the file to store
   //! \param theResults the result full file names that were stored by "save"
@@ -86,6 +92,8 @@ class MODELAPI_EXPORT ModelAPI_Session
   virtual std::list<std::string> undoList() = 0;
   //! Returns stack of rolled back operations (from last rolled back to first)
   virtual std::list<std::string> redoList() = 0;
+  //! Clears undo and redo lists of all documents in the session
+  virtual void clearUndoRedo() = 0;
 
   /// Registers the plugin that creates features.
   /// It is obligatory for each plugin to call this function on loading to be found by