Loading...
Searching...
No Matches
lightSettings.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_DIALOGS_LIGHTSETTINGS_H
#define BALL_VIEW_DIALOGS_LIGHTSETTINGS_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#ifndef BALL_CONCEPT_EMBEDDABLE_H
# include <BALL/CONCEPT/embeddable.h>
#endif
#ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
# include <BALL/VIEW/KERNEL/preferencesEntry.h>
#endif
#ifndef BALL_VIEW_KERNEL_STAGE_H
# include <BALL/VIEW/KERNEL/stage.h>
#endif
#include <BALL/VIEW/UIC/ui_lightSettings.h>
namespace BALL
{
namespace VIEW
{
class Scene;
class BALL_VIEW_EXPORT LightSettings
: public QWidget,
public Ui_LightSettingsData,
public PreferencesEntry,
public Embeddable
{
Q_OBJECT
public:
BALL_EMBEDDABLE(LightSettings,Embeddable)
LightSettings( QWidget* parent = 0, const char* name = "LightSettings",
Qt::WindowFlags fl = 0 );
~LightSettings() {}
void update();
void updateFromStage();
void apply();
virtual void restoreDefaultValues(bool /*all*/ = false);
void restoreValues(bool all);
public Q_SLOTS:
virtual void addLightPressed();
virtual void colorPressed();
virtual void defaultsPressed();
virtual void lightSelected(QListWidgetItem* current_item, QListWidgetItem* previous_item);
virtual void removeLightPressed();
virtual void typeSelected();
virtual void intensityChanged();
virtual void intensityMaxChanged(const QString& text);
virtual void positionTypeChanged();
virtual void updateDirectlyBoxChanged();
protected:
void setPosition_(const Vector3& v);
void setDirection_(const Vector3& v);
void setAttenuation_(const Vector3& a);
Vector3 getDirection_();
Vector3 getPosition_();
Vector3 getAttenuation_();
void setControlsEnabled_(bool state);
Index getCurrentLightNumber_() const;
void typeSelected_(Position type);
//_ apply values to a light
void saveSettingsToLight_();
//_ show the values of a light, after selecting an other one
void getValues_(Index light = -1);
//_ empty all fields
void clearFields_();
Stage* stage_;
//__ temporary copy of all lights
vector<LightSource> lights_;
//__ default lights
vector<LightSource> default_lights_;
bool ignore_;
Index current_light_;
Scene* scene_;
};
}
}
#endif
global.h
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::Embeddable::Embeddable
Embeddable(const String &identifier="<Embeddable>")
BALL::VIEW::LightSettings::getValues_
void getValues_(Index light=-1)
BALL::VIEW::LightSettings::restoreDefaultValues
virtual void restoreDefaultValues(bool=false)
Called when defaults is pressed in Preferences, calls setDefaults.
BALL::VIEW::LightSettings::ignore_
bool ignore_
Definition lightSettings.h:141
BALL::VIEW::LightSettings::setDirection_
void setDirection_(const Vector3 &v)
BALL::VIEW::LightSettings::defaultsPressed
virtual void defaultsPressed()
Resets the lighting.
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::intensityMaxChanged
virtual void intensityMaxChanged(const QString &text)
Slot for changes of the intensity max factor.
BALL::VIEW::LightSettings::setPosition_
void setPosition_(const Vector3 &v)
BALL::VIEW::LightSettings::setControlsEnabled_
void setControlsEnabled_(bool state)
BALL::VIEW::LightSettings::getPosition_
Vector3 getPosition_()
BALL::VIEW::LightSettings::getAttenuation_
Vector3 getAttenuation_()
BALL::VIEW::LightSettings::updateDirectlyBoxChanged
virtual void updateDirectlyBoxChanged()
BALL::VIEW::LightSettings::clearFields_
void clearFields_()
BALL::VIEW::LightSettings::saveSettingsToLight_
void saveSettingsToLight_()
BALL::VIEW::LightSettings::removeLightPressed
virtual void removeLightPressed()
Slot for the RemoveLight button.
BALL::VIEW::LightSettings::current_light_
Index current_light_
Definition lightSettings.h:142
BALL::VIEW::LightSettings::colorPressed
virtual void colorPressed()
Slot for the EditColor button, opens a color dialog.
BALL::VIEW::LightSettings::getCurrentLightNumber_
Index getCurrentLightNumber_() const
BALL::VIEW::LightSettings::stage_
Stage * stage_
Definition lightSettings.h:133
BALL::VIEW::LightSettings::typeSelected_
void typeSelected_(Position type)
BALL::VIEW::LightSettings::lights_
vector< LightSource > lights_
Definition lightSettings.h:136
BALL::VIEW::LightSettings::restoreValues
void restoreValues(bool all)
BALL::VIEW::LightSettings::addLightPressed
virtual void addLightPressed()
Slot for the AddLight button.
BALL::VIEW::LightSettings::scene_
Scene * scene_
Definition lightSettings.h:144
BALL::VIEW::LightSettings::lightSelected
virtual void lightSelected(QListWidgetItem *current_item, QListWidgetItem *previous_item)
Slot for selection in the listbox with lights.
BALL::VIEW::LightSettings::LightSettings
LightSettings(QWidget *parent=0, const char *name="LightSettings", Qt::WindowFlags fl=0)
Constructor.
BALL::VIEW::LightSettings::default_lights_
vector< LightSource > default_lights_
Definition lightSettings.h:139
BALL::VIEW::LightSettings::typeSelected
virtual void typeSelected()
Slot for type selection changed.
BALL::VIEW::LightSettings::positionTypeChanged
virtual void positionTypeChanged()
BALL::VIEW::LightSettings::updateFromStage
void updateFromStage()
Get the values for lighting from the stage.
BALL::VIEW::LightSettings::update
void update()
Update the display of all fields.
BALL::VIEW::LightSettings::getDirection_
Vector3 getDirection_()
BALL::VIEW::LightSettings::apply
void apply()
Apply the new values to the stage.
BALL::VIEW::PreferencesEntry::PreferencesEntry
PreferencesEntry()
BALL::VIEW::Scene
Definition scene.h:141
BALL::VIEW::Stage
Definition stage.h:239
QWidget
embeddable.h
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
preferencesEntry.h
stage.h