atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
cell_shift.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'cell_shift.c'
24*
25* Contains:
26*
27
28 - The functions to create the 'shift cell center' tab for the cell edition window
29
30*
31* List of functions:
32
33 G_MODULE_EXPORT gboolean scroll_shift_coord (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data);
34
35 void modify_coordinates_in_lattice (project * this_proj, mat4_t * dlat, mat4_t * drec, int refresh, int density);
36 void shift_it (vec3_t shift, int refresh, int proj);
37 void adjust_it (int refresh, int proj);
38 void shift_has_changed (gpointer data, double val);
39 void wrapping (glwin * view);
40
41 G_MODULE_EXPORT void set_shift (GtkEntry * res, gpointer data);
42 G_MODULE_EXPORT void shift_coord (GtkRange * range, gpointer data);
43 G_MODULE_EXPORT void wrap_coord (GtkCheckButton * but, gpointer data);
44 G_MODULE_EXPORT void wrap_coord (GtkToggleButton * but, gpointer data);
45
46 GtkWidget * create_cell_entries (project * this_proj, int i);
47 GtkWidget * create_shift_box (project * this_proj);
48 GtkWidget * shift_center_tab (project * this_proj);
49
50*/
51
52#include "cell_edit.h"
53
65void modify_coordinates_in_lattice (project * this_proj, mat4_t * dlat, mat4_t * drec, int refresh, int density)
66{
67 vec3_t pos;
68 vec3_t res;
69 int i, j;
70 box_info * box;
71 mat4_t lat, rec;
72 if (! density)
73 {
74 box = & this_proj -> cell.box[0];
75 lat = mat4 (box -> vect[0][0], box -> vect[1][0], box -> vect[2][0], 0.0,
76 box -> vect[0][1], box -> vect[1][1], box -> vect[2][1], 0.0,
77 box -> vect[0][2], box -> vect[1][2], box -> vect[2][2], 0.0,
78 0.0, 0.0, 0.0, 1.0);
79 rec = mat4 (box -> rvect[0][0], box -> rvect[0][1], box -> rvect[0][2], 0.0,
80 box -> rvect[1][0], box -> rvect[1][1], box -> rvect[1][2], 0.0,
81 box -> rvect[2][0], box -> rvect[2][1], box -> rvect[2][2], 0.0,
82 0.0, 0.0, 0.0, 1.0);
83 }
84 for (i=0; i<this_proj -> steps; i++)
85 {
86 for (j=0; j<this_proj -> natomes; j++)
87 {
88 pos = vec3(this_proj -> atoms[i][j].x, this_proj -> atoms[i][j].y, this_proj -> atoms[i][j].z);
89 if (density)
90 {
91 res = m4_mul_pos(*drec, pos);
92 pos = m4_mul_pos(*dlat, res);
93 }
94 else
95 {
96 if (this_proj -> cell.npt && i)
97 {
98 box = & this_proj -> cell.box[i];
99 lat = mat4 (box -> vect[0][0], box -> vect[1][0], box -> vect[2][0], 0.0,
100 box -> vect[0][1], box -> vect[1][1], box -> vect[2][1], 0.0,
101 box -> vect[0][2], box -> vect[1][2], box -> vect[2][2], 0.0,
102 0.0, 0.0, 0.0, 1.0);
103 rec = mat4 (box -> rvect[0][0], box -> rvect[0][1], box -> rvect[0][2], 0.0,
104 box -> rvect[1][0], box -> rvect[1][1], box -> rvect[1][2], 0.0,
105 box -> rvect[2][0], box -> rvect[2][1], box -> rvect[2][2], 0.0,
106 0.0, 0.0, 0.0, 1.0);
107 }
108 res = m4_mul_pos(rec, pos);
109 res.x -= (int)res.x;
110 res.x -= (int)(res.x/0.5);
111 res.y -= (int)res.y;
112 res.y -= (int)(res.y/0.5);
113 res.z -= (int)res.z;
114 res.z -= (int)(res.z/0.5);
115 pos = m4_mul_pos(lat, res);
116 }
117 this_proj -> atoms[i][j].x = pos.x;
118 this_proj -> atoms[i][j].y = pos.y;
119 this_proj -> atoms[i][j].z = pos.z;
120 }
121 if (density)
122 {
123 for (j=0; j<this_proj -> modelgl -> bonds[i][1]; j++)
124 {
125 pos = vec3(this_proj -> modelgl -> clones[i][j].x, this_proj -> modelgl -> clones[i][j].y, this_proj -> modelgl -> clones[i][j].z);
126 res = m4_mul_pos(*drec, pos);
127 pos = m4_mul_pos(*dlat, res);
128 this_proj -> modelgl -> clones[i][j].x = pos.x;
129 this_proj -> modelgl -> clones[i][j].y = pos.y;
130 this_proj -> modelgl -> clones[i][j].z = pos.z;
131 }
132 }
133 }
134 if (refresh)
135 {
136 i = activep;
137 active_project_changed (this_proj -> id);
138 if (! density)
139 {
140 this_proj -> dmtx = run_distance_matrix (NULL, 0, 1);
141#ifdef GTK3
142 // GTK3 Menu Action To Check
143 widget_set_sensitive (active_glwin -> ogl_clones[0], active_glwin -> allbonds[1]);
144#endif
145 }
146 else
147 {
148 /*if (this_proj -> modelgl -> adv_bonding[1])
149 {
150 for (j=0; j<2; j++)
151 {
152 if (this_proj -> modelgl -> anim -> last -> img -> color_map[j] == 4 || this_proj -> modelgl -> anim -> last -> img -> color_map[j] == 5)
153 {
154 if (this_proj -> modelgl -> color_styles[j*ATOM_MAPS])
155 {
156 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> color_styles[j*ATOM_MAPS], TRUE);
157 set_color_map (this_proj -> modelgl -> color_styles[j*ATOM_MAPS], & this_proj -> modelgl -> colorp[j*ATOM_MAPS][0]);
158 }
159 }
160 }
161 }*/
162 /*this_proj -> modelgl -> bonding = FALSE;
163 this_proj -> modelgl -> adv_bonding[0] = this_proj -> modelgl -> adv_bonding[1] = FALSE;
164 if (this_proj -> force_field[0])
165 {
166 g_free (this_proj -> force_field[0]);
167 this_proj -> force_field[0] = NULL;
168 }*/
169 /*int j;
170 if (this_proj -> modelgl -> rings)
171 {
172 this_proj -> modelgl -> rings = FALSE;
173 for (j=0; j<5; j++)
174 {
175 clean_rings_data (j, this_proj -> modelgl);
176#ifdef GTK3
177 update_rings_menus (this_proj -> modelgl);
178#endif
179 }
180 }
181 if (this_proj -> modelgl -> chains)
182 {
183 clean_chains_data (this_proj -> modelgl);
184#ifdef GTK3
185 update_chains_menus (this_proj -> modelgl);
186#endif
187 }*/
188 }
189 init_default_shaders (this_proj -> modelgl);
190 if (density) this_proj -> modelgl -> create_shaders[MDBOX] = TRUE;
191 if (this_proj -> modelgl -> n_shaders[SLABS][0]) this_proj -> modelgl -> create_shaders[SLABS] = TRUE;
192 update (this_proj -> modelgl);
193 if (i != this_proj -> id) active_project_changed (i);
194 }
195}
196
206void shift_it (vec3_t shift, int refresh, int proj)
207{
208 project * this_proj = get_project_by_id (proj);
209 translate (this_proj, -1, 0, shift);
210 modify_coordinates_in_lattice (this_proj, NULL, NULL, refresh, 0);
211}
212
213
222void adjust_it (int refresh, int proj)
223{
224 int i, j;
225 project * this_proj = get_project_by_id (proj);
226 box_info * box = & this_proj -> cell.box[0];
227 mat4_t rec = mat4 (box -> rvect[0][0], box -> rvect[0][1], box -> rvect[0][2], 0.0,
228 box -> rvect[1][0], box -> rvect[1][1], box -> rvect[1][2], 0.0,
229 box -> rvect[2][0], box -> rvect[2][1], box -> rvect[2][2], 0.0,
230 0.0, 0.0, 0.0, 1.0);
231 for (i=0; i<3; i++) box -> param[0][i] = this_proj -> modelgl -> cell_win -> cparam[i+3];
232 i = this_proj -> cell.ltype;
233 this_proj -> cell.ltype = 1;
234 j = activep;
235 active_project_changed (this_proj -> id);
236 this_proj -> cell.ltype = i;
238 mat4_t lat = mat4 (box -> vect[0][0], box -> vect[1][0], box -> vect[2][0], 0.0,
239 box -> vect[0][1], box -> vect[1][1], box -> vect[2][1], 0.0,
240 box -> vect[0][2], box -> vect[1][2], box -> vect[2][2], 0.0,
241 0.0, 0.0, 0.0, 1.0);
242 modify_coordinates_in_lattice (this_proj, & lat, & rec, refresh, 1);
243 double m = 0.0;
244 for (i=0; i<this_proj -> nspec; i++) m += this_proj -> chemistry -> nsps[i] * this_proj -> chemistry -> chem_prop[CHEM_M][i];
245 this_proj -> cell.density = 10.0*m/(this_proj -> cell.volume*6.02214179);
246 display_density (this_proj -> modelgl -> cell_win,
247 this_proj -> cell.volume,
248 this_proj -> cell.density, this_proj -> natomes/this_proj -> cell.volume);
249}
250
259void shift_has_changed (gpointer data, double val)
260{
261 tint * dat = (tint *)data;
262 int i, j, k, l;
263 project * this_proj = get_project_by_id (dat -> a);
264 cell_edition * cedit = this_proj -> modelgl -> cell_win;
265 l = (this_proj -> cell.npt) ? this_proj -> modelgl -> anim -> last -> img -> step : 0;
266 if (dat -> b < 3)
267 {
268 if (val >= - this_proj -> cell.box[l].param[0][dat -> b]/2.0 && val <= this_proj -> cell.box[l].param[0][dat -> b]/2.0)
269 {
270 if (val != cedit -> cparam[dat -> b])
271 {
272 double cparam[3];
273 for (i=0; i<3; i++) cparam[i] = - cedit -> cparam[i];
274 shift_it (vec3(cparam[0], cparam[1], cparam[2]), 0, dat -> a);
275 cedit -> cparam[dat -> b] = val;
276 for (i=0; i<3; i++) cparam[i] = cedit -> cparam[i];
277 shift_it (vec3(cparam[0], cparam[1], cparam[2]), 1, dat -> a);
278 }
279 }
280 }
281 else if (dat -> b < 6)
282 {
283 if (val > 0.0 && val <= cedit -> initbox[dat -> b-3]*100.0)
284 {
285 if (val != cedit -> cparam[dat -> b])
286 {
287 adjust_it (0, dat -> a);
288 if (cedit -> homo_density)
289 {
290 double v = val / cedit -> initbox[dat -> b - 3];
291 for (i=0; i<3; i++) cedit -> cparam[i+3] = v * cedit -> initbox[i];
292 }
293 else
294 {
295 cedit -> cparam[dat -> b] = val;
296 }
297 adjust_it (1, dat -> a);
298 }
299 }
300 }
301 else if (dat -> b > 5 && dat -> b < 15)
302 {
303 i = (dat -> b < 9) ? 6 : (dat -> b < 12) ? 9 : dat -> b;
304 j = (dat -> b < 9) ? 1 : (dat -> b < 12) ? 2 : 10;
305 k = (dat -> b < 9) ? 1 : 0;
306 if (val > -k * cedit -> initbox[dat -> b - i] && val <= j * cedit -> initbox[dat -> b - i])
307 {
308 if (val != cedit -> cparam[dat -> b])
309 {
310 cedit -> cparam[dat -> b] = val;
311 if (this_proj -> modelgl -> n_shaders[SLABS][0])
312 {
313 this_proj -> modelgl -> create_shaders[SLABS] = TRUE;
314 update (this_proj -> modelgl);
315 }
316 }
317 }
318 }
319 else if (dat -> b > 14)
320 {
321 i = (dat -> b < 18) ? 0 : 1;
322 if (val >= -i * 180.0 && val <= 180.0)
323 {
324 if (val != cedit -> cparam[dat -> b])
325 {
326 cedit -> cparam[dat -> b] = val;
327 if (this_proj -> modelgl -> n_shaders[SLABS][0])
328 {
329 this_proj -> modelgl -> create_shaders[SLABS] = TRUE;
330 update (this_proj -> modelgl);
331 }
332 }
333 }
334 }
335 if ((dat -> b > 2 && dat -> b < 6) && cedit -> homo_density)
336 {
337 for (i=3; i<6; i++)
338 {
339 update_entry_double (GTK_ENTRY(cedit -> edit_entry[i]), cedit -> cparam[i]);
340 gtk_range_set_value (GTK_RANGE(cedit -> edit_scale[i]), cedit -> cparam[i]);
341 }
342 }
343 else
344 {
345 update_entry_double (GTK_ENTRY(cedit -> edit_entry[dat -> b]), cedit -> cparam[dat -> b]);
346 gtk_range_set_value (GTK_RANGE(cedit -> edit_scale[dat -> b]), cedit -> cparam[dat -> b]);
347 }
348}
349
358G_MODULE_EXPORT void set_shift (GtkEntry * res, gpointer data)
359{
360 const gchar * m = entry_get_text (res);
361 double v = string_to_double ((gpointer)m);
362 shift_has_changed (data, v);
363}
364
375G_MODULE_EXPORT gboolean scroll_shift_coord (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
376{
377 shift_has_changed (data, value);
378 return FALSE;
379}
380
389G_MODULE_EXPORT void shift_coord (GtkRange * range, gpointer data)
390{
391 shift_has_changed (data, gtk_range_get_value (range));
392}
393
402GtkWidget * create_cell_entries (project * this_proj, int i)
403{
404 int j, k, l, m;
405 gchar * str;
406 GtkWidget * lab;
407 GtkWidget * hbox;
408 gchar * axis[3]={"x", "y", "z"};
409 gchar * angl[3]={"&#x3B1;", "&#x3B2;", "&#x263;"};
410 gchar * unit[2]={"<b>&#xC5;</b>", "<b>°</b>"};
411 GtkWidget * vbox = create_vbox (5);
412 cell_edition * cedit = this_proj -> modelgl -> cell_win;
413 cedit -> edit_entry[i] = create_entry (G_CALLBACK(set_shift), 100, 15, FALSE, & this_proj -> modelgl -> colorp[i][0]);
414 if (i < 3 || (i > 5 && i < 12))
415 {
416 j = (i < 3) ? i : (i < 9) ? i - 6 : i - 9;
417 k = (i < 3) ? 2 : 1;
418 l = (i < 9) ? 1 : 0;
419 m = (i < 9) ? 1 : 2;
420 cedit -> edit_scale[i] = create_hscale (-l*this_proj -> cell.box[0].param[0][j]/k, m*this_proj -> cell.box[0].param[0][j]/k, 0.01, cedit -> cparam[i],
421 GTK_POS_TOP, 3, 200, G_CALLBACK(shift_coord), G_CALLBACK(scroll_shift_coord), & this_proj -> modelgl -> colorp[i][0]);
422 str = g_strdup_printf ("on <b>%s</b> axis [+/- &#xC5;]", axis[j]);
423 }
424 else if (i < 6)
425 {
426 cedit -> initbox[i-3] = cedit -> cparam[i] = this_proj -> cell.box[0].param[0][i-3];
427 cedit -> edit_scale[i] = create_hscale (0.0, this_proj -> cell.box[0].param[0][i-3]*10.0, 0.01, cedit -> cparam[i],
428 GTK_POS_TOP, 3, 200, G_CALLBACK(shift_coord), G_CALLBACK(scroll_shift_coord), & this_proj -> modelgl -> colorp[i][0]);
429 str = g_strdup_printf ("Lattice <b>%s</b> [+/- &#xC5;]", box_prop[0][i-3]);
430 }
431 else if (i == 12)
432 {
433 cedit -> edit_scale[i] = create_hscale (0.0, this_proj -> cell.box[0].param[0][0]*10.0, 0.01, cedit -> cparam[i],
434 GTK_POS_TOP, 3, 200, G_CALLBACK(shift_coord), G_CALLBACK(scroll_shift_coord), & this_proj -> modelgl -> colorp[i][0]);
435 str = g_strdup_printf ("Length [+/- &#xC5;]");
436 }
437 else if (i > 14 && i < 18)
438 {
439 cedit -> edit_scale[i] = create_hscale (0.0, 180.0, 0.01, cedit -> cparam[i],
440 GTK_POS_TOP, 3, 200, G_CALLBACK(shift_coord), G_CALLBACK(scroll_shift_coord), & this_proj -> modelgl -> colorp[i][0]);
441 str = g_strdup_printf ("Angle <b>%s</b> [+/- °]", angl[i-15]);
442 }
443 else if (i > 17)
444 {
445 cedit -> edit_scale[i] = create_hscale (-180, 180.0, 0.01, cedit -> cparam[i],
446 GTK_POS_TOP, 3, 200, G_CALLBACK(shift_coord), G_CALLBACK(scroll_shift_coord), & this_proj -> modelgl -> colorp[i][0]);
447 str = g_strdup_printf ("on <b>%s</b> axis [+/- °]", axis[i-18]);
448 }
449 else
450 {
451 cedit -> edit_scale[i] = create_hscale (0.0, this_proj -> cell.box[0].param[0][0]*10.0, 0.01, cedit -> cparam[i],
452 GTK_POS_TOP, 3, 200, G_CALLBACK(shift_coord), G_CALLBACK(scroll_shift_coord), & this_proj -> modelgl -> colorp[i][0]);
453 str = g_strdup_printf ("Radius [+/- &#xC5;]");
454 }
455
456 update_entry_double (GTK_ENTRY(cedit -> edit_entry[i]), cedit -> cparam[i]);
457 lab = markup_label(unit[(i > 14 && i < 18) ? 1 : 0], 20, -1, 0.0, 0.5);
458 hbox = create_hbox (0);
459 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, 110, -1, 0.0, 0.5), FALSE, FALSE, 0);
460 g_free (str);
461 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, cedit -> edit_scale[i], FALSE, FALSE, 20);
462 GtkWidget * fixed = gtk_fixed_new ();
463 gtk_fixed_put (GTK_FIXED(fixed), cedit -> edit_entry[i], 0, 15);
464 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, fixed, FALSE, FALSE, 0);
465 fixed = gtk_fixed_new ();
466 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, fixed, FALSE, FALSE, 5);
467 gtk_fixed_put (GTK_FIXED(fixed), lab, (i>2 && i<6) ? -50 : 0, 25);
468 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
469 return vbox;
470}
471
479GtkWidget * create_shift_box (project * this_proj)
480{
481 GtkWidget * vbox = create_vbox (BSEP);
482 int i;
483 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("Shift the position of the cell center <sup>*</sup>: ", -1, -1, 0.0, 0.5), FALSE, FALSE, 5);
484 for (i=0; i<3; i++) add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_cell_entries (this_proj, i), FALSE, FALSE, 0);
485 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("* requires all atoms to be wrapped in the unit cell", -1, -1, 0.0, 0.5), FALSE, FALSE, 5);
486 widget_set_sensitive (vbox, this_proj -> modelgl -> wrapped);
488 return vbox;
489}
490
498void wrapping (glwin * view)
499{
500 gchar * text = "You are about to put all the atoms back inside the model box\n"
501 "This action is irreversible, proceed anyway ?";
502 if (ask_yes_no ("Wrap atomic coordinates in unit cell ?", text, GTK_MESSAGE_WARNING, view -> win))
503 {
504 shift_it (vec3 (0.0, 0.0, 0.0), 1, view -> proj);
505 view -> wrapped = TRUE;
506 }
507 if (view -> cell_win)
508 {
509 if (view -> cell_win -> shift_box[0])
510 {
511 if (GTK_IS_WIDGET(view -> cell_win -> shift_box[0]))
512 {
513 widget_set_sensitive (view -> cell_win -> shift_box[0], view -> wrapped);
514 }
515 }
516 }
517#ifdef GTK3
518 // GTK3 Menu Action To Check
519 if (GTK_IS_WIDGET(view -> ogl_box[2]))
520 {
521 widget_set_sensitive (view -> ogl_box[2], ! view -> wrapped);
522 }
523#endif
524}
525
526#ifdef GTK4
535G_MODULE_EXPORT void wrap_coord (GtkCheckButton * but, gpointer data)
536#else
545G_MODULE_EXPORT void wrap_coord (GtkToggleButton * but, gpointer data)
546#endif
547{
548 glwin * view = (glwin *)data;
549 wrapping (view);
550 widget_set_sensitive (GTK_WIDGET(but), ! view -> wrapped);
551}
552
560GtkWidget * shift_center_tab (project * this_proj)
561{
562 GtkWidget * layout = create_layout (350, 250);
563 glwin * view = this_proj -> modelgl;
564 view -> cell_win -> shift_box[0] = create_shift_box (this_proj);
565 view -> cell_win -> put_in_box = check_button ("Wrap atomic coordinates in unit cell", -1, -1, FALSE, G_CALLBACK(wrap_coord), view);
566 widget_set_sensitive (view -> cell_win -> put_in_box, ! view -> wrapped);
567 if (view -> record) widget_set_sensitive (view -> cell_win -> put_in_box, FALSE);
568 layout_add_widget (layout, view -> cell_win -> put_in_box, 20, 20);
569 layout_add_widget (layout, view -> cell_win -> shift_box[0], 100, 100);
571 return layout;
572}
void translate(project *this_proj, int status, int axis, vec3_t trans)
translate
Definition atom_move.c:230
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
Definition bdcall.c:310
void display_density(cell_edition *cell, double vol, double dens, double adens)
create density information widgets
Function declarations for the cell edition window.
gchar * axis[3]
Definition w_axis.c:65
void modify_coordinates_in_lattice(project *this_proj, mat4_t *dlat, mat4_t *drec, int refresh, int density)
modify atomic coordinates in lattice
Definition cell_shift.c:65
void wrapping(glwin *view)
wrapping atomic coordinates
Definition cell_shift.c:498
G_MODULE_EXPORT void set_shift(GtkEntry *res, gpointer data)
set atomic coordinates shift
Definition cell_shift.c:358
G_MODULE_EXPORT void shift_coord(GtkRange *range, gpointer data)
shift coordinates callback - range
Definition cell_shift.c:389
G_MODULE_EXPORT gboolean scroll_shift_coord(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
shift coordinates callback - scroll
Definition cell_shift.c:375
GtkWidget * create_shift_box(project *this_proj)
create shift box widgets
Definition cell_shift.c:479
GtkWidget * shift_center_tab(project *this_proj)
create the shift cell center tab
Definition cell_shift.c:560
void adjust_it(int refresh, int proj)
adjust atomic coordinates
Definition cell_shift.c:222
G_MODULE_EXPORT void wrap_coord(GtkToggleButton *but, gpointer data)
wrap atomic coordinates callback GTK3
Definition cell_shift.c:545
void shift_has_changed(gpointer data, double val)
shift atomic coordinates
Definition cell_shift.c:259
void shift_it(vec3_t shift, int refresh, int proj)
shift atomic coordinates
Definition cell_shift.c:206
GtkWidget * create_cell_entries(project *this_proj, int i)
create the cell entry widgets
Definition cell_shift.c:402
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
color colorp[64]
gchar * param[2]
PangoLayout * layout
Definition curve.c:79
int * shift
Definition d_measures.c:72
int atoms[NUM_STYLES][2]
int bonds[NUM_STYLES][2]
gchar * text
Definition datab.c:105
float val
Definition dlp_init.c:117
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
char * box_prop[2][3]
Definition edit_menu.c:73
int activep
Definition global.c:159
double string_to_double(gpointer string)
convert string to double
Definition global.c:624
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1314
glwin * active_glwin
Definition project.c:53
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:633
project * proj
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:597
#define BSEP
Definition global.h:245
void layout_add_widget(GtkWidget *layout, GtkWidget *child, int x_pos, int y_pos)
Add a GtkWidget in a GtkLayout.
Definition gtk-misc.c:846
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
Definition gtk-misc.c:1799
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
Definition gtk-misc.c:1585
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.
Definition gtk-misc.c:299
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:206
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:813
#define CHEM_M
Definition global.h:298
GtkWidget * create_layout(int x, int y)
create a GtkLayout / GtkFixed widget
Definition gtk-misc.c:880
GtkWidget * create_hscale(float min, float max, float delta, float val, int pos, int round, int size, GCallback handler, GCallback scroll_handler, gpointer data)
create an horizontal scale GtkWidget
Definition gtk-misc.c:744
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:801
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:173
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
void update(glwin *view)
update the rendering of the OpenGL window
Definition glview.c:439
int step
Definition ogl_draw.c:70
@ SLABS
Definition glwin.h:101
@ MDBOX
Definition glwin.h:93
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
Definition interface.c:356
double z
Definition ogl_draw.c:57
double y
Definition ogl_draw.c:57
double x
Definition ogl_draw.c:57
void active_project_changed(int id)
change the active project
Definition update_p.c:175
Definition glwin.h:875
Definition global.h:104
float y
Definition math_3d.h:130
float x
Definition math_3d.h:130
float z
Definition math_3d.h:130
int b
Definition tab-1.c:95
int a
Definition tab-1.c:95
GtkWidget * res[2]
Definition w_encode.c:212
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * img
Definition workspace.c:70
GtkWidget * vbox
Definition workspace.c:72
GtkWidget * lab
Definition workspace.c:73