]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Document.cpp
Salome HOME
Issue #3095: Import Part: provide list of parts if any
[modules/shaper.git] / src / Model / Model_Document.cpp
index 2e01c4d9d8b78725ab7562da6c2e57235babe0cc..b1efb51d0fbf3a1829c41fc17ad9887985bac883 100644 (file)
@@ -349,9 +349,9 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
   return isOk;
 }
 
-bool Model_Document::import(const char* theFileName,
-                            std::list<std::shared_ptr<ModelAPI_Feature> >& theImported,
-                            bool theCheckBefore)
+bool Model_Document::importPart(const char* theFileName,
+                                std::list<std::shared_ptr<ModelAPI_Feature> >& theImported,
+                                bool theCheckOnly)
 {
   Handle(Model_Application) anApp = Model_Application::getApplication();
   TCollection_ExtendedString aFormat;
@@ -361,7 +361,7 @@ bool Model_Document::import(const char* theFileName,
   Handle(TDocStd_Document) aTempDoc;
   bool isOk = loadDocument(anApp, aTempDoc, theFileName);
 
-  if (isOk && theCheckBefore) {
+  if (isOk && theCheckOnly) {
     // verify all features are applicable for the current document type (e.g. PartSet)
     std::shared_ptr<Model_Session> aSession =
         std::dynamic_pointer_cast<Model_Session>(ModelAPI_Session::get());
@@ -380,7 +380,7 @@ bool Model_Document::import(const char* theFileName,
     }
   }
 
-  if (isOk) {
+  if (isOk && !theCheckOnly) {
     // copy features from the temporary document to the current
     Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable();
     TDF_LabelList anAllNewFeatures;