- bool isUserDefinedName = !myNames[theEntity].myIsDefault;
- // store results if they have user-defined names or colors
- std::list<ResultPtr> aResultsWithNameOrColor;
- const std::list<ResultPtr>& aResults = theEntity->results();
- std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
- for (; aResIt != aResults.end(); ++aResIt)
- if (!myNames[*aResIt].myIsDefault || !isDefaultColor(*aResIt) || !isDefaultDeflection(*aResIt))
- aResultsWithNameOrColor.push_back(*aResIt);
- // store just dumped entity to stack
- myEntitiesStack.push(LastDumpedEntity(theEntity, isUserDefinedName, aResultsWithNameOrColor));
+ if (!myNames[theEntity].myIsDumped) {
+ bool isUserDefinedName = !myNames[theEntity].myIsDefault;
+ // store results if they have user-defined names or colors
+ std::list<ResultPtr> aResultsWithNameOrColor;
+ const std::list<ResultPtr>& aResults = theEntity->results();
+ std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
+ for (; aResIt != aResults.end(); ++aResIt) {
+ if (!myNames[*aResIt].myIsDefault || !isDefaultColor(*aResIt) ||
+ !isDefaultDeflection(*aResIt) || !isDefaultTransparency(*aResIt))
+ aResultsWithNameOrColor.push_back(*aResIt);
+
+ ResultCompSolidPtr aCompSolid =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(*aResIt);
+ if (aCompSolid) {
+ int aNbSubs = aCompSolid->numberOfSubs();
+ for (int i = 0; i < aNbSubs; ++i) {
+ ResultPtr aCurRes = aCompSolid->subResult(i);
+ if (!myNames[aCurRes].myIsDefault || !isDefaultColor(aCurRes) ||
+ !isDefaultDeflection(aCurRes) || !isDefaultTransparency(aCurRes))
+ aResultsWithNameOrColor.push_back(aCurRes);
+ }
+ }
+ }
+ // store just dumped entity to stack
+ if (myEntitiesStack.empty() || myEntitiesStack.top().myEntity != theEntity)
+ myEntitiesStack.push(
+ LastDumpedEntity(theEntity, isUserDefinedName, aResultsWithNameOrColor));
+ }