-
Notifications
You must be signed in to change notification settings - Fork 169
/
structures.h
1819 lines (1566 loc) · 48.8 KB
/
structures.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef STRUCTURES_H_DEFINED
#define STRUCTURES_H_DEFINED
#if defined(WIN32)
#include <windows.h>
#endif
#include GL_H
#include "stdio_m.h"
#include "string_util.h" // necessary for flowlabels
#include "smokestream.h"
/* -------------------------- circdata ------------------------------------ */
typedef struct _sliceparmdata {
int nsliceinfo;
int nvsliceinfo;
int nmultisliceinfo;
int nmultivsliceinfo;
int nfedinfo;
int nfediso;
} sliceparmdata;
/* -------------------------- circdata ------------------------------------ */
typedef struct _circdata {
float *xcirc, *ycirc;
int ncirc;
} circdata;
/* -------------------------- langlistdata ------------------------------------ */
typedef struct _lanlistdata {
char *file;
char lang_code[3];
char lang_name[32];
} langlistdata;
/* -------------------------- fueldata ------------------------------------ */
typedef struct _fueldata{
char *fuel;
float hoc;
} fueldata;
/* -------------------------- procdata ------------------------------------ */
#ifdef CPP
typedef struct _procdata {
GLUI_Rollout *rollout;
GLUI *dialog;
int rollout_id;
} procdata;
#endif
/* -------------------------- csvdata ------------------------------------ */
typedef struct _csvdata{
flowlabels label;
float val, *vals, *vals_orig;
float valmin, valmax;
int nvals;
int dimensionless, skip;
} csvdata;
/* -------------------------- _csvfiledata ------------------------------------ */
#define CSV_FDS_FORMAT 0
#define CSV_CFAST_FORMAT 1
typedef struct _csvfiledata {
char *file;
csvdata *csvinfo, *time;
int defined, glui_defined;
int ncsvinfo;
int format;
int loaded, display;
char c_type[32];
} csvfiledata;
/* -------------------------- vertdata ------------------------------------ */
typedef struct _vertdata {
float xyz[3],vert_norm[3],texture_xy[3];
int itriangle,ntriangles,nused;
unsigned char on_mesh_boundary;
int geomtype;
int isdup;
struct _tridata **triangles, *triangle1;
} vertdata;
/* -------------------------- edgedata ------------------------------------ */
typedef struct _edgedata {
int ntriangles;
int vert_index[2], itri;
vertdata *verts[2];
struct _tridata *triangles[2];
} edgedata;
/* -------------------------- tridata ------------------------------------ */
typedef struct _tridata {
unsigned char skinny;
float distance, *color, tverts[6], tri_norm[3], vert_norm[9], area;
float cface_norm1[3], cface_norm2[3];
struct _texturedata *textureinfo;
struct _surfdata *geomsurf;
struct _geomlistdata *geomlisti;
struct _geomobjdata *geomobj;
int vert_index[3], exterior, geomtype, insolid, outside_domain;
vertdata *verts[3];
edgedata *edges[3];
#ifdef pp_DECIMATE
int ival;
#endif
} tridata;
/* -------------------------- geomlistdata ------------------------------------ */
typedef struct _geomlistdata {
int nverts,nedges,ntriangles,norms_defined;
float *zORIG;
vertdata *verts;
float *vertvals;
tridata *triangles, **triangleptrs, **connected_triangles;
edgedata *edges;
} geomlistdata;
/* -------------------------- geomobjdata ------------------------------------ */
typedef struct _geomobjdata {
struct _surfdata *surf;
struct _texturedata *texture;
float *bounding_box, *color;
char *texture_name;
float texture_width, texture_height, texture_center[3];
int texture_mapping;
int use_geom_color, ntriangles;
} geomobjdata;
/* -------------------------- geomdata ------------------------------------ */
typedef struct _geomdata {
char *file, *file2, *topo_file;
int read_status;
int cache_defined;
int memory_id, loaded, display;
int is_terrain;
int block_number;
int have_cface_normals, ncface_normals;
float *cface_normals;
float *float_vals;
float bounding_box[6];
int *file2_tris, nfile2_tris;
int *int_vals, nfloat_vals, nint_vals;
float *times;
int ntimes,itime,*timeslist;
int ngeomobjinfo, geomtype, patchactive, fdsblock;
struct _surfdata *surfgeom;
geomlistdata *geomlistinfo,*geomlistinfo_0, *currentframe;
geomobjdata *geomobjinfo;
int *geomobj_offsets;
int ngeomobj_offsets;
} geomdata;
/* -------------------------- geomdiagdata ------------------------------------ */
typedef struct _geomdiagdata {
char *geomfile, *geomdatafile;
geomdata *geom;
} geomdiagdata;
/* -------------------------- screendata ------------------------------------ */
typedef struct _screendata {
int nwidth, nheight;
GLubyte *screenbuffer;
float width, height, cosmax;
float view[3], up[3], right[3];
} screendata;
/* -------------------------- bounddata ------------------------------------ */
typedef struct _boundata {
float global_min, global_max;
int defined;
} bounddata;
/* -------------------------- propdata ------------------------------------ */
#define PROPVARMAX 100
typedef struct _propdata {
char *label;
int menu_id;
float *rotate_axis, rotate_angle;
int inblockage,blockvis;
int nsmokeview_ids,ismokeview_ids;
char *smokeview_id,**smokeview_ids;
struct _sv_object *smv_object, **smv_objects;
int ntextures;
char **texturefiles, **vars_indep, **svals;
int *vars_indep_index, vars_dep_index[PROPVARMAX];
int nvars_indep, nvars_dep;
float *fvals, fvars_dep[PROPVARMAX];
int tag_number;
} propdata;
/* -------------------------- shootpointdata ------------------------------------ */
typedef struct _shootpointdata {
struct _shootpointdata *prev;
int visible;
float xyz[3], uvw[3], uvw_air[3], val;
} shootpointdata;
/* -------------------------- shoottimedata ------------------------------------ */
typedef struct _shoottimedata {
float time;
int frame;
shootpointdata *beg, *end;
} shoottimedata;
/* -------------------------- infiledata ------------------------------------ */
typedef struct _inifiledata {
struct _inifiledata *prev, *next;
int id;
char *file;
} inifiledata;
/* -------------------------- rolloutlistdata ------------------------------------ */
#ifdef CPP
typedef struct _rolloutlistdata {
struct _rolloutlistdata *prev, *next;
GLUI_Rollout *rollout;
GLUI *dialog;
} rolloutlistdata;
#endif
/* -------------------------- scriptfiledata ------------------------------------ */
typedef struct _scriptfiledata {
struct _scriptfiledata *prev, *next;
int id;
int recording;
char *file;
} scriptfiledata;
/* -------------------------- luascriptfiledata ------------------------------------ */
#ifdef pp_LUA
typedef struct _luascriptfiledata {
struct _luascriptfiledata *prev, *next;
int id;
char *file;
} luascriptfiledata;
#endif
/* -------------------------- scriptdata ------------------------------------ */
typedef struct _scriptdata {
int command;
char command_label[32], quantity2[32];
int ival,ival2,ival3,ival4,ival5;
int need_graphics;
char *cval,*cval2,*cval3;
float fval,fval2,fval3,fval4,fval5;
int exit,first,remove_frame;
char *quantity, *id, *c_pbxyz;
float pbxyz_val;
int pbxyz_dir, cell_centered, vector;
} scriptdata;
/* -------------------------- keyworddata ------------------------------------ */
typedef struct _keyworddata{
char keyword[32];
int index, nparams, line_number;
} keyworddata;
/* -------------------------- treedata ------------------------------------ */
typedef struct _treedata {
float xyz[3];
float time_char, time_complete;
float trunk_diam;
float tree_height;
float base_diam;
float base_height;
int state;
} treedata;
/* -------------------------- colorbardata ------------------------------------ */
#define CB_RAINBOW 0
#define CB_ORIGINAL 1
#define CB_LINEAR 2
#define CB_DIVERGENT 3
#define CB_CIRCULAR 4
#define CB_DEPRECATED 5
#define CB_USER 6
#define CB_OTHER 7
#define INTERP_RGB 0
#define INTERP_LAB 1
typedef struct _colorbardata {
char menu_label[1024]; // menu label
char colorbar_type[256]; // rainbow, linear, divergent, etc
int nnodes, nnodes_orig, node_index_orig[1024], nodehilight, type;
unsigned char node_rgb_orig[3*1024], node_rgb[3*1024], colorbar_alpha[1024];
unsigned char node_index[1024]; // colorbar index
float node_dist[1024];
float colorbar_dist[256];
int dist_ind[256];
float colorbar_dist_delta[1024];
int interp; // (LAB or RGB)
int can_adjust, adjusted;
float colorbar_rgb[3*1024], colorbar_lab[3*1024];
} colorbardata;
/* -------------------------- colortabledata ------------------------------------ */
typedef struct _colortabledata {
char label[1024];
int color[4];
} colortabledata;
/* -------------------------- surfid ------------------------------------ */
typedef struct _surfid {
char *label;
int show;
int location;
} surfid;
/* -------------------------- colordata ------------------------------------ */
typedef struct _colordata {
float color[4], full_color[4], bw_color[4];
struct _colordata *nextcolor;
} colordata;
/* -------------------------- outlinedata ------------------------------------ */
typedef struct _outlinedata {
int nlines;
float *x1, *y1, *z1;
float *x2, *y2, *z2;
} outlinedata;
/* -------------------------- labeldata ------------------------------------ */
typedef struct _labeldata {
struct _labeldata *prev, *next;
char name[300];
float xyz[3],frgb[4],tstart_stop[2];
float tick_begin[3], tick_direction[3];
int show_tick;
int rgb[4], glui_id, labeltype; // smv or ini
int useforegroundcolor,show_always;
} labeldata;
/* -------------------------- texturedata ------------------------------------ */
typedef struct _texturedata {
char *file;
int loaded, display, used, is_transparent;
GLuint name;
} texturedata;
/* -------------------------- terraindata ------------------------------------ */
typedef struct _terraindata {
char *file;
int defined;
texturedata *ter_texture;
int ibar, jbar;
float xmin, xmax, ymin, ymax;
float zmin_cutoff;
float *xplt, *yplt;
float *zcell, *znode, *znode_scaled, *znode_offset;
int nvalues; // number of values above zmin
unsigned char *uc_znormal;
struct _meshdata *terrain_mesh;
} terraindata;
/* -------------------------- surfdata ------------------------------------ */
typedef struct _surfdata {
char *surfacelabel,*texturefile;
int type; /*
0 - regular block non-textured
1 - regular block textured
2 - outline
3 - smoothed block
4 - invisible
*/
float *color, *color_orig, emis, temp_ignition;
float transparent_level, transparent_level_orig;
int iso_level;
float t_width, t_height;
texturedata *textureinfo;
int obst_surface;
int invisible;
int location;
int transparent;
int used_by_obst,used_by_vent;
int used_by_geom;
int geom_surf_color[3];
float axis[3];
int in_geom_list;
int ntris;
int in_color_dialog;
float geom_area;
} surfdata;
/* -------------------------- facedata ------------------------------------ */
typedef struct _facedata {
int type,type2;
float approx_vertex_coords[12];
float exact_vertex_coords[12];
float approx_texture_coords[8];
float exact_texture_coords[8];
float *texture_origin;
float normal[3];
float *color;
float *linecolor,*linewidth;
float approx_center_coord[3];
float dist2eye;
int meshindex, blockageindex;
int imin, imax, jmin, jmax, kmin, kmax;
float xmin, xmax, ymin, ymax, zmin, zmax;
int dir,hidden,dup,interior;
int del;
int transparent;
int patchpresent;
struct _culldata *cullport;
int **showtimelist_handle;
int show_bothsides, is_interior;
struct _blockagedata *bc;
surfdata *surfinfo;
texturedata *textureinfo;
} facedata;
/* -------------------------- selectdata ------------------------------------ */
typedef struct _selectdadta {
int mesh, blockage, side,dir;
facedata *facei;
int type;
} selectdata;
/* -------------------------- xbdata ------------------------------------ */
typedef struct _xbdata {
float xyz[6], *color;
int surf_index[6];
struct _blockagedata *bc;
int blocktype, transparent;
int usecolorindex, colorindex;
int invisible;
surfdata *surfs[6];
} xbdata;
/* -------------------------- blockagedata ------------------------------------ */
typedef struct _blockagedata {
int ijk[6];
float xmin, xmax, ymin, ymax, zmin, zmax;
float xyzEXACT[6], xyzDELTA[18];
struct _surfdata *surf[6];
struct _propdata *prop;
int walltype,walltypeORIG;
int surf_index[6];
int patchvis[7];
int usecolorindex;
int blockage_id,dup;
int is_wuiblock;
int hole;
int nnodes;
int hidden, invisible, interior[6];
int transparent;
int meshindex;
int del;
int changed, changed_surface;
int type;
float *showtime;
int *showtimelist;
unsigned char *showhide;
int nshowtime, show;
char *label, *id_label;
float *color;
int colorindex;
int useblockcolor;
struct _facedata *faceinfo[6];
float texture_origin[3];
} blockagedata;
/* -------------------------- cadlookdata ------------------------------------ */
typedef struct _cadlookdata {
int index;
float texture_width, texture_height, texture_origin[3];
float rgb[4], shininess;
texturedata textureinfo;
int onesided;
} cadlookdata;
/* -------------------------- cadquad ------------------------------------ */
typedef struct _cadquad {
float xyzpoints[12];
float txypoints[8];
float normals[3];
int colorindex;
float colors[4];
float time_show;
cadlookdata *cadlookq;
} cadquad;
/* -------------------------- clipdata ------------------------------------ */
typedef struct _clipdata {
int option;
GLdouble clipvals[24];
int clip_xmin, clip_xmax;
int clip_ymin, clip_ymax;
int clip_zmin, clip_zmax;
float xmin, xmax;
float ymin, ymax;
float zmin, zmax;
} clipdata;
/* -------------------------- cadgeomdata ------------------------------------ */
typedef struct _cadgeomdata{
char *file;
int *order;
int version;
int ncadlookinfo;
cadlookdata *cadlookinfo;
int nquads;
cadquad *quad;
} cadgeomdata;
/* -------------------------- cventdata ------------------------------------ */
typedef struct _cventdata {
int dir,type,colorindex,cvent_id,isOpenvent;
float boxmin[3], boxmax[3], texture_origin[3];
float xmin, xmax, ymin, ymax, zmin, zmax;
unsigned char *blank0, *blank;
int imin, imax, jmin, jmax, kmin, kmax;
int nshowtime, *showtimelist;
float *showtime;
unsigned char *showhide;
int useventcolor,hideboundary;
float origin[3], radius;
float *color;
surfdata *surf[1];
texturedata *textureinfo[1];
} cventdata;
/* -------------------------- ventdata ------------------------------------ */
typedef struct _ventdata {
int type,dummy;
struct _ventdata *dummyptr;
int hideboundary;
int dir,dir2,vent_id;
int useventcolor;
int isOpenvent, isMirrorvent;
float xvent1_orig, xvent2_orig;
float yvent1_orig, yvent2_orig;
float zvent1_orig, zvent2_orig;
float xvent1, xvent2;
float yvent1, yvent2;
float zvent1, zvent2;
float xmin, xmax, ymin, ymax, zmin, zmax;
int imin, imax, jmin, jmax, kmin, kmax;
float xvent1plot, xvent2plot;
float yvent1plot, yvent2plot;
float zvent1plot, zvent2plot;
float *showtime;
int *showtimelist;
unsigned char *showhide;
int nshowtime;
float *color,*color_bak;
int transparent;
int colorindex;
int usecolorindex;
surfdata *surf[1];
texturedata *textureinfo[1];
float texture_origin[3];
float *linewidth;
} ventdata;
/* -------------------------- tickdata ------------------------------------ */
typedef struct _tickdata {
float begin[3],end[3],length;
float dxyz[3],dlength;
int dir,nbars,useforegroundcolor;
float width, rgb[3];
} tickdata;
/* -------------------------- feddata ------------------------------------ */
typedef struct _feddata {
struct _slicedata *co,*co2,*o2,*fed_slice;
struct _isodata *fed_iso;
int co_index, co2_index, o2_index, fed_index;
int loaded,display;
} feddata;
/* -------------------------- isodata ------------------------------------ */
typedef struct _isodata {
int seq_id, autoload;
int isof_index;
char *reg_file, *size_file, *topo_file;
short *normaltable;
int memory_id;
int fds_skip;
int finalize;
float fds_delta;
int nnormaltable;
char *file,*tfile;
int dataflag,geomflag,get_isolevels;
int is_fed;
feddata *fedptr;
int type;
int firstshort_iso;
flowlabels surface_label, color_label;
geomdata *geominfo;
int blocknumber,display,loaded,loading;
float tmin,tmax;
int isoupdate_timestep;
float *levels, **colorlevels;
int nlevels;
char menulabel[128];
int *geom_nstatics, *geom_ndynamics;
float *geom_times, *geom_vals;
unsigned char *times_map;
unsigned char *geom_times_map;
float globalmin_iso, globalmax_iso;
int geom_nvals;
} isodata;
/* -------------------------- volrenderdata ------------------------------------ */
typedef struct _volrenderdata {
char *rendermeshlabel;
int is_compressed;
struct _slicedata *smokeslice, *fireslice;
unsigned char *c_smokedata_view, *c_firedata_view;
int *nsmokedata_compressed, *nfiredata_compressed;
float *smokedata_full, *firedata_full;
float *smokedata_view, *firedata_view;
LINT *smokepos, *firepos;
void *smokedataptr, *firedataptr;
void **smokedataptrs, **firedataptrs;
float *times;
int *dataready;
int itime, ntimes, times_defined;
int *timeslist;
float *smokecolor_yz0, *smokecolor_xz0, *smokecolor_xy0;
float *smokecolor_yz1, *smokecolor_xz1, *smokecolor_xy1;
int loaded, display;
} volrenderdata;
/* -------------------------- meshplanedata ------------------------------------ */
typedef struct _meshplanedata {
float verts[6*3],verts_smv[6*3];
float norm0[4*3], norm1[4*3];
int have_vals[3];
int triangles[4*3], nverts, ntriangles;
float *vals2, *verts2;
int *tris2, nverts2, ntris2;
int polys[10], npolys;
int drawsmoke;
} meshplanedata;
/* -------------------------- mesh ------------------------------------ */
typedef struct _meshdata {
int ibar, jbar, kbar;
float cellsize;
int ncvents,nvents,ndummyvents;
int nbptrs;
int is_bottom;
int *cutcells, ncutcells;
int update_smoke3dcolors;
struct _terraindata *terrain;
float *znodes_complete;
int nznodes;
struct _meshdata *floor_mesh;
#ifdef pp_GPU
GLuint blockage_texture_id;
struct _smoke3ddata *smoke3d_soot, *smoke3d_hrrpuv, *smoke3d_temp, *smoke3d_co2;
GLuint volsmoke_texture_id, volfire_texture_id;
float *volsmoke_texture_buffer,*volfire_texture_buffer;
int voltest_update;
GLuint slice3d_texture_id;
float *slice3d_c_buffer;
#ifdef pp_WINGPU
float *slice3d_texture_buffer;
#endif
#endif
float meshrgb[3], *meshrgb_ptr;
float mesh_offset[3], *mesh_offset_ptr;
int blockvis;
float *xplt, *yplt, *zplt;
double *xpltd, *ypltd, *zpltd;
int ivolbar, jvolbar, kvolbar;
float *xvolplt, *yvolplt, *zvolplt;
float *xplt_cen, *yplt_cen, *zplt_cen;
float *xplt_orig, *yplt_orig, *zplt_orig;
float x0, x1, y0, y1, z0, z1;
int drawsides[7];
int extsides[7]; // 1 if on exterior side of a supermesh, 0 otherwise
int is_extface[6]; // MESH_EXT if face i is completely adjacent to exterior,
// MESH_INT if face i is completely adjacent to another mesh,
// MESH_BOTH if face i is neither
int inside;
int in_frustum; // 1 if part or all of mesh is in the view frustum
float boxmin[3], boxmiddle[3], boxmax[3], dbox[3], boxeps[3], dcell, dcell3[3], verts[24], eyedist;
float boxeps_fds[3];
float slice_min[3], slice_max[3];
float boxmin_scaled[3], boxmiddle_scaled[3], boxmax_scaled[3];
float xyz_bar0[3], xyz_bar[3];
float xcen, ycen, zcen;
float face_centers[18];
float offset[3];
float xyzmaxdiff;
float boxoffset;
int plot3dfilenum,isofilenum,patchfilenum;
int *iplotx_all, *iploty_all, *iplotz_all;
int plotx, ploty, plotz;
int slicedir;
int plotn;
int *imap, *jmap, *kmap;
int n_imap, n_jmap, n_kmap;
unsigned char *boundary_mask;
char *c_iblank_node0, *c_iblank_cell0, *c_iblank_x0, *c_iblank_y0, *c_iblank_z0;
char *c_iblank_node0_temp, *c_iblank_cell0_temp, *c_iblank_x0_temp, *c_iblank_y0_temp, *c_iblank_z0_temp;
char *c_iblank_node_html;
char *c_iblank_node_html_temp;
float *f_iblank_cell0;
float *f_iblank_cell0_temp;
char *c_iblank_embed0;
float *block_zdist0;
float *opacity_adjustments;
char *c_iblank_node, *c_iblank_cell, *c_iblank_x, *c_iblank_y, *c_iblank_z;
char *c_iblank_node_temp, *c_iblank_cell_temp, *c_iblank_x_temp, *c_iblank_y_temp, *c_iblank_z_temp;
float *f_iblank_cell;
float *f_iblank_cell_temp;
char *c_iblank_embed;
float *block_zdist;
int zdist_flag;
unsigned char *iblank_smoke3d;
int iblank_smoke3d_defined;
struct _blockagedata **blockageinfoptrs;
int *obst_bysize;
struct _ventdata *ventinfo;
struct _cventdata *cventinfo;
unsigned char *is_block_terrain;
unsigned char *iqdata;
float *qdata, *udata, *vdata, *wdata;
unsigned char *yzcolorbase, *xzcolorbase, *xycolorbase;
float *yzcolorfbase, *xzcolorfbase, *xycolorfbase;
float *yzcolortbase, *xzcolortbase, *xycolortbase;
float *dx_xy, *dy_xy, *dz_xy;
float *dx_xz, *dy_xz, *dz_xz;
float *dx_yz, *dy_yz, *dz_yz;
char *c_iblank_xy, *c_iblank_xz, *c_iblank_yz;
float plot3d_speedmax;
struct _contour *plot3dcontour1, *plot3dcontour2, *plot3dcontour3;
struct _isosurface *currentsurf, *currentsurf2;
struct _isosurface *blockagesurface;
struct _isosurface **blockagesurfaces;
int ntc;
int nspr;
float *xsprplot, *ysprplot, *zsprplot, *tspr;
int nheat;
float *xheatplot, *yheatplot, *zheatplot, *theat;
float *xspr, *yspr, *zspr;
float *xheat, *yheat, *zheat;
struct _isosurface *animatedsurfaces;
int nisolevels, *showlevels;
float *isolevels;
int isomin_index, isomax_index;
int niso_times;
float *iso_times;
unsigned char *iso_times_map;
int *iso_timeslist;
int iso_itime;
int smokedir,smokedir_old;
float dxDdx, dyDdx, dzDdx, dxyDdx, dxzDdx, dyzDdx, dxyz_orig[3];
float smoke_dist[6];
float norm[3];
float dplane_min[4], dplane_max[4];
int *boundarytype;
int *patchdir,*patch_surfindex;
int *pi1, *pi2, *pj1, *pj2, *pk1, *pk2;
struct _meshdata *skip_nabors[6];
int *blockonpatch;
struct _meshdata **meshonpatch;
struct _meshdata *nabors[6];
struct _supermeshdata *super;
int *ptype;
int *boundary_row, *boundary_col, *blockstart;
unsigned int *zipoffset, *zipsize;
int *vis_boundaries;
float *xyzpatch, *xyzpatch_threshold;
unsigned char *cpatchval_zlib, *cpatchval_iframe_zlib;
unsigned char *cpatchval, *cpatchval_iframe;
float *patch_times, *patch_timesi, *patchval, *patchval_iframe;
unsigned char *patch_times_map;
float **patchventcolors;
float *thresholdtime;
int *patchblank;
int npatch_times,npatches;
int patch_itime;
int *patch_timeslist;
int npatchsize;
int visInteriorBoundaries;
float surface_tempmin, surface_tempmax;
int nface_textures, nface_outlines, nfaces;
int nface_normals_single, nface_normals_double, nface_transparent_double;
struct _facedata *faceinfo, **face_normals_single, **face_normals_double, **face_transparent_double, **face_textures, **face_outlines;
struct _facedata **face_normals_single_DOWN_X,**face_normals_single_UP_X;
struct _facedata **face_normals_single_DOWN_Y,**face_normals_single_UP_Y;
struct _facedata **face_normals_single_DOWN_Z,**face_normals_single_UP_Z;
int nface_normals_single_DOWN_X,nface_normals_single_UP_X;
int nface_normals_single_DOWN_Y,nface_normals_single_UP_Y;
int nface_normals_single_DOWN_Z,nface_normals_single_UP_Z;
int itextureoffset;
int maxtimes_boundary;
float vent_offset[3];
int select_min, select_max;
struct _clipdata *box_clipinfo;
unsigned char *merge_color,*merge_alpha;
unsigned char *smokecolor_ptr, *smokealpha_ptr;
char *label;
int ncullgeominfo,nxyzgeomcull[3],nxyzskipgeomcull[3];
struct _culldata *cullgeominfo;
#ifdef pp_DECIMATE
struct _vertdata *dec_verts;
struct _tridata *dec_triangles;
int ndec_triangles, ndec_verts, decimated;
#endif
struct _volrenderdata *volrenderinfo;
int nslicex, nslicey, nslicez;
struct _slicedata **slicex, **slicey, **slicez;
struct _meshplanedata *gsliceinfo;
struct _meshplanedata *smokeplaneinfo;
int nsmokeplaneinfo;
int s_offset[3];
int isliceinfo, nsliceinfo;
int use;
} meshdata;
/* -------------------------- cellmeshdata ------------------------------------ */
typedef struct _cellmeshdata {
int nxyz[3];
float xyzminmax[6], dxyz[3];
meshdata **cellmeshes;
} cellmeshdata;
/* -------------------------- supermeshdata ------------------------------------ */
typedef struct _supermeshdata {
#ifdef pp_GPU
GLuint blockage_texture_id;
GLuint volsmoke_texture_id, volfire_texture_id;
float *volsmoke_texture_buffer,*volfire_texture_buffer;
#endif
float *f_iblank_cell;
float boxmin_scaled[3], boxmax_scaled[3];
int drawsides[7];
int nmeshes;
meshdata **meshes;
int ibar, jbar, kbar;
} supermeshdata;
/* -------------------------- volfacelistdata ------------------------------------ */
typedef struct _volfacelistdata {
float *xyz,dist2;
int iwall;
meshdata *facemesh;
} volfacelistdata;
/* -------------------------- culldata ------------------------------------ */
typedef struct _culldata {
float xbeg, xend, ybeg, yend, zbeg, zend;
int ibeg, iend, jbeg, jend, kbeg, kend;
int iskip, jskip, kskip;
int vis;
meshdata *cull_mesh;
int npixels,npixels_old;
} culldata;
/* -------------------------- keyframe ------------------------------------ */
typedef struct _keyframe {
int selected, npoints;
float time;
float pause_time, cum_pause_time;
float view_smv[3], view2_smv[3];
float xyz_fds[3], xyz_smv[3];
float arc_dist, line_dist, xyz_diff[3], view_diff[3];
float xyz_tangent_left[3], view_tangent_left[3];
float xyz_tangent_right[3], view_tangent_right[3];
struct _keyframe *next,*prev;
} keyframe;
/* -------------------------- tourdata ------------------------------------ */
typedef struct _tourdata {
char label[300],menulabel[128];
keyframe first_frame,last_frame, **keyframe_list;
int glui_avatar_index, display2;
float *path_times,*keyframe_times;
float xyz_smv[3], view_smv[3];
float global_dist;
int *timeslist;
int ntimes, nkeyframes;
int display, periodic;
int startup;
int isDefault;
} tourdata;
/* -------------------------- tokendata ------------------------------------ */
typedef struct _tokendata {
float var, *varptr, default_val;
int command,loc,type,reads,nvars,noutvars,is_label,is_string,is_texturefile;
struct _sv_object *included_object;
int included_frame;
int texture_index;
struct _tokendata *next,*elsenext;
char token[64],tokenlabel[64],tokenfulllabel[64];
char string[256],default_string[256],*stringptr;
} tokendata;
/* -------------------------- sv_object_frame ------------------------------------ */
typedef struct _sv_object_frame {
int use_bw;
int error;
int display_list_ID;
int *symbols, nsymbols;
tokendata *tokens, **command_list;
int ntokens, ncommands, ntextures;
struct _sv_object *device;
struct _sv_object_frame *prev, *next;
} sv_object_frame;
/* -------------------------- sv_object ------------------------------------ */
typedef struct _sv_object {
char label[256];
int type;
int visible;
int used, used_by_device;
int use_displaylist;
int select_mode;
int nframes;
sv_object_frame **obj_frames, first_frame, last_frame;
struct _sv_object *prev, *next;
} sv_object;
/* -------------------------- device ------------------------------------ */
#define LENDEVICEBUFFER 255
typedef struct _device {
int active;
int show;
int screenijk[3], visval, target_index;