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

Functions to prepare the OpenGL rendering for the axis. More...

#include "global.h"
#include "glview.h"
Include dependency graph for d_axis.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 setup_triangles (float *vertices, vec3_t sa, vec3_t sb, vec3_t sc)
 setup triangle vertices
void clean_labels (int id)
 clean atomic label shaders
ColRGBA color_axis (int id)
 get axis color
mat4_t create_axis_matrices (int type)
 create axis OpenGL rendering matrices
void setup_arrow (float *vert, vec3_t a, vec3_t b, vec3_t c, vec3_t d, vec3_t e)
 setup axis 3D arrow rendering data
void init_axis_param ()
 initialize axis rendering parameters
void prepare_axis_data (float *vert_a, float *vert_b, float *vert_c)
 prepare axis OpenGL rendering data buffer
int create_axis_lists ()
 prepare axis OpenGL rendering

Variables

float poly_alpha
vec3_t centroid
ColRGBA pcol
float arrow_length
float axis_size
float axis_radius
float arrow_base
float label_pos

Detailed Description

Functions to prepare the OpenGL rendering for the axis.

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_axis.c.

Function Documentation

◆ clean_labels()

void clean_labels ( int id)
extern

clean atomic label shaders

Parameters
idlabel id

Definition at line 147 of file d_label.c.

◆ color_axis()

ColRGBA color_axis ( int id)

get axis color

Parameters
idaxis x (0), y(1) or z(2)

Definition at line 77 of file d_axis.c.

◆ create_axis_lists()

int create_axis_lists ( )

prepare axis OpenGL rendering

Definition at line 268 of file d_axis.c.

◆ create_axis_matrices()

mat4_t create_axis_matrices ( int type)

create axis OpenGL rendering matrices

Parameters
typeaxis type (standard: 0, atom edition viewer axis: 1)

Definition at line 101 of file d_axis.c.

◆ draw_billboard_quad()

object_3d * draw_billboard_quad ( void )
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.

◆ init_axis_param()

void init_axis_param ( )

initialize axis rendering parameters

Definition at line 196 of file d_axis.c.

◆ prepare_axis_data()

void prepare_axis_data ( float * vert_a,
float * vert_b,
float * vert_c )

prepare axis OpenGL rendering data buffer

Parameters
vert_aOpenGL buffer data to fill
vert_bOpenGL buffer data to fill
vert_cOpenGL buffer data to fill

Definition at line 222 of file d_axis.c.

◆ setup_arrow()

void setup_arrow ( float * vert,
vec3_t a,
vec3_t b,
vec3_t c,
vec3_t d,
vec3_t e )

setup axis 3D arrow rendering data

Parameters
vertthe OpenGL buffer data to fill
aposition vector a
bposition vector b
cposition vector c
dposition vector d
eposition vector e

Definition at line 181 of file d_axis.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_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.

◆ setup_triangles()

void setup_triangles ( float * vertices,
vec3_t sa,
vec3_t sb,
vec3_t sc )
extern

setup triangle vertices

Parameters
vertices
sa1st summit
sb2nd summit
sc3rd summit

Definition at line 126 of file d_poly.c.

Variable Documentation

◆ arrow_base

float arrow_base

Definition at line 67 of file d_axis.c.

◆ arrow_length

float arrow_length

Definition at line 64 of file d_axis.c.

◆ axis_radius

float axis_radius

Definition at line 66 of file d_axis.c.

◆ axis_size

float axis_size

Definition at line 65 of file d_axis.c.

◆ centroid

vec3_t centroid
extern

Definition at line 59 of file d_poly.c.

◆ label_pos

float label_pos

Definition at line 68 of file d_axis.c.

◆ pcol

ColRGBA pcol
extern

Definition at line 60 of file d_poly.c.

◆ poly_alpha

float poly_alpha
extern

Definition at line 65 of file d_poly.c.