83 j = this_proj -> modelgl -> anim -> last ->
img -> style;
86 int s = this_proj -> nspec;
91 this_proj -> modelgl -> anim -> last ->
img -> pointrad[
a] = v;
94 this_proj -> modelgl -> create_shaders[
PICKS] = TRUE;
95 this_proj -> modelgl -> create_shaders[
LABEL] = TRUE;
97 v = this_proj -> modelgl -> anim -> last ->
img -> pointrad[
a];
104 this_proj -> modelgl -> anim -> last ->
img -> sphererad[
a] = v;
107 this_proj -> modelgl -> create_shaders[
PICKS] = TRUE;
108 this_proj -> modelgl -> create_shaders[
LABEL] = TRUE;
110 v = this_proj -> modelgl -> anim -> last ->
img -> sphererad[
a];
118 gtk_menu_item_set_label (GTK_MENU_ITEM(this_proj -> modelgl -> ogl_atoms[t-2]), str);
125 gtk_menu_item_set_label (GTK_MENU_ITEM(
opengl_project -> modelgl -> ogl_atoms[t+2]), str);
129 update (this_proj -> modelgl);
149 gchar * dim[2]={
" pts",
" Å "};
151 if (this_proj -> modelgl -> anim -> last ->
img -> style ==
WIREFRAME || this_proj -> modelgl -> anim -> last ->
img -> style ==
PUNT)
159 for (i=0; i<nspec; i++)
162 gtk_widget_set_size_request (hbo, 250, -1);
166 str = g_strdup_printf (
" %s", this_proj ->
chemistry ->
label[i]);
170 str = g_strdup_printf (
" %s*", this_proj ->
chemistry ->
label[i]);
195 gchar * title[2][2] = {{
"Adjust atom sphere radius",
"Adjust clone sphere radius"},
196 {
"Adjust atom point size",
"Adjust clone point size"}};
201 int id = the_data ->
b;
202 int jd = the_data ->
c;
237 update (this_proj -> modelgl);
271 show = gtk_check_button_get_active (but);
272 for (l=0; l<this_proj -> steps; l++)
274 for (m=0; m<this_proj -> natomes; m++)
276 if (this_proj ->
atoms[l][m].sp == k)
278 this_proj ->
atoms[l][m].show[j] = show;
282 this_proj -> modelgl -> anim -> last ->
img -> show_atom[j][k] = show;
284 update_menu_bar (this_proj -> modelgl);
286 show = gtk_toggle_button_get_active (but);
287 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)
get_project_by_id(i) -> modelgl -> ogl_spec[j][k], show);
322 show = gtk_check_button_get_active (but);
323 for (l=0; l<this_proj -> steps; l++)
325 for (m=0; m<this_proj -> natomes; m++)
327 if (this_proj ->
atoms[l][m].sp == k)
329 this_proj ->
atoms[l][m].label[j] = show;
334 this_proj -> modelgl -> create_shaders[
LABEL] = TRUE;
335 update (this_proj -> modelgl);
336 update_menu_bar (this_proj -> modelgl);
339 show = gtk_toggle_button_get_active (but);
340 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)this_proj -> modelgl -> ogl_lab[j][k], show);
357 GtkWidget * prop_box;
362 gchar *
col[5] = {
"<b>Color</b>",
366 "<b>Size [pts]</b>"};
367 int csize[5] = {60, 0, 25, 0, 0};
372 k = view -> anim -> last ->
img -> style;
374 gtk_widget_set_size_request (prop_box, -1, -1);
388 for (i=0; i< this_proj -> nspec; i++)
393 j = i + aoc * this_proj -> nspec;
396 str = g_strdup_printf (
" <b>%s</b>", this_proj ->
chemistry ->
label[i]);
400 str = g_strdup_printf (
" <b>%s<sup>*</sup></b>", this_proj ->
chemistry ->
label[i]);
408 str = g_strdup_printf (
"%s atom(s) color", this_proj ->
chemistry ->
label[i]);
412 str = g_strdup_printf (
"%s clone(s) color", this_proj ->
chemistry ->
label[i]);
414 gtk_color_button_set_title (GTK_COLOR_BUTTON(but), str);
416 if (this_proj -> modelgl -> anim -> last ->
img -> color_map[0] != 0)
448 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (NULL, -1, -1, view -> anim -> last ->
img -> show_atom[aoc][i], G_CALLBACK(
toggled_show_hide_atom), & view ->
colorp[aoc][i]), FALSE, FALSE, 30);
450 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (NULL, -1, -1, view -> anim -> last ->
img -> show_label[aoc][i], G_CALLBACK(
toggled_show_hide_label), & view ->
colorp[aoc][i]), FALSE, FALSE, 5);
467 this_proj -> modelgl -> model_win[dat ->
b] -> win =
destroy_this_widget (this_proj -> modelgl -> model_win[dat ->
b] -> win);
468 g_free (this_proj -> modelgl -> model_win[dat ->
b]);
469 this_proj -> modelgl -> model_win[dat ->
b] = NULL;
470 g_free (this_proj -> modelgl -> search_widg[dat ->
b]);
471 this_proj -> modelgl -> search_widg[dat ->
b] = NULL;
511 GtkWidget * notebook = gtk_notebook_new ();
512 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
prop_tab (view, atom_or_clone), gtk_label_new (
"Display properties"));
513 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
labels_tab (view, atom_or_clone), gtk_label_new (
"Label properties"));
515 if (view -> search_widg[atom_or_clone] == NULL)
519 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
521 gtk_label_new ((atom_or_clone) ?
"Clone(s) selection" :
"Atom(s) selection"));
536 gchar * win_title[2]={
"Atom(s) configuration - ",
"Clone(s) configuration - "};
538 aprop =
create_win (str, view -> win, FALSE, FALSE);
540 gtk_widget_set_size_request (aprop, -1, 580+i);
544 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, view -> model_win[atom_or_clone] -> notebook, TRUE, TRUE, 0);
577 int atom_or_clone = the_data ->
b;
579 if (this_proj -> modelgl -> model_win[atom_or_clone] == NULL)
581 this_proj -> modelgl -> model_win[atom_or_clone] = g_malloc0 (
sizeof*this_proj -> modelgl -> model_win[atom_or_clone]);
582 this_proj -> modelgl -> model_win[atom_or_clone] -> win =
advanced_atom_properties (atom_or_clone, this_proj -> modelgl);
584 if (this_proj -> natomes < 10000)
586 gtk_widget_hide (this_proj -> modelgl -> search_widg[atom_or_clone] -> info[1]);
590 gtk_widget_hide (this_proj -> modelgl -> search_widg[atom_or_clone] -> id_box);
593 if (GTK_IS_WIDGET(this_proj -> modelgl -> model_win[atom_or_clone] -> win))
595 gtk_notebook_set_current_page (GTK_NOTEBOOK (this_proj -> modelgl -> model_win[atom_or_clone] -> notebook), the_data ->
c);
599 show_warning (g_strdup_printf (
"Error impossible to display the model window for %s !", (atom_or_clone) ?
"clones" :
"atomes"), this_proj -> modelgl -> win);
integer(kind=c_int) function chemistry()
Structure definitions for color management Function declarations for color management.
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
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
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
GtkWidget * add_vbox_to_layout(GtkWidget *layout, int size_x, int size_y)
Insert a vertical GtkBox in a GtkLatout then send back the GtkBox.
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
void opengl_project_changed(int id)
change the OpenGL project
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
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.
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
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
GtkWidget * create_layout(int x, int y)
create a GtkLayout / GtkFixed widget
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
void update(glwin *view)
update the rendering of the OpenGL window
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
int check_label_numbers(project *this_proj, int types)
check how many atom label(s) are visible
shaders
The different types of shaders in the atomes program.
Function declarations for the creation of the OpenGL window.
void show_warning(char *warning, GtkWidget *win)
show warning
Messaging function declarations.
G_MODULE_EXPORT void atom_properties(GSimpleAction *action, GVariant *parameter, gpointer data)
atom(s) propery callback GTK4
GtkWidget * labels_tab(glwin *view, int id)
create atomic label(s) tab for the atom(s) / clone(s) window
gchar * label_atpts(project *this_proj, glwin *view, int id)
prepare the text of a menu item in the 'Model -> Atom(s)' submenu
G_MODULE_EXPORT void set_atom_color(GtkColorChooser *colob, gpointer data)
set atom color callback
GtkWidget * selection_tab(atom_search *asearch, int nats)
create the search widget
GtkWidget * advance_atom_notebook(glwin *view, int atom_or_clone)
create atom(s) advanced properties notebook
G_MODULE_EXPORT void toggled_show_hide_atom(GtkToggleButton *but, gpointer data)
toggle show/hide atom(s) callback GTK3
G_MODULE_EXPORT void update_atom_size(GtkEntry *res, gpointer data)
update atom radius callback
atom_search * allocate_atom_search(int proj, int action, int searchid, int tsize)
allocate atom search data structure
G_MODULE_EXPORT gboolean close_event_model(GtkWidget *widg, GdkEvent *event, gpointer data)
close event callback GTK3
GtkTreeStore * atom_model
GtkWidget * advanced_atom_properties(int atom_or_clone, glwin *view)
create atom advanced properties window 'model_win'
void atoms_input_win(GtkWidget *win, project *this_proj, int nspec, int aoc, double *val)
prepare atom radii entry list
G_MODULE_EXPORT void toggled_show_hide_label(GtkToggleButton *but, gpointer data)
toggle show/hide label(s) callback GTK3
G_MODULE_EXPORT void set_atom_parameter(GtkWidget *widg, gpointer data)
set atom parameter - creating the dialog
G_MODULE_EXPORT void close_model(GtkButton *but, gpointer data)
free 'model_win' data
GtkWidget * prop_tab(glwin *view, int aoc)
create atom(s)/clone(s) properties tab