glc_light.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
00026
00027 #ifndef GLC_LIGHT_H_
00028 #define GLC_LIGHT_H_
00029
00030 #include <QColor>
00031 #include "../glc_object.h"
00032 #include "../maths/glc_vector3d.h"
00033
00034 #include "../glc_config.h"
00035
00038
00042
00043
00044 class GLC_LIB_EXPORT GLC_Light :
00045 public GLC_Object
00046 {
00048
00050
00051 public:
00053
00054 GLC_Light();
00055
00056 GLC_Light(const QColor& );
00057
00059 virtual ~GLC_Light(void);
00061
00063
00065
00066 public:
00068 inline GLC_Point3d position(void) const {return m_Position;}
00069
00071 inline QColor ambientColor() {return m_AmbientColor;}
00072
00074 inline QColor diffuseColor() { return m_DiffuseColor;}
00075
00077 inline QColor specularColor() {return m_SpecularColor;}
00078
00080 inline bool isTwoSided() const {return m_TwoSided;}
00082
00084
00086
00087 public:
00089 void setPosition(const GLC_Point3d &);
00090
00092 void setPosition(GLfloat, GLfloat, GLfloat);
00093
00095 void setAmbientColor(const QColor &);
00096
00098 void setDiffuseColor(const QColor &);
00099
00101 void setSpecularColor(const QColor &);
00102
00104 inline void setTwoSided(const bool mode)
00105 {
00106 m_TwoSided= mode;
00107 m_ListIsValid = false;
00108 }
00110
00112
00114
00115 public:
00117 inline void enable(void)
00118 {glEnable(m_LightID);}
00119
00120
00121 inline void disable(void)
00122 {glDisable(m_LightID);}
00123
00125 virtual void glExecute(GLenum Mode= GL_COMPILE_AND_EXECUTE);
00127
00129
00131
00132
00133 private:
00135 void glDraw(void);
00136
00138 void creationList(GLenum Mode);
00139
00140 private:
00141
00143 void deleteList(void);
00144
00146
00148
00150
00151 private:
00153 GLenum m_LightID;
00154
00156 GLuint m_ListID;
00157
00159 bool m_ListIsValid;
00160
00162 QColor m_AmbientColor;
00164 QColor m_DiffuseColor;
00166 QColor m_SpecularColor;
00167
00169 GLC_Point3d m_Position;
00170
00172 bool m_TwoSided;
00173
00174 };
00175 #endif //GLC_LIGHT_H_