X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Application.cpp;h=128f6ee4dffa76228158d713d4a5967ffabb6d8b;hb=d150af3c6e788269822b07b3bf344a66b71b523f;hp=bdd9eda3a5ff2862d808fa76f141e3ff38b00aba;hpb=f1cd93fd02a54259f72e3191d037323a496b2bef;p=modules%2Fshaper.git diff --git a/src/Model/Model_Application.cpp b/src/Model/Model_Application.cpp index bdd9eda3a..128f6ee4d 100644 --- a/src/Model/Model_Application.cpp +++ b/src/Model/Model_Application.cpp @@ -67,6 +67,12 @@ void Model_Application::setLoadPath(std::string thePath) myPath = thePath; } +//======================================================================= +const std::string& Model_Application::loadPath() const +{ + return myPath; +} + //======================================================================= void Model_Application::setLoadByDemand(std::string theID) { @@ -79,6 +85,27 @@ bool Model_Application::isLoadByDemand(std::string theID) return myLoadedByDemand.find(theID) != myLoadedByDemand.end(); } +//======================================================================= +void Model_Application::removeUselessDocuments( + std::list > theUsedDocs) +{ + std::map >::iterator aDoc = myDocs.begin(); + while(aDoc != myDocs.end()) { + bool aFound = false; + std::list >::iterator aUsed = theUsedDocs.begin(); + for(; !aFound && aUsed != theUsedDocs.end(); aUsed++) { + aFound = aDoc->second == *aUsed; + } + if (!aFound) { // remove the useless + aDoc->second->close(); + myDocs.erase(aDoc); + aDoc = myDocs.begin(); + } else { + aDoc++; + } + } +} + //======================================================================= Model_Application::Model_Application() {