atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
initcoord.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-2026 by CNRS and University of Strasbourg */
15
23
24/*
25* This file: 'initcoord.c'
26*
27* Contains:
28*
29
30 - Coordinations and polyhedra menu initialization
31 - Coordinations and polyhedra GTK3 menus and menu items creation
32 - Initialization of coordinations and polyhedra related data from Fortran90 information
33
34*
35* List of functions:
36
37 void gcid_spcolor_setup (int sp, int id);
38 void set_color_map_sensitive (glwin * view);
39 void set_advanced_bonding_menus (glwin * view);
40 void prep_all_coord_menus (glwin * view);
41 void partial_geo_out_ (int * sp, int * id, int * ngsp, int coord[* ngsp]);
42 void allocate_partial_geo_ (int * sp, int * ngsp);
43 void init_menu_coordinations_ (int * id, int * sp, int * ngsp, int coordt[* ngsp]);
44 void init_menu_fragmol_ (int * id);
45 void init_menurings_ (int * coo, int * ids, int * ngsp, int coordt[* ngsp], int * init);
46 void init_opengl_coords (int id, int nt, int init);
47 void send_coord_opengl_ (int * id, int * num, int * cmin, int * cmax, int * nt, int coord[* num]);
48
49 GtkWidget * coord_view_setup (int * sp, int id, int jd);
50 GtkWidget * coord_color_setup (int * sp, int id, int jd);
51 GtkWidget * poly_show_setup (int * sp, int id, int jd);
52 GtkWidget * create_coord_menu (int p, char * name, gboolean va, GtkWidget * menu, qint * data);
53
54 ColRGBA init_color (int id, int numid);
55
56*/
57
58#include "global.h"
59#include "interface.h"
60#include "bind.h"
61#include "color_box.h"
62#include "glwindow.h"
63#include "glview.h"
64
65extern GtkWidget * coord_menu (glwin * view);
66extern cairo_surface_t * col_surface (double r, double g, double b, int x, int y);
67extern G_MODULE_EXPORT void coord_properties (GtkWidget * widg, gpointer data);
68extern void setup_molecules ();
69extern int * duplicate_int (int num, int * old_val);
70
71int ** idgeo = NULL;
72
81ColRGBA init_color (int id, int numid)
82{
83 float a, b;
85 if (numid > 5)
86 {
87 a = (float)id;
88 b = (float)numid / 4.0;
89 if (a < b)
90 {
91 col.red = 1.0;
92 col.green = a / b;
93 col.blue = 0.0;
94 }
95 else if (a < 2*b)
96 {
97 col.red = 1.0 - (1.0 * (a-b)/b);
98 col.green = 1.0;
99 col.blue = 0.0;
100 }
101 else if (a < 3*b)
102 {
103 col.red = 0.0;
104 col.green = 1.0;
105 col.blue = (1.0 * (a-2.0*b)/b);
106 }
107 else
108 {
109 col.red = 0.0;
110 col.green = 1.0 - (1.0 * (a-3.0*b)/b);
111 col.blue = 1.0;
112 }
113 col.alpha = 1.0;
114 }
115 else
116 {
117 col = std[id];
118 col.alpha = 1.0;
119 }
120 return col;
121}
122
131void gcid_spcolor_setup (int sp, int id)
132{
133 int i;
134 if (active_glwin -> gcid[id] == NULL)
135 {
136 active_glwin -> gcid[id] = g_malloc0(active_coord -> totcoord[id]*sizeof*active_glwin -> gcid[id]);
137 for (i=0; i<active_coord -> totcoord[id]; i++)
138 {
139 active_glwin -> gcid[id][i] = g_malloc0(64*sizeof*active_glwin -> gcid[id][i]);
140 }
141 }
142 active_image -> spcolor[id][sp] = g_malloc0(active_coord -> totcoord[id]*sizeof*active_image -> spcolor[id][sp]);
143}
144
145#ifdef GTK3
146// GTK3 Menu Action To Check
154void set_color_map_sensitive (glwin * view)
155{
156 int i, j;
157 for (i=0; i<ATOM_MAPS+POLY_MAPS; i++)
158 {
159 j = i - ATOM_MAPS*(i/ATOM_MAPS);
160 if (j < 3 ) widget_set_sensitive (view -> color_styles[i], 1);
161 if (j == 3) widget_set_sensitive (view -> color_styles[i], view -> adv_bonding[0]);
162 if (j == 4) widget_set_sensitive (view -> color_styles[i], view -> adv_bonding[1]);
163 if (j == 5) widget_set_sensitive (view -> color_styles[i], (get_project_by_id(view -> proj) -> force_field[0]) ? 1 : 0);
164 if (j == 6) widget_set_sensitive (view -> color_styles[i], (! (i/ATOM_MAPS) || view -> custom_map) ? 1 : 0);
165 }
166}
167
176{
177 int i;
178 for (i=0; i<2; i++)
179 {
180 widget_set_sensitive (view -> ogl_smode[2*i+2], view -> adv_bonding[0]);
181 widget_set_sensitive (view -> ogl_smode[2*i+3], view -> adv_bonding[1]);
182 widget_set_sensitive (view -> ogl_mode[2+i+NINPUTS], view -> adv_bonding[1]);
183 }
184}
185
193void prep_all_coord_menus (glwin * view)
194{
195 // GTK3 Menu Action To Check
197 gtk_menu_item_set_submenu ((GtkMenuItem *)view -> ogl_coord[0], coord_menu (view));
198 widget_set_sensitive (view -> ogl_coord[3], view -> adv_bonding[0]);
199 widget_set_sensitive (view -> ogl_coord[4], view -> adv_bonding[1]);
200 show_the_widgets (view -> ogl_coord[0]);
202}
203
213GtkWidget * coord_view_setup (int * sp, int id, int jd)
214{
215 GtkWidget * menuv = gtk_menu_new ();
216 if (id < 2)
217 {
218 active_glwin -> oglmv[jd][id][* sp] = NULL;
219 active_glwin -> oglmv[jd][id][* sp] = create_menu_item (TRUE, active_chem -> label[* sp]);
220 gtk_menu_item_set_submenu ((GtkMenuItem *)active_glwin -> oglmv[jd][id][* sp], menuv);
221 }
222 return menuv;
223}
224
234GtkWidget * coord_color_setup (int * sp, int id, int jd)
235{
236 if (! jd) gcid_spcolor_setup (* sp, id);
237 GtkWidget * menuc = NULL;
238 menuc = gtk_menu_new ();
239 if (id < 2)
240 {
241 active_glwin -> oglmc[jd][id][* sp] = NULL;
242 active_glwin -> oglmc[jd][id][* sp] = create_menu_item (TRUE, active_chem -> label[* sp]);
243 gtk_menu_item_set_submenu ((GtkMenuItem *)active_glwin -> oglmc[jd][id][* sp], menuc);
244 }
245 return menuc;
246}
247
257GtkWidget * poly_show_setup (int * sp, int id, int jd)
258{
259 GtkWidget * menup = gtk_menu_new ();
260 active_glwin -> oglmpv[jd][id][* sp] = NULL;
261 if (id < 2)
262 {
263 active_glwin -> oglmpv[jd][id][* sp] = create_menu_item (TRUE, active_chem -> label[* sp]);
264 }
265 else
266 {
267 active_glwin -> oglmpv[jd][id][* sp] = create_menu_item (TRUE, _("Show/Hide"));
268 }
269 gtk_menu_item_set_submenu ((GtkMenuItem *)active_glwin -> oglmpv[jd][id][* sp], menup);
270 return menup;
271}
272
284GtkWidget * create_coord_menu (int p, char * name, gboolean va, GtkWidget * menu, qint * data)
285{
286 GtkWidget * coord_widget = gtk3_menu_item (menu, name, IMG_NONE, NULL, NULL, NULL, FALSE, 0, 0, TRUE, FALSE, va);
287 if (p == 0)
288 {
289 g_signal_connect (G_OBJECT (coord_widget), "activate", G_CALLBACK(show_hide_coord), data);
290 }
291 else
292 {
293 g_signal_connect (G_OBJECT (coord_widget), "activate", G_CALLBACK(show_hide_poly), data);
294 }
295 return coord_widget;
296}
297#endif
298
309void partial_geo_out_ (int * sp, int * id, int * ngsp, int coord[* ngsp])
310{
311 active_coord -> partial_geo[* sp][* id] = duplicate_int (* ngsp, coord);
312}
313
322void allocate_partial_geo_ (int * sp, int * ngsp)
323{
324 if (active_coord -> partial_geo[* sp] != NULL)
325 {
326 g_free (active_coord -> partial_geo[* sp]);
327 active_coord -> partial_geo[* sp] = NULL;
328 }
329 active_coord -> partial_geo[* sp] = g_malloc0(* ngsp * sizeof*active_coord -> partial_geo[* sp]);
330}
331
342void init_menu_coordinations_ (int * id, int * sp, int * ngsp, int coordt[* ngsp])
343{
344 int i, j, k, l, m, n, o;
345#ifdef GTK3
346 // GTK3 Menu Action To Check
347 gchar * str, * env;
348 GtkWidget * spm;
349 GtkWidget * menupv;
350 GtkWidget * menuc;
351 GtkWidget * menuv;
352#endif
353 i = 0;
354 for (j=0; j < * sp; j++)
355 {
356 i += active_coord -> ntg[* id][j];
357 }
358 j = 2*active_project -> nspec;
359 for (l=0; l < * id; l++)
360 {
361 j += active_coord -> totcoord[l];
362 }
363 k = i + j;
364 if (active_coord -> geolist[* id][* sp] != NULL)
365 {
366 g_free (active_coord -> geolist[* id][* sp]);
367 active_coord -> geolist[* id][* sp] = NULL;
368 }
369 active_coord -> geolist[* id][* sp] = duplicate_int (* ngsp, coordt);
370 active_coord -> ntg[* id][* sp] = * ngsp;
371
372 l = 0;
373 for (m=0; m < * ngsp; m++)
374 {
375 if (* id)
376 {
377 n = 0;
378 for (o=0; o<active_project -> nspec; o++)
379 {
380 n += active_coord -> partial_geo[* sp][m][o];
381 }
382 }
383 else
384 {
385 n = coordt[m];
386 }
387
388 if (n > 2)
389 {
390 l ++;
391 active_image -> show_poly[* id][m+i] = TRUE;
392 }
393 else
394 {
395 active_image -> show_poly[* id][m+i] = FALSE;
396 }
397 }
398#ifdef GTK4
399 gcid_spcolor_setup (* sp, * id);
400 for (m=0; m < * ngsp; m++)
401 {
402 active_image -> show_coord[* id][m+i] = TRUE;
403 active_coord -> geolist[* id][* sp][m] = coordt[m];
404 if (* id)
405 {
406 active_image -> spcolor[* id][* sp][m] = init_color (m+i, active_coord -> totcoord[* id]);
407 }
408 else
409 {
410 active_image -> spcolor[* id][* sp][m] = init_color (coordt[m]-active_coord -> cmin, active_coord -> cmax-active_coord -> cmin);
411 }
412 active_image -> show_poly[* id][m+i] = FALSE;
413 active_image -> spcolor[* id][* sp][m].alpha = DEFAULT_ALPHA;
414 color_box (active_glwin, k+m, * sp, m);
415 }
416#else
417 // GTK3 Menu Action To Check
418 for (m=0; m<2; m++)
419 {
420 menuc = coord_color_setup (sp, * id, m);
421 menuv = coord_view_setup (sp, * id, m);
422 if (l > 0)
423 {
424 menupv = poly_show_setup (sp, * id, m);
425 }
426 else
427 {
428 active_glwin -> oglmpv[m][* id][* sp] = NULL;
429 }
430 for (n=0; n < * ngsp; n++)
431 {
432 if (* id)
433 {
434 env = env_name (active_project, n, * sp, 1, NULL);
435 str = exact_name (env);
436 g_free (env);
437 spm = create_menu_item_from_widget (markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, FALSE);
438 }
439 else
440 {
441 str = g_strdup_printf ("%d", coordt[n]);
442 spm = create_menu_item (TRUE, str);
443 }
444 if (! m)
445 {
446 active_image -> show_coord[* id][n+i] = TRUE;
447 active_coord -> geolist[* id][* sp][n] = coordt[n];
448 if (* id)
449 {
450 active_image -> spcolor[* id][* sp][n] = init_color (n+i, active_coord -> totcoord[* id]);
451 }
452 else
453 {
454 active_image -> spcolor[* id][* sp][n] = init_color (coordt[n]-active_coord -> cmin, active_coord -> cmax-active_coord -> cmin);
455 }
456 active_image -> spcolor[* id][* sp][n].alpha = DEFAULT_ALPHA;
457 }
458 active_glwin -> ogl_geom[m][* id][n+i] = create_coord_menu (0, str, TRUE, menuv, & active_glwin -> gcid[* id][n+i][* id]);
459 gtk_menu_shell_append ((GtkMenuShell *)menuc, spm);
460 gtk_menu_item_set_submenu ((GtkMenuItem *)spm, color_box (active_glwin, k+n, * sp, n));
461 if (active_image -> show_poly[* id][n+i])
462 {
463 // The polyhedra show/hide menu
464 active_glwin -> ogl_poly[m][* id][n+i] = create_coord_menu (1, str, FALSE, menupv, & active_glwin -> gcid[* id][n+i][* id]);
465 if (m) active_image -> show_poly[* id][n+i] = FALSE;
466 }
467 g_free (str);
468 }
469 }
470#endif
471}
472
480void init_menu_fragmol_ (int * id)
481{
482#ifdef DEBUG
483 gchar * keyw[2] = {i18n("fragment(s)"), i18n("molecule(s)")};
484 if (active_project -> steps > 1)
485 {
486 gchar * str = g_strdup_printf (_("Maximum number of %s per MD step: %d"), _(keyw[* id -2]), active_coord -> totcoord[* id]);
487 g_debug ("%s", str);
488 }
489#endif // DEBUG
490 if (* id == 3)
491 {
492 if (active_image -> show_coord[3]) g_free (active_image -> show_coord[3]);
493 active_image -> show_coord[3] = allocbool (active_coord -> totcoord[3]);
494#ifdef GTK3
495 // GTK3 Menu Action To Check
496 if (active_coord -> totcoord[3] <= COORD_MAX_MENU)
497 {
498 active_glwin -> ogl_geom[0][3] = g_malloc0(active_coord -> totcoord[3]*sizeof*active_glwin -> ogl_geom[0][3]);
499 active_glwin -> ogl_geom[1][3] = g_malloc0(active_coord -> totcoord[3]*sizeof*active_glwin -> ogl_geom[1][3]);
500 }
501#endif
502 }
503 int i, j;
504 j = 2 * active_project -> nspec;
505 for (i=0; i < * id; i++)
506 {
507 j += active_coord -> totcoord[i];
508 }
509#ifdef GTK4
510 gcid_spcolor_setup (0, * id);
511 for (i=0; i < active_coord -> totcoord[* id]; i++)
512 {
513 color_box (active_glwin, j+i, * id, i);
514 active_image -> spcolor[* id][0][i] = init_color (i, active_coord -> totcoord[* id]);
515 active_image -> spcolor[* id][0][i].alpha = DEFAULT_ALPHA;
516 active_image -> show_coord[* id][i] = TRUE;
517 }
518#else
519 int k;
520 gchar * str;
521 GtkWidget * spm;
522 for (k=0; k<2; k++)
523 {
524 i = 0;
525 active_glwin -> oglmv[k][* id][0] = coord_view_setup (& i, * id, k);
526 active_glwin -> oglmc[k][* id][0] = coord_color_setup (& i, * id, k);
527 for (i=0; i < active_coord -> totcoord[* id]; i++)
528 {
529 if (! k) active_image -> show_coord[* id][i] = TRUE;
530 if (active_coord -> totcoord[* id] <= COORD_MAX_MENU)
531 {
532 if (* id == 2)
533 {
534 str = g_strdup_printf (_("Fragment N°%d"), i+1);
535 }
536 else
537 {
538 str = g_strdup_printf (_("Molecule N°%d"), i+1);
539 }
540 active_glwin -> ogl_geom[k][* id][i] = create_coord_menu (0, str, TRUE, active_glwin -> oglmv[k][* id][0], & active_glwin -> gcid[* id][i][* id]);
541 spm = create_menu_item (TRUE, str);
542 g_free (str);
543 gtk_menu_shell_append ((GtkMenuShell *)active_glwin -> oglmc[k][* id][0], spm);
544 gtk_menu_item_set_submenu ((GtkMenuItem *)spm, color_box (active_glwin, j+i, * id, i));
545 }
546 else
547 {
548 active_glwin -> gcid[* id][i][* id].a = active_glwin -> proj;
549 active_glwin -> gcid[* id][i][* id].b = * id;
550 active_glwin -> gcid[* id][i][* id].c = i;
551 active_glwin -> gcid[* id][i][* id].d = * id;
552
553 }
554 active_image -> spcolor[* id][0][i] = init_color (i, active_coord -> totcoord[* id]);
555 active_image -> spcolor[* id][0][i].alpha = DEFAULT_ALPHA;
556 }
557 }
558#endif
559}
560
572void init_menurings_ (int * coo, int * ids, int * ngsp, int coordt[* ngsp], int * init)
573{
574 int j;
575
576 if (active_coord -> geolist[* coo][0] != NULL)
577 {
578 g_free (active_coord -> geolist[* coo][0]);
579 active_coord -> geolist[* coo][0] = NULL;
580 }
581 active_coord -> geolist[* coo][0] = allocint (* ngsp);
582#ifdef GTK4
583 gcid_spcolor_setup (0, * coo);
584 for ( j=0 ; j < * ngsp ; j++ )
585 {
586 active_coord -> geolist[* coo][0][j] = coordt[j];
587 active_image -> show_coord[* coo][j] = TRUE;
588 if ( * coo < 9)
589 {
590 color_box (active_glwin, -3, * ids, j);
591 if (* init) active_image -> show_poly[* coo][j] = FALSE;
592 active_image -> spcolor[* coo][0][j] = init_color (coordt[j]-3, active_glwin -> ring_max[* ids]);
593 active_image -> spcolor[* coo][0][j].alpha = DEFAULT_ALPHA;
594 }
595 else
596 {
597 active_glwin -> gcid[9][j][9].a = active_glwin -> proj;
598 active_glwin -> gcid[9][j][9].b = 0;
599 active_glwin -> gcid[9][j][9].c = j;
600 active_glwin -> gcid[9][j][9].d = 9;
601 }
602 }
603#else
604 gchar * str;
605 GtkWidget * spm;
606 GtkWidget * allt;
607 int i;
608 for (i=0 ; i < 2 ; i++)
609 {
610 j = 0;
611 active_glwin -> oglmc[i][* coo][j] = NULL;
612 active_glwin -> oglmc[i][* coo][j] = coord_color_setup (& j, * coo, i);
613 if (! * init) active_glwin -> ogl_poly[i][* coo] = g_malloc0(*ngsp*sizeof*active_glwin -> ogl_poly[i][* coo]);
614 for ( j=0 ; j < * ngsp ; j++ )
615 {
616 if (i == 0)
617 {
618 active_image -> show_coord[* coo][j] = TRUE;
619 if (* coo < 9)
620 {
621 if (* init) active_image -> show_poly[* coo][j] = FALSE;
622 active_image -> spcolor[* coo][0][j] = init_color (coordt[j]-3, active_glwin -> ring_max[* ids]);
623 active_image -> spcolor[* coo][0][j].alpha = DEFAULT_ALPHA;
624 }
625 active_coord -> geolist[* coo][0][j] = coordt[j];
626 }
627 str = g_strdup_printf ("%d", coordt[j]);
628 spm = create_menu_item (TRUE, str);
629 active_glwin -> ogl_geom[i][* coo][j] = create_coord_menu (0, str, TRUE, NULL, & active_glwin -> gcid[* coo][j][* coo]);
630 gtk_menu_shell_append ((GtkMenuShell *)active_glwin -> oglmc[i][* coo][0], spm);
631 if (* coo < 9)
632 {
633 gtk_menu_item_set_submenu ((GtkMenuItem *)spm, color_box (active_glwin, -3, * ids, j));
634 active_glwin -> ogl_poly[i][* coo][j] = create_coord_menu (1, str, active_image -> show_poly[* coo][j], NULL, & active_glwin -> gcid[* coo][j][* coo]);
635 }
636 else
637 {
638 active_glwin -> gcid[9][j][9].a = active_glwin -> proj;
639 active_glwin -> gcid[9][j][9].b = 0;
640 active_glwin -> gcid[9][j][9].c = j;
641 active_glwin -> gcid[9][j][9].d = 9;
642 }
643 g_free (str);
644 }
645 allt = create_menu_item (TRUE, _("All"));
646 g_signal_connect (G_OBJECT (allt), "activate", G_CALLBACK(coord_properties), & active_glwin -> colorp[* coo][1]);
647 gtk_menu_shell_append ((GtkMenuShell *)active_glwin -> oglmc[i][* coo][0], allt);
648 }
649#endif
650}
651
661void init_opengl_coords (int id, int nt, int init)
662{
663 int k;
664 active_coord -> species = active_project -> nspec;
665 active_coord -> totcoord[id] = nt;
666 if (active_image -> show_coord[id])
667 {
668 g_free (active_image -> show_coord[id]);
669 active_image -> show_coord[id] = NULL;
670 }
671 active_image -> show_coord[id] = allocbool (nt);
672#ifdef GTK3
673 int i, j;
674 for (i=0; i<2; i++)
675 {
676 if (active_glwin -> ogl_geom[i][id]) g_free (active_glwin -> ogl_geom[i][id]);
677 active_glwin -> ogl_geom[i][id] = g_malloc0(nt*sizeof*active_glwin -> ogl_geom[i][id]);
678 for (j=0; j < nt; j++)
679 {
680 active_glwin -> ogl_geom[i][id][j] = NULL;
681 }
682 }
683#endif
684 if (id < 2 || id > 3)
685 {
686 k = (id > 3) ? 1 : active_project -> nspec;
687 if (active_coord -> ntg[id]) g_free (active_coord -> ntg[id]);
688 active_coord -> ntg[id] = g_malloc0(k*sizeof*active_coord -> ntg[id]);
689 if (id > 3) active_coord -> ntg[id][0] = nt;
690 if (id < 9)
691 {
692 if (! init)
693 {
694 if (active_image -> show_poly[id]) g_free (active_image -> show_poly[id]);
695 active_image -> show_poly[id] = allocbool (nt);
696 }
697#ifdef GTK3
698 for (i=0; i<2; i++)
699 {
700 if (active_glwin -> ogl_poly[i][id]) g_free (active_glwin -> ogl_poly[i][id]);
701 active_glwin -> ogl_poly[i][id] = g_malloc0(nt*sizeof*active_glwin -> ogl_poly[i][id]);
702 for (j=0; j < nt; j++)
703 {
704 active_glwin -> ogl_poly[i][id][j] = NULL;
705 }
706 }
707#endif
708 }
709 }
710}
711
724void send_coord_opengl_ (int * id, int * num, int * cmin, int * cmax, int * nt, int coord[* num])
725{
726 int i, j, k;
727 if (* nt) init_opengl_coords (* id, * nt, 0);
728 if (* id < 2)
729 {
730 if (* id == 0)
731 {
732 // Total coordination
733 active_coord -> cmax = * cmax;
734 active_coord -> cmin = * cmin;
735 }
736 if (coord != NULL)
737 {
738 for (i=0, k=0; i < active_project -> steps; i++)
739 {
740 for (j=0; j < active_project -> natomes; j++, k++)
741 {
742 active_project -> atoms[i][j].coord[* id] = coord[k] - 1;
743 }
744 }
745 }
746 }
747}
GtkWidget * coord_menu(glwin *view)
Binding to the Fortran90 subroutines.
GtkWidget * color_box(glwin *view, int ideo, int spec, int geo)
create the color palette pointers and menus GTK3 version
Definition color_box.c:259
Structure definitions for color management Function declarations for color management.
color colorp[64]
ColRGBA col
Definition d_measures.c:77
int atoms[NUM_STYLES][2]
gboolean * allocbool(int val)
allocate a gboolean * pointer
Definition global.c:241
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
#define i18n(String)
Definition global.c:80
Global variable declarations Global convenience function declarations Global data structure defin...
@ IMG_NONE
Definition global.h:276
glwin * active_glwin
Definition project.c:53
GtkWidget * create_menu_item_from_widget(GtkWidget *widg, gboolean check, gboolean radio, gboolean status)
G_MODULE_EXPORT void show_hide_poly(GtkWidget *widg, gpointer data)
show / hide polyhedra callback - GTK3
Definition m_poly.c:79
coord_info * active_coord
Definition project.c:49
GtkWidget * gtk3_menu_item(GtkWidget *menu, gchar *name, int icon_format, gpointer item_icon, GCallback handler, gpointer data, gboolean accel, guint key, GdkModifierType mod, gboolean check, gboolean radio, gboolean status)
project * proj
G_MODULE_EXPORT void show_hide_coord(GtkWidget *widg, gpointer data)
show/hide coordination callback GTK3
Definition m_coord.c:106
chemical_data * active_chem
Definition project.c:48
ColRGBA std[6]
Definition gui.c:149
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
Definition gtk-misc.c:1672
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:247
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
#define DEFAULT_ALPHA
Definition global.h:352
project * active_project
Definition project.c:47
image * active_image
Definition project.c:52
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:202
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
#define COORD_MAX_MENU
Maximum number of fragments or molecules to build the related menu items.
Definition glview.h:148
#define POLY_MAPS
Definition glwin.h:62
#define NINPUTS
Definition glwin.h:66
#define ATOM_MAPS
Definition glwin.h:61
void set_color_map_sensitive(glwin *view)
G_MODULE_EXPORT void coord_properties(GtkWidget *widg, gpointer data)
create the environments configuration window
Definition w_coord.c:1457
Function declarations for the creation of the OpenGL window.
GtkWidget * coord_menu(glwin *view)
G_MODULE_EXPORT void coord_properties(GtkWidget *widg, gpointer data)
create the environments configuration window
Definition w_coord.c:1457
int * duplicate_int(int num, int *old_val)
copy a list of int
Definition global.c:547
void setup_molecules()
void init_menu_coordinations_(int *id, int *sp, int *ngsp, int coordt[*ngsp])
getting atomic coordinations data from Fortran90, and related GTK3 menu elements creation
Definition initcoord.c:342
void send_coord_opengl_(int *id, int *num, int *cmin, int *cmax, int *nt, int coord[*num])
coordination information from Fortran90
Definition initcoord.c:724
void init_opengl_coords(int id, int nt, int init)
initialize data to store the coordination data
Definition initcoord.c:661
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
void init_menu_fragmol_(int *id)
getting fragment(s)/molecule(s) data from Fortran90, and related GTK3 menu elements creation
Definition initcoord.c:480
cairo_surface_t * col_surface(double r, double g, double b, int x, int y)
create a cairo sufrace painted with the appropriate color
Definition color_box.c:89
void gcid_spcolor_setup(int sp, int id)
prepare color pointers
Definition initcoord.c:131
int ** idgeo
Definition initcoord.c:71
void init_menurings_(int *coo, int *ids, int *ngsp, int coordt[*ngsp], int *init)
getting rings statistics data from Fortran90, and related GTK3 menu elements creation
Definition initcoord.c:572
void allocate_partial_geo_(int *sp, int *ngsp)
allocate partial coordination(s) data
Definition initcoord.c:322
void partial_geo_out_(int *sp, int *id, int *ngsp, int coord[*ngsp])
partial coordination data from Fortran90
Definition initcoord.c:309
void set_advanced_bonding_menus(glwin *view)
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
output the name of a coordination sphere
Definition interface.c:1022
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:434
Messaging function declarations.
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
Definition glwin.h:967
Definition global.h:126