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
14#endif
15
16#ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
18#endif
19
20#ifndef BALL_VIEW_KERNEL_STAGE_H
22#endif
23
24#include <BALL/VIEW/UIC/ui_lightSettings.h>
25
26namespace 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
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
103
104 protected:
105
106 void setPosition_(const Vector3& v);
107 void setDirection_(const Vector3& v);
108 void setAttenuation_(const Vector3& a);
109
112
115
118
119 void setControlsEnabled_(bool state);
121
123
124 //_ apply values to a light
126
127 //_ show the values of a light, after selecting an other one
128 void getValues_(Index light = -1);
129
130 //_ empty all fields
132
134
135 //__ temporary copy of all lights
136 vector<LightSource> lights_;
137
138 //__ default lights
139 vector<LightSource> default_lights_;
140
143
145 };
146
147 }
148}
149
150#endif
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
Definition: constants.h:13
void getValues_(Index light=-1)
virtual void restoreDefaultValues(bool=false)
Called when defaults is pressed in Preferences, calls setDefaults.
void setDirection_(const Vector3 &v)
virtual void defaultsPressed()
Resets the lighting.
void setAttenuation_(const Vector3 &a)
virtual void intensityChanged()
Slot for changes of the intensity slider.
virtual void intensityMaxChanged(const QString &text)
Slot for changes of the intensity max factor.
void setPosition_(const Vector3 &v)
void setControlsEnabled_(bool state)
virtual void updateDirectlyBoxChanged()
virtual void removeLightPressed()
Slot for the RemoveLight button.
virtual void colorPressed()
Slot for the EditColor button, opens a color dialog.
Index getCurrentLightNumber_() const
void typeSelected_(Position type)
vector< LightSource > lights_
void restoreValues(bool all)
virtual void addLightPressed()
Slot for the AddLight button.
virtual void lightSelected(QListWidgetItem *current_item, QListWidgetItem *previous_item)
Slot for selection in the listbox with lights.
vector< LightSource > default_lights_
virtual void typeSelected()
Slot for type selection changed.
virtual void positionTypeChanged()
void updateFromStage()
Get the values for lighting from the stage.
void update()
Update the display of all fields.
void apply()
Apply the new values to the stage.
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52