diff options
Diffstat (limited to 'Smoke/gtk_colormap.c')
-rw-r--r-- | Smoke/gtk_colormap.c | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/Smoke/gtk_colormap.c b/Smoke/gtk_colormap.c index 169291d..6a055eb 100644 --- a/Smoke/gtk_colormap.c +++ b/Smoke/gtk_colormap.c @@ -4,6 +4,7 @@ #include <rfftw.h> #include "fluids.h" +#include "smoke.h" #include "palette.h" #include "smoke.h" /* colormap and smoke are siblings */ #include "colormap.h" @@ -37,6 +38,25 @@ static gboolean set_clamping(GtkToggleButton *button, gpointer data) { return TRUE; } +static gboolean reset_scaling(GtkWidget *button, gpointer data) { + renderer_reset_scaling(); + + return TRUE; +} + +static gboolean reset_clamping(GtkWidget *button, gpointer data) { + renderer_reset_clamping(); + + return TRUE; +} + +static gboolean select_smoke_sort(GtkComboBox *combo, gpointer data) +{ + smoke_set_sort(gtk_combo_box_get_active(combo)); + + return TRUE; +} + static gboolean select_alpha(GtkRange *adjustment, gpointer data) { colormap_set_alpha((float)gtk_range_get_value(adjustment)); @@ -94,8 +114,8 @@ GtkWidget *create_colormap_page(void) gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0); gtk_widget_show(button); - gtk_box_pack_start(GTK_BOX(box), box2, TRUE, TRUE, 0); - gtk_widget_show(box2); + gtk_box_pack_start(GTK_BOX(box), box2, TRUE, TRUE, 0); + gtk_widget_show(box2); button = gtk_check_button_new_with_label("AutoScale"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), colormap_get_autoscaling()); @@ -103,6 +123,21 @@ GtkWidget *create_colormap_page(void) gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); gtk_widget_show(button); + box2 = gtk_hbox_new(FALSE, 0); + + button = gtk_button_new_with_label("Reset scaling"); + g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_scaling), NULL); + gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0); + gtk_widget_show(button); + + button = gtk_button_new_with_label("Reset clamping"); + g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_clamping), NULL); + gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 0); + gtk_widget_show(button); + + gtk_box_pack_start(GTK_BOX(box), box2, TRUE, TRUE, 0); + gtk_widget_show(box2); + gtk_container_add(GTK_CONTAINER(frame), box); gtk_widget_show(box); @@ -251,8 +286,22 @@ GtkWidget *create_colormap_page(void) gtk_box_pack_start(GTK_BOX(page), frame, FALSE, TRUE, 0); - gtk_widget_show(frame); + label = gtk_label_new("Smoke visualization"); + gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0); + gtk_widget_show(label); + + combo = gtk_combo_box_new_text(); + + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Fluid smoke"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Grid smoke"); + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), smoke_get_sort()); + g_signal_connect(combo, "changed", G_CALLBACK(select_smoke_sort), (gpointer)NULL); + + gtk_box_pack_start(GTK_BOX(box), combo, FALSE, TRUE, 0); + gtk_widget_show(combo); + + gtk_widget_show(frame); return page; } |