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

Functions to prepare the OpenGL rendering of coordination polyhedra. More...

#include "global.h"
#include "glview.h"
#include "color_box.h"
#include "dlp_field.h"
+ Include dependency graph for d_poly.c:

Go to the source code of this file.

Functions

void setup_summit (float *vertices, vec3_t s, vec3_t n)
 prepare the polygon summit to render
 
vec3_t get_triangle_normal (vec3_t v1, vec3_t v2, vec3_t v3)
 compute triangle normal vector
 
void setup_triangles (float *vertices, vec3_t sa, vec3_t sb, vec3_t sc)
 setup triangle veertices
 
void setup_polyhedron (float *vertices, GLfloat **xyz, int s)
 fill the OpenGL data buffer for a polyhedron to render
 
void setup_tetra (float *vertices, vec3_t a, vec3_t b, vec3_t c, vec3_t d)
 fill the OpenGL data buffer for a tetrahedra to render
 
void setup_tetrahedron (float *vertices, GLfloat **xyz)
 fill the OpenGL data buffer for a tetrahedra to render
 
void get_centroid (GLfloat **xyz, int id)
 find the barycenter of a polyhedron
 
gboolean is_inside (vec3_t p, float *mi, float *ma)
 is this point inside the polyhedron ?
 
gboolean is_in_triangle (vec3_t p, vec3_t a, vec3_t b, vec3_t c)
 is this point inside a triangle ?
 
gboolean check_it (int i, int j, int k, int l)
 test this atom id ?
 
void check_triangles (int s, GLfloat **xyz)
 check triangle intersection
 
void prepare_poly_gl (float *vertices, atom at, int c)
 prepare the OpenGL rendering of a polyhedron
 
int is_atom_cloned (int at)
 does this atom have clone(s) ?
 
void create_poly_lists ()
 prepare coordination polyhedra(s) OpenGL rendering
 

Variables

gboolean * do_gl
 
vec3_t centroid
 
ColRGBA pcol
 
int nbs
 
int nbl
 
int nba
 
float the_sign
 
float poly_alpha
 

Detailed Description

Functions to prepare the OpenGL rendering of coordination polyhedra.

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

Function Documentation

◆ check_it()

gboolean check_it ( int i,
int j,
int k,
int l )

test this atom id ?

Parameters
i1st summit atom id
j2nd summit atom id
k3rd summit atom id
latom id to test

Definition at line 340 of file d_poly.c.

◆ check_triangles()

void check_triangles ( int s,
GLfloat ** xyz )

check triangle intersection

Parameters
snumber of summits for the polygon
xyzthe coordinates of the summits

Definition at line 360 of file d_poly.c.

◆ create_poly_lists()

void create_poly_lists ( )

prepare coordination polyhedra(s) OpenGL rendering

Definition at line 630 of file d_poly.c.

◆ get_centroid()

void get_centroid ( GLfloat ** xyz,
int id )

find the barycenter of a polyhedron

Parameters
xyzthe OpenGL buffer data to fill
idthe number of summits

Definition at line 267 of file d_poly.c.

◆ get_triangle_normal()

vec3_t get_triangle_normal ( vec3_t v1,
vec3_t v2,
vec3_t v3 )

compute triangle normal vector

Parameters
v11st summit
v22nd summit
v33rd summit

Definition at line 101 of file d_poly.c.

◆ is_atom_cloned()

int is_atom_cloned ( int at)

does this atom have clone(s) ?

Parameters
atthe atom id to test

Definition at line 613 of file d_poly.c.

◆ is_in_triangle()

gboolean is_in_triangle ( vec3_t p,
vec3_t a,
vec3_t b,
vec3_t c )

is this point inside a triangle ?

Parameters
pthe position to test
a1st summit of the triangle
b2nd summit of the triangle
c3rd summit of the triangle

Definition at line 314 of file d_poly.c.

◆ is_inside()

gboolean is_inside ( vec3_t p,
float * mi,
float * ma )

is this point inside the polyhedron ?

Parameters
pthe position to test
mithe min values in the summits coordinates on each axis
mathe max values in the summits coordinates on each axis

Definition at line 289 of file d_poly.c.

◆ prepare_poly_gl()

void prepare_poly_gl ( float * vertices,
atom at,
int c )

prepare the OpenGL rendering of a polyhedron

Parameters
verticesthe OpenGL data buffer to fill
atthe atom origin of the polyhedron
cthe coordination (0= total, 1= partial)

Definition at line 515 of file d_poly.c.

◆ setup_polyhedron()

void setup_polyhedron ( float * vertices,
GLfloat ** xyz,
int s )

fill the OpenGL data buffer for a polyhedron to render

Parameters
verticesthe OpenGL buffer data to fill
xyzthe summits coordinates
sthe number of summits

Definition at line 152 of file d_poly.c.

◆ setup_summit()

void setup_summit ( float * vertices,
vec3_t s,
vec3_t n )

prepare the polygon summit to render

Parameters
verticesthe OpenGL data buffer to fill
sposition vector
nnormal vector

Definition at line 76 of file d_poly.c.

◆ setup_tetra()

void setup_tetra ( float * vertices,
vec3_t a,
vec3_t b,
vec3_t c,
vec3_t d )

fill the OpenGL data buffer for a tetrahedra to render

Parameters
verticesthe OpenGL buffer data to fill
a1st summit
b2nd summit
c3rd summit
d4th summit

Definition at line 211 of file d_poly.c.

◆ setup_tetrahedron()

void setup_tetrahedron ( float * vertices,
GLfloat ** xyz )

fill the OpenGL data buffer for a tetrahedra to render

Parameters
verticesthe OpenGL buffer data to fill
xyzthe summits coordinates

Definition at line 227 of file d_poly.c.

◆ setup_triangles()

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

setup triangle veertices

Parameters
vertices
sa1st summit
sb2nd summit
sc3rd summit

Definition at line 126 of file d_poly.c.

Variable Documentation

◆ centroid

vec3_t centroid

Definition at line 59 of file d_poly.c.

◆ do_gl

gboolean* do_gl

Definition at line 58 of file d_poly.c.

◆ nba

int nba

Definition at line 62 of file d_poly.c.

◆ nbl

int nbl

Definition at line 62 of file d_poly.c.

◆ nbs

int nbs
extern

Definition at line 176 of file d_atoms.c.

◆ pcol

ColRGBA pcol

Definition at line 60 of file d_poly.c.

◆ poly_alpha

float poly_alpha

Definition at line 65 of file d_poly.c.

◆ the_sign

float the_sign

Definition at line 64 of file d_poly.c.