diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-06 15:41:19 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-06 15:41:19 (GMT) |
commit | 5297d5f9565da695a6a9891f829118ecaea6ad8a (patch) | |
tree | 5ad10fc27445604c010f1f678b913fb2286b0fd3 | |
parent | 11e1578b67647a603e23fae44fe658fe2806e19a (diff) | |
download | 2iv35-5297d5f9565da695a6a9891f829118ecaea6ad8a.zip 2iv35-5297d5f9565da695a6a9891f829118ecaea6ad8a.tar.gz 2iv35-5297d5f9565da695a6a9891f829118ecaea6ad8a.tar.bz2 |
fixed heightplot get/setters
-rw-r--r-- | Smoke/gtk_heightplots.c | 19 | ||||
-rw-r--r-- | Smoke/heightplots.c | 17 | ||||
-rwxr-xr-x | Smoke/smoke.bin | bin | 636108 -> 636173 bytes |
3 files changed, 28 insertions, 8 deletions
diff --git a/Smoke/gtk_heightplots.c b/Smoke/gtk_heightplots.c index 42ddf70..dadec94 100644 --- a/Smoke/gtk_heightplots.c +++ b/Smoke/gtk_heightplots.c @@ -15,9 +15,7 @@ static GtkAdjustment *rho_adj, *vel_adj, *force_adj, *divv_adj, *divf_adj; static gboolean set_dataset(GtkToggleButton *button, gpointer data) { - GtkAdjustment *temp; - gchar *s; - + printf("height: %d\n", heightplots_get_height()); if (gtk_toggle_button_get_active(button)) { switch ((int)data) { default: @@ -72,7 +70,7 @@ static void init_adjustments(void) g_object_ref(rho_adj); heightplots_set_dataset(DATASET_VEL); vel_adj = GTK_ADJUSTMENT(gtk_adjustment_new( - heightplots_get_height(), 1, 1000, 5, 50, 0)); + heightplots_get_height(), 1, 2000, 5, 50, 0)); g_object_ref(vel_adj); heightplots_set_dataset(DATASET_FORCE); force_adj = GTK_ADJUSTMENT(gtk_adjustment_new( @@ -80,16 +78,25 @@ static void init_adjustments(void) g_object_ref(force_adj); heightplots_set_dataset(DATASET_DIVV); divv_adj = GTK_ADJUSTMENT(gtk_adjustment_new( - heightplots_get_height(), 1, 3000, 5, 50, 0)); + heightplots_get_height(), 1, 500, 5, 50, 0)); g_object_ref(divv_adj); heightplots_set_dataset(DATASET_DIVF); divf_adj = GTK_ADJUSTMENT(gtk_adjustment_new( - heightplots_get_height(), 1, 4000, 5, 50, 0)); + heightplots_get_height(), 1, 500, 5, 50, 0)); g_object_ref(divf_adj); heightplots_set_dataset(dataset); } +/* should be called by destroy */ +void clean_adjustments(void) +{ + g_object_unref(rho_adj); + g_object_unref(vel_adj); + g_object_unref(force_adj); + g_object_unref(divv_adj); + g_object_unref(divf_adj); +} GtkWidget *create_heightplots_page(void) { diff --git a/Smoke/heightplots.c b/Smoke/heightplots.c index 2f166d6..61efea1 100644 --- a/Smoke/heightplots.c +++ b/Smoke/heightplots.c @@ -23,8 +23,11 @@ static float heightplots_alpha = 1.0f; static int heightplots_dataset = DATASET_RHO; -static int heightplots_rho, heightplots_vel, heightplots_force = 100; -static int heightplots_divv, heightplots_divf = 1000; +static int heightplots_rho = 100; +static int heightplots_vel = 10; +static int heightplots_force = 10; +static int heightplots_divv = 100; +static int heightplots_divf = 100; static fftw_real *heightplots_frame; @@ -84,14 +87,19 @@ void heightplots_set_height(int height) switch(heightplots_dataset) { case DATASET_RHO: heightplots_rho = height; + break; case DATASET_VEL: heightplots_vel = height; + break; case DATASET_FORCE: heightplots_force = height; + break; case DATASET_DIVV: heightplots_divv = height; + break; case DATASET_DIVF: heightplots_divf = height; + break; default: break; } @@ -106,14 +114,19 @@ int heightplots_get_height(void) switch(heightplots_dataset) { case DATASET_RHO: return_value = heightplots_rho; + break; case DATASET_VEL: return_value = heightplots_vel; + break; case DATASET_FORCE: return_value = heightplots_force; + break; case DATASET_DIVV: return_value = heightplots_divv; + break; case DATASET_DIVF: return_value = heightplots_divf; + break; default: break; } diff --git a/Smoke/smoke.bin b/Smoke/smoke.bin Binary files differindex f5578cc..da1d5b5 100755 --- a/Smoke/smoke.bin +++ b/Smoke/smoke.bin |