atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
d_bonds.c File Reference

Functions to prepare the OpenGL rendering of bond(s) and clone bond(s) More...

#include "global.h"
#include "glview.h"
#include "dlp_field.h"
+ Include dependency graph for d_bonds.c:

Go to the source code of this file.

Functions

ColRGBA get_atom_color (int i, int j, double al, int picked, gboolean to_picked)
 get atom (or clone) color
 
int cylinder_vertices (int qual)
 return the number of OpenGL vertices to render a cylinder
 
int cylinder_indices (int qual)
 return the number of OpenGL indices to render a cylinder
 
object_3ddraw_cylinder (int quality, float ra, float rb)
 OpenGL 3D cylinder object rendering.
 
int cap_vertices (int qual)
 return the number of OpenGL vertices to render a cylinder cap
 
int cap_indices (int qual)
 return the number of OpenGL indices to render a cylinder cap
 
object_3ddraw_cylinder_cap (int quality, float rad, gboolean picked)
 OpenGL 3D cylinder cap object rendering.
 
vec4_t rotate_bond (vec3_t a, vec3_t b)
 rotate a bond based on the proper orientation
 
float get_bond_radius (int sty, int ac, int at, int bt, int sel)
 get bond (clone bond) radius
 
void setup_line_vertice (float *vertices, vec3_t pos, ColRGBA col, float alpha)
 fill the OpenGL data buffer for a line bond (or clone bond) to render
 
void setup_cylinder_vertice (float *vertices, vec3_t pos_a, vec3_t pos_b, ColRGBA col, float rad, float alpha, float delta)
 fill the OpenGL data buffer for a cylinder bond (or clone bond) to render
 
void setup_cap_vertice (float *vertices, vec3_t pos_a, vec3_t pos_b, ColRGBA col, float rad, float alpha)
 fill the OpenGL data buffer for a cylinder cap bond (or clone bond) to render
 
void setup_this_bond (int sty, gboolean to_pick, gboolean picked, int cap, int bi, int pi, atom *at, atom *bt, float al, float *vertices)
 prepare the OpenGL rendering data of a bond / clone bond
 
void prepare_bond (int sty, gboolean to_pick, gboolean picked, int cap, int bi, int pi, int bid, atom *at, atom *bt, float *vertices)
 prepare a bond OpenGL rendering
 
int find_bond_vertices (gboolean to_pick, int sty, int sa, int sb, int bi, int cap)
 find bond(s) and clone bond(s) to render
 
void setup_all_cylinder_vertices (int style, gboolean to_pick, int cap, int bi, float *vertices)
 prepare cylinder bond(s) and clone bond(s) to render
 
void setup_line_vertices (int style, int cap, int bi, int sa, int sb, float *vertices)
 prepare line bond(s) and clone bond(s) to render
 
int create_bond_lists (gboolean to_pick)
 prepare bond(s) and clone bond(s) OpenGL rendering
 

Variables

vec3_t model_position
 
int nbs
 
int vs_bid
 

Detailed Description

Functions to prepare the OpenGL rendering of bond(s) and clone bond(s)

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file d_bonds.c.

Function Documentation

◆ cap_indices()

int cap_indices ( int qual)

return the number of OpenGL indices to render a cylinder cap

Parameters
qualOpenGL quality

Definition at line 155 of file d_bonds.c.

◆ cap_vertices()

int cap_vertices ( int qual)

return the number of OpenGL vertices to render a cylinder cap

Parameters
qualOpenGL quality

Definition at line 143 of file d_bonds.c.

◆ create_bond_lists()

int create_bond_lists ( gboolean to_pick)

prepare bond(s) and clone bond(s) OpenGL rendering

Parameters
to_pickto pick (1) or to draw (0)

Definition at line 670 of file d_bonds.c.

◆ cylinder_indices()

int cylinder_indices ( int qual)

return the number of OpenGL indices to render a cylinder

Parameters
qualOpenGL quality

Definition at line 84 of file d_bonds.c.

◆ cylinder_vertices()

int cylinder_vertices ( int qual)

return the number of OpenGL vertices to render a cylinder

Parameters
qualOpenGL quality

Definition at line 72 of file d_bonds.c.

◆ draw_cylinder()

object_3d * draw_cylinder ( int quality,
float ra,
float rb )

OpenGL 3D cylinder object rendering.

Parameters
qualityOpenGL quality
racylinder radius at 1st side point
rbcylinder radius at 2nd side point

Definition at line 98 of file d_bonds.c.

◆ draw_cylinder_cap()

object_3d * draw_cylinder_cap ( int quality,
float rad,
gboolean picked )

OpenGL 3D cylinder cap object rendering.

Parameters
qualityOpenGL quality
radcylinder radius
pickedis the bond selected (1) or not (0)

Definition at line 169 of file d_bonds.c.

◆ find_bond_vertices()

int find_bond_vertices ( gboolean to_pick,
int sty,
int sa,
int sb,
int bi,
int cap )

find bond(s) and clone bond(s) to render

Parameters
to_pickto pick (1) or to draw (0)
styrendering style
sa1st chemical species
sb2nd chemical species
bibond (0) or clone bond (1)
capdraw cylinder cap (1/0)

Definition at line 499 of file d_bonds.c.

◆ get_atom_color()

ColRGBA get_atom_color ( int i,
int j,
double al,
int picked,
gboolean to_pick )
extern

get atom (or clone) color

Parameters
ichemical species
jthe atom id
alopacity (atom: 1.0, clone: 0.5)
pickedis the atom (clone) selected (1) or not (0)
to_pickto pick (1) or to draw (0)

Definition at line 74 of file d_atoms.c.

◆ get_bond_radius()

float get_bond_radius ( int sty,
int ac,
int at,
int bt,
int sel )

get bond (clone bond) radius

Parameters
stythe rendering style
acatom (0) or clone (1)
at1st chemical species
bt2nd chemical species
selis the bond selected (1) or not (0)

Definition at line 239 of file d_bonds.c.

◆ prepare_bond()

void prepare_bond ( int sty,
gboolean to_pick,
gboolean picked,
int cap,
int bi,
int pi,
int bid,
atom * at,
atom * bt,
float * vertices )

prepare a bond OpenGL rendering

Parameters
styrendering style
to_pickto pick (1) or to draw (0)
pickedis the atom selected (1) or not (0)
capdraw cylinder cap
biatom (0) or clone (1) visible
piatom (0) or clone (1) picked
bidbond id
at1st atom
bt2nd atom
verticesthe OpenGL buffer data to fill

Definition at line 442 of file d_bonds.c.

◆ rotate_bond()

vec4_t rotate_bond ( vec3_t a,
vec3_t b )

rotate a bond based on the proper orientation

Parameters
a1st atom position
b2nd atom position

Definition at line 216 of file d_bonds.c.

◆ setup_all_cylinder_vertices()

void setup_all_cylinder_vertices ( int style,
gboolean to_pick,
int cap,
int bi,
float * vertices )

prepare cylinder bond(s) and clone bond(s) to render

Parameters
stylerendering style
to_pickto pick (1) or to draw (0)
capdraw cylinder cap (1/0)
bibond (0) or clone bond (1)
verticesthe OpenGL data buffer to fill

Definition at line 565 of file d_bonds.c.

◆ setup_cap_vertice()

void setup_cap_vertice ( float * vertices,
vec3_t pos_a,
vec3_t pos_b,
ColRGBA col,
float rad,
float alpha )

fill the OpenGL data buffer for a cylinder cap bond (or clone bond) to render

Parameters
verticesthe OpenGL buffer to fill
pos_athe position vector
pos_bthe rotation vector
colthe color
radthe radius
alphathe opacity (atom: 1.0, clone: 0.5)

Definition at line 323 of file d_bonds.c.

◆ setup_cylinder_vertice()

void setup_cylinder_vertice ( float * vertices,
vec3_t pos_a,
vec3_t pos_b,
ColRGBA col,
float rad,
float alpha,
float delta )

fill the OpenGL data buffer for a cylinder bond (or clone bond) to render

Parameters
verticesthe OpenGL buffer to fill
pos_a1st atom position
pos_b2nd atom position
colthe color
radthe radius
alphathe opacity (atom: 1.0, clone: 0.5)
deltaradius correction(s) if atom(s) are shown

Definition at line 291 of file d_bonds.c.

◆ setup_line_vertice()

void setup_line_vertice ( float * vertices,
vec3_t pos,
ColRGBA col,
float alpha )

fill the OpenGL data buffer for a line bond (or clone bond) to render

Parameters
verticesthe OpenGL buffer to fill
posthe position vector
colthe color
alphathe opacity (atom: 1.0, clone: 0.5)

Definition at line 265 of file d_bonds.c.

◆ setup_line_vertices()

void setup_line_vertices ( int style,
int cap,
int bi,
int sa,
int sb,
float * vertices )

prepare line bond(s) and clone bond(s) to render

Parameters
stylerendering style
capdraw cylinder cap (1/0)
bibond (0) or clone bond (1)
sa1st chemical species
sb2nd chemical species
verticesthe OpenGL buffer to fill

Definition at line 624 of file d_bonds.c.

◆ setup_this_bond()

void setup_this_bond ( int sty,
gboolean to_pick,
gboolean picked,
int cap,
int bi,
int pi,
atom * at,
atom * bt,
float al,
float * vertices )

prepare the OpenGL rendering data of a bond / clone bond

Parameters
styrendering style
to_pickto pick (1) or to draw (0)
pickedis the bond selected (1) or not (0)
capdraw cylinder cap (1/0)
biatom (0) or clone (1) visible
piatom (0) or clone (1) picked
at1st atom
bt2nd atom
althe opacity (bond: 1.0, clone bond: 0.5)
verticesthe OpenGL buffer data to fill

Definition at line 360 of file d_bonds.c.

Variable Documentation

◆ model_position

vec3_t model_position
extern

◆ nbs

int nbs
extern

Definition at line 176 of file d_atoms.c.

◆ vs_bid

int vs_bid

Definition at line 342 of file d_bonds.c.