Salome HOME
IPAL21297: errors for Netgen_1D_2D
[modules/geom.git] / src / IGESExport / IGESExport.cxx
index 475b41db284d32f3394a6a0eacb73ddd4b798b51..72e6cb2fa51e9bf8ca8f1c871ec0cbcb1f804df1 100644 (file)
@@ -26,6 +26,8 @@
 //
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 #include <IGESControl_Controller.hxx>
 #include <IGESControl_Writer.hxx>
 #include <Interface_Static.hxx>
@@ -34,7 +36,7 @@
 #include <TopoDS_Shape.hxx>
 
 #ifdef WNT
- #if defined IGESEXPORT_EXPORTS
+ #if defined IGESEXPORT_EXPORTS || defined IGESExport_EXPORTS
   #if defined WIN32
    #define IGESEXPORT_EXPORT __declspec( dllexport )
   #else
@@ -73,16 +75,23 @@ IGESEXPORT_EXPORT
       if (theFormatName.IsEqual("IGES_5_3"))
         aBrepMode = 1;
 
+      // Set "C" numeric locale to save numbers correctly
+      Kernel_Utils::Localizer loc;
+
       // initialize writer
       IGESControl_Controller::Init();
       //IGESControl_Writer ICW (Interface_Static::CVal("write.iges.unit"),
       //                       Interface_Static::IVal("write.iges.brep.mode"));
-      IGESControl_Writer ICW (Interface_Static::CVal("write.iges.unit"), aBrepMode);
+      IGESControl_Writer ICW ("M", aBrepMode); // "write.iges.unit" ->> VSR 15.09.09: export explicitly in meters
+      Interface_Static::SetCVal("xstep.cascade.unit","M");
 
       // perform shape writing
       ICW.AddShape( theShape );
       ICW.ComputeModel();
-      if ( ICW.Write( theFileName.ToCString() ) )
+      bool ok = ICW.Write( theFileName.ToCString() );
+      
+      // Return previous locale
+      if ( ok )
         return 1;
     }
     catch(Standard_Failure)