Salome HOME
Clean Property panel before starting of a new operation.
[modules/shaper.git] / src / Model / Model_Application.cpp
index 166b4e1a173f3812013eabdce23d4aec14c8f8f2..df32ef977d7c599acfbb7dbadc23c99492533fb7 100644 (file)
@@ -26,6 +26,12 @@ const boost::shared_ptr<Model_Document>& Model_Application::getDocument(string t
 
   boost::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
   myDocs[theDocID] = aNew;
+  // load it if it must be loaded by demand
+  if (myLoadedByDemand.find(theDocID) != myLoadedByDemand.end() && !myPath.empty()) {
+    aNew->load(myPath.c_str());
+    myLoadedByDemand.erase(theDocID); // done, don't do it anymore
+  }
+
   return myDocs[theDocID];
 }
 
@@ -40,6 +46,18 @@ bool Model_Application::hasDocument(std::string theDocID)
   return myDocs.find(theDocID) != myDocs.end();
 }
 
+//=======================================================================
+void Model_Application::setLoadPath(std::string thePath)
+{
+  myPath = thePath;
+}
+
+//=======================================================================
+void Model_Application::setLoadByDemand(std::string theID)
+{
+  myLoadedByDemand.insert(theID);
+}
+
 //=======================================================================
 Model_Application::Model_Application()
 {