atomes 1.1.14
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.
 
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)
 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)
 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 ()
 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 82 of file d_box.c.

◆ create_box_lists()

int create_box_lists ( )

prepare box OpenGL rendering

Definition at line 290 of file d_box.c.

◆ create_light_lists()

void create_light_lists ( )

prepare light(s) OpenGL rendering

Definition at line 467 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 898 of file d_box.c.

◆ create_volumes_lists()

void create_volumes_lists ( )

prepare volume(s) OpenGL rendering

Definition at line 939 of file d_box.c.

◆ cuboid_slab()

void cuboid_slab ( mat4_t rot)

prepare cuboid slab OpenGL rendering

Parameters
rotrotation matrix

Definition at line 602 of file d_box.c.

◆ cylinder_slab()

void cylinder_slab ( mat4_t rot)

prepare cylinder slab OpenGL rendering

Parameters
rotrotation matrix

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

◆ get_normal()

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

Definition at line 501 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 104 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 134 of file d_box.c.

◆ prepare_box_vertices()

void prepare_box_vertices ( void(*)(vec3_t, vec3_t, float *, float *) c_func,
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 254 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 433 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 213 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 )
extern

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

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

Definition at line 323 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 )
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)
deltaradius correction(s) if atom(s) are shown

Definition at line 291 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 160 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 265 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 312 of file d_atoms.c.

◆ spherical_slab()

void spherical_slab ( )

prepare spherical slab OpenGL rendering

Definition at line 834 of file d_box.c.

Variable Documentation

◆ BOX_BUFF_SIZE

int BOX_BUFF_SIZE

Definition at line 72 of file d_box.c.

◆ cuboid_vertices

GLfloat cuboid_vertices[]

Definition at line 380 of file d_box.c.

◆ pcol

ColRGBA pcol
extern

Definition at line 60 of file d_poly.c.