/src/contrib/geom-5.1.2.7/src/ExchangeVRML/ExchangeVRML_Export.cpp
http://pythonocc.googlecode.com/ · C++ · 58 lines · 30 code · 7 blank · 21 comment · 0 complexity · 0ad36b01bf4352c3a76a4d1a0e32dcec MD5 · raw file
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Lesser General Public
- // License as published by the Free Software Foundation; either
- // version 2.1 of the License.
- //
- // This library is distributed in the hope that it will be useful
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- // Lesser General Public License for more details.
- //
- // You should have received a copy of the GNU Lesser General Public
- // License along with this library; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- //
- // File: VrmlExport.cxx
- // Author: Sioutis Fotis
-
- #include "utilities.h"
-
- #include <VrmlAPI_Writer.hxx>
-
- #include <TCollection_AsciiString.hxx>
- #include <TopoDS_Shape.hxx>
-
- #ifdef WNT
- #define SALOME_WNT_EXPORT __declspec(dllexport)
- #else
- #define SALOME_WNT_EXPORT
- #endif
-
- //=============================================================================
- /*!
- *
- */
- //=============================================================================
-
- extern "C"
- {
- SALOME_WNT_EXPORT
- int Export(const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
- {
- MESSAGE("Export VRML into file " << theFileName.ToCString());
-
- try
- {
- VrmlAPI_Writer aWriter;
- aWriter.Write(theShape, theFileName.ToCString()) ;
- return 1;
- }
- catch(Standard_Failure)
- {
- Standard_Failure::Raise("Could not export in VRML format");
- }
- return 0;
- }
- }