00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "../Include/FlyLegacy.h"
00031 #include "../Include/Ui.h"
00032 #include "../Include/Terrain.h"
00033 #include "../Include/Globals.h"
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 typedef struct {
00069 puDialogBox* dialog;
00070 puFrame* frame;
00071 puText* title;
00072
00073 puInput *YCurve_A_0, *YCurve_A_1;
00074 puInput *YCurve_B_0, *YCurve_B_1;
00075 puInput *YCurve_C_0, *YCurve_C_1;
00076 puInput *YCurve_D_0, *YCurve_D_1;
00077 puInput *YCurve_E_0, *YCurve_E_1;
00078
00079 puInput *xCurve_A_0, *xCurve_A_1;
00080 puInput *xCurve_B_0, *xCurve_B_1;
00081 puInput *xCurve_C_0, *xCurve_C_1;
00082 puInput *xCurve_D_0, *xCurve_D_1;
00083 puInput *xCurve_E_0, *xCurve_E_1;
00084
00085 puInput *yCurve_A_0, *yCurve_A_1;
00086 puInput *yCurve_B_0, *yCurve_B_1;
00087 puInput *yCurve_C_0, *yCurve_C_1;
00088 puInput *yCurve_D_0, *yCurve_D_1;
00089 puInput *yCurve_E_0, *yCurve_E_1;
00090
00091 puInput *YZenith_A;
00092 puInput *YZenith_B;
00093 puInput *YZenith_C;
00094 puInput *YZenith_D;
00095
00096 puInput *xZenith_theta3_T2, *xZenith_theta3_T1, *xZenith_theta3_T0;
00097 puInput *xZenith_theta2_T2, *xZenith_theta2_T1, *xZenith_theta2_T0;
00098 puInput *xZenith_theta1_T2, *xZenith_theta1_T1, *xZenith_theta1_T0;
00099 puInput *xZenith_theta0;
00100
00101 puInput *yZenith_theta3_T2, *yZenith_theta3_T1, *yZenith_theta3_T0;
00102 puInput *yZenith_theta2_T2, *yZenith_theta2_T1, *yZenith_theta2_T0;
00103 puInput *yZenith_theta1_T2, *yZenith_theta1_T1, *yZenith_theta1_T0;
00104 puInput *yZenith_theta0;
00105
00106 puFrame* frame_Profiles;
00107 puFrame* frame_YCurve;
00108 puFrame* frame_xCurve;
00109 puFrame* frame_yCurve;
00110 puFrame* frame_YZenith;
00111 puFrame* frame_xZenith;
00112 puFrame* frame_yZenith;
00113 puFrame* frame_Turbidity;
00114
00115 puOneShot* defaults;
00116 puOneShot* apply;
00117 puOneShot* close;
00118 } SSkyTweakerDialogData;
00119
00120
00121 static SSkyTweakerDialogData *dt = NULL;
00122
00123
00124 static void apply_cb (puObject* obj)
00125 {
00126 if (dt == NULL) return;
00127
00128
00129
00130 }
00131
00132 static void close_cb (puObject* obj)
00133 {
00134 if (dt == NULL) return;
00135
00136
00137 delete dt->dialog;
00138
00139
00140 delete dt;
00141 dt = NULL;
00142 }
00143
00144
00145
00146
00147
00148
00149 static puInput* makeInput (int x1, int y1, int x2, int y2, const char* label, int* v)
00150 {
00151 puInput *pi = new puInput (x1, y1, x2, y2);
00152 pi->setLabel (label);
00153 pi->setLabelPlace (PUPLACE_CENTERED_LEFT);
00154 pi->setStyle (PUSTYLE_BOXED);
00155 if (v != NULL) {
00156 pi->setValuator (v);
00157 }
00158 return pi;
00159 }
00160
00161
00162 void sky_tweaker_dlg_create (void)
00163 {
00164 if (dt != NULL) return;
00165
00166
00167 dt = new SSkyTweakerDialogData;
00168
00169
00170 int frame_w = 600;
00171 int frame_h = 600;
00172 dt->dialog = new puDialogBox (20, globals->screenHeight - 30 - frame_h);
00173 {
00174
00175 dt->frame = new puFrame (0, 0, frame_w, frame_h);
00176 dt->frame->setStyle (PUSTYLE_SMALL_SHADED);
00177
00178 dt->title = new puText (10, frame_h - 30);
00179 dt->title->setLabel ("Sky Tweaker");
00180
00181 int x1 = 0;
00182
00183
00184
00185 int gx, gy, gw, gh;
00186 puGroup *pg;
00187
00188
00189
00190
00191
00192
00193 gx = 10;
00194 gy = 400;
00195 gw = 250;
00196 gh = 150;
00197 pg = new puGroup (gx, gy);
00198 dt->frame_YCurve = new puFrame (0, 0, gw, gh);
00199 dt->frame_YCurve->setStyle (PUSTYLE_BOXED);
00200 dt->frame_YCurve->setLegend ("Luminance Y Curve");
00201 dt->frame_YCurve->setLegendPlace (PUPLACE_TOP_LEFT);
00202
00203 dt->YCurve_A_1 = makeInput (50, 90, 120, 105, "A: ", NULL);
00204 dt->YCurve_B_1 = makeInput (50, 70, 120, 85, "B: ", NULL);
00205 dt->YCurve_C_1 = makeInput (50, 50, 120, 65, "C: ", NULL);
00206 dt->YCurve_D_1 = makeInput (50, 30, 120, 45, "D: ", NULL);
00207 dt->YCurve_E_1 = makeInput (50, 10, 120, 25, "E: ", NULL);
00208
00209 dt->YCurve_A_0 = makeInput (160, 90, 230, 105, "T + ", NULL);
00210 dt->YCurve_B_0 = makeInput (160, 70, 230, 85, "T + ", NULL);
00211 dt->YCurve_C_0 = makeInput (160, 50, 230, 65, "T + ", NULL);
00212 dt->YCurve_D_0 = makeInput (160, 30, 230, 45, "T + ", NULL);
00213 dt->YCurve_E_0 = makeInput (160, 10, 230, 25, "T + ", NULL);
00214 pg->close ();
00215
00216
00217 gx = 10;
00218 gy = 250;
00219 gw = 250;
00220 gh = 150;
00221 pg = new puGroup (gx, gy);
00222 dt->frame_xCurve = new puFrame (0, 0, gw, gh);
00223 dt->frame_xCurve->setStyle (PUSTYLE_BOXED);
00224 dt->frame_xCurve->setLegend ("Chrominance x Curve");
00225 dt->frame_xCurve->setLegendPlace (PUPLACE_TOP_LEFT);
00226
00227 dt->xCurve_A_1 = makeInput (50, 90, 120, 105, "A: ", NULL);
00228 dt->xCurve_B_1 = makeInput (50, 70, 120, 85, "B: ", NULL);
00229 dt->xCurve_C_1 = makeInput (50, 50, 120, 65, "C: ", NULL);
00230 dt->xCurve_D_1 = makeInput (50, 30, 120, 45, "D: ", NULL);
00231 dt->xCurve_E_1 = makeInput (50, 10, 120, 25, "E: ", NULL);
00232
00233 dt->xCurve_A_0 = makeInput (160, 90, 230, 105, "T + ", NULL);
00234 dt->xCurve_B_0 = makeInput (160, 70, 230, 85, "T + ", NULL);
00235 dt->xCurve_C_0 = makeInput (160, 50, 230, 65, "T + ", NULL);
00236 dt->xCurve_D_0 = makeInput (160, 30, 230, 45, "T + ", NULL);
00237 dt->xCurve_E_0 = makeInput (160, 10, 230, 25, "T + ", NULL);
00238 pg->close ();
00239
00240
00241 gx = 10;
00242 gy = 100;
00243 gw = 250;
00244 gh = 150;
00245 pg = new puGroup (gx, gy);
00246 dt->frame_yCurve = new puFrame (0, 0, gw, gh);
00247 dt->frame_yCurve->setStyle (PUSTYLE_BOXED);
00248 dt->frame_yCurve->setLegend ("Chrominance y Curve");
00249 dt->frame_yCurve->setLegendPlace (PUPLACE_TOP_LEFT);
00250
00251 dt->yCurve_A_1 = makeInput (50, 90, 120, 105, "A: ", NULL);
00252 dt->yCurve_B_1 = makeInput (50, 70, 120, 85, "B: ", NULL);
00253 dt->yCurve_C_1 = makeInput (50, 50, 120, 65, "C: ", NULL);
00254 dt->yCurve_D_1 = makeInput (50, 30, 120, 45, "D: ", NULL);
00255 dt->yCurve_E_1 = makeInput (50, 10, 120, 25, "E: ", NULL);
00256
00257 dt->yCurve_A_0 = makeInput (160, 90, 230, 105, "T + ", NULL);
00258 dt->yCurve_B_0 = makeInput (160, 70, 230, 85, "T + ", NULL);
00259 dt->yCurve_C_0 = makeInput (160, 50, 230, 65, "T + ", NULL);
00260 dt->yCurve_D_0 = makeInput (160, 30, 230, 45, "T + ", NULL);
00261 dt->yCurve_E_0 = makeInput (160, 10, 230, 25, "T + ", NULL);
00262 pg->close ();
00263
00264
00265 gx = 260;
00266 gy = 400;
00267 gw = 160;
00268 gh = 150;
00269 pg = new puGroup (gx, gy);
00270 dt->frame_YZenith = new puFrame (0, 0, gw, gh);
00271 dt->frame_YZenith->setStyle (PUSTYLE_BOXED);
00272 dt->frame_YZenith->setLegend ("Luminance Y Zenith");
00273 dt->frame_YZenith->setLegendPlace (PUPLACE_TOP_LEFT);
00274 pg->close ();
00275
00276
00277 gx = 420;
00278 gy = 400;
00279 gw = 170;
00280 gh = 150;
00281 pg = new puGroup (gx, gy);
00282 dt->frame_Profiles = new puFrame (0, 0, gw, gh);
00283 dt->frame_Profiles->setStyle (PUSTYLE_BOXED);
00284 dt->frame_Profiles->setLegend ("Profiles (SKIES.INI)");
00285 dt->frame_Profiles->setLegendPlace (PUPLACE_TOP_CENTER);
00286 pg->close ();
00287
00288
00289 gx = 260;
00290 gy = 100;
00291 gw = 330;
00292 gh = 150;
00293 pg = new puGroup (gx, gy);
00294 dt->frame_xZenith = new puFrame (0, 0, gw, gh);
00295 dt->frame_xZenith->setStyle (PUSTYLE_BOXED);
00296 dt->frame_xZenith->setLegend ("Chrominance x Zenith");
00297 dt->frame_xZenith->setLegendPlace (PUPLACE_TOP_LEFT);
00298 pg->close ();
00299
00300
00301 gx = 260;
00302 gy = 250;
00303 gw = 330;
00304 gh = 150;
00305 pg = new puGroup (gx, gy);
00306 dt->frame_yZenith = new puFrame (0, 0, gw, gh);
00307 dt->frame_yZenith->setStyle (PUSTYLE_BOXED);
00308 dt->frame_yZenith->setLegend ("Chrominance y Zenith");
00309 dt->frame_yZenith->setLegendPlace (PUPLACE_TOP_LEFT);
00310 pg->close ();
00311
00312
00313 gx = 10;
00314 gy = 60;
00315 gw = frame_w - 20;
00316 gh = 40;
00317 pg = new puGroup (gx, gy);
00318 dt->frame_Turbidity = new puFrame (0, 0, gw, gh);
00319 dt->frame_Turbidity->setStyle (PUSTYLE_BOXED);
00320 pg->close ();
00321
00322
00323 x1 = 20;
00324 dt->defaults = new puOneShot (x1, 20, x1+80, 40);
00325 dt->defaults->setLegend ("Defaults");
00326 dt->defaults->makeReturnDefault (false);
00327 dt->defaults->setStyle (PUSTYLE_SMALL_SHADED);
00328 dt->defaults->setCallback (apply_cb);
00329
00330
00331 x1 = frame_w - 180;
00332 dt->apply = new puOneShot (x1, 20, x1+60, 40);
00333 dt->apply->setLegend ("Apply");
00334 dt->apply->makeReturnDefault (false);
00335 dt->apply->setStyle (PUSTYLE_SMALL_SHADED);
00336 dt->apply->setCallback (apply_cb);
00337
00338
00339 x1 = frame_w - 80;
00340 dt->close = new puOneShot (x1, 20, x1+60, 40);
00341 dt->close->setLegend ("Close");
00342 dt->close->makeReturnDefault (false);
00343 dt->close->setStyle (PUSTYLE_SMALL_SHADED);
00344 dt->close->setCallback (close_cb);
00345 }
00346 dt->dialog->close ();
00347 dt->dialog->reveal ();
00348 dt->dialog->setFloating (true);
00349 }
00350