00001 // Mesh Algorithms: a library of algorithms to manipulate 3D meshes 00002 // Copyright (C) 2001 Tim Garthwaite and Jason Reposa 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 #ifndef COLOR_H 00019 #define COLOR_H 00020 00021 #include "options.h" 00022 #include <cstdio> 00023 #include <string> 00024 #include <GL/gl.h> 00025 00027 class Color { 00028 GLfloat red, green, blue, alpha; 00029 // bool created; 00030 00031 public: 00032 //Color(); //!< Default constructor. 00034 Color( GLfloat r = 1.0f, //!< red. 00035 GLfloat g = 1.0f, 00036 GLfloat b = 1.0f, 00037 GLfloat a = 1.0f 00038 ); 00039 00041 GLvoid setColor( GLfloat r, 00042 GLfloat g, 00043 GLfloat b, 00044 GLfloat a = 1.0f 00045 ); 00046 00047 GLvoid r(GLfloat r); 00048 GLvoid g(GLfloat g); 00049 GLvoid b(GLfloat b); 00050 GLvoid a(GLfloat a); 00051 00052 GLfloat r() const; 00053 GLfloat g() const; 00054 GLfloat b() const; 00055 GLfloat a() const; 00056 00057 GLfloat & r(); 00058 GLfloat & g(); 00059 GLfloat & b(); 00060 GLfloat & a(); 00061 std::string toString(); 00062 // bool exists(); //!< True if the color exists after decimation. 00063 00064 }; 00065 00066 #endif