]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Write STEP files in meters
authorjfa <jfa@opencascade.com>
Thu, 1 Nov 2012 09:04:40 +0000 (09:04 +0000)
committerjfa <jfa@opencascade.com>
Thu, 1 Nov 2012 09:04:40 +0000 (09:04 +0000)
src/STEPExport/STEPExport.cxx

index 4a0805c848cc7e1c92340eead3bf737aea95db76..abe5c310a9b9b16dcfa453730b853f1eb75d4596 100644 (file)
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 
 // File:        STEPExport.cxx
 // Created:     Wed May 19 14:53:52 2004
 // Author:      Pavel TELKOV
-//              <ptv@mutex.nnov.opencascade.com>
-//
+
 #include "utilities.h"
 
 #include <Basics_Utils.hxx>
 
 extern "C"
 {
-STEPEXPORT_EXPORT
+  STEPEXPORT_EXPORT
   int Export(const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
   {
     MESSAGE("Export STEP into file " << theFileName.ToCString());
 
-  try 
-    {
-      // Set "C" numeric locale to save numbers correctly
-      Kernel_Utils::Localizer loc;
+    try 
+      {
+        // Set "C" numeric locale to save numbers correctly
+        Kernel_Utils::Localizer loc;
 
-      IFSelect_ReturnStatus status ;
-      //VRV: OCC 4.0 migration
-      STEPControl_Writer aWriter;
-      //VSR: 16/09/09: Convert to METERS
-      Interface_Static::SetCVal("xstep.cascade.unit","M");
-      Interface_Static::SetIVal("write.step.nonmanifold", 1);
-//JFA: PAL6162      status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
-      status = aWriter.Transfer( theShape, STEPControl_AsIs );
-      //VRV: OCC 4.0 migration
-      if ( status == IFSelect_RetDone ) 
+        IFSelect_ReturnStatus status ;
+        //VRV: OCC 4.0 migration
+        STEPControl_Writer aWriter;
+        //VSR: 16/09/09: Convert to METERS
+        Interface_Static::SetCVal("xstep.cascade.unit","M");
+        Interface_Static::SetCVal("write.step.unit", "M");
+        Interface_Static::SetIVal("write.step.nonmanifold", 1);
+        //JFA: PAL6162      status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
+        status = aWriter.Transfer( theShape, STEPControl_AsIs );
+        //VRV: OCC 4.0 migration
+        if ( status == IFSelect_RetDone ) 
           status = aWriter.Write( theFileName.ToCString() );
 
-      // Return previous locale
-      if ( status == IFSelect_RetDone ) 
-        return 1;
-    }
-  catch(Standard_Failure) 
-    {
-      //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
-    }
-  return 0;
+        // Return previous locale
+        if ( status == IFSelect_RetDone ) 
+          return 1;
+      }
+    catch (Standard_Failure) 
+      {
+        //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
+      }
+    return 0;
   }
 }