+
+ // check names of sub-results for CompSolid
+ ResultCompSolidPtr aCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(*aResIt);
+ if (aCompSolid) {
+ int aNbSubs = aCompSolid->numberOfSubs();
+ for (int j = 0; j < aNbSubs; ++j) {
+ isUserDefined = true;
+ ResultPtr aSub = aCompSolid->subResult(j);
+ std::string aSubName = aSub->data()->name();
+ size_t anIndex = aSubName.find(aResName);
+ if (anIndex == 0) {
+ std::string aSuffix = aSubName.substr(aResName.length());
+ if (aSuffix.empty() && aNbSubs == 1) // first result may not constain index in the name
+ isUserDefined = false;
+ else {
+ if (aSuffix[0] == '_' && std::stoi(aSuffix.substr(1)) == j + 1)
+ isUserDefined = false;
+ }
+ }
+
+ myNames[aSub] = EntityName(aSubName,
+ (isUserDefined ? aSubName : std::string()), !isUserDefined);
+ }
+ }