-boost::shared_ptr<ModelAPI_Document> Model_Session::copy(
- boost::shared_ptr<ModelAPI_Document> theSource, std::string theID)
+std::list<std::shared_ptr<ModelAPI_Document> > Model_Session::allOpenedDocuments()
+{
+ list<std::shared_ptr<ModelAPI_Document> > aResult;
+ aResult.push_back(moduleDocument());
+ // add subs recursively
+ list<std::shared_ptr<ModelAPI_Document> >::iterator aDoc = aResult.begin();
+ for(; aDoc != aResult.end(); aDoc++) {
+ DocumentPtr anAPIDoc = *aDoc;
+ std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(anAPIDoc);
+ if (aDoc) {
+ const std::set<std::string> aSubs = aDoc->subDocuments(true);
+ std::set<std::string>::const_iterator aSubIter = aSubs.cbegin();
+ for(; aSubIter != aSubs.cend(); aSubIter++) {
+ if (!Model_Application::getApplication()->isLoadByDemand(*aSubIter)) {
+ aResult.push_back(Model_Application::getApplication()->getDocument(*aSubIter));
+ }
+ }
+ }
+ }
+ return aResult;
+}
+
+bool Model_Session::isLoadByDemand(const std::string theDocID)
+{
+ return Model_Application::getApplication()->isLoadByDemand(theDocID);
+}
+
+std::shared_ptr<ModelAPI_Document> Model_Session::copy(
+ std::shared_ptr<ModelAPI_Document> theSource, std::string theID)