-// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
const std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theAlgo,
const std::list<std::shared_ptr<GeomAPI_Shape> >& theOriginalShapes,
std::shared_ptr<GeomAPI_Shape> theTargetShape, int& theResultIndex,
- std::string & theTextureFile)
+ const ResultPtr& theTextureSource)
{
// Store and name the result.
ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
ModelAPI_Tools::loadModifiedShapes(aResultBody, theOriginalShapes, ListOfShape(),
theAlgo, theTargetShape, "Symmetried");
- aResultBody->setTextureFile(theTextureFile);
+ // Copy image data, if any
+ ModelAPI_Tools::copyImageAttribute(theTextureSource, aResultBody);
setResult(aResultBody, theResultIndex++);
}
// Getting objects.
GeomAPI_ShapeHierarchy anObjects;
std::list<ResultPtr> aParts;
- std::string theTextureFile;
+ ResultPtr aTextureSource;
AttributeSelectionListPtr anObjSelList = selectionList(OBJECTS_LIST_ID());
if (!FeaturesPlugin_Tools::shapesFromSelectionList(
- anObjSelList, isKeepSubShapes, anObjects, aParts, theTextureFile))
+ anObjSelList, isKeepSubShapes, anObjects, aParts, aTextureSource))
return;
std::string anError;
ListOfShape aTopLevel;
anObjects.topLevelObjects(aTopLevel);
for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt)
- buildResult(aMakeShapeList, anOriginalShapes, *anIt, aResultIndex, theTextureFile);
+ buildResult(aMakeShapeList, anOriginalShapes, *anIt, aResultIndex, aTextureSource);
// Remove the rest results if there were produced in the previous pass.
removeResults(aResultIndex);