00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_MATERIALSETTINGS_H
00008 #define BALL_VIEW_DIALOGS_MATERIALSETTINGS_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifdef BALL_COMPILER_MSVC
00015 # include <BALL/VIEW/UIC/ui_materialSettings.h>
00016 #else
00017 # include <BALL/VIEW/UIC/materialSettingsData.h>
00018 #endif
00019
00020
00021 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00022 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00023 #endif
00024
00025 #include <QtGui/QWidget>
00026 #include <QtGui/QLabel>
00027
00028 namespace BALL
00029 {
00030 namespace VIEW
00031 {
00032 class Scene;
00033 class Representation;
00034
00040 class BALL_VIEW_EXPORT MaterialSettings
00041 : public QWidget,
00042 public Ui_MaterialSettingsData,
00043 public PreferencesEntry
00044 {
00045 Q_OBJECT
00046
00047 public:
00048
00050 MaterialSettings( QWidget* parent = 0, const char* name = "MaterialSettings", Qt::WFlags fl = 0 );
00051
00053 ~MaterialSettings() {}
00054
00056 void apply();
00057
00059 void setCurrentRepresentation(Representation const* representation)
00060 {
00061 current_representation_ = representation;
00062 }
00063
00064 public slots:
00065
00066 virtual void ambientFactorChanged();
00067 virtual void specularityFactorChanged();
00068 virtual void reflectivenessFactorChanged();
00069 virtual void shininessFactorChanged();
00070 virtual void transparencyFactorChanged();
00071 virtual void updateDirectlyBoxChanged();
00072 virtual void editAmbientColor();
00073 virtual void editSpecularityColor();
00074 virtual void editReflectivenessColor();
00075 virtual void rendererChanged();
00076 private:
00077
00078 void setValues_(const QSlider& slider, QLabel& label, int divisor);
00079 void setQuadraticValues_(const QSlider& slider, QLabel& label, int divisor);
00080
00081 Representation const* current_representation_;
00082 };
00083
00084 }
00085 }
00086
00087 #endif