]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/STEPPlugin/STEPPlugin_IOperations.cxx
Salome HOME
updated copyright message
[modules/geom.git] / src / STEPPlugin / STEPPlugin_IOperations.cxx
index 46a4594a1384cd2b3e3da3311adea8ec8d7cf219..026cfbf84bf6eef432eff05a8c4ccfddd2300246 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2023  CEA, EDF, 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 "STEPPlugin_IImport.hxx"
 
 // KERNEL includes
+#include <Basics_DirUtils.hxx>
 #include <utilities.h>
 
 // GEOM includes
@@ -145,15 +146,15 @@ void STEPPlugin_IOperations::ExportSTEP
       return;
     }
   }
-  catch( Standard_Failure ) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode( aFail->GetMessageString() );
+  catch( Standard_Failure& aFail ) {
+    SetErrorCode( aFail.GetMessageString() );
     return;
   }
 
   //Make a Python command
+  std::string convFileName = Kernel_Utils::BackSlashToSlash(theFileName.ToCString());
   GEOM::TPythonDump(aFunction) << "geompy.ExportSTEP(" << theOriginal << ", \""
-    << theFileName.ToCString() << "\", " << theUnit << " )";
+    << convFileName.c_str() << "\", " << theUnit << " )";
 
   SetErrorCode(OK);
 }
@@ -202,18 +203,18 @@ STEPPlugin_IOperations::ImportSTEP(const TCollection_AsciiString& theFileName,
     }
     aSeq->Append(anImported);
 
-    // Greate material groups.
+    // Create material groups.
     MakeMaterialGroups( anImported, aSeq );
   }
-  catch( Standard_Failure ) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode( aFail->GetMessageString() );
+  catch( Standard_Failure& aFail ) {
+    SetErrorCode( aFail.GetMessageString() );
     return NULL;
   }
 
   //Make a Python command
   GEOM::TPythonDump pd (aFunction);
-  pd << aSeq << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\", ";
+  std::string convFileName =  Kernel_Utils::BackSlashToSlash( theFileName.ToCString() );
+  pd << aSeq << " = geompy.ImportSTEP(\"" << convFileName.c_str() << "\", ";
   pd << (theIsIgnoreUnits ? "True" : "False");
   pd << ", " << (IsCreateAssemblies ? "True" : "False");
   pd << ")";