+ // Collect transformations for each object.
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList);
+
+ for(GeomAPI_ShapeHierarchy::iterator anObjectsIt = anObjects.begin();
+ anObjectsIt != anObjects.end(); anObjectsIt++) {
+ std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
+ std::shared_ptr<GeomAlgoAPI_Transform> aTransformAlgo(
+ new GeomAlgoAPI_Transform(aBaseShape, aTrsf));
+
+ // Checking that the algorithm worked properly.
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTransformAlgo, getKind(), anError)) {
+ setError(anError);
+ break;
+ }
+
+ anObjects.markModified(aBaseShape, aTransformAlgo->shape());
+ aMakeShapeList->appendAlgo(aTransformAlgo);
+ }
+
+ // Build results of the operation.
+ const ListOfShape& anOriginalShapes = anObjects.objects();
+ ListOfShape aTopLevel;
+ anObjects.topLevelObjects(aTopLevel);
+ for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) {
+ //LoadNamingDS
+ ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
+ FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
+ aMakeShapeList, *anIt, "Placed");
+ aResultBody->setTextureFile(theTextureFile);
+ setResult(aResultBody, aResultIndex++);