62extern G_MODULE_EXPORT
void window_measures (GtkWidget * widg, gpointer data);
84 for (k=0; k < this_proj -> modelgl ->
bonds[j][
b]; k++)
86 l = this_proj -> modelgl -> bondid[j][
b][k][0];
87 m = this_proj -> modelgl -> bondid[j][
b][k][1];
88 if (this_proj ->
atoms[j][l].show[
b]) i ++;
89 if (i ==
id)
return k;
92 if (this_proj ->
atoms[j][l].show[
b]) i ++;
93 if (i ==
id)
return k;
95 if (this_proj ->
atoms[j][m].show[
b]) i ++;
96 if (i ==
id)
return k;
99 if (this_proj ->
atoms[j][m].show[
b]) i ++;
100 if (i ==
id)
return k;
118 i = this_proj -> modelgl -> clones_to_be_picked - 1;
119 j = this_proj -> modelgl -> anim -> last ->
img ->
step;
121 if (k < 0 && this_proj -> modelgl -> anim -> last ->
img -> draw_clones)
155 j = this_proj -> modelgl -> anim -> last ->
img ->
step;
156 for (k=0; k<this_proj -> natomes; k++)
158 if (this_proj ->
atoms[j][k].show[0]) i++;
159 if (i ==
id)
return k;
161 if (this_proj -> modelgl -> anim -> last ->
img -> draw_clones)
163 for (k=0; k < this_proj -> modelgl ->
bonds[j][1]; k++)
165 l = this_proj -> modelgl -> bondid[
step][1][k][0];
166 m = this_proj -> modelgl -> bondid[
step][1][k][1];
167 if (this_proj ->
atoms[j][l].show[1]) i++;
168 if (i ==
id)
return l;
169 if (this_proj ->
atoms[j][m].show[1]) i++;
170 if (i ==
id)
return m;
197 return i*(i-1)*(i-2)/2;
209 return i*(i-1)*(i-2)*(i-3)/2;
235 g_free (
img -> selected[
pi] -> selected_dihedrals);
282 g_free (
img -> selected[
pi] -> selected_angles);
329 g_free (
img -> selected[
pi] -> selected_bonds);
355 if (view -> measure_win != NULL)
357 if (view -> measure_win -> selection_tree[0] != NULL)
410 if (view -> measure_win != NULL)
412 if (view -> measure_win -> selection_tree[i] != NULL)
452 selection = at_list -> last;
453 if (at_list -> selected == 0)
456 at_list -> last = at_list -> first;
461 selection -> next -> prev = selection;
462 at_list -> last = selection -> next;
467 selection = at_list -> first;
468 for (i=0; i<at_list -> selected; i++)
470 if (selection ->
id == at ->
id)
472 if (i == 0 && at_list -> selected == 1)
474 at_list -> last = NULL;
475 at_list -> first = NULL;
479 at_list -> first = at_list -> first -> next;
480 at_list -> first -> prev = NULL;
484 if (i == at_list -> selected-1)
486 at_list -> last = selection -> prev;
487 at_list -> last -> next = NULL;
491 selection -> next -> prev = selection -> prev;
492 selection -> prev -> next = selection -> next;
497 if (selection -> next != NULL) selection = selection -> next;
517 i = view -> anim -> last ->
img ->
step;
522 this_proj ->
atoms[i][id].pick[
pi] = FALSE;
524 view -> anim -> last ->
img -> selected[
pi] -> selected --;
525 view -> prepare_motion = TRUE;
529 this_proj ->
atoms[i][id].pick[
pi] = FALSE;
530 this_proj ->
atoms[i][id].label[ac] = FALSE;
533 view -> anim -> last ->
img -> selected[
pi] -> selected --;
534 view -> prepare_motion = TRUE;
538 this_proj ->
atoms[i][id].label[ac] = TRUE;
544 this_proj ->
atoms[i][id].pick[
pi] = TRUE;
546 view -> anim -> last ->
img -> selected[
pi] -> selected ++;
547 view -> prepare_motion = TRUE;
565 j = view -> anim -> last ->
img ->
step;
566 k = this_proj ->
atoms[j][id].pick[
pi];
567 for (i=0; i<this_proj -> steps; i++)
575 this_proj ->
atoms[i][id].pick[
pi] = ! k;
592 int i, j, k, l, m, n, o, p, q;
593 view -> picked = FALSE;
596 int scale = gtk_widget_get_scale_factor (view -> win);
597 glGetIntegerv (GL_VIEWPORT, viewport);
598 glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
599 glReadPixels (
scale * view -> mouseX, viewport[3] -
scale * view -> mouseY, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
601 int picked_id = pixel[0] + 256*pixel[1] + 256*256*pixel[2];
602 for (i=0; i<view -> to_be_picked; i++)
604 if (picked_id == view -> color_to_pick[i])
607 view -> picked = TRUE;
619 l = view -> anim -> last ->
img ->
step;
620 if (j < view -> clones_to_be_picked)
623 n = (j < view -> atoms_to_be_picked) ? 0 : 1;
626 q = this_proj ->
atoms[l][m].pick[k];
631 n = (j < view -> bonds_to_be_picked) ? 0 : 1;
632 o = view -> bondid[l][n][m][0];
633 p = view -> bondid[l][n][m][1];
639 if (event_button == 1)
644 if (j < view -> clones_to_be_picked)
655 else if (view -> selection_mode == 1)
658 if (j < view -> clones_to_be_picked)
682 if (view -> selection_mode > 3)
684 p = view -> selection_mode-2;
688 p = view -> selection_mode;
690 if (j < view -> clones_to_be_picked)
693 o = this_proj ->
atoms[l][m].pick[0];
698 o = this_proj ->
atoms[l][o].pick[0];
700 if (view -> selection_mode > 3)
722 view -> baryc[1] =
get_bary (this_proj, 1);
726 view -> create_shaders[
LABEL] = TRUE;
727 view -> create_shaders[
MEASU] = TRUE;
731 else if (event_button == 3)
745 else if (event_button == 3)
Function declarations for the mode edition window.
void init_coordinates(project *this_proj, int status, gboolean win, gboolean init)
preserve atomic coordinates
vec3_t get_bary(project *this_proj, int status)
get barycenter of atomic coordinates
double scale(double axe)
find appropriate major tick spacing based on axis length
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
int ** allocdint(int xal, int yal)
allocate an int ** pointer
int * allocint(int val)
allocate an int * 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 ?
void opengl_project_changed(int id)
change the OpenGL project
G_MODULE_EXPORT void select_unselect_this_atom(GtkWidget *widg, gpointer data)
select / unselect this atom callback GTK3
G_MODULE_EXPORT void select_unselect_atoms(GtkWidget *widg, gpointer data)
select / unselect a type of atom(s) callback GTK3
G_MODULE_EXPORT void select_unselect_coord(GtkWidget *widg, gpointer data)
select / unselect a type of coordination callback GTK3
project * get_project_by_id(int p)
get project pointer using id number
void update(glwin *view)
update the rendering of the OpenGL window
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
#define MAX_IN_SELECTION
Maximum number of atoms in selection to display measure information.
int check_label_numbers(project *this_proj, int types)
check how many atom label(s) are visible
void update_selection_tree(glwin *view, int pi, int id)
update measurements tree view
shaders
The different types of shaders in the atomes program.
Messaging function declarations.
void update_dihedral_selection(glwin *view, int pi)
update the dihedral selection data
int num_bonds(int i)
number of distinct pair(s) of atoms in selection
void save_angle_selection(glwin *view, int pi)
save the angle selection data
int find_selected_bond(project *this_proj, int id)
find the selected bond based of the picked color id
void update_angle_selection(glwin *view, int pi)
update the angle selection data
int num_dihedrals(int i)
number of distinct quadruplet(s) of atoms in selection
void dihedrals_loop(glwin *view, int id, int pi, GtkTreeStore *store)
do things for the measured dihedrals selection
void update_selection_list(atom_selection *at_list, atom *at, gboolean add)
update the selection list adding or removing an atom
void save_bond_selection(glwin *view, int pi)
save the bond selection data
void save_dihedral_selection(glwin *view, int pi)
save the dihedral selection data
int get_to_be_selected(glwin *view)
find which atom(s) are to be selected
int num_angles(int i)
number of distinct triplet(s) of atoms in selection
atom_in_selection * new_atom_in_selection(int id, int sp)
create a selected atom
void angles_loop(glwin *view, int id, int pi, GtkTreeStore *store)
do things for the measured angles selection
void update_label_selection(glwin *view, int pi)
update the text information for the number of atoms/measures in selection
int find_selected_atom(project *this_proj, int id)
find the selected atom based of the picked color id
void process_the_hits(glwin *view, gint event_button, double ptx, double pty)
process a mouse click
void bonds_loop(glwin *view, int id, int pi, GtkTreeStore *store)
do things for the measured distances selection
int find_bond_in_bonds(project *this_proj, int i, int j, int b, int id)
Find for a bond ID in the bond list using the atoms in the bond.
void process_selected_atom(project *this_proj, glwin *view, int id, int ac, int se, int pi)
process selected atom
G_MODULE_EXPORT void window_measures(GtkWidget *widg, gpointer data)
create the measurements window
void update_all_selections(glwin *view, int pi)
update the selection data: bonds, angles and dihedrals
void save_all_selections(glwin *view, int pi)
save all selection data
int * object_was_selected[3]
void process_selection(project *this_proj, glwin *view, int id, int ac, int pi)
process selection
void update_bond_selection(glwin *view, int pi)
update the bond selection data