Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LangmuirView::Light Class Reference

A class to represent a light source. More...

#include <light.h>

Public Slots

virtual void makeConnections ()
 make signal/slot connections More...
 
void setPosition (float x, float y, float z, float w=0.0)
 set position of light More...
 
void setPosition (QVector4D value)
 set position of light More...
 
void setAColor (QColor color)
 set the ambient color More...
 
void setDColor (QColor color)
 set the diffuse color More...
 
void setSColor (QColor color)
 set the specular color More...
 
void setLightID (GLuint lightID)
 set the OpenGL light ID More...
 
void setEnabled (bool enabled)
 enabled or disable the light More...
 
void toggle ()
 toggle the light between enabled/disabled More...
 
void updatePosition ()
 use OpenGL commands More...
 
void updateAColor ()
 use OpenGL commands More...
 
void updateSColor ()
 use OpenGL commands More...
 
void updateDColor ()
 use OpenGL commands More...
 
- Public Slots inherited from LangmuirView::SceneObject
void toggleVisible ()
 toggle visibility More...
 
void setVisible (bool draw=true)
 set the visibility More...
 
virtual void makeConnections ()
 make signal/slot connections More...
 

Signals

void positionChanged (QVector4D position)
 signal that the position changed More...
 
void aColorChanged (QColor color)
 signal that the ambient color of has changed More...
 
void dColorChanged (QColor color)
 signal that the diffuse color of has changed More...
 
void sColorChanged (QColor color)
 signal that the specular color of has changed More...
 
void enabledChanged (bool enabled)
 signal that the light has been enabled/disabled More...
 
void lightIDChanged (GLuint lightID)
 signal that the OpenGL light ID has changed More...
 
- Signals inherited from LangmuirView::SceneObject
void visibleChanged (bool drawn)
 signal that the visibility has changed More...
 

Public Member Functions

 Light (GLenum lightID, LangmuirViewer &viewer, QObject *parent=0)
 
 ~Light ()
 
const QColor & getAColor () const
 get ambient color More...
 
const QColor & getDColor () const
 get diffuse color More...
 
const QColor & getSColor () const
 get specular color More...
 
GLenum getLightID () const
 get the OpenGL light id More...
 
bool isEnabled () const
 find out if the light is enabled More...
 
const QVector4D & getPosition () const
 get position of light More...
 
- Public Member Functions inherited from LangmuirView::SceneObject
 SceneObject (LangmuirViewer &viewer, QObject *parent=0)
 create the SceneObject More...
 
bool isVisible ()
 true if object is drawn More...
 
void render ()
 calls OpenGL drawing commands. More...
 

Protected Member Functions

virtual void init ()
 initialize object More...
 
virtual void draw ()
 perform OpenGL drawing operations More...
 
- Protected Member Functions inherited from LangmuirView::SceneObject
virtual void preDraw ()
 perform OpenGL drawing operations before draw() More...
 
virtual void postDraw ()
 perform OpenGL drawing operations after draw() More...
 

Protected Attributes

QVector4D m_position
 location of light More...
 
QColor m_acolor
 ambient color More...
 
QColor m_dcolor
 diffuse color More...
 
QColor m_scolor
 specular color More...
 
GLenum m_lightID
 OpenGL light ID. More...
 
bool m_enabled
 true if light is on More...
 
- Protected Attributes inherited from LangmuirView::SceneObject
LangmuirViewerm_viewer
 reference to OpenGL widget More...
 
bool visible_
 visibility More...
 

Detailed Description

A class to represent a light source.

Constructor & Destructor Documentation

LangmuirView::Light::Light ( GLenum  lightID,
LangmuirViewer viewer,
QObject *  parent = 0 
)
explicit
LangmuirView::Light::~Light ( )

Member Function Documentation

void LangmuirView::Light::aColorChanged ( QColor  color)
signal

signal that the ambient color of has changed

Parameters
colorvalue of color
void LangmuirView::Light::dColorChanged ( QColor  color)
signal

signal that the diffuse color of has changed

Parameters
colorvalue of color
virtual void LangmuirView::Light::draw ( )
protectedvirtual

perform OpenGL drawing operations

Reimplemented from LangmuirView::SceneObject.

void LangmuirView::Light::enabledChanged ( bool  enabled)
signal

signal that the light has been enabled/disabled

Parameters
enabledtrue if light has been enabled
const QColor& LangmuirView::Light::getAColor ( ) const

get ambient color

const QColor& LangmuirView::Light::getDColor ( ) const

get diffuse color

GLenum LangmuirView::Light::getLightID ( ) const

get the OpenGL light id

const QVector4D& LangmuirView::Light::getPosition ( ) const

get position of light

const QColor& LangmuirView::Light::getSColor ( ) const

get specular color

virtual void LangmuirView::Light::init ( )
protectedvirtual

initialize object

Reimplemented from LangmuirView::SceneObject.

bool LangmuirView::Light::isEnabled ( ) const

find out if the light is enabled

void LangmuirView::Light::lightIDChanged ( GLuint  lightID)
signal

signal that the OpenGL light ID has changed

Parameters
lightIDvalue of OpenGL light ID
virtual void LangmuirView::Light::makeConnections ( )
virtualslot

make signal/slot connections

void LangmuirView::Light::positionChanged ( QVector4D  position)
signal

signal that the position changed

Parameters
positionvalue of position
void LangmuirView::Light::sColorChanged ( QColor  color)
signal

signal that the specular color of has changed

Parameters
colorvalue of color
void LangmuirView::Light::setAColor ( QColor  color)
slot

set the ambient color

Parameters
colorcolor to set
void LangmuirView::Light::setDColor ( QColor  color)
slot

set the diffuse color

Parameters
colorcolor to set
void LangmuirView::Light::setEnabled ( bool  enabled)
slot

enabled or disable the light

Parameters
enabledtrue if the light is to be enabled
void LangmuirView::Light::setLightID ( GLuint  lightID)
slot

set the OpenGL light ID

Parameters
lightIDOpenGL light ID to use
void LangmuirView::Light::setPosition ( float  x,
float  y,
float  z,
float  w = 0.0 
)
slot

set position of light

Parameters
xx-position
yy-position
zz-position
ww-position
void LangmuirView::Light::setPosition ( QVector4D  value)
slot

set position of light

Parameters
valueposition to set
void LangmuirView::Light::setSColor ( QColor  color)
slot

set the specular color

Parameters
colorcolor to set
void LangmuirView::Light::toggle ( )
slot

toggle the light between enabled/disabled

void LangmuirView::Light::updateAColor ( )
slot

use OpenGL commands

void LangmuirView::Light::updateDColor ( )
slot

use OpenGL commands

void LangmuirView::Light::updatePosition ( )
slot

use OpenGL commands

void LangmuirView::Light::updateSColor ( )
slot

use OpenGL commands

Member Data Documentation

QColor LangmuirView::Light::m_acolor
protected

ambient color

QColor LangmuirView::Light::m_dcolor
protected

diffuse color

bool LangmuirView::Light::m_enabled
protected

true if light is on

GLenum LangmuirView::Light::m_lightID
protected

OpenGL light ID.

QVector4D LangmuirView::Light::m_position
protected

location of light

QColor LangmuirView::Light::m_scolor
protected

specular color


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