00001 #ifndef _VULIGHTDIAL_H_
00002 #define _VULIGHTDIAL_H_
00003
00004 #include <wx/wx.h>
00005 #include <wx/dialog.h>
00006 #include <wx/image.h>
00007 #include <wx/file.h>
00008
00009 #include "../vuGui.h"
00010 #include "vuTFunc/vuTFDesignSpec.h"
00011 #include "vuConvexHull.h"
00012 #include "vuSimpleTypes.h"
00013
00014 #define CHECK_EXE_PATH
00015 #ifdef CHECK_EXE_PATH
00016
00017 DECLARE_APP(vuGUI)
00018 #endif
00019
00020 #define LDIAL_SLDRES 100
00021 #define LDIAL_INTENSITY 5
00022
00023 #define LDIAL_MAXLIGHTS 100
00024
00026
00028 class vuLightDial : public wxDialog
00029 {
00030 public:
00031 enum
00032 {
00033 idLIGHTINT,
00034 idHIDE,
00035 idLAST
00036 };
00037
00039
00045 vuLightDial(wxWindow *parent, vuTFDesignSpec &tf);
00046
00048 bool isUpdated() {
00049 bool ret=m_IsUpdated;
00050 m_IsUpdated=false;
00051 return ret;
00052 }
00053
00059 void updateSliders();
00060
00062 float getLj(int j, const wxPoint& x);
00063
00064 protected:
00065
00067 #if wxMINOR_VERSION < 5
00068 void OnSlideIntensity();
00069 #else
00070 void OnSlideIntensity(wxScrollEvent&);
00071 #endif
00072
00073 #if wxMINOR_VERSION < 5
00074 void OnHide();
00075 #else
00076 void OnHide(wxCommandEvent&);
00077 #endif
00078
00080 void reweightLights();
00081
00083 void OnMouseEvent(wxMouseEvent& event);
00085 #if wxMINOR_VERSION < 5
00086 void OnPaint();
00087 #else
00088 void OnPaint(wxPaintEvent& event);
00089 #endif
00090 void DrawShape();
00091
00093 void repaintParent();
00094
00096 vuTFDesignSpec &m_TFunc;
00097
00099 wxSlider *m_LightIntensity;
00100
00102 wxRect m_DialArea;
00103
00105 int m_WeightX, m_WeightY;
00106
00108 wxSizer *m_DialSpacer;
00109
00111 bool m_IsUpdated;
00112
00113 wxPoint m_LPos[LDIAL_MAXLIGHTS];
00114 bool m_LActive[LDIAL_MAXLIGHTS];
00115 wxPoint m_HullPos[LDIAL_MAXLIGHTS];
00116 int m_LIndices[LDIAL_MAXLIGHTS];
00117 int m_NLights, m_NCHull;
00118
00119 vuConvexHull m_CHull;
00120
00121 wxBitmap *m_BulbImg;
00122
00123 DECLARE_EVENT_TABLE()
00124 };
00125
00126 #ifndef WIN32
00127 # undef wxUSE_LIBPNG
00128 #endif
00129
00130
00131 #endif