Back to index

salome-geom  6.5.0
Defines | Functions
STLExport.cxx File Reference
#include "utilities.h"
#include <StlAPI_Writer.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Shape.hxx>

Go to the source code of this file.

Defines

#define STLEXPORT_EXPORT

Functions

STLEXPORT_EXPORT int Export (const TopoDS_Shape &theShape, const TCollection_AsciiString &theFileName, const TCollection_AsciiString &theFormatName)

Define Documentation

Definition at line 42 of file STLExport.cxx.


Function Documentation

STLEXPORT_EXPORT int Export ( const TopoDS_Shape &  theShape,
const TCollection_AsciiString &  theFileName,
const TCollection_AsciiString &  theFormatName 
)

Definition at line 54 of file STLExport.cxx.

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

    try
    {
      StlAPI_Writer aWriter;
      bool aIsASCIIMode;
      aIsASCIIMode = (theFormatName.IsEqual("STL_ASCII")) ? true : false;
      aWriter.ASCIIMode() = aIsASCIIMode;
      aWriter.Write(theShape, theFileName.ToCString()) ;
      return 1;
    }
    catch(Standard_Failure)
    {
      //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STLExport", SALOME::BAD_PARAM);
    }
    return 0;
  }