Initial revision
[gpiv.git] / src / pivpost_interface.c
blob973e6ebb22bf7dcc62dcff015e726593e4ce15dc
1 /*----------------------------------------------------------------------
3 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
4 libraries.
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)
13 any later version.
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
30 * Initial revision
34 #ifdef HAVE_CONFIG_H
35 # include <config.h>
36 #endif
38 #include "gpiv_gtk.h"
39 #include "console.h"
40 #include "pivpost_interface.h"
41 #include "pivpost.h"
43 PivPost*
44 create_pivpost (GtkWidget *main_window,
45 GtkWidget *container)
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,
55 0);
56 gtk_widget_ref(post->vbox_label);
57 gtk_object_set_data_full(GTK_OBJECT(main_window),
58 "post_vbox_label",
59 post->vbox_label,
60 (GtkDestroyNotify) gtk_widget_unref);
61 gtk_widget_show(post->vbox_label);
62 gtk_container_add(GTK_CONTAINER(container),
63 post->vbox_label);
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),
68 "post_label_title",
69 post->label_title,
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,
74 FALSE,
75 0);
79 * Scrolled window
81 post->vbox_scroll = gtk_vbox_new(FALSE,
82 0);
83 gtk_widget_ref(post->vbox_scroll);
84 gtk_object_set_data_full(GTK_OBJECT(main_window),
85 "post_vbox_scroll",
86 post->vbox_scroll,
87 (GtkDestroyNotify) gtk_widget_unref);
88 gtk_widget_show(post->vbox_scroll);
89 gtk_box_pack_start(GTK_BOX(post->vbox_label),
90 post->vbox_scroll,
91 TRUE,
92 TRUE,
93 0);
97 post->scrolledwindow = gtk_scrolled_window_new(NULL,
98 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,
107 TRUE,
108 TRUE,
110 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
111 (post->scrolledwindow),
112 GTK_POLICY_NEVER,
113 GTK_POLICY_NEVER
114 /* GTK_POLICY_AUTOMATIC */ );
118 post->viewport = gtk_viewport_new(NULL,
119 NULL);
120 gtk_widget_ref(post->viewport);
121 gtk_object_set_data_full(GTK_OBJECT(main_window),
122 "post_viewport",
123 post->viewport,
124 (GtkDestroyNotify) gtk_widget_unref);
125 gtk_widget_show(post->viewport);
126 gtk_container_add(GTK_CONTAINER(post->scrolledwindow),
127 post->viewport);
130 * main table for PIVPOST
132 post->table = gtk_table_new(2,
134 FALSE);
135 gtk_widget_ref(post->table);
136 gtk_object_set_data_full(GTK_OBJECT(main_window),
137 "post_table",
138 post->table,
139 (GtkDestroyNotify) gtk_widget_unref);
140 gtk_widget_show(post->table);
141 gtk_container_add(GTK_CONTAINER(post->viewport),
142 post->table);
147 * Scale frame
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),
155 "post_frame_scale",
156 post->frame_scale,
157 (GtkDestroyNotify) gtk_widget_unref);
158 gtk_widget_show(post->frame_scale);
159 gtk_table_attach(GTK_TABLE(post->table),
160 post->frame_scale,
165 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
166 (GtkAttachOptions) (0),
172 post->table_scale = gtk_table_new(5,
174 FALSE);
175 gtk_widget_ref(post->table_scale);
176 gtk_object_set_data_full(GTK_OBJECT(main_window),
177 "post_table_scale",
178 post->table_scale,
179 (GtkDestroyNotify) gtk_widget_unref);
180 gtk_widget_show(post->table_scale);
181 gtk_container_add(GTK_CONTAINER(post->frame_scale),
182 post->table_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),
191 "post_label_sscale",
192 post->label_sscale,
193 (GtkDestroyNotify) gtk_widget_unref);
194 gtk_widget_show(post->label_sscale);
195 gtk_table_attach(GTK_TABLE(post->table_scale),
196 post->label_sscale,
201 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
202 (GtkAttachOptions) (0),
209 * KEEP DISABLED
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),
233 TRUE);
234 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post->spinbutton_sscale),
235 TRUE);
237 gtk_object_set_data(GTK_OBJECT(post->spinbutton_sscale),
238 "post",
239 post);
240 gtk_object_set_data(GTK_OBJECT(post->spinbutton_sscale),
241 "var_type",
242 "3");
243 gtk_signal_connect(GTK_OBJECT(post->spinbutton_sscale),
244 "changed",
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),
255 "post_label_tscale",
256 post->label_tscale,
257 (GtkDestroyNotify) gtk_widget_unref);
258 gtk_widget_show(post->label_tscale);
259 gtk_table_attach(GTK_TABLE(post->table_scale),
260 post->label_tscale,
265 (GtkAttachOptions) (GTK_FILL),
266 (GtkAttachOptions) (0),
273 * KEEP DISABLED
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),
297 TRUE);
298 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post->spinbutton_tscale),
299 TRUE);
301 gtk_object_set_data(GTK_OBJECT(post->spinbutton_tscale),
302 "post",
303 post);
304 gtk_object_set_data(GTK_OBJECT(post->spinbutton_tscale),
305 "var_type",
306 "4");
307 gtk_signal_connect(GTK_OBJECT(post->spinbutton_tscale),
308 "changed",
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),
320 "post_label_colpos",
321 post->label_colpos,
322 (GtkDestroyNotify) gtk_widget_unref);
323 gtk_widget_show(post->label_colpos);
324 gtk_table_attach(GTK_TABLE(post->table_scale),
325 post->label_colpos,
330 (GtkAttachOptions) (GTK_FILL),
331 (GtkAttachOptions) (0),
338 * KEEP DISABLED
340 /* spinbutton_adj_post_colpos = */
341 /* gtk_adjustment_new(piv_post_par.z_off_x, 0, Z_OFF_MAX, 1, 100, */
342 /* 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),
363 TRUE);
364 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post->spinbutton_colpos),
365 TRUE);
367 gtk_object_set_data(GTK_OBJECT(post->spinbutton_colpos),
368 "post",
369 post);
370 gtk_object_set_data(GTK_OBJECT(post->spinbutton_colpos),
371 "var_type",
372 "1");
373 gtk_signal_connect(GTK_OBJECT(post->spinbutton_colpos),
374 "changed",
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),
386 "post_label_rowpos",
387 post->label_rowpos,
388 (GtkDestroyNotify) gtk_widget_unref);
389 gtk_widget_show(post->label_rowpos);
390 gtk_table_attach(GTK_TABLE(post->table_scale),
391 post->label_rowpos,
396 (GtkAttachOptions) (GTK_FILL),
397 (GtkAttachOptions) (0),
404 * KEEP DISABLED
406 /* spinbutton_adj_post_rowpos = */
407 /* gtk_adjustment_new(piv_post_par.z_off_y, 0, Z_OFF_MAX, 1, 100, */
408 /* 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),
429 TRUE);
430 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post->spinbutton_rowpos),
431 TRUE);
433 gtk_object_set_data(GTK_OBJECT(post->spinbutton_rowpos),
434 "post",
435 post);
436 gtk_object_set_data(GTK_OBJECT(post->spinbutton_rowpos),
437 "var_type",
438 "2");
439 gtk_signal_connect(GTK_OBJECT(post->spinbutton_rowpos),
440 "changed",
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),
449 "post_button_scale",
450 post->button_scale,
451 (GtkDestroyNotify) gtk_widget_unref);
452 gtk_widget_show(post->button_scale);
453 gtk_table_attach(GTK_TABLE(post->table_scale),
454 post->button_scale,
459 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
460 (GtkAttachOptions) (GTK_FILL),
463 gtk_tooltips_set_tip(post->tooltips,
464 post->button_scale,
465 _("Calculates time and spatial scaled particle "
466 "displacements (i.e. velocities) from a PIV displacement field, and their "
467 "scaled positions"),
468 NULL);
470 gtk_object_set_data(GTK_OBJECT(post->button_scale),
471 "post",
472 post);
473 gtk_signal_connect(GTK_OBJECT(post->button_scale),
474 "enter",
475 GTK_SIGNAL_FUNC
476 (on_button_post_scale_enter),
477 NULL);
478 gtk_signal_connect(GTK_OBJECT(post->button_scale),
479 "leave",
480 GTK_SIGNAL_FUNC(on_widget_leave),
481 NULL);
482 gtk_signal_connect(GTK_OBJECT(post->button_scale),
483 "clicked",
484 GTK_SIGNAL_FUNC(on_button_post_scale),
485 NULL);
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),
495 "post_frame_savg",
496 post->frame_savg,
497 (GtkDestroyNotify) gtk_widget_unref);
498 gtk_widget_show(post->frame_savg);
499 gtk_table_attach(GTK_TABLE(post->table),
500 post->frame_savg,
505 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
506 (GtkAttachOptions) (0),
512 post->table_savg = gtk_table_new(2,
514 FALSE);
515 gtk_widget_ref(post->table_savg);
516 gtk_object_set_data_full(GTK_OBJECT(main_window),
517 "post_table_savg",
518 post->table_savg,
519 (GtkDestroyNotify) gtk_widget_unref);
520 gtk_widget_show(post->table_savg);
521 gtk_container_add(GTK_CONTAINER(post->frame_savg),
522 post->table_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),
531 "post_label_suavg",
532 post->label_suavg,
533 (GtkDestroyNotify) gtk_widget_unref);
534 gtk_widget_show(post->label_suavg);
535 gtk_table_attach(GTK_TABLE(post->table_savg),
536 post->label_suavg,
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. ,
553 0.01,
554 0.1,
555 10.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),
573 TRUE);
574 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post->spinbutton_suavg),
575 TRUE);
577 * KEEP DISABLED
579 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_suavg), */
580 /* "post", post); */
581 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_suavg), */
582 /* "var_type", "3"); */
583 /* gtk_signal_connect(GTK_OBJECT(post->spinbutton_suavg), */
584 /* "changed", */
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),
599 "post_label_svavg",
600 post->label_svavg,
601 (GtkDestroyNotify) gtk_widget_unref);
602 gtk_widget_show(post->label_svavg);
603 gtk_table_attach(GTK_TABLE(post->table_savg),
604 post->label_svavg,
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 ,
620 100,
621 0.1,
622 0.1,
623 10.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),
641 TRUE);
642 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(post->spinbutton_svavg),
643 TRUE);
645 * KEEP DISABLED
647 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_svavg), */
648 /* "var_type", "3"); */
649 /* gtk_object_set_data(GTK_OBJECT(post->spinbutton_suavg), */
650 /* "post", post); */
651 /* gtk_signal_connect(GTK_OBJECT(post->spinbutton_svavg), */
652 /* "changed", */
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),
666 "post_button_savg",
667 post->button_savg,
668 (GtkDestroyNotify) gtk_widget_unref);
669 gtk_widget_show(post->button_savg);
670 gtk_table_attach(GTK_TABLE(post->table_savg),
671 post->button_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"),
683 NULL);
685 gtk_object_set_data(GTK_OBJECT(post->button_savg),
686 "post",
687 post);
688 gtk_signal_connect(GTK_OBJECT(post->button_savg),
689 "enter",
690 GTK_SIGNAL_FUNC(on_button_post_savg_enter),
691 NULL);
692 gtk_signal_connect(GTK_OBJECT(post->button_savg),
693 "leave",
694 GTK_SIGNAL_FUNC(on_widget_leave),
695 NULL);
696 gtk_signal_connect(GTK_OBJECT(post->button_savg),
697 "clicked",
698 GTK_SIGNAL_FUNC(on_button_post_savg),
699 NULL);
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",
709 post->button_subavg,
710 (GtkDestroyNotify) gtk_widget_unref);
711 gtk_widget_show(post->button_subavg);
712 gtk_table_attach(GTK_TABLE(post->table_savg),
713 post->button_subavg,
718 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
719 (GtkAttachOptions) (0),
722 gtk_tooltips_set_tip(post->tooltips,
723 post->button_subavg,
724 _("Substracts the spatial averages, or values that "
725 "have been entered manually, from each estimator"),
726 NULL);
728 gtk_object_set_data(GTK_OBJECT(post->button_subavg),
729 "post",
730 post);
731 gtk_signal_connect(GTK_OBJECT(post->button_subavg),
732 "enter",
733 GTK_SIGNAL_FUNC(on_button_post_subavg_enter),
734 NULL);
735 gtk_signal_connect(GTK_OBJECT(post->button_subavg),
736 "leave",
737 GTK_SIGNAL_FUNC(on_widget_leave),
738 NULL);
739 gtk_signal_connect(GTK_OBJECT(post->button_subavg),
740 "clicked",
741 GTK_SIGNAL_FUNC(on_button_post_subavg),
742 NULL);
746 * Vorstra frame
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",
752 post->frame_vorstra,
753 (GtkDestroyNotify) gtk_widget_unref);
754 gtk_widget_show(post->frame_vorstra);
755 gtk_table_attach(GTK_TABLE(post->table),
756 post->frame_vorstra,
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),
772 "post_vbox_vorstra",
773 post->vbox_vorstra,
774 (GtkDestroyNotify) gtk_widget_unref);
775 gtk_widget_show(post->vbox_vorstra);
776 gtk_container_add(GTK_CONTAINER(post->frame_vorstra),
777 post->vbox_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,
790 TRUE,
791 TRUE,
793 gtk_frame_set_shadow_type(GTK_FRAME(post->frame_vorstra_output),
794 GTK_SHADOW_NONE);
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,
813 _("Vorticity"));
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,
825 FALSE,
826 FALSE,
829 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_output_1),
830 "post",
831 post);
832 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_output_1),
833 "operator",
834 "0");
835 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_1),
836 "enter",
837 GTK_SIGNAL_FUNC
838 (on_radiobutton_post_vorstra_output_enter),
839 NULL);
840 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_1),
841 "leave",
842 GTK_SIGNAL_FUNC(on_widget_leave),
843 NULL);
844 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_1),
845 "toggled",
846 GTK_SIGNAL_FUNC(on_radiobutton_post_vorstra_output),
847 NULL);
852 post->radiobutton_vorstra_output_2 =
853 gtk_radio_button_new_with_label(post->vbox_vorstra_output_group,
854 _("Shear strain"));
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,
866 FALSE,
867 FALSE,
870 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_output_2),
871 "post",
872 post);
873 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_output_2),
874 "operator",
875 "1");
876 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_2),
877 "enter",
878 GTK_SIGNAL_FUNC
879 (on_radiobutton_post_vorstra_output_enter),
880 NULL);
881 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_2),
882 "leave",
883 GTK_SIGNAL_FUNC(on_widget_leave),
884 NULL);
885 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_2),
886 "toggled",
887 GTK_SIGNAL_FUNC(on_radiobutton_post_vorstra_output),
888 NULL);
893 post->radiobutton_vorstra_output_3 =
894 gtk_radio_button_new_with_label(post->vbox_vorstra_output_group,
895 _("Normal strain"));
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,
907 FALSE,
908 FALSE,
911 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_output_3),
912 "post",
913 post);
914 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_output_3),
915 "operator",
916 "2");
917 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_3),
918 "enter",
919 GTK_SIGNAL_FUNC
920 (on_radiobutton_post_vorstra_output_enter),
921 NULL);
922 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_3),
923 "leave",
924 GTK_SIGNAL_FUNC(on_widget_leave),
925 NULL);
926 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_output_3),
927 "toggled",
928 GTK_SIGNAL_FUNC(on_radiobutton_post_vorstra_output),
929 NULL);
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,
942 TRUE,
943 TRUE,
945 gtk_frame_set_shadow_type(GTK_FRAME(post->frame_vorstra_diffscheme),
946 GTK_SHADOW_NONE);
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,
967 _("Central"));
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,
979 FALSE,
980 FALSE,
983 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_1),
984 "post",
985 post);
986 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_1),
987 "diff_type",
988 "0");
989 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_1),
990 "enter",
991 GTK_SIGNAL_FUNC
992 (on_radiobutton_post_vorstra_diffscheme_enter),
993 NULL);
994 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_1),
995 "leave",
996 GTK_SIGNAL_FUNC(on_widget_leave),
997 NULL);
998 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_1),
999 "toggled",
1000 GTK_SIGNAL_FUNC
1001 (on_radiobutton_post_vorstra_diffscheme),
1002 NULL);
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,
1020 FALSE,
1021 FALSE,
1024 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_2),
1025 "post",
1026 post);
1027 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_2),
1028 "diff_type",
1029 "1");
1030 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_2),
1031 "enter",
1032 GTK_SIGNAL_FUNC
1033 (on_radiobutton_post_vorstra_diffscheme_enter),
1034 NULL);
1035 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_2),
1036 "leave",
1037 GTK_SIGNAL_FUNC(on_widget_leave),
1038 NULL);
1039 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_2),
1040 "toggled",
1041 GTK_SIGNAL_FUNC
1042 (on_radiobutton_post_vorstra_diffscheme),
1043 NULL);
1048 post->radiobutton_vorstra_diffscheme_3 =
1049 gtk_radio_button_new_with_label(post->vbox_vorstra_diffscheme_group,
1050 _("Richardson"));
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),
1065 TRUE);
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,
1070 FALSE,
1071 FALSE,
1074 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_3),
1075 "post",
1076 post);
1077 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_3),
1078 "diff_type",
1079 "2");
1080 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_3),
1081 "enter",
1082 GTK_SIGNAL_FUNC
1083 (on_radiobutton_post_vorstra_diffscheme_enter),
1084 NULL);
1085 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_3),
1086 "leave",
1087 GTK_SIGNAL_FUNC(on_widget_leave),
1088 NULL);
1089 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_3),
1090 "toggled",
1091 GTK_SIGNAL_FUNC
1092 (on_radiobutton_post_vorstra_diffscheme),
1093 NULL);
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),
1115 TRUE);
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,
1120 FALSE,
1121 FALSE,
1124 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_4),
1125 "post",
1126 post);
1127 gtk_object_set_data(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_4),
1128 "diff_type",
1129 "3");
1130 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_4),
1131 "enter",
1132 GTK_SIGNAL_FUNC
1133 (on_radiobutton_post_vorstra_diffscheme_enter),
1134 NULL);
1135 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_4),
1136 "leave",
1137 GTK_SIGNAL_FUNC(on_widget_leave),
1138 NULL);
1139 gtk_signal_connect(GTK_OBJECT(post->radiobutton_vorstra_diffscheme_4),
1140 "toggled",
1141 GTK_SIGNAL_FUNC
1142 (on_radiobutton_post_vorstra_diffscheme),
1143 NULL);
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),
1154 TRUE);
1155 } else if (piv_post_par.operator_vorstra == 1) {
1156 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1157 (post->radiobutton_vorstra_output_2),
1158 TRUE);
1159 } else if (piv_post_par.operator_vorstra == 2) {
1160 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1161 (post->radiobutton_vorstra_output_3),
1162 TRUE);
1166 if (piv_post_par.diff_type == 0) {
1167 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1168 (post->radiobutton_vorstra_diffscheme_1),
1169 TRUE);
1171 if (piv_post_par.diff_type == 1) {
1172 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1173 (post->radiobutton_vorstra_diffscheme_2),
1174 TRUE);
1175 } else if (piv_post_par.diff_type == 2) {
1176 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1177 (post->radiobutton_vorstra_diffscheme_3),
1178 TRUE);
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,
1193 FALSE,
1194 FALSE,
1196 gtk_tooltips_set_tip(post->tooltips,
1197 post->button_vorstra,
1198 _("Calculates vorticity or strain magnitudes from a velocity field, obtained by PIV"),
1199 NULL);
1200 gtk_object_set_data(GTK_OBJECT(post->button_vorstra),
1201 "post",
1202 post);
1203 gtk_signal_connect(GTK_OBJECT(post->button_vorstra),
1204 "enter",
1205 GTK_SIGNAL_FUNC(on_button_post_vorstra_enter),
1206 NULL);
1207 gtk_signal_connect(GTK_OBJECT(post->button_vorstra),
1208 "leave",
1209 GTK_SIGNAL_FUNC(on_widget_leave),
1210 NULL);
1211 gtk_signal_connect(GTK_OBJECT(post->button_vorstra),
1212 "clicked",
1213 GTK_SIGNAL_FUNC(on_button_post_vorstra),
1214 NULL);
1217 return post;