atomes 1.3.1
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 "preferences.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.
object_3ddraw_billboard_quad ()
 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_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 625 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 643 of file d_atoms.c.

◆ draw_billboard_quad()

object_3d * draw_billboard_quad ( void )

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

object_3d * draw_sphere ( int quality)

OpenGL 3D sphere object rendering.

Parameters
qualityOpenGL quality

Definition at line 198 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 406 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 518 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 75 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 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 )

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.

◆ 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 455 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 593 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 345 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 373 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 186 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 174 of file d_atoms.c.

Variable Documentation

◆ all_styles

int all_styles[NUM_STYLES]

Definition at line 62 of file d_atoms.c.

◆ atom_id

int atom_id

Definition at line 60 of file d_atoms.c.

◆ gColorID

int gColorID[3]

Definition at line 61 of file d_atoms.c.

◆ nba

int nba

Definition at line 165 of file d_atoms.c.

◆ nbl

int nbl

Definition at line 165 of file d_atoms.c.

◆ nbs

int nbs

Definition at line 165 of file d_atoms.c.