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

Functions handling the atom and bond selection process in the OpenGL window. More...

#include "global.h"
#include "interface.h"
#include "glview.h"
#include "atom_edit.h"
+ Include dependency graph for selection.c:

Go to the source code of this file.

Functions

G_MODULE_EXPORT void window_measures (GtkWidget *widg, gpointer data)
 create the measurements window
 
void dihedrals_loop (glwin *view, int id, int pi, GtkTreeStore *store)
 do things for the measured dihedrals 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 update_label_selection (glwin *view, int pi)
 update the text information for the number of atoms/measures in selection
 
int get_to_be_selected (glwin *view)
 find which atom(s) are to be selected
 
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.
 
int find_selected_bond (project *this_proj, int id)
 find the selected bond based of the picked color id
 
int find_selected_atom (project *this_proj, int id)
 find the selected atom based of the picked color id
 
int num_bonds (int i)
 number of distinct pair(s) of atoms in selection
 
int num_angles (int i)
 number of distinct triplet(s) of atoms in selection
 
int num_dihedrals (int i)
 number of distinct quadruplet(s) of atoms in selection
 
void save_dihedral_selection (glwin *view, int pi)
 save the dihedral selection data
 
void update_dihedral_selection (glwin *view, int pi)
 update the dihedral selection data
 
void save_angle_selection (glwin *view, int pi)
 save the angle selection data
 
void update_angle_selection (glwin *view, int pi)
 update the angle selection data
 
void save_bond_selection (glwin *view, int pi)
 save the bond selection data
 
void update_bond_selection (glwin *view, int pi)
 update the bond selection data
 
void save_all_selections (glwin *view, int pi)
 save all selection data
 
void update_all_selections (glwin *view, int pi)
 update the selection data: bonds, angles and dihedrals
 
atom_in_selectionnew_atom_in_selection (int id, int sp)
 create a selected atom
 
void update_selection_list (atom_selection *at_list, atom *at, gboolean add)
 update the selection list adding or removing an atom
 
void process_selected_atom (project *this_proj, glwin *view, int id, int ac, int se, int pi)
 process selected atom
 
void process_selection (project *this_proj, glwin *view, int id, int ac, int pi)
 process selection
 
void process_the_hits (glwin *view, gint event_button, double ptx, double pty)
 process a mouse click
 

Variables

int selected_aspec
 
int objects [3] = {0, 0, 0}
 
int * object_was_selected [3] = {NULL, NULL, NULL}
 
int ** tmp_object_id [3] = {NULL, NULL, NULL}
 

Detailed Description

Functions handling the atom and bond selection process in the OpenGL window.

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

Function Documentation

◆ angles_loop()

void angles_loop ( glwin * view,
int id,
int pi,
GtkTreeStore * store )
extern

do things for the measured angles selection

Parameters
viewthe target glwin
idaction to perform:
-2 = save angles selection,
-1 = clean angles selection,
0 = prepare OpenGL buffer data analysis mode selection measure,
1 = prepare OpenGL buffer data edition mode selection measure,
2 = fill angles tree store measures window
pi0 = mouse analysis mode, 1 = mouse edition mode
storethe tree store to fill, if any

Definition at line 204 of file d_measures.c.

◆ bonds_loop()

void bonds_loop ( glwin * view,
int id,
int pi,
GtkTreeStore * store )
extern

do things for the measured distances selection

Parameters
viewthe target glwin
idaction to perform:
-2 = save bonds selection
-1 = clean bonds selection
0 = prepare OpenGL buffer data analysis mode selection measure
1 = prepare OpenGL buffer data edition mode selection measure
2 = fill bonds distances tree store measures window
pi0 = mouse analysis mode, 1 = mouse edition mode
storethe tree store to fill, if any

Definition at line 530 of file d_measures.c.

◆ dihedrals_loop()

void dihedrals_loop ( glwin * view,
int id,
int pi,
GtkTreeStore * store )
extern

do things for the measured dihedrals selection

Parameters
viewthe target glwin
idaction to perform:
-2 = save dihedrals selection
-1 = clean dihedrals selection
0 = prepare OpenGL buffer data analysis mode selection measure
1 = prepare OpenGL buffer data edition mode selection measure
2 = fill dihedrals tree store measures window
pi0 = mouse analysis mode, 1 = mouse edition mode
storethe tree store to fill, if any

Definition at line 319 of file d_measures.c.

◆ find_bond_in_bonds()

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.

Parameters
this_projthe target project
iid tracker
jthe MD step
b0 = normal, 1 = clones
idthe id-th visible bond to find

Definition at line 81 of file selection.c.

◆ find_selected_atom()

int find_selected_atom ( project * this_proj,
int id )

find the selected atom based of the picked color id

Parameters
this_projthe target project
idthe id-th visible atom or clone to find

Definition at line 151 of file selection.c.

◆ find_selected_bond()

int find_selected_bond ( project * this_proj,
int id )

find the selected bond based of the picked color id

Parameters
this_projthe target project
idthe id-th visible bond to find

Definition at line 114 of file selection.c.

◆ get_to_be_selected()

int get_to_be_selected ( glwin * view)
extern

find which atom(s) are to be selected

Parameters
viewthe target glwin

Definition at line 196 of file popup.c.

◆ new_atom_in_selection()

atom_in_selection * new_atom_in_selection ( int id,
int sp )

create a selected atom

Parameters
idatom id
spatom species

Definition at line 428 of file selection.c.

◆ num_angles()

int num_angles ( int i)

number of distinct triplet(s) of atoms in selection

Parameters
ithe number of atom(s) in selection

Definition at line 195 of file selection.c.

◆ num_bonds()

int num_bonds ( int i)

number of distinct pair(s) of atoms in selection

Parameters
ithe number of atom(s) in selection

Definition at line 183 of file selection.c.

◆ num_dihedrals()

int num_dihedrals ( int i)

number of distinct quadruplet(s) of atoms in selection

Parameters
ithe number of atom(s) in selection

Definition at line 207 of file selection.c.

◆ process_selected_atom()

void process_selected_atom ( project * this_proj,
glwin * view,
int id,
int ac,
int se,
int pi )

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.

◆ process_selection()

void process_selection ( project * this_proj,
glwin * view,
int id,
int ac,
int pi )

process selection

Parameters
this_projthe target project
viewthe target glwin
idthe atom id
acatom or clone (0/1)
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 562 of file selection.c.

◆ process_the_hits()

void process_the_hits ( glwin * view,
gint event_button,
double ptx,
double pty )

process a mouse click

Parameters
viewthe target glwin
event_buttonthe event button
ptxx position
ptyy position

Definition at line 590 of file selection.c.

◆ save_all_selections()

void save_all_selections ( glwin * view,
int pi )

save all selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 372 of file selection.c.

◆ save_angle_selection()

void save_angle_selection ( glwin * view,
int pi )

save the angle selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 271 of file selection.c.

◆ save_bond_selection()

void save_bond_selection ( glwin * view,
int pi )

save the bond selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 318 of file selection.c.

◆ save_dihedral_selection()

void save_dihedral_selection ( glwin * view,
int pi )

save the dihedral selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 224 of file selection.c.

◆ update_all_selections()

void update_all_selections ( glwin * view,
int pi )

update the selection data: bonds, angles and dihedrals

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 387 of file selection.c.

◆ update_angle_selection()

void update_angle_selection ( glwin * view,
int pi )

update the angle selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 298 of file selection.c.

◆ update_bond_selection()

void update_bond_selection ( glwin * view,
int pi )

update the bond selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 345 of file selection.c.

◆ update_dihedral_selection()

void update_dihedral_selection ( glwin * view,
int pi )

update the dihedral selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 251 of file selection.c.

◆ update_label_selection()

void update_label_selection ( glwin * view,
int sid )
extern

update the text information for the number of atoms/measures in selection

Parameters
viewthe target glwin
sidthe type of selection (0 = analysis mode, 1 = edition mode)

Definition at line 647 of file w_measures.c.

◆ update_selection_list()

void update_selection_list ( atom_selection * at_list,
atom * at,
gboolean add )

update the selection list adding or removing an atom

Parameters
at_listtarget atom selection
atatom
addadd or remove (1/0)

Definition at line 445 of file selection.c.

◆ window_measures()

G_MODULE_EXPORT void window_measures ( GtkWidget * widg,
gpointer data )
extern

create the measurements window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 738 of file w_measures.c.

Variable Documentation

◆ object_was_selected

int* object_was_selected[3] = {NULL, NULL, NULL}

Definition at line 213 of file selection.c.

◆ objects

int objects[3] = {0, 0, 0}

Definition at line 212 of file selection.c.

◆ selected_aspec

int selected_aspec
extern

Definition at line 179 of file popup.c.

◆ tmp_object_id

int** tmp_object_id[3] = {NULL, NULL, NULL}

Definition at line 214 of file selection.c.