kalzium
color.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __COLOR_H
00027 #define __COLOR_H
00028
00029 #include <avogadro/global.h>
00030
00031 #include <QGLWidget>
00032 #include <openbabel/mol.h>
00033
00034 namespace Avogadro {
00035
00041 class A_EXPORT Color
00042 {
00043 public:
00044 Color() {}
00045 virtual ~Color() {}
00046
00052 Color( GLfloat red, GLfloat green, GLfloat blue,
00053 GLfloat alpha = 1.0 );
00054
00058 Color( const OpenBabel::OBAtom *atom );
00059
00062 Color &operator=( const Color& other );
00063
00069 virtual void set(GLfloat red, GLfloat green, GLfloat blue,
00070 GLfloat alpha = 1.0 );
00071
00075 virtual void set(const OpenBabel::OBAtom *atom );
00076
00081 virtual void set(double value, double low, double high);
00082
00086 inline virtual void apply()
00087 {
00088 glColor4fv( &m_red );
00089 }
00090
00095 virtual void applyAsMaterials();
00096
00097 private:
00099 GLfloat m_red, m_green, m_blue, m_alpha;
00101 };
00102
00103 }
00104
00105 #endif