Salome HOME
ENV: Windows porting.
[modules/geom.git] / src / STEPExport / STEPExport.cxx
1 // File:        STEPExport.cxx
2 // Created:     Wed May 19 14:53:52 2004
3 // Author:      Pavel TELKOV
4 //              <ptv@mutex.nnov.opencascade.com>
5
6 #include "utilities.h"
7
8 #include <IFSelect_ReturnStatus.hxx>
9
10 #include <STEPControl_Writer.hxx>
11
12 #include <TCollection_AsciiString.hxx>
13 #include <TopoDS_Shape.hxx>
14
15 #ifdef WNT
16 #include <SALOME_WNT.hxx>
17 #else
18 #define SALOME_WNT_EXPORT
19 #endif
20
21 //=============================================================================
22 /*!
23  *
24  */
25 //=============================================================================
26
27 extern "C"
28 {
29 SALOME_WNT_EXPORT
30   int Export(const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
31   {
32     MESSAGE("Export STEP into file " << theFileName.ToCString());
33
34   try 
35     {
36       IFSelect_ReturnStatus status ;
37       //VRV: OCC 4.0 migration
38       STEPControl_Writer aWriter;
39 //JFA: PAL6162      status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
40       status = aWriter.Transfer( theShape, STEPControl_AsIs );
41       //VRV: OCC 4.0 migration
42       if ( status == IFSelect_RetDone ) 
43           status = aWriter.Write( theFileName.ToCString() ) ;
44       if ( status == IFSelect_RetDone ) 
45         return 1;
46     }
47   catch(Standard_Failure) 
48     {
49       //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
50     }
51   return 0;
52   }
53 }