Updated because of cvs conflict
[gpiv.git] / src / display_interface.h
blobf3c9b0ffa95e0f22721b19db18279c875e107eb9
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 * widgets prototypes of display
30 * $Log: display_interface.h,v $
31 * Revision 1.13 2007-12-19 08:42:35 gerber
32 * debugged
34 * Revision 1.12 2007-11-23 16:24:07 gerber
35 * release 0.5.0: Kafka
37 * Revision 1.11 2007-06-06 17:00:48 gerber
38 * Retreives images/data from URI using Gnome Virtual File System.
40 * Revision 1.10 2007-03-22 16:00:32 gerber
41 * Added image processing tabulator
43 * Revision 1.9 2007/02/05 15:17:09 gerber
44 * auto stretching, broadcast display settings to buffers from preferences
46 * Revision 1.8 2007-01-29 11:27:43 gerber
47 * added image formats png, gif, tif png, bmp, improved buffer display
49 * Revision 1.7 2006/01/31 14:28:12 gerber
50 * version 0.3.0
52 * Revision 1.5 2004/06/14 21:19:23 gerber
53 * Image depth up to 16 bits.
54 * Improvement "single int" and "drag int" in Eval tab.
55 * Viewer's pop-up menu.
56 * Adaption for gpiv_matrix_* and gpiv_vector_*.
57 * Resizing console.
58 * See Changelog for further info.
60 * Revision 1.4 2003/09/01 11:17:14 gerber
61 * improved monitoring of interrogation process
63 * Revision 1.3 2003/07/31 11:43:26 gerber
64 * display images in gnome canvas (HOERAreset)
66 * Revision 1.2 2003/06/27 13:47:26 gerber
67 * display ruler, line/point evaluation
69 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
70 * Imported gpiv
74 #ifndef DISPLAY_INTERFACE_H
75 #define DISPLAY_INTERFACE_H
77 #include "console_interface.h"
78 /* #include "gpiv_gui.h" */
81 typedef struct _Image Image;
82 struct _Image {
83 GpivImage *image; /* image structure */
86 * Image is displayed at gnome canvas
88 GdkPixbuf *pixbuf1; /* pixpbuf of first image frame */
89 GdkPixbuf *pixbuf2; /* pixbuf of first image frame */
90 guchar *rgbbuf_img1; /* graphical representation of first image frame */
91 guchar *rgbbuf_img2; /* graphical representation of first image frame */
92 guint rgb_img_width; /* straddled image width */
93 gfloat img_mean; /* average value of image intensity */
94 GnomeCanvasItem *gci_img1;
95 GnomeCanvasItem *gci_img2;
96 gboolean exist_img; /* flag if image exists */
97 gboolean saved_img; /* flag if image has been saved after modifying */
102 * Structure for displaying the Interrogation Region contours
104 typedef struct _Intreg Intreg;
105 struct _Intreg {
106 guint row_start_old; /* Used to check if contours have to be updated */
107 guint col_start_old; /* Used to check if contours have to be updated */
108 GpivPivPar *par;
109 GpivPivData *data;
110 gboolean exist_int;
111 GnomeCanvasItem *gci_intreg1[MAX_DATA][MAX_DATA];
112 GnomeCanvasItem *gci_intreg2[MAX_DATA][MAX_DATA];
117 * Contains all PIV data, derived data and parameters
119 typedef struct _PivData PivData;
120 struct _PivData {
121 GpivPivPar *piv_par;
122 GpivPivData *piv_data;
123 GpivPivData *piv_data_scaled;
124 gboolean exist_piv;
125 gboolean saved_piv;
126 gboolean scaled_piv;
127 gboolean averaged_piv;
129 GnomeCanvasItem *gci_vector[MAX_DATA][MAX_DATA];
130 gboolean exist_vec;
132 GpivCov *cov; /* Used for displaying in Interrogation tab of console */
133 gboolean exist_cov;
135 gfloat **intreg1; /* Used for displaying in Interrogation tab of console */
136 gfloat **intreg2; /* Used for displaying in Interrogation tab of console */
138 GpivValidPar *valid_par;
139 gboolean exist_valid;
140 GpivBinData *klass;
141 gboolean exist_histo;
142 gboolean saved_histo;
144 GpivPostPar *post_par; /* Post processing parameters */
145 GpivScalarData *vor_data; /* Vorticity data, derived from PIV data */
146 GpivScalarData *vor_data_scaled; /* Time and spatial scaled vorticity data */
147 gboolean exist_vor;
148 gboolean exist_vor_scaled;
149 gboolean saved_vor;
150 GnomeCanvasItem *gci_scalar_vor[MAX_DATA][MAX_DATA];
152 GpivScalarData *sstrain_data; /* Shear strain data, derived from PIV data */
153 GpivScalarData *sstrain_data_scaled; /* Time and spatial scaled shear strain data */
154 gboolean exist_sstrain;
155 gboolean exist_sstrain_scaled;
156 gboolean saved_sstrain;
157 GnomeCanvasItem *gci_scalar_sstrain[MAX_DATA][MAX_DATA];
159 GpivScalarData *nstrain_data; /* Normal strain data, derived from PIV data */
160 GpivScalarData *nstrain_data_scaled; /* Time and spatial scaled normal strain data */
161 gboolean exist_nstrain;
162 gboolean exist_nstrain_scaled;
163 gboolean saved_nstrain;
164 GnomeCanvasItem *gci_scalar_nstrain[MAX_DATA][MAX_DATA];
169 * The graphical interface of the display buffer
171 typedef struct _Display Display;
172 struct _Display {
173 char *file_uri_name;
174 guint id; /* array number and identity of display.
175 When created set to row number in buffer clist,
176 but may differ after deleting displays has taken place */
177 GtkWidget *mwin; /* main window for display */
178 GtkWidget *vbox;
181 * Menu bar and menus
183 GtkWidget *menubar;
184 GtkWidget *menuitem_view;
185 GtkWidget *menuitem_view_menu;
186 GtkWidget *view_menubar;
187 GtkWidget *view_rulers;
188 GtkWidget *stretch_auto;
189 GtkWidget *stretch;
190 GtkWidget *separator_zoom;
191 GSList *zoom_group;
192 gchar *zoom_key[8];
193 GtkWidget *zoom_menu[8];
195 GtkWidget *menuitem_background;
196 GtkWidget *menuitem_background_menu;
197 GSList *background_group;
198 GtkWidget *view_blue;
199 GtkWidget *view_black;
200 GtkWidget *view_image_a;
201 GtkWidget *view_image_b;
203 GtkWidget *menuitem_view_piv_data;
204 GtkWidget *menuitem_view_piv_data_menu;
205 GtkWidget *view_interrogation_areas;
206 GtkWidget *view_velocity_vectors;
208 GtkWidget *menuitem_view_scalar_data;
209 GtkWidget *menuitem_view_scalar_data_menu;
210 GSList *scalar_group;
211 GtkWidget *view_none;
212 GtkWidget *view_vorticity;
213 GtkWidget *view_shear_strain;
214 GtkWidget *view_normal_strain;
216 GtkWidget *menuitem_vector_scale;
217 GtkWidget *menuitem_vector_scale_menu;
218 GSList *vector_scale_group;
219 gchar *vector_scale_key[9];
220 GtkWidget *vector_scale_menu[9];
222 GtkWidget *menuitem_vector_color;
223 GtkWidget *menuitem_vector_color_menu;
224 GSList *vector_color_group;
225 GtkWidget *vector_color_peak_nr;
226 GtkWidget *vector_color_snr;
227 GtkWidget *vector_color_magngray;
228 GtkWidget *vector_color_magncolor;
231 * Toolbar
233 #ifdef DISPLAY_TOOLBAR
234 GtkWidget *toolbar;
235 GtkIconSize toolbar_icon_size;
236 GtkWidget *toolitem_zoom_in;
237 GtkWidget *button_zoom_in;
238 GtkWidget *toolitem_zoom_out;
239 GtkWidget *button_zoom_out;
240 GtkWidget *toolitem_fit;
241 GtkWidget *button_fit;
242 #endif
245 * Display area
247 GtkWidget *table;
248 /* GtkWidget *button_origin; */
249 /* GtkWidget *arrow_origin; */
250 GtkObject *hadj;
251 GtkObject *vadj;
252 GtkWidget *hruler;
253 GtkWidget *vruler;
254 GtkWidget *vscrollbar;
255 GtkWidget *hscrollbar;
257 GtkWidget *canvas;
258 GtkWidget *view_options;
259 GtkWidget *appbar;
260 GtkWidget *nav_ebox;
262 /* gboolean stretch_window_tmp; */
263 gint zoom_index;
264 gfloat zoom_factor_old;
265 gfloat zoom_factor;
266 gint vector_scale;
267 gint vector_color;
268 gchar msg_display_default[GPIV_MAX_CHARS];
270 GtkWidget *display_popupmenu;
271 GnomeCanvasItem *gci_bg;
274 * Display data
276 Image *img;
277 Intreg *intreg;
278 PivData *pida;
280 /* enum ShowBackground */ guint display_backgrnd;
281 /* gboolean display_img1; */
282 /* gboolean display_img2; */
283 gboolean display_intregs;
284 gboolean display_piv;
285 /* enum ShowScalar */ guint display_scalar;
286 /* gboolean display_vor; */
287 /* gboolean display_sstrain; */
288 /* gboolean display_nstrain; */
290 gboolean index_old;
291 gint index_x_old;
292 gint index_y_old;
293 gdouble xgrab_first;
294 gdouble ygrab_first;
296 gdouble x_adj_value;
297 /* gdouble x_adj_value_init; */
298 gdouble x_adj_lower;
299 gdouble x_adj_upper;
300 gdouble x_page_size;
301 gdouble y_adj_value;
302 /* gdouble y_adj_value_init; */
303 gdouble y_adj_lower;
304 gdouble y_adj_upper;
305 gdouble y_page_size;
310 * creates display window
312 Display *
313 create_display (gchar *fname,
314 GpivImage *image,
315 guint buf,
316 GpivConsole *gpiv);
319 * creates display popup menu
321 GtkWidget *
322 create_display_popupmenu (Display *disp);
325 #endif /* DISPLAY_INTERFACE_H */