atomes 1.1.15
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
cpmd_atoms.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: 'cpmd_atoms.c'
24*
25* Contains:
26*
27
28 - The functions to handle dummy atom(s) for the CPMD input file
29
30*
31* List of functions:
32
33 void create_dummy_param_box (int dummy_id);
34 void dummy_set_color (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
35 void dummy_set_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
36 void clean_dummy_widgets ();
37 void remove_dummy (int num_to_remove);
38 void add_dummy (int extra);
39
40 G_MODULE_EXPORT void update_dummy_coord (GtkEntry * res, gpointer data);
41 G_MODULE_EXPORT void dummy_type_changed (GtkComboBox * box, gpointer data);
42 G_MODULE_EXPORT void changed_dummy_id_box (GtkComboBox * box, gpointer data);
43 G_MODULE_EXPORT void select_dummy (GtkCellRendererToggle * cell_renderer, gchar * string_path, gpointer data);
44 G_MODULE_EXPORT void run_remove_dummy (GtkDialog * dialog, gint response_id, gpointer data);
45 G_MODULE_EXPORT void add_or_remove_dummy (GtkSpinButton * res, gpointer data);
46 G_MODULE_EXPORT void atom_button (GtkWidget * but, gpointer data);
47
48 GtkWidget * create_dummy_box ();
49
50 dummy_atom * get_active_dummy (int id);
51 dummy_atom * init_dummy (int type, int id);
52
53*/
54
55#include "global.h"
56#include "interface.h"
57#include "glview.h"
58#include "calc.h"
59#include "cpmd.h"
60
61extern void create_selection_combo (int id, int num, int type, GCallback handler);
62extern void print_the_section (int s, int p, GtkTextBuffer * buffer);
63extern void create_selection_button (GtkWidget * box, int num, int id, gpointer data);
64extern G_MODULE_EXPORT void changed_opt_box (GtkComboBox * box, gpointer data);
65extern GtkWidget * combo_id[2];
66extern GtkWidget * combo_id_box[2];
67extern ColRGBA init_color (int id, int numid);
68extern int num_cpmd_objects;
69
70GtkWidget * dummy_box[2];
71GtkWidget * the_dummy_box;
72GtkWidget * dummy_param_box;
76GtkCellRenderer * dummy_renderer[5];
77GtkTreeViewColumn * dummy_col[5];
78
87{
88 dummy_atom * dumm = tmp_cpmd -> dummy;
89 while (dumm -> id != id)
90 {
91 if (dumm -> next != NULL) dumm = dumm -> next;
92 }
93 return dumm;
94}
95
104G_MODULE_EXPORT void update_dummy_coord (GtkEntry * res, gpointer data)
105{
106 int i;
107 i = GPOINTER_TO_INT(data);
108 const gchar * m = entry_get_text (res);
109 double v = string_to_double ((gpointer)m);
110 dummy -> xyz[i] = v;
111 update_entry_double (res, dummy -> xyz[i]);
112 print_the_section (8, 0, qmbuffer[8]);
113}
114
115void create_dummy_param_box (int dummy_id);
116
125G_MODULE_EXPORT void dummy_type_changed (GtkComboBox * box, gpointer data)
126{
127 int i;
128 i = gtk_combo_box_get_active (box);
129 if (i != dummy -> type)
130 {
131 dummy -> type = i;
133 }
134 print_the_section (8, 0, qmbuffer[8]);
135}
136
144void create_dummy_param_box (int dummy_id)
145{
146 gchar * str;
148 if (tmp_cpmd -> dummies > 0)
149 {
150 GtkWidget * hbox;
151 GtkWidget * widg;
152 str = g_strdup_printf ("Configuration for dummy atom N°<b>%d</b>: ", dummy_id+1);
154 cpmd_box (dummy_box[1], str, 0, 5, 280);
155 g_free (str);
156 int i;
157 hbox = cpmd_box (dummy_box[1], "Type of dummy atom:", 0, 25, -1);
158 GtkWidget * box = create_combo ();
159 gchar * dtypes[3] = {"Type 1", "Type 2", "Type 3"};
160 gchar * dtext[3] = {"fixed in space:",
161 "calculated by\nthe arithmetic mean of the coordinates of the selected atom(s)",
162 "calculated by\nthe center of mass of the coordinates of the selected atom(s)"};
163 for (i=0; i<3; i++)
164 {
165 combo_text_append (box, dtypes[i]);
166 }
167 g_signal_connect (G_OBJECT (box), "changed", G_CALLBACK(dummy_type_changed), NULL);
168 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, box, FALSE, FALSE, 10);
169 dummy = get_active_dummy (dummy_id);
170 str = g_strdup_printf ("The coordinates of the dummy atom are %s", dtext[dummy -> type]);
171
172 hbox = create_hbox (0);
173 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_box[1], hbox, FALSE, FALSE, 0);
174 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, -1, (dummy -> type == 0) ? 40 : 60, 0.0, 0.5), FALSE, FALSE, 25);
175 g_free (str);
176 if (dummy -> type > 0)
177 {
178 create_selection_button (dummy_box[1], dummy -> natoms, 2, GINT_TO_POINTER(-(dummy -> id + 2)));
179 }
180 else
181 {
182 gchar * lcoo[3]={"<b>x</b>", "<b>y</b>", "<b>z</b>"};
183
184 for (i=0; i<3; i++)
185 {
186 str = g_strdup_printf ("Dummy %s coordinate: ", lcoo[i]);
187 hbox = cpmd_box (dummy_box[1], str, 0, 25, -1);
188 widg = create_entry (G_CALLBACK(update_dummy_coord), 100, 15, FALSE, GINT_TO_POINTER(i));
189 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, widg, FALSE, FALSE, 10);
190 update_entry_double (GTK_ENTRY(widg), dummy -> xyz[i]);
191 }
192 }
193 gtk_combo_box_set_active (GTK_COMBO_BOX(box), dummy -> type);
194 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_box[0], dummy_box[1], FALSE, FALSE, 0);
196 }
197}
198
207G_MODULE_EXPORT void changed_dummy_id_box (GtkComboBox * box, gpointer data)
208{
209 int i;
210 i = gtk_combo_box_get_active (box);
212}
213
222dummy_atom * init_dummy (int type, int id)
223{
224 dummy_atom * dumm = g_malloc0 (sizeof*dumm);
225 dumm -> id = id;
226 dumm -> type = type;
227 dumm -> show = FALSE;
228 dumm -> natoms = 0;
229 dumm -> list = NULL;
230 dumm -> xyz[0] = 0.0;
231 dumm -> xyz[1] = 0.0;
232 dumm -> xyz[2] = 0.0;
233 return dumm;
234}
235
245G_MODULE_EXPORT void select_dummy (GtkCellRendererToggle * cell_renderer, gchar * string_path, gpointer data)
246{
247 GtkTreeStore ** model = (GtkTreeStore **)data;
248 GtkTreeIter iter;
249 GtkTreePath * path = gtk_tree_path_new_from_string (string_path);
250 gtk_tree_model_get_iter (GTK_TREE_MODEL(* model), & iter, path);
251 if (gtk_cell_renderer_toggle_get_active(cell_renderer))
252 {
253 get_active_dummy (old_dummy[n_dummy-1]) -> show = FALSE;
254 old_dummy[n_dummy-1] = -1;
255 n_dummy --;
256 gtk_tree_store_set (* model, & iter, 4, 0, -1);
257 //toviz.c = 0;
258 }
259 else
260 {
261 n_dummy ++;
262 gtk_tree_store_set (* model, & iter, 4, 1, -1);
263 gtk_tree_model_get (GTK_TREE_MODEL(* model), & iter, 0, & old_dummy[n_dummy-1], -1);
264 old_dummy[n_dummy-1] --;
265 get_active_dummy (old_dummy[n_dummy-1]) -> show = TRUE;
266 //toviz.c = 1;
267 }
268 // Viz
269}
270
282void dummy_set_color (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
283{
284 int i;
285 gtk_tree_model_get (mod, iter, 0, & i, -1);
286 i = abs(i);
287 set_renderer_color (get_active_dummy (i-1) -> show, renderer, init_color (i-1, num_cpmd_objects));
288}
289
301void dummy_set_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
302{
303 int i, j;
304 i = GPOINTER_TO_INT(data);
305 gtk_tree_model_get (mod, iter, 0, & j, -1);
306 if (j > 0 && i != 3)
307 {
308 gtk_cell_renderer_set_visible (renderer, TRUE);
309 if (i < 3) dummy_set_color (col, renderer, mod, iter, data);
310 }
311 else if (j > 0)
312 {
313 gtk_cell_renderer_set_visible (renderer, FALSE);
314 }
315 else if (i == 3)
316 {
317 gtk_cell_renderer_set_visible (renderer, TRUE);
318 dummy_set_color (col, renderer, mod, iter, data);
319 }
320 else
321 {
322 gtk_cell_renderer_set_visible (renderer, FALSE);
323 }
324}
325
326GtkWidget * create_dummy_box ();
327
341
351G_MODULE_EXPORT void run_remove_dummy (GtkDialog * dialog, gint response_id, gpointer data)
352{
353 int i, j;
354 gboolean done = FALSE;
355 int num_to_remove = GPOINTER_TO_INT(data);
356 dummy_atom * dumm;
357 gchar * str;
358 switch (response_id)
359 {
360 case GTK_RESPONSE_APPLY:
361 if (n_dummy == num_to_remove)
362 {
363 done = TRUE;
364 // Now we remove all selected dummy atoms
365 for (i=0; i<n_dummy; i++)
366 {
367 dumm = tmp_cpmd -> dummy;
368 for (j=0; j<tmp_cpmd -> dummies; j++)
369 {
370 if (dumm -> id == old_dummy[i])
371 {
372 if (dumm -> next != NULL)
373 {
374 if (dumm -> prev != NULL)
375 {
376 dumm -> next -> prev = dumm -> prev;
377 dumm -> prev -> next = dumm -> next;
378 }
379 else
380 {
381 tmp_cpmd -> dummy = dumm -> next;
382 tmp_cpmd -> dummy -> prev = NULL;
383 }
384 g_free (dumm);
385 }
386 else if (dumm -> prev != NULL)
387 {
388 dumm -> prev -> next = NULL;
389 g_free (dumm);
390 }
391 else
392 {
393 g_free (tmp_cpmd -> dummy);
394 tmp_cpmd -> dummy = NULL;
395 }
396 break;
397 }
398 if (dumm -> next != NULL) dumm = dumm -> next;
399 }
400 }
401 tmp_cpmd -> dummies -= num_to_remove;
402 if (tmp_cpmd -> dummies > 0)
403 {
404 dumm = tmp_cpmd -> dummy;
405 for (j=0; j<tmp_cpmd -> dummies; j++)
406 {
407 dumm -> id = j;
408 if (dumm -> next != NULL) dumm = dumm -> next;
409 }
410 }
413 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_param_box, the_dummy_box, FALSE, FALSE, 0);
415 }
416 else
417 {
418 str = g_strdup_printf ("You must select %d dummy atom(s) to be deleted !", num_to_remove);
420 g_free (str);
421 }
422 break;
423 default:
424 // field_unselect_all ();
425 done = TRUE;
426 break;
427 }
428 if (done) destroy_this_dialog (dialog);
429}
430
438void remove_dummy (int num_to_remove)
439{
440 int i, j, k;
441 gchar * str;
442 str = g_strdup_printf ("Select the %d dummy atom(s) to be removed", num_to_remove);
443 GtkWidget * rdummy = dialogmodal (str, GTK_WINDOW(qm_assistant));
444 g_free (str);
445 gtk_dialog_add_button (GTK_DIALOG(rdummy), "Apply", GTK_RESPONSE_APPLY);
446
447 gchar * mol_title[5] = {"Id", "Type", "Atom(s)", " ", "Select"};
448 gchar * ctype[5] = {"text", "text", "text", "text", "active"};
449 GType col_type[5] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN};
450
451 GtkTreeIter dummy_level, atom_level;
452 n_dummy = 0;
453 old_dummy = allocint(tmp_cpmd -> dummies);
454 GtkTreeStore * remove_model = gtk_tree_store_newv (5, col_type);
455 GtkWidget * remove_tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(remove_model));
456 for (i=0; i<5; i++)
457 {
458 if (i < 4)
459 {
460 dummy_renderer[i] = gtk_cell_renderer_text_new ();
461 }
462 else
463 {
464 dummy_renderer[i] = gtk_cell_renderer_toggle_new ();
465 gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE(dummy_renderer[i]), TRUE);
466 g_signal_connect (G_OBJECT(dummy_renderer[i]), "toggled", G_CALLBACK(select_dummy), & remove_model);
467 }
468 dummy_col[i] = gtk_tree_view_column_new_with_attributes (mol_title[i], dummy_renderer[i], ctype[i], i, NULL);
469 gtk_tree_view_column_set_alignment (dummy_col[i], 0.5);
470 gtk_tree_view_append_column (GTK_TREE_VIEW(remove_tree), dummy_col[i]);
471 gtk_tree_view_column_set_cell_data_func (dummy_col[i], dummy_renderer[i], dummy_set_visible, GINT_TO_POINTER(i), NULL);
472 }
473 // fill model
474 dummy_atom * dumm = tmp_cpmd -> dummy;
475 for (i=0; i<tmp_cpmd -> dummies; i++)
476 {
477 gtk_tree_store_append (remove_model, & dummy_level, NULL);
478 gtk_tree_store_set (remove_model, & dummy_level, 0, i+1,
479 1, g_strdup_printf ("Type %d", dumm -> type + 1),
480 2, dumm -> natoms,
481 3, NULL,
482 4, 0, -1);
483 for (j=0; j<dumm -> natoms; j++)
484 {
485 gtk_tree_store_append (remove_model, & atom_level, & dummy_level);
486 k = qm_proj -> atoms[0][dumm -> list[j]].sp;
487 str = g_strdup_printf ("%s<sub>%d</sub>", exact_name(qm_proj -> chemistry -> label[k]), dumm -> list[j]+1);
488 gtk_tree_store_set (remove_model, & atom_level, 0, -(i+1), 1, 0.0, 2, 0.0, 3, str, 4, 0, -1);
489 g_free (str);
490 }
491 if (dumm -> next != NULL) dumm = dumm -> next;
492 }
493 num_cpmd_objects = tmp_cpmd -> dummies;
494 g_object_unref (remove_model);
495
496 i = ((tmp_cpmd -> dummies+1)*40 < 500) ? (tmp_cpmd -> dummies+1)*40 : 500;
497 GtkWidget * scrollsets = create_scroll (dialog_get_content_area (rdummy), 450, i, GTK_SHADOW_ETCHED_IN);
498 add_container_child (CONTAINER_SCR, scrollsets, remove_tree);
499 run_this_gtk_dialog (rdummy, G_CALLBACK(run_remove_dummy), GINT_TO_POINTER(num_to_remove));
500}
501
502
510void add_dummy (int extra)
511{
512 int i;
513 if (tmp_cpmd -> dummy == NULL)
514 {
515 tmp_cpmd -> dummy = init_dummy (0, 0);
516 tmp_cpmd -> dummies = 1;
517 extra --;
518 }
519 dummy_atom * dumm = tmp_cpmd -> dummy;
520 while (dumm -> next != NULL) dumm = dumm -> next;
521 for (i=0; i<extra; i++)
522 {
523 dumm -> next = init_dummy (0, i+tmp_cpmd -> dummies);
524 dumm -> next -> prev = dumm;
525 dumm = dumm -> next;
526 }
527
528 tmp_cpmd -> dummies += extra;
529 // finaly update the combobox
530 create_selection_combo (1, tmp_cpmd -> dummies, 0, G_CALLBACK(changed_dummy_id_box));
531}
532
541G_MODULE_EXPORT void add_or_remove_dummy (GtkSpinButton * res, gpointer data)
542{
543 int id = gtk_spin_button_get_value_as_int(res);
544 int k;
545 gchar * str;
546 gboolean to_add_dummy = TRUE;
547 if (id != tmp_cpmd -> dummies)
548 {
549 if (id > tmp_cpmd -> dummies)
550 {
551 // adding dummy
552 k = id - tmp_cpmd -> dummies;
553 if (k > 1)
554 {
555 str = g_strdup_printf ("Do you really want to add %d dummy atom(s) ?", k);
556 to_add_dummy = ask_yes_no ("Adding dummy atom(s) ?", str, GTK_MESSAGE_QUESTION, qm_assistant);
557 g_free (str);
558 }
559 if (to_add_dummy)
560 {
561 add_dummy (k);
562 }
563 }
564 else if (id < tmp_cpmd -> dummies)
565 {
566 remove_dummy (tmp_cpmd -> dummies - id);
567 }
568 }
569 gtk_spin_button_set_value (GTK_SPIN_BUTTON(res), tmp_cpmd -> dummies);
570 print_the_section (8, 0, qmbuffer[8]);
571}
572
578GtkWidget * create_dummy_box ()
579{
580 GtkWidget * vbox = create_vbox (BSEP);
581 GtkWidget * hbox;
582 GtkWidget * widg;
583 hbox = cpmd_box (vbox, "Number of dummy atom(s):", 5, 20, 200);
584 widg = spin_button (G_CALLBACK(add_or_remove_dummy),
585 tmp_cpmd -> dummies, 0.0, (double)qm_proj -> natomes, 1.0, 0, 100, NULL);
586 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, widg, FALSE, FALSE, 0);
587 combo_id[1] = cpmd_box (vbox, "Dummy atom to configure: ", 5, 5, 200);
589 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, dummy_box[0], FALSE, FALSE, 10);
590 create_selection_combo (1, tmp_cpmd -> dummies, 0, G_CALLBACK(changed_dummy_id_box));
591 return vbox;
592}
593
602G_MODULE_EXPORT void atom_button (GtkWidget * but, gpointer data)
603{
604 int i, j;
605 i = GPOINTER_TO_INT(data);
606 gchar * atom_cons[2] = {"Add and configure constraint(s)", "Add and configure dummy atoms"};
607 GtkWidget * amol = dialogmodal (atom_cons[(i == DEFCO) ? 0 : 1], GTK_WINDOW(qm_assistant));
608 GtkWidget * vbox = dialog_get_content_area (amol);
609 GtkWidget * hbox;
610 GtkWidget * widg;
611 gchar * str;
612 if (i == DEFCO)
613 {
614 hbox = cpmd_box (vbox, default_opts[5][1], 5, 20, 120);
615 widg = create_combo ();
616 for (j=0; j<defaut_num[5]; j++)
617 {
618 str = g_strdup_printf ("%s", default_text[5][j]);
619 combo_text_append (widg, str);
620 g_free (str);
621 }
622 gtk_combo_box_set_active (GTK_COMBO_BOX(widg), (int)tmp_cpmd -> default_opts[i+1]);
623 g_signal_connect (G_OBJECT (widg), "changed", G_CALLBACK(changed_opt_box), GINT_TO_POINTER(i+1));
624 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, widg, FALSE, FALSE, 0);
625 create_selection_button (vbox, tmp_cpmd -> fixat, 1, GINT_TO_POINTER(-1));
626 j = (tmp_cpmd -> default_opts[i+1] < 0.0) ? 0 : (int) tmp_cpmd -> default_opts[i+1];
628 }
629 else if (i == DEFDU)
630 {
631 dummy_box[0] = NULL;
632 dummy_box[1] = NULL;
633 combo_id[1] = NULL;
635 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, dummy_param_box, FALSE, FALSE, 0);
637 add_box_child_start (GTK_ORIENTATION_VERTICAL, dummy_param_box, the_dummy_box, FALSE, FALSE, 0);
638 }
639 run_this_gtk_dialog (amol, G_CALLBACK(run_destroy_dialog), NULL);
640}
GtkTextBuffer * qmbuffer[MAXDATAQM+2]
Definition calc.c:70
GtkWidget * qm_assistant
Definition calc.c:66
project * qm_proj
Definition calc.c:67
Variable declarations for the MD input preparation assistants.
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
GtkWidget * cpmd_box(GtkWidget *box, gchar *lab, int v_space, int h_space, int dim)
prepare a labelled box widget for the CPMD input creation assistant
Definition cpmd_init.c:248
Variable declarations for the creation of the CPMD input file.
gchar * default_text[9][NDFT]
Definition cpmd_init.c:150
#define DEFDU
Definition cpmd.h:51
cpmd * tmp_cpmd
Definition cpmd_init.c:103
int defaut_num[9]
Definition cpmd_init.c:138
gchar * default_opts[MAXDATAQM-1][NSECOP]
Definition cpmd_init.c:123
#define DEFCO
Definition cpmd.h:49
GtkWidget * sel_but[3]
Definition cpmd_nose.c:137
void create_dummy_param_box(int dummy_id)
crreate dummy atom parameter widgets
Definition cpmd_atoms.c:144
dummy_atom * dummy
Definition cpmd_atoms.c:73
void dummy_set_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
show / hide cell renderer in the CPMD dummy atom(s) tree store
Definition cpmd_atoms.c:301
void create_selection_button(GtkWidget *box, int num, int id, gpointer data)
create thermostat atom(s) selection button
Definition cpmd_nose.c:1430
GtkWidget * dummy_box[2]
Definition cpmd_atoms.c:70
G_MODULE_EXPORT void dummy_type_changed(GtkComboBox *box, gpointer data)
change the dummy atom type
Definition cpmd_atoms.c:125
GtkWidget * create_dummy_box()
create the dummy atom(s) widgets
Definition cpmd_atoms.c:578
int n_dummy
Definition cpmd_atoms.c:74
int * old_dummy
Definition cpmd_atoms.c:75
void create_selection_combo(int id, int num, int type, GCallback handler)
create thermostat selection combo box
Definition cpmd_nose.c:1503
GtkWidget * dummy_param_box
Definition cpmd_atoms.c:72
void clean_dummy_widgets()
destroy dummy atom(s) widgets
Definition cpmd_atoms.c:333
int num_cpmd_objects
Definition cpmd_nose.c:154
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
void print_the_section(int s, int p, GtkTextBuffer *buffer)
print CPMD input section
Definition cpmd_print.c:695
G_MODULE_EXPORT void select_dummy(GtkCellRendererToggle *cell_renderer, gchar *string_path, gpointer data)
on select dummy atom toggle callback
Definition cpmd_atoms.c:245
GtkWidget * combo_id_box[2]
Definition cpmd_nose.c:146
GtkWidget * combo_id[2]
Definition cpmd_nose.c:145
GtkWidget * the_dummy_box
Definition cpmd_atoms.c:71
void dummy_set_color(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color in the CPMD dummy atom(s) tree store
Definition cpmd_atoms.c:282
dummy_atom * init_dummy(int type, int id)
create dummy atom
Definition cpmd_atoms.c:222
dummy_atom * get_active_dummy(int id)
get dummy atom by id
Definition cpmd_atoms.c:86
void remove_dummy(int num_to_remove)
remove dummy atom(s) - creating the dialog
Definition cpmd_atoms.c:438
GtkCellRenderer * dummy_renderer[5]
Definition cpmd_atoms.c:76
G_MODULE_EXPORT void atom_button(GtkWidget *but, gpointer data)
CPMD input file, add constraint(s) or dummy atom(s) - creating the dialog.
Definition cpmd_atoms.c:602
GtkTreeViewColumn * dummy_col[5]
Definition cpmd_atoms.c:77
G_MODULE_EXPORT void changed_opt_box(GtkComboBox *box, gpointer data)
change CPMD QM option
Definition cpmd_init.c:375
void add_dummy(int extra)
add dummy atom(s)
Definition cpmd_atoms.c:510
G_MODULE_EXPORT void add_or_remove_dummy(GtkSpinButton *res, gpointer data)
add or remove dummy atom spin callback
Definition cpmd_atoms.c:541
G_MODULE_EXPORT void changed_dummy_id_box(GtkComboBox *box, gpointer data)
change the dummy atom id
Definition cpmd_atoms.c:207
G_MODULE_EXPORT void run_remove_dummy(GtkDialog *dialog, gint response_id, gpointer data)
remove dummy atom(s) - running the dialog
Definition cpmd_atoms.c:351
G_MODULE_EXPORT void update_dummy_coord(GtkEntry *res, gpointer data)
udate dummy atom coordinate entry callback
Definition cpmd_atoms.c:104
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Definition labels.c:56
float extra
ColRGBA col
Definition d_measures.c:77
int atoms[NUM_STYLES][2]
GtkTreePath * path
Definition datab.c:103
GType col_type[MAXDATA][12]
Definition dlp_field.c:856
int * allocint(int val)
allocate an int * pointer
Definition global.c:314
double string_to_double(gpointer string)
convert string to double
Definition global.c:624
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
Definition gtk-misc.c:492
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1314
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:633
void set_renderer_color(int tocol, GtkCellRenderer *renderer, ColRGBA col)
set the color of a GtkCellRenderer
Definition gtk-misc.c:1653
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
Definition gtk-misc.c:1960
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
Definition gtk-misc.c:510
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:597
#define BSEP
Definition global.h:245
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
Definition gtk-misc.c:1772
@ CONTAINER_SCR
Definition global.h:251
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:923
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:825
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
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
Definition gtk-misc.c:2065
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:813
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:900
G_MODULE_EXPORT void run_destroy_dialog(GtkDialog *dialog, gint response_id, gpointer data)
to destroy a GtkDialog when the dialog emit the closing signal
Definition gtk-misc.c:2102
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2034
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:226
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
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void show_warning(char *warning, GtkWidget *win)
show warning
Definition interface.c:260
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
Definition interface.c:356
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:370
Messaging function declarations.
GtkWidget * res[2]
Definition w_encode.c:212
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * vbox
Definition workspace.c:72