1 /*----------------------------------------------------------------------
3 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
6 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
9 This file is part of gpiv.
11 Gpiv is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation,
23 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 ----------------------------------------------------------------------*/
28 * PIV Post-processing interface
29 * $Log: pivpost_interface.c,v $
30 * Revision 1.10 2007-11-23 16:24:08 gerber
31 * release 0.5.0: Kafka
33 * Revision 1.9 2007-01-29 11:27:44 gerber
34 * added image formats png, gif, tif png, bmp, improved buffer display
36 * Revision 1.8 2006-09-18 07:27:06 gerber
37 * *** empty log message ***
39 * Revision 1.7 2006/01/31 14:28:12 gerber
42 * Revision 1.5 2005/02/12 14:12:12 gerber
43 * Changed tabular names and titles
45 * Revision 1.4 2005/01/19 15:53:42 gerber
46 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
47 * by using RTAI and Realtime Linux, recording images from IEEE1394
48 * (Firewire) IIDC compliant camera's
50 * Revision 1.3 2004/06/14 21:19:23 gerber
51 * Image depth up to 16 bits.
52 * Improvement "single int" and "drag int" in Eval tab.
53 * Viewer's pop-up menu.
54 * Adaption for gpiv_matrix_* and gpiv_vector_*.
56 * See Changelog for further info.
58 * Revision 1.2 2003/08/22 15:24:52 gerber
59 * interactive spatial scaling
61 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
71 /* #include "console.h" */
73 #include "pivpost_interface.h"
77 create_pivpost (GnomeApp
*main_window
,
80 /*-----------------------------------------------------------------------------
83 PivPost
* post
= g_new0 (PivPost
, 1);
84 GpivConsole
* gpiv
= gtk_object_get_data (GTK_OBJECT (main_window
), "gpiv");
88 post
->vbox_label
= gtk_vbox_new (FALSE
,
90 gtk_widget_ref (post
->vbox_label
);
91 gtk_object_set_data_full (GTK_OBJECT (main_window
),
94 (GtkDestroyNotify
) gtk_widget_unref
);
95 gtk_widget_show (post
->vbox_label
);
96 gtk_container_add (GTK_CONTAINER (container
),
99 post
->label_title
= gtk_label_new(_("Piv data post processing"));
100 gtk_widget_ref(post
->label_title
);
101 gtk_object_set_data_full (GTK_OBJECT (main_window
),
104 (GtkDestroyNotify
) gtk_widget_unref
);
105 gtk_widget_show (post
->label_title
);
106 gtk_box_pack_start (GTK_BOX (post
->vbox_label
),
107 post
->label_title
, FALSE
,
115 post
->vbox_scroll
= gtk_vbox_new (FALSE
,
117 gtk_widget_ref (post
->vbox_scroll
);
118 gtk_object_set_data_full (GTK_OBJECT (main_window
),
121 (GtkDestroyNotify
) gtk_widget_unref
);
122 gtk_widget_show (post
->vbox_scroll
);
123 gtk_box_pack_start (GTK_BOX (post
->vbox_label
),
131 post
->scrolledwindow
= gtk_scrolled_window_new (NULL
,
133 gtk_widget_ref (post
->scrolledwindow
);
134 gtk_object_set_data_full (GTK_OBJECT (main_window
),
135 "post_scrolledwindow",
136 post
->scrolledwindow
,
137 (GtkDestroyNotify
) gtk_widget_unref
);
138 gtk_widget_show (post
->scrolledwindow
);
139 gtk_box_pack_start (GTK_BOX (post
->vbox_scroll
),
140 post
->scrolledwindow
,
144 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
145 (post
->scrolledwindow
),
148 /* GTK_POLICY_AUTOMATIC */ );
152 post
->viewport
= gtk_viewport_new (NULL
,
154 gtk_widget_ref (post
->viewport
);
155 gtk_object_set_data_full (GTK_OBJECT (main_window
),
158 (GtkDestroyNotify
) gtk_widget_unref
);
159 gtk_widget_show (post
->viewport
);
160 gtk_container_add (GTK_CONTAINER (post
->scrolledwindow
),
164 * main table for PIVPOST
166 post
->table
= gtk_table_new (2,
169 gtk_widget_ref (post
->table
);
170 gtk_object_set_data_full (GTK_OBJECT (main_window
),
173 (GtkDestroyNotify
) gtk_widget_unref
);
174 gtk_widget_show (post
->table
);
175 gtk_container_add (GTK_CONTAINER (post
->viewport
),
184 * Spinners use the adjustment from spinbutton_adj_imgh_*
186 post
->frame_scale
= gtk_frame_new ( _("Scaling"));
187 gtk_widget_ref (post
->frame_scale
);
188 gtk_object_set_data_full (GTK_OBJECT (main_window
),
191 (GtkDestroyNotify
) gtk_widget_unref
);
192 gtk_widget_show (post
->frame_scale
);
193 gtk_table_attach (GTK_TABLE (post
->table
),
199 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
200 (GtkAttachOptions
) (0),
206 post
->table_scale
= gtk_table_new (5,
209 gtk_widget_ref (post
->table_scale
);
210 gtk_object_set_data_full (GTK_OBJECT (main_window
),
213 (GtkDestroyNotify
) gtk_widget_unref
);
214 gtk_widget_show (post
->table_scale
);
215 gtk_container_add (GTK_CONTAINER (post
->frame_scale
),
220 *spinner for spatial scale "sscale"
222 post
->label_sscale
= gtk_label_new ( _("spatial scale (mm/pixels): "));
223 gtk_widget_ref (post
->label_sscale
);
224 gtk_object_set_data_full (GTK_OBJECT (main_window
),
227 (GtkDestroyNotify
) gtk_widget_unref
);
228 gtk_widget_show (post
->label_sscale
);
229 gtk_table_attach (GTK_TABLE (post
->table_scale
),
235 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
236 (GtkAttachOptions
) (0),
245 /* spinbutton_adj_post_sscale = */
246 /* gtk_adjustment_new (gl_post_par.s_scale, 0, 1279, 1, 100, 100); */
248 * end of KEEP DISABLED
250 post
->spinbutton_sscale
=
251 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_sscale
),
254 gtk_widget_ref (post
->spinbutton_sscale
);
255 gtk_widget_show (post
->spinbutton_sscale
);
256 gtk_table_attach (GTK_TABLE (post
->table_scale
),
257 post
->spinbutton_sscale
,
262 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
263 (GtkAttachOptions
) (0),
266 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_sscale
),
268 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_sscale
),
271 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_sscale
),
274 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_sscale
),
277 g_signal_connect (GTK_OBJECT (post
->spinbutton_sscale
),
279 G_CALLBACK (on_spinbutton_post_scale
),
280 post
->spinbutton_sscale
);
284 *spinner for time scale "tscale"
286 post
->label_tscale
= gtk_label_new ( _("time scale (ms): "));
287 gtk_widget_ref (post
->label_tscale
);
288 gtk_object_set_data_full (GTK_OBJECT (main_window
),
291 (GtkDestroyNotify
) gtk_widget_unref
);
292 gtk_widget_show (post
->label_tscale
);
293 gtk_table_attach (GTK_TABLE (post
->table_scale
),
299 (GtkAttachOptions
) (GTK_FILL
),
300 (GtkAttachOptions
) (0),
309 /* spinbutton_adj_post_tscale = */
310 /* gtk_adjustment_new (gl_post_par.t_scale, 0, 1279, 1, 100, 100); */
312 * end of KEEP DISABLED
314 post
->spinbutton_tscale
=
315 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_tscale
),
318 gtk_widget_ref (post
->spinbutton_tscale
);
319 gtk_widget_show (post
->spinbutton_tscale
);
320 gtk_table_attach (GTK_TABLE (post
->table_scale
),
321 post
->spinbutton_tscale
,
326 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
327 (GtkAttachOptions
) (0),
330 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_tscale
),
332 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_tscale
),
335 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_tscale
),
338 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_tscale
),
341 g_signal_connect (GTK_OBJECT (post
->spinbutton_tscale
),
343 G_CALLBACK (on_spinbutton_post_scale
),
344 post
->spinbutton_tscale
);
349 * spinner for column position
351 post
->label_colpos
= gtk_label_new ( _("pos. of col #0 (m): "));
352 gtk_widget_ref (post
->label_colpos
);
353 gtk_object_set_data_full (GTK_OBJECT (main_window
),
356 (GtkDestroyNotify
) gtk_widget_unref
);
357 gtk_widget_show (post
->label_colpos
);
358 gtk_table_attach (GTK_TABLE (post
->table_scale
),
364 (GtkAttachOptions
) (GTK_FILL
),
365 (GtkAttachOptions
) (0),
374 /* spinbutton_adj_post_colpos = */
375 /* gtk_adjustment_new (gl_post_par.z_off_x, 0, Z_OFF_MAX, 1, 100, */
378 * end of KEEP DISABLED
380 post
->spinbutton_colpos
=
381 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_colpos
),
384 gtk_widget_ref (post
->spinbutton_colpos
);
385 gtk_widget_show (post
->spinbutton_colpos
);
386 gtk_table_attach (GTK_TABLE (post
->table_scale
),
387 post
->spinbutton_colpos
,
392 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
393 (GtkAttachOptions
) (0),
396 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_colpos
),
398 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_colpos
),
401 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_colpos
),
404 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_colpos
),
407 g_signal_connect (GTK_OBJECT (post
->spinbutton_colpos
),
409 G_CALLBACK (on_spinbutton_post_scale
),
410 post
->spinbutton_colpos
);
415 * spinner for row position
417 post
->label_rowpos
= gtk_label_new ( _("pos. of row #0 (m): "));
418 gtk_widget_ref (post
->label_rowpos
);
419 gtk_object_set_data_full (GTK_OBJECT (main_window
),
422 (GtkDestroyNotify
) gtk_widget_unref
);
423 gtk_widget_show (post
->label_rowpos
);
424 gtk_table_attach (GTK_TABLE (post
->table_scale
),
430 (GtkAttachOptions
) (GTK_FILL
),
431 (GtkAttachOptions
) (0),
440 /* spinbutton_adj_post_rowpos = */
441 /* gtk_adjustment_new (gl_post_par.z_off_y, 0, Z_OFF_MAX, 1, 100, */
444 * end of KEEP DISABLED
446 post
->spinbutton_rowpos
=
447 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_rowpos
),
450 gtk_widget_ref (post
->spinbutton_rowpos
);
451 gtk_widget_show (post
->spinbutton_rowpos
);
452 gtk_table_attach (GTK_TABLE (post
->table_scale
),
453 post
->spinbutton_rowpos
,
458 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
459 (GtkAttachOptions
) (0),
462 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_rowpos
),
464 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_rowpos
),
467 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_rowpos
),
470 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_rowpos
),
473 g_signal_connect (GTK_OBJECT (post
->spinbutton_rowpos
),
475 G_CALLBACK (on_spinbutton_post_scale
),
476 post
->spinbutton_rowpos
);
480 post
->button_scale
= gtk_button_new_with_label ( _("scale"));
481 gtk_widget_ref (post
->button_scale
);
482 gtk_object_set_data_full (GTK_OBJECT (main_window
),
485 (GtkDestroyNotify
) gtk_widget_unref
);
486 gtk_widget_show (post
->button_scale
);
487 gtk_table_attach (GTK_TABLE (post
->table_scale
),
493 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
494 (GtkAttachOptions
) (GTK_FILL
),
497 gtk_tooltips_set_tip(gpiv
->tooltips
,
499 _("Calculates time and spatial scaled particle "
500 "displacements (i.e. velocities) from a PIV displacement field, and their "
504 gtk_object_set_data (GTK_OBJECT (post
->button_scale
),
507 g_signal_connect (GTK_OBJECT (post
->button_scale
),
510 (on_button_post_scale_enter
),
512 g_signal_connect (GTK_OBJECT (post
->button_scale
),
514 G_CALLBACK (on_widget_leave
),
516 g_signal_connect (GTK_OBJECT (post
->button_scale
),
518 G_CALLBACK (on_button_post_scale
),
523 * Spatial average frame
526 post
->frame_savg
= gtk_frame_new ( _("Offset / Spatial statistics"));
527 gtk_widget_ref (post
->frame_savg
);
528 gtk_object_set_data_full (GTK_OBJECT (main_window
),
531 (GtkDestroyNotify
) gtk_widget_unref
);
532 gtk_widget_show (post
->frame_savg
);
533 gtk_table_attach (GTK_TABLE (post
->table
),
539 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
540 (GtkAttachOptions
) (0),
546 post
->table_savg
= gtk_table_new (2,
549 gtk_widget_ref (post
->table_savg
);
550 gtk_object_set_data_full (GTK_OBJECT (main_window
),
553 (GtkDestroyNotify
) gtk_widget_unref
);
554 gtk_widget_show (post
->table_savg
);
555 gtk_container_add (GTK_CONTAINER (post
->frame_savg
),
560 *spinner for spatial average horizontal velocity U-avg
562 post
->label_suavg
= gtk_label_new ( _("dx (px), U (m/s): "));
563 gtk_widget_ref (post
->label_suavg
);
564 gtk_object_set_data_full (GTK_OBJECT (main_window
),
567 (GtkDestroyNotify
) gtk_widget_unref
);
568 gtk_widget_show (post
->label_suavg
);
569 gtk_table_attach (GTK_TABLE (post
->table_savg
),
575 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
576 (GtkAttachOptions
) (0),
582 post
->spinbutton_adj_suavg
=
583 /* ARG1: gl_post_par.s_savg */
584 /* gtk_adjustment_new (0. , */
590 gtk_adjustment_new (0.0 ,
596 post
->spinbutton_suavg
=
597 gtk_spin_button_new (GTK_ADJUSTMENT (post
->spinbutton_adj_suavg
),
600 gtk_widget_ref (post
->spinbutton_suavg
);
601 gtk_widget_show (post
->spinbutton_suavg
);
602 gtk_table_attach (GTK_TABLE (post
->table_savg
),
603 post
->spinbutton_suavg
,
608 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
609 (GtkAttachOptions
) (0),
612 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_suavg
),
614 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_suavg
),
619 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_suavg
),
621 g_signal_connect (GTK_OBJECT (post
->spinbutton_suavg
),
623 G_CALLBACK (on_spinbutton_post_suavg
),
624 post
->spinbutton_suavg
);
626 * end of KEEP DISABLED
632 * spinner for spatial average vertical velocity V-avg
634 post
->label_svavg
= gtk_label_new ( _("dy (px), V (m/s): "));
635 gtk_widget_ref (post
->label_svavg
);
636 gtk_object_set_data_full (GTK_OBJECT (main_window
),
639 (GtkDestroyNotify
) gtk_widget_unref
);
640 gtk_widget_show (post
->label_svavg
);
641 gtk_table_attach (GTK_TABLE (post
->table_savg
),
647 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
648 (GtkAttachOptions
) (0),
654 post
->spinbutton_adj_svavg
=
655 /* ARG1: gl_post_par.s_savg */
656 gtk_adjustment_new (0.0 ,
662 post
->spinbutton_svavg
=
663 gtk_spin_button_new (GTK_ADJUSTMENT (post
->spinbutton_adj_svavg
),
666 gtk_widget_ref (post
->spinbutton_svavg
);
667 gtk_widget_show (post
->spinbutton_svavg
);
668 gtk_table_attach (GTK_TABLE (post
->table_savg
),
669 post
->spinbutton_svavg
,
674 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
675 (GtkAttachOptions
) (0),
678 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_svavg
),
680 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_svavg
),
685 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_svavg
),
687 g_signal_connect (GTK_OBJECT (post
->spinbutton_svavg
),
689 G_CALLBACK (on_spinbutton_post_svavg
),
690 post
->spinbutton_svavg
);
692 * end of KEEP DISABLED
697 * button to calculate averages
699 post
->button_savg
= gtk_button_new_with_label ( _("average"));
700 gtk_widget_ref (post
->button_savg
);
701 gtk_object_set_data_full (GTK_OBJECT (main_window
),
704 (GtkDestroyNotify
) gtk_widget_unref
);
705 gtk_widget_show (post
->button_savg
);
706 gtk_table_attach (GTK_TABLE (post
->table_savg
),
712 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
713 (GtkAttachOptions
) (0),
716 gtk_tooltips_set_tip(gpiv
->tooltips
, post
->button_savg
,
717 _("Calculates spatial average particle displacements "
718 "or velocities from a velocity field, obtained from PIV data"),
721 gtk_object_set_data (GTK_OBJECT (post
->button_savg
),
724 g_signal_connect (GTK_OBJECT (post
->button_savg
),
726 G_CALLBACK (on_button_post_savg_enter
),
728 g_signal_connect (GTK_OBJECT (post
->button_savg
),
730 G_CALLBACK (on_widget_leave
),
732 g_signal_connect (GTK_OBJECT (post
->button_savg
),
734 G_CALLBACK (on_button_post_savg
),
739 * button to subtract averages or zero offset displacements / velocities
741 post
->button_subavg
= gtk_button_new_with_label ( _("subtract"));
742 gtk_widget_ref (post
->button_subavg
);
743 gtk_object_set_data_full (GTK_OBJECT (main_window
),
744 "post_button_subavg",
746 (GtkDestroyNotify
) gtk_widget_unref
);
747 gtk_widget_show (post
->button_subavg
);
748 gtk_table_attach (GTK_TABLE (post
->table_savg
),
754 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
755 (GtkAttachOptions
) (0),
758 gtk_tooltips_set_tip(gpiv
->tooltips
,
760 _("Subtracts the spatial averages or offset "
761 "displacements / velocities, from each estimator"),
764 gtk_object_set_data (GTK_OBJECT (post
->button_subavg
),
767 g_signal_connect (GTK_OBJECT (post
->button_subavg
),
769 G_CALLBACK (on_button_post_subavg_enter
),
771 g_signal_connect (GTK_OBJECT (post
->button_subavg
),
773 G_CALLBACK (on_widget_leave
),
775 g_signal_connect (GTK_OBJECT (post
->button_subavg
),
777 G_CALLBACK (on_button_post_subavg
),
784 post
->frame_vorstra
= gtk_frame_new ( _("Vorticity & strain"));
785 gtk_widget_ref (post
->frame_vorstra
);
786 gtk_object_set_data_full (GTK_OBJECT (main_window
),
787 "post_frame_vorstra",
789 (GtkDestroyNotify
) gtk_widget_unref
);
790 gtk_widget_show (post
->frame_vorstra
);
791 gtk_table_attach (GTK_TABLE (post
->table
),
797 (GtkAttachOptions
) (GTK_FILL
),
798 (GtkAttachOptions
) (0),
804 post
->vbox_vorstra
= gtk_vbox_new (FALSE
,
806 gtk_widget_ref (post
->vbox_vorstra
);
807 gtk_object_set_data_full (GTK_OBJECT (main_window
),
810 (GtkDestroyNotify
) gtk_widget_unref
);
811 gtk_widget_show (post
->vbox_vorstra
);
812 gtk_container_add (GTK_CONTAINER (post
->frame_vorstra
),
817 post
->frame_vorstra_output
= gtk_frame_new ( _("Output:"));
818 gtk_widget_ref (post
->frame_vorstra_output
);
819 gtk_object_set_data_full (GTK_OBJECT (main_window
),
820 "post_frame_vorstra_output",
821 post
->frame_vorstra_output
,
822 (GtkDestroyNotify
) gtk_widget_unref
);
823 gtk_widget_show (post
->frame_vorstra_output
);
824 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra
),
825 post
->frame_vorstra_output
,
829 gtk_frame_set_shadow_type (GTK_FRAME (post
->frame_vorstra_output
),
834 post
->vbox_vorstra_output
= gtk_vbox_new (FALSE
,
836 gtk_widget_ref (post
->vbox_vorstra_output
);
837 gtk_object_set_data_full (GTK_OBJECT (main_window
),
838 "post_vbox_vorstra_output",
839 post
->vbox_vorstra_output
,
840 (GtkDestroyNotify
) gtk_widget_unref
);
841 gtk_widget_show (post
->vbox_vorstra_output
);
842 gtk_container_add (GTK_CONTAINER (post
->frame_vorstra_output
),
843 post
->vbox_vorstra_output
);
847 post
->radiobutton_vorstra_output_1
=
848 gtk_radio_button_new_with_label (post
->vbox_vorstra_output_group
,
850 post
->vbox_vorstra_output_group
=
851 gtk_radio_button_group (GTK_RADIO_BUTTON
852 (post
->radiobutton_vorstra_output_1
));
853 gtk_widget_ref (post
->radiobutton_vorstra_output_1
);
854 gtk_object_set_data_full (GTK_OBJECT (main_window
),
855 "post_radiobutton_vorstra_output_1",
856 post
->radiobutton_vorstra_output_1
,
857 (GtkDestroyNotify
) gtk_widget_unref
);
858 gtk_widget_show (post
->radiobutton_vorstra_output_1
);
859 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_output
),
860 post
->radiobutton_vorstra_output_1
,
865 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
868 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
871 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
874 (on_radiobutton_post_vorstra_output_enter
),
876 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
878 G_CALLBACK (on_widget_leave
),
880 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
882 G_CALLBACK (on_radiobutton_post_vorstra_output
),
888 post
->radiobutton_vorstra_output_2
=
889 gtk_radio_button_new_with_label (post
->vbox_vorstra_output_group
,
891 post
->vbox_vorstra_output_group
=
892 gtk_radio_button_group (GTK_RADIO_BUTTON
893 (post
->radiobutton_vorstra_output_2
));
894 gtk_widget_ref (post
->radiobutton_vorstra_output_2
);
895 gtk_object_set_data_full (GTK_OBJECT (main_window
),
896 "post_radiobutton_vorstra_output_2",
897 post
->radiobutton_vorstra_output_2
,
898 (GtkDestroyNotify
) gtk_widget_unref
);
899 gtk_widget_show (post
->radiobutton_vorstra_output_2
);
900 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_output
),
901 post
->radiobutton_vorstra_output_2
,
906 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
909 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
912 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
915 (on_radiobutton_post_vorstra_output_enter
),
917 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
919 G_CALLBACK (on_widget_leave
),
921 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
923 G_CALLBACK (on_radiobutton_post_vorstra_output
),
929 post
->radiobutton_vorstra_output_3
=
930 gtk_radio_button_new_with_label (post
->vbox_vorstra_output_group
,
932 post
->vbox_vorstra_output_group
=
933 gtk_radio_button_group (GTK_RADIO_BUTTON
934 (post
->radiobutton_vorstra_output_3
));
935 gtk_widget_ref (post
->radiobutton_vorstra_output_3
);
936 gtk_object_set_data_full (GTK_OBJECT (main_window
),
937 "post_radiobutton_vorstra_output_3",
938 post
->radiobutton_vorstra_output_3
,
939 (GtkDestroyNotify
) gtk_widget_unref
);
940 gtk_widget_show (post
->radiobutton_vorstra_output_3
);
941 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_output
),
942 post
->radiobutton_vorstra_output_3
,
947 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
950 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
953 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
956 (on_radiobutton_post_vorstra_output_enter
),
958 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
960 G_CALLBACK (on_widget_leave
),
962 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
964 G_CALLBACK (on_radiobutton_post_vorstra_output
),
969 post
->frame_vorstra_diffscheme
= gtk_frame_new ( _("Differential scheme:"));
970 gtk_widget_ref (post
->frame_vorstra_diffscheme
);
971 gtk_object_set_data_full (GTK_OBJECT (main_window
),
972 "post_frame_vorstra_diffscheme",
973 post
->frame_vorstra_diffscheme
,
974 (GtkDestroyNotify
) gtk_widget_unref
);
975 gtk_widget_show (post
->frame_vorstra_diffscheme
);
976 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra
),
977 post
->frame_vorstra_diffscheme
,
981 gtk_frame_set_shadow_type (GTK_FRAME (post
->frame_vorstra_diffscheme
),
987 post
->vbox_vorstra_diffscheme
= gtk_vbox_new (FALSE
,
989 gtk_widget_ref (post
->vbox_vorstra_diffscheme
);
990 gtk_object_set_data_full (GTK_OBJECT (main_window
),
991 "post_vbox_vorstra_diffscheme",
992 post
->vbox_vorstra_diffscheme
,
993 (GtkDestroyNotify
) gtk_widget_unref
);
994 gtk_widget_show (post
->vbox_vorstra_diffscheme
);
995 gtk_container_add (GTK_CONTAINER (post
->frame_vorstra_diffscheme
),
996 post
->vbox_vorstra_diffscheme
);
1001 post
->radiobutton_vorstra_diffscheme_1
=
1002 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1004 post
->vbox_vorstra_diffscheme_group
=
1005 gtk_radio_button_group (GTK_RADIO_BUTTON
1006 (post
->radiobutton_vorstra_diffscheme_1
));
1007 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_1
);
1008 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1009 "post_radiobutton_vorstra_diffscheme_1",
1010 post
->radiobutton_vorstra_diffscheme_1
,
1011 (GtkDestroyNotify
) gtk_widget_unref
);
1012 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_1
);
1013 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1014 post
->radiobutton_vorstra_diffscheme_1
,
1019 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1022 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1025 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1028 (on_radiobutton_post_vorstra_diffscheme_enter
),
1030 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1032 G_CALLBACK (on_widget_leave
),
1034 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1037 (on_radiobutton_post_vorstra_diffscheme
),
1042 post
->radiobutton_vorstra_diffscheme_2
=
1043 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1044 _("Least squares"));
1045 post
->vbox_vorstra_diffscheme_group
=
1046 gtk_radio_button_group (GTK_RADIO_BUTTON
1047 (post
->radiobutton_vorstra_diffscheme_2
));
1048 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_2
);
1049 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1050 "post_radiobutton_vorstra_diffscheme_2",
1051 post
->radiobutton_vorstra_diffscheme_2
,
1052 (GtkDestroyNotify
) gtk_widget_unref
);
1053 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_2
);
1054 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1055 post
->radiobutton_vorstra_diffscheme_2
,
1060 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1063 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1066 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1069 (on_radiobutton_post_vorstra_diffscheme_enter
),
1071 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1073 G_CALLBACK (on_widget_leave
),
1075 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1078 (on_radiobutton_post_vorstra_diffscheme
),
1084 post
->radiobutton_vorstra_diffscheme_3
=
1085 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1087 post
->vbox_vorstra_diffscheme_group
=
1088 gtk_radio_button_group (GTK_RADIO_BUTTON
1089 (post
->radiobutton_vorstra_diffscheme_3
));
1090 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_3
);
1091 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1092 "post_radiobutton_vorstra_diffscheme_3",
1093 post
->radiobutton_vorstra_diffscheme_3
,
1094 (GtkDestroyNotify
) gtk_widget_unref
);
1096 *Define which button is switched on at start up time
1098 if (gl_post_par
->diff_type
== 2) {
1099 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1100 (post
->radiobutton_vorstra_diffscheme_3
),
1103 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_3
);
1104 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1105 post
->radiobutton_vorstra_diffscheme_3
,
1110 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1113 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1116 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1119 (on_radiobutton_post_vorstra_diffscheme_enter
),
1121 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1123 G_CALLBACK (on_widget_leave
),
1125 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1128 (on_radiobutton_post_vorstra_diffscheme
),
1134 post
->radiobutton_vorstra_diffscheme_4
=
1135 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1136 _("Circulation method"));
1137 post
->vbox_vorstra_diffscheme_group
=
1138 gtk_radio_button_group (GTK_RADIO_BUTTON
1139 (post
->radiobutton_vorstra_diffscheme_4
));
1140 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_4
);
1141 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1142 "post_radiobutton_vorstra_diffscheme_4",
1143 post
->radiobutton_vorstra_diffscheme_4
,
1144 (GtkDestroyNotify
) gtk_widget_unref
);
1146 *Define which button is switched on at start up time
1148 if (gl_post_par
->diff_type
== 3) {
1149 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1150 (post
->radiobutton_vorstra_diffscheme_4
),
1153 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_4
);
1154 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1155 post
->radiobutton_vorstra_diffscheme_4
,
1160 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1163 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1166 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1169 (on_radiobutton_post_vorstra_diffscheme_enter
),
1171 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1173 G_CALLBACK (on_widget_leave
),
1175 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1178 (on_radiobutton_post_vorstra_diffscheme
),
1183 * Define which button is switched on at start up time; moved to the
1184 * end of the tabulator as diff_scheme button Circulation might be
1185 * enabled or disabled
1187 if (gl_post_par
->operator_vorstra
== 0) {
1188 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1189 (post
->radiobutton_vorstra_output_1
),
1191 } else if (gl_post_par
->operator_vorstra
== 1) {
1192 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1193 (post
->radiobutton_vorstra_output_2
),
1195 } else if (gl_post_par
->operator_vorstra
== 2) {
1196 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1197 (post
->radiobutton_vorstra_output_3
),
1202 if (gl_post_par
->diff_type
== 0) {
1203 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1204 (post
->radiobutton_vorstra_diffscheme_1
),
1207 if (gl_post_par
->diff_type
== 1) {
1208 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1209 (post
->radiobutton_vorstra_diffscheme_2
),
1211 } else if (gl_post_par
->diff_type
== 2) {
1212 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1213 (post
->radiobutton_vorstra_diffscheme_3
),
1220 post
->button_vorstra
= gtk_button_new_with_label ( _("vorticity"));
1221 gtk_widget_ref (post
->button_vorstra
);
1222 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1223 "post_button_vorstra",
1224 post
->button_vorstra
,
1225 (GtkDestroyNotify
) gtk_widget_unref
);
1226 gtk_widget_show (post
->button_vorstra
);
1227 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra
),
1228 post
->button_vorstra
,
1232 gtk_tooltips_set_tip(gpiv
->tooltips
,
1233 post
->button_vorstra
,
1234 _("Calculates vorticity or strain magnitudes from a velocity field, obtained by PIV"),
1236 gtk_object_set_data (GTK_OBJECT (post
->button_vorstra
),
1239 g_signal_connect (GTK_OBJECT (post
->button_vorstra
),
1241 G_CALLBACK (on_button_post_vorstra_enter
),
1243 g_signal_connect (GTK_OBJECT (post
->button_vorstra
),
1245 G_CALLBACK (on_widget_leave
),
1247 g_signal_connect (GTK_OBJECT (post
->button_vorstra
),
1249 G_CALLBACK (on_button_post_vorstra
),