X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Symmetry.cpp;h=80eb4d9b7a1c8ac7ca20f721f712b201ed136acb;hb=04e2497fc973f0afc95d0a4a6f95e37fb27f45e8;hp=e877c4016b7f709a7db6a82c3cd2cacfd2b0f57a;hpb=1fd15bed1c62f994a3438bc4a12f44d0361f98c9;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp index e877c4016..80eb4d9b7 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.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 @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -204,13 +205,14 @@ void FeaturesPlugin_Symmetry::buildResult( const std::shared_ptr& theAlgo, const std::list >& theOriginalShapes, std::shared_ptr theTargetShape, int& theResultIndex, - std::string & theTextureFile) + const ResultPtr& theTextureSource) { // Store and name the result. ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, theOriginalShapes, ListOfShape(), - theAlgo, theTargetShape, "Symmetried"); - aResultBody->setTextureFile(theTextureFile); + ModelAPI_Tools::loadModifiedShapes(aResultBody, theOriginalShapes, ListOfShape(), + theAlgo, theTargetShape, "Symmetried"); + // Copy image data, if any + ModelAPI_Tools::copyImageAttribute(theTextureSource, aResultBody); setResult(aResultBody, theResultIndex++); } @@ -281,10 +283,10 @@ void FeaturesPlugin_Symmetry::performSymmetry(GeomTrsfPtr theTrsf) // Getting objects. GeomAPI_ShapeHierarchy anObjects; std::list 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; @@ -312,7 +314,7 @@ void FeaturesPlugin_Symmetry::performSymmetry(GeomTrsfPtr theTrsf) 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);