BALL  1.5.0
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_CONCEPT_EMBEDDABLE_H
13 # include <BALL/CONCEPT/embeddable.h>
14 #endif
15 
16 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
18 #endif
19 
20 #ifndef BALL_VIEW_KERNEL_STAGE_H
21 # include <BALL/VIEW/KERNEL/stage.h>
22 #endif
23 
24 #include <BALL/VIEW/UIC/ui_lightSettings.h>
25 
26 namespace BALL
27 {
28  namespace VIEW
29  {
30  class Scene;
31 
39  : public QWidget,
40  public Ui_LightSettingsData,
41  public PreferencesEntry,
42  public Embeddable
43  {
44  Q_OBJECT
45 
46  public:
47 
49 
50 
51  LightSettings( QWidget* parent = 0, const char* name = "LightSettings",
52  Qt::WindowFlags fl = 0 );
53 
56 
58  void update();
59 
61  void updateFromStage();
62 
64  void apply();
65 
67  virtual void restoreDefaultValues(bool /*all*/ = false);
68 
70  void restoreValues(bool all);
71 
72  public Q_SLOTS:
73 
75  virtual void addLightPressed();
76 
78  virtual void colorPressed();
79 
81  virtual void defaultsPressed();
82 
84  virtual void lightSelected(QListWidgetItem* current_item, QListWidgetItem* previous_item);
85 
87  virtual void removeLightPressed();
88 
90  virtual void typeSelected();
91 
93  virtual void intensityChanged();
94 
96  virtual void intensityMaxChanged(const QString& text);
97 
99  virtual void positionTypeChanged();
100 
102  virtual void updateDirectlyBoxChanged();
103 
104  protected:
105 
106  void setPosition_(const Vector3& v);
107  void setDirection_(const Vector3& v);
108  void setAttenuation_(const Vector3& a);
109 
111  Vector3 getDirection_();
112 
114  Vector3 getPosition_();
115 
117  Vector3 getAttenuation_();
118 
119  void setControlsEnabled_(bool state);
120  Index getCurrentLightNumber_() const;
121 
122  void typeSelected_(Position type);
123 
124  //_ apply values to a light
125  void saveSettingsToLight_();
126 
127  //_ show the values of a light, after selecting an other one
128  void getValues_(Index light = -1);
129 
130  //_ empty all fields
131  void clearFields_();
132 
134 
135  //__ temporary copy of all lights
136  vector<LightSource> lights_;
137 
138  //__ default lights
139  vector<LightSource> default_lights_;
140 
141  bool ignore_;
143 
145  };
146 
147  }
148 }
149 
150 #endif
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
vector< LightSource > lights_
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
~LightSettings()
Destructor.
Definition: lightSettings.h:55
Definition: constants.h:12
vector< LightSource > default_lights_