PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1// This library is free software; you can redistribute it and/or
 2// modify it under the terms of the GNU Lesser General Public
 3// License as published by the Free Software Foundation; either 
 4// version 2.1 of the License.
 5// 
 6// This library is distributed in the hope that it will be useful 
 7// but WITHOUT ANY WARRANTY; without even the implied warranty of 
 8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 9// Lesser General Public License for more details.
10//
11// You should have received a copy of the GNU Lesser General Public  
12// License along with this library; if not, write to the Free Software 
13// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
14//
15// File:	VrmlExport.cxx
16// Author:	Sioutis Fotis
17
18#include "utilities.h"
19
20#include <VrmlAPI_Writer.hxx>
21
22#include <TCollection_AsciiString.hxx>
23#include <TopoDS_Shape.hxx>
24
25#ifdef WNT
26#define SALOME_WNT_EXPORT __declspec(dllexport)
27#else
28#define SALOME_WNT_EXPORT
29#endif
30
31//=============================================================================
32/*!
33 *
34 */
35//=============================================================================
36
37extern "C"
38{
39SALOME_WNT_EXPORT
40  int Export(const TopoDS_Shape& theShape,
41             const TCollection_AsciiString& theFileName,
42             const TCollection_AsciiString& theFormatName)
43  {
44	MESSAGE("Export VRML into file " << theFileName.ToCString());
45
46  try
47	{
48	  VrmlAPI_Writer aWriter;
49	  aWriter.Write(theShape, theFileName.ToCString()) ;
50      return 1;
51    }
52  catch(Standard_Failure) 
53	{
54	  Standard_Failure::Raise("Could not export in VRML format");
55    }
56  return 0;
57  }
58}