Salome HOME
22612: [CEA 1189] sauv2med should not change faces orientation
[tools/medcoupling.git] / src / MEDLoader / Swig / medutilities.py
index c53c98524bbf820b1a7db41a8e616063d326e9a6..06fa149f6ac805740541191c1003eeef64189691 100644 (file)
@@ -1,11 +1,11 @@
 # -*- coding: iso-8859-1 -*-
 # --
-# Copyright (C) 2009-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2009-2014  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -49,7 +49,7 @@ def convert(file_in, driver_in, driver_out, format=1, file_out=None):
     #
     if driver_in == "GIBI":
         sr = SauvReader.New(file_in)
-        mfd= sr.loadInMEDFileDS()
+        mfd= sr.loadInMEDFileDS( format )
         pass
     elif driver_in == "MED":
         mfd = MEDFileData(file_in)
@@ -110,9 +110,10 @@ def convert(file_in, driver_in, driver_out, format=1, file_out=None):
         raise NotImplementedError("Driver in %s is unknown"%(driver_in))
 
 def sauv2med(*argv):
-    argv = list(argv)
+    fix2DOri = ( "--fix2DOri" in argv )
     for arg in argv:
-        convert(arg, "GIBI", "MED")
+        if not arg.startswith("--fix"):
+            convert(arg, "GIBI", "MED", format = fix2DOri)
         pass
     return