updated copyright statement
[gpiv.git] / src / pivpost_interface.c
blob37ea8c09933eda3306b5a4d9ca595eee50ac4991
1 /*----------------------------------------------------------------------
3 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
4 libraries.
6 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
7 Gerber van der Graaf
9 This file is part of gpiv.
11 Gpiv is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation,
23 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 ----------------------------------------------------------------------*/
28 * PIV Post-processing interface
29 * $Log: pivpost_interface.c,v $
30 * Revision 1.10 2007-11-23 16:24:08 gerber
31 * release 0.5.0: Kafka
33 * Revision 1.9 2007-01-29 11:27:44 gerber
34 * added image formats png, gif, tif png, bmp, improved buffer display
36 * Revision 1.8 2006-09-18 07:27:06 gerber
37 * *** empty log message ***
39 * Revision 1.7 2006/01/31 14:28:12 gerber
40 * version 0.3.0
42 * Revision 1.5 2005/02/12 14:12:12 gerber
43 * Changed tabular names and titles
45 * Revision 1.4 2005/01/19 15:53:42 gerber
46 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
47 * by using RTAI and Realtime Linux, recording images from IEEE1394
48 * (Firewire) IIDC compliant camera's
50 * Revision 1.3 2004/06/14 21:19:23 gerber
51 * Image depth up to 16 bits.
52 * Improvement "single int" and "drag int" in Eval tab.
53 * Viewer's pop-up menu.
54 * Adaption for gpiv_matrix_* and gpiv_vector_*.
55 * Resizing console.
56 * See Changelog for further info.
58 * Revision 1.2 2003/08/22 15:24:52 gerber
59 * interactive spatial scaling
61 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
62 * Imported gpiv
66 #ifdef HAVE_CONFIG_H
67 # include <config.h>
68 #endif
70 #include "gpiv_gui.h"
71 /* #include "console.h" */
72 #include "utils.h"
73 #include "pivpost_interface.h"
74 #include "pivpost.h"
76 PivPost*
77 create_pivpost (GnomeApp *main_window,
78 GtkWidget *container
80 /*-----------------------------------------------------------------------------
83 PivPost * post = g_new0 (PivPost, 1);
84 GpivConsole * gpiv = gtk_object_get_data (GTK_OBJECT (main_window), "gpiv");
88 post->vbox_label = gtk_vbox_new (FALSE,
89 0);
90 gtk_widget_ref (post->vbox_label);
91 gtk_object_set_data_full (GTK_OBJECT (main_window),
92 "post_vbox_label",
93 post->vbox_label,
94 (GtkDestroyNotify) gtk_widget_unref);
95 gtk_widget_show (post->vbox_label);
96 gtk_container_add (GTK_CONTAINER (container),
97 post->vbox_label);
99 post->label_title = gtk_label_new(_("Piv data post processing"));
100 gtk_widget_ref(post->label_title);
101 gtk_object_set_data_full (GTK_OBJECT (main_window),
102 "post_label_title",
103 post->label_title,
104 (GtkDestroyNotify) gtk_widget_unref);
105 gtk_widget_show (post->label_title);
106 gtk_box_pack_start (GTK_BOX (post->vbox_label),
107 post->label_title, FALSE,
108 FALSE,
113 * Scrolled window
115 post->vbox_scroll = gtk_vbox_new (FALSE,
117 gtk_widget_ref (post->vbox_scroll);
118 gtk_object_set_data_full (GTK_OBJECT (main_window),
119 "post_vbox_scroll",
120 post->vbox_scroll,
121 (GtkDestroyNotify) gtk_widget_unref);
122 gtk_widget_show (post->vbox_scroll);
123 gtk_box_pack_start (GTK_BOX (post->vbox_label),
124 post->vbox_scroll,
125 TRUE,
126 TRUE,
131 post->scrolledwindow = gtk_scrolled_window_new (NULL,
132 NULL);
133 gtk_widget_ref (post->scrolledwindow);
134 gtk_object_set_data_full (GTK_OBJECT (main_window),
135 "post_scrolledwindow",
136 post->scrolledwindow,
137 (GtkDestroyNotify) gtk_widget_unref);
138 gtk_widget_show (post->scrolledwindow);
139 gtk_box_pack_start (GTK_BOX (post->vbox_scroll),
140 post->scrolledwindow,
141 TRUE,
142 TRUE,
144 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
145 (post->scrolledwindow),
146 GTK_POLICY_NEVER,
147 GTK_POLICY_NEVER
148 /* GTK_POLICY_AUTOMATIC */ );
152 post->viewport = gtk_viewport_new (NULL,
153 NULL);
154 gtk_widget_ref (post->viewport);
155 gtk_object_set_data_full (GTK_OBJECT (main_window),
156 "post_viewport",
157 post->viewport,
158 (GtkDestroyNotify) gtk_widget_unref);
159 gtk_widget_show (post->viewport);
160 gtk_container_add (GTK_CONTAINER (post->scrolledwindow),
161 post->viewport);
164 * main table for PIVPOST
166 post->table = gtk_table_new (2,
168 FALSE);
169 gtk_widget_ref (post->table);
170 gtk_object_set_data_full (GTK_OBJECT (main_window),
171 "post_table",
172 post->table,
173 (GtkDestroyNotify) gtk_widget_unref);
174 gtk_widget_show (post->table);
175 gtk_container_add (GTK_CONTAINER (post->viewport),
176 post->table);
181 * Scale frame
184 * Spinners use the adjustment from spinbutton_adj_imgh_*
186 post->frame_scale = gtk_frame_new ( _("Scaling"));
187 gtk_widget_ref (post->frame_scale);
188 gtk_object_set_data_full (GTK_OBJECT (main_window),
189 "post_frame_scale",
190 post->frame_scale,
191 (GtkDestroyNotify) gtk_widget_unref);
192 gtk_widget_show (post->frame_scale);
193 gtk_table_attach (GTK_TABLE (post->table),
194 post->frame_scale,
199 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
200 (GtkAttachOptions) (0),
206 post->table_scale = gtk_table_new (5,
208 FALSE);
209 gtk_widget_ref (post->table_scale);
210 gtk_object_set_data_full (GTK_OBJECT (main_window),
211 "post_table_scale",
212 post->table_scale,
213 (GtkDestroyNotify) gtk_widget_unref);
214 gtk_widget_show (post->table_scale);
215 gtk_container_add (GTK_CONTAINER (post->frame_scale),
216 post->table_scale);
220 *spinner for spatial scale "sscale"
222 post->label_sscale = gtk_label_new ( _("spatial scale (mm/pixels): "));
223 gtk_widget_ref (post->label_sscale);
224 gtk_object_set_data_full (GTK_OBJECT (main_window),
225 "post_label_sscale",
226 post->label_sscale,
227 (GtkDestroyNotify) gtk_widget_unref);
228 gtk_widget_show (post->label_sscale);
229 gtk_table_attach (GTK_TABLE (post->table_scale),
230 post->label_sscale,
235 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
236 (GtkAttachOptions) (0),
243 * KEEP DISABLED
245 /* spinbutton_adj_post_sscale = */
246 /* gtk_adjustment_new (gl_post_par.s_scale, 0, 1279, 1, 100, 100); */
248 * end of KEEP DISABLED
250 post->spinbutton_sscale =
251 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv->imgh->spinbutton_adj_sscale),
254 gtk_widget_ref (post->spinbutton_sscale);
255 gtk_widget_show (post->spinbutton_sscale);
256 gtk_table_attach (GTK_TABLE (post->table_scale),
257 post->spinbutton_sscale,
262 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
263 (GtkAttachOptions) (0),
266 gtk_entry_set_editable (GTK_ENTRY (post->spinbutton_sscale),
267 TRUE);
268 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_sscale),
269 TRUE);
271 gtk_object_set_data (GTK_OBJECT (post->spinbutton_sscale),
272 "post",
273 post);
274 gtk_object_set_data (GTK_OBJECT (post->spinbutton_sscale),
275 "var_type",
276 "3");
277 g_signal_connect (GTK_OBJECT (post->spinbutton_sscale),
278 "changed",
279 G_CALLBACK (on_spinbutton_post_scale),
280 post->spinbutton_sscale);
284 *spinner for time scale "tscale"
286 post->label_tscale = gtk_label_new ( _("time scale (ms): "));
287 gtk_widget_ref (post->label_tscale);
288 gtk_object_set_data_full (GTK_OBJECT (main_window),
289 "post_label_tscale",
290 post->label_tscale,
291 (GtkDestroyNotify) gtk_widget_unref);
292 gtk_widget_show (post->label_tscale);
293 gtk_table_attach (GTK_TABLE (post->table_scale),
294 post->label_tscale,
299 (GtkAttachOptions) (GTK_FILL),
300 (GtkAttachOptions) (0),
307 * KEEP DISABLED
309 /* spinbutton_adj_post_tscale = */
310 /* gtk_adjustment_new (gl_post_par.t_scale, 0, 1279, 1, 100, 100); */
312 * end of KEEP DISABLED
314 post->spinbutton_tscale =
315 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv->imgh->spinbutton_adj_tscale),
318 gtk_widget_ref (post->spinbutton_tscale);
319 gtk_widget_show (post->spinbutton_tscale);
320 gtk_table_attach (GTK_TABLE (post->table_scale),
321 post->spinbutton_tscale,
326 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
327 (GtkAttachOptions) (0),
330 gtk_entry_set_editable (GTK_ENTRY (post->spinbutton_tscale),
331 TRUE);
332 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_tscale),
333 TRUE);
335 gtk_object_set_data (GTK_OBJECT (post->spinbutton_tscale),
336 "post",
337 post);
338 gtk_object_set_data (GTK_OBJECT (post->spinbutton_tscale),
339 "var_type",
340 "4");
341 g_signal_connect (GTK_OBJECT (post->spinbutton_tscale),
342 "changed",
343 G_CALLBACK (on_spinbutton_post_scale),
344 post->spinbutton_tscale);
349 * spinner for column position
351 post->label_colpos = gtk_label_new ( _("pos. of col #0 (m): "));
352 gtk_widget_ref (post->label_colpos);
353 gtk_object_set_data_full (GTK_OBJECT (main_window),
354 "post_label_colpos",
355 post->label_colpos,
356 (GtkDestroyNotify) gtk_widget_unref);
357 gtk_widget_show (post->label_colpos);
358 gtk_table_attach (GTK_TABLE (post->table_scale),
359 post->label_colpos,
364 (GtkAttachOptions) (GTK_FILL),
365 (GtkAttachOptions) (0),
372 * KEEP DISABLED
374 /* spinbutton_adj_post_colpos = */
375 /* gtk_adjustment_new (gl_post_par.z_off_x, 0, Z_OFF_MAX, 1, 100, */
376 /* 100); */
378 * end of KEEP DISABLED
380 post->spinbutton_colpos =
381 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv->imgh->spinbutton_adj_colpos),
384 gtk_widget_ref (post->spinbutton_colpos);
385 gtk_widget_show (post->spinbutton_colpos);
386 gtk_table_attach (GTK_TABLE (post->table_scale),
387 post->spinbutton_colpos,
392 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
393 (GtkAttachOptions) (0),
396 gtk_entry_set_editable (GTK_ENTRY (post->spinbutton_colpos),
397 TRUE);
398 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_colpos),
399 TRUE);
401 gtk_object_set_data (GTK_OBJECT (post->spinbutton_colpos),
402 "post",
403 post);
404 gtk_object_set_data (GTK_OBJECT (post->spinbutton_colpos),
405 "var_type",
406 "1");
407 g_signal_connect (GTK_OBJECT (post->spinbutton_colpos),
408 "changed",
409 G_CALLBACK (on_spinbutton_post_scale),
410 post->spinbutton_colpos);
415 * spinner for row position
417 post->label_rowpos = gtk_label_new ( _("pos. of row #0 (m): "));
418 gtk_widget_ref (post->label_rowpos);
419 gtk_object_set_data_full (GTK_OBJECT (main_window),
420 "post_label_rowpos",
421 post->label_rowpos,
422 (GtkDestroyNotify) gtk_widget_unref);
423 gtk_widget_show (post->label_rowpos);
424 gtk_table_attach (GTK_TABLE (post->table_scale),
425 post->label_rowpos,
430 (GtkAttachOptions) (GTK_FILL),
431 (GtkAttachOptions) (0),
438 * KEEP DISABLED
440 /* spinbutton_adj_post_rowpos = */
441 /* gtk_adjustment_new (gl_post_par.z_off_y, 0, Z_OFF_MAX, 1, 100, */
442 /* 100); */
444 * end of KEEP DISABLED
446 post->spinbutton_rowpos =
447 gtk_spin_button_new (GTK_ADJUSTMENT (gpiv->imgh->spinbutton_adj_rowpos),
450 gtk_widget_ref (post->spinbutton_rowpos);
451 gtk_widget_show (post->spinbutton_rowpos);
452 gtk_table_attach (GTK_TABLE (post->table_scale),
453 post->spinbutton_rowpos,
458 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
459 (GtkAttachOptions) (0),
462 gtk_entry_set_editable (GTK_ENTRY (post->spinbutton_rowpos),
463 TRUE);
464 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_rowpos),
465 TRUE);
467 gtk_object_set_data (GTK_OBJECT (post->spinbutton_rowpos),
468 "post",
469 post);
470 gtk_object_set_data (GTK_OBJECT (post->spinbutton_rowpos),
471 "var_type",
472 "2");
473 g_signal_connect (GTK_OBJECT (post->spinbutton_rowpos),
474 "changed",
475 G_CALLBACK (on_spinbutton_post_scale),
476 post->spinbutton_rowpos);
480 post->button_scale = gtk_button_new_with_label ( _("scale"));
481 gtk_widget_ref (post->button_scale);
482 gtk_object_set_data_full (GTK_OBJECT (main_window),
483 "post_button_scale",
484 post->button_scale,
485 (GtkDestroyNotify) gtk_widget_unref);
486 gtk_widget_show (post->button_scale);
487 gtk_table_attach (GTK_TABLE (post->table_scale),
488 post->button_scale,
493 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
494 (GtkAttachOptions) (GTK_FILL),
497 gtk_tooltips_set_tip(gpiv->tooltips,
498 post->button_scale,
499 _("Calculates time and spatial scaled particle "
500 "displacements (i.e. velocities) from a PIV displacement field, and their "
501 "scaled positions"),
502 NULL);
504 gtk_object_set_data (GTK_OBJECT (post->button_scale),
505 "post",
506 post);
507 g_signal_connect (GTK_OBJECT (post->button_scale),
508 "enter",
509 G_CALLBACK
510 (on_button_post_scale_enter),
511 NULL);
512 g_signal_connect (GTK_OBJECT (post->button_scale),
513 "leave",
514 G_CALLBACK (on_widget_leave),
515 NULL);
516 g_signal_connect (GTK_OBJECT (post->button_scale),
517 "clicked",
518 G_CALLBACK (on_button_post_scale),
519 NULL);
523 * Spatial average frame
526 post->frame_savg = gtk_frame_new ( _("Offset / Spatial statistics"));
527 gtk_widget_ref (post->frame_savg);
528 gtk_object_set_data_full (GTK_OBJECT (main_window),
529 "post_frame_savg",
530 post->frame_savg,
531 (GtkDestroyNotify) gtk_widget_unref);
532 gtk_widget_show (post->frame_savg);
533 gtk_table_attach (GTK_TABLE (post->table),
534 post->frame_savg,
539 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
540 (GtkAttachOptions) (0),
546 post->table_savg = gtk_table_new (2,
548 FALSE);
549 gtk_widget_ref (post->table_savg);
550 gtk_object_set_data_full (GTK_OBJECT (main_window),
551 "post_table_savg",
552 post->table_savg,
553 (GtkDestroyNotify) gtk_widget_unref);
554 gtk_widget_show (post->table_savg);
555 gtk_container_add (GTK_CONTAINER (post->frame_savg),
556 post->table_savg);
560 *spinner for spatial average horizontal velocity U-avg
562 post->label_suavg = gtk_label_new ( _("dx (px), U (m/s): "));
563 gtk_widget_ref (post->label_suavg);
564 gtk_object_set_data_full (GTK_OBJECT (main_window),
565 "post_label_suavg",
566 post->label_suavg,
567 (GtkDestroyNotify) gtk_widget_unref);
568 gtk_widget_show (post->label_suavg);
569 gtk_table_attach (GTK_TABLE (post->table_savg),
570 post->label_suavg,
575 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
576 (GtkAttachOptions) (0),
582 post->spinbutton_adj_suavg =
583 /* ARG1: gl_post_par.s_savg */
584 /* gtk_adjustment_new (0. , */
585 /* 0, */
586 /* 1, */
587 /* 0.01, */
588 /* 0.1, */
589 /* 10.0); */
590 gtk_adjustment_new (0.0 ,
591 -100,
592 100,
593 0.01,
594 1.0,
595 10.0);
596 post->spinbutton_suavg =
597 gtk_spin_button_new (GTK_ADJUSTMENT (post->spinbutton_adj_suavg),
600 gtk_widget_ref (post->spinbutton_suavg);
601 gtk_widget_show (post->spinbutton_suavg);
602 gtk_table_attach (GTK_TABLE (post->table_savg),
603 post->spinbutton_suavg,
608 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
609 (GtkAttachOptions) (0),
612 gtk_entry_set_editable (GTK_ENTRY (post->spinbutton_suavg),
613 TRUE);
614 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_suavg),
615 TRUE);
617 * KEEP DISABLED
619 gtk_object_set_data (GTK_OBJECT (post->spinbutton_suavg),
620 "post", post);
621 g_signal_connect (GTK_OBJECT (post->spinbutton_suavg),
622 "changed",
623 G_CALLBACK (on_spinbutton_post_suavg),
624 post->spinbutton_suavg);
626 * end of KEEP DISABLED
632 * spinner for spatial average vertical velocity V-avg
634 post->label_svavg = gtk_label_new ( _("dy (px), V (m/s): "));
635 gtk_widget_ref (post->label_svavg);
636 gtk_object_set_data_full (GTK_OBJECT (main_window),
637 "post_label_svavg",
638 post->label_svavg,
639 (GtkDestroyNotify) gtk_widget_unref);
640 gtk_widget_show (post->label_svavg);
641 gtk_table_attach (GTK_TABLE (post->table_savg),
642 post->label_svavg,
647 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
648 (GtkAttachOptions) (0),
654 post->spinbutton_adj_svavg =
655 /* ARG1: gl_post_par.s_savg */
656 gtk_adjustment_new (0.0 ,
657 -100,
658 100,
659 0.01,
660 1.0,
661 10.0);
662 post->spinbutton_svavg =
663 gtk_spin_button_new (GTK_ADJUSTMENT (post->spinbutton_adj_svavg),
666 gtk_widget_ref (post->spinbutton_svavg);
667 gtk_widget_show (post->spinbutton_svavg);
668 gtk_table_attach (GTK_TABLE (post->table_savg),
669 post->spinbutton_svavg,
674 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
675 (GtkAttachOptions) (0),
678 gtk_entry_set_editable (GTK_ENTRY (post->spinbutton_svavg),
679 TRUE);
680 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (post->spinbutton_svavg),
681 TRUE);
683 * KEEP DISABLED
685 gtk_object_set_data (GTK_OBJECT (post->spinbutton_svavg),
686 "post", post);
687 g_signal_connect (GTK_OBJECT (post->spinbutton_svavg),
688 "changed",
689 G_CALLBACK (on_spinbutton_post_svavg),
690 post->spinbutton_svavg);
692 * end of KEEP DISABLED
697 * button to calculate averages
699 post->button_savg = gtk_button_new_with_label ( _("average"));
700 gtk_widget_ref (post->button_savg);
701 gtk_object_set_data_full (GTK_OBJECT (main_window),
702 "post_button_savg",
703 post->button_savg,
704 (GtkDestroyNotify) gtk_widget_unref);
705 gtk_widget_show (post->button_savg);
706 gtk_table_attach (GTK_TABLE (post->table_savg),
707 post->button_savg,
712 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
713 (GtkAttachOptions) (0),
716 gtk_tooltips_set_tip(gpiv->tooltips, post->button_savg,
717 _("Calculates spatial average particle displacements "
718 "or velocities from a velocity field, obtained from PIV data"),
719 NULL);
721 gtk_object_set_data (GTK_OBJECT (post->button_savg),
722 "post",
723 post);
724 g_signal_connect (GTK_OBJECT (post->button_savg),
725 "enter",
726 G_CALLBACK (on_button_post_savg_enter),
727 NULL);
728 g_signal_connect (GTK_OBJECT (post->button_savg),
729 "leave",
730 G_CALLBACK (on_widget_leave),
731 NULL);
732 g_signal_connect (GTK_OBJECT (post->button_savg),
733 "clicked",
734 G_CALLBACK (on_button_post_savg),
735 NULL);
739 * button to subtract averages or zero offset displacements / velocities
741 post->button_subavg = gtk_button_new_with_label ( _("subtract"));
742 gtk_widget_ref (post->button_subavg);
743 gtk_object_set_data_full (GTK_OBJECT (main_window),
744 "post_button_subavg",
745 post->button_subavg,
746 (GtkDestroyNotify) gtk_widget_unref);
747 gtk_widget_show (post->button_subavg);
748 gtk_table_attach (GTK_TABLE (post->table_savg),
749 post->button_subavg,
754 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
755 (GtkAttachOptions) (0),
758 gtk_tooltips_set_tip(gpiv->tooltips,
759 post->button_subavg,
760 _("Subtracts the spatial averages or offset "
761 "displacements / velocities, from each estimator"),
762 NULL);
764 gtk_object_set_data (GTK_OBJECT (post->button_subavg),
765 "post",
766 post);
767 g_signal_connect (GTK_OBJECT (post->button_subavg),
768 "enter",
769 G_CALLBACK (on_button_post_subavg_enter),
770 NULL);
771 g_signal_connect (GTK_OBJECT (post->button_subavg),
772 "leave",
773 G_CALLBACK (on_widget_leave),
774 NULL);
775 g_signal_connect (GTK_OBJECT (post->button_subavg),
776 "clicked",
777 G_CALLBACK (on_button_post_subavg),
778 NULL);
782 * Vorstra frame
784 post->frame_vorstra = gtk_frame_new ( _("Vorticity & strain"));
785 gtk_widget_ref (post->frame_vorstra);
786 gtk_object_set_data_full (GTK_OBJECT (main_window),
787 "post_frame_vorstra",
788 post->frame_vorstra,
789 (GtkDestroyNotify) gtk_widget_unref);
790 gtk_widget_show (post->frame_vorstra);
791 gtk_table_attach (GTK_TABLE (post->table),
792 post->frame_vorstra,
797 (GtkAttachOptions) (GTK_FILL),
798 (GtkAttachOptions) (0),
804 post->vbox_vorstra = gtk_vbox_new (FALSE,
806 gtk_widget_ref (post->vbox_vorstra);
807 gtk_object_set_data_full (GTK_OBJECT (main_window),
808 "post_vbox_vorstra",
809 post->vbox_vorstra,
810 (GtkDestroyNotify) gtk_widget_unref);
811 gtk_widget_show (post->vbox_vorstra);
812 gtk_container_add (GTK_CONTAINER (post->frame_vorstra),
813 post->vbox_vorstra);
817 post->frame_vorstra_output = gtk_frame_new ( _("Output:"));
818 gtk_widget_ref (post->frame_vorstra_output);
819 gtk_object_set_data_full (GTK_OBJECT (main_window),
820 "post_frame_vorstra_output",
821 post->frame_vorstra_output,
822 (GtkDestroyNotify) gtk_widget_unref);
823 gtk_widget_show (post->frame_vorstra_output);
824 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra),
825 post->frame_vorstra_output,
826 TRUE,
827 TRUE,
829 gtk_frame_set_shadow_type (GTK_FRAME (post->frame_vorstra_output),
830 GTK_SHADOW_NONE);
834 post->vbox_vorstra_output = gtk_vbox_new (FALSE,
836 gtk_widget_ref (post->vbox_vorstra_output);
837 gtk_object_set_data_full (GTK_OBJECT (main_window),
838 "post_vbox_vorstra_output",
839 post->vbox_vorstra_output,
840 (GtkDestroyNotify) gtk_widget_unref);
841 gtk_widget_show (post->vbox_vorstra_output);
842 gtk_container_add (GTK_CONTAINER (post->frame_vorstra_output),
843 post->vbox_vorstra_output);
847 post->radiobutton_vorstra_output_1 =
848 gtk_radio_button_new_with_label (post->vbox_vorstra_output_group,
849 _("Vorticity"));
850 post->vbox_vorstra_output_group =
851 gtk_radio_button_group (GTK_RADIO_BUTTON
852 (post->radiobutton_vorstra_output_1));
853 gtk_widget_ref (post->radiobutton_vorstra_output_1);
854 gtk_object_set_data_full (GTK_OBJECT (main_window),
855 "post_radiobutton_vorstra_output_1",
856 post->radiobutton_vorstra_output_1,
857 (GtkDestroyNotify) gtk_widget_unref);
858 gtk_widget_show (post->radiobutton_vorstra_output_1);
859 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_output),
860 post->radiobutton_vorstra_output_1,
861 FALSE,
862 FALSE,
865 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_1),
866 "post",
867 post);
868 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_1),
869 "operator",
870 "0");
871 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_1),
872 "enter",
873 G_CALLBACK
874 (on_radiobutton_post_vorstra_output_enter),
875 NULL);
876 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_1),
877 "leave",
878 G_CALLBACK (on_widget_leave),
879 NULL);
880 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_1),
881 "toggled",
882 G_CALLBACK (on_radiobutton_post_vorstra_output),
883 NULL);
888 post->radiobutton_vorstra_output_2 =
889 gtk_radio_button_new_with_label (post->vbox_vorstra_output_group,
890 _("Shear strain"));
891 post->vbox_vorstra_output_group =
892 gtk_radio_button_group (GTK_RADIO_BUTTON
893 (post->radiobutton_vorstra_output_2));
894 gtk_widget_ref (post->radiobutton_vorstra_output_2);
895 gtk_object_set_data_full (GTK_OBJECT (main_window),
896 "post_radiobutton_vorstra_output_2",
897 post->radiobutton_vorstra_output_2,
898 (GtkDestroyNotify) gtk_widget_unref);
899 gtk_widget_show (post->radiobutton_vorstra_output_2);
900 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_output),
901 post->radiobutton_vorstra_output_2,
902 FALSE,
903 FALSE,
906 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_2),
907 "post",
908 post);
909 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_2),
910 "operator",
911 "1");
912 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_2),
913 "enter",
914 G_CALLBACK
915 (on_radiobutton_post_vorstra_output_enter),
916 NULL);
917 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_2),
918 "leave",
919 G_CALLBACK (on_widget_leave),
920 NULL);
921 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_2),
922 "toggled",
923 G_CALLBACK (on_radiobutton_post_vorstra_output),
924 NULL);
929 post->radiobutton_vorstra_output_3 =
930 gtk_radio_button_new_with_label (post->vbox_vorstra_output_group,
931 _("Normal strain"));
932 post->vbox_vorstra_output_group =
933 gtk_radio_button_group (GTK_RADIO_BUTTON
934 (post->radiobutton_vorstra_output_3));
935 gtk_widget_ref (post->radiobutton_vorstra_output_3);
936 gtk_object_set_data_full (GTK_OBJECT (main_window),
937 "post_radiobutton_vorstra_output_3",
938 post->radiobutton_vorstra_output_3,
939 (GtkDestroyNotify) gtk_widget_unref);
940 gtk_widget_show (post->radiobutton_vorstra_output_3);
941 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_output),
942 post->radiobutton_vorstra_output_3,
943 FALSE,
944 FALSE,
947 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_3),
948 "post",
949 post);
950 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_output_3),
951 "operator",
952 "2");
953 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_3),
954 "enter",
955 G_CALLBACK
956 (on_radiobutton_post_vorstra_output_enter),
957 NULL);
958 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_3),
959 "leave",
960 G_CALLBACK (on_widget_leave),
961 NULL);
962 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_output_3),
963 "toggled",
964 G_CALLBACK (on_radiobutton_post_vorstra_output),
965 NULL);
969 post->frame_vorstra_diffscheme = gtk_frame_new ( _("Differential scheme:"));
970 gtk_widget_ref (post->frame_vorstra_diffscheme);
971 gtk_object_set_data_full (GTK_OBJECT (main_window),
972 "post_frame_vorstra_diffscheme",
973 post->frame_vorstra_diffscheme,
974 (GtkDestroyNotify) gtk_widget_unref);
975 gtk_widget_show (post->frame_vorstra_diffscheme);
976 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra),
977 post->frame_vorstra_diffscheme,
978 TRUE,
979 TRUE,
981 gtk_frame_set_shadow_type (GTK_FRAME (post->frame_vorstra_diffscheme),
982 GTK_SHADOW_NONE);
987 post->vbox_vorstra_diffscheme = gtk_vbox_new (FALSE,
989 gtk_widget_ref (post->vbox_vorstra_diffscheme);
990 gtk_object_set_data_full (GTK_OBJECT (main_window),
991 "post_vbox_vorstra_diffscheme",
992 post->vbox_vorstra_diffscheme,
993 (GtkDestroyNotify) gtk_widget_unref);
994 gtk_widget_show (post->vbox_vorstra_diffscheme);
995 gtk_container_add (GTK_CONTAINER (post->frame_vorstra_diffscheme),
996 post->vbox_vorstra_diffscheme);
1001 post->radiobutton_vorstra_diffscheme_1 =
1002 gtk_radio_button_new_with_label (post->vbox_vorstra_diffscheme_group,
1003 _("Central"));
1004 post->vbox_vorstra_diffscheme_group =
1005 gtk_radio_button_group (GTK_RADIO_BUTTON
1006 (post->radiobutton_vorstra_diffscheme_1));
1007 gtk_widget_ref (post->radiobutton_vorstra_diffscheme_1);
1008 gtk_object_set_data_full (GTK_OBJECT (main_window),
1009 "post_radiobutton_vorstra_diffscheme_1",
1010 post->radiobutton_vorstra_diffscheme_1,
1011 (GtkDestroyNotify) gtk_widget_unref);
1012 gtk_widget_show (post->radiobutton_vorstra_diffscheme_1);
1013 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_diffscheme),
1014 post->radiobutton_vorstra_diffscheme_1,
1015 FALSE,
1016 FALSE,
1019 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1020 "post",
1021 post);
1022 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1023 "diff_type",
1024 "0");
1025 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1026 "enter",
1027 G_CALLBACK
1028 (on_radiobutton_post_vorstra_diffscheme_enter),
1029 NULL);
1030 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1031 "leave",
1032 G_CALLBACK (on_widget_leave),
1033 NULL);
1034 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_1),
1035 "toggled",
1036 G_CALLBACK
1037 (on_radiobutton_post_vorstra_diffscheme),
1038 NULL);
1042 post->radiobutton_vorstra_diffscheme_2 =
1043 gtk_radio_button_new_with_label (post->vbox_vorstra_diffscheme_group,
1044 _("Least squares"));
1045 post->vbox_vorstra_diffscheme_group =
1046 gtk_radio_button_group (GTK_RADIO_BUTTON
1047 (post->radiobutton_vorstra_diffscheme_2));
1048 gtk_widget_ref (post->radiobutton_vorstra_diffscheme_2);
1049 gtk_object_set_data_full (GTK_OBJECT (main_window),
1050 "post_radiobutton_vorstra_diffscheme_2",
1051 post->radiobutton_vorstra_diffscheme_2,
1052 (GtkDestroyNotify) gtk_widget_unref);
1053 gtk_widget_show (post->radiobutton_vorstra_diffscheme_2);
1054 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_diffscheme),
1055 post->radiobutton_vorstra_diffscheme_2,
1056 FALSE,
1057 FALSE,
1060 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1061 "post",
1062 post);
1063 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1064 "diff_type",
1065 "1");
1066 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1067 "enter",
1068 G_CALLBACK
1069 (on_radiobutton_post_vorstra_diffscheme_enter),
1070 NULL);
1071 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1072 "leave",
1073 G_CALLBACK (on_widget_leave),
1074 NULL);
1075 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_2),
1076 "toggled",
1077 G_CALLBACK
1078 (on_radiobutton_post_vorstra_diffscheme),
1079 NULL);
1084 post->radiobutton_vorstra_diffscheme_3 =
1085 gtk_radio_button_new_with_label (post->vbox_vorstra_diffscheme_group,
1086 _("Richardson"));
1087 post->vbox_vorstra_diffscheme_group =
1088 gtk_radio_button_group (GTK_RADIO_BUTTON
1089 (post->radiobutton_vorstra_diffscheme_3));
1090 gtk_widget_ref (post->radiobutton_vorstra_diffscheme_3);
1091 gtk_object_set_data_full (GTK_OBJECT (main_window),
1092 "post_radiobutton_vorstra_diffscheme_3",
1093 post->radiobutton_vorstra_diffscheme_3,
1094 (GtkDestroyNotify) gtk_widget_unref);
1096 *Define which button is switched on at start up time
1098 if (gl_post_par->diff_type == 2) {
1099 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1100 (post->radiobutton_vorstra_diffscheme_3),
1101 TRUE);
1103 gtk_widget_show (post->radiobutton_vorstra_diffscheme_3);
1104 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_diffscheme),
1105 post->radiobutton_vorstra_diffscheme_3,
1106 FALSE,
1107 FALSE,
1110 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1111 "post",
1112 post);
1113 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1114 "diff_type",
1115 "2");
1116 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1117 "enter",
1118 G_CALLBACK
1119 (on_radiobutton_post_vorstra_diffscheme_enter),
1120 NULL);
1121 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1122 "leave",
1123 G_CALLBACK (on_widget_leave),
1124 NULL);
1125 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_3),
1126 "toggled",
1127 G_CALLBACK
1128 (on_radiobutton_post_vorstra_diffscheme),
1129 NULL);
1134 post->radiobutton_vorstra_diffscheme_4 =
1135 gtk_radio_button_new_with_label (post->vbox_vorstra_diffscheme_group,
1136 _("Circulation method"));
1137 post->vbox_vorstra_diffscheme_group =
1138 gtk_radio_button_group (GTK_RADIO_BUTTON
1139 (post->radiobutton_vorstra_diffscheme_4));
1140 gtk_widget_ref (post->radiobutton_vorstra_diffscheme_4);
1141 gtk_object_set_data_full (GTK_OBJECT (main_window),
1142 "post_radiobutton_vorstra_diffscheme_4",
1143 post->radiobutton_vorstra_diffscheme_4,
1144 (GtkDestroyNotify) gtk_widget_unref);
1146 *Define which button is switched on at start up time
1148 if (gl_post_par->diff_type == 3) {
1149 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1150 (post->radiobutton_vorstra_diffscheme_4),
1151 TRUE);
1153 gtk_widget_show (post->radiobutton_vorstra_diffscheme_4);
1154 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra_diffscheme),
1155 post->radiobutton_vorstra_diffscheme_4,
1156 FALSE,
1157 FALSE,
1160 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1161 "post",
1162 post);
1163 gtk_object_set_data (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1164 "diff_type",
1165 "3");
1166 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1167 "enter",
1168 G_CALLBACK
1169 (on_radiobutton_post_vorstra_diffscheme_enter),
1170 NULL);
1171 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1172 "leave",
1173 G_CALLBACK (on_widget_leave),
1174 NULL);
1175 g_signal_connect (GTK_OBJECT (post->radiobutton_vorstra_diffscheme_4),
1176 "toggled",
1177 G_CALLBACK
1178 (on_radiobutton_post_vorstra_diffscheme),
1179 NULL);
1183 * Define which button is switched on at start up time; moved to the
1184 * end of the tabulator as diff_scheme button Circulation might be
1185 * enabled or disabled
1187 if (gl_post_par->operator_vorstra == 0) {
1188 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1189 (post->radiobutton_vorstra_output_1),
1190 TRUE);
1191 } else if (gl_post_par->operator_vorstra == 1) {
1192 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1193 (post->radiobutton_vorstra_output_2),
1194 TRUE);
1195 } else if (gl_post_par->operator_vorstra == 2) {
1196 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1197 (post->radiobutton_vorstra_output_3),
1198 TRUE);
1202 if (gl_post_par->diff_type == 0) {
1203 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1204 (post->radiobutton_vorstra_diffscheme_1),
1205 TRUE);
1207 if (gl_post_par->diff_type == 1) {
1208 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1209 (post->radiobutton_vorstra_diffscheme_2),
1210 TRUE);
1211 } else if (gl_post_par->diff_type == 2) {
1212 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1213 (post->radiobutton_vorstra_diffscheme_3),
1214 TRUE);
1220 post->button_vorstra = gtk_button_new_with_label ( _("vorticity"));
1221 gtk_widget_ref (post->button_vorstra);
1222 gtk_object_set_data_full (GTK_OBJECT (main_window),
1223 "post_button_vorstra",
1224 post->button_vorstra,
1225 (GtkDestroyNotify) gtk_widget_unref);
1226 gtk_widget_show (post->button_vorstra);
1227 gtk_box_pack_start (GTK_BOX (post->vbox_vorstra),
1228 post->button_vorstra,
1229 FALSE,
1230 FALSE,
1232 gtk_tooltips_set_tip(gpiv->tooltips,
1233 post->button_vorstra,
1234 _("Calculates vorticity or strain magnitudes from a velocity field, obtained by PIV"),
1235 NULL);
1236 gtk_object_set_data (GTK_OBJECT (post->button_vorstra),
1237 "post",
1238 post);
1239 g_signal_connect (GTK_OBJECT (post->button_vorstra),
1240 "enter",
1241 G_CALLBACK (on_button_post_vorstra_enter),
1242 NULL);
1243 g_signal_connect (GTK_OBJECT (post->button_vorstra),
1244 "leave",
1245 G_CALLBACK (on_widget_leave),
1246 NULL);
1247 g_signal_connect (GTK_OBJECT (post->button_vorstra),
1248 "clicked",
1249 G_CALLBACK (on_button_post_vorstra),
1250 NULL);
1253 return post;