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 a writer module for OFF files 00030 // 00031 //============================================================================= 00032 00033 00034 #ifndef __OFFWRITER_HH__ 00035 #define __OFFWRITER_HH__ 00036 00037 00038 //=== INCLUDES ================================================================ 00039 00040 00041 #include <stdio.h> 00042 #include <string> 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 _OFFWriter_ : public BaseWriter 00065 { 00066 public: 00067 00068 _OFFWriter_(); 00069 00070 std::string get_description() const { return "no description"; } 00071 std::string get_extensions() const { return "off"; } 00072 00073 bool write(const std::string&, BaseExporter&, Options) const; 00074 00075 size_t binary_size(BaseExporter& _be, Options _opt) const; 00076 00077 00078 protected: 00079 00080 bool write_ascii(FILE*, BaseExporter&, Options) const; 00081 bool write_binary(FILE*, BaseExporter&, Options) const; 00082 }; 00083 00084 00085 //== TYPE DEFINITION ========================================================== 00086 00087 00089 extern _OFFWriter_ __OFFWriterInstance; 00090 _OFFWriter_& OFFWriter(); 00091 00092 00093 //============================================================================= 00094 } // namespace IO 00095 } // namespace OpenMesh 00096 //============================================================================= 00097 #endif 00098 //=============================================================================