- ListOfShape aShapes;
- aShapes.push_back(aBaseShape);
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
- aShapes,
- ListOfShape(),
- aScaleAlgo,
- aScaleAlgo->shape(),
- "Scaled");
- setResult(aResultBody, aResultIndex);
- aResultIndex++;
+ // Build results of the scaling
+ int aResultIndex = 0;
+ const ListOfShape& anOriginalShapes = anObjects.objects();
+ ListOfShape aTopLevel;
+ anObjects.topLevelObjects(aTopLevel);
+ for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) {
+ ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
+ ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
+ aMakeShapeList, *anIt, "Scaled");
+ // Copy image data, if any
+ ModelAPI_Tools::copyImageAttribute(aTextureSource, aResultBody);
+ setResult(aResultBody, aResultIndex++);