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

nctions to prepare the OpenGL rendering atom(s) and clone(s) More...

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

Go to the source code of this file.

Functions

ColRGBA get_atom_color (int i, int j, double al, int picked, gboolean to_pick)
 get atom (or clone) color
 
int sphere_vertices (int qual)
 return the number of OpenGL vertices to render a sphere
 
int sphere_indices (int qual)
 return the number of OpenGL indices to render a sphere
 
object_3ddraw_sphere (int quality)
 OpenGL 3D sphere object rendering.
 
float get_sphere_radius (int style, int sp, int ac, int sel)
 get an atom sphere radius
 
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_this_atom (int style, gboolean to_pick, gboolean picked, atom *at, int ac, float *vert, float al)
 prepare the OpenGL rendering data of an atom / clone
 
int find_atom_vertices (gboolean to_pick)
 find the number of atom(s) to render
 
void setup_atom_vertices (int style, gboolean to_pick, float *vertices)
 prepare an atom OpenGL rendering
 
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
 
int find_clone_vertices (gboolean to_pick)
 find the number of clones to render
 
void setup_clone_vertices (int style, gboolean to_pick, float *vertices)
 find clone(s) position(s), color(s) and prepare the data for the OpenGL rendering
 
void atom_positions_colors_and_sizes (int style, gboolean to_pick, float *instances)
 find atom(s) position(s), color(s) and prepare the data for the OpenGL rendering
 
void create_atom_lists (gboolean to_pick)
 prepare atom(s) and clone(s) OpenGL rendering
 

Variables

int atom_id
 
int gColorID [3]
 
int all_styles [NUM_STYLES]
 
int nbs
 
int nbl
 
int nba
 

Detailed Description

nctions to prepare the OpenGL rendering atom(s) and clone(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_atoms.c.

Function Documentation

◆ atom_positions_colors_and_sizes()

void atom_positions_colors_and_sizes ( int style,
gboolean to_pick,
float * instances )

find atom(s) position(s), color(s) and prepare the data for the OpenGL rendering

Parameters
stylerendering style
to_pickto pick (1) or to draw (0)
instancesthe OpenGL data buffer to fill

Definition at line 592 of file d_atoms.c.

◆ create_atom_lists()

void create_atom_lists ( gboolean to_pick)

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.

◆ draw_sphere()

object_3d * draw_sphere ( int quality)

OpenGL 3D sphere object rendering.

Parameters
qualityOpenGL quality

Definition at line 209 of file d_atoms.c.

◆ find_atom_vertices()

int find_atom_vertices ( gboolean to_pick)

find the number of atom(s) to render

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

Definition at line 373 of file d_atoms.c.

◆ find_clone_vertices()

int find_clone_vertices ( gboolean to_pick)

find the number of clones to render

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

Definition at line 485 of file d_atoms.c.

◆ get_atom_color()

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

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

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

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

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.

◆ setup_atom_vertices()

void setup_atom_vertices ( int style,
gboolean to_pick,
float * vertices )

prepare an atom OpenGL rendering

Parameters
stylethe rendering style
to_pickto pick (1) or to draw (0)
verticesthe OpenGL buffer data to fill

Definition at line 422 of file d_atoms.c.

◆ setup_clone_vertices()

void setup_clone_vertices ( int style,
gboolean to_pick,
float * vertices )

find clone(s) position(s), color(s) and prepare the data for the OpenGL rendering

Parameters
stylerendering style
to_pickto pick (1) or to draw (0)
verticesthe OpenGL data buffer to fill

Definition at line 560 of file d_atoms.c.

◆ setup_sphere_vertice()

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

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,
gboolean picked,
atom * at,
int ac,
float * vert,
float al )

prepare the OpenGL rendering data of an atom / clone

Parameters
stylerendering style
to_pickto pick (1) or to draw (0)
pickedis the atom selected (1) or not (0)
atthe atom to render
acatom (0) or clone (1)
vertthe OpenGL buffer data to fill
althe opacity (atom: 1.0, clone: 0.5)

Definition at line 340 of file d_atoms.c.

◆ sphere_indices()

int sphere_indices ( int qual)

return the number of OpenGL indices to render a sphere

Parameters
qualOpenGL quality

Definition at line 197 of file d_atoms.c.

◆ sphere_vertices()

int sphere_vertices ( int qual)

return the number of OpenGL vertices to render a sphere

Parameters
qualOpenGL quality

Definition at line 185 of file d_atoms.c.

Variable Documentation

◆ all_styles

int all_styles[NUM_STYLES]

Definition at line 61 of file d_atoms.c.

◆ atom_id

int atom_id

Definition at line 59 of file d_atoms.c.

◆ gColorID

int gColorID[3]

Definition at line 60 of file d_atoms.c.

◆ nba

int nba

Definition at line 176 of file d_atoms.c.

◆ nbl

int nbl

Definition at line 176 of file d_atoms.c.

◆ nbs

int nbs

Definition at line 176 of file d_atoms.c.