85 if (view -> volume_win)
87 if (view -> volume_win -> win)
91 g_free (view -> volume_win);
92 view -> volume_win = NULL;
97 if (view -> atoms_volume[i]) g_free (view -> atoms_volume[i]);
98 view -> atoms_volume[i] = NULL;
99 if (view -> atoms_ppvolume[i]) g_free (view -> atoms_ppvolume[i]);
100 view -> atoms_ppvolume[i] = NULL;
101 if (view -> volume_box[i]) g_free (view -> volume_box[i]);
102 view -> volume_box[i] = NULL;
103 view -> comp_vol[i] = FALSE;
104 view -> anim -> last ->
img -> show_vol[i] = FALSE;
110 if (view -> frag_mol_volume[i][j]) g_free (view -> frag_mol_volume[i][j]);
111 view -> frag_mol_volume[i][j] = NULL;
112 if (view -> frag_mol_ppvolume[i][j]) g_free (view -> frag_mol_ppvolume[i][j]);
113 view -> frag_mol_ppvolume[i][j] = NULL;
116 if (view -> frag_box[j]) g_free (view -> frag_box[j]);
117 view -> frag_box[j] = NULL;
119 if (view -> fm_comp_vol[i][j]) g_free (view -> fm_comp_vol[i][j]);
120 view -> fm_comp_vol[i][j] = NULL;
121 if (view -> anim -> last ->
img -> fm_show_vol[i][j]) g_free (view -> anim -> last ->
img -> fm_show_vol[i][j]);
122 view -> anim -> last ->
img -> fm_show_vol[i][j] = NULL;
123 if (view -> anim -> last ->
img -> fm_vol_col[i][j]) g_free (view -> anim -> last ->
img -> fm_vol_col[i][j]);
124 view -> anim -> last ->
img -> fm_vol_col[i][j] = NULL;
141 return (
pi/3.0)*ht*ht*(3*dh-ht);
158 rmi =
min (rad, rbd);
159 rma =
max (rad, rbd);
160 px = (dab*dab - rmi*rmi + rma*rma) / (2.0*dab);
162 h2 = rmi - (dab - px);
175 return ((4.0*
pi)/3.0)*rad*rad*rad;
191 int i, j, k, l, m, n, o;
193 double cap_vol = 0.0;
196 for (i=0; i<this_proj -> nspec; i++)
203 for (k=0; k<this_proj -> modelgl ->
bonds[sid][j]; k++)
205 l = this_proj -> modelgl -> bondid[sid][j][k][0];
206 m = this_proj ->
atoms[sid][l].sp;
207 n = this_proj -> modelgl -> bondid[sid][j][k][1];
208 o = this_proj ->
atoms[sid][n].sp;
209 if (gid < 0 || this_proj ->
atoms[sid][l].coord[gid] == gcid)
211 dist =
distance_3d (& this_proj -> cell, (this_proj -> cell.npt) ? sid : 0, & this_proj ->
atoms[sid][l], & this_proj ->
atoms[sid][n]);
219 for (i=0; i<this_proj -> nspec; i++)
229 for (i=0; i<this_proj -> nspec; i++)
231 vol += this_proj -> modelfc -> mols[sid][gcid].species[i] *
sphere_volume (rvdws[i]);
233 vol *= this_proj -> modelfc -> mols[sid][gcid].multiplicity;
235 vol /= this_proj -> modelfc -> mols[sid][gcid].multiplicity;
239 for (i=0; i<this_proj -> natomes; i++)
241 if (this_proj ->
atoms[sid][i].coord[gid] == gcid)
243 j = this_proj ->
atoms[sid][i].sp;
269double molecular_volume (
int nats,
atom * ats_vol,
double baryc[3],
double * rvdws,
double a_ang,
double b_ang,
double c_ang)
274 rot = m4_rotation_xyz (a_ang, b_ang, c_ang);
277 for (i=0; i<nats; i++)
280 c_old = vec3(ats_vol[i].
x+baryc[0], ats_vol[i].
y+baryc[1], ats_vol[i].
z+baryc[2]);
281 c_new = m4_mul_pos (rot, c_old);
284 vamin[0] = c_new.
x - rvdws[j];
285 vamax[0] = c_new.
x + rvdws[j];
286 vamin[1] = c_new.
y - rvdws[j];
287 vamax[1] = c_new.
y + rvdws[j];
288 vamin[2] = c_new.
z - rvdws[j];
289 vamax[2] = c_new.
z + rvdws[j];
312 return draw_cuboid (FALSE,
VOLMS, 0, m4_identity (), vec3(0.0,0.0,0.0), paral, null, 1.0);
330 for (i=0; i<this_proj -> nspec; i++)
336 int a_ang, b_ang, c_ang;
338 int finess = pow (10, this_proj -> modelgl -> volume_win -> angp);
340 atom * ats_vol = NULL;
348 rtmp = this_proj -> modelgl -> rebuild[0][0];
349 this_proj -> modelgl -> rebuild[0][0] = TRUE;
352 this_proj -> modelgl -> rebuild[0][0] = rtmp;
353 nats =
object ->
atoms;
355 ats_vol =
object -> at_list;
358 nats = this_proj -> natomes;
359 ats_vol = this_proj ->
atoms[sid];
364 for (a_ang=0; a_ang < 90*finess; a_ang ++)
366 for (b_ang=0; b_ang < 90*finess; b_ang ++)
368 for (c_ang=0; c_ang < 90*finess; c_ang ++)
370 val =
molecular_volume (nats, ats_vol, baryc, rvdws, a_ang/finess, b_ang/finess, c_ang/finess);
371 if (a_ang == 0 && b_ang == 0 && c_ang == 0)
378 this_proj -> modelgl -> volume_box[rid][sid][i] =
vamax[i] -
vamin[i];
379 this_proj -> modelgl -> volume_box[rid][sid][i+6] = (
vamax[i] +
vamin[i]) / 2.0;
381 this_proj -> modelgl -> volume_box[rid][sid][3] = a_ang/finess;
382 this_proj -> modelgl -> volume_box[rid][sid][4] = b_ang/finess;
383 this_proj -> modelgl -> volume_box[rid][sid][5] = c_ang/finess;
389 this_proj -> modelgl -> frag_box[rid][sid][gid][i] =
vamax[i] -
vamin[i];
390 this_proj -> modelgl -> frag_box[rid][sid][gid][i+6] = (
vamax[i] +
vamin[i]) / 2.0;
392 this_proj -> modelgl -> frag_box[rid][sid][gid][3] = a_ang/finess;
393 this_proj -> modelgl -> frag_box[rid][sid][gid][4] = b_ang/finess;
394 this_proj -> modelgl -> frag_box[rid][sid][gid][5] = c_ang/finess;
404 this_proj -> modelgl -> volume_box[rid][sid][i] =
vamax[i] -
vamin[i];
405 this_proj -> modelgl -> volume_box[rid][sid][i+6] = (
vamax[i] +
vamin[i]) / 2.0;
407 this_proj -> modelgl -> volume_box[rid][sid][3] = a_ang/finess;
408 this_proj -> modelgl -> volume_box[rid][sid][4] = b_ang/finess;
409 this_proj -> modelgl -> volume_box[rid][sid][5] = c_ang/finess;
415 this_proj -> modelgl -> frag_box[rid][sid][gid][i] =
vamax[i] -
vamin[i];
416 this_proj -> modelgl -> frag_box[rid][sid][gid][i+6] = (
vamax[i] +
vamin[i]) / 2.0;
418 this_proj -> modelgl -> frag_box[rid][sid][gid][3] = a_ang/finess;
419 this_proj -> modelgl -> frag_box[rid][sid][gid][4] = b_ang/finess;
420 this_proj -> modelgl -> frag_box[rid][sid][gid][5] = c_ang/finess;
433 if (geo == 2) g_free (
object);
450 for (i=0; i<this_proj -> steps; i++) this_proj -> modelgl -> atoms_ppvolume[dat ->
b][i] =
get_atoms_box (this_proj, dat ->
b, i, -1, 0);
451 this_proj -> modelgl -> comp_vol[dat ->
b] = TRUE;
452 widget_set_sensitive (this_proj -> modelgl -> volume_win -> hbvol[dat ->
b], this_proj -> modelgl -> comp_vol[dat ->
b]);
454 for (i=0; i<this_proj -> steps; i++) movol += this_proj -> modelgl -> atoms_ppvolume[dat ->
b][i];
455 movol /= this_proj -> steps;
456 gchar * str = g_strdup_printf (
"%15.3f", movol);
457 gtk_label_set_text ((GtkLabel *)this_proj -> modelgl -> volume_win -> lab_vol[dat ->
b], str);
459 if (this_proj -> modelgl -> comp_vol[dat ->
b])
464 this_proj -> modelgl ->
volumes = TRUE;
478 k = this_proj -> modelgl -> volume_win -> sid[geo-2];
480 if (this_proj -> coord -> totcoord[geo] <= 10000)
484 for (j=0; j<this_proj -> coord -> totcoord[geo]; j++)
486 if (this_proj -> modelgl -> fm_comp_vol[geo-2][i][k][j])
488 hide_the_widgets (this_proj -> modelgl -> volume_win -> fm_compb[geo-2][i][j]);
489 str = g_strdup_printf (
"%15.3f", this_proj -> modelgl -> frag_mol_ppvolume[geo-2][i][k][j]);
490 gtk_label_set_text ((GtkLabel *)this_proj -> modelgl -> volume_win -> fm_lab_vol[geo-2][i][j], str);
492 show_the_widgets (this_proj -> modelgl -> volume_win -> fm_hboxv[geo-2][i][j]);
496 show_the_widgets (this_proj -> modelgl -> volume_win -> fm_compb[geo-2][i][j]);
497 hide_the_widgets (this_proj -> modelgl -> volume_win -> fm_hboxv[geo-2][i][j]);
506 for (j=0; j<this_proj -> modelgl -> volume_win -> ngeov[geo-2]; j++)
508 k = this_proj -> modelgl -> volume_win -> geov_id[geo-2][j];
509 if (this_proj -> modelgl -> fm_comp_vol[geo-2][i][0][k])
511 hide_the_widgets (this_proj -> modelgl -> volume_win -> fm_compb[geo-2][i][k]);
512 str = g_strdup_printf (
"%15.3f", this_proj -> modelgl -> frag_mol_ppvolume[geo-2][i][0][k]);
513 gtk_label_set_text ((GtkLabel *)this_proj -> modelgl -> volume_win -> fm_lab_vol[geo-2][i][k], str);
515 show_the_widgets (this_proj -> modelgl -> volume_win -> fm_hboxv[geo-2][i][k]);
519 show_the_widgets (this_proj -> modelgl -> volume_win -> fm_compb[geo-2][i][k]);
520 hide_the_widgets (this_proj -> modelgl -> volume_win -> fm_hboxv[geo-2][i][k]);
540 int sid = this_proj -> modelgl -> volume_win -> sid[dat ->
b-2];
543 this_proj -> modelgl -> frag_mol_ppvolume[dat ->
b-2][dat ->
d][sid][dat ->
c] =
get_atoms_box (this_proj, dat ->
d, sid, dat ->
b, dat ->
c);
547 this_proj -> modelgl -> frag_mol_ppvolume[dat ->
b-2][dat ->
d][sid][dat ->
c] = 0.0;
548 for (i=0; i<this_proj -> modelfc -> mols[sid][dat ->
c].multiplicity; i++)
550 j = this_proj -> modelfc -> mols[sid][dat ->
c].fragments[i];
551 if (! this_proj -> modelgl -> fm_comp_vol[0][dat ->
d][sid][j])
553 this_proj -> modelgl -> frag_mol_ppvolume[0][dat ->
d][sid][j] =
get_atoms_box (this_proj, dat ->
d, sid, 2, j);
554 this_proj -> modelgl -> fm_comp_vol[0][dat ->
d][sid][j] = TRUE;
555 widget_set_sensitive (this_proj -> modelgl -> volume_win -> fm_hbvol[0][dat ->
d][j], this_proj -> modelgl -> fm_comp_vol[0][dat ->
d][sid][j]);
557 this_proj -> modelgl -> frag_mol_ppvolume[dat ->
b-2][dat ->
d][sid][dat ->
c] += this_proj -> modelgl -> frag_mol_ppvolume[0][dat ->
d][sid][j];
559 this_proj -> modelgl -> frag_mol_ppvolume[dat ->
b-2][dat ->
d][sid][dat ->
c] /= this_proj -> modelfc -> mols[sid][dat ->
c].multiplicity;
562 for (i=0; i<2; i++) this_proj -> modelgl -> saved_coord[i] =
save_coordinates (this_proj, i);
564 update (this_proj -> modelgl);
565 this_proj -> modelgl -> fm_comp_vol[dat ->
b-2][dat ->
d][sid][dat ->
c] = TRUE;
566 widget_set_sensitive (this_proj -> modelgl -> volume_win -> fm_hbvol[dat ->
b-2][dat ->
d][dat ->
c], this_proj -> modelgl -> fm_comp_vol[dat ->
b-2][dat ->
d][sid][dat ->
c]);
567 gchar * str = g_strdup_printf (
"%15.3f", this_proj -> modelgl -> frag_mol_ppvolume[dat ->
b-2][dat ->
d][sid][dat ->
c]);
568 gtk_label_set_text ((GtkLabel *)this_proj -> modelgl -> volume_win -> fm_lab_vol[dat ->
b-2][dat ->
d][dat ->
c], str);
570 if (this_proj -> modelgl -> fm_comp_vol[dat ->
b-2][dat ->
d][sid][dat ->
c])
572 hide_the_widgets (this_proj -> modelgl -> volume_win -> fm_compb[dat ->
b-2][dat ->
d][dat ->
c]);
573 show_the_widgets (this_proj -> modelgl -> volume_win -> fm_hboxv[dat ->
b-2][dat ->
d][dat ->
c]);
579 this_proj -> modelgl ->
volumes = TRUE;
591G_MODULE_EXPORT
void show_volumes (GtkCheckButton * but, gpointer data)
601G_MODULE_EXPORT
void show_volumes (GtkToggleButton * but, gpointer data)
607 this_proj -> modelgl -> anim -> last ->
img -> show_vol[dat ->
b] = gtk_check_button_get_active (but);
609 this_proj -> modelgl -> anim -> last ->
img -> show_vol[dat ->
b] = gtk_toggle_button_get_active (but);
613 update (this_proj -> modelgl);
625G_MODULE_EXPORT
void fm_show_volumes (GtkCheckButton * but, gpointer data)
641 this_proj -> modelgl -> anim -> last ->
img -> fm_show_vol[dat ->
b-2][dat ->
d][dat ->
c] = gtk_check_button_get_active (but);
643 this_proj -> modelgl -> anim -> last ->
img -> fm_show_vol[dat ->
b-2][dat ->
d][dat ->
c] = gtk_toggle_button_get_active (but);
647 update (this_proj -> modelgl);
665 update (this_proj -> modelgl);
680 this_proj -> modelgl -> anim -> last ->
img -> fm_vol_col[dat ->
b-2][dat ->
d][dat ->
c] =
get_button_color (colob);
683 update (this_proj -> modelgl);
698 this_proj -> modelgl -> volume_win -> sid[dat ->
b-2] = gtk_spin_button_get_value_as_int(
res);
714 gchar * name_geo[2] = {
"fragment",
"molecule"};
715 gchar * fmo[2] = {
"Fragment",
"Molecule"};
721 int ngeov = (this_proj -> coord -> totcoord[geo] > 10000) ? view -> volume_win -> ngeov[geo-2] : this_proj -> coord -> totcoord[geo];
724 str = g_strdup_printf (
"<u>Mean volume(s) occupied by the atom(s) for each %s:</u>", name_geo[geo-2]);
728 str = g_strdup_printf (
"<u>Volume(s) occupied by the atom(s) for each %s:</u>", name_geo[geo-2]);
733 gtk_widget_set_hexpand (fragtab, TRUE);
734 gtk_widget_set_vexpand (fragtab, TRUE);
739 for (i=0; i<ngeov; i++)
741 geoid = (this_proj -> coord -> totcoord[geo] > 10000) ? view -> volume_win -> geov_id[geo-2][i] : i;
742 str = g_strdup_printf (
"%s N°%d", fmo[geo-2], geoid+1);
750 str = g_strdup_printf (
"using <b>%s</b>: ",
text_filled[j]);
753 view -> frag_mol_volume[geo-2][j][0][geoid] =
get_atoms_volume (this_proj, j, 0, geo, i);
754 str = g_strdup_printf (
"%15.3f", view -> frag_mol_volume[geo-2][j][0][geoid]);
764 str = g_strdup_printf (
"<u>Mean smallest rectangle parallepiped volume(s) to englobe the atom(s) for each %s:</u>", name_geo[geo-2]);
768 str = g_strdup_printf (
"<u>Smallest rectangle parallepiped volume(s) to englobe the atom(s) for each %s:</u>", name_geo[geo-2]);
773 gtk_widget_set_hexpand (fragtab, TRUE);
774 gtk_widget_set_vexpand (fragtab, TRUE);
777 for (i=0; i<ngeov; i++)
779 geoid = (this_proj -> coord -> totcoord[geo] > 10000) ? view -> volume_win -> geov_id[geo-2][i] : i;
780 str = g_strdup_printf (
"%s N°%d", fmo[geo-2], geoid+1);
788 str = g_strdup_printf (
"using <b>%s</b>: ",
text_filled[j]);
794 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, view -> volume_win -> fm_compb[geo-2][j][geoid], FALSE, FALSE, 20);
796 if (view -> frag_mol_ppvolume[geo-2][j]) vof = view -> frag_mol_ppvolume[geo-2][j][0][geoid];
797 str = g_strdup_printf (
"%15.3f", vof);
799 view -> volume_win -> fm_lab_vol[geo-2][j][geoid] =
markup_label (str, 100, -1, 1.0, 0.5);
800 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> fm_hboxv[geo-2][j][geoid] , view -> volume_win -> fm_lab_vol[geo-2][j][geoid], FALSE, FALSE, 20);
802 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> fm_hboxv[geo-2][j][geoid] ,
markup_label (
"<b>Å<sup>3</sup></b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
803 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, view -> volume_win -> fm_hboxv[geo-2][j][geoid] , FALSE, FALSE, 0);
805 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> fm_hbvol[geo-2][j][geoid],
check_button (
"Show/Hide", 100, -1, view -> anim -> last ->
img -> fm_show_vol[geo-2][j][geoid], G_CALLBACK(
fm_show_volumes), & view -> gcid[geo][geoid][j]), FALSE, FALSE, 0);
806 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> fm_hbvol[geo-2][j][geoid],
color_button (view -> anim -> last ->
img -> fm_vol_col[geo-2][j][geoid], TRUE, 50, -1, G_CALLBACK(
fm_set_volume_color), & view -> gcid[geo][geoid][j]), FALSE, FALSE, 5);
807 widget_set_sensitive (view -> volume_win -> fm_hbvol[geo-2][j][geoid], view -> fm_comp_vol[geo-2][j][0][geoid]);
808 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, view -> volume_win -> fm_hbvol[geo-2][j][geoid], FALSE, FALSE, 5);
829 if (v > 0 && v <= this_proj -> coord -> totcoord[g])
833 for (i=0; i<this_proj -> modelgl -> volume_win -> ngeov[g-2]; i++)
835 if (this_proj -> modelgl -> volume_win -> geov_id[g-2][i] == v-1)
843 int * sdata =
duplicate_int (this_proj -> modelgl -> volume_win -> ngeov[g-2], this_proj -> modelgl -> volume_win -> geov_id[g-2]);
844 g_free (this_proj -> modelgl -> volume_win -> geov_id[g-2]);
845 this_proj -> modelgl -> volume_win -> geov_id[g-2] =
allocint (this_proj -> modelgl -> volume_win -> ngeov[g-2]+1);
846 for (i=0; i<this_proj -> modelgl -> volume_win -> ngeov[g-2]; i++)
848 this_proj -> modelgl -> volume_win -> geov_id[g-2][i] = sdata[i];
850 this_proj -> modelgl -> volume_win -> geov_id[g-2][i] = v-1;
851 this_proj -> modelgl -> volume_win -> ngeov[g-2] ++;
854 this_proj -> modelgl -> volume_win -> fm_vvbox[g-2] =
create_vbox (
BSEP);
855 add_frag_mol_vol_data (this_proj -> modelgl -> volume_win -> fm_vvbox[g-2], this_proj, this_proj -> modelgl, g);
856 add_box_child_start (GTK_ORIENTATION_VERTICAL, this_proj -> modelgl -> volume_win -> fm_vbox[g-2], this_proj -> modelgl -> volume_win -> fm_vvbox[g-2], TRUE, TRUE, 0);
878 gchar * obj[2] = {
"fragment",
"molecule"};
879 gchar * str = g_strdup_printf (
"Too many <b>%ss</b> in your model !\n"
880 " It is impossible to display the entire list ...\n"
881 "... instead you can look for %s(s) 'manually':\n", obj[g-2], obj[g-2]);
884 gchar * search_item[2]={
"Fragment ID:",
"Molecule ID:"};
893 str = g_strdup_printf (
"in [%d - %d]", 1, this_proj -> coord -> totcoord[g]);
897 return frag_mol_search;
914 if (this_proj -> steps > 1)
917 GtkWidget * sbut =
spin_button (G_CALLBACK(
set_md_step_vol), view -> volume_win -> sid[geo-2], 1.0, this_proj -> steps, 1.0, 0, 1000, & view -> gcid[geo][0][geo]);
918 gtk_widget_set_size_request (sbut, 25, -1);
919 GtkWidget * fix = gtk_fixed_new ();
920 gtk_fixed_put (GTK_FIXED (fix), sbut, 0, 10);
921 str = g_strdup_printf (
"<u>Select MD step [1-%d]:</u>", this_proj -> steps);
929 if (! view -> fm_comp_vol[geo-2][i])
931 view -> fm_comp_vol[geo-2][i] =
allocdbool (this_proj -> steps, this_proj -> coord -> totcoord[geo]);
933 if (! view -> anim -> last ->
img -> fm_show_vol[geo-2][i])
935 view -> anim -> last ->
img -> fm_show_vol[geo-2][i] =
allocbool (this_proj -> coord -> totcoord[geo]);
937 if (! view -> anim -> last ->
img -> fm_vol_col[geo-2][i])
939 view -> anim -> last ->
img -> fm_vol_col[geo-2][i] = g_malloc0(this_proj -> coord -> totcoord[geo]*
sizeof*view -> anim -> last ->
img -> fm_vol_col[geo-2][i]);
940 for (j=0; j<this_proj -> coord -> totcoord[geo]; j++)
942 view -> anim -> last ->
img -> fm_vol_col[geo-2][i][j] =
init_color (j+i*this_proj -> coord -> totcoord[geo],
FILLED_STYLES*this_proj -> coord -> totcoord[geo]);
943 view -> anim -> last ->
img -> fm_vol_col[geo-2][i][j].alpha = 0.75;
946 if (! view -> frag_box[i])
948 view -> frag_box[i] =
alloctdouble (this_proj -> steps, this_proj -> coord -> totcoord[geo], 9);
950 if (! view -> frag_mol_volume[geo-2][i])
952 view -> frag_mol_volume[geo-2][i] =
allocddouble (this_proj -> steps, this_proj -> coord -> totcoord[geo]);
954 if (! view -> frag_mol_ppvolume[geo-2][i])
956 view -> frag_mol_ppvolume[geo-2][i] =
allocddouble (this_proj -> steps, this_proj -> coord -> totcoord[geo]);
958 if (! view -> volume_win -> fm_compb[geo-2][i])
960 view -> volume_win -> fm_compb[geo-2][i] = g_malloc0 (this_proj -> coord -> totcoord[geo]*
sizeof*view -> volume_win ->fm_compb[geo-2][i]);
962 if (! view -> volume_win -> fm_hbvol[geo-2][i])
964 view -> volume_win -> fm_hbvol[geo-2][i] = g_malloc0 (this_proj -> coord -> totcoord[geo]*
sizeof*view -> volume_win -> fm_hbvol[geo-2][i]);
966 if (! view -> volume_win -> fm_hboxv[geo-2][i])
968 view -> volume_win -> fm_hboxv[geo-2][i] = g_malloc0 (this_proj -> coord -> totcoord[geo]*
sizeof*view -> volume_win -> fm_hboxv[geo-2][i]);
970 if (! view -> volume_win -> fm_lab_vol[geo-2][i])
972 view -> volume_win -> fm_lab_vol[geo-2][i] = g_malloc0 (this_proj -> coord -> totcoord[geo]*
sizeof*view -> volume_win -> fm_lab_vol[geo-2][i]);
976 if (this_proj -> coord -> totcoord[geo] > 10000)
979 gtk_widget_set_hexpand (fragtab, TRUE);
980 gtk_widget_set_vexpand (fragtab, TRUE);
986 add_box_child_start (GTK_ORIENTATION_VERTICAL, view -> volume_win -> fm_vbox[geo-2], view -> volume_win -> fm_vvbox[geo-2], TRUE, TRUE, 0);
1002 int i = gtk_combo_box_get_active (box);
1003 if (i != view -> volume_win -> angp)
1006 view -> volume_win -> angp = i;
1012 view -> comp_vol[i] = FALSE;
1014 view -> anim -> last ->
img -> show_vol[i] = FALSE;
1017 for (k=0; k<this_proj -> coord -> totcoord[j+2]; k++)
1021 view -> fm_comp_vol[j][i][0][k] = FALSE;
1022 widget_set_sensitive (view -> volume_win -> fm_hbvol[j][i][k], view -> fm_comp_vol[j][i][0][k]);
1023 view -> anim -> last ->
img -> fm_show_vol[j][i][k] = FALSE;
1027 this_proj -> modelgl ->
volumes = FALSE;
1044 abox (
vbox,
"<u>Volume(s) occupied by all the atom(s):</u>", 5);
1054 str = g_strdup_printf (
"using <b>%s</b>: ",
text_filled[i]);
1057 if (! view -> atoms_volume[i]) view -> atoms_volume[i] =
allocdouble (this_proj -> steps);
1058 for (j=0; j<this_proj -> steps; j++) view -> atoms_volume[i][j] =
get_atoms_volume (this_proj, i, j, -1, 0);
1060 for (j=0; j<this_proj -> steps; j++) vof += view -> atoms_volume[i][j];
1061 vof /= this_proj -> steps;
1062 str = g_strdup_printf (
"%15.3f", vof);
1067 if (this_proj -> steps > 1)
1073 abox (
vbox,
"<u>Smallest rectangle parallepiped volume(s) to englobe all atom(s):</u>", 5);
1075 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, gtk_label_new(
"Angular precision: "), FALSE, FALSE, 10);
1077 gchar * angpr[4] = {
"°",
"°/10",
"°/100",
"°/1000"};
1079 gtk_combo_box_set_active (GTK_COMBO_BOX(ang_combo), view -> volume_win -> angp);
1087 str = g_strdup_printf (
"using <b>%s</b>: ",
text_filled[i]);
1091 if (! view -> comp_vol[i])
1094 view -> anim -> last ->
img -> vol_col[i].green = 1.0;
1095 view -> anim -> last ->
img -> vol_col[i].blue = 0.0;
1096 view -> anim -> last ->
img -> vol_col[i].alpha = 0.75;
1098 if (! view -> atoms_ppvolume[i]) view -> atoms_ppvolume[i] =
allocdouble (this_proj -> steps);
1099 if (! view -> volume_box[i]) view -> volume_box[i] =
allocddouble (this_proj -> steps, 9);
1102 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, view -> volume_win -> compb[i], FALSE, FALSE, 20);
1104 for (j=0; j<this_proj -> steps; j++) vof += view -> atoms_ppvolume[i][j];
1105 vof /= this_proj -> steps;
1106 str = g_strdup_printf (
"%15.3f", vof);
1108 view -> volume_win -> lab_vol[i] =
markup_label (str, 100, -1, 1.0, 0.5);
1109 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> hboxv[i], view -> volume_win -> lab_vol[i], FALSE, FALSE, 20);
1111 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> hboxv[i],
markup_label (
"<b>Å<sup>3</sup></b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1112 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, view -> volume_win -> hboxv[i], FALSE, FALSE, 0);
1114 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> hbvol[i],
check_button (
"Show/Hide", 100, -1, view -> anim -> last ->
img -> show_vol[i], G_CALLBACK(
show_volumes), & view ->
colorp[i][0]), FALSE, FALSE, 0);
1115 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, view -> volume_win -> hbvol[i],
color_button (view -> anim -> last ->
img -> vol_col[i], TRUE, 50, -1, G_CALLBACK(
set_volume_color), & view ->
colorp[i][0]), FALSE, FALSE, 5);
1134 if (view -> volume_win == NULL)
1136 view -> volume_win = g_malloc0 (
sizeof*view -> volume_win);
1138 gchar * str = g_strdup_printf (
"%s - volumes", this_proj -> name);
1139 view -> volume_win -> win =
create_win (str, view -> win, FALSE, FALSE);
1140 gtk_widget_set_size_request (view -> volume_win -> win, 450, 420);
1144 GtkWidget * notebook = gtk_notebook_new ();
1146 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vol_model_tab (view), gtk_label_new (
"Model"));
1147 if (view -> adv_bonding[0]) gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
frag_mol_volume_tab (view, 2), gtk_label_new (
"Fragment(s)"));
1148 if (view -> adv_bonding[1]) gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
frag_mol_volume_tab (view, 3), gtk_label_new (
"Molecule(s)"));
1154 if (view -> comp_vol[i])
Function declarations for the mode edition window.
atomic_object * create_object_from_frag_mol(project *this_proj, int coord, int geo, atom_search *remove)
create object from a fragment or a molecule
double ** save_coordinates(project *this_proj, int status)
save atomic coordinates
void center_molecule(project *this_proj)
center atomic coordinates around (0,0,0)
Binding to the Fortran90 subroutines.
double set_radius_(int *, int *)
Callback declarations for main window.
integer(kind=c_int) function chemistry()
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
int * duplicate_int(int num, int *old_val)
copy a list of int
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
double * duplicate_double(int num, double *old_val)
copy a list of double
gboolean * allocbool(int val)
allocate a gboolean * pointer
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
double * allocdouble(int val)
allocate a double * pointer
double *** alloctdouble(int xal, int yal, int zal)
allocate a double *** pointer
int * allocint(int val)
allocate an int * pointer
gboolean ** allocdbool(int xal, int yal)
allocate a gboolean ** pointer
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
G_MODULE_EXPORT gboolean hide_this_window(GtkWidget *win, GdkEvent *event, gpointer data)
hide a GtkWindow
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
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 * 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.
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
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 * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
GtkWidget * abox(GtkWidget *box, char *lab, int vspace)
box creating routine, to help design faster elements for the GUI
void show_the_widgets(GtkWidget *widg)
show GtkWidget
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 draw(glwin *view)
main drawing subroutine for the OpenGL window
void re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
char * text_filled[FILLED_STYLES]
shaders
The different types of shaders in the atomes program.
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
G_MODULE_EXPORT void set_md_step_vol(GtkSpinButton *res, gpointer data)
change MD step spin callback
GtkWidget * vol_model_tab(glwin *view)
create the 'Model' volume tab
G_MODULE_EXPORT void fm_molecular_volumes(GtkButton *but, gpointer data)
compute fragment / molecule volume
double cap_volume(double ht, double dh)
compute cap volume
double get_atoms_box(project *this_proj, int rid, int sid, int geo, int gid)
find volume box parameters for object
double get_atoms_volume(project *this_proj, int rid, int sid, int gid, int gcid)
compute exact atomic volume for all system or fragment or molecule
G_MODULE_EXPORT void set_angular_precision(GtkComboBox *box, gpointer data)
change angular precision
void add_frag_mol_vol_data(GtkWidget *vbox, project *this_proj, glwin *view, int geo)
add fragment / molecule volume data to the search tab
double molecular_volume(int nats, atom *ats_vol, double baryc[3], double *rvdws, double a_ang, double b_ang, double c_ang)
compute volume
double get_sphere_caps_volume(double dab, double rad, double rbd)
compute sphere cap volume
GtkWidget * frag_mol_volume_tab(glwin *view, int geo)
create the fragment(s) / molecule(s) tab
G_MODULE_EXPORT void window_volumes(GtkWidget *widg, gpointer data)
create the 'Volumes' window callback
double draw_cuboid(gboolean draw, int SHADID, int shadnum, mat4_t rot, vec3_t cpos, double paral[3][3], ColRGBA col, double slab_alpha)
draw cuboid vertices
G_MODULE_EXPORT void update_vol_frag_mol_search(GtkEntry *res, gpointer data)
update fragment / molecule search entry
G_MODULE_EXPORT void molecular_volumes(GtkButton *but, gpointer data)
compute volume
G_MODULE_EXPORT void fm_set_volume_color(GtkColorChooser *colob, gpointer data)
change fragment / molecule volume color
void adjust_vol_md_step(project *this_proj, int geo)
update volume value labels
void clean_volumes_data(glwin *view)
clean volume data
double sphere_volume(double rad)
compute sphere volume
void center_this_molecule(glwin *view)
center atomic coordinates around (0,0,0) and refresh shaders
G_MODULE_EXPORT void set_volume_color(GtkColorChooser *colob, gpointer data)
change volume color
GtkWidget * frag_mol_volume_search(project *this_proj, int g)
create the fragment(s) / molecule(s) search widget
G_MODULE_EXPORT void fm_show_volumes(GtkToggleButton *but, gpointer data)
toggle show / hide fragment / molecule volume callback GTK3
G_MODULE_EXPORT void show_volumes(GtkToggleButton *but, gpointer data)
toggle show / hide volume callback GTK3