Salome HOME
#54775: No error when load file with parameters
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_ImportFeature.cpp
index 91c6c188a00d5b18321ebabc99022ef2a647b93e..e73ccfbe3070d78754b669ca7b8234a6e55029ab 100644 (file)
@@ -214,7 +214,7 @@ void ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
     setColorGroups(aResult);
   }
 
-  // create Materiel group
+  // create Material group
   if (anMaterialsGroupSelected){
     setMaterielGroup(aResult,theMaterialShape);
   }
@@ -628,6 +628,15 @@ void ExchangePlugin_ImportFeatureBase::loadNamingDS(
   //load result
   theResultBody->store(theGeomShape);
 
+  // to store color of higher-level shape
+  std::wstring aName = theResultBody->findShapeName(theGeomShape);
+  if (!aName.empty())
+  {
+    std::vector<int> aColor = theResultBody->findShapeColor(aName);
+    if (!aColor.empty())
+      ModelAPI_Tools::setColor(theResultBody, aColor);
+  }
+
   std::string aNameMS = "Shape";
   theResultBody->loadFirstLevel(theGeomShape, aNameMS);
 }