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 // CLASS newClass 00029 // 00030 //============================================================================= 00031 00032 00033 #ifndef OPENMESH_UTILS_GLCONSTASSTRING_HH 00034 #define OPENMESH_UTILS_GLCONSTASSTRING_HH 00035 00036 00037 //== INCLUDES ================================================================= 00038 00039 #include <OpenMesh/Core/System/config.hh> 00040 #include <GL/glut.h> 00041 00042 00043 //== FORWARDDECLARATIONS ====================================================== 00044 00045 00046 //== NAMESPACES =============================================================== 00047 00048 namespace OpenMesh { 00049 namespace Utils { 00050 00051 //== CLASS DEFINITION ========================================================= 00052 00053 inline 00054 const char *GLenum_as_string( GLenum _m ) 00055 { 00056 #define MODE(M) case M:return #M 00057 switch( _m ) 00058 { 00059 MODE(GL_POINTS); 00060 MODE(GL_LINES); 00061 MODE(GL_LINE_STRIP); 00062 MODE(GL_LINE_LOOP); 00063 MODE(GL_TRIANGLES); 00064 MODE(GL_TRIANGLE_STRIP); 00065 MODE(GL_TRIANGLE_FAN); 00066 MODE(GL_QUADS); 00067 MODE(GL_QUAD_STRIP); 00068 MODE(GL_POLYGON); 00069 default: return "<unknown>"; 00070 } 00071 #undef MODE 00072 } 00073 00074 //============================================================================= 00075 } // namespace Utils 00076 } // namespace OpenMesh 00077 //============================================================================= 00078 #endif // OPENMESH_UTILS_GLCONSTASSTRING_HH defined 00079 //============================================================================= 00080