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 
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 
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
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
BALL::VIEW::LightSettings::updateDirectlyBoxChanged
virtual void updateDirectlyBoxChanged()
global.h
BALL::VIEW::LightSettings::positionTypeChanged
virtual void positionTypeChanged()
BALL::VIEW::LightSettings::saveSettingsToLight_
void saveSettingsToLight_()
BALL::VIEW::LightSettings::addLightPressed
virtual void addLightPressed()
Slot for the AddLight button.
BALL::VIEW::LightSettings::scene_
Scene * scene_
Definition: lightSettings.h:144
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
BALL::VIEW::PreferencesEntry
Definition: preferencesEntry.h:69
BALL::VIEW::LightSettings::typeSelected_
void typeSelected_(Position type)
BALL::VIEW::Scene
Definition: scene.h:141
BALL::VIEW::LightSettings::update
void update()
Update the display of all fields.
BALL::VIEW::LightSettings::restoreValues
void restoreValues(bool all)
BALL
Definition: constants.h:13
embeddable.h
QWidget
BALL::VIEW::LightSettings::setAttenuation_
void setAttenuation_(const Vector3 &a)
BALL::VIEW::LightSettings::intensityChanged
virtual void intensityChanged()
Slot for changes of the intensity slider.
BALL::VIEW::LightSettings::getValues_
void getValues_(Index light=-1)
BALL::VIEW::LightSettings::getAttenuation_
Vector3 getAttenuation_()
BALL::VIEW::LightSettings::lights_
vector< LightSource > lights_
Definition: lightSettings.h:136
BALL_INDEX_TYPE
BALL::VIEW::LightSettings::getDirection_
Vector3 getDirection_()
BALL_SIZE_TYPE
BALL::TVector3< float >
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::LightSettings::apply
void apply()
Apply the new values to the stage.
BALL::VIEW::LightSettings::restoreDefaultValues
virtual void restoreDefaultValues(bool=false)
Called when defaults is pressed in Preferences, calls setDefaults.
BALL::VIEW::LightSettings::typeSelected
virtual void typeSelected()
Slot for type selection changed.
BALL::VIEW::LightSettings::setControlsEnabled_
void setControlsEnabled_(bool state)
BALL::VIEW::LightSettings::stage_
Stage * stage_
Definition: lightSettings.h:133
stage.h
BALL::VIEW::LightSettings::clearFields_
void clearFields_()
BALL::VIEW::LightSettings::updateFromStage
void updateFromStage()
Get the values for lighting from the stage.
BALL::VIEW::LightSettings::ignore_
bool ignore_
Definition: lightSettings.h:141
BALL::VIEW::LightSettings::lightSelected
virtual void lightSelected(QListWidgetItem *current_item, QListWidgetItem *previous_item)
Slot for selection in the listbox with lights.
preferencesEntry.h
BALL::VIEW::LightSettings::colorPressed
virtual void colorPressed()
Slot for the EditColor button, opens a color dialog.
BALL::VIEW::LightSettings::setPosition_
void setPosition_(const Vector3 &v)
BALL::Embeddable
Definition: embeddable.h:82
BALL::VIEW::LightSettings::intensityMaxChanged
virtual void intensityMaxChanged(const QString &text)
Slot for changes of the intensity max factor.
BALL::VIEW::LightSettings
Definition: lightSettings.h:43
BALL::VIEW::LightSettings::removeLightPressed
virtual void removeLightPressed()
Slot for the RemoveLight button.
BALL::VIEW::LightSettings::default_lights_
vector< LightSource > default_lights_
Definition: lightSettings.h:139
BALL::VIEW::LightSettings::getCurrentLightNumber_
Index getCurrentLightNumber_() const
BALL::VIEW::LightSettings::setDirection_
void setDirection_(const Vector3 &v)
BALL::VIEW::Stage
Definition: stage.h:239
BALL::VIEW::LightSettings::getPosition_
Vector3 getPosition_()
BALL::VIEW::LightSettings::defaultsPressed
virtual void defaultsPressed()
Resets the lighting.
BALL::VIEW::LightSettings::current_light_
Index current_light_
Definition: lightSettings.h:142