X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Dumper.cpp;h=20e8ff20f36c221f489705c00c7b8ca20b1eb388;hb=6b615b773dd6e6901cd246ecb55003a9941e2365;hp=a5073da9e1ec3a84d6581afb1e64b45f228ecd9e;hpb=59021a07c78eb8f73fefef9128ecc463040682ef;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index a5073da9e..20e8ff20f 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -214,7 +214,8 @@ void ModelHighAPI_Dumper::saveResultNames(const FeaturePtr& theFeature) const std::list& aResults = theFeature->results(); std::list::const_iterator aResIt = aResults.begin(); for (int i = 0; aResIt != aResults.end(); ++aResIt, ++i) { - std::string aDefaultName = ModelAPI_Tools::getDefaultName(*aResIt, i); + std::pair aName = ModelAPI_Tools::getDefaultName(*aResIt, i); + std::string aDefaultName = aName.first; std::string aResName = (*aResIt)->data()->name(); bool isUserDefined = !(isFeatureDefaultName && aDefaultName == aResName); @@ -229,7 +230,8 @@ void ModelHighAPI_Dumper::saveResultNames(const FeaturePtr& theFeature) for (int j = 0; j < aNbSubs; ++j) { ResultPtr aSub = aCompSolid->subResult(j); std::string aSubName = aSub->data()->name(); - aDefaultName = ModelAPI_Tools::getDefaultName(aSub, j); + aName = ModelAPI_Tools::getDefaultName(aSub, j); + aDefaultName = aName.first; bool isUserDefinedSubName = isUserDefined || aDefaultName != aSubName; myNames[aSub] = EntityName(aSubName, @@ -279,6 +281,8 @@ bool ModelHighAPI_Dumper::process(const std::shared_ptr& theD } } } + // dump folders if any + dumpPostponed(true); return isOk; } @@ -325,6 +329,8 @@ bool ModelHighAPI_Dumper::process(const std::shared_ptr::const_iterator anIt = aPostponedCopy.begin(); for (; anIt != aPostponedCopy.end(); ++anIt) { FolderPtr aFolder = std::dynamic_pointer_cast(*anIt); - if (aFolder) - dumpFolder(aFolder); + if (aFolder) { + if (theDumpFolders) + dumpFolder(aFolder); + else + myPostponed.push_back(*anIt); + } else { FeaturePtr aFeature = std::dynamic_pointer_cast(*anIt); if (aFeature)