diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-19 20:59:56 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-19 20:59:56 (GMT) |
commit | 5f1fc7b0711f51dd05077303f854c658ccd9dcba (patch) | |
tree | 7d519f704a04a8f25d3e5f14ce809a7d985c4581 /Smoke/gtk.c | |
parent | a60088999da4f44bf5885f431fe78eb87d643ae7 (diff) | |
download | 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.zip 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.tar.gz 2iv35-5f1fc7b0711f51dd05077303f854c658ccd9dcba.tar.bz2 |
Loads of splitting, gui templates added for other elements
Diffstat (limited to 'Smoke/gtk.c')
-rw-r--r-- | Smoke/gtk.c | 209 |
1 files changed, 16 insertions, 193 deletions
diff --git a/Smoke/gtk.c b/Smoke/gtk.c index 9c91164..51016dd 100644 --- a/Smoke/gtk.c +++ b/Smoke/gtk.c @@ -45,16 +45,20 @@ #include <GL/gl.h> #include <GL/glu.h> -#include <rfftw.h> //the numerical simulation FFTW library - +#include <rfftw.h> //the numerical simulation FFTW library #include "fluids.h" + #include "palette.h" #include "renderer_gl.h" -#include "seedpoint.h" - #include "gtk_colormap.h" #include "gtk_glyphs.h" +#include "gtk_divergence.h" +#include "gtk_isolines.h" +#include "gtk_heightplots.h" +#include "gtk_streamlines.h" + +#include "gtk_main.h" /************************************************************************** * The following section contains all the macro definitions. @@ -423,10 +427,6 @@ key_press_event (GtkWidget *widget, } break; - case GDK_m: - scalar_col++; if (scalar_col > PALETTE_OLIVER) scalar_col = PALETTE_BLACKWHITE; - break; - case GDK_a: // g_print ("a key\n"); toggle_animation (widget); @@ -549,7 +549,7 @@ visibility_notify_event (GtkWidget *widget, static void toggle_animation (GtkWidget *widget) { - frozen = animate = !animate; + animate = !animate; if (animate) { @@ -586,13 +586,6 @@ create_popup_menu (GtkWidget *drawing_area) G_CALLBACK (toggle_animation), drawing_area); gtk_widget_show (menu_item); - /* Toggle glyphs */ -// menu_item = gtk_menu_item_new_with_label ("Glyphs"); -// gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); -// g_signal_connect_swapped (G_OBJECT (menu_item), "activate", -// G_CALLBACK (set_glyph_usage), drawing_area); -// gtk_widget_show (menu_item); - /* Quit */ menu_item = gtk_menu_item_new_with_label ("Quit"); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); @@ -602,178 +595,8 @@ create_popup_menu (GtkWidget *drawing_area) return menu; } - - -void show_settings(GtkWidget *notebook) -{ - -} #endif -static gboolean select_render_smoke(GtkWidget *button, gpointer data) { - smoke_set_render(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); -} - - -static gboolean select_render_glyphs(GtkWidget *button, gpointer data) { - glyphs_set_render(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); -} - -static gboolean -select_palette(GtkComboBox *combo, gpointer data) { - g_print("combo: %d\n", gtk_combo_box_get_active(combo)); - selectColor(gtk_combo_box_get_active(combo)); -} - -/* - * Draw main notebook page - */ -GtkWidget *create_main_page(void) -{ - /* in reality a page is really just a vbox filled with other widgets - */ - GtkWidget *page; - GtkWidget *frame; - GtkWidget *box; - GtkWidget *button; - GtkWidget *combo; - GSList *dataset_group; - - page = gtk_vbox_new(FALSE, 0); - - - box = gtk_vbox_new(FALSE, 0); - button = gtk_check_button_new_with_label("Draw Smoke"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE); - g_signal_connect (G_OBJECT(button), "clicked", G_CALLBACK(select_render_smoke), NULL); - gtk_box_pack_start (GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show(button); - - button = gtk_check_button_new_with_label("Draw Glyphs"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE); - g_signal_connect (G_OBJECT(button), "clicked", G_CALLBACK(select_render_glyphs), NULL); - gtk_box_pack_start (GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show(button); - - gtk_box_pack_start (GTK_BOX(page), box, FALSE, TRUE, 0); - gtk_widget_show(box); - - - frame = gtk_frame_new("Dataset"); - - box = gtk_hbox_new(FALSE, 0); - - button = gtk_radio_button_new_with_label (NULL, "Rho"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_dataset), (gpointer)DATASET_RHO); - gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show(button); - - dataset_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(button)); - - button = gtk_radio_button_new_with_label(dataset_group, "Velocity"); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_dataset), (gpointer)DATASET_VEL); - gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show(button); - - button = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(button), "Force"); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_dataset), (gpointer)DATASET_FORCE); - gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show(button); - - gtk_container_add(GTK_CONTAINER(frame), box); - gtk_widget_show(box); - - gtk_box_pack_start (GTK_BOX(page), frame, FALSE, TRUE, 0); - gtk_widget_show(frame); - - frame = gtk_frame_new("Colormap"); - - box = gtk_hbox_new(FALSE, 0); - - combo = gtk_combo_box_new_text(); - - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Black & White"); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Rainbow"); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Bands"); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Wilrik"); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Oliver"); - - g_signal_connect(combo, "changed", - G_CALLBACK(select_palette), (gpointer)NULL); - - gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0); - - gtk_box_pack_start(GTK_BOX(box), combo, FALSE, TRUE, 0); - gtk_widget_show(combo); - - gtk_container_add(GTK_CONTAINER(frame), box); - gtk_widget_show(box); - - gtk_box_pack_start(GTK_BOX(page), frame, FALSE, TRUE, 0); - - gtk_widget_show(frame); - - return page; -} - -GtkWidget *create_divergence_page(void) -{ - /* in reality a page is really just a vbox filled with other widgets - */ - GtkWidget *page; - - page = gtk_vbox_new(FALSE, 0); - - return page; -} - -/* - * Draw isolines notebook page - */ -GtkWidget *create_isolines_page(void) -{ - /* in reality a page is really just a vbox filled with other widgets - */ - GtkWidget *page; - - page = gtk_vbox_new(FALSE, 0); - - return page; -} -/* - * Draw height plots notebook page - */ -GtkWidget *create_height_plots_page(void) -{ - /* in reality a page is really just a vbox filled with other widgets - */ - GtkWidget *page; - - page = gtk_vbox_new(FALSE, 0); - - return page; -} - -GtkWidget *create_stream_tubes_page(void) -{ - int i, max; - GtkWidget *page; - - page = gtk_vbox_new(FALSE, 0); - - return page; -} - -GtkWidget *create_animated_textures_page(void) -{ - int i, max; - GtkWidget *page; - - page = gtk_vbox_new(FALSE, 0); - - return page; -} /*** *** Creates the simple application window with one @@ -909,7 +732,7 @@ create_window (GdkGLConfig *glconfig) gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); - notebook_page_label = gtk_label_new("Colormaps"); + notebook_page_label = gtk_label_new("Colormap"); gtk_widget_show(notebook_page_label); notebook_page = create_colormap_page(); @@ -941,26 +764,26 @@ create_window (GdkGLConfig *glconfig) gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); - notebook_page_label = gtk_label_new("Height plots"); + notebook_page_label = gtk_label_new("Height Plots"); gtk_widget_show(notebook_page_label); - notebook_page = create_height_plots_page(); + notebook_page = create_heightplots_page(); gtk_widget_show(notebook_page); gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); - notebook_page_label = gtk_label_new("Stream tubes"); + notebook_page_label = gtk_label_new("Stream Tubes"); gtk_widget_show(notebook_page_label); - notebook_page = create_stream_tubes_page(); + notebook_page = create_streamlines_page(); gtk_widget_show(notebook_page); gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); - notebook_page_label = gtk_label_new("Animated Textures"); + notebook_page_label = gtk_label_new("Flow Vis"); gtk_widget_show(notebook_page_label); - notebook_page = create_animated_textures_page(); + notebook_page = create_flowvis_page(); gtk_widget_show(notebook_page); gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); |