paralellized with OMP and MPI
[gpiv.git] / src / pivpost_interface.c
blob4806a78f7b8b425ef7075fa75f06734a0d89b445
1 /*----------------------------------------------------------------------
3 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
4 libraries.
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)
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.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
39 * version 0.3.0
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_*.
54 * Resizing console.
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
61 * Imported gpiv
65 #ifdef HAVE_CONFIG_H
66 # include <config.h>
67 #endif
69 #include "gpiv_gui.h"
70 /* #include "console.h" */
71 #include "utils.h"
72 #include "pivpost_interface.h"
73 #include "pivpost.h"
75 PivPost*
76 create_pivpost (GnomeApp *main_window,
77 GtkWidget *container
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,
88 0);
89 gtk_widget_ref (post->vbox_label);
90 gtk_object_set_data_full (GTK_OBJECT (main_window),
91 "post_vbox_label",
92 post->vbox_label,
93 (GtkDestroyNotify) gtk_widget_unref);
94 gtk_widget_show (post->vbox_label);
95 gtk_container_add (GTK_CONTAINER (container),
96 post->vbox_label);
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),
101 "post_label_title",
102 post->label_title,
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,
107 FALSE,
112 * Scrolled window
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),
118 "post_vbox_scroll",
119 post->vbox_scroll,
120 (GtkDestroyNotify) gtk_widget_unref);
121 gtk_widget_show (post->vbox_scroll);
122 gtk_box_pack_start (GTK_BOX (post->vbox_label),
123 post->vbox_scroll,
124 TRUE,
125 TRUE,
130 post->scrolledwindow = gtk_scrolled_window_new (NULL,
131 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,
140 TRUE,
141 TRUE,
143 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
144 (post->scrolledwindow),
145 GTK_POLICY_NEVER,
146 GTK_POLICY_NEVER
147 /* GTK_POLICY_AUTOMATIC */ );
151 post->viewport = gtk_viewport_new (NULL,
152 NULL);
153 gtk_widget_ref (post->viewport);
154 gtk_object_set_data_full (GTK_OBJECT (main_window),
155 "post_viewport",
156 post->viewport,
157 (GtkDestroyNotify) gtk_widget_unref);
158 gtk_widget_show (post->viewport);
159 gtk_container_add (GTK_CONTAINER (post->scrolledwindow),
160 post->viewport);
163 * main table for PIVPOST
165 post->table = gtk_table_new (2,
167 FALSE);
168 gtk_widget_ref (post->table);
169 gtk_object_set_data_full (GTK_OBJECT (main_window),
170 "post_table",
171 post->table,
172 (GtkDestroyNotify) gtk_widget_unref);
173 gtk_widget_show (post->table);
174 gtk_container_add (GTK_CONTAINER (post->viewport),
175 post->table);
180 * Scale frame
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),
188 "post_frame_scale",
189 post->frame_scale,
190 (GtkDestroyNotify) gtk_widget_unref);
191 gtk_widget_show (post->frame_scale);
192 gtk_table_attach (GTK_TABLE (post->table),
193 post->frame_scale,
198 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
199 (GtkAttachOptions) (0),
205 post->table_scale = gtk_table_new (5,
207 FALSE);
208 gtk_widget_ref (post->table_scale);
209 gtk_object_set_data_full (GTK_OBJECT (main_window),
210 "post_table_scale",
211 post->table_scale,
212 (GtkDestroyNotify) gtk_widget_unref);
213 gtk_widget_show (post->table_scale);
214 gtk_container_add (GTK_CONTAINER (post->frame_scale),
215 post->table_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),
224 "post_label_sscale",
225 post->label_sscale,
226 (GtkDestroyNotify) gtk_widget_unref);
227 gtk_widget_show (post->label_sscale);
228 gtk_table_attach (GTK_TABLE (post->table_scale),
229 post->label_sscale,
234 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
235 (GtkAttachOptions) (0),
242 * KEEP DISABLED
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),
266 TRUE);
267 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_sscale),
268 TRUE);
270 gtk_object_set_data (GTK_OBJECT (post->spinbutton_sscale),
271 "post",
272 post);
273 gtk_object_set_data (GTK_OBJECT (post->spinbutton_sscale),
274 "var_type",
275 "3");
276 g_signal_connect (GTK_OBJECT (post->spinbutton_sscale),
277 "changed",
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),
288 "post_label_tscale",
289 post->label_tscale,
290 (GtkDestroyNotify) gtk_widget_unref);
291 gtk_widget_show (post->label_tscale);
292 gtk_table_attach (GTK_TABLE (post->table_scale),
293 post->label_tscale,
298 (GtkAttachOptions) (GTK_FILL),
299 (GtkAttachOptions) (0),
306 * KEEP DISABLED
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),
330 TRUE);
331 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_tscale),
332 TRUE);
334 gtk_object_set_data (GTK_OBJECT (post->spinbutton_tscale),
335 "post",
336 post);
337 gtk_object_set_data (GTK_OBJECT (post->spinbutton_tscale),
338 "var_type",
339 "4");
340 g_signal_connect (GTK_OBJECT (post->spinbutton_tscale),
341 "changed",
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),
353 "post_label_colpos",
354 post->label_colpos,
355 (GtkDestroyNotify) gtk_widget_unref);
356 gtk_widget_show (post->label_colpos);
357 gtk_table_attach (GTK_TABLE (post->table_scale),
358 post->label_colpos,
363 (GtkAttachOptions) (GTK_FILL),
364 (GtkAttachOptions) (0),
371 * KEEP DISABLED
373 /* spinbutton_adj_post_colpos = */
374 /* gtk_adjustment_new (gl_post_par.z_off_x, 0, Z_OFF_MAX, 1, 100, */
375 /* 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),
396 TRUE);
397 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_colpos),
398 TRUE);
400 gtk_object_set_data (GTK_OBJECT (post->spinbutton_colpos),
401 "post",
402 post);
403 gtk_object_set_data (GTK_OBJECT (post->spinbutton_colpos),
404 "var_type",
405 "1");
406 g_signal_connect (GTK_OBJECT (post->spinbutton_colpos),
407 "changed",
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),
419 "post_label_rowpos",
420 post->label_rowpos,
421 (GtkDestroyNotify) gtk_widget_unref);
422 gtk_widget_show (post->label_rowpos);
423 gtk_table_attach (GTK_TABLE (post->table_scale),
424 post->label_rowpos,
429 (GtkAttachOptions) (GTK_FILL),
430 (GtkAttachOptions) (0),
437 * KEEP DISABLED
439 /* spinbutton_adj_post_rowpos = */
440 /* gtk_adjustment_new (gl_post_par.z_off_y, 0, Z_OFF_MAX, 1, 100, */
441 /* 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),
462 TRUE);
463 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_rowpos),
464 TRUE);
466 gtk_object_set_data (GTK_OBJECT (post->spinbutton_rowpos),
467 "post",
468 post);
469 gtk_object_set_data (GTK_OBJECT (post->spinbutton_rowpos),
470 "var_type",
471 "2");
472 g_signal_connect (GTK_OBJECT (post->spinbutton_rowpos),
473 "changed",
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),
482 "post_button_scale",
483 post->button_scale,
484 (GtkDestroyNotify) gtk_widget_unref);
485 gtk_widget_show (post->button_scale);
486 gtk_table_attach (GTK_TABLE (post->table_scale),
487 post->button_scale,
492 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
493 (GtkAttachOptions) (GTK_FILL),
496 gtk_tooltips_set_tip(gpiv->tooltips,
497 post->button_scale,
498 _("Calculates time and spatial scaled particle "
499 "displacements (i.e. velocities) from a PIV displacement field, and their "
500 "scaled positions"),
501 NULL);
503 gtk_object_set_data (GTK_OBJECT (post->button_scale),
504 "post",
505 post);
506 g_signal_connect (GTK_OBJECT (post->button_scale),
507 "enter",
508 G_CALLBACK
509 (on_button_post_scale_enter),
510 NULL);
511 g_signal_connect (GTK_OBJECT (post->button_scale),
512 "leave",
513 G_CALLBACK (on_widget_leave),
514 NULL);
515 g_signal_connect (GTK_OBJECT (post->button_scale),
516 "clicked",
517 G_CALLBACK (on_button_post_scale),
518 NULL);
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),
528 "post_frame_savg",
529 post->frame_savg,
530 (GtkDestroyNotify) gtk_widget_unref);
531 gtk_widget_show (post->frame_savg);
532 gtk_table_attach (GTK_TABLE (post->table),
533 post->frame_savg,
538 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
539 (GtkAttachOptions) (0),
545 post->table_savg = gtk_table_new (2,
547 FALSE);
548 gtk_widget_ref (post->table_savg);
549 gtk_object_set_data_full (GTK_OBJECT (main_window),
550 "post_table_savg",
551 post->table_savg,
552 (GtkDestroyNotify) gtk_widget_unref);
553 gtk_widget_show (post->table_savg);
554 gtk_container_add (GTK_CONTAINER (post->frame_savg),
555 post->table_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),
564 "post_label_suavg",
565 post->label_suavg,
566 (GtkDestroyNotify) gtk_widget_unref);
567 gtk_widget_show (post->label_suavg);
568 gtk_table_attach (GTK_TABLE (post->table_savg),
569 post->label_suavg,
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. , */
584 /* 0, */
585 /* 1, */
586 /* 0.01, */
587 /* 0.1, */
588 /* 10.0); */
589 gtk_adjustment_new (0.0 ,
590 -100,
591 100,
592 0.01,
593 1.0,
594 10.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),
612 TRUE);
613 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_suavg),
614 TRUE);
616 * KEEP DISABLED
618 gtk_object_set_data (GTK_OBJECT (post->spinbutton_suavg),
619 "post", post);
620 g_signal_connect (GTK_OBJECT (post->spinbutton_suavg),
621 "changed",
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),
636 "post_label_svavg",
637 post->label_svavg,
638 (GtkDestroyNotify) gtk_widget_unref);
639 gtk_widget_show (post->label_svavg);
640 gtk_table_attach (GTK_TABLE (post->table_savg),
641 post->label_svavg,
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 ,
656 -100,
657 100,
658 0.01,
659 1.0,
660 10.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),
678 TRUE);
679 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_svavg),
680 TRUE);
682 * KEEP DISABLED
684 gtk_object_set_data (GTK_OBJECT (post->spinbutton_svavg),
685 "post", post);
686 g_signal_connect (GTK_OBJECT (post->spinbutton_svavg),
687 "changed",
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),
701 "post_button_savg",
702 post->button_savg,
703 (GtkDestroyNotify) gtk_widget_unref);
704 gtk_widget_show (post->button_savg);
705 gtk_table_attach (GTK_TABLE (post->table_savg),
706 post->button_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"),
718 NULL);
720 gtk_object_set_data (GTK_OBJECT (post->button_savg),
721 "post",
722 post);
723 g_signal_connect (GTK_OBJECT (post->button_savg),
724 "enter",
725 G_CALLBACK (on_button_post_savg_enter),
726 NULL);
727 g_signal_connect (GTK_OBJECT (post->button_savg),
728 "leave",
729 G_CALLBACK (on_widget_leave),
730 NULL);
731 g_signal_connect (GTK_OBJECT (post->button_savg),
732 "clicked",
733 G_CALLBACK (on_button_post_savg),
734 NULL);
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",
744 post->button_subavg,
745 (GtkDestroyNotify) gtk_widget_unref);
746 gtk_widget_show (post->button_subavg);
747 gtk_table_attach (GTK_TABLE (post->table_savg),
748 post->button_subavg,
753 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
754 (GtkAttachOptions) (0),
757 gtk_tooltips_set_tip(gpiv->tooltips,
758 post->button_subavg,
759 _("Subtracts the spatial averages or offset "
760 "displacements / velocities, from each estimator"),
761 NULL);
763 gtk_object_set_data (GTK_OBJECT (post->button_subavg),
764 "post",
765 post);
766 g_signal_connect (GTK_OBJECT (post->button_subavg),
767 "enter",
768 G_CALLBACK (on_button_post_subavg_enter),
769 NULL);
770 g_signal_connect (GTK_OBJECT (post->button_subavg),
771 "leave",
772 G_CALLBACK (on_widget_leave),
773 NULL);
774 g_signal_connect (GTK_OBJECT (post->button_subavg),
775 "clicked",
776 G_CALLBACK (on_button_post_subavg),
777 NULL);
781 * Vorstra frame
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",
787 post->frame_vorstra,
788 (GtkDestroyNotify) gtk_widget_unref);
789 gtk_widget_show (post->frame_vorstra);
790 gtk_table_attach (GTK_TABLE (post->table),
791 post->frame_vorstra,
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),
807 "post_vbox_vorstra",
808 post->vbox_vorstra,
809 (GtkDestroyNotify) gtk_widget_unref);
810 gtk_widget_show (post->vbox_vorstra);
811 gtk_container_add (GTK_CONTAINER (post->frame_vorstra),
812 post->vbox_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,
825 TRUE,
826 TRUE,
828 gtk_frame_set_shadow_type (GTK_FRAME (post->frame_vorstra_output),
829 GTK_SHADOW_NONE);
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,
848 _("Vorticity"));
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,
860 FALSE,
861 FALSE,
864 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_1),
865 "post",
866 post);
867 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_1),
868 "operator",
869 "0");
870 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_1),
871 "enter",
872 G_CALLBACK
873 (on_radiobutton_post_vorstra_output_enter),
874 NULL);
875 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_1),
876 "leave",
877 G_CALLBACK (on_widget_leave),
878 NULL);
879 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_1),
880 "toggled",
881 G_CALLBACK (on_radiobutton_post_vorstra_output),
882 NULL);
887 post->radiobutton_vorstra_output_2 =
888 gtk_radio_button_new_with_label (post->vbox_vorstra_output_group,
889 _("Shear strain"));
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,
901 FALSE,
902 FALSE,
905 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_2),
906 "post",
907 post);
908 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_2),
909 "operator",
910 "1");
911 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_2),
912 "enter",
913 G_CALLBACK
914 (on_radiobutton_post_vorstra_output_enter),
915 NULL);
916 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_2),
917 "leave",
918 G_CALLBACK (on_widget_leave),
919 NULL);
920 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_2),
921 "toggled",
922 G_CALLBACK (on_radiobutton_post_vorstra_output),
923 NULL);
928 post->radiobutton_vorstra_output_3 =
929 gtk_radio_button_new_with_label (post->vbox_vorstra_output_group,
930 _("Normal strain"));
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,
942 FALSE,
943 FALSE,
946 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_3),
947 "post",
948 post);
949 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_3),
950 "operator",
951 "2");
952 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_3),
953 "enter",
954 G_CALLBACK
955 (on_radiobutton_post_vorstra_output_enter),
956 NULL);
957 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_3),
958 "leave",
959 G_CALLBACK (on_widget_leave),
960 NULL);
961 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_3),
962 "toggled",
963 G_CALLBACK (on_radiobutton_post_vorstra_output),
964 NULL);
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,
977 TRUE,
978 TRUE,
980 gtk_frame_set_shadow_type (GTK_FRAME (post->frame_vorstra_diffscheme),
981 GTK_SHADOW_NONE);
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,
1002 _("Central"));
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,
1014 FALSE,
1015 FALSE,
1018 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1019 "post",
1020 post);
1021 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1022 "diff_type",
1023 "0");
1024 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1025 "enter",
1026 G_CALLBACK
1027 (on_radiobutton_post_vorstra_diffscheme_enter),
1028 NULL);
1029 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1030 "leave",
1031 G_CALLBACK (on_widget_leave),
1032 NULL);
1033 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1034 "toggled",
1035 G_CALLBACK
1036 (on_radiobutton_post_vorstra_diffscheme),
1037 NULL);
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,
1055 FALSE,
1056 FALSE,
1059 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1060 "post",
1061 post);
1062 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1063 "diff_type",
1064 "1");
1065 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1066 "enter",
1067 G_CALLBACK
1068 (on_radiobutton_post_vorstra_diffscheme_enter),
1069 NULL);
1070 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1071 "leave",
1072 G_CALLBACK (on_widget_leave),
1073 NULL);
1074 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1075 "toggled",
1076 G_CALLBACK
1077 (on_radiobutton_post_vorstra_diffscheme),
1078 NULL);
1083 post->radiobutton_vorstra_diffscheme_3 =
1084 gtk_radio_button_new_with_label (post->vbox_vorstra_diffscheme_group,
1085 _("Richardson"));
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),
1100 TRUE);
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,
1105 FALSE,
1106 FALSE,
1109 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1110 "post",
1111 post);
1112 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1113 "diff_type",
1114 "2");
1115 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1116 "enter",
1117 G_CALLBACK
1118 (on_radiobutton_post_vorstra_diffscheme_enter),
1119 NULL);
1120 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1121 "leave",
1122 G_CALLBACK (on_widget_leave),
1123 NULL);
1124 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1125 "toggled",
1126 G_CALLBACK
1127 (on_radiobutton_post_vorstra_diffscheme),
1128 NULL);
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),
1150 TRUE);
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,
1155 FALSE,
1156 FALSE,
1159 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1160 "post",
1161 post);
1162 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1163 "diff_type",
1164 "3");
1165 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1166 "enter",
1167 G_CALLBACK
1168 (on_radiobutton_post_vorstra_diffscheme_enter),
1169 NULL);
1170 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1171 "leave",
1172 G_CALLBACK (on_widget_leave),
1173 NULL);
1174 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1175 "toggled",
1176 G_CALLBACK
1177 (on_radiobutton_post_vorstra_diffscheme),
1178 NULL);
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),
1189 TRUE);
1190 } else if (gl_post_par->operator_vorstra == 1) {
1191 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1192 (post->radiobutton_vorstra_output_2),
1193 TRUE);
1194 } else if (gl_post_par->operator_vorstra == 2) {
1195 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1196 (post->radiobutton_vorstra_output_3),
1197 TRUE);
1201 if (gl_post_par->diff_type == 0) {
1202 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1203 (post->radiobutton_vorstra_diffscheme_1),
1204 TRUE);
1206 if (gl_post_par->diff_type == 1) {
1207 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1208 (post->radiobutton_vorstra_diffscheme_2),
1209 TRUE);
1210 } else if (gl_post_par->diff_type == 2) {
1211 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1212 (post->radiobutton_vorstra_diffscheme_3),
1213 TRUE);
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,
1228 FALSE,
1229 FALSE,
1231 gtk_tooltips_set_tip(gpiv->tooltips,
1232 post->button_vorstra,
1233 _("Calculates vorticity or strain magnitudes from a velocity field, obtained by PIV"),
1234 NULL);
1235 gtk_object_set_data (GTK_OBJECT (post->button_vorstra),
1236 "post",
1237 post);
1238 g_signal_connect (GTK_OBJECT (post->button_vorstra),
1239 "enter",
1240 G_CALLBACK (on_button_post_vorstra_enter),
1241 NULL);
1242 g_signal_connect (GTK_OBJECT (post->button_vorstra),
1243 "leave",
1244 G_CALLBACK (on_widget_leave),
1245 NULL);
1246 g_signal_connect (GTK_OBJECT (post->button_vorstra),
1247 "clicked",
1248 G_CALLBACK (on_button_post_vorstra),
1249 NULL);
1252 return post;