1 /*----------------------------------------------------------------------
3 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
6 Copyright (C) 2002 Gerber van der Graaf
8 This file is part of gpiv.
10 Gpiv is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software Foundation,
22 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 ----------------------------------------------------------------------*/
27 * PIV Post-processing interface
28 * $Log: pivpost_interface.c,v $
29 * Revision 1.1 2003-06-17 17:10:52 gerber
40 #include "pivpost_interface.h"
44 create_pivpost (GtkWidget
*main_window
,
47 PivPost
* post
= g_new0(PivPost
, 1);
48 GpivConsole
* gpiv
= gtk_object_get_data(GTK_OBJECT(main_window
), "gpiv");
50 post
->tooltips
= gtk_tooltips_new();
54 post
->vbox_label
= gtk_vbox_new(FALSE
,
56 gtk_widget_ref(post
->vbox_label
);
57 gtk_object_set_data_full(GTK_OBJECT(main_window
),
60 (GtkDestroyNotify
) gtk_widget_unref
);
61 gtk_widget_show(post
->vbox_label
);
62 gtk_container_add(GTK_CONTAINER(container
),
65 post
->label_title
= gtk_label_new(_("Piv: data post processing"));
66 gtk_widget_ref(post
->label_title
);
67 gtk_object_set_data_full(GTK_OBJECT(main_window
),
70 (GtkDestroyNotify
) gtk_widget_unref
);
71 gtk_widget_show(post
->label_title
);
72 gtk_box_pack_start(GTK_BOX(post
->vbox_label
),
73 post
->label_title
, FALSE
,
81 post
->vbox_scroll
= gtk_vbox_new(FALSE
,
83 gtk_widget_ref(post
->vbox_scroll
);
84 gtk_object_set_data_full(GTK_OBJECT(main_window
),
87 (GtkDestroyNotify
) gtk_widget_unref
);
88 gtk_widget_show(post
->vbox_scroll
);
89 gtk_box_pack_start(GTK_BOX(post
->vbox_label
),
97 post
->scrolledwindow
= gtk_scrolled_window_new(NULL
,
99 gtk_widget_ref(post
->scrolledwindow
);
100 gtk_object_set_data_full(GTK_OBJECT(main_window
),
101 "post_scrolledwindow",
102 post
->scrolledwindow
,
103 (GtkDestroyNotify
) gtk_widget_unref
);
104 gtk_widget_show(post
->scrolledwindow
);
105 gtk_box_pack_start(GTK_BOX(post
->vbox_scroll
),
106 post
->scrolledwindow
,
110 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
111 (post
->scrolledwindow
),
114 /* GTK_POLICY_AUTOMATIC */ );
118 post
->viewport
= gtk_viewport_new(NULL
,
120 gtk_widget_ref(post
->viewport
);
121 gtk_object_set_data_full(GTK_OBJECT(main_window
),
124 (GtkDestroyNotify
) gtk_widget_unref
);
125 gtk_widget_show(post
->viewport
);
126 gtk_container_add(GTK_CONTAINER(post
->scrolledwindow
),
130 * main table for PIVPOST
132 post
->table
= gtk_table_new(2,
135 gtk_widget_ref(post
->table
);
136 gtk_object_set_data_full(GTK_OBJECT(main_window
),
139 (GtkDestroyNotify
) gtk_widget_unref
);
140 gtk_widget_show(post
->table
);
141 gtk_container_add(GTK_CONTAINER(post
->viewport
),
150 * Spinners use the adjustment from spinbutton_adj_imgh_*
152 post
->frame_scale
= gtk_frame_new(_("Scaling"));
153 gtk_widget_ref(post
->frame_scale
);
154 gtk_object_set_data_full(GTK_OBJECT(main_window
),
157 (GtkDestroyNotify
) gtk_widget_unref
);
158 gtk_widget_show(post
->frame_scale
);
159 gtk_table_attach(GTK_TABLE(post
->table
),
165 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
166 (GtkAttachOptions
) (0),
172 post
->table_scale
= gtk_table_new(5,
175 gtk_widget_ref(post
->table_scale
);
176 gtk_object_set_data_full(GTK_OBJECT(main_window
),
179 (GtkDestroyNotify
) gtk_widget_unref
);
180 gtk_widget_show(post
->table_scale
);
181 gtk_container_add(GTK_CONTAINER(post
->frame_scale
),
186 *spinner for spatial scale "sscale"
188 post
->label_sscale
= gtk_label_new(_("spatial scale (mm/px): "));
189 gtk_widget_ref(post
->label_sscale
);
190 gtk_object_set_data_full(GTK_OBJECT(main_window
),
193 (GtkDestroyNotify
) gtk_widget_unref
);
194 gtk_widget_show(post
->label_sscale
);
195 gtk_table_attach(GTK_TABLE(post
->table_scale
),
201 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
202 (GtkAttachOptions
) (0),
211 /* spinbutton_adj_post_sscale = */
212 /* gtk_adjustment_new(piv_post_par.s_scale, 0, 1279, 1, 100, 100); */
214 * end of KEEP DISABLED
216 post
->spinbutton_sscale
=
217 gtk_spin_button_new(GTK_ADJUSTMENT(gpiv
->imgh
->spinbutton_adj_sscale
),
220 gtk_widget_ref(post
->spinbutton_sscale
);
221 gtk_widget_show(post
->spinbutton_sscale
);
222 gtk_table_attach(GTK_TABLE(post
->table_scale
),
223 post
->spinbutton_sscale
,
228 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
229 (GtkAttachOptions
) (0),
232 gtk_entry_set_editable(GTK_ENTRY(post
->spinbutton_sscale
),
234 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post
->spinbutton_sscale
),
237 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_sscale
),
240 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_sscale
),
243 gtk_signal_connect(GTK_OBJECT(post
->spinbutton_sscale
),
245 on_spinbutton_post_scale
,
246 post
->spinbutton_sscale
);
250 *spinner for time scale "tscale"
252 post
->label_tscale
= gtk_label_new(_("time scale (ms): "));
253 gtk_widget_ref(post
->label_tscale
);
254 gtk_object_set_data_full(GTK_OBJECT(main_window
),
257 (GtkDestroyNotify
) gtk_widget_unref
);
258 gtk_widget_show(post
->label_tscale
);
259 gtk_table_attach(GTK_TABLE(post
->table_scale
),
265 (GtkAttachOptions
) (GTK_FILL
),
266 (GtkAttachOptions
) (0),
275 /* spinbutton_adj_post_tscale = */
276 /* gtk_adjustment_new(piv_post_par.t_scale, 0, 1279, 1, 100, 100); */
278 * end of KEEP DISABLED
280 post
->spinbutton_tscale
=
281 gtk_spin_button_new(GTK_ADJUSTMENT(gpiv
->imgh
->spinbutton_adj_tscale
),
284 gtk_widget_ref(post
->spinbutton_tscale
);
285 gtk_widget_show(post
->spinbutton_tscale
);
286 gtk_table_attach(GTK_TABLE(post
->table_scale
),
287 post
->spinbutton_tscale
,
292 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
293 (GtkAttachOptions
) (0),
296 gtk_entry_set_editable(GTK_ENTRY(post
->spinbutton_tscale
),
298 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post
->spinbutton_tscale
),
301 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_tscale
),
304 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_tscale
),
307 gtk_signal_connect(GTK_OBJECT(post
->spinbutton_tscale
),
309 on_spinbutton_post_scale
,
310 post
->spinbutton_tscale
);
315 * spinner for column position
317 post
->label_colpos
= gtk_label_new(_("pos. of col #0 (m): "));
318 gtk_widget_ref(post
->label_colpos
);
319 gtk_object_set_data_full(GTK_OBJECT(main_window
),
322 (GtkDestroyNotify
) gtk_widget_unref
);
323 gtk_widget_show(post
->label_colpos
);
324 gtk_table_attach(GTK_TABLE(post
->table_scale
),
330 (GtkAttachOptions
) (GTK_FILL
),
331 (GtkAttachOptions
) (0),
340 /* spinbutton_adj_post_colpos = */
341 /* gtk_adjustment_new(piv_post_par.z_off_x, 0, Z_OFF_MAX, 1, 100, */
344 * end of KEEP DISABLED
346 post
->spinbutton_colpos
=
347 gtk_spin_button_new(GTK_ADJUSTMENT(gpiv
->imgh
->spinbutton_adj_colpos
),
350 gtk_widget_ref(post
->spinbutton_colpos
);
351 gtk_widget_show(post
->spinbutton_colpos
);
352 gtk_table_attach(GTK_TABLE(post
->table_scale
),
353 post
->spinbutton_colpos
,
358 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
359 (GtkAttachOptions
) (0),
362 gtk_entry_set_editable(GTK_ENTRY(post
->spinbutton_colpos
),
364 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post
->spinbutton_colpos
),
367 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_colpos
),
370 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_colpos
),
373 gtk_signal_connect(GTK_OBJECT(post
->spinbutton_colpos
),
375 on_spinbutton_post_scale
,
376 post
->spinbutton_colpos
);
381 * spinner for row position
383 post
->label_rowpos
= gtk_label_new(_("pos. of row #0 (m): "));
384 gtk_widget_ref(post
->label_rowpos
);
385 gtk_object_set_data_full(GTK_OBJECT(main_window
),
388 (GtkDestroyNotify
) gtk_widget_unref
);
389 gtk_widget_show(post
->label_rowpos
);
390 gtk_table_attach(GTK_TABLE(post
->table_scale
),
396 (GtkAttachOptions
) (GTK_FILL
),
397 (GtkAttachOptions
) (0),
406 /* spinbutton_adj_post_rowpos = */
407 /* gtk_adjustment_new(piv_post_par.z_off_y, 0, Z_OFF_MAX, 1, 100, */
410 * end of KEEP DISABLED
412 post
->spinbutton_rowpos
=
413 gtk_spin_button_new(GTK_ADJUSTMENT(gpiv
->imgh
->spinbutton_adj_rowpos
),
416 gtk_widget_ref(post
->spinbutton_rowpos
);
417 gtk_widget_show(post
->spinbutton_rowpos
);
418 gtk_table_attach(GTK_TABLE(post
->table_scale
),
419 post
->spinbutton_rowpos
,
424 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
425 (GtkAttachOptions
) (0),
428 gtk_entry_set_editable(GTK_ENTRY(post
->spinbutton_rowpos
),
430 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post
->spinbutton_rowpos
),
433 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_rowpos
),
436 gtk_object_set_data(GTK_OBJECT(post
->spinbutton_rowpos
),
439 gtk_signal_connect(GTK_OBJECT(post
->spinbutton_rowpos
),
441 on_spinbutton_post_scale
,
442 post
->spinbutton_rowpos
);
446 post
->button_scale
= gtk_button_new_with_label(_("scale"));
447 gtk_widget_ref(post
->button_scale
);
448 gtk_object_set_data_full(GTK_OBJECT(main_window
),
451 (GtkDestroyNotify
) gtk_widget_unref
);
452 gtk_widget_show(post
->button_scale
);
453 gtk_table_attach(GTK_TABLE(post
->table_scale
),
459 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
460 (GtkAttachOptions
) (GTK_FILL
),
463 gtk_tooltips_set_tip(post
->tooltips
,
465 _("Calculates time and spatial scaled particle "
466 "displacements (i.e. velocities) from a PIV displacement field, and their "
470 gtk_object_set_data(GTK_OBJECT(post
->button_scale
),
473 gtk_signal_connect(GTK_OBJECT(post
->button_scale
),
476 (on_button_post_scale_enter
),
478 gtk_signal_connect(GTK_OBJECT(post
->button_scale
),
480 GTK_SIGNAL_FUNC(on_widget_leave
),
482 gtk_signal_connect(GTK_OBJECT(post
->button_scale
),
484 GTK_SIGNAL_FUNC(on_button_post_scale
),
489 * Spatial average frame
492 post
->frame_savg
= gtk_frame_new(_("Spatial statistics"));
493 gtk_widget_ref(post
->frame_savg
);
494 gtk_object_set_data_full(GTK_OBJECT(main_window
),
497 (GtkDestroyNotify
) gtk_widget_unref
);
498 gtk_widget_show(post
->frame_savg
);
499 gtk_table_attach(GTK_TABLE(post
->table
),
505 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
506 (GtkAttachOptions
) (0),
512 post
->table_savg
= gtk_table_new(2,
515 gtk_widget_ref(post
->table_savg
);
516 gtk_object_set_data_full(GTK_OBJECT(main_window
),
519 (GtkDestroyNotify
) gtk_widget_unref
);
520 gtk_widget_show(post
->table_savg
);
521 gtk_container_add(GTK_CONTAINER(post
->frame_savg
),
526 *spinner for spatial U-avg
528 post
->label_suavg
= gtk_label_new(_("dx (px), U (m/s): "));
529 gtk_widget_ref(post
->label_suavg
);
530 gtk_object_set_data_full(GTK_OBJECT(main_window
),
533 (GtkDestroyNotify
) gtk_widget_unref
);
534 gtk_widget_show(post
->label_suavg
);
535 gtk_table_attach(GTK_TABLE(post
->table_savg
),
541 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
542 (GtkAttachOptions
) (0),
548 post
->spinbutton_adj_suavg
=
549 /* ARG1: piv_post_par.s_savg */
550 gtk_adjustment_new(0. ,
556 post
->spinbutton_suavg
=
557 gtk_spin_button_new(GTK_ADJUSTMENT(post
->spinbutton_adj_suavg
),
560 gtk_widget_ref(post
->spinbutton_suavg
);
561 gtk_widget_show(post
->spinbutton_suavg
);
562 gtk_table_attach(GTK_TABLE(post
->table_savg
),
563 post
->spinbutton_suavg
,
568 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
569 (GtkAttachOptions
) (0),
572 gtk_entry_set_editable(GTK_ENTRY(post
->spinbutton_suavg
),
574 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post
->spinbutton_suavg
),
579 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_suavg), */
581 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_suavg), */
582 /* "var_type", "3"); */
583 /* gtk_signal_connect(GTK_OBJECT(post->spinbutton_suavg), */
585 /* on_spinbutton_post_suavg, */
586 /* post->spinbutton_suavg); */
588 * end of KEEP DISABLED
594 * spinner for spatial V-avg
596 post
->label_svavg
= gtk_label_new(_("dy (px), V (m/s): "));
597 gtk_widget_ref(post
->label_svavg
);
598 gtk_object_set_data_full(GTK_OBJECT(main_window
),
601 (GtkDestroyNotify
) gtk_widget_unref
);
602 gtk_widget_show(post
->label_svavg
);
603 gtk_table_attach(GTK_TABLE(post
->table_savg
),
609 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
610 (GtkAttachOptions
) (0),
616 post
->spinbutton_adj_svavg
=
617 /* ARG1: piv_post_par.s_savg */
618 gtk_adjustment_new(0.0 ,
624 post
->spinbutton_svavg
=
625 gtk_spin_button_new(GTK_ADJUSTMENT(post
->spinbutton_adj_svavg
),
628 gtk_widget_ref(post
->spinbutton_svavg
);
629 gtk_widget_show(post
->spinbutton_svavg
);
630 gtk_table_attach(GTK_TABLE(post
->table_savg
),
631 post
->spinbutton_svavg
,
636 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
637 (GtkAttachOptions
) (0),
640 gtk_entry_set_editable(GTK_ENTRY(post
->spinbutton_svavg
),
642 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post
->spinbutton_svavg
),
647 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_svavg), */
648 /* "var_type", "3"); */
649 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_suavg), */
651 /* gtk_signal_connect(GTK_OBJECT(post->spinbutton_svavg), */
653 /* on_spinbutton_post_svavg, */
654 /* post->spinbutton_svavg); */
656 * end of KEEP DISABLED
661 * button to calculate averages
663 post
->button_savg
= gtk_button_new_with_label(_("avarage"));
664 gtk_widget_ref(post
->button_savg
);
665 gtk_object_set_data_full(GTK_OBJECT(main_window
),
668 (GtkDestroyNotify
) gtk_widget_unref
);
669 gtk_widget_show(post
->button_savg
);
670 gtk_table_attach(GTK_TABLE(post
->table_savg
),
676 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
677 (GtkAttachOptions
) (0),
680 gtk_tooltips_set_tip(post
->tooltips
, post
->button_savg
,
681 _("Calculates spatial average particle displacements "
682 "or velocities from a velocity field, obtained from PIV data"),
685 gtk_object_set_data(GTK_OBJECT(post
->button_savg
),
688 gtk_signal_connect(GTK_OBJECT(post
->button_savg
),
690 GTK_SIGNAL_FUNC(on_button_post_savg_enter
),
692 gtk_signal_connect(GTK_OBJECT(post
->button_savg
),
694 GTK_SIGNAL_FUNC(on_widget_leave
),
696 gtk_signal_connect(GTK_OBJECT(post
->button_savg
),
698 GTK_SIGNAL_FUNC(on_button_post_savg
),
703 * button to substracts averages
705 post
->button_subavg
= gtk_button_new_with_label(_("substract"));
706 gtk_widget_ref(post
->button_subavg
);
707 gtk_object_set_data_full(GTK_OBJECT(main_window
),
708 "post_button_subavg",
710 (GtkDestroyNotify
) gtk_widget_unref
);
711 gtk_widget_show(post
->button_subavg
);
712 gtk_table_attach(GTK_TABLE(post
->table_savg
),
718 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
719 (GtkAttachOptions
) (0),
722 gtk_tooltips_set_tip(post
->tooltips
,
724 _("Substracts the spatial averages, or values that "
725 "have been entered manually, from each estimator"),
728 gtk_object_set_data(GTK_OBJECT(post
->button_subavg
),
731 gtk_signal_connect(GTK_OBJECT(post
->button_subavg
),
733 GTK_SIGNAL_FUNC(on_button_post_subavg_enter
),
735 gtk_signal_connect(GTK_OBJECT(post
->button_subavg
),
737 GTK_SIGNAL_FUNC(on_widget_leave
),
739 gtk_signal_connect(GTK_OBJECT(post
->button_subavg
),
741 GTK_SIGNAL_FUNC(on_button_post_subavg
),
748 post
->frame_vorstra
= gtk_frame_new(_("Vorticity & strain"));
749 gtk_widget_ref(post
->frame_vorstra
);
750 gtk_object_set_data_full(GTK_OBJECT(main_window
),
751 "post_frame_vorstra",
753 (GtkDestroyNotify
) gtk_widget_unref
);
754 gtk_widget_show(post
->frame_vorstra
);
755 gtk_table_attach(GTK_TABLE(post
->table
),
761 (GtkAttachOptions
) (GTK_FILL
),
762 (GtkAttachOptions
) (0),
768 post
->vbox_vorstra
= gtk_vbox_new(FALSE
,
770 gtk_widget_ref(post
->vbox_vorstra
);
771 gtk_object_set_data_full(GTK_OBJECT(main_window
),
774 (GtkDestroyNotify
) gtk_widget_unref
);
775 gtk_widget_show(post
->vbox_vorstra
);
776 gtk_container_add(GTK_CONTAINER(post
->frame_vorstra
),
781 post
->frame_vorstra_output
= gtk_frame_new(_("Output:"));
782 gtk_widget_ref(post
->frame_vorstra_output
);
783 gtk_object_set_data_full(GTK_OBJECT(main_window
),
784 "post_frame_vorstra_output",
785 post
->frame_vorstra_output
,
786 (GtkDestroyNotify
) gtk_widget_unref
);
787 gtk_widget_show(post
->frame_vorstra_output
);
788 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra
),
789 post
->frame_vorstra_output
,
793 gtk_frame_set_shadow_type(GTK_FRAME(post
->frame_vorstra_output
),
798 post
->vbox_vorstra_output
= gtk_vbox_new(FALSE
,
800 gtk_widget_ref(post
->vbox_vorstra_output
);
801 gtk_object_set_data_full(GTK_OBJECT(main_window
),
802 "post_vbox_vorstra_output",
803 post
->vbox_vorstra_output
,
804 (GtkDestroyNotify
) gtk_widget_unref
);
805 gtk_widget_show(post
->vbox_vorstra_output
);
806 gtk_container_add(GTK_CONTAINER(post
->frame_vorstra_output
),
807 post
->vbox_vorstra_output
);
811 post
->radiobutton_vorstra_output_1
=
812 gtk_radio_button_new_with_label(post
->vbox_vorstra_output_group
,
814 post
->vbox_vorstra_output_group
=
815 gtk_radio_button_group(GTK_RADIO_BUTTON
816 (post
->radiobutton_vorstra_output_1
));
817 gtk_widget_ref(post
->radiobutton_vorstra_output_1
);
818 gtk_object_set_data_full(GTK_OBJECT(main_window
),
819 "post_radiobutton_vorstra_output_1",
820 post
->radiobutton_vorstra_output_1
,
821 (GtkDestroyNotify
) gtk_widget_unref
);
822 gtk_widget_show(post
->radiobutton_vorstra_output_1
);
823 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_output
),
824 post
->radiobutton_vorstra_output_1
,
829 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_output_1
),
832 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_output_1
),
835 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_1
),
838 (on_radiobutton_post_vorstra_output_enter
),
840 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_1
),
842 GTK_SIGNAL_FUNC(on_widget_leave
),
844 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_1
),
846 GTK_SIGNAL_FUNC(on_radiobutton_post_vorstra_output
),
852 post
->radiobutton_vorstra_output_2
=
853 gtk_radio_button_new_with_label(post
->vbox_vorstra_output_group
,
855 post
->vbox_vorstra_output_group
=
856 gtk_radio_button_group(GTK_RADIO_BUTTON
857 (post
->radiobutton_vorstra_output_2
));
858 gtk_widget_ref(post
->radiobutton_vorstra_output_2
);
859 gtk_object_set_data_full(GTK_OBJECT(main_window
),
860 "post_radiobutton_vorstra_output_2",
861 post
->radiobutton_vorstra_output_2
,
862 (GtkDestroyNotify
) gtk_widget_unref
);
863 gtk_widget_show(post
->radiobutton_vorstra_output_2
);
864 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_output
),
865 post
->radiobutton_vorstra_output_2
,
870 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_output_2
),
873 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_output_2
),
876 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_2
),
879 (on_radiobutton_post_vorstra_output_enter
),
881 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_2
),
883 GTK_SIGNAL_FUNC(on_widget_leave
),
885 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_2
),
887 GTK_SIGNAL_FUNC(on_radiobutton_post_vorstra_output
),
893 post
->radiobutton_vorstra_output_3
=
894 gtk_radio_button_new_with_label(post
->vbox_vorstra_output_group
,
896 post
->vbox_vorstra_output_group
=
897 gtk_radio_button_group(GTK_RADIO_BUTTON
898 (post
->radiobutton_vorstra_output_3
));
899 gtk_widget_ref(post
->radiobutton_vorstra_output_3
);
900 gtk_object_set_data_full(GTK_OBJECT(main_window
),
901 "post_radiobutton_vorstra_output_3",
902 post
->radiobutton_vorstra_output_3
,
903 (GtkDestroyNotify
) gtk_widget_unref
);
904 gtk_widget_show(post
->radiobutton_vorstra_output_3
);
905 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_output
),
906 post
->radiobutton_vorstra_output_3
,
911 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_output_3
),
914 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_output_3
),
917 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_3
),
920 (on_radiobutton_post_vorstra_output_enter
),
922 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_3
),
924 GTK_SIGNAL_FUNC(on_widget_leave
),
926 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_output_3
),
928 GTK_SIGNAL_FUNC(on_radiobutton_post_vorstra_output
),
933 post
->frame_vorstra_diffscheme
= gtk_frame_new(_("Differential scheme:"));
934 gtk_widget_ref(post
->frame_vorstra_diffscheme
);
935 gtk_object_set_data_full(GTK_OBJECT(main_window
),
936 "post_frame_vorstra_diffscheme",
937 post
->frame_vorstra_diffscheme
,
938 (GtkDestroyNotify
) gtk_widget_unref
);
939 gtk_widget_show(post
->frame_vorstra_diffscheme
);
940 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra
),
941 post
->frame_vorstra_diffscheme
,
945 gtk_frame_set_shadow_type(GTK_FRAME(post
->frame_vorstra_diffscheme
),
951 post
->vbox_vorstra_diffscheme
= gtk_vbox_new(FALSE
,
953 gtk_widget_ref(post
->vbox_vorstra_diffscheme
);
954 gtk_object_set_data_full(GTK_OBJECT(main_window
),
955 "post_vbox_vorstra_diffscheme",
956 post
->vbox_vorstra_diffscheme
,
957 (GtkDestroyNotify
) gtk_widget_unref
);
958 gtk_widget_show(post
->vbox_vorstra_diffscheme
);
959 gtk_container_add(GTK_CONTAINER(post
->frame_vorstra_diffscheme
),
960 post
->vbox_vorstra_diffscheme
);
965 post
->radiobutton_vorstra_diffscheme_1
=
966 gtk_radio_button_new_with_label(post
->vbox_vorstra_diffscheme_group
,
968 post
->vbox_vorstra_diffscheme_group
=
969 gtk_radio_button_group(GTK_RADIO_BUTTON
970 (post
->radiobutton_vorstra_diffscheme_1
));
971 gtk_widget_ref(post
->radiobutton_vorstra_diffscheme_1
);
972 gtk_object_set_data_full(GTK_OBJECT(main_window
),
973 "post_radiobutton_vorstra_diffscheme_1",
974 post
->radiobutton_vorstra_diffscheme_1
,
975 (GtkDestroyNotify
) gtk_widget_unref
);
976 gtk_widget_show(post
->radiobutton_vorstra_diffscheme_1
);
977 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_diffscheme
),
978 post
->radiobutton_vorstra_diffscheme_1
,
983 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_1
),
986 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_1
),
989 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_1
),
992 (on_radiobutton_post_vorstra_diffscheme_enter
),
994 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_1
),
996 GTK_SIGNAL_FUNC(on_widget_leave
),
998 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_1
),
1001 (on_radiobutton_post_vorstra_diffscheme
),
1006 post
->radiobutton_vorstra_diffscheme_2
=
1007 gtk_radio_button_new_with_label(post
->vbox_vorstra_diffscheme_group
,
1008 _("Least squares"));
1009 post
->vbox_vorstra_diffscheme_group
=
1010 gtk_radio_button_group(GTK_RADIO_BUTTON
1011 (post
->radiobutton_vorstra_diffscheme_2
));
1012 gtk_widget_ref(post
->radiobutton_vorstra_diffscheme_2
);
1013 gtk_object_set_data_full(GTK_OBJECT(main_window
),
1014 "post_radiobutton_vorstra_diffscheme_2",
1015 post
->radiobutton_vorstra_diffscheme_2
,
1016 (GtkDestroyNotify
) gtk_widget_unref
);
1017 gtk_widget_show(post
->radiobutton_vorstra_diffscheme_2
);
1018 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_diffscheme
),
1019 post
->radiobutton_vorstra_diffscheme_2
,
1024 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_2
),
1027 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_2
),
1030 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_2
),
1033 (on_radiobutton_post_vorstra_diffscheme_enter
),
1035 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_2
),
1037 GTK_SIGNAL_FUNC(on_widget_leave
),
1039 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_2
),
1042 (on_radiobutton_post_vorstra_diffscheme
),
1048 post
->radiobutton_vorstra_diffscheme_3
=
1049 gtk_radio_button_new_with_label(post
->vbox_vorstra_diffscheme_group
,
1051 post
->vbox_vorstra_diffscheme_group
=
1052 gtk_radio_button_group(GTK_RADIO_BUTTON
1053 (post
->radiobutton_vorstra_diffscheme_3
));
1054 gtk_widget_ref(post
->radiobutton_vorstra_diffscheme_3
);
1055 gtk_object_set_data_full(GTK_OBJECT(main_window
),
1056 "post_radiobutton_vorstra_diffscheme_3",
1057 post
->radiobutton_vorstra_diffscheme_3
,
1058 (GtkDestroyNotify
) gtk_widget_unref
);
1060 *Define which button is switched on at start up time
1062 if (piv_post_par
.diff_type
== 2) {
1063 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1064 (post
->radiobutton_vorstra_diffscheme_3
),
1067 gtk_widget_show(post
->radiobutton_vorstra_diffscheme_3
);
1068 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_diffscheme
),
1069 post
->radiobutton_vorstra_diffscheme_3
,
1074 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_3
),
1077 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_3
),
1080 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_3
),
1083 (on_radiobutton_post_vorstra_diffscheme_enter
),
1085 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_3
),
1087 GTK_SIGNAL_FUNC(on_widget_leave
),
1089 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_3
),
1092 (on_radiobutton_post_vorstra_diffscheme
),
1098 post
->radiobutton_vorstra_diffscheme_4
=
1099 gtk_radio_button_new_with_label(post
->vbox_vorstra_diffscheme_group
,
1100 _("Circulation method"));
1101 post
->vbox_vorstra_diffscheme_group
=
1102 gtk_radio_button_group(GTK_RADIO_BUTTON
1103 (post
->radiobutton_vorstra_diffscheme_4
));
1104 gtk_widget_ref(post
->radiobutton_vorstra_diffscheme_4
);
1105 gtk_object_set_data_full(GTK_OBJECT(main_window
),
1106 "post_radiobutton_vorstra_diffscheme_4",
1107 post
->radiobutton_vorstra_diffscheme_4
,
1108 (GtkDestroyNotify
) gtk_widget_unref
);
1110 *Define which button is switched on at start up time
1112 if (piv_post_par
.diff_type
== 3) {
1113 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1114 (post
->radiobutton_vorstra_diffscheme_4
),
1117 gtk_widget_show(post
->radiobutton_vorstra_diffscheme_4
);
1118 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra_diffscheme
),
1119 post
->radiobutton_vorstra_diffscheme_4
,
1124 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_4
),
1127 gtk_object_set_data(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_4
),
1130 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_4
),
1133 (on_radiobutton_post_vorstra_diffscheme_enter
),
1135 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_4
),
1137 GTK_SIGNAL_FUNC(on_widget_leave
),
1139 gtk_signal_connect(GTK_OBJECT(post
->radiobutton_vorstra_diffscheme_4
),
1142 (on_radiobutton_post_vorstra_diffscheme
),
1147 * Define which button is switched on at start up time; moved to the
1148 * end of the tabulator as diff_scheme button Circulation might be
1149 * enabled or disabled
1151 if (piv_post_par
.operator_vorstra
== 0) {
1152 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1153 (post
->radiobutton_vorstra_output_1
),
1155 } else if (piv_post_par
.operator_vorstra
== 1) {
1156 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1157 (post
->radiobutton_vorstra_output_2
),
1159 } else if (piv_post_par
.operator_vorstra
== 2) {
1160 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1161 (post
->radiobutton_vorstra_output_3
),
1166 if (piv_post_par
.diff_type
== 0) {
1167 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1168 (post
->radiobutton_vorstra_diffscheme_1
),
1171 if (piv_post_par
.diff_type
== 1) {
1172 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1173 (post
->radiobutton_vorstra_diffscheme_2
),
1175 } else if (piv_post_par
.diff_type
== 2) {
1176 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1177 (post
->radiobutton_vorstra_diffscheme_3
),
1184 post
->button_vorstra
= gtk_button_new_with_label(_("vorticity"));
1185 gtk_widget_ref(post
->button_vorstra
);
1186 gtk_object_set_data_full(GTK_OBJECT(main_window
),
1187 "post_button_vorstra",
1188 post
->button_vorstra
,
1189 (GtkDestroyNotify
) gtk_widget_unref
);
1190 gtk_widget_show(post
->button_vorstra
);
1191 gtk_box_pack_start(GTK_BOX(post
->vbox_vorstra
),
1192 post
->button_vorstra
,
1196 gtk_tooltips_set_tip(post
->tooltips
,
1197 post
->button_vorstra
,
1198 _("Calculates vorticity or strain magnitudes from a velocity field, obtained by PIV"),
1200 gtk_object_set_data(GTK_OBJECT(post
->button_vorstra
),
1203 gtk_signal_connect(GTK_OBJECT(post
->button_vorstra
),
1205 GTK_SIGNAL_FUNC(on_button_post_vorstra_enter
),
1207 gtk_signal_connect(GTK_OBJECT(post
->button_vorstra
),
1209 GTK_SIGNAL_FUNC(on_widget_leave
),
1211 gtk_signal_connect(GTK_OBJECT(post
->button_vorstra
),
1213 GTK_SIGNAL_FUNC(on_button_post_vorstra
),