]> SALOME platform Git repositories - modules/geom.git/blob - src/STEPExport/STEPExport.cxx
Salome HOME
Patch for bug IPAL9210(3.0.0 "GEOM_usinggeom.py" script execution failed.).
[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 //=============================================================================
16 /*!
17  *
18  */
19 //=============================================================================
20
21 extern "C"
22 {
23 #ifdef WNT
24   __declspec(__dllexport)
25 #endif
26   int Export(const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
27   {
28     MESSAGE("Export STEP into file " << theFileName.ToCString());
29
30   try 
31     {
32       IFSelect_ReturnStatus status ;
33       //VRV: OCC 4.0 migration
34       STEPControl_Writer aWriter;
35 //JFA: PAL6162      status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
36       status = aWriter.Transfer( theShape, STEPControl_AsIs );
37       //VRV: OCC 4.0 migration
38       if ( status == IFSelect_RetDone ) 
39           status = aWriter.Write( theFileName.ToCString() ) ;
40       if ( status == IFSelect_RetDone ) 
41         return 1;
42     }
43   catch(Standard_Failure) 
44     {
45       //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
46     }
47   return 0;
48   }
49 }