1 /*----------------------------------------------------------------------
3 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
6 Copyright (C) 2002, 2003, 2004 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.10 2007-11-23 16:24:08 gerber
30 * release 0.5.0: Kafka
32 * Revision 1.9 2007-01-29 11:27:44 gerber
33 * added image formats png, gif, tif png, bmp, improved buffer display
35 * Revision 1.8 2006-09-18 07:27:06 gerber
36 * *** empty log message ***
38 * Revision 1.7 2006/01/31 14:28:12 gerber
41 * Revision 1.5 2005/02/12 14:12:12 gerber
42 * Changed tabular names and titles
44 * Revision 1.4 2005/01/19 15:53:42 gerber
45 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
46 * by using RTAI and Realtime Linux, recording images from IEEE1394
47 * (Firewire) IIDC compliant camera's
49 * Revision 1.3 2004/06/14 21:19:23 gerber
50 * Image depth up to 16 bits.
51 * Improvement "single int" and "drag int" in Eval tab.
52 * Viewer's pop-up menu.
53 * Adaption for gpiv_matrix_* and gpiv_vector_*.
55 * See Changelog for further info.
57 * Revision 1.2 2003/08/22 15:24:52 gerber
58 * interactive spatial scaling
60 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
70 /* #include "console.h" */
72 #include "pivpost_interface.h"
76 create_pivpost (GnomeApp
*main_window
,
79 /*-----------------------------------------------------------------------------
82 PivPost
* post
= g_new0 (PivPost
, 1);
83 GpivConsole
* gpiv
= gtk_object_get_data (GTK_OBJECT (main_window
), "gpiv");
87 post
->vbox_label
= gtk_vbox_new (FALSE
,
89 gtk_widget_ref (post
->vbox_label
);
90 gtk_object_set_data_full (GTK_OBJECT (main_window
),
93 (GtkDestroyNotify
) gtk_widget_unref
);
94 gtk_widget_show (post
->vbox_label
);
95 gtk_container_add (GTK_CONTAINER (container
),
98 post
->label_title
= gtk_label_new(_("Piv data post processing"));
99 gtk_widget_ref(post
->label_title
);
100 gtk_object_set_data_full (GTK_OBJECT (main_window
),
103 (GtkDestroyNotify
) gtk_widget_unref
);
104 gtk_widget_show (post
->label_title
);
105 gtk_box_pack_start (GTK_BOX (post
->vbox_label
),
106 post
->label_title
, FALSE
,
114 post
->vbox_scroll
= gtk_vbox_new (FALSE
,
116 gtk_widget_ref (post
->vbox_scroll
);
117 gtk_object_set_data_full (GTK_OBJECT (main_window
),
120 (GtkDestroyNotify
) gtk_widget_unref
);
121 gtk_widget_show (post
->vbox_scroll
);
122 gtk_box_pack_start (GTK_BOX (post
->vbox_label
),
130 post
->scrolledwindow
= gtk_scrolled_window_new (NULL
,
132 gtk_widget_ref (post
->scrolledwindow
);
133 gtk_object_set_data_full (GTK_OBJECT (main_window
),
134 "post_scrolledwindow",
135 post
->scrolledwindow
,
136 (GtkDestroyNotify
) gtk_widget_unref
);
137 gtk_widget_show (post
->scrolledwindow
);
138 gtk_box_pack_start (GTK_BOX (post
->vbox_scroll
),
139 post
->scrolledwindow
,
143 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
144 (post
->scrolledwindow
),
147 /* GTK_POLICY_AUTOMATIC */ );
151 post
->viewport
= gtk_viewport_new (NULL
,
153 gtk_widget_ref (post
->viewport
);
154 gtk_object_set_data_full (GTK_OBJECT (main_window
),
157 (GtkDestroyNotify
) gtk_widget_unref
);
158 gtk_widget_show (post
->viewport
);
159 gtk_container_add (GTK_CONTAINER (post
->scrolledwindow
),
163 * main table for PIVPOST
165 post
->table
= gtk_table_new (2,
168 gtk_widget_ref (post
->table
);
169 gtk_object_set_data_full (GTK_OBJECT (main_window
),
172 (GtkDestroyNotify
) gtk_widget_unref
);
173 gtk_widget_show (post
->table
);
174 gtk_container_add (GTK_CONTAINER (post
->viewport
),
183 * Spinners use the adjustment from spinbutton_adj_imgh_*
185 post
->frame_scale
= gtk_frame_new ( _("Scaling"));
186 gtk_widget_ref (post
->frame_scale
);
187 gtk_object_set_data_full (GTK_OBJECT (main_window
),
190 (GtkDestroyNotify
) gtk_widget_unref
);
191 gtk_widget_show (post
->frame_scale
);
192 gtk_table_attach (GTK_TABLE (post
->table
),
198 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
199 (GtkAttachOptions
) (0),
205 post
->table_scale
= gtk_table_new (5,
208 gtk_widget_ref (post
->table_scale
);
209 gtk_object_set_data_full (GTK_OBJECT (main_window
),
212 (GtkDestroyNotify
) gtk_widget_unref
);
213 gtk_widget_show (post
->table_scale
);
214 gtk_container_add (GTK_CONTAINER (post
->frame_scale
),
219 *spinner for spatial scale "sscale"
221 post
->label_sscale
= gtk_label_new ( _("spatial scale (mm/pixels): "));
222 gtk_widget_ref (post
->label_sscale
);
223 gtk_object_set_data_full (GTK_OBJECT (main_window
),
226 (GtkDestroyNotify
) gtk_widget_unref
);
227 gtk_widget_show (post
->label_sscale
);
228 gtk_table_attach (GTK_TABLE (post
->table_scale
),
234 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
235 (GtkAttachOptions
) (0),
244 /* spinbutton_adj_post_sscale = */
245 /* gtk_adjustment_new (gl_post_par.s_scale, 0, 1279, 1, 100, 100); */
247 * end of KEEP DISABLED
249 post
->spinbutton_sscale
=
250 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_sscale
),
253 gtk_widget_ref (post
->spinbutton_sscale
);
254 gtk_widget_show (post
->spinbutton_sscale
);
255 gtk_table_attach (GTK_TABLE (post
->table_scale
),
256 post
->spinbutton_sscale
,
261 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
262 (GtkAttachOptions
) (0),
265 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_sscale
),
267 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_sscale
),
270 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_sscale
),
273 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_sscale
),
276 g_signal_connect (GTK_OBJECT (post
->spinbutton_sscale
),
278 G_CALLBACK (on_spinbutton_post_scale
),
279 post
->spinbutton_sscale
);
283 *spinner for time scale "tscale"
285 post
->label_tscale
= gtk_label_new ( _("time scale (ms): "));
286 gtk_widget_ref (post
->label_tscale
);
287 gtk_object_set_data_full (GTK_OBJECT (main_window
),
290 (GtkDestroyNotify
) gtk_widget_unref
);
291 gtk_widget_show (post
->label_tscale
);
292 gtk_table_attach (GTK_TABLE (post
->table_scale
),
298 (GtkAttachOptions
) (GTK_FILL
),
299 (GtkAttachOptions
) (0),
308 /* spinbutton_adj_post_tscale = */
309 /* gtk_adjustment_new (gl_post_par.t_scale, 0, 1279, 1, 100, 100); */
311 * end of KEEP DISABLED
313 post
->spinbutton_tscale
=
314 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_tscale
),
317 gtk_widget_ref (post
->spinbutton_tscale
);
318 gtk_widget_show (post
->spinbutton_tscale
);
319 gtk_table_attach (GTK_TABLE (post
->table_scale
),
320 post
->spinbutton_tscale
,
325 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
326 (GtkAttachOptions
) (0),
329 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_tscale
),
331 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_tscale
),
334 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_tscale
),
337 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_tscale
),
340 g_signal_connect (GTK_OBJECT (post
->spinbutton_tscale
),
342 G_CALLBACK (on_spinbutton_post_scale
),
343 post
->spinbutton_tscale
);
348 * spinner for column position
350 post
->label_colpos
= gtk_label_new ( _("pos. of col #0 (m): "));
351 gtk_widget_ref (post
->label_colpos
);
352 gtk_object_set_data_full (GTK_OBJECT (main_window
),
355 (GtkDestroyNotify
) gtk_widget_unref
);
356 gtk_widget_show (post
->label_colpos
);
357 gtk_table_attach (GTK_TABLE (post
->table_scale
),
363 (GtkAttachOptions
) (GTK_FILL
),
364 (GtkAttachOptions
) (0),
373 /* spinbutton_adj_post_colpos = */
374 /* gtk_adjustment_new (gl_post_par.z_off_x, 0, Z_OFF_MAX, 1, 100, */
377 * end of KEEP DISABLED
379 post
->spinbutton_colpos
=
380 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_colpos
),
383 gtk_widget_ref (post
->spinbutton_colpos
);
384 gtk_widget_show (post
->spinbutton_colpos
);
385 gtk_table_attach (GTK_TABLE (post
->table_scale
),
386 post
->spinbutton_colpos
,
391 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
392 (GtkAttachOptions
) (0),
395 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_colpos
),
397 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_colpos
),
400 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_colpos
),
403 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_colpos
),
406 g_signal_connect (GTK_OBJECT (post
->spinbutton_colpos
),
408 G_CALLBACK (on_spinbutton_post_scale
),
409 post
->spinbutton_colpos
);
414 * spinner for row position
416 post
->label_rowpos
= gtk_label_new ( _("pos. of row #0 (m): "));
417 gtk_widget_ref (post
->label_rowpos
);
418 gtk_object_set_data_full (GTK_OBJECT (main_window
),
421 (GtkDestroyNotify
) gtk_widget_unref
);
422 gtk_widget_show (post
->label_rowpos
);
423 gtk_table_attach (GTK_TABLE (post
->table_scale
),
429 (GtkAttachOptions
) (GTK_FILL
),
430 (GtkAttachOptions
) (0),
439 /* spinbutton_adj_post_rowpos = */
440 /* gtk_adjustment_new (gl_post_par.z_off_y, 0, Z_OFF_MAX, 1, 100, */
443 * end of KEEP DISABLED
445 post
->spinbutton_rowpos
=
446 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv
->imgh
->spinbutton_adj_rowpos
),
449 gtk_widget_ref (post
->spinbutton_rowpos
);
450 gtk_widget_show (post
->spinbutton_rowpos
);
451 gtk_table_attach (GTK_TABLE (post
->table_scale
),
452 post
->spinbutton_rowpos
,
457 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
458 (GtkAttachOptions
) (0),
461 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_rowpos
),
463 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_rowpos
),
466 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_rowpos
),
469 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_rowpos
),
472 g_signal_connect (GTK_OBJECT (post
->spinbutton_rowpos
),
474 G_CALLBACK (on_spinbutton_post_scale
),
475 post
->spinbutton_rowpos
);
479 post
->button_scale
= gtk_button_new_with_label ( _("scale"));
480 gtk_widget_ref (post
->button_scale
);
481 gtk_object_set_data_full (GTK_OBJECT (main_window
),
484 (GtkDestroyNotify
) gtk_widget_unref
);
485 gtk_widget_show (post
->button_scale
);
486 gtk_table_attach (GTK_TABLE (post
->table_scale
),
492 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
493 (GtkAttachOptions
) (GTK_FILL
),
496 gtk_tooltips_set_tip(gpiv
->tooltips
,
498 _("Calculates time and spatial scaled particle "
499 "displacements (i.e. velocities) from a PIV displacement field, and their "
503 gtk_object_set_data (GTK_OBJECT (post
->button_scale
),
506 g_signal_connect (GTK_OBJECT (post
->button_scale
),
509 (on_button_post_scale_enter
),
511 g_signal_connect (GTK_OBJECT (post
->button_scale
),
513 G_CALLBACK (on_widget_leave
),
515 g_signal_connect (GTK_OBJECT (post
->button_scale
),
517 G_CALLBACK (on_button_post_scale
),
522 * Spatial average frame
525 post
->frame_savg
= gtk_frame_new ( _("Offset / Spatial statistics"));
526 gtk_widget_ref (post
->frame_savg
);
527 gtk_object_set_data_full (GTK_OBJECT (main_window
),
530 (GtkDestroyNotify
) gtk_widget_unref
);
531 gtk_widget_show (post
->frame_savg
);
532 gtk_table_attach (GTK_TABLE (post
->table
),
538 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
539 (GtkAttachOptions
) (0),
545 post
->table_savg
= gtk_table_new (2,
548 gtk_widget_ref (post
->table_savg
);
549 gtk_object_set_data_full (GTK_OBJECT (main_window
),
552 (GtkDestroyNotify
) gtk_widget_unref
);
553 gtk_widget_show (post
->table_savg
);
554 gtk_container_add (GTK_CONTAINER (post
->frame_savg
),
559 *spinner for spatial average horizontal velocity U-avg
561 post
->label_suavg
= gtk_label_new ( _("dx (px), U (m/s): "));
562 gtk_widget_ref (post
->label_suavg
);
563 gtk_object_set_data_full (GTK_OBJECT (main_window
),
566 (GtkDestroyNotify
) gtk_widget_unref
);
567 gtk_widget_show (post
->label_suavg
);
568 gtk_table_attach (GTK_TABLE (post
->table_savg
),
574 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
575 (GtkAttachOptions
) (0),
581 post
->spinbutton_adj_suavg
=
582 /* ARG1: gl_post_par.s_savg */
583 /* gtk_adjustment_new (0. , */
589 gtk_adjustment_new (0.0 ,
595 post
->spinbutton_suavg
=
596 gtk_spin_button_new (GTK_ADJUSTMENT (post
->spinbutton_adj_suavg
),
599 gtk_widget_ref (post
->spinbutton_suavg
);
600 gtk_widget_show (post
->spinbutton_suavg
);
601 gtk_table_attach (GTK_TABLE (post
->table_savg
),
602 post
->spinbutton_suavg
,
607 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
608 (GtkAttachOptions
) (0),
611 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_suavg
),
613 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_suavg
),
618 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_suavg
),
620 g_signal_connect (GTK_OBJECT (post
->spinbutton_suavg
),
622 G_CALLBACK (on_spinbutton_post_suavg
),
623 post
->spinbutton_suavg
);
625 * end of KEEP DISABLED
631 * spinner for spatial average vertical velocity V-avg
633 post
->label_svavg
= gtk_label_new ( _("dy (px), V (m/s): "));
634 gtk_widget_ref (post
->label_svavg
);
635 gtk_object_set_data_full (GTK_OBJECT (main_window
),
638 (GtkDestroyNotify
) gtk_widget_unref
);
639 gtk_widget_show (post
->label_svavg
);
640 gtk_table_attach (GTK_TABLE (post
->table_savg
),
646 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
647 (GtkAttachOptions
) (0),
653 post
->spinbutton_adj_svavg
=
654 /* ARG1: gl_post_par.s_savg */
655 gtk_adjustment_new (0.0 ,
661 post
->spinbutton_svavg
=
662 gtk_spin_button_new (GTK_ADJUSTMENT (post
->spinbutton_adj_svavg
),
665 gtk_widget_ref (post
->spinbutton_svavg
);
666 gtk_widget_show (post
->spinbutton_svavg
);
667 gtk_table_attach (GTK_TABLE (post
->table_savg
),
668 post
->spinbutton_svavg
,
673 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
674 (GtkAttachOptions
) (0),
677 gtk_entry_set_editable (GTK_ENTRY (post
->spinbutton_svavg
),
679 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post
->spinbutton_svavg
),
684 gtk_object_set_data (GTK_OBJECT (post
->spinbutton_svavg
),
686 g_signal_connect (GTK_OBJECT (post
->spinbutton_svavg
),
688 G_CALLBACK (on_spinbutton_post_svavg
),
689 post
->spinbutton_svavg
);
691 * end of KEEP DISABLED
696 * button to calculate averages
698 post
->button_savg
= gtk_button_new_with_label ( _("average"));
699 gtk_widget_ref (post
->button_savg
);
700 gtk_object_set_data_full (GTK_OBJECT (main_window
),
703 (GtkDestroyNotify
) gtk_widget_unref
);
704 gtk_widget_show (post
->button_savg
);
705 gtk_table_attach (GTK_TABLE (post
->table_savg
),
711 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
712 (GtkAttachOptions
) (0),
715 gtk_tooltips_set_tip(gpiv
->tooltips
, post
->button_savg
,
716 _("Calculates spatial average particle displacements "
717 "or velocities from a velocity field, obtained from PIV data"),
720 gtk_object_set_data (GTK_OBJECT (post
->button_savg
),
723 g_signal_connect (GTK_OBJECT (post
->button_savg
),
725 G_CALLBACK (on_button_post_savg_enter
),
727 g_signal_connect (GTK_OBJECT (post
->button_savg
),
729 G_CALLBACK (on_widget_leave
),
731 g_signal_connect (GTK_OBJECT (post
->button_savg
),
733 G_CALLBACK (on_button_post_savg
),
738 * button to subtract averages or zero offset displacements / velocities
740 post
->button_subavg
= gtk_button_new_with_label ( _("subtract"));
741 gtk_widget_ref (post
->button_subavg
);
742 gtk_object_set_data_full (GTK_OBJECT (main_window
),
743 "post_button_subavg",
745 (GtkDestroyNotify
) gtk_widget_unref
);
746 gtk_widget_show (post
->button_subavg
);
747 gtk_table_attach (GTK_TABLE (post
->table_savg
),
753 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
754 (GtkAttachOptions
) (0),
757 gtk_tooltips_set_tip(gpiv
->tooltips
,
759 _("Subtracts the spatial averages or offset "
760 "displacements / velocities, from each estimator"),
763 gtk_object_set_data (GTK_OBJECT (post
->button_subavg
),
766 g_signal_connect (GTK_OBJECT (post
->button_subavg
),
768 G_CALLBACK (on_button_post_subavg_enter
),
770 g_signal_connect (GTK_OBJECT (post
->button_subavg
),
772 G_CALLBACK (on_widget_leave
),
774 g_signal_connect (GTK_OBJECT (post
->button_subavg
),
776 G_CALLBACK (on_button_post_subavg
),
783 post
->frame_vorstra
= gtk_frame_new ( _("Vorticity & strain"));
784 gtk_widget_ref (post
->frame_vorstra
);
785 gtk_object_set_data_full (GTK_OBJECT (main_window
),
786 "post_frame_vorstra",
788 (GtkDestroyNotify
) gtk_widget_unref
);
789 gtk_widget_show (post
->frame_vorstra
);
790 gtk_table_attach (GTK_TABLE (post
->table
),
796 (GtkAttachOptions
) (GTK_FILL
),
797 (GtkAttachOptions
) (0),
803 post
->vbox_vorstra
= gtk_vbox_new (FALSE
,
805 gtk_widget_ref (post
->vbox_vorstra
);
806 gtk_object_set_data_full (GTK_OBJECT (main_window
),
809 (GtkDestroyNotify
) gtk_widget_unref
);
810 gtk_widget_show (post
->vbox_vorstra
);
811 gtk_container_add (GTK_CONTAINER (post
->frame_vorstra
),
816 post
->frame_vorstra_output
= gtk_frame_new ( _("Output:"));
817 gtk_widget_ref (post
->frame_vorstra_output
);
818 gtk_object_set_data_full (GTK_OBJECT (main_window
),
819 "post_frame_vorstra_output",
820 post
->frame_vorstra_output
,
821 (GtkDestroyNotify
) gtk_widget_unref
);
822 gtk_widget_show (post
->frame_vorstra_output
);
823 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra
),
824 post
->frame_vorstra_output
,
828 gtk_frame_set_shadow_type (GTK_FRAME (post
->frame_vorstra_output
),
833 post
->vbox_vorstra_output
= gtk_vbox_new (FALSE
,
835 gtk_widget_ref (post
->vbox_vorstra_output
);
836 gtk_object_set_data_full (GTK_OBJECT (main_window
),
837 "post_vbox_vorstra_output",
838 post
->vbox_vorstra_output
,
839 (GtkDestroyNotify
) gtk_widget_unref
);
840 gtk_widget_show (post
->vbox_vorstra_output
);
841 gtk_container_add (GTK_CONTAINER (post
->frame_vorstra_output
),
842 post
->vbox_vorstra_output
);
846 post
->radiobutton_vorstra_output_1
=
847 gtk_radio_button_new_with_label (post
->vbox_vorstra_output_group
,
849 post
->vbox_vorstra_output_group
=
850 gtk_radio_button_group (GTK_RADIO_BUTTON
851 (post
->radiobutton_vorstra_output_1
));
852 gtk_widget_ref (post
->radiobutton_vorstra_output_1
);
853 gtk_object_set_data_full (GTK_OBJECT (main_window
),
854 "post_radiobutton_vorstra_output_1",
855 post
->radiobutton_vorstra_output_1
,
856 (GtkDestroyNotify
) gtk_widget_unref
);
857 gtk_widget_show (post
->radiobutton_vorstra_output_1
);
858 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_output
),
859 post
->radiobutton_vorstra_output_1
,
864 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
867 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
870 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
873 (on_radiobutton_post_vorstra_output_enter
),
875 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
877 G_CALLBACK (on_widget_leave
),
879 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_1
),
881 G_CALLBACK (on_radiobutton_post_vorstra_output
),
887 post
->radiobutton_vorstra_output_2
=
888 gtk_radio_button_new_with_label (post
->vbox_vorstra_output_group
,
890 post
->vbox_vorstra_output_group
=
891 gtk_radio_button_group (GTK_RADIO_BUTTON
892 (post
->radiobutton_vorstra_output_2
));
893 gtk_widget_ref (post
->radiobutton_vorstra_output_2
);
894 gtk_object_set_data_full (GTK_OBJECT (main_window
),
895 "post_radiobutton_vorstra_output_2",
896 post
->radiobutton_vorstra_output_2
,
897 (GtkDestroyNotify
) gtk_widget_unref
);
898 gtk_widget_show (post
->radiobutton_vorstra_output_2
);
899 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_output
),
900 post
->radiobutton_vorstra_output_2
,
905 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
908 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
911 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
914 (on_radiobutton_post_vorstra_output_enter
),
916 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
918 G_CALLBACK (on_widget_leave
),
920 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_2
),
922 G_CALLBACK (on_radiobutton_post_vorstra_output
),
928 post
->radiobutton_vorstra_output_3
=
929 gtk_radio_button_new_with_label (post
->vbox_vorstra_output_group
,
931 post
->vbox_vorstra_output_group
=
932 gtk_radio_button_group (GTK_RADIO_BUTTON
933 (post
->radiobutton_vorstra_output_3
));
934 gtk_widget_ref (post
->radiobutton_vorstra_output_3
);
935 gtk_object_set_data_full (GTK_OBJECT (main_window
),
936 "post_radiobutton_vorstra_output_3",
937 post
->radiobutton_vorstra_output_3
,
938 (GtkDestroyNotify
) gtk_widget_unref
);
939 gtk_widget_show (post
->radiobutton_vorstra_output_3
);
940 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_output
),
941 post
->radiobutton_vorstra_output_3
,
946 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
949 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
952 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
955 (on_radiobutton_post_vorstra_output_enter
),
957 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
959 G_CALLBACK (on_widget_leave
),
961 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_output_3
),
963 G_CALLBACK (on_radiobutton_post_vorstra_output
),
968 post
->frame_vorstra_diffscheme
= gtk_frame_new ( _("Differential scheme:"));
969 gtk_widget_ref (post
->frame_vorstra_diffscheme
);
970 gtk_object_set_data_full (GTK_OBJECT (main_window
),
971 "post_frame_vorstra_diffscheme",
972 post
->frame_vorstra_diffscheme
,
973 (GtkDestroyNotify
) gtk_widget_unref
);
974 gtk_widget_show (post
->frame_vorstra_diffscheme
);
975 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra
),
976 post
->frame_vorstra_diffscheme
,
980 gtk_frame_set_shadow_type (GTK_FRAME (post
->frame_vorstra_diffscheme
),
986 post
->vbox_vorstra_diffscheme
= gtk_vbox_new (FALSE
,
988 gtk_widget_ref (post
->vbox_vorstra_diffscheme
);
989 gtk_object_set_data_full (GTK_OBJECT (main_window
),
990 "post_vbox_vorstra_diffscheme",
991 post
->vbox_vorstra_diffscheme
,
992 (GtkDestroyNotify
) gtk_widget_unref
);
993 gtk_widget_show (post
->vbox_vorstra_diffscheme
);
994 gtk_container_add (GTK_CONTAINER (post
->frame_vorstra_diffscheme
),
995 post
->vbox_vorstra_diffscheme
);
1000 post
->radiobutton_vorstra_diffscheme_1
=
1001 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1003 post
->vbox_vorstra_diffscheme_group
=
1004 gtk_radio_button_group (GTK_RADIO_BUTTON
1005 (post
->radiobutton_vorstra_diffscheme_1
));
1006 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_1
);
1007 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1008 "post_radiobutton_vorstra_diffscheme_1",
1009 post
->radiobutton_vorstra_diffscheme_1
,
1010 (GtkDestroyNotify
) gtk_widget_unref
);
1011 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_1
);
1012 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1013 post
->radiobutton_vorstra_diffscheme_1
,
1018 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1021 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1024 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1027 (on_radiobutton_post_vorstra_diffscheme_enter
),
1029 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1031 G_CALLBACK (on_widget_leave
),
1033 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_1
),
1036 (on_radiobutton_post_vorstra_diffscheme
),
1041 post
->radiobutton_vorstra_diffscheme_2
=
1042 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1043 _("Least squares"));
1044 post
->vbox_vorstra_diffscheme_group
=
1045 gtk_radio_button_group (GTK_RADIO_BUTTON
1046 (post
->radiobutton_vorstra_diffscheme_2
));
1047 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_2
);
1048 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1049 "post_radiobutton_vorstra_diffscheme_2",
1050 post
->radiobutton_vorstra_diffscheme_2
,
1051 (GtkDestroyNotify
) gtk_widget_unref
);
1052 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_2
);
1053 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1054 post
->radiobutton_vorstra_diffscheme_2
,
1059 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1062 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1065 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1068 (on_radiobutton_post_vorstra_diffscheme_enter
),
1070 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1072 G_CALLBACK (on_widget_leave
),
1074 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_2
),
1077 (on_radiobutton_post_vorstra_diffscheme
),
1083 post
->radiobutton_vorstra_diffscheme_3
=
1084 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1086 post
->vbox_vorstra_diffscheme_group
=
1087 gtk_radio_button_group (GTK_RADIO_BUTTON
1088 (post
->radiobutton_vorstra_diffscheme_3
));
1089 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_3
);
1090 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1091 "post_radiobutton_vorstra_diffscheme_3",
1092 post
->radiobutton_vorstra_diffscheme_3
,
1093 (GtkDestroyNotify
) gtk_widget_unref
);
1095 *Define which button is switched on at start up time
1097 if (gl_post_par
->diff_type
== 2) {
1098 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1099 (post
->radiobutton_vorstra_diffscheme_3
),
1102 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_3
);
1103 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1104 post
->radiobutton_vorstra_diffscheme_3
,
1109 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1112 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1115 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1118 (on_radiobutton_post_vorstra_diffscheme_enter
),
1120 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1122 G_CALLBACK (on_widget_leave
),
1124 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_3
),
1127 (on_radiobutton_post_vorstra_diffscheme
),
1133 post
->radiobutton_vorstra_diffscheme_4
=
1134 gtk_radio_button_new_with_label (post
->vbox_vorstra_diffscheme_group
,
1135 _("Circulation method"));
1136 post
->vbox_vorstra_diffscheme_group
=
1137 gtk_radio_button_group (GTK_RADIO_BUTTON
1138 (post
->radiobutton_vorstra_diffscheme_4
));
1139 gtk_widget_ref (post
->radiobutton_vorstra_diffscheme_4
);
1140 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1141 "post_radiobutton_vorstra_diffscheme_4",
1142 post
->radiobutton_vorstra_diffscheme_4
,
1143 (GtkDestroyNotify
) gtk_widget_unref
);
1145 *Define which button is switched on at start up time
1147 if (gl_post_par
->diff_type
== 3) {
1148 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1149 (post
->radiobutton_vorstra_diffscheme_4
),
1152 gtk_widget_show (post
->radiobutton_vorstra_diffscheme_4
);
1153 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra_diffscheme
),
1154 post
->radiobutton_vorstra_diffscheme_4
,
1159 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1162 gtk_object_set_data (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1165 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1168 (on_radiobutton_post_vorstra_diffscheme_enter
),
1170 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1172 G_CALLBACK (on_widget_leave
),
1174 g_signal_connect (GTK_OBJECT (post
->radiobutton_vorstra_diffscheme_4
),
1177 (on_radiobutton_post_vorstra_diffscheme
),
1182 * Define which button is switched on at start up time; moved to the
1183 * end of the tabulator as diff_scheme button Circulation might be
1184 * enabled or disabled
1186 if (gl_post_par
->operator_vorstra
== 0) {
1187 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1188 (post
->radiobutton_vorstra_output_1
),
1190 } else if (gl_post_par
->operator_vorstra
== 1) {
1191 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1192 (post
->radiobutton_vorstra_output_2
),
1194 } else if (gl_post_par
->operator_vorstra
== 2) {
1195 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1196 (post
->radiobutton_vorstra_output_3
),
1201 if (gl_post_par
->diff_type
== 0) {
1202 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1203 (post
->radiobutton_vorstra_diffscheme_1
),
1206 if (gl_post_par
->diff_type
== 1) {
1207 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1208 (post
->radiobutton_vorstra_diffscheme_2
),
1210 } else if (gl_post_par
->diff_type
== 2) {
1211 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1212 (post
->radiobutton_vorstra_diffscheme_3
),
1219 post
->button_vorstra
= gtk_button_new_with_label ( _("vorticity"));
1220 gtk_widget_ref (post
->button_vorstra
);
1221 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1222 "post_button_vorstra",
1223 post
->button_vorstra
,
1224 (GtkDestroyNotify
) gtk_widget_unref
);
1225 gtk_widget_show (post
->button_vorstra
);
1226 gtk_box_pack_start (GTK_BOX (post
->vbox_vorstra
),
1227 post
->button_vorstra
,
1231 gtk_tooltips_set_tip(gpiv
->tooltips
,
1232 post
->button_vorstra
,
1233 _("Calculates vorticity or strain magnitudes from a velocity field, obtained by PIV"),
1235 gtk_object_set_data (GTK_OBJECT (post
->button_vorstra
),
1238 g_signal_connect (GTK_OBJECT (post
->button_vorstra
),
1240 G_CALLBACK (on_button_post_vorstra_enter
),
1242 g_signal_connect (GTK_OBJECT (post
->button_vorstra
),
1244 G_CALLBACK (on_widget_leave
),
1246 g_signal_connect (GTK_OBJECT (post
->button_vorstra
),
1248 G_CALLBACK (on_button_post_vorstra
),