378 |
/* Return if atoms not being display and in ball and stick mode; |
/* Return if atoms not being display and in ball and stick mode; |
379 |
note that we draw atoms if tubes mode if the bond is visible */ |
note that we draw atoms if tubes mode if the bond is visible */ |
380 |
|
|
381 |
if ((atom_flag == 0) && (gl_render_type == BALL_AND_STICK)) return; |
if ((atom_flag == 0) && |
382 |
|
((gl_render_type == BALL_AND_STICK) || |
383 |
|
((gl_render_type == TUBES) && (! gl_use_lighting)))) return; |
384 |
|
|
385 |
for (i = 0; i < no_atoms; i++) |
for (i = 0; i < no_atoms; i++) |
386 |
{ |
{ |
403 |
displayed and the atom is not bonded. In essense, atoms and bonds |
displayed and the atom is not bonded. In essense, atoms and bonds |
404 |
are mutually exclusive. */ |
are mutually exclusive. */ |
405 |
|
|
406 |
if (gl_render_type == TUBES) |
if ((gl_render_type == TUBES) && gl_use_lighting) |
407 |
{ |
{ |
408 |
if (((bond_flag == 0) && (bond_adjacency_list[i] != NULL)) || |
if (((bond_flag == 0) && (bond_adjacency_list[i] != NULL)) || |
409 |
((atom_flag == 0) && (bond_adjacency_list[i] == NULL))) return; |
((atom_flag == 0) && (bond_adjacency_list[i] == NULL))) return; |
434 |
glColor3f (0.0, 0.0, 0.0); |
glColor3f (0.0, 0.0, 0.0); |
435 |
} |
} |
436 |
|
|
437 |
if (gl_render_type == BALL_AND_STICK) |
atom_size = gl_get_rendered_atom_size (i); |
|
{ |
|
|
if ((bond_adjacency_list[i] == NULL) && (never_use_vdw == 0)) |
|
|
{ |
|
|
/* If no bond, use van der Waals radius */ |
|
|
atom_size = get_atom_scale () * atoms[i].vdw_rad; |
|
|
} |
|
|
else |
|
|
{ |
|
|
atom_size = get_atom_scale () * atoms[i].cov_rad; |
|
|
} |
|
|
} |
|
|
else if (gl_render_type == TUBES) |
|
|
{ |
|
|
/* If we are not bonded to any other atoms, use normal size */ |
|
|
|
|
|
if (bond_adjacency_list[i] == NULL) |
|
|
{ |
|
|
if (never_use_vdw == 1) |
|
|
{ |
|
|
atom_size = get_atom_scale () * atoms[i].cov_rad; |
|
|
} |
|
|
else |
|
|
{ |
|
|
atom_size = get_atom_scale () * atoms[i].vdw_rad; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
/* We're getting the diameter, and we want the radius */ |
|
|
atom_size = get_bond_width () / 2.0; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
atom_size = 0.0; |
|
|
} |
|
438 |
|
|
439 |
/* Set up rendering for elliptical atoms */ |
/* Set up rendering for elliptical atoms */ |
440 |
|
|
489 |
{ |
{ |
490 |
if (atoms[i].sel == 1) |
if (atoms[i].sel == 1) |
491 |
{ |
{ |
492 |
glColor3f (1.0 - red, |
glColor3f (1.0, 0.65, 0.0); /* Orange */ |
|
1.0 - green, |
|
|
1.0 - blue); |
|
493 |
|
|
494 |
gluDisk (gl_quadric, |
gluDisk (gl_quadric, |
495 |
0.9 * atom_size, |
0.9 * atom_size, |
920 |
account the drawing mode (BALL_AND_STICK or TUBES) and whether or |
account the drawing mode (BALL_AND_STICK or TUBES) and whether or |
921 |
not atoms and bonds are being displayed */ |
not atoms and bonds are being displayed */ |
922 |
|
|
923 |
if (gl_render_type == BALL_AND_STICK) |
if ((gl_render_type == BALL_AND_STICK) || (! gl_use_lighting)) |
924 |
{ |
{ |
925 |
if (atom_flag) |
if (atom_flag) |
926 |
{ |
{ |