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
Prepare version 1.2.1: quick fix for iteration 2 release
[modules/shaper.git]
/
src
/
Model
/
Model_Session.cpp
diff --git
a/src/Model/Model_Session.cpp
b/src/Model/Model_Session.cpp
index 8dcd0a11b0e04e008fc17b0d4f906fb9058be13e..04229f2c2257af2b46404547d8a463d4c23fe384 100644
(file)
--- a/
src/Model/Model_Session.cpp
+++ b/
src/Model/Model_Session.cpp
@@
-9,6
+9,7
@@
#include <ModelAPI_Plugin.h>
#include <Model_Data.h>
#include <Model_Document.h>
#include <ModelAPI_Plugin.h>
#include <Model_Data.h>
#include <Model_Document.h>
+#include <Model_Objects.h>
#include <Model_Application.h>
#include <Model_Events.h>
#include <Model_Validator.h>
#include <Model_Application.h>
#include <Model_Events.h>
#include <Model_Validator.h>
@@
-36,7
+37,7
@@
static Model_Session* myImpl = new Model_Session();
bool Model_Session::load(const char* theFileName)
{
bool Model_Session::load(const char* theFileName)
{
- bool aRes = ROOT_DOC->load(theFileName);
+ bool aRes = ROOT_DOC->load(theFileName
, ROOT_DOC
);
return aRes;
}
return aRes;
}
@@
-47,7
+48,6
@@
bool Model_Session::save(const char* theFileName, std::list<std::string>& theRes
void Model_Session::closeAll()
{
void Model_Session::closeAll()
{
- ROOT_DOC->close(true);
Model_Application::getApplication()->deleteAllDocuments();
}
Model_Application::getApplication()->deleteAllDocuments();
}
@@
-131,10
+131,10
@@
std::list<std::string> Model_Session::redoList()
return ROOT_DOC->redoList();
}
return ROOT_DOC->redoList();
}
-FeaturePtr Model_Session::createFeature(string theFeatureID)
+FeaturePtr Model_Session::createFeature(string theFeatureID
, Model_Document* theDocOwner
)
{
if (this != myImpl) {
{
if (this != myImpl) {
- return myImpl->createFeature(theFeatureID);
+ return myImpl->createFeature(theFeatureID
, theDocOwner
);
}
// load all information about plugins, features and attributes
}
// load all information about plugins, features and attributes
@@
-142,7
+142,7
@@
FeaturePtr Model_Session::createFeature(string theFeatureID)
if (myPlugins.find(theFeatureID) != myPlugins.end()) {
std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
if (myPlugins.find(theFeatureID) != myPlugins.end()) {
std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
- if (!aPlugin.second.empty() && aPlugin.second !=
activeDocument()
->kind()) {
+ if (!aPlugin.second.empty() && aPlugin.second !=
theDocOwner
->kind()) {
Events_Error::send(
string("Feature '") + theFeatureID + "' can be created only in document '"
+ aPlugin.second + "' by the XML definition");
Events_Error::send(
string("Feature '") + theFeatureID + "' can be created only in document '"
+ aPlugin.second + "' by the XML definition");
@@
-216,7
+216,7
@@
void Model_Session::setActiveDocument(
if (aDoc.get()) {
bool aWasChecked = myCheckTransactions;
setCheckTransactions(false);
if (aDoc.get()) {
bool aWasChecked = myCheckTransactions;
setCheckTransactions(false);
- aDoc->synchronizeFeatures(false, true, true);
+ aDoc->
objects()->
synchronizeFeatures(false, true, true);
if (aWasChecked)
setCheckTransactions(true);
}
if (aWasChecked)
setCheckTransactions(true);
}
@@
-249,6
+249,11
@@
std::list<std::shared_ptr<ModelAPI_Document> > Model_Session::allOpenedDocuments
return aResult;
}
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)
{
std::shared_ptr<ModelAPI_Document> Model_Session::copy(
std::shared_ptr<ModelAPI_Document> theSource, std::string theID)
{
@@
-266,7
+271,7
@@
std::shared_ptr<ModelAPI_Document> Model_Session::copy(
aRT->SetRelocation(aSourceRoot, aTargetRoot);
TDF_CopyTool::Copy(aDS, aRT);
aRT->SetRelocation(aSourceRoot, aTargetRoot);
TDF_CopyTool::Copy(aDS, aRT);
- aNew->synchronizeFeatures(false, true, true);
+ aNew->
objects()->
synchronizeFeatures(false, true, true);
return aNew;
}
return aNew;
}