53 newchem ->
label = g_malloc (spec*
sizeof*newchem ->
label);
56 for (i=0; i<spec; i++)
58 newchem ->
label[i] = g_strdup_printf (
"%s", chem ->
label[i]);
59 newchem ->
element[i] = g_strdup_printf (
"%s", chem ->
element[i]);
64 newchem -> grtotcutoff = chem -> grtotcutoff;
66 for (i=0; i<spec; i++)
68 for (j=0; j<spec; j++) newchem -> cutoffs[i][j] = chem -> cutoffs[i][j];
69 for (j=0; j<
CHEM_PARAMS; j++) newchem -> chem_prop[j][i] = chem -> chem_prop[j][i];
90 if (list_z[i] == (
double)
z)
112 for (j=0; j<
object -> species; j++)
114 if (
object -> old_z[j] > 0)
116 k =
find_spec_id (coord -> species,
object -> old_z[j], edit -> new_z);
120 edit -> new_z = g_realloc (edit -> new_z, (coord -> species+i)*
sizeof*edit -> new_z);
121 edit -> new_z[coord -> species+i-1] = (double)
object -> old_z[j];
131 if (coord -> species)
133 g_free (coord -> ntg[j]);
134 g_free (coord -> geolist[j]);
136 coord -> ntg[j] =
allocint (coord -> species + i);
137 coord -> geolist[j] = g_malloc0 ((coord -> species + i)*
sizeof* coord -> geolist[j]);
140 if (coord -> species) g_free (coord -> partial_geo);
141 coord -> partial_geo = g_malloc0 ((coord -> species + i)*
sizeof*coord -> partial_geo);
143 for (k=0; k<coord -> species; k++)
145 coord -> ntg[j][k] = tmp -> ntg[j][k];
146 coord -> geolist[j][k] =
duplicate_int (tmp -> ntg[j][k], tmp -> geolist[j][k]);
149 coord -> partial_geo[k] =
allocdint (coord -> ntg[j][k], coord -> species + i);
150 for (l=0; l<tmp -> ntg[j][k]; l++)
152 for (m=0; m<coord -> species; m++)
154 coord -> partial_geo[k][l][m] = tmp -> partial_geo[k][l][m];
160 coord -> species += i;
coord_info * duplicate_coord_info(coord_info *old_coord)
duplicate coordination information data structure
Function declarations for the mode edition window.
chemical_data * duplicate_chemical_data(int spec, chemical_data *chem)
duplicate chemical data information
int find_spec_id(int s, int z, double *list_z)
find species id based on Z
int search_for_new_spec(atom_edition *edit, atomic_object *object)
search for new chemical species
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
int * duplicate_int(int num, int *old_val)
copy a list of int
int ** allocdint(int xal, int yal)
allocate an int ** pointer
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
int * allocint(int val)
allocate an int * pointer