atomes 1.1.16
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-2024 by CNRS and University of Strasbourg */
15
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_malloc (* 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;
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 str = exact_name(env_name (active_project, n, * sp, 1, NULL));
435 spm = create_menu_item_from_widget (markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, FALSE);
436 }
437 else
438 {
439 str = g_strdup_printf ("%d", coordt[n]);
440 spm = create_menu_item (TRUE, str);
441 }
442 if (! m)
443 {
444 active_image -> show_coord[* id][n+i] = TRUE;
445 active_coord -> geolist[* id][* sp][n] = coordt[n];
446 if (* id)
447 {
448 active_image -> spcolor[* id][* sp][n] = init_color (n+i, active_coord -> totcoord[* id]);
449 }
450 else
451 {
452 active_image -> spcolor[* id][* sp][n] = init_color (coordt[n]-active_coord -> cmin, active_coord -> cmax-active_coord -> cmin);
453 }
454 active_image -> spcolor[* id][* sp][n].alpha = DEFAULT_ALPHA;
455 }
456 active_glwin -> ogl_geom[m][* id][n+i] = create_coord_menu (0, str, TRUE, menuv, & active_glwin -> gcid[* id][n+i][* id]);
457 gtk_menu_shell_append ((GtkMenuShell *)menuc, spm);
458 gtk_menu_item_set_submenu ((GtkMenuItem *)spm, color_box (active_glwin, k+n, * sp, n));
459 if (active_image -> show_poly[* id][n+i])
460 {
461 // The polyhedra show/hide menu
462 active_glwin -> ogl_poly[m][* id][n+i] = create_coord_menu (1, str, FALSE, menupv, & active_glwin -> gcid[* id][n+i][* id]);
463 if (m) active_image -> show_poly[* id][n+i] = FALSE;
464 }
465 g_free (str);
466 }
467 }
468#endif
469}
470
478void init_menu_fragmol_ (int * id)
479{
480#ifdef DEBUG
481 gchar * keyw[2] = {"fragment(s)", "molecule(s)"};
482 if (active_project -> steps > 1)
483 {
484 gchar * str = g_strdup_printf ("Maximum number of %s per MD step: %d", keyw[* id -2], active_coord -> totcoord[* id]);
485 g_debug ("%s", str);
486 }
487#endif // DEBUG
488 if (* id == 3)
489 {
490 active_image -> show_coord[3] = allocbool (active_coord -> totcoord[3]);
491#ifdef GTK3
492 // GTK3 Menu Action To Check
493 if (active_coord -> totcoord[3] <= COORD_MAX_MENU)
494 {
495 active_glwin -> ogl_geom[0][3] = g_malloc (active_coord -> totcoord[3]*sizeof*active_glwin -> ogl_geom[0][3]);
496 active_glwin -> ogl_geom[1][3] = g_malloc (active_coord -> totcoord[3]*sizeof*active_glwin -> ogl_geom[1][3]);
497 }
498#endif
499 }
500 int i, j;
501 j = 2 * active_project -> nspec;
502 for (i=0; i < * id; i++)
503 {
504 j += active_coord -> totcoord[i];
505 }
506#ifdef GTK4
507 gcid_spcolor_setup (0, * id);
508 for (i=0; i < active_coord -> totcoord[* id]; i++)
509 {
510 color_box (active_glwin, j+i, * id, i);
511 active_image -> spcolor[* id][0][i] = init_color (i, active_coord -> totcoord[* id]);
512 active_image -> spcolor[* id][0][i].alpha = DEFAULT_ALPHA;
513 active_image -> show_coord[* id][i] = TRUE;
514 }
515#else
516 int k;
517 gchar * str;
518 GtkWidget * spm;
519 for (k=0; k<2; k++)
520 {
521 i = 0;
522 active_glwin -> oglmv[k][* id][0] = coord_view_setup (& i, * id, k);
523 active_glwin -> oglmc[k][* id][0] = coord_color_setup (& i, * id, k);
524 if (! k) g_debug ("active_project -> name= %s, id= %d, totcoord[%d]= %d", active_project -> name, * id, * id, active_coord -> totcoord[* id]);
525 for (i=0; i < active_coord -> totcoord[* id]; i++)
526 {
527 if (! k) active_image -> show_coord[* id][i] = TRUE;
528 if (active_coord -> totcoord[* id] <= COORD_MAX_MENU)
529 {
530 if (* id == 2)
531 {
532 str = g_strdup_printf ("Fragment N°%d", i+1);
533 }
534 else
535 {
536 str = g_strdup_printf ("Molecule N°%d", i+1);
537 }
538 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]);
539 spm = create_menu_item (TRUE, str);
540 g_free (str);
541 gtk_menu_shell_append ((GtkMenuShell *)active_glwin -> oglmc[k][* id][0], spm);
542 gtk_menu_item_set_submenu ((GtkMenuItem *)spm, color_box (active_glwin, j+i, * id, i));
543 }
544 else
545 {
546 active_glwin -> gcid[* id][i][* id].a = active_glwin -> proj;
547 active_glwin -> gcid[* id][i][* id].b = * id;
548 active_glwin -> gcid[* id][i][* id].c = i;
549 active_glwin -> gcid[* id][i][* id].d = * id;
550
551 }
552 active_image -> spcolor[* id][0][i] = init_color (i, active_coord -> totcoord[* id]);
553 active_image -> spcolor[* id][0][i].alpha = DEFAULT_ALPHA;
554 }
555 }
556#endif
557}
558
570void init_menurings_ (int * coo, int * ids, int * ngsp, int coordt[* ngsp], int * init)
571{
572 int j;
573
574 if (active_coord -> geolist[* coo][0] != NULL)
575 {
576 g_free (active_coord -> geolist[* coo][0]);
577 active_coord -> geolist[* coo][0] = NULL;
578 }
579 active_coord -> geolist[* coo][0] = allocint (* ngsp);
580#ifdef GTK4
581 gcid_spcolor_setup (0, * coo);
582 for ( j=0 ; j < * ngsp ; j++ )
583 {
584 active_coord -> geolist[* coo][0][j] = coordt[j];
585 active_image -> show_coord[* coo][j] = TRUE;
586 if ( * coo < 9)
587 {
588 color_box (active_glwin, -3, * ids, j);
589 if (* init) active_image -> show_poly[* coo][j] = FALSE;
590 active_image -> spcolor[* coo][0][j] = init_color (coordt[j]-3, active_glwin -> ring_max[* ids]);
591 active_image -> spcolor[* coo][0][j].alpha = DEFAULT_ALPHA;
592 }
593 else
594 {
595 active_glwin -> gcid[9][j][9].a = active_glwin -> proj;
596 active_glwin -> gcid[9][j][9].b = 0;
597 active_glwin -> gcid[9][j][9].c = j;
598 active_glwin -> gcid[9][j][9].d = 9;
599 }
600 }
601#else
602 gchar * str;
603 GtkWidget * spm;
604 GtkWidget * allt;
605 int i;
606 for (i=0 ; i < 2 ; i++)
607 {
608 j = 0;
609 active_glwin -> oglmc[i][* coo][j] = NULL;
610 active_glwin -> oglmc[i][* coo][j] = coord_color_setup (& j, * coo, i);
611 if (! * init) active_glwin -> ogl_poly[i][* coo] = g_malloc0 (*ngsp*sizeof*active_glwin -> ogl_poly[i][* coo]);
612 for ( j=0 ; j < * ngsp ; j++ )
613 {
614 if (i == 0)
615 {
616 active_image -> show_coord[* coo][j] = TRUE;
617 if (* coo < 9)
618 {
619 if (* init) active_image -> show_poly[* coo][j] = FALSE;
620 active_image -> spcolor[* coo][0][j] = init_color (coordt[j]-3, active_glwin -> ring_max[* ids]);
621 active_image -> spcolor[* coo][0][j].alpha = DEFAULT_ALPHA;
622 }
623 active_coord -> geolist[* coo][0][j] = coordt[j];
624 }
625 str = g_strdup_printf ("%d", coordt[j]);
626 spm = create_menu_item (TRUE, str);
627 active_glwin -> ogl_geom[i][* coo][j] = create_coord_menu (0, str, TRUE, NULL, & active_glwin -> gcid[* coo][j][* coo]);
628 gtk_menu_shell_append ((GtkMenuShell *)active_glwin -> oglmc[i][* coo][0], spm);
629 if (* coo < 9)
630 {
631 gtk_menu_item_set_submenu ((GtkMenuItem *)spm, color_box (active_glwin, -3, * ids, j));
632 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]);
633 }
634 else
635 {
636 active_glwin -> gcid[9][j][9].a = active_glwin -> proj;
637 active_glwin -> gcid[9][j][9].b = 0;
638 active_glwin -> gcid[9][j][9].c = j;
639 active_glwin -> gcid[9][j][9].d = 9;
640 }
641 g_free (str);
642 }
643 allt = create_menu_item (TRUE, "_All");
644 g_signal_connect (G_OBJECT (allt), "activate", G_CALLBACK(coord_properties), & active_glwin -> colorp[* coo][1]);
645 gtk_menu_shell_append ((GtkMenuShell *)active_glwin -> oglmc[i][* coo][0], allt);
646 }
647#endif
648}
649
659void init_opengl_coords (int id, int nt, int init)
660{
661 int k;
662 active_coord -> species = active_project -> nspec;
663 active_coord -> totcoord[id] = nt;
664 active_image -> show_coord[id] = allocbool (nt);
665#ifdef GTK3
666 int i, j;
667 for (i=0; i<2; i++)
668 {
669 if (active_glwin -> ogl_geom[i][id]) g_free (active_glwin -> ogl_geom[i][id]);
670 active_glwin -> ogl_geom[i][id] = g_malloc0 (nt*sizeof*active_glwin -> ogl_geom[i][id]);
671 for (j=0; j < nt; j++)
672 {
673 active_glwin -> ogl_geom[i][id][j] = NULL;
674 }
675 }
676#endif
677 if (id < 2 || id > 3)
678 {
679 k = (id > 3) ? 1 : active_project -> nspec;
680 if (active_coord -> ntg[id]) g_free (active_coord -> ntg[id]);
681 active_coord -> ntg[id] = g_malloc0 (k*sizeof*active_coord -> ntg[id]);
682 if (id > 3) active_coord -> ntg[id][0] = nt;
683 if (id < 9)
684 {
685 if (! init)
686 {
687 if (active_image -> show_poly[id]) g_free (active_image -> show_poly[id]);
688 active_image -> show_poly[id] = allocbool (nt);
689 }
690#ifdef GTK3
691 for (i=0; i<2; i++)
692 {
693 if (active_glwin -> ogl_poly[i][id]) g_free (active_glwin -> ogl_poly[i][id]);
694 active_glwin -> ogl_poly[i][id] = g_malloc0 (nt*sizeof*active_glwin -> ogl_poly[i][id]);
695 for (j=0; j < nt; j++)
696 {
697 active_glwin -> ogl_poly[i][id][j] = NULL;
698 }
699 }
700#endif
701 }
702 }
703}
704
717void send_coord_opengl_ (int * id, int * num, int * cmin, int * cmax, int * nt, int coord[* num])
718{
719 int i, j, k;
720 if (* nt) init_opengl_coords (* id, * nt, 0);
721 if (* id < 2)
722 {
723 if (* id == 0)
724 {
725 // Total coordination
726 active_coord -> cmax = * cmax;
727 active_coord -> cmin = * cmin;
728 }
729 if (coord != NULL)
730 {
731 for (i=0, k=0; i < active_project -> steps; i++)
732 {
733 for (j=0; j < active_project -> natomes; j++, k++)
734 {
735 active_project -> atoms[i][j].coord[* id] = coord[k] - 1;
736 }
737 }
738 }
739 }
740}
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:254
Structure definitions for color management Function declarations for color management.
color colorp[64]
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Definition labels.c:56
ColRGBA col
Definition d_measures.c:77
int atoms[NUM_STYLES][2]
gboolean * allocbool(int val)
allocate a gboolean * pointer
Definition global.c:254
int * allocint(int val)
allocate an int * pointer
Definition global.c:314
Global variable declarations Global convenience function declarations Global data structure defin...
@ IMG_NONE
Definition global.h:260
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:147
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
Definition gtk-misc.c:1585
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_menu_item(gboolean add_mnemo, gchar *action)
#define DEFAULT_ALPHA
Definition global.h:336
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:173
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:139
#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)
void prep_all_coord_menus(glwin *view)
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:1469
int * duplicate_int(int num, int *old_val)
copy a list of int
Definition global.c:560
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:717
void init_opengl_coords(int id, int nt, int init)
initialize data to store the coordination data
Definition initcoord.c:659
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:478
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:87
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:570
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)
ouput the name of a coordination sphere
Definition interface.c:889
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:370
Messaging function declarations.
double y
Definition ogl_draw.c:57
double x
Definition ogl_draw.c:57
float blue
Definition global.h:124
float alpha
Definition global.h:125
float red
Definition global.h:122
float green
Definition global.h:123
Definition glwin.h:875
coord_info * coord
Definition global.h:956
Definition global.h:112
int b
Definition tab-1.c:95
int a
Definition tab-1.c:95