-// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
#include <GeomAlgoAPI_MakeShapeList.h>
#include <GeomAlgoAPI_PointBuilder.h>
// Getting objects.
GeomAPI_ShapeHierarchy anObjects;
std::list<ResultPtr> aParts;
+ ResultPtr aTextureSource;
AttributeSelectionListPtr anObjSelList = selectionList(OBJECTS_LIST_ID());
if (!FeaturesPlugin_Tools::shapesFromSelectionList(
- anObjSelList, isKeepSubShapes, anObjects, aParts))
+ anObjSelList, isKeepSubShapes, anObjects, aParts, aTextureSource))
return;
std::string anError;
anObjects.topLevelObjects(aTopLevel);
for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) {
ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
- aMakeShapeList, *anIt, "Rotated");
+ ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
+ aMakeShapeList, *anIt, "Rotated");
+ // Copy image data, if any
+ ModelAPI_Tools::copyImageAttribute(aTextureSource, aResultBody);
setResult(aResultBody, aResultIndex++);
}