BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lightSettings.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_VIEW_DIALOGS_LIGHTSETTINGS_H
6 #define BALL_VIEW_DIALOGS_LIGHTSETTINGS_H
7 
8 #ifndef BALL_COMMON_GLOBAL_H
9 # include <BALL/COMMON/global.h>
10 #endif
11 
12 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
14 #endif
15 
16 #ifndef BALL_VIEW_KERNEL_STAGE_H
17 # include <BALL/VIEW/KERNEL/stage.h>
18 #endif
19 
20 #include <BALL/VIEW/UIC/ui_lightSettings.h>
21 
22 namespace BALL
23 {
24  namespace VIEW
25  {
26  class Scene;
27 
35  : public QWidget,
36  public Ui_LightSettingsData,
37  public PreferencesEntry
38  {
39  Q_OBJECT
40 
41  public:
42 
44  LightSettings( QWidget* parent = 0, const char* name = "LightSettings",
45  Qt::WFlags fl = 0 );
46 
49 
51  void update();
52 
54  void updateFromStage();
55 
57  void apply();
58 
60  virtual void restoreDefaultValues(bool /*all*/ = false);
61 
63  void restoreValues(bool all);
64 
65  public slots:
66 
68  virtual void addLightPressed();
69 
71  virtual void colorPressed();
72 
74  virtual void defaultsPressed();
75 
77  virtual void lightSelected(QListWidgetItem* current_item, QListWidgetItem* previous_item);
78 
80  virtual void removeLightPressed();
81 
83  virtual void typeSelected();
84 
86  virtual void intensityChanged();
87 
89  virtual void positionTypeChanged();
90 
91  protected:
92 
93  void setPosition_(const Vector3& v);
94  void setDirection_(const Vector3& v);
95  void setAttenuation_(const Vector3& a);
96  Vector3 getDirection_() throw(Exception::InvalidFormat);
97  Vector3 getPosition_() throw(Exception::InvalidFormat);
98  Vector3 getAttenuation_() throw(Exception::InvalidFormat);
99  void setControlsEnabled_(bool state);
100  Index getCurrentLightNumber_() const;
101 
102  void typeSelected_(Position type);
103 
104  //_ apply values to a light
105  void saveSettingsToLight_();
106 
107  //_ show the values of a light, after selecting an other one
108  void getValues_(Index light = -1);
109 
110  //_ empty all fields
111  void clearFields_();
112 
113  Stage* stage_;
114 
115  //__ temporary copy of all lights
116  vector<LightSource> lights_;
117 
118  //__ default lights
119  vector<LightSource> default_lights_;
120 
121  bool ignore_;
122  Index current_light_;
123  };
124 
125  }
126 }
127 
128 #endif