]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Session.cpp
Salome HOME
Merge branch 'master' into BR_PYTHON_PLUGIN
[modules/shaper.git] / src / Model / Model_Session.cpp
index 16a4d07f0bc2d242ffd2b63de10d32fdc5e8978a..409e91cbf29380bbc9289cde5b68b71e208c7e28 100644 (file)
@@ -39,6 +39,12 @@ bool Model_Session::save(const char* theFileName, std::list<std::string>& theRes
   return ROOT_DOC->save(theFileName, theResults);
 }
 
+void Model_Session::closeAll()
+{
+  ROOT_DOC->close(true);
+  Model_Application::getApplication()->deleteAllDocuments();
+}
+
 void Model_Session::startOperation()
 {
   ROOT_DOC->startOperation();
@@ -96,6 +102,9 @@ FeaturePtr Model_Session::createFeature(string theFeatureID)
     return myImpl->createFeature(theFeatureID);
   }
 
+  // load all information about plugins, features and attributes
+  LoadPluginsInfo();
+
   if (myPlugins.find(theFeatureID) != myPlugins.end()) {
     std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
     if (!aPlugin.second.empty() && aPlugin.second != activeDocument()->kind()) {
@@ -212,9 +221,6 @@ Model_Session::Model_Session()
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED), 0, true);
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED), 0, true);
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_VALIDATOR_LOADED));
-  
-  // load all information about plugins, features and attributes
-  LoadPluginsInfo();
 }
 
 void Model_Session::processEvent(const boost::shared_ptr<Events_Message>& theMessage)