27
27
#define DEFAULTS "*delay: 10000 \n" \
28
28
"*showFPS: False \n" \
29
29
"*wireframe: False \n" \
30
"*atomFont: -*-helvetica-medium-r-normal-*-240-*\n" \
30
"*atomFont: -*-helvetica-medium-r-normal-*-180-*\n" \
31
"*atomFont2: -*-helvetica-bold-r-normal-*-80-*\n" \
31
32
"*titleFont: -*-helvetica-medium-r-normal-*-180-*\n" \
32
33
"*noLabelThreshold: 30 \n" \
33
34
"*wireframeThreshold: 150 \n" \
65
66
#define DEF_MOLECULE "(default)"
66
67
#define DEF_VERBOSE "False"
68
#define SPHERE_SLICES 24 /* how densely to render spheres */
69
#define SPHERE_STACKS 12
69
#define SPHERE_SLICES 48 /* how densely to render spheres */
70
#define SPHERE_STACKS 24
71
72
#define SMOOTH_TUBE /* whether to have smooth or faceted tubes */
104
105
and their approximate size in angstroms.
106
107
static const atom_data all_atom_data[] = {
107
{ "H", 1.17, 0.40, "#FFFFFF", "#B3B3B3", { 0, }},
108
{ "H", 1.17, 0.40, "#FFFFFF", "#000000", { 0, }},
108
109
{ "C", 1.75, 0.58, "#999999", "#FFFFFF", { 0, }},
109
110
{ "CA", 1.80, 0.60, "#0000FF", "#ADD8E6", { 0, }},
110
{ "N", 1.55, 0.52, "#A2B5CD", "#836FFF", { 0, }},
111
{ "N", 1.55, 0.52, "#A2B5CD", "#EE99FF", { 0, }},
111
112
{ "O", 1.40, 0.47, "#FF0000", "#FFB6C1", { 0, }},
112
113
{ "P", 1.28, 0.43, "#9370DB", "#DB7093", { 0, }},
113
114
{ "S", 1.80, 0.60, "#8B8B00", "#FFFF00", { 0, }},
159
160
GLuint molecule_dlist;
160
161
GLuint shell_dlist;
162
XFontStruct *xfont1, *xfont2;
163
GLuint font1_dlist, font2_dlist;
163
XFontStruct *xfont1, *xfont2, *xfont3;
164
GLuint font1_dlist, font2_dlist, font3_dlist;
164
165
int polygon_count;
166
167
time_t draw_time;
259
260
molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
260
261
load_font (mi->dpy, "atomFont", &mc->xfont1, &mc->font1_dlist);
261
load_font (mi->dpy, "titleFont", &mc->xfont2, &mc->font2_dlist);
262
load_font (mi->dpy, "atomFont2", &mc->xfont2, &mc->font2_dlist);
263
load_font (mi->dpy, "titleFont", &mc->xfont3, &mc->font3_dlist);
334
336
gl_color[3] = alpha;
338
/* If we're not drawing atoms, and the color is black, use white instead.
339
This is a kludge so that H can have black text over its white ball,
340
but the text still shows up if balls are off.
342
if (font_p && !do_atoms &&
343
gl_color[0] == 0 && gl_color[1] == 0 && gl_color[2] == 0)
345
gl_color[0] = gl_color[1] = gl_color[2] = 1;
337
349
glColor4f (gl_color[0], gl_color[1], gl_color[2], gl_color[3]);
1196
1208
molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
1197
1209
const char *s = "Constructing molecules...";
1198
print_gl_string (mi->dpy, mc->xfont2, mc->font2_dlist,
1210
print_gl_string (mi->dpy, mc->xfont3, mc->font3_dlist,
1199
1211
mi->xgwa.width, mi->xgwa.height,
1200
1212
10, mi->xgwa.height - 10,
1353
1365
molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
1354
1366
int wire = MI_IS_WIREFRAME(mi);
1355
1367
molecule *m = &mc->molecules[mc->which];
1368
XFontStruct *xfont = (mc->scale_down ? mc->xfont2 : mc->xfont1);
1369
GLuint font_dlist = (mc->scale_down ? mc->font2_dlist : mc->font1_dlist);
1358
1372
if (!do_labels)
1412
1426
/* Before drawing the string, shift the origin to center
1413
1427
the text over the origin of the sphere. */
1414
1428
glBitmap (0, 0, 0, 0,
1415
-string_width (mc->xfont1, a->label, 0) / 2,
1416
-mc->xfont1->descent,
1429
-string_width (xfont, a->label, 0) / 2,
1419
1433
for (j = 0; j < strlen(a->label); j++)
1421
glCallList (mc->font1_dlist + (int)(a->label[j]));
1435
glCallList (font_dlist + (int)(a->label[j]));
1613
1627
if (do_titles && m->label && *m->label)
1615
1629
set_atom_color (mi, 0, True, 1);
1616
print_gl_string (mi->dpy, mc->xfont2, mc->font2_dlist,
1630
print_gl_string (mi->dpy, mc->xfont3, mc->font3_dlist,
1617
1631
mi->xgwa.width, mi->xgwa.height,
1618
1632
10, mi->xgwa.height - 10,
1619
1633
m->label, False);