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

Functions to prepare the OpenGL rendering of the selected: atom(s), clone(s), bond(s) and clone bond(s)
Functions to prepare the unique color rendering for picking the atom(s) and bond(s) More...

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

Go to the source code of this file.

Functions

void create_atom_lists (gboolean to_pick)
 prepare atom(s) and clone(s) OpenGL rendering
 
int create_bond_lists (gboolean to_pick)
 prepare bond(s) and clone bond(s) OpenGL rendering
 
object_3ddraw_sphere (int quality)
 OpenGL 3D sphere object rendering.
 
object_3ddraw_cylinder (int quality, float ra, float rb)
 OpenGL 3D cylinder object rendering.
 
object_3ddraw_cylinder_cap (int quality, float rad, gboolean picked)
 OpenGL 3D cylinder cap object rendering.
 
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_sphere_vertice (float *vertices, vec3_t pos, ColRGBA col, float rad, float alpha)
 fill the OpenGL data buffer for a atom (or clone) to render
 
void setup_cylinder_vertice (float *vertices, vec3_t pos_a, vec3_t pos_b, ColRGBA col, float rad, float alpha)
 
void setup_triangles (float *vertices, vec3_t sa, vec3_t sb, vec3_t sc)
 setup triangle veertices
 
float get_bond_radius (int sty, int ac, int at, int b, int sel)
 get bond (clone bond) radius
 
void setup_this_atom (int style, gboolean to_pick, int picked, atom *at, int ac, float *vert, float al)
 
void prepare_clone (int style, gboolean to_pick, int picked, atom at, atom bt, float x, float y, float z, float *vertices)
 prepare the rendering data of a clone
 
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 setup_selected_clone_vertices (int style, int at, int pi, float *vertices)
 fill the OpenGL data buffer for a selected atom clone bonds to render
 
int find_selected_clone_vertices (int style, int at)
 find the number of selected atom(s) to render
 
int find_selected_bond_vertices (int sty, int at, int sp, int bi, int pi, int cap)
 find the number of selected bond(s) to render
 
int get_clone_id (int at, int bt)
 get the bond id of cloned bond
 
void prepare_selected_bond (int sty, int cap, int bi, int pi, atom *at, atom *bt, float *vertices)
 prepare the rendering of a selected bond
 
void setup_all_selected_bond_vertices (int sty, int cap, int bi, int at, int sb, int pi, float *vertices)
 prepare the rendering of all selected bond(s)
 
void prepare_selected (int style, gboolean cylinder, int clone, int type)
 prepare the list of selected bond(s) to render
 
void prepare_picked (int style, gboolean cylinder, int clone, int type)
 prepare the list of the bond that can be picked to render
 
int render_selected (int style, gboolean cylinder, int caps, int bonds, int ncaps, int type, int clone, int shader)
 prepare the OpenGL rendering data of to selected bond / clone bond
 
int render_picked (int style, gboolean cylinder, int caps, int bonds, int ncaps, int type, int clone, int shader)
 prepare the OpenGL rendering data of to be picked bond / clone bond
 
int prepare_selection_shaders (int style, int shaders, int clone, int type, gboolean do_bonds)
 prepare selection shaders
 
int check_selection (int style, int type)
 check selection : atom(s) in selection ?
 
int create_selection_lists ()
 prepare the selected atom(s) and bond(s) OpenGL rendering
 
int create_pick_lists ()
 prepare the picking list OpenGL rendering
 

Variables

int atoms [NUM_STYLES][2]
 
int bonds [NUM_STYLES][2]
 
int caps [NUM_STYLES][2]
 
int npbds [NUM_STYLES][2]
 
int npcps [NUM_STYLES][2]
 
int *** nbonds [NUM_STYLES][2]
 

Detailed Description

Functions to prepare the OpenGL rendering of the selected: atom(s), clone(s), bond(s) and clone bond(s)
Functions to prepare the unique color rendering for picking the atom(s) and 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_selection.c.

Function Documentation

◆ check_selection()

int check_selection ( int style,
int type )

check selection : atom(s) in selection ?

Parameters
stylerendering style
type0 = mouse analysis mode, 1 = mouse edition mode

Definition at line 817 of file d_selection.c.

◆ create_atom_lists()

void create_atom_lists ( gboolean to_pick)
extern

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

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

Definition at line 610 of file d_atoms.c.

◆ create_bond_lists()

int create_bond_lists ( gboolean to_pick)
extern

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.

◆ create_pick_lists()

int create_pick_lists ( )

prepare the picking list OpenGL rendering

Definition at line 940 of file d_selection.c.

◆ create_selection_lists()

int create_selection_lists ( )

prepare the selected atom(s) and bond(s) OpenGL rendering

Definition at line 872 of file d_selection.c.

◆ draw_cylinder()

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

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 )
extern

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.

◆ draw_sphere()

object_3d * draw_sphere ( int quality)
extern

OpenGL 3D sphere object rendering.

Parameters
qualityOpenGL quality

Definition at line 209 of file d_atoms.c.

◆ find_selected_bond_vertices()

int find_selected_bond_vertices ( int sty,
int at,
int sp,
int bi,
int pi,
int cap )

find the number of selected bond(s) to render

Parameters
styrendering style
atthe atom id
spthe chemical species
biatom (0) or clone (1)
pi0 = mouse analysis mode, 1 = mouse edition mode
caprender cylinder caps (1/0)

Definition at line 160 of file d_selection.c.

◆ find_selected_clone_vertices()

int find_selected_clone_vertices ( int style,
int at )

find the number of selected atom(s) to render

Parameters
stylerendering style
atthe atom id

Definition at line 122 of file d_selection.c.

◆ get_bond_radius()

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

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.

◆ get_clone_id()

int get_clone_id ( int at,
int bt )

get the bond id of cloned bond

Parameters
at1st atom
bt2nd atom

Definition at line 225 of file d_selection.c.

◆ prepare_clone()

void prepare_clone ( int style,
gboolean to_pick,
int picked,
atom at,
atom bt,
float x,
float y,
float z,
float * vertices )
extern

prepare the rendering data of a clone

Parameters
stylethe rendering style
to_pickto pick (1) or to draw (0)
pickedis the clone selected (1) or not (0)
at1st atom of the cloned chemical bond
bt2nd atom of the cloned chemical bond
xx position
yy position
zz position
verticesthe OpenGL buffer data to fill

Definition at line 457 of file d_atoms.c.

◆ prepare_picked()

void prepare_picked ( int style,
gboolean cylinder,
int clone,
int type )

prepare the list of the bond that can be picked to render

Parameters
stylerendering style
cylindercylinder (1) or line (1)
cloneatom (0) or clone (1)
type0 = mouse analysis mode, 1 = mouse edition mode

Definition at line 436 of file d_selection.c.

◆ prepare_selected()

void prepare_selected ( int style,
gboolean cylinder,
int clone,
int type )

prepare the list of selected bond(s) to render

Parameters
stylerendering style
cylindercylinder (1) or line (1)
cloneatom (0) or clone (1)
type0 = mouse analysis mode, 1 = mouse edition mode

Definition at line 376 of file d_selection.c.

◆ prepare_selected_bond()

void prepare_selected_bond ( int sty,
int cap,
int bi,
int pi,
atom * at,
atom * bt,
float * vertices )

prepare the rendering of a selected bond

Parameters
styrendering style
caprender cylinder caps (1/0)
biatom (0) or clone (1)
pi0 = mouse analysis mode, 1 = mouse edition mode
at1st atom
bt2nd atom
verticesthe OpenGL buffer data to fill

Definition at line 250 of file d_selection.c.

◆ prepare_selection_shaders()

int prepare_selection_shaders ( int style,
int shaders,
int clone,
int type,
gboolean do_bonds )

prepare selection shaders

Parameters
stylerendering style
shadersshader id number
cloneatoms (0) or clones (1)
type0 = mouse analysis mode, 1 = mouse edition mode
do_bondsrender bonds (1/0)

Definition at line 687 of file d_selection.c.

◆ render_picked()

int render_picked ( int style,
gboolean cylinder,
int caps,
int bonds,
int ncaps,
int type,
int clone,
int shader )

prepare the OpenGL rendering data of to be picked bond / clone bond

Parameters
stylerendering style
cylindercylinders (1) or lines (0)
capscylinder caps (1/0)
bondsnumber of selected bonds
ncapsnumber of cylinder caps
type0 = mouse analysis mode, 1 = mouse edition mode
cloneatom (0) or clone (1)
shadershader id number

Definition at line 596 of file d_selection.c.

◆ render_selected()

int render_selected ( int style,
gboolean cylinder,
int caps,
int bonds,
int ncaps,
int type,
int clone,
int shader )

prepare the OpenGL rendering data of to selected bond / clone bond

Parameters
stylerendering style
cylindercylinders (1) or lines (0)
capscylinder caps (1/0)
bondsnumber of selected bonds
ncapsnumber of cylinder caps
type0 = mouse analysis mode, 1 = mouse edition mode
cloneatom (0) or clone (1)
shadershader id number

Definition at line 501 of file d_selection.c.

◆ setup_all_selected_bond_vertices()

void setup_all_selected_bond_vertices ( int sty,
int cap,
int bi,
int at,
int sb,
int pi,
float * vertices )

prepare the rendering of all selected bond(s)

Parameters
styrendering style
caprender cylinder caps (1/0)
biatom (0) or clone (1)
atatom id
sbtarget chemical species
pi0 = mouse analysis mode, 1 = mouse edition mode
verticesthe OpenGL buffer data to fill

Definition at line 303 of file d_selection.c.

◆ setup_cylinder_vertice()

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

◆ setup_line_vertice()

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

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_selected_clone_vertices()

void setup_selected_clone_vertices ( int style,
int at,
int pi,
float * vertices )

fill the OpenGL data buffer for a selected atom clone bonds to render

Parameters
stylerendering style
atthe atom id
pi0 = mouse analysis mode, 1 = mouse edition mode
verticesthe OpenGL buffer data to fill

Definition at line 82 of file d_selection.c.

◆ setup_sphere_vertice()

void setup_sphere_vertice ( float * vertices,
vec3_t pos,
ColRGBA col,
float rad,
float alpha )
extern

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

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

Definition at line 312 of file d_atoms.c.

◆ setup_this_atom()

void setup_this_atom ( int style,
gboolean to_pick,
int picked,
atom * at,
int ac,
float * vert,
float al )
extern

◆ 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 )
extern

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.

◆ setup_triangles()

void setup_triangles ( float * vertices,
vec3_t sa,
vec3_t sb,
vec3_t sc )
extern

setup triangle veertices

Parameters
vertices
sa1st summit
sb2nd summit
sc3rd summit

Definition at line 126 of file d_poly.c.

Variable Documentation

◆ atoms

int atoms[NUM_STYLES][2]

Definition at line 361 of file d_selection.c.

◆ bonds

int bonds[NUM_STYLES][2]

Definition at line 362 of file d_selection.c.

◆ caps

int caps[NUM_STYLES][2]

Definition at line 362 of file d_selection.c.

◆ nbonds

int*** nbonds[NUM_STYLES][2]

Definition at line 364 of file d_selection.c.

◆ npbds

int npbds[NUM_STYLES][2]

Definition at line 363 of file d_selection.c.

◆ npcps

int npcps[NUM_STYLES][2]

Definition at line 363 of file d_selection.c.