1# data file for the Fltk User Interface Designer (fluid) 2version 1.0100 3header_name {.h} 4code_name {.cxx} 5gridx 5 6gridy 5 7snap 3 8decl {// Quat - A 3D fractal generation program 9// Copyright (C) 1997-2000 Dirk Meyer 10// (email: dirk.meyer@studserv.uni-stuttgart.de) 11// mail: Dirk Meyer 12// Marbacher Weg 29 13// D-71334 Waiblingen 14// Germany 15// 16// This program is free software; you can redistribute it and/or 17// modify it under the terms of the GNU General Public License 18// as published by the Free Software Foundation; either version 2 19// of the License, or (at your option) any later version. 20// 21// This program is distributed in the hope that it will be useful, 22// but WITHOUT ANY WARRANTY; without even the implied warranty of 23// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24// GNU General Public License for more details. 25// 26// You should have received a copy of the GNU General Public License 27// along with this program; if not, write to the Free Software 28// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.} {} 29 30declblock {\#ifdef HAVE_CONFIG_H} {after {\#endif} 31} { 32 decl {\#include <config.h>} {} 33} 34 35decl {//\#include <iostream>} {} 36 37decl {//\#include <string.h>} {} 38 39decl {\#include <cmath> // fabs} {} 40 41decl {\#include "ChildWindow.h"} {} 42 43decl {class ChildWindow;} {public 44} 45 46decl {\#include "structs.h"} {public 47} 48 49decl {\#define VD(a) (a)->value()} {} 50 51decl {\#define VI(a) static_cast<int>((a)->value())} {} 52 53decl {\#include "MandelPreview.h"} {} 54 55decl {class MandelPreview;} {public 56} 57 58class ObjectEditor {open : {public Fl_Group} 59} { 60 Function {ObjectEditor(int X, int Y, int W, int H, const char *label) : Fl_Group(X, Y, W, H, label)} {open 61 } { 62 Fl_Window win {open 63 xywh {342 298 416 216} 64 class ChildWindow noborder visible 65 } { 66 Fl_Value_Input maxiter { 67 label {Max. 68Iteration} 69 callback {MP->maxiter(VI(o)); 70frac.maxiter = VI(o); 71o->color(FL_WHITE); 72if (VI(o)<=0) o->color(FL_RED); 73if (VI(o)>65535) o->color(FL_RED); 74o->redraw();} 75 tooltip {Highest number of iterations done.} xywh {10 35 60 20} labelsize 12 align 5 minimum 1 maximum 1e+20 step 1 textsize 12 76 } 77 Fl_Value_Input lvalue { 78 label {4th-dim. 79Intersection} 80 callback {frac.lvalue = VD(o); 81o->color(FL_WHITE); 82if (fabs(VD(o))>2.0) o->color(FL_YELLOW); 83if (fabs(VD(o))>=1000000.0) o->color(FL_RED); 84o->redraw();} 85 tooltip {The constant value for the 4th part of a quaternion.} xywh {75 35 95 20} labelsize 12 align 5 minimum -1e+20 maximum 1e+20 textsize 12 86 } 87 Fl_Value_Input bailout { 88 label Bailout 89 callback {MP->bailout(VD(o)); 90frac.bailout = VD(o); 91o->color(FL_WHITE); 92if (VD(o) <= 0.0 || VD(o) >= 1E20) o->color(FL_RED); 93else if (VD(o) < 4.0) o->color(FL_YELLOW); 94else o->color(FL_WHITE); 95o->redraw();} 96 tooltip {If this value is exceeded, iteration is ready.} xywh {175 35 95 20} labelsize 12 align 5 maximum 1e+20 textsize 12 97 } 98 Fl_Choice formula { 99 label {Iteration 100Formula } 101 callback {MP->formula(VI(o)); 102frac.formula = VI(o); 103formula_changed();} 104 tooltip {The formula that gets iterated.} xywh {65 65 205 30} down_box BORDER_BOX labelsize 12 textsize 12 105 } { 106 menuitem {} { 107 label {Classical Julia} 108 xywh {35 35 100 20} shortcut 0x61 labelsize 12 109 } 110 menuitem {} { 111 label {Lambda Julia} 112 xywh {30 30 100 20} shortcut 0x62 labelsize 12 113 } 114 menuitem {} { 115 label {x[n+1] = x[n]*ln(x[n]) - c} 116 xywh {40 40 100 20} shortcut 0x63 labelsize 12 117 } 118 menuitem {} { 119 label {Cubic Julia} 120 xywh {50 50 100 20} shortcut 0x64 labelsize 12 121 } 122 menuitem {} { 123 label {x[n+1] = x[n]^p1-c} 124 xywh {40 40 100 20} shortcut 0x65 labelsize 12 125 } 126 } 127 Fl_Value_Input cre { 128 label {c (1, i, j, k parts)} 129 callback {MP->SetCX(VD(o)); 130frac.c[0] = VD(o);} selected 131 tooltip {Real part of c.} xywh {10 125 95 20} labelsize 12 align 5 minimum -1e+20 maximum 1e+20 textsize 12 132 } 133 Fl_Value_Input ci { 134 label {value:} 135 callback {MP->SetCY(VD(o)); 136frac.c[1] = VD(o);} 137 tooltip {1st imaginary (i) part of c.} xywh {10 145 95 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 138 } 139 Fl_Value_Input cj { 140 label {value:} 141 callback {MP->cj(VD(o)); 142frac.c[2] = VD(o);} 143 tooltip {2nd imaginary (j) part of c.} xywh {10 165 95 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 144 } 145 Fl_Value_Input ck { 146 label {value:} 147 callback {MP->ck(VD(o)); 148frac.c[3] = VD(o);} 149 tooltip {3rd imaginary part (k) of c.} xywh {10 185 95 19} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 150 } 151 Fl_Group paramgroup { 152 xywh {280 20 115 125} 153 } { 154 Fl_Box {} { 155 label Parameter 156 xywh {285 20 105 125} box UP_BOX labelsize 12 align 21 157 } 158 Fl_Scrollbar paramscroll { 159 xywh {290 120 95 15} type Horizontal 160 } 161 } 162 Fl_Group {} { 163 xywh {225 165 80 40} 164 } { 165 Fl_Button {} { 166 label up 167 callback {MP->MoveUp();} 168 tooltip {Navigation in Mandelbrot Preview.} xywh {225 165 40 20} shortcut 0x80069 labelsize 12 169 } 170 Fl_Button {} { 171 label {<} 172 callback {MP->MoveLeft();} 173 tooltip {Navigation in Mandelbrot Preview: to the left.} xywh {225 185 20 20} shortcut 0x8006a labelsize 12 174 } 175 Fl_Button {} { 176 label {+} 177 callback {MP->ZoomIn();} 178 tooltip {Zoom In.} xywh {245 185 20 20} shortcut 0x2b labelsize 12 179 } 180 Fl_Button {} { 181 label {-} 182 callback {MP->ZoomOut();} 183 tooltip {Zoom out.} xywh {265 185 20 20} shortcut 0x2d labelsize 12 184 } 185 Fl_Button {} { 186 label {>} 187 callback {MP->MoveRight();} 188 tooltip {Navigation in Mandelbrot Preview: to the right.} xywh {285 185 20 20} shortcut 0x8006c labelsize 12 189 } 190 Fl_Button {} { 191 label down 192 callback {MP->MoveDown();} 193 tooltip {Navigation in Mandelbrot Preview.} xywh {265 165 40 20} shortcut 0x8006b labelsize 12 194 } 195 } 196 Fl_Button redraw { 197 label {&redraw} 198 callback {MP->CalcImage(); 199MP->redraw(); 200MP->CheckUpdate();} 201 tooltip {Redraws the Mandebrot Preview.} xywh {225 125 45 20} shortcut 0x80072 labelsize 12 deactivate 202 } 203 Fl_Box MP { 204 label label 205 tooltip {Mandelbrot preview: 206for easy selection of c (real- and i- part) 207Red frame: Redraw required.} xywh {110 125 110 80} box EMBOSSED_FRAME labeltype NO_LABEL labelsize 12 208 class MandelPreview 209 } 210 Fl_Group paramgroup2 { 211 xywh {290 20 95 100} 212 } { 213 Fl_Value_Input p_re { 214 label p1 215 callback {MP->p(paramscroll->value()-1, 0, VD(o)); 216frac.p[paramscroll->value()-1][0] = VD(o); 217//cout << paramscroll->value() << endl;} 218 tooltip {Real part of p1.} xywh {290 35 95 20} labelsize 12 align 9 minimum -1e+20 maximum 1e+20 textsize 12 219 } 220 Fl_Value_Input p_i { 221 label {value:} 222 callback {MP->p(paramscroll->value()-1, 1, VD(o)); 223frac.p[paramscroll->value()-1][1] = VD(o);} 224 tooltip {1st imaginary (i) part of p1.} xywh {290 56 95 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 225 } 226 Fl_Value_Input p_j { 227 label {value:} 228 callback {MP->p(paramscroll->value()-1, 2, VD(o)); 229frac.p[paramscroll->value()-1][2] = VD(o);} 230 tooltip {2nd imaginary (j) part of p1.} xywh {290 76 95 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 231 } 232 Fl_Value_Input p_k { 233 label {value:} 234 callback {MP->p(paramscroll->value()-1, 3, VD(o)); 235frac.p[paramscroll->value()-1][3] = VD(o);} 236 tooltip {3rd imaginary (k) part of p1.} xywh {290 96 95 19} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 237 } 238 } 239 } 240 code {MP->SetInputs(cre, ci, redraw); 241end(); // VERY IMPORTANT! 242win->position(X+2, Y+2); 243// DON'T delete win in destructor (or elsewhere) 244// it's automatically deleted by Fl_Group} {} 245 } 246 Function {set(const frac_cpp& f)} {return_type void 247 } { 248 code {frac = f; 249maxiter->value(f.maxiter); maxiter->do_callback(); 250lvalue->value(f.lvalue); lvalue->do_callback(); 251bailout->value(f.bailout); bailout->do_callback(); 252formula->value(f.formula); formula->do_callback(); // Also calls formula_changed() 253cre->value(f.c[0]); cre->do_callback(); 254ci->value(f.c[1]); ci->do_callback(); 255cj->value(f.c[2]); cj->do_callback(); 256ck->value(f.c[3]); ck->do_callback(); 257for (int j=0; j<4; j++) for (int i=0; i<4; i++) MP->p(j, i, f.p[j][i]); 258MP->CalcImage(); MP->CheckUpdate();} {} 259 } 260 Function {get(frac_cpp& f)} {return_type void 261 } { 262 code {f = frac; 263return;} {} 264 } 265 Function {formula_changed()} {return_type void 266 } { 267 code {int pno = 0; 268switch (frac.formula) { 269 case 4: pno = 1; break; 270 default: pno = 0; break; 271} 272 273if (pno == 0) { 274 paramgroup->hide(); 275 paramgroup2->hide(); 276} 277else { 278 paramgroup->show(); 279 paramgroup2->show(); 280} 281 282paramscroll->scrollvalue(1,1,1,pno); 283if (pno != 0) paramscroll_changed();} {} 284 } 285 Function {paramscroll_changed()} {return_type void 286 } { 287 code {int i = paramscroll->value(); 288p_re->value(frac.p[i-1][0]); 289p_i->value(frac.p[i-1][1]); 290p_j->value(frac.p[i-1][2]); 291p_k->value(frac.p[i-1][3]);} {} 292 } 293 decl {frac_cpp frac;} {} 294 Function {deactiv()} {return_type void 295 } { 296 code {maxiter->deactivate(); 297lvalue->deactivate(); 298bailout->deactivate(); 299formula->deactivate(); 300cre->deactivate(); 301ci->deactivate(); 302cj->deactivate(); 303ck->deactivate(); 304MP->deactivate(); 305paramgroup2->deactivate();} {} 306 } 307} 308