display ruler, line/point evaluation
[gpiv.git] / src / pivpost.c
blobcc2fe8f4985697a21823430d8dabfbc30dd3aab1
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
6 libraries.
8 Copyright (C) 2002 Gerber van der Graaf
10 This file is part of gpiv.
12 Gpiv is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2, or (at your option)
15 any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 ----------------------------------------------------------------------*/
29 * (callback) functions for Piv post processing window/tabulator
30 * $Log: pivpost.c,v $
31 * Revision 1.2 2003-06-27 13:47:26 gerber
32 * display ruler, line/point evaluation
34 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
35 * Imported gpiv
40 #include "gpiv_gtk.h"
41 #include "utils.h"
42 #include "pivpost.h"
43 #include "display.h"
47 * Piv post-processing callbacks
49 void
50 on_spinbutton_post_scale(GtkSpinButton * widget, GtkWidget * entry)
51 /* (GtkWidget *widget, gpointer data) */
53 enum VariableType {
54 COL_POS = 1,
55 ROW_POS = 2,
56 S_SCALE = 3,
57 T_SCALE = 4
58 } var_type;
60 var_type = atoi(gtk_object_get_data(GTK_OBJECT(widget), "var_type"));
62 if (var_type == COL_POS) {
63 image_par.z_off_x = gtk_spin_button_get_value_as_float(widget);
64 image_par.z_off_logic = 1;
65 if (display_act != NULL) {
66 display_act->img.image_par.z_off_x = image_par.z_off_x;
67 display_act->img.image_par.z_off_logic = 1;
70 } else if (var_type == ROW_POS) {
71 image_par.z_off_y = gtk_spin_button_get_value_as_float(widget);
72 image_par.z_off_logic = 1;
73 if (display_act != NULL) {
74 display_act->img.image_par.z_off_y = image_par.z_off_y;
75 display_act->img.image_par.z_off_logic = 1;
78 } else if (var_type == S_SCALE) {
79 image_par.s_scale = gtk_spin_button_get_value_as_float(widget) * 1e-3;
80 image_par.s_scale_logic = 1;
81 if (display_act != NULL) {
82 display_act->img.image_par.s_scale = image_par.s_scale;
83 display_act->img.image_par.s_scale_logic = 1;
86 } else if (var_type == T_SCALE) {
87 image_par.t_scale = gtk_spin_button_get_value_as_float(widget) * 1e-3;
88 image_par.t_scale_logic = 1;
89 if (display_act != NULL) {
90 display_act->img.image_par.t_scale = image_par.t_scale;
91 display_act->img.image_par.t_scale_logic = 1;
94 } else {
95 g_warning("on_spinbutton_post_scale: should not arrive here");
101 void
102 on_button_post_scale_enter(GtkWidget *widget,
103 gpointer data)
105 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
106 gchar *msg = _("Calculates scaled locations and velocities");
107 gnome_appbar_set_status(GNOME_APPBAR(gpiv->appbar), msg);
110 void
111 on_button_post_scale(GtkWidget *widget,
112 gpointer data)
114 /* PivPost * post = gtk_object_get_data(GTK_OBJECT(widget), "post"); */
115 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
116 gint row, ibuf;
118 if (nbufs > 0) {
119 for (row = gpiv->first_selected_row; row <= gpiv->last_selected_row;
120 row++) {
121 display_act = gtk_clist_get_row_data(GTK_CLIST(gpiv->clist_buf),
122 row);
123 ibuf = display_act->count;
124 if (display[ibuf] != NULL
125 && display_act->mwin != NULL
126 && GTK_WIDGET_VISIBLE(GTK_WIDGET(display_act->mwin)) ) {
127 gdk_window_show(GTK_WIDGET(display_act->mwin)->window);
128 gdk_window_raise(GTK_WIDGET(display_act->mwin)->window);
130 g_warning("on_button_post_scale:: 1");
131 exec_scale(gpiv->pivpost);
132 g_warning("on_button_post_scale:: 2");
138 void
139 on_button_post_savg_enter(GtkWidget *widget,
140 gpointer data)
142 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
143 gchar *msg = _("Calculates spatial average displacements");
144 gnome_appbar_set_status(GNOME_APPBAR(gpiv->appbar), msg);
148 void
149 on_button_post_savg(GtkWidget *widget,
150 gpointer data)
152 PivPost * post = gtk_object_get_data(GTK_OBJECT(widget), "post");
153 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
154 gint row, ibuf;
156 if (nbufs > 0) {
157 for (row = gpiv->first_selected_row; row <= gpiv->last_selected_row;
158 row++) {
159 display_act = gtk_clist_get_row_data(GTK_CLIST(gpiv->clist_buf),
160 row);
161 ibuf = display_act->count;
162 if (display[ibuf] != NULL
163 && display_act->mwin != NULL
164 && GTK_WIDGET_VISIBLE(GTK_WIDGET(display_act->mwin)) ) {
165 gdk_window_show(GTK_WIDGET(display_act->mwin)->window);
166 gdk_window_raise(GTK_WIDGET(display_act->mwin)->window);
168 exec_savg(post);
174 void
175 on_button_post_subavg_enter(GtkWidget *widget,
176 gpointer data)
178 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
179 gchar *msg = _("Substracts mean displacements from PIV data");
180 gnome_appbar_set_status(GNOME_APPBAR(gpiv->appbar), msg);
184 void
185 on_button_post_subavg(GtkWidget *widget,
186 gpointer data)
188 PivPost * post = gtk_object_get_data(GTK_OBJECT(widget), "post");
189 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
190 gint row, ibuf;
192 if (nbufs > 0) {
193 for (row = gpiv->first_selected_row; row <= gpiv->last_selected_row;
194 row++) {
195 display_act = gtk_clist_get_row_data(GTK_CLIST(gpiv->clist_buf),
196 row);
197 ibuf = display_act->count;
198 if (display[ibuf] != NULL
199 && display_act->mwin != NULL
200 && GTK_WIDGET_VISIBLE(GTK_WIDGET(display_act->mwin)) ) {
201 gdk_window_show(GTK_WIDGET(display_act->mwin)->window);
202 gdk_window_raise(GTK_WIDGET(display_act->mwin)->window);
204 exec_subavg(post);
210 void
211 on_radiobutton_post_vorstra_output_enter(GtkWidget *widget,
212 gpointer data)
214 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
215 gchar *msg = _("Selects the differential quantity");
216 gnome_appbar_set_status(GNOME_APPBAR(gpiv->appbar), msg);
219 void
220 on_radiobutton_post_vorstra_output(GtkWidget *widget,
221 gpointer data)
223 PivPost * post = gtk_object_get_data(GTK_OBJECT(widget), "post");
224 piv_post_par.operator_vorstra = atoi(gtk_object_get_data
225 (GTK_OBJECT(widget),
226 "operator"));
227 fprintf(stderr, "operator_vorstra = %d\n", piv_post_par.operator_vorstra);
229 if (piv_post_par.operator_vorstra == VORTICITY) {
230 gtk_widget_set_sensitive(post->radiobutton_vorstra_diffscheme_4,
231 TRUE);
232 } else {
233 if (piv_post_par.diff_type == CIRCULATION) {
234 piv_post_par.diff_type = CENTRAL;
235 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
236 (post->radiobutton_vorstra_diffscheme_1),
237 TRUE);
239 gtk_widget_set_sensitive(post->radiobutton_vorstra_diffscheme_4,
240 FALSE);
245 void
246 on_radiobutton_post_vorstra_diffscheme_enter(GtkWidget *widget,
247 gpointer data)
249 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
250 gchar *msg = _("Selects the type of differential scheme");
251 gnome_appbar_set_status(GNOME_APPBAR(gpiv->appbar), msg);
255 void
256 on_radiobutton_post_vorstra_diffscheme(GtkWidget *widget,
257 gpointer data)
259 piv_post_par.diff_type = atoi(gtk_object_get_data(GTK_OBJECT(widget),
260 "diff_type"));
261 /* fprintf(stderr, "diff_type = %d\n", piv_post_par.diff_type); */
266 void
267 on_button_post_vorstra_enter(GtkWidget *widget,
268 gpointer data)
270 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
271 gchar *msg = _("Calculates differential quantity");
272 gnome_appbar_set_status(GNOME_APPBAR(gpiv->appbar), msg);
276 void
277 on_button_post_vorstra(GtkWidget *widget,
278 gpointer data)
280 GpivConsole *gpiv = gtk_object_get_data(GTK_OBJECT(widget), "gpiv");
281 gint row, ibuf;
283 if (nbufs > 0) {
284 for (row = gpiv->first_selected_row; row <= gpiv->last_selected_row;
285 row++) {
286 display_act = gtk_clist_get_row_data(GTK_CLIST(gpiv->clist_buf),
287 row);
288 ibuf = display_act->count;
289 if (display[ibuf] != NULL
290 && display_act->mwin != NULL
291 && GTK_WIDGET_VISIBLE(GTK_WIDGET(display_act->mwin)) ) {
292 gdk_window_show(GTK_WIDGET(display_act->mwin)->window);
293 gdk_window_raise(GTK_WIDGET(display_act->mwin)->window);
295 exec_vorstra();
302 * Other post-processing functions
305 void
306 exec_scale(PivPost * pivpost)
309 g_warning("exec_scale:: 1");
310 if (display_act->gpd.scaled_piv)
311 gpiv_free_pivdata(&display_act->gpd.piv_data_scaled);
313 display_act->gpd.piv_data_scaled.nx = display_act->gpd.piv_data.nx;
314 display_act->gpd.piv_data_scaled.ny = display_act->gpd.piv_data.ny;
315 gpiv_alloc_pivdata(&display_act->gpd.piv_data_scaled);
316 g_warning("exec_scale:: 2");
318 if(display_act->gpd.exist_piv && !cancel_process) {
319 if ((display_act->gpd.scaled_piv =
320 gpiv_post_scale (display_act->gpd.piv_data,
321 &display_act->gpd.piv_data_scaled,
322 display_act->img.image_par)) != 1) {
323 gtk_error("exec_scale:: Failure calling gpiv_post_scale");
327 * Adjusting display rulers
328 * TODO
330 /* gtk_ruler_set_range(GTK_RULER(display_act->hruler), */
331 /* (gfloat) image_par.z_off_x, */
332 /* (gfloat) (gpiv_par.img_width * image_par.s_scale - 1), */
333 /* (gfloat) image_par.z_off_x, */
334 /* (gfloat) (gpiv_par.img_width * image_par.s_scale - 1)); */
336 free_post_bufmems(display_act);
337 } else {
338 gtk_warning(_("no PIV data"));
345 void exec_savg(PivPost * pivpost)
347 gint ndata = 0;
348 gfloat mean_dx = 0.0, sdev_dx = 0.0, min_dx = 0.0, max_dx = 0.0;
349 gfloat mean_dy = 0.0, sdev_dy = 0.0, min_dy = 0.0, max_dy = 0.0;
351 gfloat mean_dx_scaled = 0.0, sdev_dx_scaled = 0.0, min_dx_scaled = 0.0,
352 max_dx_scaled = 0.0;
353 gfloat mean_dy_scaled = 0.0, sdev_dy_scaled = 0.0, min_dy_scaled = 0.0,
354 max_dy_scaled = 0.0;
355 PivData dummy_data;
357 if (display_act->gpd.exist_piv && !cancel_process) {
358 exec_process = TRUE;
359 piv_post_par.substract = 0;
360 gpiv_post_savg(display_act->gpd.piv_data,
361 &dummy_data,
362 piv_post_par,
363 &ndata,
364 &mean_dx,
365 &mean_dy,
366 &sdev_dx,
367 &sdev_dy,
368 &min_dx,
369 &min_dy,
370 &max_dx,
371 &max_dy);
374 /* display_act->gpd. */
375 g_warning("::mean_dx = %f sdev_dx = %f min_dx = %f max_dx = %f",
376 mean_dx, sdev_dx, min_dx, max_dx);
377 g_warning("::mean_dy = %f sdev_dy = %f min_dy = %f max_dy = %f\n",
378 mean_dy, sdev_dy, min_dy, max_dy);
381 gtk_spin_button_set_value (GTK_SPIN_BUTTON
382 (pivpost->spinbutton_suavg),
383 (gfloat) mean_dx);
384 gtk_spin_button_set_value (GTK_SPIN_BUTTON
385 (pivpost->spinbutton_svavg),
386 (gfloat) mean_dy);
389 * Repete same process for scaled piv_data
391 if (display_act->gpd.scaled_piv) {
392 gpiv_post_savg(display_act->gpd.piv_data_scaled,
393 &dummy_data,
394 piv_post_par,
395 &ndata,
396 &mean_dx_scaled,
397 &mean_dy_scaled,
398 &sdev_dx_scaled,
399 &sdev_dy_scaled,
400 &min_dx_scaled,
401 &min_dy_scaled,
402 &max_dx_scaled,
403 &max_dy_scaled);
405 g_warning(":: mean_dx = %f sdev_dx = %f min_dx = %f max_dx = %f",
406 mean_dx_scaled, sdev_dx_scaled, min_dx_scaled, max_dx_scaled);
407 g_warning("::mean_dy = %f sdev_dy = %f min_dy = %f max_dy = %f\n",
408 mean_dy_scaled, sdev_dy_scaled, min_dy_scaled, max_dy_scaled);
411 gtk_spin_button_set_value (GTK_SPIN_BUTTON
412 (pivpost->spinbutton_suavg),
413 (gfloat) mean_dx_scaled);
414 gtk_spin_button_set_value (GTK_SPIN_BUTTON
415 (pivpost->spinbutton_svavg),
416 (gfloat) mean_dy_scaled);
419 * Copy parameters in Buffer structure for saving and, eventual,
420 * later use
423 display_act->gpd.piv_post_par.z_off_dx = piv_post_par.z_off_dx;
424 display_act->gpd.piv_post_par.z_off_dy = piv_post_par.z_off_dy;
426 display_act->gpd.piv_post_par.z_off_d_logic = 1;
427 exec_process = FALSE;
429 } else {
430 gtk_warning(_("no PIV data"));
433 /* g_warning("exec_savg:: entering"); */
434 /* gtk_warning(_("not connected, yet")); */
440 void exec_subavg(PivPost * pivpost)
442 gint ndata = 0, i, j;
443 gfloat mean_dx = 0.0, sdev_dx = 0.0, min_dx = 0.0, max_dx = 0.0;
444 gfloat mean_dy = 0.0, sdev_dy = 0.0, min_dy = 0.0, max_dy = 0.0;
445 gfloat mean_dx_scaled = 0.0, sdev_dx_scaled = 0.0, min_dx_scaled = 0.0,
446 max_dx_scaled = 0.0;
447 gfloat mean_dy_scaled = 0.0, sdev_dy_scaled = 0.0, min_dy_scaled = 0.0,
448 max_dy_scaled = 0.0;
449 PivData out_data, out_data_scaled;
451 out_data.point_x = NULL;
452 out_data.point_y = NULL;
453 out_data.dx = NULL;
454 out_data.dy = NULL;
455 out_data.snr = NULL;
456 out_data.peak_no = NULL;
458 out_data_scaled.point_x = NULL;
459 out_data_scaled.point_y = NULL;
460 out_data_scaled.dx = NULL;
461 out_data_scaled.dy = NULL;
462 out_data_scaled.snr = NULL;
463 out_data_scaled.peak_no = NULL;
465 if (display_act->gpd.exist_piv && !cancel_process) {
466 exec_process = TRUE;
467 piv_post_par.substract = 1;
468 out_data.nx = display_act->gpd.piv_data.nx;
469 out_data.ny = display_act->gpd.piv_data.ny;
470 gpiv_alloc_pivdata(&out_data);
471 gpiv_post_savg(display_act->gpd.piv_data,
472 &out_data,
473 piv_post_par,
474 &ndata,
475 &mean_dx,
476 &mean_dy,
477 &sdev_dx,
478 &sdev_dy,
479 &min_dx,
480 &min_dy,
481 &max_dx,
482 &max_dy);
484 gtk_spin_button_set_value (GTK_SPIN_BUTTON(pivpost->spinbutton_suavg),
485 (gfloat) mean_dx);
486 gtk_spin_button_set_value (GTK_SPIN_BUTTON(pivpost->spinbutton_svavg),
487 (gfloat) mean_dy);
489 for (i = 0; i < display_act->gpd.piv_data.ny; i++) {
490 for (j = 0; j < display_act->gpd.piv_data.nx; j++) {
491 display_act->gpd.piv_data.dx[i][j] = out_data.dx[i][j];
492 display_act->gpd.piv_data.dy[i][j] = out_data.dy[i][j];
496 gpiv_free_pivdata(&out_data);
497 update_all_vectors(&display_act->gpd);
500 * Repete same process for scaled piv_data
502 if (display_act->gpd.scaled_piv) {
503 out_data.nx = display_act->gpd.piv_data_scaled.nx;
504 out_data.ny = display_act->gpd.piv_data_scaled.ny;
505 gpiv_alloc_pivdata(&out_data);
506 gpiv_post_savg(display_act->gpd.piv_data_scaled,
507 &out_data,
508 piv_post_par,
509 &ndata,
510 &mean_dx_scaled,
511 &mean_dy_scaled,
512 &sdev_dx_scaled,
513 &sdev_dy_scaled,
514 &min_dx_scaled,
515 &min_dy_scaled,
516 &max_dx_scaled,
517 &max_dy_scaled);
519 gtk_spin_button_set_value (GTK_SPIN_BUTTON(pivpost->spinbutton_suavg),
520 (gfloat) mean_dx_scaled);
521 gtk_spin_button_set_value (GTK_SPIN_BUTTON(pivpost->spinbutton_svavg),
522 (gfloat) mean_dy_scaled);
524 for (i = 0; i < display_act->gpd.piv_data.ny; i++) {
525 for (j = 0; j < display_act->gpd.piv_data.nx; j++) {
526 display_act->gpd.piv_data_scaled.dx[i][j] = out_data.dx[i][j];
527 display_act->gpd.piv_data_scaled.dy[i][j] = out_data.dy[i][j];
531 gpiv_free_pivdata(&out_data);
536 * Copy parameters in Buffer structure for saving and, eventual,
537 * later use
540 display_act->gpd.piv_post_par.z_off_dx = piv_post_par.z_off_dx;
541 display_act->gpd.piv_post_par.z_off_dy = piv_post_par.z_off_dy;
543 display_act->gpd.piv_post_par.z_off_d_logic = 1;
544 exec_process = FALSE;
546 } else {
547 gtk_warning(_("no PIV data"));
550 /* g_warning("exec_savg:: entering"); */
551 /* gtk_warning(_("not connected, yet")); */
556 void exec_vorstra(void)
558 /* ScalarData out_data; */
560 if (display_act->gpd.exist_piv && !cancel_process) {
561 exec_process = TRUE;
565 * Vorticity calculation
567 if (piv_post_par.operator_vorstra == VORTICITY) {
568 if (display_act->gpd.exist_vor) {
569 destroy_all_scalars(&display_act->gpd.vor_data,
570 VORTICITY
571 /* display_act->gpd.gci_scalar_vor */
573 gpiv_free_scdata(&display_act->gpd.vor_data);
574 display_act->gpd.exist_vor = FALSE;
575 /* display_act->gpd.d_vor = FALSE; */
578 display_act->gpd.vor_data.nx = display_act->gpd.piv_data.nx;
579 display_act->gpd.vor_data.ny = display_act->gpd.piv_data.ny;
580 gpiv_alloc_scdata(&display_act->gpd.vor_data);
581 gpiv_post_vorstra(display_act->gpd.piv_data, &display_act->gpd.vor_data,
582 piv_post_par);
583 display_all_scalars(&display_act->gpd.vor_data,
584 VORTICITY
585 /* display_act->gpd.gci_scalar_vor */
587 display_act->gpd.exist_vor = TRUE;
588 display_act->gpd.saved_vor = FALSE;
589 /* display_act->gpd.d_vor = TRUE; */
592 * Repete vorticity calculation process for scaled piv_data
594 if (display_act->gpd.scaled_piv) {
595 display_act->gpd.vor_data_scaled.nx =
596 display_act->gpd.piv_data.nx;
597 display_act->gpd.vor_data_scaled.ny =
598 display_act->gpd.piv_data.ny;
599 gpiv_alloc_scdata(&display_act->gpd.vor_data_scaled);
600 gpiv_post_vorstra(display_act->gpd.piv_data,
601 &display_act->gpd.vor_data_scaled,
602 piv_post_par);
603 display_act->gpd.exist_vor_scaled = TRUE;
608 * Shear strain calculation
610 } else if (piv_post_par.operator_vorstra == S_STRAIN) {
611 if (display_act->gpd.exist_sstrain) {
612 destroy_all_scalars(&display_act->gpd.sstrain_data, S_STRAIN);
613 gpiv_free_scdata(&display_act->gpd.sstrain_data);
614 display_act->gpd.exist_sstrain = FALSE;
615 /* display_act->gpd.d_sstrain = FALSE; */
618 display_act->gpd.sstrain_data.nx = display_act->gpd.piv_data.nx;
619 display_act->gpd.sstrain_data.ny = display_act->gpd.piv_data.ny;
620 gpiv_alloc_scdata(&display_act->gpd.sstrain_data);
621 gpiv_post_vorstra(display_act->gpd.piv_data, &display_act->gpd.sstrain_data,
622 piv_post_par);
623 display_all_scalars(&display_act->gpd.sstrain_data, S_STRAIN);
624 display_act->gpd.exist_sstrain = TRUE;
625 display_act->gpd.saved_sstrain = FALSE;
626 /* display_act->gpd.d_sstrain = TRUE; */
629 * Repete shear strain calculation process for scaled piv_data
631 if (display_act->gpd.scaled_piv) {
632 display_act->gpd.sstrain_data_scaled.nx =
633 display_act->gpd.piv_data.nx;
634 display_act->gpd.sstrain_data_scaled.ny =
635 display_act->gpd.piv_data.ny;
636 gpiv_alloc_scdata(&display_act->gpd.sstrain_data_scaled);
637 gpiv_post_vorstra(display_act->gpd.piv_data,
638 &display_act->gpd.sstrain_data_scaled,
639 piv_post_par);
640 display_act->gpd.exist_sstrain_scaled = TRUE;
644 * Normal strain calculation
646 } else if (piv_post_par.operator_vorstra == N_STRAIN) {
647 if (display_act->gpd.exist_nstrain) {
648 destroy_all_scalars(&display_act->gpd.nstrain_data, N_STRAIN);
649 gpiv_free_scdata(&display_act->gpd.nstrain_data);
650 display_act->gpd.exist_nstrain = FALSE;
651 /* display_act->gpd.d_nstrain = FALSE; */
654 display_act->gpd.nstrain_data.nx = display_act->gpd.piv_data.nx;
655 display_act->gpd.nstrain_data.ny = display_act->gpd.piv_data.ny;
656 gpiv_alloc_scdata(&display_act->gpd.nstrain_data);
657 gpiv_post_vorstra(display_act->gpd.piv_data, &display_act->gpd.nstrain_data,
658 piv_post_par);
659 display_all_scalars(&display_act->gpd.nstrain_data, N_STRAIN);
660 display_act->gpd.exist_nstrain = TRUE;
661 display_act->gpd.saved_nstrain = FALSE;
662 /* display_act->gpd.d_nstrain = TRUE; */
665 * Repete normal strain calculation process for scaled piv_data
667 if (display_act->gpd.scaled_piv) {
668 display_act->gpd.nstrain_data_scaled.nx =
669 display_act->gpd.piv_data.nx;
670 display_act->gpd.nstrain_data_scaled.ny =
671 display_act->gpd.piv_data.ny;
672 gpiv_alloc_scdata(&display_act->gpd.nstrain_data_scaled);
673 gpiv_post_vorstra(display_act->gpd.piv_data,
674 &display_act->gpd.nstrain_data_scaled,
675 piv_post_par);
676 display_act->gpd.exist_nstrain_scaled = TRUE;
681 } else {
682 gtk_warning(_("non valid vorstra operation"));
684 exec_process = FALSE;
686 } else {
687 gtk_warning(_("no PIV data"));
690 /* --------------------------------------------------------------------
691 Copy parameters in Buffer structure for saving and, eventual,
692 later use */
694 if (display_act->gpd.exist_vor || display_act->gpd.exist_sstrain ||
695 display_act->gpd.exist_nstrain) {
697 display_act->gpd.piv_post_par.diff_type = piv_post_par.diff_type;
698 display_act->gpd.piv_post_par.operator_vorstra =
699 piv_post_par.operator_vorstra;
701 display_act->gpd.piv_post_par.diff_type_logic = 1;
702 display_act->gpd.piv_post_par.operator_vorstra_logic = 1;
704 gpiv_post_print_parameters(display_act->gpd.piv_post_par);
708 /* gpiv_write_scdata( &display_act->gpd.vor_data, c_line, nc_lines, */
709 /* scale, RCSID); */