lightwidget.h

Go to the documentation of this file.
00001 //=============================================================================
00016 #ifndef __LIGHTWIDGET_H_INCLUDED__
00017 #define __LIGHTWIDGET_H_INCLUDED__
00018 
00019 #include <QtGui/QWidget>
00020 #include <QtGui/QPushButton>
00021 #include <QtGui/QGroupBox>
00022 #include <QtGui/QDoubleSpinBox>
00023 #include <QtGui/QCheckBox>
00024 #include <QtGui/QComboBox>
00025 
00026 #include "light.h"
00027 
00028 
00029 //=============================================================================
00030 //  CLightParamWidget
00031 //=============================================================================
00032 
00043 class CLightParamWidget : public QGroupBox
00044 {
00045     Q_OBJECT
00046 public:
00053     CLightParamWidget( const QString & name=QString(), bool isColorWidget=true );
00054 
00057     vec4_t getValues( void ) const;
00058 
00062     void setValues( const vec4_t & values );
00063 
00064 signals:
00066     void contentsChanged( void );
00067 
00068 private slots:
00069     void someValueChanged( double );
00070     void selectColor( bool );
00071 
00072 private:
00073     int             m_skipValueChangedSignal;
00074     QDoubleSpinBox* m_vector[ 4 ];
00075     QPushButton*    m_selectColorButton;
00076 };
00077 
00078 
00079 //=============================================================================
00080 //  CLightWidget
00081 //=============================================================================
00082 
00092 class CLightWidget : public QWidget
00093 {
00094     Q_OBJECT
00095 public:
00099     CLightWidget( ILightingState* ls );
00100 
00101 
00102 private slots:
00103     void setActiveLight( int lightIndex );
00104     void lightPropertiesChanged( void );
00105     void lightPropertiesChanged( int );
00106     void lightingEnabledChanged( int );
00107     void showLightsChanged( int );
00108 
00109 private:
00110 
00111     // state changing
00112     void downloadLight( CLight & light );
00113     void uploadLight( const CLight & light );
00114 
00115     // signal processiong control
00116     int m_skipSetActiveLight;
00117     int m_skipLightPropertiesChanged;
00118 
00119     // widgets
00120     QComboBox*          m_activeLight;
00121     QCheckBox*          m_enableLight;      // GL_LIGHTi
00122     QCheckBox*          m_enableLighting;   // GL_LIGHTING
00123     QCheckBox*          m_lockToCamera;     // for active light
00124     QCheckBox*          m_autoRotateLight;  // for active light
00125     QCheckBox*          m_showLights;
00126     CLightParamWidget*  m_position;
00127     CLightParamWidget*  m_ambient;
00128     CLightParamWidget*  m_diffuse;
00129     CLightParamWidget*  m_specular;
00130 
00131     ILightingState*     m_lightingState;
00132 };
00133 
00134 
00135 //=============================================================================
00136 //  CMaterialWidget
00137 //=============================================================================
00138 
00146 class CMaterialWidget : public QWidget
00147 {
00148     Q_OBJECT
00149 public:
00153     CMaterialWidget( ILightingState* ls );
00154 
00155 private slots:;
00156     void materialPropertyChanged( int );
00157     void materialPropertyChanged( void );
00158     void materialPropertyChanged( double );
00159 
00160 private:
00161 
00162     // helpers
00163     void uploadMaterialState( void ); // ILightingState -> GUI
00164     void downloadMaterialState( void ); // GUI -> ILightingState
00165 
00166     // widgets
00167     CLightParamWidget*  m_emission;
00168     CLightParamWidget*  m_ambient;
00169     CLightParamWidget*  m_diffuse;
00170     CLightParamWidget*  m_specular;
00171     QDoubleSpinBox*     m_specularExponent;
00172     QCheckBox*          m_useColorMaterial;
00173 
00174     ILightingState*     m_lightingState;
00175 };
00176 
00177 
00178 #endif  // __LIGHTWIDGET_H_INCLUDED__

Generated on Sun Mar 2 17:12:31 2008 for Shader Maker by  doxygen 1.5.4