Salome HOME
bos #26449: SHAPER: save imported images
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Tools.cpp
index 9a36609a4e5d6c07188af5c03bd88270d749f566..d1a690ce1abeb1069d4db39ab36cb62637025b8d 100644 (file)
@@ -263,27 +263,21 @@ bool FeaturesPlugin_Tools::shapesFromSelectionList(
     const std::shared_ptr<ModelAPI_AttributeSelectionList> theSelectionList,
     const bool theStoreFullHierarchy,
     GeomAPI_ShapeHierarchy& theHierarchy,
-    std::list<ResultPtr>& theParts, std::string &theTextureFile)
+    std::list<ResultPtr>& theParts, ResultPtr& theTextureSource)
 {
   int aSize = theSelectionList->size();
-  if(aSize == 1)
-  {
+  if (aSize == 1) {
     auto anObjectAttr = theSelectionList->value(0);
-    if(anObjectAttr.get())
-    {
+    if (anObjectAttr.get()) {
       FeaturePtr aFeature = anObjectAttr->contextFeature();
-      if(aFeature.get() &&  aFeature->results().size() == 1)
-      {
-        theTextureFile = aFeature->firstResult()->getTextureFile();
+      if (aFeature.get() && aFeature->results().size() == 1) {
+        theTextureSource = aFeature->firstResult();
       }
-      else
-      {
-        if(!aFeature.get())
-        {
-          auto aResult =  anObjectAttr->context();
-          if(aResult.get())
-          {
-            theTextureFile = aResult->getTextureFile();
+      else {
+        if (!aFeature.get()) {
+          auto aResult = anObjectAttr->context();
+          if (aResult.get()) {
+            theTextureSource = aResult;
           }
         }
       }