-
Notifications
You must be signed in to change notification settings - Fork 1
/
modelerui.fl
190 lines (181 loc) · 5.09 KB
/
modelerui.fl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# data file for the Fltk User Interface Designer (fluid)
version 1.00
header_name {.h}
code_name {.cxx}
gridx 5
gridy 5
snap 3
class ModelerUserInterface {open
} {
Function {ModelerUserInterface()} {open
} {
Fl_Window m_controlsWindow {
label {CS 341 Modeler (SP02)}
callback {0;;} open
xywh {558 295 395 326} when 0 resizable visible
} {
Fl_Menu_Bar m_controlsMenuBar {open
xywh {0 0 395 25}
} {
submenu {} {
label File open
xywh {0 0 100 20}
} {
menuitem {} {
label {Save Raytracer File}
callback {char *filename = NULL;
filename = fl_file_chooser("Save RAY File", "*.ray", NULL);
if (filename)
{
if (openRayFile(filename) == false)
fl_alert("Error opening file.");
else
{
m_modelerView->draw();
closeRayFile();
}
}} selected
xywh {0 0 100 20}
code0 {\#include "modelerview.h"}
code1 {\#include <FL/Fl_File_Chooser.H>}
code2 {\#include <FL/Fl_Message.H>}
}
menuitem {} {
label {Save Bitmap File}
callback {char *filename = NULL;
filename = fl_file_chooser("Save BMP File", "*.bmp", NULL);
if (filename)
{
int x = m_modelerView->x();
int y = m_modelerView->y();
int w = m_modelerView->w();
int h = m_modelerView->h();
m_modelerWindow->show();
// do {Sleep(10); }
// while (!m_modelerWindow->shown());
// m_modelerView->draw();
m_modelerView->make_current();
m_modelerView->draw();
unsigned char *imageBuffer = new unsigned char[3*w*h];
// Tell openGL to read from the front buffer when capturing
// out paint strokes
glReadBuffer(GL_BACK);
glPixelStorei( GL_PACK_ALIGNMENT, 1 );
glPixelStorei( GL_PACK_ROW_LENGTH, w );
glReadPixels( 0, 0, w, h,
GL_RGB, GL_UNSIGNED_BYTE,
imageBuffer );
writeBMP(filename, w,h, imageBuffer);
delete [] imageBuffer;
}}
xywh {10 10 100 20} divider
code0 {\#include "modelerview.h"}
code1 {\#include <FL/Fl_File_Chooser.H>}
code2 {\#include <FL/Fl_Message.H>}
code3 {\#include "bitmap.h"}
}
menuitem {} {
label Exit
callback {m_controlsWindow->hide();
m_modelerWindow->hide();}
xywh {10 10 100 20}
}
}
submenu {} {
label View open
xywh {0 0 100 20}
code0 {\#include "modelerdraw.h"}
} {
menuitem {} {
label Normal
callback {setDrawMode(NORMAL);
m_modelerView->redraw();}
xywh {0 0 100 20} type Radio value 1
}
menuitem {} {
label {Flat Shaded}
callback {setDrawMode(FLATSHADE);
m_modelerView->redraw();}
xywh {0 0 100 20} type Radio
}
menuitem {} {
label Wireframe
callback {setDrawMode(WIREFRAME);
m_modelerView->redraw();}
xywh {10 10 100 20} type Radio divider
}
menuitem {} {
label {High Quality}
callback {setQuality(HIGH);
m_modelerView->redraw();}
xywh {0 0 100 20} type Radio
}
menuitem {} {
label {Medium Quality}
callback {setQuality(MEDIUM);
m_modelerView->redraw();}
xywh {10 10 100 20} type Radio value 1
}
menuitem {} {
label {Low Quality}
callback {setQuality(LOW);
m_modelerView->redraw();}
xywh {20 20 100 20} type Radio
}
menuitem {} {
label {Poor Quality}
callback {setQuality(POOR);
m_modelerView->redraw();}
xywh {30 30 100 20} type Radio
}
}
submenu {} {
label Animate open
xywh {0 0 100 20}
} {
menuitem m_controlsAnimOnMenu {
label Enable
callback {ModelerApplication::Instance()->m_animating = (m_controlsAnimOnMenu->value() == 0) ? false : true;}
xywh {0 0 100 20} type Toggle
}
}
}
Fl_Browser m_controlsBrowser {
label Controls
callback {for (int i=0; i<ModelerApplication::Instance()->m_numControls; i++) {
if (m_controlsBrowser->selected(i+1))
ModelerApplication::Instance()->ShowControl(i);
else
ModelerApplication::Instance()->HideControl(i);
}}
xywh {0 25 140 300} type Multi textsize 10 resizable
}
Fl_Scroll m_controlsScroll {open
xywh {145 25 250 300} type VERTICAL_ALWAYS when 1
} {
Fl_Pack m_controlsPack {open
xywh {145 25 225 300}
code0 {\#include "modelerapp.h"}
} {}
}
}
Fl_Window m_modelerWindow {
label Model
callback {0;} open
xywh {481 95 340 296} when 0 hide resizable
} {
Fl_Box m_modelerView {
label ModelerView
xywh {0 0 340 295} resizable
code0 {\#include "modelerview.h"}
class ModelerView
}
}
}
Function {show()} {open
} {
code {m_controlsWindow->show();
m_modelerWindow->show();
m_modelerView->show();} {}
}
}