106 dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
"Are you sure ?");
107 gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", question);
108 gtk_window_set_title(GTK_WINDOW(dialog),
"Please confirm");
124 if (! old_sel -> selected)
return new_sel;
125 new_sel -> selected = old_sel -> selected;
126 at = old_sel -> first;
127 for (i=0; i< old_sel -> selected; i++)
132 bt = new_sel -> first;
133 new_sel -> last = NULL;
138 bt -> next -> prev = bt;
141 if (at -> next != NULL) at = at -> next;
144 new_sel -> last = bt;
148 new_sel -> selected_bonds =
allocint (i);
151 new_sel -> selected_bonds[j] = old_sel -> selected_bonds[j];
153 if (new_sel -> selected > 2)
156 new_sel -> selected_angles =
allocint (i);
159 new_sel -> selected_angles[j] = old_sel -> selected_angles[j];
164 new_sel -> selected_dihedrals =
allocint (i);
167 new_sel -> selected_dihedrals[j] = old_sel -> selected_dihedrals[j];
189 for (j=0; j<this_proj -> steps; j++)
191 for (k=0; k<this_proj -> natomes; k++)
193 if (j == view -> anim -> last ->
img ->
step)
202 this_proj ->
atoms[j][k].pick[i] = FALSE;
226 if (view -> anim -> last ->
img -> selected[i] -> selected)
231 for (j=0; j<this_proj -> steps; j++)
233 this_proj ->
atoms[j][at -> id].pick[i] = TRUE;
238 if (view -> stored_labels[i])
240 for (j=1; j<view -> stored_labels[i][0]; j++)
242 k = view -> stored_labels[i][j];
243 for (l=0; l<this_proj -> steps; l++) this_proj ->
atoms[l][k].
label[i] = TRUE;
245 g_free (view -> stored_labels[i]);
246 view -> stored_labels[i] = NULL;
268 h = view -> anim -> last ->
img ->
step;
277 view -> stored_labels[i] =
allocint(k+1);
278 view -> stored_labels[i][0] = k+1;
281 for (l=0; l<this_proj -> natomes; l++)
287 view -> stored_labels[i][k] = l;
288 this_proj ->
atoms[h][l].label[i] = FALSE;
311 int p = the_data ->
a;
312 int t = the_data ->
b;
320 gchar * info = g_strdup_printf (
" %s contains %d different sets of atomic coordinates. \n"
321 " Please select the one to use to create the input file(s) \n"
322 " Note that a new project will be generated for that purpose. \n",
atom_selection * duplicate_ogl_selection(atom_selection *old_sel)
copy an atom selection
void field_question(gchar *question, GCallback handler, gpointer data)
ask the use to confirm something
int num_bonds(int i)
number of distinct pair(s) of atoms in selection
GtkTextBuffer * qmbuffer[MAXDATAQM+2]
void create_new_project_using_data(atom_selection *selection)
create new project using an atom selection
gboolean selection_confirmed
void unselect_all_atoms(glwin *view)
remove all atom(s) from selection
G_MODULE_EXPORT void confirm_selection(GtkDialog *dialog, gint response_id, gpointer data)
confirm that the selection is good
G_MODULE_EXPORT void create_field(GtkWidget *widg, gpointer data)
start an input creation assistant
int num_dihedrals(int i)
number of distinct quadruplet(s) of atoms in selection
char * input_types[NINPUTS]
void restore_ogl_selection(glwin *view)
restore a saved atom selection
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 create_qm_input_file(int c, int p, int s)
initialize an ab-initio MD input file creation assistant
void create_classical_force_field(int p, int f)
create classical force field prepare the assistant
void preserve_ogl_selection(glwin *view)
copy the atom selection, so that it can be re-used once the input assistant is closed.
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
void process_selected_atom(project *this_proj, glwin *view, int id, int ac, int se, int pi)
process selected atom
atom_in_selection * tmp_a
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
int * allocint(int val)
allocate an int * pointer
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
void opengl_project_changed(int id)
change the OpenGL project
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
G_MODULE_EXPORT void select_unselect_atoms(GtkWidget *widg, gpointer data)
select / unselect a type of atom(s) 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...
#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_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
Function declarations for the creation of the OpenGL window.
int iask(char *question, char *lab, int id, GtkWidget *win)
enter an integer value - prepare the dialog
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void active_project_changed(int id)
change the active project