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

Functions to prepare the OpenGL rendering for the box(es)
Functions to prepare the OpenGL rendering for the slab(s)
Functions to prepare the OpenGL rendering for the volume(s). More...

#include "global.h"
#include "glview.h"
Include dependency graph for d_box.c:

Go to the source code of this file.

Functions

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.
object_3ddraw_billboard_quad (void)
 create a camera-aligned billboard quad proxy for perfect impostors.
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, float delta, float r_sph_a, float r_sph_b)
 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, gboolean sel)
 fill the OpenGL data buffer for a cylinder cap bond (or clone bond) to render
void create_slab_info (project *this_proj)
 create slab information widget
void process_selected_atom (project *this_proj, glwin *view, int id, int ac, int se, int pi)
 process selected atom
gboolean are_identical_vec3 (vec3_t va, vec3_t vb)
 are these 2 vectors indentical
gboolean not_in_already (vec3_t a, vec3_t b, float *vertices)
 is this box edge vector already saved ?
gboolean not_in_corners (vec3_t a, float *vertices)
 is this box cornder already saved ?
void setup_extra_box_vertices (vec3_t a, vec3_t b, float *c_vert, float *s_vert)
 prepare the extra cell(s) OpenGL rendering
void setup_box_vertices (vec3_t ax, vec3_t bx, float *c_vert, float *s_vert)
 prepare the unit cell OpenGL rendering
void prepare_box_vertices (void(*c_func)(vec3_t, vec3_t, float *, float *), float *verts, float *serts)
 prepare a box OpenGL rendering
int create_box_lists (int b_step)
 prepare box OpenGL rendering
void prepare_cuboid (vec3_t position, int id)
 OpenGL 3D light object rendering.
void create_light_lists ()
 prepare light(s) OpenGL rendering
vec3_t get_normal (vec3_t v1, vec3_t v2, vec3_t v3)
double draw_cuboid (gboolean draw, int SHADID, int shadnum, mat4_t rot, vec3_t cpos, double paral[3][3], ColRGBA col, double slab_alpha)
 draw cuboid vertices
void cuboid_slab (mat4_t rot)
 prepare cuboid slab OpenGL rendering
void cylinder_slab (mat4_t rot)
 prepare cylinder slab OpenGL rendering
void spherical_slab ()
 prepare spherical slab OpenGL rendering
void create_slab_lists (project *this_proj)
 prepare slab(s) OpenGL rendering
void create_volumes_lists ()
 prepare volume(s) OpenGL rendering

Variables

ColRGBA pcol
int BOX_BUFF_SIZE
GLfloat cuboid_vertices []

Detailed Description

Functions to prepare the OpenGL rendering for the box(es)
Functions to prepare the OpenGL rendering for the slab(s)
Functions to prepare the OpenGL rendering for the volume(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_box.c.

Function Documentation

◆ are_identical_vec3()

gboolean are_identical_vec3 ( vec3_t va,
vec3_t vb )

are these 2 vectors indentical

Parameters
va1st vector
vb2nd vector

Definition at line 83 of file d_box.c.

◆ create_box_lists()

int create_box_lists ( int b_step)

prepare box OpenGL rendering

Parameters
b_stepthe step number if NPT, 0 otherwise

Definition at line 294 of file d_box.c.

◆ create_light_lists()

void create_light_lists ( )

prepare light(s) OpenGL rendering

Definition at line 473 of file d_box.c.

◆ create_slab_info()

void create_slab_info ( project * this_proj)
extern

create slab information widget

Parameters
this_projthe target project

Definition at line 109 of file cell_cut.c.

◆ create_slab_lists()

void create_slab_lists ( project * this_proj)

prepare slab(s) OpenGL rendering

Parameters
this_projthe target project

Definition at line 906 of file d_box.c.

◆ create_volumes_lists()

void create_volumes_lists ( )

prepare volume(s) OpenGL rendering

Definition at line 947 of file d_box.c.

◆ cuboid_slab()

void cuboid_slab ( mat4_t rot)

prepare cuboid slab OpenGL rendering

Parameters
rotrotation matrix

Definition at line 606 of file d_box.c.

◆ cylinder_slab()

void cylinder_slab ( mat4_t rot)

prepare cylinder slab OpenGL rendering

Parameters
rotrotation matrix

Definition at line 735 of file d_box.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_cuboid()

double draw_cuboid ( gboolean draw,
int SHADID,
int shadnum,
mat4_t rot,
vec3_t cpos,
double paral[3][3],
ColRGBA col,
double slab_alpha )

draw cuboid vertices

Parameters
drawdraw or not (1/0)
SHADIDshader id
shadnumshader number
rotrotation matrix
cposposition of center of slab
paralcell parameters
colslab color
slab_alphaslab opacity

Definition at line 528 of file d_box.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.

◆ get_normal()

vec3_t get_normal ( vec3_t v1,
vec3_t v2,
vec3_t v3 )

Definition at line 507 of file d_box.c.

◆ not_in_already()

gboolean not_in_already ( vec3_t a,
vec3_t b,
float * vertices )

is this box edge vector already saved ?

Parameters
a1st set of coordinates
b2nd set of coordinates
verticesthe data buffer to check

Definition at line 105 of file d_box.c.

◆ not_in_corners()

gboolean not_in_corners ( vec3_t a,
float * vertices )

is this box cornder already saved ?

Parameters
athe coordinates
verticesthe data buffer to check

Definition at line 136 of file d_box.c.

◆ prepare_box_vertices()

void prepare_box_vertices ( void(* c_func )(vec3_t, vec3_t, float *, float *),
float * verts,
float * serts )

prepare a box OpenGL rendering

Parameters
c_functhe function to use a render
vertsOpenGL cylinder/line data buffer to fill
sertsOpenGL sphere data buffer to fill, or NULL

Definition at line 256 of file d_box.c.

◆ prepare_cuboid()

void prepare_cuboid ( vec3_t position,
int id )

OpenGL 3D light object rendering.

Parameters
positionlight position
idshader number

Definition at line 440 of file d_box.c.

◆ process_selected_atom()

void process_selected_atom ( project * this_proj,
glwin * view,
int id,
int ac,
int se,
int pi )
extern

process selected atom

Parameters
this_projthe target project
viewthe target glwin
idthe atom id
acatom or clone (0/1)
seset to 0 to ensure to remove a selected atom from the list and not to add label
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 514 of file selection.c.

◆ setup_box_vertices()

void setup_box_vertices ( vec3_t ax,
vec3_t bx,
float * c_vert,
float * s_vert )

prepare the unit cell OpenGL rendering

Parameters
ax1st point coordinates
bx2nd point coordinates
c_vertOpenGL cylinder/line data buffer to fill
s_vertOpenGL sphere data buffer to fill, or NULL

Definition at line 215 of file d_box.c.

◆ setup_cap_vertice()

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

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

Parameters
verticesthe OpenGL buffer to fill
pos_ainitial atom position vector
pos_bcap center position vector
colthe color
radthe radius
alphathe opacity (atom: 1.0, clone: 0.5)
selselected half bond (1/0)

Definition at line 336 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,
float r_sph_a,
float r_sph_b )
extern

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)
deltalength correction if atom(s) are shown
r_sph_asphere radius at the atom side (for in-sphere clipping in the frag shader)
r_sph_bsphere radius at the midpoint side (0.0 for a bond half, > 0 for axis cylinders)

Definition at line 297 of file d_bonds.c.

◆ setup_extra_box_vertices()

void setup_extra_box_vertices ( vec3_t a,
vec3_t b,
float * c_vert,
float * s_vert )

prepare the extra cell(s) OpenGL rendering

Parameters
a1st point coordinates
b2nd point coordinates
c_vertOpenGL cylinder/line data buffer to fill
s_vertOpenGL sphere data buffer to fill, or NULL

Definition at line 162 of file d_box.c.

◆ 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 269 of file d_bonds.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 345 of file d_atoms.c.

◆ spherical_slab()

void spherical_slab ( )

prepare spherical slab OpenGL rendering

Definition at line 841 of file d_box.c.

Variable Documentation

◆ BOX_BUFF_SIZE

int BOX_BUFF_SIZE

Definition at line 73 of file d_box.c.

◆ cuboid_vertices

GLfloat cuboid_vertices[]

Definition at line 387 of file d_box.c.

◆ pcol

ColRGBA pcol
extern

Definition at line 60 of file d_poly.c.