summaryrefslogtreecommitdiffstats
path: root/Smoke/gtk_streamlines.c
diff options
context:
space:
mode:
Diffstat (limited to 'Smoke/gtk_streamlines.c')
-rw-r--r--Smoke/gtk_streamlines.c88
1 files changed, 71 insertions, 17 deletions
diff --git a/Smoke/gtk_streamlines.c b/Smoke/gtk_streamlines.c
index d207684..ca6aff7 100644
--- a/Smoke/gtk_streamlines.c
+++ b/Smoke/gtk_streamlines.c
@@ -43,6 +43,22 @@ static gboolean select_sort(GtkComboBox *combo, gpointer data)
return TRUE;
}
+static gboolean select_slices(GtkRange *adjustment, gpointer data)
+{
+ streamlines_set_slices((int)gtk_range_get_value(adjustment));
+
+ return TRUE;
+}
+
+static gboolean select_radius(GtkRange *adjustment, gpointer data)
+{
+ streamlines_set_radius((float)gtk_range_get_value(adjustment));
+
+ return TRUE;
+}
+
+
+
GtkWidget *create_streamlines_page(void)
{
@@ -121,33 +137,71 @@ GtkWidget *create_streamlines_page(void)
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("Streamlines");
+ box = gtk_vbox_new(FALSE, 0);
+
+ button = gtk_button_new_with_label("Delete seedpoints");
+ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_seedpoints), NULL);
+ gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
- button = gtk_button_new_with_label("Delete seedpoints");
- g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_seedpoints), NULL);
- gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0);
- gtk_widget_show(button);
- gtk_widget_show(frame);
+ label = gtk_label_new("Traceline");
+
+ gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
+ gtk_widget_show(label);
- label = gtk_label_new("Select your traceline");
+ combo = gtk_combo_box_new_text();
- gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
- gtk_widget_show(label);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Streamlines");
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Streamtubes");
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Stream-spheres");
- combo = gtk_combo_box_new_text();
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), streamlines_get_sort());
+ g_signal_connect(combo, "changed", G_CALLBACK(select_sort), (gpointer)NULL);
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Streamlines");
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Streamtubes");
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Stream-spheres");
+ gtk_box_pack_start(GTK_BOX(box), combo, FALSE, TRUE, 0);
+ gtk_widget_show(combo);
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo), streamlines_get_sort());
- g_signal_connect(combo, "changed", G_CALLBACK(select_sort), (gpointer)NULL);
- gtk_box_pack_start(GTK_BOX(box), combo, FALSE, TRUE, 0);
- gtk_widget_show(combo);
+ label = gtk_label_new("Slices");
+ gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
+ gtk_widget_show(label);
+
+ adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(
+ streamlines_get_slices(), 3, 10, 0.5, 5, 0));
+ scale = gtk_hscale_new(adjustment);
+ gtk_scale_set_digits(GTK_SCALE(scale), 0);
+ g_signal_connect(GTK_RANGE(scale), "value-changed", G_CALLBACK(select_slices), NULL);
+
+ gtk_box_pack_start(GTK_BOX(box), scale, FALSE, TRUE, 0);
+ gtk_widget_show(scale);
+
+
+ label = gtk_label_new("Radius");
+
+ gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
+ gtk_widget_show(label);
+
+ adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(
+ streamlines_get_radius(), 0.1, 25, 0.5, 5, 0));
+ scale = gtk_hscale_new(adjustment);
+ gtk_scale_set_digits(GTK_SCALE(scale), 1);
+ g_signal_connect(GTK_RANGE(scale), "value-changed", G_CALLBACK(select_radius), NULL);
+
+ gtk_box_pack_start(GTK_BOX(box), scale, FALSE, TRUE, 0);
+ gtk_widget_show(scale);
+
+ 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;
}