GLC_Light Class Reference

GLC_Light : OpenGL Point Light. More...

#include <glc_light.h>

Inheritance diagram for GLC_Light:
GLC_Object

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_Light ()
 Construct a default GLC_Light.
 GLC_Light (const QColor &)
virtual ~GLC_Light (void)
 Delete OpenGL list.
Get Functions

GLC_Point3d position (void) const
 Return a 4D GLC_Point3d representing light position.
QColor ambientColor ()
 Return the QColor of the light's ambient color.
QColor diffuseColor ()
 Return the QColor of the light's Diffuse color.
QColor specularColor ()
 Return the QColor of the light's Specular color.
bool isTwoSided () const
 Return true if the light used two sided ilumination.
Set Functions

void setPosition (const GLC_Point3d &)
 Set lihgt's position by a 4D point.
void setPosition (GLfloat, GLfloat, GLfloat)
 Set lihgt's position by a 3 GLfloat.
void setAmbientColor (const QColor &)
 Set light's ambiant color by a QColor.
void setDiffuseColor (const QColor &)
 Set light's diffuse color by a QColor.
void setSpecularColor (const QColor &)
 Set light's specular color by a QColor.
void setTwoSided (const bool mode)
 Set Mode.

Private Attributes

GLenum m_LightID
 OpenGL light ID.
GLuint m_ListID
 OpenGL Display list ID.
bool m_ListIsValid
 OpenGL list validity.
QColor m_AmbientColor
 Light ambiant color.
QColor m_DiffuseColor
 Light diffuse color.
QColor m_SpecularColor
 Light specular color.
GLC_Point3d m_Position
 Light position.
bool m_TwoSided
 Lighting mode.

OpenGL Functions



void enable (void)
 Enable the light.
void disable (void)
virtual void glExecute (GLenum Mode=GL_COMPILE_AND_EXECUTE)
 Execute OpenGL light.
void glDraw (void)
 OpenGL light set up.
void creationList (GLenum Mode)
 Display List creation.
void deleteList (void)
 Delete OpenGL Display list.

Detailed Description

GLC_Light : OpenGL Point Light.

An GLC_Light is an OpenGL point Light source at a 3D location
Point light is omnidirectional and have color

Definition at line 44 of file glc_light.h.


Constructor & Destructor Documentation

GLC_Light::GLC_Light (  ) 

Construct a default GLC_Light.

By default, ambient color is black, diffuse Color is white and specular color is white

Todo:
modify class to support multi light

Definition at line 35 of file glc_light.cpp.

GLC_Light::GLC_Light ( const QColor &  color  ) 

Todo:
modify class to support multi light

Definition at line 49 of file glc_light.cpp.

GLC_Light::~GLC_Light ( void   )  [virtual]

Delete OpenGL list.

Definition at line 63 of file glc_light.cpp.

References deleteList().


Member Function Documentation

QColor GLC_Light::ambientColor (  )  [inline]

Return the QColor of the light's ambient color.

Definition at line 71 of file glc_light.h.

void GLC_Light::creationList ( GLenum  Mode  )  [private]

Display List creation.

Definition at line 116 of file glc_light.cpp.

References glDraw(), m_ListID, and m_ListIsValid.

Referenced by glExecute().

void GLC_Light::deleteList ( void   )  [private]

Delete OpenGL Display list.

Definition at line 229 of file glc_light.cpp.

References m_ListID.

Referenced by ~GLC_Light().

QColor GLC_Light::diffuseColor (  )  [inline]

Return the QColor of the light's Diffuse color.

Definition at line 74 of file glc_light.h.

void GLC_Light::disable ( void   )  [inline]

Definition at line 121 of file glc_light.h.

void GLC_Light::enable ( void   )  [inline]

Enable the light.

Definition at line 117 of file glc_light.h.

void GLC_Light::glDraw ( void   )  [private]
void GLC_Light::glExecute ( GLenum  Mode = GL_COMPILE_AND_EXECUTE  )  [virtual]

Execute OpenGL light.

Definition at line 148 of file glc_light.cpp.

References creationList(), m_ListID, and m_ListIsValid.

bool GLC_Light::isTwoSided (  )  const [inline]

Return true if the light used two sided ilumination.

Definition at line 80 of file glc_light.h.

GLC_Point3d GLC_Light::position ( void   )  const [inline]

Return a 4D GLC_Point3d representing light position.

Definition at line 68 of file glc_light.h.

void GLC_Light::setAmbientColor ( const QColor &  color  ) 

Set light's ambiant color by a QColor.

Definition at line 87 of file glc_light.cpp.

References m_AmbientColor, and m_ListIsValid.

void GLC_Light::setDiffuseColor ( const QColor &  color  ) 

Set light's diffuse color by a QColor.

Definition at line 94 of file glc_light.cpp.

References m_DiffuseColor, and m_ListIsValid.

void GLC_Light::setPosition ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Set lihgt's position by a 3 GLfloat.

Definition at line 80 of file glc_light.cpp.

References m_ListIsValid, m_Position, and GLC_Vector3d::setVect().

void GLC_Light::setPosition ( const GLC_Point3d pos  ) 

Set lihgt's position by a 4D point.

Definition at line 73 of file glc_light.cpp.

References m_ListIsValid, and m_Position.

void GLC_Light::setSpecularColor ( const QColor &  color  ) 

Set light's specular color by a QColor.

Definition at line 101 of file glc_light.cpp.

References m_ListIsValid, and m_SpecularColor.

void GLC_Light::setTwoSided ( const bool  mode  )  [inline]

Set Mode.

Definition at line 104 of file glc_light.h.

QColor GLC_Light::specularColor (  )  [inline]

Return the QColor of the light's Specular color.

Definition at line 77 of file glc_light.h.


Member Data Documentation

QColor GLC_Light::m_AmbientColor [private]

Light ambiant color.

Definition at line 162 of file glc_light.h.

Referenced by glDraw(), and setAmbientColor().

QColor GLC_Light::m_DiffuseColor [private]

Light diffuse color.

Definition at line 164 of file glc_light.h.

Referenced by glDraw(), and setDiffuseColor().

GLenum GLC_Light::m_LightID [private]

OpenGL light ID.

Definition at line 153 of file glc_light.h.

Referenced by glDraw().

GLuint GLC_Light::m_ListID [private]

OpenGL Display list ID.

Definition at line 156 of file glc_light.h.

Referenced by creationList(), deleteList(), and glExecute().

bool GLC_Light::m_ListIsValid [private]

OpenGL list validity.

Definition at line 159 of file glc_light.h.

Referenced by creationList(), glExecute(), setAmbientColor(), setDiffuseColor(), setPosition(), and setSpecularColor().

Light position.

Definition at line 169 of file glc_light.h.

Referenced by glDraw(), and setPosition().

QColor GLC_Light::m_SpecularColor [private]

Light specular color.

Definition at line 166 of file glc_light.h.

Referenced by glDraw(), and setSpecularColor().

bool GLC_Light::m_TwoSided [private]

Lighting mode.

Definition at line 172 of file glc_light.h.

Referenced by glDraw().


The documentation for this class was generated from the following files:

SourceForge.net Logo

©2005 Laurent Ribon