LightingWindow.h

Go to the documentation of this file.
00001 
00005 /* Copyright © 2010 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 
00012 #ifndef LIGHTING_WINDOW_H_
00013 #define LIGHTING_WINDOW_H_
00014 
00015 #include <vector>
00016 
00017 #include <boost/shared_ptr.hpp>
00018 
00019 #include <gtkmm/window.h>
00020 #include <gtkmm/box.h>
00021 #include <gtkmm/frame.h>
00022 #include <gtkmm/table.h>
00023 #include <gtkmm/label.h>
00024 #include <gtkmm/colorbutton.h>
00025 #include <gtkmm/spinbutton.h>
00026 #include <gtkmm/checkbutton.h>
00027 
00028 #include <libtrack/Lighting.h>
00029 
00031 class LightSettingWidget
00032     :   public Gtk::HBox
00033 {
00034     public:
00035         LightSettingWidget();
00036         Track::LightSettings get_light_settings() const;
00037         void set_light_settings(Track::LightSettings settings);
00038         sigc::signal<void> signal_changed();
00039     protected:
00040         Gtk::Label m_x_label;
00041         Gtk::Adjustment m_x_adjustment;
00042         Gtk::SpinButton m_x_spin;
00043         Gtk::Label m_y_label;
00044         Gtk::Adjustment m_y_adjustment;
00045         Gtk::SpinButton m_y_spin;
00046         Gtk::Label m_z_label;
00047         Gtk::Adjustment m_z_adjustment;
00048         Gtk::SpinButton m_z_spin;
00049         Gtk::Label m_w_label;
00050         Gtk::Adjustment m_w_adjustment;
00051         Gtk::SpinButton m_w_spin;
00052         Gtk::Label m_colour_label;
00053         Gtk::ColorButton m_colour_button;
00054         
00055         Track::LightSettings m_light_settings;
00056         
00057         sigc::signal<void> m_signal_changed;
00058         
00059         void on_x_change();
00060         void on_y_change();
00061         void on_z_change();
00062         void on_w_change();
00063         void on_colour_change();
00064 };
00065 
00067 class LightingWindow
00068     : public Gtk::Window
00069 {
00070     public:
00071         LightingWindow();
00072         const Track::Lighting & get_lighting() const;
00073         void set_lighting(const Track::Lighting & lighting);
00074         sigc::signal<void> signal_changed();
00075     protected:
00076         Gtk::VBox m_box;
00077         
00079         Gtk::Frame m_fog_frame;
00081         Gtk::Label m_fog_frame_label;
00083         Gtk::Table m_fog_table;
00084         Gtk::CheckButton m_fog_enabled_button;
00085         Gtk::Label m_fog_colour_label;
00086         Gtk::ColorButton m_fog_colour_button;
00087         Gtk::Label m_fog_density_label;
00088         Gtk::Adjustment m_fog_density_adjustment;
00089         Gtk::SpinButton m_fog_density_spin;
00090         
00092         Gtk::Frame m_light_frame;
00094         Gtk::Label m_light_frame_label;
00096         Gtk::Table m_light_table;
00097         Gtk::Label m_ambient_light_label;
00098         Gtk::ColorButton m_ambient_light_button;
00099         Gtk::Label m_num_lights_label;
00100         Gtk::Adjustment m_num_lights_adjustment;
00101         Gtk::SpinButton m_num_lights_spin;
00102         std::vector<boost::shared_ptr<LightSettingWidget> > m_light_setting_widgets;
00103         
00104         sigc::signal<void> m_signal_changed;
00105         
00106         Track::Lighting m_lighting;
00107         
00108         void on_fog_colour_change();
00109         void on_fog_density_change();
00110         void on_fog_enabled_change();
00111         void on_ambient_light_change();
00112         void on_num_lights_change();
00113         void on_light_setting_changed(int index);
00114         
00116         void update_light_widgets();
00117 };
00118 
00119 #endif // LIGHTING_WINDOW_H_

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:13 2010 by Doxygen version 1.4.7 for Racer version svn335.