Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

open-axiom repository from github

24005 views
1
/*
2
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
3
All rights reserved.
4
Copyright (C) 2007-2010, Gabriel Dos Reis.
5
All rights reserved.
6
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are
9
met:
10
11
- Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
14
- Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in
16
the documentation and/or other materials provided with the
17
distribution.
18
19
- Neither the name of The Numerical Algorithms Group Ltd. nor the
20
names of its contributors may be used to endorse or promote products
21
derived from this software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
27
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
#define _LIGHTING3D_C
37
#include "openaxiom-c-macros.h"
38
39
#include <math.h>
40
#include <string.h>
41
42
#include "light11.bitmap"
43
#include "light11.mask"
44
45
46
#include "header.h"
47
#include "static.h"
48
#include "draw.h"
49
#include "cpanel.h"
50
#include "volume.h"
51
52
#include "Gfun.H1"
53
#include "XSpadFill.h"
54
#include "all_3d.H1"
55
56
#define lightMASK ExposureMask
57
#define lightCursorForeground lightingTitleColor
58
#define lightCursorBackground foregroundColor
59
60
#define lightFontHeight (lightingFont->max_bounds.ascent+lightingFont->max_bounds.descent)
61
62
#define lightingAxesColor monoColor(52)
63
#define lightingLabelColor monoColor(12)
64
#define lightingBoxColor monoColor(138)
65
#define lightingLightColor monoColor(7)
66
#define lightingTitleColor monoColor(69)
67
#define lightingButtonColor monoColor(140)
68
#define lightingTransColor monoColor(140)
69
#define lightingTransArrowColor monoColor(100)
70
#define lightingTransLabelColor monoColor(207)
71
72
#define lightingAxesSize 175
73
#define lightingAxesX 61
74
#define lightingAxesY 28
75
76
#define lightAxesScale 110 /* the extent of the axes in object space */
77
#define lightScale 0.63 /* projected scale factor */
78
79
#define arrowHead (control->buttonQueue[lightTranslucent].buttonX + 5)
80
static viewTriple point0 = {0,0,0};
81
82
83
/***************************
84
* int makeLightingPanel() *
85
***************************/
86
87
int
88
makeLightingPanel(void)
89
{
90
91
int i;
92
XSetWindowAttributes cwAttrib, controlAttrib;
93
XSizeHints sizehint;
94
Pixmap lightbits,lightmask;
95
XColor foreColor, backColor;
96
97
lightbits = XCreateBitmapFromData(dsply,rtWindow,
98
(const char*) lightBitmap_bits,
99
lightBitmap_width,lightBitmap_height);
100
lightmask = XCreateBitmapFromData(dsply,rtWindow,
101
(const char*) lightMask_bits,
102
lightMask_width,lightMask_height);
103
cwAttrib.background_pixel = backgroundColor;
104
cwAttrib.border_pixel = foregroundColor;
105
cwAttrib.event_mask = lightMASK;
106
cwAttrib.colormap = colorMap;
107
cwAttrib.override_redirect = overrideManager;
108
foreColor.pixel = lightCursorForeground;
109
XQueryColor(dsply,colorMap,&foreColor);
110
backColor.pixel = lightCursorBackground;
111
XQueryColor(dsply,colorMap,&backColor);
112
cwAttrib.cursor = XCreatePixmapCursor(dsply,lightbits,lightmask,
113
&foreColor,&backColor,
114
lightBitmap_x_hot,lightBitmap_y_hot);
115
lightingWindow = XCreateWindow(dsply,control->controlWindow,
116
-3,-3,controlWidth,controlHeight,3,
117
CopyFromParent,InputOutput,CopyFromParent,
118
controlCreateMASK,&cwAttrib);
119
120
sizehint.flags = USPosition | USSize;
121
sizehint.x = 0;
122
sizehint.y = 0;
123
sizehint.width = controlWidth;
124
sizehint.height = controlHeight;
125
/*** the None stands for icon pixmap. ***/
126
XSetNormalHints(dsply,lightingWindow,&sizehint);
127
XSetStandardProperties(dsply,lightingWindow,"Lighting Panel 3D",
128
"Lighting Panel",None,NULL,0,&sizehint);
129
130
/*** lighting axes window ***/
131
cwAttrib.event_mask = 0;
132
lightingAxes = XCreateWindow(dsply,lightingWindow,
133
lightingAxesX,lightingAxesY,
134
lightingAxesSize,lightingAxesSize,
135
0,CopyFromParent,InputOutput,CopyFromParent,
136
controlCreateMASK,&cwAttrib);
137
138
sizehint.flags = USPosition | USSize;
139
sizehint.x = lightingAxesX;
140
sizehint.y = lightingAxesY;
141
sizehint.width = lightingAxesSize;
142
sizehint.height = lightingAxesSize;
143
/*** the None stands for icon pixmap ***/
144
XSetNormalHints(dsply,lightingAxes,&sizehint);
145
XSetStandardProperties(dsply,lightingAxes,"Lighting Axes","Lighting Axes",
146
None,NULL,0,&sizehint);
147
XMapWindow(dsply,lightingAxes);
148
149
/*** draw lighting buttons ***/
150
initLightButtons(control->buttonQueue);
151
/*
152
controlAttrib.event_mask = (control->buttonQueue[lightingButtonsStart]).mask;
153
(control->buttonQueue[lightingButtonsStart]).self =
154
XCreateWindow(dsply, lightingWindow,
155
(control->buttonQueue[lightingButtonsStart]).buttonX,
156
(control->buttonQueue[lightingButtonsStart]).buttonY,
157
(control->buttonQueue[lightingButtonsStart]).buttonWidth,
158
(control->buttonQueue[lightingButtonsStart]).buttonHeight,
159
0,0,InputOnly,CopyFromParent,
160
buttonCreateMASK,&controlAttrib);
161
XMakeAssoc(dsply,table,(control->buttonQueue[lightingButtonsStart]).self,
162
&((control->buttonQueue[lightingButtonsStart]).buttonKey));
163
XMapWindow(dsply,(control->buttonQueue[lightingButtonsStart]).self);
164
*/
165
for (i=(lightingButtonsStart + 1); i<(lightingButtonsEnd); i++) {
166
controlAttrib.event_mask = (control->buttonQueue[i]).mask;
167
(control->buttonQueue[i]).self =
168
XCreateWindow(dsply,lightingWindow,
169
(control->buttonQueue[i]).buttonX,
170
(control->buttonQueue[i]).buttonY,
171
(control->buttonQueue[i]).buttonWidth,
172
(control->buttonQueue[i]).buttonHeight,
173
0,0,InputOnly,CopyFromParent,
174
buttonCreateMASK,&controlAttrib);
175
XMakeAssoc(dsply,table,(control->buttonQueue[i]).self,
176
&((control->buttonQueue[i]).buttonKey));
177
XMapWindow(dsply,(control->buttonQueue[i]).self);
178
}
179
180
/* assign global direction variables for light projections */
181
sinTheta = sin(-viewport->theta);
182
cosTheta = cos(-viewport->theta);
183
sinPhi = sin(viewport->phi);
184
cosPhi = cos(viewport->phi);
185
186
return(0);
187
188
} /* makeLightingPanel() */
189
190
/***************************
191
* void drawLightingAxes() *
192
***************************/
193
194
void
195
drawLightingAxes(void)
196
{
197
198
XWindowAttributes laInfo;
199
int i,xCenter,yCenter;
200
float Px0,Py0;
201
int vPx0,vPy0,vPx1,vPy1;
202
viewTriple pointX,pointY,pointXY,pointXYZ;
203
204
XGetWindowAttributes(dsply,lightingAxes,&laInfo);
205
XClearWindow(dsply,lightingAxes);
206
xCenter = laInfo.width / 2;
207
yCenter = laInfo.height / 2;
208
209
sinTheta = sin(-viewport->theta);
210
cosTheta = cos(-viewport->theta);
211
sinPhi = sin(viewport->phi);
212
cosPhi = cos(viewport->phi);
213
214
GSetForeground(lightingGC,(float)monoColor(buttonColor),Xoption);
215
for (i=0; i < 3; i++) {
216
Px0 = proj2PX(axes[i][0],axes[i][1]);
217
Py0 = proj2PY(axes[i][0],axes[i][1],axes[i][2]);
218
vPx0 = Px0 * lightScale + xCenter;
219
vPy0 = laInfo.height - (Py0 * lightScale + yCenter);
220
Px0 = proj2PX(axes[i][3],axes[i][4]);
221
Py0 = proj2PY(axes[i][3],axes[i][4],axes[i][5]);
222
vPx1 = Px0 * lightScale + xCenter;
223
vPy1 = laInfo.height - (Py0 * lightScale + yCenter);
224
GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption);
225
}
226
227
GSetForeground(lightingGC,(float)lightingLabelColor,Xoption);
228
for (i=0; i < basicScreen; i++) {
229
Px0 = proj2PX(labels[i][0],labels[i][1]);
230
Py0 = proj2PY(labels[i][0],labels[i][1],labels[i][2]);
231
vPx0 = Px0 * lightScale + xCenter;
232
vPy0 = laInfo.height - (Py0 * lightScale + yCenter);
233
Px0 = proj2PX(labels[i][3],labels[i][4]);
234
Py0 = proj2PY(labels[i][3],labels[i][4],labels[i][5]);
235
vPx1 = Px0 * lightScale + xCenter;
236
vPy1 = laInfo.height - (Py0 * lightScale + yCenter);
237
GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption);
238
}
239
240
GSetForeground(lightingGC,(float)lightingBoxColor,Xoption);
241
pointX.x = tempLightPointer[0] * lightAxesScale;
242
pointX.y = 0;
243
pointX.z = 0;
244
245
pointY.x = 0;
246
pointY.y = tempLightPointer[1] * lightAxesScale;
247
pointY.z = 0;
248
249
pointXY.x = tempLightPointer[0] * lightAxesScale;
250
pointXY.y = tempLightPointer[1] * lightAxesScale;
251
pointXY.z = 0;
252
253
pointXYZ.x = tempLightPointer[0] * lightAxesScale;
254
pointXYZ.y = tempLightPointer[1] * lightAxesScale;
255
pointXYZ.z = tempLightPointer[2] * lightAxesScale;
256
257
Px0 = proj2PX(pointXY.x,pointXY.y);
258
Py0 = proj2PY(pointXY.x,pointXY.y,pointXY.z);
259
vPx0 = Px0 * lightScale + xCenter;
260
vPy0 = laInfo.height - (Py0 * lightScale + yCenter);
261
262
Px0 = proj2PX(pointX.x,pointX.y);
263
Py0 = proj2PY(pointX.x,pointX.y,pointX.z);
264
vPx1 = Px0 * lightScale + xCenter;
265
vPy1 = laInfo.height - (Py0 * lightScale + yCenter);
266
GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption);
267
268
Px0 = proj2PX(pointY.x,pointY.y);
269
Py0 = proj2PY(pointY.x,pointY.y,pointY.z);
270
vPx1 = Px0 * lightScale + xCenter;
271
vPy1 = laInfo.height - (Py0 * lightScale + yCenter);
272
GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption);
273
274
Px0 = proj2PX(pointXYZ.x,pointXYZ.y);
275
Py0 = proj2PY(pointXYZ.x,pointXYZ.y,pointXYZ.z);
276
vPx1 = Px0 * lightScale + xCenter;
277
vPy1 = laInfo.height - (Py0 * lightScale + yCenter);
278
GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption);
279
280
GSetForeground(lightingGC,(float)lightingLightColor,Xoption);
281
Px0 = proj2PX(point0.x,point0.y);
282
Py0 = proj2PY(point0.x,point0.y,point0.z);
283
vPx0 = Px0 * lightScale + xCenter;
284
vPy0 = laInfo.height - (Py0 * lightScale + yCenter);
285
GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption);
286
287
} /* drawLightingAxes */
288
289
290
/******************************
291
* void drawLightTransArrow() *
292
******************************/
293
294
void
295
drawLightTransArrow(void)
296
{
297
298
int i;
299
float f;
300
301
/*** Draw the intensity potentiometer window. ***/
302
XClearArea(dsply,lightingWindow,
303
(control->buttonQueue[lightTranslucent]).buttonX,
304
(control->buttonQueue[lightTranslucent]).buttonY-5,
305
(control->buttonQueue[lightTranslucent]).buttonWidth,
306
(control->buttonQueue[lightTranslucent]).buttonHeight+10,
307
False);
308
GDrawLine(controlMessageGC,lightingWindow,
309
(control->buttonQueue[lightTranslucent]).buttonX,
310
(control->buttonQueue[lightTranslucent]).buttonY,
311
(control->buttonQueue[lightTranslucent]).buttonX,
312
(control->buttonQueue[lightTranslucent]).buttonY +
313
(control->buttonQueue[lightTranslucent]).buttonHeight,Xoption);
314
GDrawLine(controlMessageGC,lightingWindow,
315
(control->buttonQueue[lightTranslucent]).buttonX + 1,
316
(control->buttonQueue[lightTranslucent]).buttonY,
317
(control->buttonQueue[lightTranslucent]).buttonX +
318
(control->buttonQueue[lightTranslucent]).buttonWidth * 3/10,
319
(control->buttonQueue[lightTranslucent]).buttonY,Xoption);
320
GDrawLine(controlMessageGC,lightingWindow,
321
(control->buttonQueue[lightTranslucent]).buttonX + 1,
322
(control->buttonQueue[lightTranslucent]).buttonY +
323
(control->buttonQueue[lightTranslucent]).yHalf/2,
324
(control->buttonQueue[lightTranslucent]).buttonX +
325
(control->buttonQueue[lightTranslucent]).buttonWidth * 2/10,
326
(control->buttonQueue[lightTranslucent]).buttonY +
327
(control->buttonQueue[lightTranslucent]).yHalf/2,Xoption);
328
GDrawLine(controlMessageGC,lightingWindow,
329
(control->buttonQueue[lightTranslucent]).buttonX + 1,
330
(control->buttonQueue[lightTranslucent]).buttonY +
331
(control->buttonQueue[lightTranslucent]).yHalf,
332
(control->buttonQueue[lightTranslucent]).buttonX +
333
(control->buttonQueue[lightTranslucent]).buttonWidth * 3/10,
334
(control->buttonQueue[lightTranslucent]).buttonY +
335
(control->buttonQueue[lightTranslucent]).yHalf,Xoption);
336
GDrawLine(controlMessageGC,lightingWindow,
337
(control->buttonQueue[lightTranslucent]).buttonX + 1,
338
(control->buttonQueue[lightTranslucent]).buttonY +
339
(control->buttonQueue[lightTranslucent]).buttonHeight*3/4,
340
(control->buttonQueue[lightTranslucent]).buttonX +
341
(control->buttonQueue[lightTranslucent]).buttonWidth * 2/10,
342
(control->buttonQueue[lightTranslucent]).buttonY +
343
(control->buttonQueue[lightTranslucent]).buttonHeight*3/4,Xoption);
344
GDrawLine(controlMessageGC,lightingWindow,
345
(control->buttonQueue[lightTranslucent]).buttonX + 1,
346
(control->buttonQueue[lightTranslucent]).buttonY +
347
(control->buttonQueue[lightTranslucent]).buttonHeight,
348
(control->buttonQueue[lightTranslucent]).buttonX +
349
(control->buttonQueue[lightTranslucent]).buttonWidth * 3/10,
350
(control->buttonQueue[lightTranslucent]).buttonY +
351
(control->buttonQueue[lightTranslucent]).buttonHeight,Xoption);
352
353
/*** Draw the intensity selection arrow ***/
354
GSetForeground(lightingGC,(float)lightingTransArrowColor,Xoption);
355
356
f = (control->buttonQueue[lightTranslucent].buttonY +
357
control->buttonQueue[lightTranslucent].buttonHeight) -
358
(tempLightIntensity *
359
control->buttonQueue[lightTranslucent].buttonHeight);
360
i = f;
361
GDrawLine(lightingGC, lightingWindow, arrowHead + 10, i,
362
arrowHead + 22, i + 2, Xoption);
363
GDrawLine(lightingGC, lightingWindow, arrowHead + 22, i + 2,
364
arrowHead + 22, i - 2, Xoption);
365
GDrawLine(lightingGC, lightingWindow, arrowHead + 22, i - 2,
366
arrowHead + 10, i, Xoption);
367
368
} /* drawLightTransArrow() */
369
370
371
372
373
374
/****************************
375
* void drawLightingPanel() *
376
****************************/
377
378
void
379
drawLightingPanel(void)
380
{
381
382
const char* s;
383
int i,strlength;
384
385
/* Draw border lines to separate the lighting window, potentiometers,
386
and button regions of the lightng subpanel. */
387
GSetForeground(trashGC,(float)foregroundColor,Xoption);
388
GSetLineAttributes(trashGC,3,LineSolid,CapButt,JoinMiter,Xoption);
389
GDrawLine(trashGC, lightingWindow, 0, potA, controlWidth, potA, Xoption);
390
391
GSetLineAttributes(trashGC,2,LineSolid,CapButt,JoinMiter,Xoption);
392
GDrawLine(trashGC, lightingWindow, 0, lightB, controlWidth, lightB, Xoption);
393
GDrawLine(trashGC, lightingWindow, 0, lightPotA, controlWidth,
394
lightPotA, Xoption);
395
GDrawLine(trashGC, lightingWindow, 0, lightPotB, controlWidth,
396
lightPotB, Xoption);
397
GDrawLine(trashGC, lightingWindow, lightTransL, lightPotA,
398
lightTransL, lightPotB, Xoption);
399
400
writeControlTitle(lightingWindow);
401
s = "Lighting Control Panel";
402
strlength = strlen(s);
403
GSetForeground(anotherGC,(float)lightingTitleColor,Xoption);
404
GDrawString(anotherGC, lightingWindow,
405
centerX(anotherGC, s, strlength, controlWidth),
406
lightB+18, s, strlength, Xoption);
407
408
for (i=lightingButtonsStart; i<(lightingButtonsEnd); i++) {
409
switch (i) {
410
case lightMove:
411
GSetForeground(lightingGC,(float)lightingButtonColor,Xoption);
412
GDraw3DButtonOut(lightingGC,lightingWindow,
413
(control->buttonQueue[i]).buttonX,
414
(control->buttonQueue[i]).buttonY,
415
(control->buttonQueue[i]).buttonWidth,
416
(control->buttonQueue[i]).buttonHeight,Xoption);
417
GSetForeground(lightingGC,(float)monoColor(buttonColor),Xoption);
418
GDrawLine(lightingGC,lightingWindow,
419
(control->buttonQueue[i]).buttonX +
420
(control->buttonQueue[i]).xHalf,
421
(control->buttonQueue[i]).buttonY,
422
(control->buttonQueue[i]).buttonX +
423
(control->buttonQueue[i]).xHalf,
424
(control->buttonQueue[i]).buttonY +
425
2*(control->buttonQueue[i]).yHalf,Xoption);
426
GDrawLine(lightingGC,lightingWindow,
427
(control->buttonQueue[i]).buttonX,
428
(control->buttonQueue[i]).buttonY +
429
(control->buttonQueue[i]).yHalf,
430
(control->buttonQueue[i]).buttonX +
431
2*(control->buttonQueue[i]).xHalf,
432
(control->buttonQueue[i]).buttonY +
433
(control->buttonQueue[i]).yHalf,Xoption);
434
break;
435
case lightMoveXY:
436
GSetForeground(lightingGC,(float)lightingButtonColor,Xoption);
437
GDraw3DButtonOut(lightingGC,lightingWindow,
438
(control->buttonQueue[i]).buttonX,
439
(control->buttonQueue[i]).buttonY,
440
(control->buttonQueue[i]).buttonWidth,
441
(control->buttonQueue[i]).buttonHeight,Xoption);
442
GSetForeground(lightingGC,(float)monoColor(buttonColor),Xoption);
443
GDrawLine(lightingGC,lightingWindow,
444
(control->buttonQueue[i]).buttonX +
445
(control->buttonQueue[i]).xHalf,
446
(control->buttonQueue[i]).buttonY,
447
(control->buttonQueue[i]).buttonX +
448
(control->buttonQueue[i]).xHalf,
449
(control->buttonQueue[i]).buttonY +
450
2*(control->buttonQueue[i]).yHalf,Xoption);
451
GDrawLine(lightingGC,lightingWindow,
452
(control->buttonQueue[i]).buttonX,
453
(control->buttonQueue[i]).buttonY +
454
(control->buttonQueue[i]).yHalf,
455
(control->buttonQueue[i]).buttonX +
456
2*(control->buttonQueue[i]).xHalf,
457
(control->buttonQueue[i]).buttonY +
458
(control->buttonQueue[i]).yHalf,Xoption);
459
break;
460
case lightMoveZ:
461
GSetForeground(lightingGC,(float)lightingButtonColor,Xoption);
462
GDraw3DButtonOut(lightingGC,lightingWindow,
463
(control->buttonQueue[i]).buttonX,
464
(control->buttonQueue[i]).buttonY,
465
(control->buttonQueue[i]).buttonWidth,
466
(control->buttonQueue[i]).buttonHeight,Xoption);
467
GSetForeground(lightingGC,(float)monoColor(buttonColor),Xoption);
468
GDrawLine(lightingGC,lightingWindow,
469
(control->buttonQueue[i]).buttonX +
470
(control->buttonQueue[i]).xHalf,
471
(control->buttonQueue[i]).buttonY,
472
(control->buttonQueue[i]).buttonX +
473
(control->buttonQueue[i]).xHalf,
474
(control->buttonQueue[i]).buttonY +
475
2*(control->buttonQueue[i]).yHalf,Xoption);
476
GDrawLine(lightingGC,lightingWindow,
477
(control->buttonQueue[i]).buttonX +
478
(control->buttonQueue[i]).xHalf -
479
(control->buttonQueue[i]).xHalf/2,
480
(control->buttonQueue[i]).buttonY +
481
(control->buttonQueue[i]).yHalf,
482
(control->buttonQueue[i]).buttonX +
483
(control->buttonQueue[i]).xHalf +
484
(control->buttonQueue[i]).xHalf/2,
485
(control->buttonQueue[i]).buttonY +
486
(control->buttonQueue[i]).yHalf,Xoption);
487
break;
488
case lightTranslucent:
489
drawLightTransArrow();
490
break;
491
default:
492
GDraw3DButtonOut(lightingGC,lightingWindow,
493
(control->buttonQueue[i]).buttonX,
494
(control->buttonQueue[i]).buttonY,
495
(control->buttonQueue[i]).buttonWidth,
496
(control->buttonQueue[i]).buttonHeight,Xoption);
497
s = (control->buttonQueue[i]).text;
498
strlength = strlen(s);
499
GSetForeground(trashGC,
500
(float)monoColor((control->buttonQueue[i]).textColor),Xoption);
501
GDrawString(trashGC, lightingWindow,
502
(control->buttonQueue[i]).buttonX +
503
centerX(processGC,s,strlength,
504
(control->buttonQueue[i]).buttonWidth),
505
(control->buttonQueue[i]).buttonY +
506
centerY(processGC,(control->buttonQueue[i]).buttonHeight),
507
s,strlen(s),Xoption);
508
} /* switch */
509
} /* for i in control->buttonQueue */
510
511
GSetForeground(lightingGC,(float)monoColor(labelColor),Xoption);
512
GDrawString(lightingGC,lightingWindow,
513
control->buttonQueue[lightMoveXY].buttonX +
514
control->buttonQueue[lightMoveXY].buttonWidth + 3,
515
control->buttonQueue[lightMoveXY].buttonY +
516
control->buttonQueue[lightMoveXY].yHalf,
517
"x",1,Xoption);
518
GDrawString(lightingGC,lightingWindow,
519
control->buttonQueue[lightMoveXY].buttonX +
520
control->buttonQueue[lightMoveXY].xHalf - 2,
521
control->buttonQueue[lightMoveXY].buttonY - 4,
522
"y",1,Xoption);
523
GDrawString(lightingGC,lightingWindow,
524
control->buttonQueue[lightMoveZ].buttonX +
525
control->buttonQueue[lightMoveZ].xHalf - 2,
526
control->buttonQueue[lightMoveZ].buttonY - 4,
527
"z",1,Xoption);
528
529
/** Draw the title for the intensity potentiometer. */
530
GSetForeground(lightingGC,(float)lightingTransColor,Xoption);
531
532
GDrawString(lightingGC,lightingWindow,
533
control->buttonQueue[lightTranslucent].buttonX +
534
control->buttonQueue[lightTranslucent].buttonWidth + 3,
535
control->buttonQueue[lightTranslucent].buttonY,
536
"I",1,Xoption);
537
GDrawString(lightingGC,lightingWindow,
538
control->buttonQueue[lightTranslucent].buttonX +
539
control->buttonQueue[lightTranslucent].buttonWidth + 3,
540
control->buttonQueue[lightTranslucent].buttonY +
541
lightFontHeight,
542
"n",1,Xoption);
543
GDrawString(lightingGC,lightingWindow,
544
control->buttonQueue[lightTranslucent].buttonX +
545
control->buttonQueue[lightTranslucent].buttonWidth + 3,
546
control->buttonQueue[lightTranslucent].buttonY +
547
lightFontHeight*2,
548
"t",1,Xoption);
549
GDrawString(lightingGC,lightingWindow,
550
control->buttonQueue[lightTranslucent].buttonX +
551
control->buttonQueue[lightTranslucent].buttonWidth + 3,
552
control->buttonQueue[lightTranslucent].buttonY +
553
lightFontHeight*3,
554
"e",1,Xoption);
555
GDrawString(lightingGC,lightingWindow,
556
control->buttonQueue[lightTranslucent].buttonX +
557
control->buttonQueue[lightTranslucent].buttonWidth + 3,
558
control->buttonQueue[lightTranslucent].buttonY +
559
lightFontHeight*4,
560
"n",1,Xoption);
561
GDrawString(lightingGC,lightingWindow,
562
control->buttonQueue[lightTranslucent].buttonX +
563
control->buttonQueue[lightTranslucent].buttonWidth + 3,
564
control->buttonQueue[lightTranslucent].buttonY +
565
lightFontHeight*5,
566
"s",1,Xoption);
567
GDrawString(lightingGC,lightingWindow,
568
control->buttonQueue[lightTranslucent].buttonX +
569
control->buttonQueue[lightTranslucent].buttonWidth + 3,
570
control->buttonQueue[lightTranslucent].buttonY +
571
lightFontHeight*6,
572
"i",1,Xoption);
573
GDrawString(lightingGC,lightingWindow,
574
control->buttonQueue[lightTranslucent].buttonX +
575
control->buttonQueue[lightTranslucent].buttonWidth + 3,
576
control->buttonQueue[lightTranslucent].buttonY +
577
lightFontHeight*7,
578
"t",1,Xoption);
579
GDrawString(lightingGC,lightingWindow,
580
control->buttonQueue[lightTranslucent].buttonX +
581
control->buttonQueue[lightTranslucent].buttonWidth + 3,
582
control->buttonQueue[lightTranslucent].buttonY +
583
lightFontHeight*8,
584
"y",1,Xoption);
585
drawLightingAxes();
586
drawLightTransArrow();
587
588
} /* drawLightingPanel */
589
590
591
592
593
594
595