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 30decl {\#include <cassert>} {} 31 32decl {//\#include <cstring>} {} 33 34decl {\#include "ChildWindow.h"} {} 35 36decl {class ChildWindow;} {public 37} 38 39decl {\#include "ViewSelector.h"} {} 40 41decl {class ViewSelector;} {public 42} 43 44decl {\#include "common.h"} {public 45} 46 47class OtherEditor {open : {public Fl_Group} 48} { 49 Function {OtherEditor(int X, int Y, int W, int H, const char *label) : Fl_Group(X,Y,W,H,label)} {open 50 } { 51 Fl_Window win {open 52 xywh {318 319 416 216} 53 class ChildWindow noborder visible 54 } { 55 Fl_Box {} { 56 label {Image Resolution} 57 xywh {10 5 330 70} box ENGRAVED_FRAME labelsize 12 align 21 58 } 59 Fl_Group group_res { 60 xywh {10 5 330 70} 61 } { 62 Fl_Value_Input xres { 63 label {X Resolution} 64 callback {view.xres = static_cast<int>(o->value()); 65for (int i=0; i<3; i++) vs[i]->xres(view.xres); 66checkValidity();} 67 tooltip {Horizontal size of the image.} xywh {20 40 90 20} labelsize 12 align 5 minimum 1 maximum 32767 step 1 textsize 12 68 } 69 Fl_Value_Input yres { 70 label {Y Resolution} 71 callback {view.yres = static_cast<int>(o->value()); 72for (int i=0; i<3; i++) vs[i]->yres(view.yres); 73checkValidity();} 74 tooltip {Vertical size of the image.} xywh {130 40 90 20} labelsize 12 align 5 minimum 1 maximum 32767 step 1 textsize 12 75 } 76 Fl_Value_Input zres { 77 label {Z Resolution} 78 callback {view.zres = static_cast<int>(o->value()); 79checkValidity();} 80 tooltip {Describes how exact the object is scanned.} xywh {240 40 90 20} labelsize 12 align 5 minimum 1 maximum 32767 step 1 textsize 12 81 } 82 } 83 Fl_Box {} { 84 label {Phong Highlight} 85 xywh {10 85 240 70} box ENGRAVED_FRAME labelsize 12 align 21 86 } 87 Fl_Value_Input phongmax { 88 label {max.} 89 callback {view.phongmax = o->value(); 90checkValidity();} 91 tooltip {Maximum brightness of the highlight.} xywh {20 125 100 20} labelsize 12 align 5 textsize 12 92 } 93 Fl_Value_Input phongsharp { 94 label sharp 95 callback {view.phongsharp = o->value(); 96checkValidity();} selected 97 tooltip {Describes how fast the highlight will fade into usual light.} xywh {140 125 100 20} labelsize 12 align 5 maximum 1e+20 textsize 12 98 } 99 Fl_Value_Input ambient { 100 label {Ambient Light} 101 callback {view.ambient = o->value(); 102checkValidity();} 103 tooltip {The brightness that is even in shadowed parts of the object.} xywh {20 180 100 20} labelsize 12 align 5 maximum 1e+20 textsize 12 104 } 105 Fl_Value_Input antialiasing { 106 label Antialiasing 107 callback {view.antialiasing = static_cast<int>(o->value()); 108checkValidity();} 109 tooltip {Subdivide pixels n*n times. Higher values result in smoother 110images and longer calculation time.} xywh {140 180 90 20} labelsize 12 align 5 minimum 1 maximum 5 step 1 value 1 textsize 12 111 } 112 Fl_Box {} { 113 label {Resolution shortcuts} 114 xywh {280 85 120 20} labelsize 12 align 21 115 } 116 Fl_Group group_buttons { 117 tooltip {Clicking on one of those buttons will set a predefined resolution.} xywh {280 85 110 115} 118 } { 119 Fl_Button res1 { 120 label {DIN A4 (100 dpi)} 121 callback {xres->value(1170); yres->value(828); 122xres->do_callback(); yres->do_callback();} 123 tooltip {A whole sheet of paper printed in 100 dpi.} xywh {280 100 110 20} labelsize 12 124 } 125 Fl_Button res1b { 126 label {DIN A4 (300 dpi)} 127 callback {xres->value(3511); yres->value(2483); 128xres->do_callback(); yres->do_callback();} 129 tooltip {A whole sheet of paper printed in 300 dpi.} xywh {280 120 110 20} labelsize 12 130 } 131 Fl_Button res2 { 132 label 160x120x120 133 callback {xres->value(160); yres->value(120); zres->value(120); 134xres->do_callback(); yres->do_callback(); zres->do_callback();} 135 tooltip {A small image for testing.} xywh {280 140 110 20} labelsize 12 136 } 137 Fl_Button res3 { 138 label 320x240x240 139 callback {xres->value(320); yres->value(240); zres->value(240); 140xres->do_callback(); yres->do_callback(); zres->do_callback();} 141 tooltip {Medium sized image.} xywh {280 160 110 20} labelsize 12 142 } 143 Fl_Button res4 { 144 label 640x480x480 145 callback {xres->value(640); yres->value(480); zres->value(480); 146xres->do_callback(); yres->do_callback(); zres->do_callback();} 147 tooltip {Common resolution.} xywh {280 180 110 20} labelsize 12 148 } 149 } 150 } 151 code {//memset(&view, 0, sizeof(view)); 152end(); // VERY IMPORTANT! 153win->position(X+2, Y+2); 154// DON'T delete win in destructor (or elsewhere) 155// it's automatically deleted by Fl_Group} {} 156 } 157 Function {setSelectors(ViewSelector *vsa, ViewSelector *vsb, ViewSelector *vsf)} {return_type void 158 } { 159 code {vs[0] = vsa; vs[1] = vsb; vs[2] = vsf;} {} 160 } 161 Function {set(const view_struct& v)} {return_type void 162 } { 163 code {for (int i=0; i<3; i++) assert(vs[i] != 0); 164view = v; 165xres->value(v.xres); yres->value(v.yres); zres->value(v.zres); 166phongmax->value(v.phongmax); phongsharp->value(v.phongsharp); 167ambient->value(v.ambient); antialiasing->value(v.antialiasing); 168 169// Callbacks & checkValidity 170xres->do_callback(); 171yres->do_callback(); 172 173return;} {} 174 } 175 Function {get(view_struct& v)} {return_type void 176 } { 177 code {// Don't do v=view, because there are other members 178// which aren't in the ViewEditor 179 180v.xres = static_cast<int>(view.xres); 181v.yres = static_cast<int>(view.yres); 182v.zres = static_cast<int>(view.zres); 183v.phongmax = view.phongmax; v.phongsharp = view.phongsharp; 184v.ambient = view.ambient; 185v.antialiasing = static_cast<int>(view.antialiasing); 186 187return;} {} 188 } 189 Function {checkValidity()} {return_type void 190 } { 191 code {const Fl_Color okc = FL_WHITE; 192const Fl_Color ndefc = FL_RED; 193Fl_Color xres_c = okc, yres_c = okc, zres_c = okc, 194 pm_c = okc, ps_c = okc, amb_c = okc, ant_c = okc; 195 196if (view.xres < 1 || view.xres > 32767) xres_c = ndefc; 197if (view.yres < 1 || view.yres > 32767) yres_c = ndefc; 198if (view.zres < 1) zres_c = ndefc; 199 200if (view.phongmax < 0.0 || view.phongmax > 1.0) pm_c = ndefc; 201if (view.phongsharp < 0.0) ps_c = ndefc; 202 203if (view.ambient < 0.0 || view.ambient >1.0) amb_c = ndefc; 204if (view.antialiasing < 1 || view.antialiasing > 5) ant_c = ndefc; 205 206if (xres->color() != xres_c) { xres->color(xres_c); xres->redraw(); } 207if (yres->color() != yres_c) { yres->color(yres_c); yres->redraw(); } 208if (zres->color() != zres_c) { zres->color(zres_c); zres->redraw(); } 209if (phongmax->color() != pm_c) { phongmax->color(pm_c); phongmax->redraw(); } 210if (phongsharp->color() != ps_c) { phongsharp->color(ps_c); phongsharp->redraw(); } 211if (ambient->color() != amb_c) { ambient->color(amb_c); ambient->redraw(); } 212if (antialiasing->color() != ant_c) { antialiasing->color(ant_c); antialiasing->redraw(); } 213 214return;} {} 215 } 216 decl {view_struct view;} {} 217 decl {ViewSelector *vs[3];} {} 218} 219