Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git]
/
src
/
Model
/
Model_Application.cpp
diff --git
a/src/Model/Model_Application.cpp
b/src/Model/Model_Application.cpp
index fe51e99a8decfb6694c0fb0dfc412802d66f4017..147bb4ac29e2c4450b28c73bafa042215c8c8c18 100644
(file)
--- a/
src/Model/Model_Application.cpp
+++ b/
src/Model/Model_Application.cpp
@@
-1,3
+1,5
@@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: Model_Application.cxx
// Created: Fri Sep 2 2011
// Author: Mikhail PONIKAROV
// File: Model_Application.cxx
// Created: Fri Sep 2 2011
// Author: Mikhail PONIKAROV
@@
-19,12
+21,15
@@
Handle(Model_Application) Model_Application::getApplication()
}
//=======================================================================
}
//=======================================================================
-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];
{
if (myDocs.find(theDocID) != myDocs.end())
return myDocs[theDocID];
- boost::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
+ static const std::string thePartSetKind("PartSet");
+ static const std::string thePartKind("Part");
+ 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
if (myLoadedByDemand.find(theDocID) != myLoadedByDemand.end() && !myPath.empty()) {
myDocs[theDocID] = aNew;
// load it if it must be loaded by demand
if (myLoadedByDemand.find(theDocID) != myLoadedByDemand.end() && !myPath.empty()) {
@@
-37,7
+42,17
@@
const boost::shared_ptr<Model_Document>& Model_Application::getDocument(string t
void Model_Application::deleteDocument(string theDocID)
{
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();
}
//=======================================================================
}
//=======================================================================
@@
-52,12
+67,24
@@
void Model_Application::setLoadPath(std::string thePath)
myPath = thePath;
}
myPath = thePath;
}
+//=======================================================================
+const std::string& Model_Application::loadPath() const
+{
+ return myPath;
+}
+
//=======================================================================
void Model_Application::setLoadByDemand(std::string theID)
{
myLoadedByDemand.insert(theID);
}
//=======================================================================
void Model_Application::setLoadByDemand(std::string theID)
{
myLoadedByDemand.insert(theID);
}
+//=======================================================================
+bool Model_Application::isLoadByDemand(std::string theID)
+{
+ return myLoadedByDemand.find(theID) != myLoadedByDemand.end();
+}
+
//=======================================================================
Model_Application::Model_Application()
{
//=======================================================================
Model_Application::Model_Application()
{