BALL  1.4.79
 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_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::WFlags 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 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  Vector3 getDirection_() throw(Exception::InvalidFormat);
110  Vector3 getPosition_() throw(Exception::InvalidFormat);
111  Vector3 getAttenuation_() throw(Exception::InvalidFormat);
112  void setControlsEnabled_(bool state);
113  Index getCurrentLightNumber_() const;
114 
115  void typeSelected_(Position type);
116 
117  //_ apply values to a light
118  void saveSettingsToLight_();
119 
120  //_ show the values of a light, after selecting an other one
121  void getValues_(Index light = -1);
122 
123  //_ empty all fields
124  void clearFields_();
125 
126  Stage* stage_;
127 
128  //__ temporary copy of all lights
129  vector<LightSource> lights_;
130 
131  //__ default lights
132  vector<LightSource> default_lights_;
133 
134  bool ignore_;
135  Index current_light_;
136 
137  Scene* scene_;
138  };
139 
140  }
141 }
142 
143 #endif
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
~LightSettings()
Destructor.
Definition: lightSettings.h:55
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31