X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Translation.cpp;h=6a3ceeae37eda34a2aaea2d0fa26ddfcfa5d9e2a;hb=8f8cca340a8eb75d742c2e34c4265dd5b3f56628;hp=9dc5f3d99d6d4cae164632361fae53a21d88aa55;hpb=745c72679f6346375d5e886b25cc3865f3c4daae;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index 9dc5f3d99..6a3ceeae3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -1,4 +1,4 @@ -// 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 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -197,9 +198,10 @@ void FeaturesPlugin_Translation::performTranslation(const GeomTrsfPtr& theTrsf) // Getting objects. GeomAPI_ShapeHierarchy anObjects; std::list aParts; + ResultPtr aTextureSource; AttributeSelectionListPtr anObjectsSelList = selectionList(OBJECTS_LIST_ID()); - if (!FeaturesPlugin_Tools::shapesFromSelectionList( - anObjectsSelList, isKeepSubShapes, anObjects, aParts)) + if (!FeaturesPlugin_Tools::shapesFromSelectionList + (anObjectsSelList, isKeepSubShapes, anObjects, aParts, aTextureSource)) return; std::string anError; @@ -238,8 +240,10 @@ void FeaturesPlugin_Translation::performTranslation(const GeomTrsfPtr& theTrsf) 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, "Translated"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Translated"); + // Copy image data, if any + ModelAPI_Tools::copyImageAttribute(aTextureSource, aResultBody); setResult(aResultBody, aResultIndex++); }