96 str = g_strdup_printf(
"%.1lf° (PBC)", real_theta.
angle);
100 str = g_strdup_printf(
"%.1lf°", real_theta.
angle);
102 float ls[3] = {15.0, 15.0, 0.0};
103 vec3_t pos = vec3(bt ->
x, bt ->
y, bt ->
z);
148 vec3_t pos_a, pos_b, pos_c;
149 atom * at, * bt, * ct;
154 for (p=0; p<
plot -> extra_cell[0]+1;p++)
156 for (q=0; q<
plot -> extra_cell[1]+1; q++)
158 for (r=0; r<
plot -> extra_cell[2]+1; r++)
166 pos_a = vec3(at ->
x, at ->
y, at ->
z);
167 pos_b = vec3(bt ->
x, bt ->
y, bt ->
z);
168 pos_c = vec3(ct ->
x, ct ->
y, ct ->
z);
218 for (i=0; i <
img -> selected[
pi] -> selected; i++)
221 for (j=0; j <
img -> selected[
pi] -> selected; j++)
226 for (k=0; k <
img -> selected[
pi] -> selected; k++)
231 for (l=0; l<aid; l++)
233 if (did_it[l][1] ==
tmp_b ->
id &&
234 ((did_it[l][0] ==
tmp_a ->
id && did_it[l][2] ==
tmp_c ->
id)
235 || (did_it[l][2] ==
tmp_a ->
id && did_it[l][0] ==
tmp_c ->
id)))
243 did_it[aid][0] =
tmp_a -> id;
244 did_it[aid][1] =
tmp_b -> id;
245 did_it[aid][2] =
tmp_c -> id;
249 for (m=0; m<3; m++)
tmp_object_id[1][aid][m] = did_it[aid][m];
252 img -> selected[
pi] -> selected_angles[aid] = 0;
255 if (
img -> selected[
pi] -> selected_angles[aid] ||
img -> m_is_pressed == 2 ||
id == 2)
288 for (i=0; i<n_angl; i++)
333 for (i=0; i <
img -> selected[
pi] -> selected; i++)
336 for (j=0; j <
img -> selected[
pi] -> selected; j++)
341 for (k=0; k <
img -> selected[
pi] -> selected; k++)
346 for (l=0; l <
img -> selected[
pi] -> selected; l++)
351 for (m=0; m<did; m++)
353 if ((did_it[m][0] ==
tmp_a ->
id && did_it[m][1] ==
tmp_b ->
id && did_it[m][2] ==
tmp_c ->
id && did_it[m][3] ==
tmp_d ->
id)
354 ||(did_it[m][0] ==
tmp_d ->
id && did_it[m][1] ==
tmp_c ->
id && did_it[m][2] ==
tmp_b ->
id && did_it[m][3] ==
tmp_a ->
id))
362 did_it[did][0] =
tmp_a -> id;
363 did_it[did][1] =
tmp_b -> id;
364 did_it[did][2] =
tmp_c -> id;
365 did_it[did][3] =
tmp_d -> id;
369 for (m=0; m<4; m++)
tmp_object_id[2][did][m] = did_it[did][m];
372 img -> selected[
pi] -> selected_dihedrals[did] = 0;
375 if (
img -> selected[
pi] -> selected_dihedrals[did] ||
img -> m_is_pressed == 3 ||
id == 2)
414 for (i=0; i<n_dihedral; i++)
444 pos = vec3 (at ->
x - (at ->
x - bt ->
x)/2.0, at ->
y - (at ->
y - bt ->
y)/2.0, at ->
z - (at ->
z - bt ->
z)/2.0);
453 str = g_strdup_printf(
"%.3lf Å (PBC)",
dist.length);
457 str = g_strdup_printf(
"%.3lf Å",
dist.length);
459 float ls[3] = {-15.0, 15.0, 0.0};
484 for (p=0; p<
plot -> extra_cell[0]+1;p++)
486 for (q=0; q<
plot -> extra_cell[1]+1; q++)
488 for (r=0; r<
plot -> extra_cell[2]+1; r++)
495 pos_a = vec3(at ->
x, at ->
y, at ->
z);
496 pos_b = vec3(bt ->
x, bt ->
y, bt ->
z);
542 for (i=0; i <
img -> selected[
pi] -> selected-1; i++)
545 for (j=i+1; j <
img -> selected[
pi] -> selected; j++)
548 did_it[bid][0] =
tmp_a -> id;
549 did_it[bid][1] =
tmp_b -> id;
557 img -> selected[
pi] -> selected_bonds[bid] = 0;
560 if (
img -> selected[
pi] -> selected_bonds[bid] ||
img -> m_is_pressed == 1 ||
id == 2)
582 if (
id == 1) g_free (
shift);
585 for (i=0; i<n_dist; i++)
613 if (
plot -> mpattern > -1)
618 measure -> num_vertices = 2 *
num_bonds (
plot -> selected[type] -> selected) * (
plot -> extra_cell[0]+1)*(
plot -> extra_cell[1]+1)*(
plot -> extra_cell[2]+1);
623 if (
plot -> mpattern != 2)
636 if (
plot -> selected[type] -> selected > 2)
644 if (
plot -> mpattern != 2)
658 if (
plot -> labels_list[3+type] != NULL)
662 nshaders += (
plot -> labels_render[3+type]+1) * (
plot -> labels_list[3+type] -> last ->
id + 1);
677 g_debug (
"Measure LIST");
691 if (
plot -> mpattern > -1)
694 if (
plot -> selected[j] -> selected > 2)
wingl -> n_shaders[
MEASU][0] ++;
700 if (
plot -> selected[j] -> selected >= 3)
706 if (
plot -> labels_list[3+j] != NULL)
709 wingl -> n_shaders[
MEASU][0] += (
plot -> labels_render[3+j]+1) * (
plot -> labels_list[3+j] -> last ->
id + 1);
void clean_labels(int id)
clean atomic label shaders
void setup_this_measured_angle(int s, int sa, int sb, int sc, int pi)
prepare measured angle to render
void set_measure_color(int selected, int id, int num)
set measure color
int num_bonds(int i)
number of distinct pair(s) of atoms in selection
double arc_cos(double val)
compute arc cosinus
void unrotate_camera()
unrotate OpenGL camera
void fill_angle_model_row(int p, int a, int b, int c, GtkTreeStore *store)
fill angle tree store row
atom_in_selection * tmp_c
int num_dihedrals(int i)
number of distinct quadruplet(s) of atoms in selection
void draw_bond_label(atom *at, atom *bt, int pi)
prepare a measured distance OpenGL rendering
void dihedrals_loop(glwin *view, int id, int pi, GtkTreeStore *store)
do things for the measured dihedrals selection
void setup_this_measured_bond(int s, int sa, int sb, int pi)
prepare measured distance to render
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
atom_in_selection * tmp_d
void fill_dihedral_model_row(int p, int a, int b, int c, int d, GtkTreeStore *store)
fill dihedral tree store row
int prepare_measure_shaders(int type, int shaders)
prepare measure OpenGL rendering
int num_angles(int i)
number of distinct triplet(s) of atoms in selection
void angles_loop(glwin *view, int id, int pi, GtkTreeStore *store)
do things for the measured angles selection
void bonds_loop(glwin *view, int id, int pi, GtkTreeStore *store)
do things for the measured distances selection
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 draw_angle_label(atom *at, atom *bt, atom *ct, int pi)
prepare an measured angle label OpenGL rendering
int * object_was_selected[3]
void fill_bond_model_row(int p, int a, int b, GtkTreeStore *store)
fill bond tree store row
atom_in_selection * tmp_a
void create_measures_lists()
prepare measure(s) OpenGL rendering
atom_in_selection * tmp_b
angle angle_3d(cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct)
angle between atom a, b and c in 3D
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
int ** allocdint(int xal, int yal)
allocate an int ** pointer
int * allocint(int val)
allocate an int * pointer
float * allocfloat(int val)
allocate a float * pointer
Global variable declarations Global convenience function declarations Global data structure defin...
gboolean is_atom_win_active(glwin *view)
is the model edition window visible ?
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void at_unshift(atom *at, float *shift)
correct atomic coordinates modified to display image in cell replica
#define MAX_IN_SELECTION
Maximum number of atoms in selection to display measure information.
void at_shift(atom *at, float *shift)
modify atomic coordinates to display image in cell replica
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
glsl_program * init_shader_program(int object, int object_id, const GLchar *vertex, const GLchar *geometry, const GLchar *fragment, GLenum type_of_vertices, int narray, int nunif, gboolean lightning, object_3d *obj)
create an OpenGL shader program
shaders
The different types of shaders in the atomes program.
const GLchar * line_stipple_color
const GLchar * angle_stipple
const GLchar * angle_vertex
const GLchar * line_color
const GLchar * line_stipple
const GLchar * angle_color
const GLchar * line_vertex
void prepare_string(char *text, int id, ColRGBA col, vec3_t pos, float lshift[3], atom *at, atom *bt, atom *ct)
prepare a screen string to be rendered
void render_all_strings(int glsl, int id)
render all string to be rendered for a label list