00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_LIGHTSETTINGS_H
00008 #define BALL_VIEW_DIALOGS_LIGHTSETTINGS_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifdef BALL_COMPILER_MSVC
00015 # include <BALL/VIEW/UIC/ui_lightSettings.h>
00016 #else
00017 # include <BALL/VIEW/UIC/lightSettingsData.h>
00018 #endif
00019
00020
00021 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00022 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00023 #endif
00024
00025 #ifndef BALL_VIEW_KERNEL_STAGE_H
00026 # include <BALL/VIEW/KERNEL/stage.h>
00027 #endif
00028
00029 namespace BALL
00030 {
00031 namespace VIEW
00032 {
00033 class Scene;
00034
00041 class BALL_VIEW_EXPORT LightSettings
00042 : public QWidget,
00043 public Ui_LightSettingsData,
00044 public PreferencesEntry
00045 {
00046 Q_OBJECT
00047
00048 public:
00049
00051 LightSettings( QWidget* parent = 0, const char* name = "LightSettings",
00052 Qt::WFlags fl = 0 );
00053
00055 ~LightSettings() {}
00056
00058 void update();
00059
00061 void updateFromStage();
00062
00064 void apply();
00065
00067 virtual void restoreDefaultValues(bool = false);
00068
00070 void restoreValues(bool all);
00071
00072 public slots:
00073
00075 virtual void addLightPressed();
00076
00078 virtual void colorPressed();
00079
00081 virtual void defaultsPressed();
00082
00084 virtual void lightSelected(QListWidgetItem* current_item, QListWidgetItem* previous_item);
00085
00087 virtual void removeLightPressed();
00088
00090 virtual void typeSelected();
00091
00093 virtual void intensityChanged();
00094
00096 virtual void positionTypeChanged();
00097
00098 protected:
00099
00100 void setPosition_(const Vector3& v);
00101 void setDirection_(const Vector3& v);
00102 void setAttenuation_(const Vector3& a);
00103 Vector3 getDirection_() throw(Exception::InvalidFormat);
00104 Vector3 getPosition_() throw(Exception::InvalidFormat);
00105 Vector3 getAttenuation_() throw(Exception::InvalidFormat);
00106 void setControlsEnabled_(bool state);
00107 Index getCurrentLightNumber_() const;
00108
00109 void typeSelected_(Position type);
00110
00111
00112 void saveSettingsToLight_();
00113
00114
00115 void getValues_(Index light = -1);
00116
00117
00118 void clearFields_();
00119
00120 Stage* stage_;
00121
00122
00123 vector<LightSource> lights_;
00124
00125
00126 vector<LightSource> default_lights_;
00127
00128 bool ignore_;
00129 Index current_light_;
00130 };
00131
00132 }
00133 }
00134
00135 #endif