72char *
box_p[2]={
"<b>Edges [Å]</b>",
"<b>Angles [°]</b>"};
73char *
box_prop[2][3]={{
"<b><i>a</i></b>",
"<b><i>b</i></b>",
"<b><i>c</i></b>"},
74 {
"alpha - α",
"beta - β",
"gamma - ɣ"}};
76 "Atomic number",
"Atomic mass:",
"Radius",
77 "Neutrons scattering length:",
"X-rays scattering length:"};
78char *
chem_rad[4]={
"Covalent",
"Ionic",
"van Der Waals",
"In crystal"};
79char *
chem_unit[4]={
" g/mol",
" Å",
" fm",
" e.u"};
80char *
edit_prop[4]={
"Chemistry and physics",
"Box and periodicity",
"Bond cutoffs",
"Lattice vectors"};
81char *
vect_name[3]={
"<i>a</i>",
"<i>b</i>",
"<i>c</i>"};
107G_MODULE_EXPORT
void update_box (GtkEntry * entry, gpointer data)
128G_MODULE_EXPORT
void toggle_pbc (GtkCheckButton * Button, gpointer data)
138G_MODULE_EXPORT
void toggle_pbc (GtkToggleButton * Button, gpointer data)
142 tmp_pbc = gtk_check_button_get_active (Button);
144 tmp_pbc = gtk_toggle_button_get_active (Button);
157G_MODULE_EXPORT
void toggle_frac (GtkCheckButton * Button, gpointer data)
167G_MODULE_EXPORT
void toggle_frac (GtkToggleButton * Button, gpointer data)
171 tmp_frac = gtk_check_button_get_active (Button);
173 tmp_frac = gtk_toggle_button_get_active (Button);
211G_MODULE_EXPORT
void run_vectors (GtkDialog * win, gint response_id, gpointer data)
213 if (response_id == GTK_RESPONSE_APPLY)
245 GtkWidget * table = gtk_grid_new ();
266 gtk_grid_attach (GTK_GRID (table),
vect_entry[k], j, i, 1, 1);
296 GtkWidget * table = gtk_grid_new ();
301 for (j=0; j<3; j++, k++)
313 gtk_grid_attach (GTK_GRID (table),
markup_label(
box_p[i], -1, 50, 0.5, 0.5), 1, i+2*i, 1, 1);
314 for (j=0; j<3; j++, k++)
316 gtk_grid_attach (GTK_GRID (table),
markup_label(
box_prop[i][j], -1, -1, 0.5, 0.5), j, i+2*i+1, 1, 1);
319 gtk_grid_attach (GTK_GRID (table), entry, j, i+2*i+2, 1, 1);
338 int i = gtk_combo_box_get_active (GTK_COMBO_BOX(
spec_box));
339 int j = GPOINTER_TO_INT(data);
357 i = gtk_combo_box_get_active (combo);
364 gtk_combo_box_set_active (GTK_COMBO_BOX(
rad_box), -1);
378 i = gtk_combo_box_get_active (combo);
381 j = gtk_combo_box_get_active (GTK_COMBO_BOX(
spec_box));
397G_MODULE_EXPORT
void toggle_xcor (GtkCheckButton * but, gpointer data)
407G_MODULE_EXPORT
void toggle_xcor (GtkToggleButton * but, gpointer data)
411 tmp_xcor = gtk_check_button_get_active (but);
413 tmp_xcor = gtk_toggle_button_get_active (but);
431 GtkWidget * table = gtk_grid_new ();
433 GtkWidget * chem_fixed = gtk_fixed_new ();
434 gtk_grid_attach (GTK_GRID (table), chem_fixed, 1, 0, 1, 1);
437 j = (i == 0) ? i : i + 2;
451 gtk_grid_attach (GTK_GRID (table),
chem_spec[i-1], 1, i+2, 1, 1);
458 gtk_widget_set_size_request (
rad_box, -1, 30);
463 gtk_combo_box_set_active (GTK_COMBO_BOX(
rad_box), -1);
465 gtk_grid_attach (GTK_GRID (table),
rad_box, 1, i+1, 1, 1);
474 gtk_grid_attach (GTK_GRID (table),
chem_entry[i-3], 2, i+2, 1, 1);
480 gtk_grid_attach (GTK_GRID (table), chem_xcor, 1, i+2, 1, 1);
486 gtk_combo_box_set_active (GTK_COMBO_BOX(
spec_box), 0);
487 gtk_fixed_put (GTK_FIXED (chem_fixed),
spec_box, -1, -1);
498gboolean
test_vol (
double box[2][3],
double vect[3][3])
507 if (box[i][j] == 0.0)
val = FALSE;
514 if (vect[i][0] == 0.0 && vect[i][1] == 0.0 && vect[i][2] == 0.0)
520 return (
tmp_lat) ? TRUE : FALSE;
533gboolean
test_pbc (
int pbc,
int frac,
double box[2][3],
double vect[3][3])
561 for (i=0; i<3; i=i+2)
573 gboolean changed = FALSE;
591 gboolean changed = FALSE;
619 if (tmp_lat < 2 && tmp_lat != active_cell -> ltype)
active_project -> run = 0;
708 gchar * mess =
"To define the existence of a bond between two atoms i (α) and j (β)."
709 "\n\tA bond exits if the two following conditions are verified:\n"
710 "\n\t\t1) D<sub>ij</sub> < first minimum of the total g(r) - r<sub>cut</sub> (Tot.)"
711 "\n\t\t2) D<sub>ij</sub> < first minimum of the partial gr<sub>α,β</sub>(r) - r<sub>cut</sub> (α,β)\n"
712 "\n\t0.0 < r<sub>cut</sub> ≤ D<sub>max</sub>";
713 gchar * fin =
"\n\tD<sub>max</sub> is the maximum inter-atomic distance in the model\n";
717 str = g_strdup_printf (
"%s\twith\tD<sub>max</sub> = %f Å%s",
722 str = g_strdup_printf (
"%s%s", mess, fin);
744 int id = GPOINTER_TO_INT(data);
745 int i = (
id < 2) ?
id : (
id > 2 &&
id < 5) ? 1 : 2;
747 gboolean done = FALSE;
748 char * errpbc =
"To apply PBC or use fractional coordinates\n"
749 "describe properly the simulation box parameters";
752 case GTK_RESPONSE_APPLY:
790 upc =
ask_yes_no (
"Data can be lost !",
"You will lose\n rings statistics and/or chains statistics data\nProceed anyway ?", GTK_MESSAGE_WARNING, GTK_WIDGET(win));
838 gboolean skip = FALSE;
839 int id = GPOINTER_TO_INT(data);
840 i = (
id < 2) ?
id : (
id > 2 &&
id < 5) ? 1 : 2;
843 gtk_box_set_homogeneous (GTK_BOX(box), FALSE);
Binding to the Fortran90 subroutines.
double set_radius_(int *, int *)
void run_project()
send project data to Fortran90
Callback declarations for main window.
integer function chains()
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * dialog_cancel_apply(gchar *title, GtkWidget *parent, gboolean resiz)
create a dialog modal offering a choice to apply something or not
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
#define ATOM_LIMIT
atom number limit to compute fragment(s) and molecule(s) analysis automatically
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
chemical_data * active_chem
void opengl_project_changed(int id)
change the OpenGL project
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Function declarations for the creation of the OpenGL window.
void show_warning(char *warning, GtkWidget *win)
show warning
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
Messaging function declarations.
void prep_calc_actions()
prepare analysis widgets
Function declarations for reading atomes project file Function declarations for saving atomes proje...
Function declarations for workspace managment.