Salome HOME
Avoid installing redundant files
[modules/geom.git] / src / IGESPlugin / IGESPlugin_IOperations.cxx
index 0d27d48805bd29a797acf102a76a629408fed07b..ef2265cf5236cdbc8a3367c933bc7bc554af00e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,7 @@
 #include "IGESPlugin_IImport.hxx"
 
 // KERNEL includes
+#include <Basics_DirUtils.hxx>
 #include <utilities.h>
 
 // GEOM includes
@@ -106,8 +107,9 @@ void IGESPlugin_IOperations::ExportIGES( const Handle(GEOM_Object)      theOrigi
   }
 
   //Make a Python command
+  std::string convFileName = Kernel_Utils::BackSlashToSlash(theFileName.ToCString());
   GEOM::TPythonDump(aFunction) << "geompy.ExportIGES(" << theOriginal << ", \""
-    << theFileName.ToCString() << "\", \"" << theVersion.ToCString() << "\" )";
+    << convFileName.c_str() << "\", \"" << theVersion.ToCString() << "\" )";
 
   SetErrorCode(OK);
 }
@@ -154,7 +156,7 @@ IGESPlugin_IOperations::ImportIGES( const TCollection_AsciiString& theFileName,
     }
     aSeq->Append(anImported);
 
-    // Greate material groups.
+    // Create material groups.
     // MakeMaterialGroups( anImported, aSeq );
   }
   catch( Standard_Failure& aFail ) {
@@ -164,10 +166,11 @@ IGESPlugin_IOperations::ImportIGES( const TCollection_AsciiString& theFileName,
 
   //Make a Python command
   GEOM::TPythonDump pd (aFunction);
+  std::string convFileName = Kernel_Utils::BackSlashToSlash(theFileName.ToCString());
   if( theIsIgnoreUnits )
-    pd << aSeq << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\", True)";
+    pd << aSeq << " = geompy.ImportIGES(\"" << convFileName.c_str() << "\", True)";
   else
-    pd << aSeq << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\")";
+    pd << aSeq << " = geompy.ImportIGES(\"" << convFileName.c_str() << "\")";
   SetErrorCode(OK);
 
   return aSeq;