From: azv Date: Thu, 1 Sep 2016 11:46:27 +0000 (+0300) Subject: Correct naming of results while dumping X-Git-Tag: V_2.5.0~85 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c9aced7d9d388cb02806dccf83f99dd9604f31d;p=modules%2Fshaper.git Correct naming of results while dumping --- diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index fe2875f8c..5086d7662 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -111,7 +111,6 @@ const std::string& ModelHighAPI_Dumper::name(const EntityPtr& theEntity, // should be the same to identify feature's name as automatically generated. if (aNbFeatures == anId) { // name is not user-defined - aName.clear(); isDefaultName = true; } } @@ -159,7 +158,15 @@ const std::string& ModelHighAPI_Dumper::parentName(const FeaturePtr& theEntity) void ModelHighAPI_Dumper::saveResultNames(const FeaturePtr& theFeature) { - const std::string& aFeatureName = myNames[theFeature].myCurrentName; + // Default name of the feature + const std::string& aKind = theFeature->getKind(); + DocumentPtr aDoc = theFeature->document(); + int aNbFeatures = myFeatureCount[aDoc][aKind]; + std::ostringstream aNameStream; + aNameStream << aKind << "_" << aNbFeatures; + std::string aFeatureName = aNameStream.str(); + + // Save only names of results which is not correspond to default feature name const std::list& aResults = theFeature->results(); std::list::const_iterator aResIt = aResults.begin(); for (int i = 1; aResIt != aResults.end(); ++aResIt, ++i) {