+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: Model_Application.cxx
// Created: Fri Sep 2 2011
// Author: Mikhail PONIKAROV
}
//=======================================================================
-const boost::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
+const std::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
{
if (myDocs.find(theDocID) != myDocs.end())
return myDocs[theDocID];
static const std::string thePartSetKind("PartSet");
static const std::string thePartKind("Part");
- boost::shared_ptr<Model_Document> aNew(
+ std::shared_ptr<Model_Document> aNew(
new Model_Document(theDocID, theDocID == "root" ? thePartSetKind : thePartKind));
myDocs[theDocID] = aNew;
// load it if it must be loaded by demand
void Model_Application::deleteDocument(string theDocID)
{
- myDocs.erase(theDocID);
+ if (myDocs.find(theDocID) != myDocs.end()) {
+ myDocs[theDocID]->close(true);
+ myDocs.erase(theDocID);
+ }
+ myLoadedByDemand.clear();
+}
+
+void Model_Application::deleteAllDocuments()
+{
+ myDocs.clear();
+ myLoadedByDemand.clear();
}
//=======================================================================
myPath = thePath;
}
+//=======================================================================
+const std::string& Model_Application::loadPath() const
+{
+ return myPath;
+}
+
//=======================================================================
void Model_Application::setLoadByDemand(std::string theID)
{