]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix issue "addImport", ascending compatibility
authorJérôme <jerome.lucas@cesgenslab.fr>
Thu, 22 Oct 2020 10:23:28 +0000 (12:23 +0200)
committerJérôme <jerome.lucas@cesgenslab.fr>
Thu, 22 Oct 2020 10:23:28 +0000 (12:23 +0200)
src/ExchangeAPI/ExchangeAPI_Import.cpp

index 059467a250f371e4d797123bdd60410523e1da38..70761000bb31071dc3e32765f9f442692ffb0898 100644 (file)
@@ -87,18 +87,13 @@ void ExchangeAPI_Import::setParameters(const std::string & theFilePath,
 void ExchangeAPI_Import::setFilePath(const std::string & theFilePath)
 {
   fillAttribute(theFilePath, myfilePath);
-  std::string aFrom = "\\";
-  std::string aTo = "\\\\";
-  std::string aFilePath = theFilePath;
-  for(std::size_t aPos = aFilePath.find(aFrom);
-      aPos != std::string::npos;
-      aPos = aFilePath.find(aFrom, aPos)) {
-    aFilePath.replace(aPos, aFrom.size(), aTo);
-    aPos += aTo.size();
+  std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(theFilePath);
+  if (anExtension == "STEP" || anExtension == "STP") {
+    setParameters(theFilePath,true,false,false);
+  }else{
+    fillAttribute(anExtension, feature()->string(ExchangePlugin_ImportFeature::IMPORT_TYPE_ID()));
+    execute();
   }
-  std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(aFilePath);
-  fillAttribute(anExtension, feature()->string(ExchangePlugin_ImportFeature::IMPORT_TYPE_ID()));
-  execute();
 }
 
 //--------------------------------------------------------------------------------------