materialSettings.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_DIALOGS_MATERIALSETTINGS_H
00006 #define BALL_VIEW_DIALOGS_MATERIALSETTINGS_H
00007 
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011 
00012 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00013 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00014 #endif
00015 
00016 #include <BALL/VIEW/UIC/ui_materialSettings.h>
00017 
00018 #include <QtGui/QWidget>
00019 #include <QtGui/QLabel>
00020 
00021 namespace BALL
00022 {
00023   namespace VIEW
00024   {
00025     class Scene;
00026     class Representation;
00027 
00033     class BALL_VIEW_EXPORT MaterialSettings 
00034       : public QWidget,
00035         public Ui_MaterialSettingsData,
00036         public PreferencesEntry
00037     { 
00038       Q_OBJECT
00039 
00040       public:
00041 
00043       MaterialSettings( QWidget* parent = 0, const char* name = "MaterialSettings", Qt::WFlags fl = 0 );
00044 
00046       ~MaterialSettings() {}
00047 
00049       void apply();
00050 
00052       void setCurrentRepresentation(Representation const* representation)
00053       {
00054         current_representation_ = representation;
00055       }
00056 
00057       public slots:
00058 
00059       virtual void ambientFactorChanged();
00060       virtual void specularityFactorChanged();
00061       virtual void reflectivenessFactorChanged();
00062       virtual void shininessFactorChanged();
00063       virtual void transparencyFactorChanged();
00064       virtual void updateDirectlyBoxChanged();
00065       virtual void editAmbientColor();
00066       virtual void editSpecularityColor();
00067       virtual void editReflectivenessColor();
00068       virtual void rendererChanged();
00069       private:
00070 
00071       void setValues_(const QSlider& slider, QLabel& label, int divisor);
00072       void setQuadraticValues_(const QSlider& slider, QLabel& label, int divisor);
00073 
00074       Representation const* current_representation_;
00075     };
00076 
00077   }
00078 }
00079 
00080 #endif