00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef freecloth_gfx_gfxGLWindowGLUI_h
00020 #define freecloth_gfx_gfxGLWindowGLUI_h
00021
00022 #ifndef freecloth_gfx_package_h
00023 #include <freecloth/gfx/package.h>
00024 #endif
00025
00026 #ifndef freecloth_gfx_gfxGLWindowGLUT_h
00027 #include <freecloth/gfx/gfxGLWindowGLUT.h>
00028 #endif
00029
00030
00031
00032
00033
00034 FREECLOTH_NAMESPACE_START
00035 class GeMatrix4;
00036 FREECLOTH_NAMESPACE_END
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class GfxGLWindowGLUI : public GfxGLWindowGLUT {
00047
00048 public:
00049
00050
00051 typedef GfxGLWindowGLUT BaseClass;
00052 typedef UInt32 ControlID;
00053 typedef UInt32 PanelID;
00054
00055 enum TranslateType {
00056 TR_XY,
00057 TR_X,
00058 TR_Y,
00059 TR_Z
00060 };
00061 enum EditType {
00062 EDIT_TEXT,
00063 EDIT_INT,
00064 EDIT_FLOAT
00065 };
00066 enum BorderType {
00067 BORDER_NONE,
00068 BORDER_RAISED,
00069 BORDER_EMBOSSED
00070 };
00071 enum {
00072 PANEL_NONE = ~0U,
00073 CTRL_NONE = ~0U
00074 };
00075
00076
00077
00078 GfxGLWindowGLUI(
00079 const GfxConfig&,
00080 const String& title
00081 );
00082 ~GfxGLWindowGLUI();
00083
00084
00085 void addGroup( BorderType, PanelID, PanelID parent = PANEL_NONE );
00086 void addPanel( const String& label, PanelID, PanelID parent = PANEL_NONE );
00087 void addRollout(
00088 const String& label,
00089 PanelID,
00090 bool open,
00091 PanelID parent = PANEL_NONE
00092 );
00093 void addColumn( bool showDivider = true, PanelID = PANEL_NONE );
00094 void addButton( const String& label, ControlID, PanelID = PANEL_NONE );
00095 void addRotate( const String& label, ControlID, PanelID = PANEL_NONE );
00096 void addTranslate(
00097 const String& label,
00098 TranslateType,
00099 ControlID,
00100 PanelID = PANEL_NONE
00101 );
00102 void addText(
00103 const String& label,
00104 ControlID = CTRL_NONE,
00105 PanelID = PANEL_NONE
00106 );
00107 void addEditText( const String& label, ControlID, PanelID = PANEL_NONE );
00108 void addEditInt( const String& label, ControlID, PanelID = PANEL_NONE );
00109 void addEditFloat( const String& label, ControlID, PanelID = PANEL_NONE );
00110 void addEditBox(
00111 const String& label,
00112 EditType,
00113 ControlID,
00114 PanelID = PANEL_NONE
00115 );
00116 void addCheckbox( const String& label, ControlID, PanelID = PANEL_NONE );
00117 void addRadioGroup( ControlID, PanelID = PANEL_NONE );
00118 void addRadioButton( ControlID group, const String& label );
00119
00120 void setRotate( ControlID, const GeMatrix4& );
00121 void setTranslateX( ControlID, Float );
00122 void setTranslateY( ControlID, Float );
00123 void setTranslateZ( ControlID, Float );
00124 void setText( ControlID, const String& );
00125 void setCheckbox( ControlID, bool );
00126 void setRadioGroup( ControlID, UInt32 );
00127 void setEditText( ControlID, const String& );
00128 void setEditInt( ControlID, Int32 );
00129 void setEditFloat( ControlID, Float );
00130 void setEditIntLimits(
00131 ControlID,
00132 Int32 low,
00133 Int32 high,
00134 bool wrap = false
00135 );
00136 void setEditFloatLimits(
00137 ControlID,
00138 Float low,
00139 Float high,
00140 bool wrap = false
00141 );
00142
00143 GeMatrix4 getRotate( ControlID ) const;
00144 Float getTranslateX( ControlID ) const;
00145 Float getTranslateY( ControlID ) const;
00146 Float getTranslateZ( ControlID ) const;
00147 bool getCheckbox( ControlID ) const;
00148 UInt32 getRadioGroup( ControlID ) const;
00149 String getEditText( ControlID ) const;
00150 Int32 getEditInt( ControlID ) const;
00151 Float getEditFloat( ControlID ) const;
00152
00153 protected:
00154
00155
00156
00157 static void reshapeCB( int w, int h );
00158 static void controlCB( int control );
00159
00160
00161
00162 virtual void registerIdleCB();
00163 virtual void registerCBs();
00164
00165 private:
00166
00167
00168 class Imp;
00169
00170
00171
00172
00173 GfxGLWindowGLUI( const GfxGLWindowGLUI& );
00174 GfxGLWindowGLUI& operator = ( const GfxGLWindowGLUI& );
00175
00176
00177
00178 Imp* _imp;
00179 };
00180
00181 #endif