Salome HOME
bos #29475 Option to create new part on study open
[modules/shaper.git] / src / Model / Model_Session.cpp
index 5456d832e98d199aa678f4724d925883d2bfba62..37224746df949fbab6501ac844ccf2c02bef9e08 100644 (file)
@@ -21,7 +21,6 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Plugin.h>
 #include <Model_Data.h>
-#include <Model_Document.h>
 #include <Model_Objects.h>
 #include <Model_Application.h>
 #include <Model_Events.h>
@@ -60,7 +59,9 @@ static Model_Session* myImpl = new Model_Session();
 
 bool Model_Session::load(const char* theFileName)
 {
+  myIsLoading = true;
   bool aRes = ROOT_DOC->load(theFileName, "root", ROOT_DOC);
+  myIsLoading = false;
   return aRes;
 }
 
@@ -179,6 +180,11 @@ std::list<std::string> Model_Session::redoList()
   return ROOT_DOC->redoList();
 }
 
+void Model_Session::clearUndoRedo()
+{
+  return ROOT_DOC->clearUndoRedo();
+}
+
 bool Model_Session::checkLicense(const std::string& thePluginName)
 {
   return getPlugin(thePluginName);
@@ -448,6 +454,7 @@ Model_Session::Model_Session()
 {
   myPluginsInfoLoaded = false;
   myCheckTransactions = true;
+  myIsLoading = false;
   ModelAPI_Session::setSession(std::shared_ptr<ModelAPI_Session>(this));
   // register the configuration reading listener
   Events_Loop* aLoop = Events_Loop::loop();
@@ -674,3 +681,10 @@ void Model_Session::blockAutoUpdate(const bool theBlock)
     }
   }
 }
+
+#ifdef TINSPECTOR
+Handle(TDocStd_Application) Model_Session::application()
+{
+  return Model_Application::getApplication();
+}
+#endif
\ No newline at end of file