00001 /*===========================================================================*\ 00002 * * 00003 * OpenMesh * 00004 * Copyright (C) 2001-2005 by Computer Graphics Group, RWTH Aachen * 00005 * www.openmesh.org * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * * 00009 * License * 00010 * * 00011 * This library is free software; you can redistribute it and/or modify it * 00012 * under the terms of the GNU Library General Public License as published * 00013 * by the Free Software Foundation, version 2. * 00014 * * 00015 * This library is distributed in the hope that it will be useful, but * 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00018 * Library General Public License for more details. * 00019 * * 00020 * You should have received a copy of the GNU Library General Public * 00021 * License along with this library; if not, write to the Free Software * 00022 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00023 * * 00024 \*===========================================================================*/ 00025 00026 00027 //============================================================================= 00028 // 00029 // Implements an IOManager writer module for OBJ files 00030 // 00031 //============================================================================= 00032 00033 00034 #ifndef __OBJWRITER_HH__ 00035 #define __OBJWRITER_HH__ 00036 00037 00038 //=== INCLUDES ================================================================ 00039 00040 00041 #include <string> 00042 #include <stdio.h> 00043 00044 #include <OpenMesh/Core/System/config.hh> 00045 #include <OpenMesh/Core/Utils/SingletonT.hh> 00046 #include <OpenMesh/Core/IO/exporter/BaseExporter.hh> 00047 #include <OpenMesh/Core/IO/writer/BaseWriter.hh> 00048 00049 00050 //== NAMESPACES =============================================================== 00051 00052 00053 namespace OpenMesh { 00054 namespace IO { 00055 00056 00057 //=== IMPLEMENTATION ========================================================== 00058 00059 00064 class _OBJWriter_ : public BaseWriter 00065 { 00066 public: 00067 00068 _OBJWriter_(); 00069 00070 std::string get_description() const { return "Alias/Wavefront"; } 00071 std::string get_extensions() const { return "obj"; } 00072 00073 bool write(const std::string&, BaseExporter&, Options) const; 00074 00075 size_t binary_size(BaseExporter&, Options) const { return 0; } 00076 00077 private: 00078 00079 bool write(FILE*, BaseExporter&, Options) const; 00080 }; 00081 00082 00083 //== TYPE DEFINITION ========================================================== 00084 00085 00087 extern _OBJWriter_ __OBJWriterinstance; 00088 _OBJWriter_& OBJWriter(); 00089 00090 00091 //============================================================================= 00092 } // namespace IO 00093 } // namespace OpenMesh 00094 //============================================================================= 00095 #endif 00096 //=============================================================================