48gchar *
edit_names[7] = {
"Wrap All Atoms in",
"Shift Center",
"Add Extra(s)",
"Create Super-Cell",
"Adjust Density",
"Cut Slab",
"PBC Pixels Debug"};
62 for (i=0; i<3; i++) this_proj -> modelgl -> cshift[i] = this_proj -> modelgl -> cell_win -> cparam[i];
63 this_proj -> modelgl -> cell_win -> win =
destroy_this_widget (this_proj -> modelgl -> cell_win -> win);
64 g_free (this_proj -> modelgl -> cell_win);
65 this_proj -> modelgl -> cell_win = NULL;
67 update (this_proj -> modelgl);
79G_MODULE_EXPORT gboolean
close_cell (GtkWindow * widg, gpointer data)
90G_MODULE_EXPORT gboolean
close_cell (GtkWidget * widg, GdkEvent * event, gpointer data)
143 GtkWidget * notebook = gtk_notebook_new ();
156 doit = (i == 4 && ! this_proj ->
pix[0]) ? FALSE : TRUE;
162 j = (i < 2) ? i+1 : i+2;
163 str = g_strdup_printf (
"<b>%s</b>",
edit_names[j]);
164 gtk_notebook_insert_page (GTK_NOTEBOOK(notebook),
cell_tab (i, this_proj),
markup_label(str, -1, -1, 0.0, 0.5), i);
165 if (i > 1)
widget_set_sensitive (gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), i), (this_proj -> steps) > 1 ? 0 : 1);
184 gchar * str = g_strdup_printf (
"Cell edition - %s", this_proj -> name);
185 GtkWidget * win =
create_win (str, this_proj -> modelgl -> win, FALSE, FALSE);
189 gtk_widget_set_size_request (
vbox, 700 , -1);
192 for (i=0; i<3; i++) this_proj -> modelgl -> cell_win -> cparam[i] = this_proj -> modelgl -> cshift[i];
214G_MODULE_EXPORT
void edition_win (GSimpleAction *
action, GVariant * parameter, gpointer data)
230 if (this_proj -> modelgl -> cell_win == NULL)
232 this_proj -> modelgl -> cell_win = g_malloc0 (
sizeof*this_proj -> modelgl -> cell_win);
233 this_proj -> modelgl -> cell_win -> homo_density = TRUE;
234 this_proj -> modelgl -> cell_win -> slab_alpha = 0.75;
235 this_proj -> modelgl -> cell_win -> slab_lot =
allocint (this_proj -> nspec);
236 this_proj -> modelgl -> cell_win -> slab_pbc = this_proj -> cell.pbc;
239 this_proj -> modelgl -> cell_win -> slab_pointer[i].a =
id ->
a;
240 this_proj -> modelgl -> cell_win -> slab_pointer[i].b = i;
242 for (i=9; i<13; i++) this_proj -> modelgl -> cell_win -> cparam[i] = 5.0;
243 for (i=13; i<15; i++) this_proj -> modelgl -> cell_win -> cparam[i] = 2.5;
244 for (i=15; i<18; i++) this_proj -> modelgl -> cell_win -> cparam[i] = 90.0;
251 if (i < 3) gtk_widget_hide (this_proj -> modelgl -> cell_win -> slab_hbox[i]);
252 gtk_widget_hide (this_proj -> modelgl -> cell_win -> slab_box[i]);
255 gtk_notebook_set_current_page (GTK_NOTEBOOK (this_proj -> modelgl -> cell_win -> notebook), page);
GtkWidget * cut_in_model(project *this_proj)
create the cut slab tab
GtkWidget * adjust_density_tab(project *this_proj)
create the density tab
G_MODULE_EXPORT void edition_win(GtkWidget *widg, gpointer data)
create the cell edition window callback GTK3
GtkWidget * cell_tab(int i, project *this_proj)
create the 'i'th cell tab
GtkWidget * create_cell_edition_window(project *this_proj, gpointer data)
create the cell editon window
G_MODULE_EXPORT gboolean close_cell(GtkWidget *widg, GdkEvent *event, gpointer data)
cell edition window close event callback GTK3
G_MODULE_EXPORT void close_cell_edit(GtkButton *but, gpointer data)
close cell edition window and free the associated data pointers
GtkWidget * create_cell_notebook(project *this_proj, GtkWidget *vbox)
create the cell edition notebook
Function declarations for the cell edition window.
GtkWidget * add_extra_cell_tab(glwin *view)
create the add cell(s) tab
GtkWidget * shift_center_tab(project *this_proj)
create the shift cell center tab
GtkWidget * pixels_tab(project *this_proj)
int * allocint(int val)
allocate an int * pointer
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
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 * 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.
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
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void add_box_child_end(GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the end position.
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
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader