X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Symmetry.cpp;h=f700c366d288f548d77aeec8dba515f33908d6da;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=6dce5b6c8d459c7101fe1f4b080ec1e42352f9f7;hpb=4462c8acab55ab702986f63117666aa6dea3aa3c;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp index 6dce5b6c8..f700c366d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 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 @@ -203,13 +204,15 @@ GeomTrsfPtr FeaturesPlugin_Symmetry::symmetryByPlane() void FeaturesPlugin_Symmetry::buildResult( const std::shared_ptr& theAlgo, const std::list >& theOriginalShapes, - std::shared_ptr theTargetShape, int& theResultIndex, std::string & theTextureFile) + std::shared_ptr theTargetShape, int& theResultIndex, + 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++); } @@ -280,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; @@ -311,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);