/[xmakemol]/xmakemol/gl_funcs.c
ViewVC logotype

Diff of /xmakemol/gl_funcs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.60 by MPHodges, Tue Apr 1 22:03:11 2003 UTC revision 1.61 by MPHodges, Thu Apr 3 20:25:55 2003 UTC
# Line 378  void gl_render_atoms (void) Line 378  void gl_render_atoms (void)
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      {      {
# Line 401  void gl_render_atom (int i) Line 403  void gl_render_atom (int i)
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;
# Line 432  void gl_render_atom (int i) Line 434  void gl_render_atom (int i)
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    
# Line 523  void gl_render_atom (int i) Line 489  void gl_render_atom (int i)
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,
# Line 956  double gl_get_rendered_atom_size (int i) Line 920  double gl_get_rendered_atom_size (int i)
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          {          {

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.61

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26