Back to index

salome-geom  6.5.0
Defines | Functions
STEPExport.cxx File Reference
#include "utilities.h"
#include <Basics_Utils.hxx>
#include <IFSelect_ReturnStatus.hxx>
#include <STEPControl_Writer.hxx>
#include <Interface_Static.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Shape.hxx>

Go to the source code of this file.

Defines

#define STEPEXPORT_EXPORT

Functions

STEPEXPORT_EXPORT int Export (const TopoDS_Shape &theShape, const TCollection_AsciiString &theFileName)

Define Documentation

Definition at line 55 of file STEPExport.cxx.


Function Documentation

STEPEXPORT_EXPORT int Export ( const TopoDS_Shape &  theShape,
const TCollection_AsciiString &  theFileName 
)

Definition at line 67 of file STEPExport.cxx.

  {
    MESSAGE("Export STEP into file " << theFileName.ToCString());

  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 ) 
          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;
  }