383 int i, j, k, l, m, n;
390 if (
img -> back -> gradient)
403 img -> back -> gradient = 0;
410 img -> color_map[0] -= 10;
413 this_proj -> modelgl -> custom_map -> points = j;
414 if (fread (& this_proj -> modelgl -> custom_map -> cmax,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
415 if (fread (& this_proj -> modelgl -> custom_map -> cmin,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
416 this_proj -> modelgl -> custom_map -> positions =
allocfloat (j);
417 this_proj -> modelgl -> custom_map -> values = g_malloc0(j*
sizeof*this_proj -> modelgl -> custom_map -> values);
418 if (fread (this_proj -> modelgl -> custom_map -> positions,
sizeof(
float), j,
fp) != j)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
420 j = this_proj -> steps*this_proj -> natomes;
421 for (i=0; i<this_proj -> steps; i++)
423 if (fread (this_proj -> modelgl -> custom_map -> data[i],
sizeof(
float), this_proj -> natomes,
fp) != this_proj -> natomes)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
434 for (i=0; i<sid*2; i++)
495 img -> mtilt[1] =
img -> mtilt[0];
497 img -> mpattern[1] =
img -> mpattern[0];
499 img -> mfactor[1] =
img -> mfactor[0];
501 img -> mwidth[1] =
img -> mwidth[0];
589 if (
img -> l_ghtning.spot != NULL)
591 g_free (
img -> l_ghtning.spot);
592 img -> l_ghtning.spot = NULL;
594 img -> l_ghtning.spot = g_malloc0(
img -> l_ghtning.lights*
sizeof*
img -> l_ghtning.spot);
595 for (i=0; i<
img -> l_ghtning.lights; i++)
597 img -> l_ghtning.spot[i] = g_malloc0(
sizeof*
img -> l_ghtning.spot[i]);
598 if (fread (&
img -> l_ghtning.spot[i] -> type,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
599 if (fread (&
img -> l_ghtning.spot[i] -> fix,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
600 if (fread (&
img -> l_ghtning.spot[i] -> show,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
624 for (j=0; j<sid; j++)
626 if (fread (
img -> spcolor[i][j],
sizeof(
ColRGBA), this_proj -> coord -> ntg[i][j],
fp) != this_proj -> coord -> ntg[i][j])
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
634 if (j != this_proj -> coord -> totcoord[i])
638 if (fread (
img -> spcolor[i][0],
sizeof(
ColRGBA), this_proj -> coord -> totcoord[i],
fp) != this_proj -> coord -> totcoord[i])
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
645 if (fread (& this_proj -> modelgl -> rings,
sizeof(gboolean), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
646 if (this_proj -> modelgl -> rings)
658 if (this_proj -> modelgl ->
chains)
669 this_proj -> modelgl -> create_shaders[
VOLMS] = TRUE;
670 this_proj -> modelgl ->
volumes = TRUE;
673 this_proj -> modelgl -> atoms_volume[i] =
allocdouble (this_proj -> steps);
674 this_proj -> modelgl -> atoms_ppvolume[i] =
allocdouble (this_proj -> steps);
675 if (fread (this_proj -> modelgl -> atoms_volume[i],
sizeof(
double), this_proj -> steps,
fp) != this_proj -> steps)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
676 if (fread (this_proj -> modelgl -> atoms_ppvolume[i],
sizeof(
double), this_proj -> steps,
fp) != this_proj -> steps)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
677 this_proj -> modelgl -> volume_box[i] =
allocddouble (this_proj -> steps, 9);
678 for (j=0; j<this_proj -> steps; j++)
680 if (fread (this_proj -> modelgl -> volume_box[i][j],
sizeof(
double), 9,
fp) != 9)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
694 this_proj -> modelgl -> frag_mol_volume[0][j] =
allocddouble (this_proj -> steps, i);
695 this_proj -> modelgl -> frag_mol_ppvolume[0][j] =
allocddouble (this_proj -> steps, i);
696 this_proj -> modelgl -> fm_comp_vol[0][j] =
allocdbool (this_proj -> steps, i);
698 this_proj -> modelgl -> frag_box[j] =
alloctdouble (this_proj -> steps, i, 9);
703 if (fread (& this_proj -> modelgl -> frag_mol_ppvolume[0][j][m][n],
sizeof(
double), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
704 if (fread (this_proj -> modelgl -> frag_box[j][m][n],
sizeof(
double), 9,
fp) != 9)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
705 this_proj -> modelgl -> fm_comp_vol[0][j][m][n] = TRUE;
720 this_proj -> modelgl -> frag_mol_volume[1][j] =
allocddouble (this_proj -> steps, i);
721 this_proj -> modelgl -> frag_mol_ppvolume[1][j] =
allocddouble (this_proj -> steps, i);
722 this_proj -> modelgl -> fm_comp_vol[1][j] =
allocdbool (this_proj -> steps, i);
728 if (fread (& this_proj -> modelgl -> frag_mol_ppvolume[1][j][m][n],
sizeof(
double), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
729 this_proj -> modelgl -> fm_comp_vol[1][j][m][n] = TRUE;
740 for (i=0; i<this_proj -> steps; i++)
742 for (j=0; j< this_proj -> natomes; j++)
763 if (
img -> selected[i] -> selected >= 2 &&
img -> selected[i] -> selected <= 20)
766 if (fread (
img -> selected[i] -> selected_bonds,
sizeof(
int), j,
fp) != j)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
767 if (
img -> selected[i] -> selected >= 3)
770 if (fread (
img -> selected[i] -> selected_angles,
sizeof(
int), j,
fp) != j)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
771 if (
img -> selected[i] -> selected >= 4 &&
img -> selected[i] -> selected <= 10)
774 if (fread (
img -> selected[i] -> selected_dihedrals,
sizeof(
int), j,
fp) != j)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_IMAGE);
785 for (j=0; j<sid; j++)
787 if (GTK_IS_WIDGET(this_proj -> modelgl -> ogl_spec[i][j]))
789 if (gtk_check_menu_item_get_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_spec[i][j]) !=
img -> show_atom[i][j])
791 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_spec[i][j],
img -> show_atom[i][j]);
798 if (this_proj -> modelgl -> ogl_poly[0][i] != NULL)
800 for (j=0; j<this_proj -> coord -> totcoord[i]; j++)
802 if (i < 2 || (i > 3 && i < 9))
804 if (this_proj -> modelgl -> ogl_poly[0][i][j] != NULL)
806 if (GTK_IS_WIDGET(this_proj -> modelgl -> ogl_poly[0][i][j]))
808 if (gtk_check_menu_item_get_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_poly[0][i][j]) !=
img -> show_poly[i][j])
810 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_poly[0][i][j],
img -> show_poly[i][j]);
817 if (this_proj -> modelgl -> ogl_geom[0][i] != NULL)
819 for (j=0; j<this_proj -> coord -> totcoord[i]; j++)
821 if (this_proj -> modelgl -> ogl_geom[0][i][j] != NULL)
823 if (GTK_IS_WIDGET(this_proj -> modelgl -> ogl_geom[0][i][j]))
825 if (gtk_check_menu_item_get_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_geom[0][i][j]) !=
img -> show_coord[i][j])
827 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_geom[0][i][j],
img -> show_coord[i][j]);
841 for (j=0; j<sid; j++)
843 if (!
img -> show_atom[i][j])
851 for (j=0; j<this_proj -> coord -> totcoord[i]; j++)
853 if (i < 2 || (i > 3 && i < 9))
855 if (
img -> show_poly[i][j])
857 show_hide_poly (NULL, NULL, & this_proj -> modelgl -> gcid[i][j][i]);
861 for (j=0; j<this_proj -> coord -> totcoord[i]; j++)
863 if (!
img -> show_coord[i][j])
869 update_menu_bar (this_proj -> modelgl);