# data file for the Fltk User Interface Designer (fluid) version 1.0100 header_name {.h} code_name {.cxx} gridx 5 gridy 5 snap 3 decl {// Quat - A 3D fractal generation program // Copyright (C) 1997-2000 Dirk Meyer // (email: dirk.meyer@studserv.uni-stuttgart.de) // mail: Dirk Meyer // Marbacher Weg 29 // D-71334 Waiblingen // Germany // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.} {} declblock {\#ifdef HAVE_CONFIG_H} {after {\#endif} } { decl {\#include } {} } decl {\#include "ChildWindow.h"} {} decl {class ChildWindow;} {public } decl {\#include "structs.h"} {public } class IntersecEditor {open : {public Fl_Group} } { Function {IntersecEditor(int X, int Y, int W, int H, const char *label) : Fl_Group(X,Y,W,H,label), num(0), idx(0), _disabled(false)} {open } { Fl_Window win {open xywh {384 373 416 216} class ChildWindow noborder visible } { Fl_Scrollbar scroll { label {Plane to edit} callback {setno(o->value());} tooltip {Select the intersection plane to edit.} xywh {10 20 20 150} labelsize 12 align 5 code1 {scroll->linesize(1); scroll->value(0, 1, 0, 0);} } Fl_Group qspacebox { label {QSpace coordinates} tooltip {All parameters in this box are measured in QSpace coordinates.} xywh {120 5 270 115} box EMBOSSED_BOX labelsize 12 align 21 } {} Fl_Group n {open tooltip {Normal vector = stands perpendicular on the intersection plane.} xywh {130 25 110 75} labeltype NO_LABEL } { Fl_Value_Input nre { label {Normal Vector} callback {cutbuf[7*idx+1] = o->value(); checkValidity();} tooltip {Real part.} xywh {130 40 110 20} labelsize 12 align 5 minimum -1e+20 maximum 1e+20 textsize 12 } Fl_Value_Input ni { label {value:} callback {cutbuf[7*idx+2] = o->value(); checkValidity();} tooltip {1st imaginary (i) part.} xywh {130 60 110 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 } Fl_Value_Input nj { label {value:} callback {cutbuf[7*idx+3] = o->value(); checkValidity();} tooltip {2nd imaginary (j) part.} xywh {130 80 110 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 } } Fl_Group p { tooltip {Any point that lies on the desired plane.} xywh {270 25 110 75} labeltype NO_LABEL } { Fl_Value_Input pre { label {Point to fix plane} callback {cutbuf[7*idx+4] = o->value();} tooltip {Real part.} xywh {270 40 110 20} labelsize 12 align 5 minimum -1e+20 maximum 1e+20 textsize 12 } Fl_Value_Input pi { label {value:} callback {cutbuf[7*idx+5] = o->value();} tooltip {1st imaginary (i) part.} xywh {270 60 110 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 } Fl_Value_Input pj { label {value:} callback {cutbuf[7*idx+6] = o->value();} tooltip {2nd imaginary (j) part.} xywh {270 80 110 20} labeltype NO_LABEL labelsize 12 minimum -1e+20 maximum 1e+20 textsize 12 } } Fl_Button add { label Add callback {cutbuf.add(); num = cutbuf.getnum(); scroll->value(num-1, 1, 0, num); setno(num-1);} tooltip {Add a new intersection plane.} xywh {50 60 60 20} labelsize 12 } Fl_Button del { label Delete callback {cutbuf.del(idx); num = cutbuf.getnum(); if (idx>=num && idx != 0) idx = num-1; scroll->value(idx, 1, 0, num); setno(idx);} tooltip {Delete the current plane.} xywh {50 80 60 20} labelsize 12 } Fl_Box note { label {The Normal Vector points to half-space in which the object will disappear.} xywh {130 130 230 50} labelsize 12 align 20 } Fl_Value_Output planeno { xywh {50 20 30 20} labeltype NO_LABEL } } code {end(); // VERY IMPORTANT! win->position(X+2, Y+2); // DON'T delete win in destructor (or elsewhere) // it's automatically deleted by Fl_Group} {} } decl {cutbuf_cpp cutbuf;} {} Function {set(const cutbuf_cpp& buf)} {return_type void } { code {cutbuf = buf; num = cutbuf.getnum(); idx = 0; scroll->value(0, 1, 0, num); setno(0); checkValidity();} {} } Function {get(cutbuf_cpp& buf)} {return_type void } { code {buf = cutbuf;} {} } Function {setno(int no)} {return_type void } { code {if (no < num || num == 0) { nre->value(cutbuf[no*7+1]); ni->value(cutbuf[no*7+2]); nj->value(cutbuf[no*7+3]); pre->value(cutbuf[no*7+4]); pi->value(cutbuf[no*7+5]); pj->value(cutbuf[no*7+6]); // scroll->value(no, 1, 0, num-1); planeno->value(no+1); idx = no; // if (scroll->value() != idx) scroll->value(no, 1, 0, num-1); checkValidity(); }} {} } Function {checkValidity()} {open return_type void } { code {const Fl_Color okc = FL_WHITE; const Fl_Color ndefc = FL_RED; Fl_Color nre_c = okc, ni_c = okc, nj_c = okc; if (nre->value() == 0.0 && ni->value() == 0.0 && nj->value() == 0.0) { nre_c = ndefc; ni_c = ndefc; nj_c = ndefc; } if (nre->color() != nre_c) { nre->color(nre_c); nre->redraw(); } if (ni->color() != ni_c) { ni->color(ni_c); ni->redraw(); } if (nj->color() != nj_c) { nj->color(nj_c); nj->redraw(); } if (num == 0 && scroll->active()) { qspacebox->hide(); n->hide(); p->hide(); note->hide(); planeno->hide(); scroll->deactivate(); del->deactivate(); } if (num != 0 && !scroll->active()) { qspacebox->show(); n->show(); p->show(); note->show(); planeno->show(); scroll->activate(); } if (num == 20 && add->active()) add->deactivate(); if (num != 20 && !add->active() && !_disabled) add->activate(); if (num == 0 && del->active()) del->deactivate(); if (num != 0 && !del->active() && !_disabled) del->activate(); return;} {selected } } decl {int num, idx;} {} Function {deactiv()} {return_type void } { code {n->deactivate(); p->deactivate(); add->deactivate(); del->deactivate(); _disabled = true;} {} } decl {bool _disabled;} {} }