atomes 1.3.1
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.
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
object_3ddraw_billboard_quad (void)
 create a camera-aligned billboard quad proxy for perfect impostors.
float get_sphere_radius (int style, int sp, int ac, int sel)
 get an atom sphere radius
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 the 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 *** sbonds [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 838 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 643 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 685 of file d_bonds.c.

◆ create_pick_lists()

int create_pick_lists ( )

prepare the picking list OpenGL rendering

Definition at line 968 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 893 of file d_selection.c.

◆ draw_billboard_quad()

object_3d * draw_billboard_quad ( )
extern

create a camera-aligned billboard quad proxy for perfect impostors.

The quad has 4 vertices at unit corners (±1, ±1, 0). Each vertex shader for perfect impostors uses the sign of vert.x / vert.y to select the corresponding edge of the tight axis-aligned bounding box in view space.

Draw primitive: GL_TRIANGLE_STRIP with indices [0,1,2,3]. tri 0 → vertices 0,1,2 tri 1 → vertices 1,2,3

Definition at line 273 of file d_atoms.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 102 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 173 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 198 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 158 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 120 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 243 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 223 of file d_selection.c.

◆ get_sphere_radius()

float get_sphere_radius ( int style,
int sp,
int ac,
int sel )
extern

get an atom sphere radius

Parameters
stylerendering style
spchemical species
acatom (0) or clone (1)
selis the atom selected (1) or not (0)

Definition at line 305 of file d_atoms.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 490 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 434 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 374 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 248 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 689 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 597 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 the 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 499 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 301 of file d_selection.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 80 of file d_selection.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 374 of file d_bonds.c.

Variable Documentation

◆ atoms

int atoms[NUM_STYLES][2]

Definition at line 359 of file d_selection.c.

◆ bonds

int bonds[NUM_STYLES][2]

Definition at line 360 of file d_selection.c.

◆ caps

int caps[NUM_STYLES][2]

Definition at line 360 of file d_selection.c.

◆ npbds

int npbds[NUM_STYLES][2]

Definition at line 361 of file d_selection.c.

◆ npcps

int npcps[NUM_STYLES][2]

Definition at line 361 of file d_selection.c.

◆ sbonds

int*** sbonds[NUM_STYLES][2]

Definition at line 362 of file d_selection.c.