From 134e25dbf039aaa04c75b9fb7b96bdb968137d7c Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 25 Mar 2026 21:09:39 -0400 Subject: [PATCH 01/46] smokeview source: update blanking data structures in the background (to speed up startup) --- Source/smokeview/readsmv.c | 3 ++- Source/smokeview/smokeheaders.h | 2 +- Source/smokeview/smokeviewvars.h | 4 ++++ Source/smokeview/smv_geometry.c | 25 +++++++++++++++---------- Source/smokeview/update.c | 1 + 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 7bd7ccaa13..c5b4ecedf2 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -2837,7 +2837,8 @@ int ReadSMV_Configure(){ PRINT_TIMER(timer_readsmv, "MakeIBlankSmoke3D"); if(HaveCircularVents()==1|| global_scase.meshescoll.nmeshes < 100 || parse_opts.fast_startup == 0){ - MakeIBlank(); + makeiblank_threads = THREADinit(&n_makeiblank_threads, &use_makeiblank_threads, MakeIBlank); + THREADrun(makeiblank_threads); PRINT_TIMER(timer_readsmv, "MakeIBlank"); } diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 557eb23271..763a657bd7 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -816,7 +816,7 @@ EXTERNCPP int InExterior(float *xyz); EXTERNCPP void InitClip(void); EXTERNCPP void InitTetraClipInfo(clipdata *ci,float *v1, float *v2, float *v3, float *v4); EXTERNCPP void MatMultMat(float *m1, float *m2, float *m3); -EXTERNCPP int MakeIBlank(void); +EXTERNCPP void *MakeIBlank(void *arg); EXTERNCPP int MakeIBlankCarve(void); EXTERNCPP void MergeClipPlanes(clipdata *ci, clipdata *cj); EXTERNCPP int MeshInFrustum(meshdata *meshi); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 4392ea6ef2..61253e24b8 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -43,6 +43,10 @@ SVEXTERN threaderdata SVDECL(*sliceparms_threads, NULL); SVEXTERN int SVDECL(n_meshnabors_threads, 1), SVDECL(use_meshnabors_threads, 1); SVEXTERN threaderdata SVDECL(*meshnabors_threads, NULL); +//***MakeIBlank +SVEXTERN int SVDECL(n_makeiblank_threads, 1), SVDECL(use_makeiblank_threads, 1); +SVEXTERN threaderdata SVDECL(*makeiblank_threads, NULL); + //***checkfiles SVEXTERN int SVDECL(n_checkfiles_threads, 1), SVDECL(use_checkfiles_threads, 1); SVEXTERN threaderdata SVDECL(*checkfiles_threads, NULL); diff --git a/Source/smokeview/smv_geometry.c b/Source/smokeview/smv_geometry.c index e567ecda2a..b3eceb011e 100644 --- a/Source/smokeview/smv_geometry.c +++ b/Source/smokeview/smv_geometry.c @@ -1352,10 +1352,12 @@ void SetHiddenBlockages(meshdata *meshi){ /* ------------------ MakeIBlank ------------------------ */ -int MakeIBlank(void){ +void *MakeIBlank(void *arg){ int ig; - if(global_scase.use_iblank==0)return 0; + if(global_scase.use_iblank==0){ + THREAD_EXIT(makeiblank_threads); + } for(ig=0;igkbar; ijksize=(ibar+1)*(jbar+1)*(kbar+1); - if(NewMemory((void **)&c_iblank_node_html, ijksize*sizeof(char))==0)return 1; - if(NewMemory((void **)&iblank_node, ijksize*sizeof(char))==0)return 1; - if(NewMemory((void **)&iblank_cell, ibar*jbar*kbar*sizeof(char))==0)return 1; - if(NewMemory((void **)&fblank_cell, ibar*jbar*kbar*sizeof(float))==0)return 1; - if(NewMemory((void **)&c_iblank_x, ijksize*sizeof(char))==0)return 1; - if(NewMemory((void **)&c_iblank_y, ijksize*sizeof(char))==0)return 1; - if(NewMemory((void **)&c_iblank_z, ijksize*sizeof(char))==0)return 1; + if( + NewMemory((void **)&c_iblank_node_html, ijksize*sizeof(char))==0 || + NewMemory((void **)&iblank_node, ijksize*sizeof(char))==0 || + NewMemory((void **)&iblank_cell, ibar*jbar*kbar*sizeof(char))==0 || + NewMemory((void **)&fblank_cell, ibar*jbar*kbar*sizeof(float))==0 || + NewMemory((void **)&c_iblank_x, ijksize*sizeof(char))==0 || + NewMemory((void **)&c_iblank_y, ijksize*sizeof(char))==0 || + NewMemory((void **)&c_iblank_z, ijksize*sizeof(char))==0){ + THREAD_EXIT(makeiblank_threads); + } meshi->c_iblank_node_html_temp = c_iblank_node_html; meshi->c_iblank_node0_temp = iblank_node; @@ -1562,7 +1567,7 @@ int MakeIBlank(void){ } update_make_iblank = 1; - return 0; + THREAD_EXIT(makeiblank_threads); } /* ------------------ InitClip ------------------------ */ diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 01e8075ee4..e0de35b37d 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -2853,6 +2853,7 @@ void UpdateDisplay(void){ update_make_iblank = 0; update_setvents = 1; update_setcvents = 1; + printf("blanking data structures updated\n"); } if(update_setvents==1){ SetVentDirs(); From 364d9f8e85e4fe8d9698776078760ececc5cb6fc Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 26 Mar 2026 08:55:41 -0400 Subject: [PATCH 02/46] smokeview source: add pp_SPEEDUP directive --- Source/smokeview/options.h | 1 + Source/smokeview/readsmv.c | 4 ++++ Source/smokeview/smokeheaders.h | 4 ++++ Source/smokeview/smokeviewvars.h | 2 ++ Source/smokeview/smv_geometry.c | 22 ++++++++++++++++++++++ Source/smokeview/update.c | 2 ++ 6 files changed, 35 insertions(+) diff --git a/Source/smokeview/options.h b/Source/smokeview/options.h index 25702e57b9..6d26056555 100644 --- a/Source/smokeview/options.h +++ b/Source/smokeview/options.h @@ -16,6 +16,7 @@ //#define pp_OPACITY_DEBUG // output hrrpuv opacity in center of each mesh //#define pp_GLUT_DEBUG // add debug print for glut debugging //#define pp_OSX_CWD // turn on initial getcwd call for OSX smokeview's +#define pp_SPEEDUP // speed up smokeview //*** options: windows diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index c5b4ecedf2..6d3bb17fb2 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -2837,8 +2837,12 @@ int ReadSMV_Configure(){ PRINT_TIMER(timer_readsmv, "MakeIBlankSmoke3D"); if(HaveCircularVents()==1|| global_scase.meshescoll.nmeshes < 100 || parse_opts.fast_startup == 0){ +#ifdef pp_SPEEDUP makeiblank_threads = THREADinit(&n_makeiblank_threads, &use_makeiblank_threads, MakeIBlank); THREADrun(makeiblank_threads); +#else + MakeIBlank(); +#endif PRINT_TIMER(timer_readsmv, "MakeIBlank"); } diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 763a657bd7..78be351404 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -816,7 +816,11 @@ EXTERNCPP int InExterior(float *xyz); EXTERNCPP void InitClip(void); EXTERNCPP void InitTetraClipInfo(clipdata *ci,float *v1, float *v2, float *v3, float *v4); EXTERNCPP void MatMultMat(float *m1, float *m2, float *m3); +#ifdef pp_SPEEDUP EXTERNCPP void *MakeIBlank(void *arg); +#else +EXTERNCPP int MakeIBlank(void); +#endif EXTERNCPP int MakeIBlankCarve(void); EXTERNCPP void MergeClipPlanes(clipdata *ci, clipdata *cj); EXTERNCPP int MeshInFrustum(meshdata *meshi); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 61253e24b8..0987afd15d 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -43,9 +43,11 @@ SVEXTERN threaderdata SVDECL(*sliceparms_threads, NULL); SVEXTERN int SVDECL(n_meshnabors_threads, 1), SVDECL(use_meshnabors_threads, 1); SVEXTERN threaderdata SVDECL(*meshnabors_threads, NULL); +#ifdef pp_SPEEDUP //***MakeIBlank SVEXTERN int SVDECL(n_makeiblank_threads, 1), SVDECL(use_makeiblank_threads, 1); SVEXTERN threaderdata SVDECL(*makeiblank_threads, NULL); +#endif //***checkfiles SVEXTERN int SVDECL(n_checkfiles_threads, 1), SVDECL(use_checkfiles_threads, 1); diff --git a/Source/smokeview/smv_geometry.c b/Source/smokeview/smv_geometry.c index b3eceb011e..29a0fa9e89 100644 --- a/Source/smokeview/smv_geometry.c +++ b/Source/smokeview/smv_geometry.c @@ -1352,12 +1352,20 @@ void SetHiddenBlockages(meshdata *meshi){ /* ------------------ MakeIBlank ------------------------ */ +#ifdef pp_SPEEDUP void *MakeIBlank(void *arg){ +#else +int MakeIBlank(void){ +#endif int ig; +#ifdef pp_SPEEDUP if(global_scase.use_iblank==0){ THREAD_EXIT(makeiblank_threads); } +#else + if(global_scase.use_iblank==0)return 0; +#endif for(ig=0;igkbar; ijksize=(ibar+1)*(jbar+1)*(kbar+1); +#ifdef pp_SPEEDUP if( NewMemory((void **)&c_iblank_node_html, ijksize*sizeof(char))==0 || NewMemory((void **)&iblank_node, ijksize*sizeof(char))==0 || @@ -1384,6 +1393,15 @@ void *MakeIBlank(void *arg){ NewMemory((void **)&c_iblank_z, ijksize*sizeof(char))==0){ THREAD_EXIT(makeiblank_threads); } +#else + if(NewMemory(( void ** )&c_iblank_node_html, ijksize * sizeof(char)) == 0)return 1; + if(NewMemory(( void ** )&iblank_node, ijksize * sizeof(char)) == 0)return 1; + if(NewMemory(( void ** )&iblank_cell, ibar * jbar * kbar * sizeof(char)) == 0)return 1; + if(NewMemory(( void ** )&fblank_cell, ibar * jbar * kbar * sizeof(float)) == 0)return 1; + if(NewMemory(( void ** )&c_iblank_x, ijksize * sizeof(char)) == 0)return 1; + if(NewMemory(( void ** )&c_iblank_y, ijksize * sizeof(char)) == 0)return 1; + if(NewMemory(( void ** )&c_iblank_z, ijksize * sizeof(char)) == 0)return 1; +#endif meshi->c_iblank_node_html_temp = c_iblank_node_html; meshi->c_iblank_node0_temp = iblank_node; @@ -1567,7 +1585,11 @@ void *MakeIBlank(void *arg){ } update_make_iblank = 1; +#ifdef pp_SPEEDUP THREAD_EXIT(makeiblank_threads); +#else + return 0; +#endif } /* ------------------ InitClip ------------------------ */ diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index e0de35b37d..bd38af31fa 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -2853,7 +2853,9 @@ void UpdateDisplay(void){ update_make_iblank = 0; update_setvents = 1; update_setcvents = 1; +#ifdef pp_SPEEDUP printf("blanking data structures updated\n"); +#endif } if(update_setvents==1){ SetVentDirs(); From 73bded8155a65d00114e96da51a936ef4239243b Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 26 Mar 2026 10:27:59 -0400 Subject: [PATCH 03/46] smokeview source: add timing code for smoke drawing --- Source/smokeview/showscene.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/smokeview/showscene.c b/Source/smokeview/showscene.c index a207984e09..d23a0ce7c6 100644 --- a/Source/smokeview/showscene.c +++ b/Source/smokeview/showscene.c @@ -527,7 +527,9 @@ void ShowScene2(int mode){ if(show3dsmoke == 1 && (hide_scene == 0 || mouse_down == 0)){ CLIP_VALS; + INIT_PRINT_TIMER(timer_drawsmoke); DrawSmokeFrame(); + PRINT_TIMER(timer_drawsmoke, "DrawSmokeFrame"); } /* ++++++++++++++++++++++++ draw vol smoke +++++++++++++++++++++++++ */ From 0753a641b8d30143c5631d548cef26b6fdd9e863 Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 26 Mar 2026 16:20:53 -0400 Subject: [PATCH 04/46] smokeview source: compute/save max for all 3D smoke components --- Source/smokeview/IOsmoke.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index aebf73fcaa..e7b7445897 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -1354,10 +1354,12 @@ void UpdateSmokeAlphas(void){ for(j=0;j<6;j++){ float maxval; +#ifndef pp_SPEEDUP assert( (smoke3di->soot_density_loaded == 1 && smoke3di->maxvals!=NULL) || (smoke3di->soot_density_loaded == 0 && smoke3di->maxvals==NULL) ); +#endif maxval = smoke3di->maxval; if(smoke3di->soot_density_loaded == 1 && smoke3di->maxvals!=NULL)maxval = smoke3di->maxvals[smoke3di->ismoke3d_time]; InitAlphas(smoke3di->alphas_smokedir[j], smoke3di->alphas_firedir[j], smoke3di->extinct, smoke3di->soot_density_loaded, maxval, glui_mass_extinct, smoke_mesh->dxyz_fds[0], dists[j]); @@ -2690,7 +2692,6 @@ void DrawSmokeFrame(void){ load_shaders = 1; } #endif - float smoke3d_timer; START_TIMER(smoke3d_timer); blend_mode = 0; @@ -3163,25 +3164,37 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in times_map = *times_map_ptr; nch_smoke_compressed_full = *nchars_smoke_compressed_full; nch_smoke_compressed_found= *nchars_smoke_compressed_found; +#ifdef pp_SPEEDUP + maxvals = *maxvals_ptr; +#else if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1)maxvals = *maxvals_ptr; +#endif NewResizeMemory( use_smokeframe_full, (*ntimes_full) * sizeof(int)); NewResizeMemory( times, nframes_found * sizeof(float)); NewResizeMemory( times_map, nframes_found * sizeof(char)); NewResizeMemory( nch_smoke_compressed_full, (*ntimes_full) * sizeof(int)); NewResizeMemory(nch_smoke_compressed_found, (*ntimes_found) * sizeof(int)); +#ifdef pp_SPEEDUP + NewResizeMemory(maxvals, (*ntimes_full) * sizeof(float)); +#else if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ NewResizeMemory(maxvals, (*ntimes_full) * sizeof(float)); } +#endif *use_smokeframe = use_smokeframe_full; *times_ptr = times; *times_map_ptr = times_map; *nchars_smoke_compressed_full = nch_smoke_compressed_full; *nchars_smoke_compressed_found = nch_smoke_compressed_found; +#ifdef pp_SPEEDUP + *maxvals_ptr = maxvals; +#else if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ *maxvals_ptr = maxvals; } +#endif fgets(buffer, 255, SMOKE_SIZE); ntimes_full2 = 0; @@ -3208,13 +3221,24 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in sscanf(buffer, "%f %i %i %i %i %f", &time_local, &nch_uncompressed, &dummy, &nch_smoke_compressed, &nch_light, &maxvali); } *maxval = MAX(maxvali, *maxval); +#ifdef pp_SPEEDUP if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ *maxvals++ = maxval_density; *nch_smoke_compressed_full++ = nch_smoke_density; } else{ + *maxvals++ = maxvali; *nch_smoke_compressed_full++ = nch_smoke_compressed; } +#else + if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ + *maxvals++ = maxval_density; + *nch_smoke_compressed_full++ = nch_smoke_density; + } + else{ + *nch_smoke_compressed_full++ = nch_smoke_compressed; + } +#endif *use_smokeframe_full = 0; if(use_tload_end == 1 && time_local > global_scase.tload_end)break; From 4441824fb79c41a0b6b18b50cdb011c31742b22a Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 26 Mar 2026 21:09:54 -0400 Subject: [PATCH 05/46] smokeview source: fix problem when pressing '0' to reset time --- Source/smokeview/callbacks.c | 10 +++------- Source/smokeview/smokeviewvars.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index f359a1491c..5a2b6fb979 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -623,10 +623,6 @@ void CheckTimeBound(void){ int i; if((timebar_drag==0&&itimes>nglobal_times-1)||(timebar_drag==1&&itimes<0)){ - if(timebar_drag==0){ - if(itimes>nglobal_times-1)itime_cycle++; - if(itimes<0)itime_cycle--; - } izone = 0; itimes=first_frame_index; if(render_status==RENDER_ON){ @@ -2807,9 +2803,9 @@ void Keyboard(unsigned char key, int flag){ break; case '0': if(plotstate==DYNAMIC_PLOTS){ - itime_cycle = 0; - UpdateTimes(); - return; + itimes = 0; + CheckTimeBound(); + IdleCB(); } break; case '~': diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 4392ea6ef2..1882bb699e 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1458,7 +1458,7 @@ SVEXTERN int SVDECL(nslicebounds, 0), SVDECL(npatchbounds,0), SVDECL(npatch2,0); SVEXTERN int SVDECL(niso_bounds,0); SVEXTERN int SVDECL(visLabels,0); SVEXTERN float SVDECL(framerate,-1.0); -SVEXTERN int SVDECL(seqnum,0),SVDECL(RenderTime,0),SVDECL(RenderTimeOld,0), SVDECL(itime_cycle,0); +SVEXTERN int SVDECL(seqnum, 0), SVDECL(RenderTime, 0), SVDECL(RenderTimeOld, 0); SVEXTERN int SVDECL(nopart,1); SVEXTERN int SVDECL(uindex,-1), SVDECL(vindex,-1), SVDECL(windex,-1); From 1edd25cc94b84ce6cacd921bc662af5c3d7d9388 Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 27 Mar 2026 11:13:59 -0400 Subject: [PATCH 06/46] smokeview source: add 3D smoke files when checking time bounds --- Source/smokeview/callbacks.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 5a2b6fb979..57181494ab 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -631,6 +631,12 @@ void CheckTimeBound(void){ current_script_command->exit=1; } } + for(i = 0; i < global_scase.smoke3dcoll.nsmoke3dinfo; i++){ + smoke3ddata *smoke3di; + + smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; + smoke3di->ismoke3d_time = 0; + } for(i=0;iitime=parti->ntimes-1; } + for(i = 0; i < global_scase.smoke3dcoll.nsmoke3dinfo; i++){ + smoke3ddata *smoke3di; + + smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; + smoke3di->ismoke3d_time = smoke3di->ntimes; + } for(i=0;i Date: Fri, 27 Mar 2026 11:16:13 -0400 Subject: [PATCH 07/46] smokeview source: add gui widget for setting time frame --- Source/smokeview/IOscript.c | 36 --------------- Source/smokeview/IOscript.h | 1 - Source/smokeview/glui_bounds.cpp | 78 ++++++++++++++++++++++++++++++-- Source/smokeview/glui_bounds.h | 2 + Source/smokeview/smokeviewvars.h | 1 + Source/smokeview/update.c | 2 +- 6 files changed, 79 insertions(+), 41 deletions(-) diff --git a/Source/smokeview/IOscript.c b/Source/smokeview/IOscript.c index ec9987f49b..a0a5aa434d 100644 --- a/Source/smokeview/IOscript.c +++ b/Source/smokeview/IOscript.c @@ -3569,42 +3569,6 @@ void ScriptGSliceOrien(scriptdata *scripti){ update_gslice=1; } -/* ------------------ SetTimeVal ------------------------ */ - -void SetTimeVal(float timeval){ - int i; - - if(global_times!=NULL&&nglobal_times>0){ - if(timevalglobal_times[nglobal_times-1]-0.0001)timeval=global_times[nglobal_times-1]-0.0001; - for(i=0;i 0){ + if(timeval < global_times[0])timeval = global_times[0]; + if(timeval > global_times[nglobal_times - 1] - 0.0001)timeval = global_times[nglobal_times - 1] - 0.0001; + for(i = 0; i < nglobal_times; i++){ + float tlow, thigh; + + if(i == 0){ + tlow = global_times[i]; + thigh = (global_times[i] + global_times[i + 1]) / 2.0; + } + else if(i == nglobal_times - 1){ + tlow = (global_times[i - 1] + global_times[i]) / 2.0; + thigh = global_times[i]; + } + else{ + tlow = (global_times[i - 1] + global_times[i]) / 2.0; + thigh = (global_times[i] + global_times[i + 1]) / 2.0; + } + if(tlow <= timeval && timeval < thigh){ + itimes = i; + stept = 1; + force_redisplay = 1; + UpdateFrameNumber(0); + UpdateTimeLabels(); + Keyboard('t', FROM_SMOKEVIEW); + SPINNER_framebounds->set_int_val(itimes); + break; + } + } + } +} + +/* ------------------ SetFrameVal ------------------------ */ + +void SetFrameVal(int frameval){ + int changed_frame = 0; + + if(global_times == NULL)return; + if(frameval < 0){ + frameval = 0; + changed_frame = 1; + } + if(frameval > nglobal_times - 1){ + frameval = nglobal_times-1; + changed_frame = 1; + } + itimes = frameval; + stept = 1; + force_redisplay = 1; + UpdateFrameNumber(0); + UpdateTimeLabels(); + Keyboard('t', FROM_SMOKEVIEW); + float timeval; + timeval = global_times[itimes]; + SPINNER_timebounds->set_float_val(timeval); + if(changed_frame==1)SPINNER_framebounds->set_int_val(frameval); +} + /* ------------------ TimeBoundCB ------------------------ */ void TimeBoundCB(int var){ updatemenu = 1; switch(var){ + case SET_FRAME: + SetFrameVal(glui_frame); + break; case SET_TIME: - SetTimeVal(glui_time); + GLUISetTimeVal(glui_time); break; case TBOUNDS_USE: GLUIUpdatePlot2DTbounds(); @@ -5610,12 +5678,16 @@ extern "C" void GLUIBoundsSetup(int main_window){ glui_bounds->add_button_to_panel(ROLLOUT_autoload, "Save auto load file list", SAVE_FILE_LIST, BoundBoundCB); glui_bounds->add_button_to_panel(ROLLOUT_autoload, "Auto load now", LOAD_FILES, BoundBoundCB); - ROLLOUT_time1a = glui_bounds->add_rollout_to_panel(PANEL_loadbounds, "Set time", false, LOAD_TIMESET_ROLLOUT, LoadRolloutCB); + ROLLOUT_time1a = glui_bounds->add_rollout_to_panel(PANEL_loadbounds, "Set time/frame", false, LOAD_TIMESET_ROLLOUT, LoadRolloutCB); TOGGLE_ROLLOUT(loadprocinfo, nloadprocinfo, ROLLOUT_time1a, LOAD_TIMESET_ROLLOUT, glui_bounds); SPINNER_timebounds = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Time:", GLUI_SPINNER_FLOAT, &glui_time); + BUTTON_SETTIME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set time", SET_TIME, TimeBoundCB); + + SPINNER_framebounds = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Frame:", GLUI_SPINNER_INT, &glui_frame); + BUTTON_SETFRAME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set frame", SET_FRAME, TimeBoundCB); + glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Offset:", GLUI_SPINNER_FLOAT, &timeoffset); - BUTTON_SETTIME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set", SET_TIME, TimeBoundCB); ROLLOUT_time2 = glui_bounds->add_rollout_to_panel(PANEL_loadbounds, "Set time limits", false, LOAD_TIMEBOUND_ROLLOUT, LoadRolloutCB); TOGGLE_ROLLOUT(loadprocinfo, nloadprocinfo, ROLLOUT_time2, LOAD_TIMEBOUND_ROLLOUT, glui_bounds); diff --git a/Source/smokeview/glui_bounds.h b/Source/smokeview/glui_bounds.h index d142307a38..b438653b78 100644 --- a/Source/smokeview/glui_bounds.h +++ b/Source/smokeview/glui_bounds.h @@ -55,6 +55,7 @@ #define PARTSKIP 28 #define UNLOAD_QDATA 203 #define SET_TIME 204 +#define SET_FRAME 229 #define TBOUNDS 205 #define TBOUNDS_USE 206 #define RELOAD_ALL_DATA 207 @@ -165,6 +166,7 @@ EXTERNCPP int GLUIGetChopMin(int type, char *label, int *set_valmin, float *val EXTERNCPP int GLUIGetChopMax(int type, char *label, int *set_valmax, float *valmax); EXTERNCPP int GLUISetChopMin(int type, char *label, int set_chopmin, float chopmin); EXTERNCPP int GLUISetChopMax(int type, char *label, int set_chopmax, float chopmax); +EXTERNCPP void GLUISetTimeVal(float timeval); EXTERNCPP void GLUIUpdateTextureDisplay(void); EXTERNCPP void GLUIUpdateLoadAllSlices(void); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 1882bb699e..ad03e41e26 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -943,6 +943,7 @@ SVEXTERN int SVDECL(saved_colorbar, -1); SVEXTERN int SVDECL(levelset_colorbar,-1), SVDECL(wallthickness_colorbar,-1); SVEXTERN colorbardata SVDECL(*fire_colorbar,NULL); SVEXTERN float SVDECL(glui_time,0.0); +SVEXTERN int SVDECL(glui_frame, 0); SVEXTERN int show_mode; SVEXTERN int SVDECL(part5colorindex,0), SVDECL(show_tracers_always,0); SVEXTERN int SVDECL(select_avatar,0), SVDECL(selected_avatar_tag,-1), SVDECL(view_from_selected_avatar,0); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 01e8075ee4..0776815036 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -2238,7 +2238,7 @@ void UpdateShowScene(void){ if(update_stept==1){ SHOW_UPDATE(update_stept); update_stept = 0; - SetTimeVal(time_paused); + GLUISetTimeVal(time_paused); END_SHOW_UPDATE(update_stept); } if(update_movie_parms==1){ From 01d14dfa290c06803e9416c142115fb3557443e7 Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 27 Mar 2026 14:41:04 -0400 Subject: [PATCH 08/46] smokeview source: allow a 1X resolution multiplier and let that be the default --- Source/smokeview/glui_motion.cpp | 4 ++-- Source/smokeview/smokeviewvars.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/smokeview/glui_motion.cpp b/Source/smokeview/glui_motion.cpp index 297a3d72fd..9ee5559778 100644 --- a/Source/smokeview/glui_motion.cpp +++ b/Source/smokeview/glui_motion.cpp @@ -1490,9 +1490,9 @@ extern "C" void GLUIMotionSetup(int main_window){ render_size_index = RenderWindow; RenderCB(RENDER_RESOLUTION); - glui_resolution_multiplier=CLAMP(resolution_multiplier,2,10); + glui_resolution_multiplier=CLAMP(resolution_multiplier,1,10); SPINNER_resolution_multiplier = glui_motion->add_spinner_to_panel(ROLLOUT_image_size, "multiplier:", GLUI_SPINNER_INT, &glui_resolution_multiplier, RENDER_MULTIPLIER, RenderCB); - SPINNER_resolution_multiplier->set_int_limits(2, 10); + SPINNER_resolution_multiplier->set_int_limits(1, 10); RenderCB(RENDER_MULTIPLIER); PANEL_360 = glui_motion->add_panel_to_panel(ROLLOUT_image_size, (char *)deg360, true); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index ad03e41e26..5a5e72fb8d 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -598,7 +598,7 @@ SVEXTERN int SVDECL(visCompartments, 1); SVEXTERN int render_mode, render_times; SVEXTERN int SVDECL(render_status, 0); SVEXTERN int SVDECL(resolution_multiplier, 1); -SVEXTERN int SVDECL(glui_resolution_multiplier, 2); +SVEXTERN int SVDECL(glui_resolution_multiplier, 1); SVEXTERN char render_file_base[1024]; SVEXTERN char html_file_base[1024]; SVEXTERN int SVDECL(script_render_width, 320), SVDECL(script_render_height, 240); From 5523de1e697fd2917423b210eb9dca518ef7ca1e Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 27 Mar 2026 14:57:22 -0400 Subject: [PATCH 09/46] smokeview source: eliminate duplicate rendering of frame 0 --- Source/smokeview/callbacks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 57181494ab..7fe03e7b30 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -4172,8 +4172,8 @@ void DoNonStereo(void){ IdleDisplay(); - stop_rendering = 1; - if(plotstate==DYNAMIC_PLOTS && nglobal_times>0&&itimes>=0&&itimes0&&itimes==nglobal_times-1)stop_rendering = 1; if(render_mode==RENDER_NORMAL){ int i, ibuffer = 0; GLubyte **screenbuffers; From 79263646f1ea9db5e4389b4f4e91fb8458c1546f Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 27 Mar 2026 15:36:01 -0400 Subject: [PATCH 10/46] smokeview source: fix check for last rendering frame --- Source/smokeview/callbacks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 7fe03e7b30..4671f6979b 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -671,7 +671,7 @@ void CheckTimeBound(void){ smoke3ddata *smoke3di; smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; - smoke3di->ismoke3d_time = smoke3di->ntimes; + smoke3di->ismoke3d_time = smoke3di->ntimes-1; } for(i=0;i Date: Fri, 27 Mar 2026 15:36:38 -0400 Subject: [PATCH 11/46] smokeview source: remove check if last 3D smoke frame is current than current one --- Source/shared/readsmoke.c | 1 - Source/shared/readsmvfile.c | 1 - Source/shared/shared_structures.h | 2 +- Source/smokeview/IOsmoke.c | 5 +---- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Source/shared/readsmoke.c b/Source/shared/readsmoke.c index e1e4fe7324..21c7e6be5c 100644 --- a/Source/shared/readsmoke.c +++ b/Source/shared/readsmoke.c @@ -20,7 +20,6 @@ void FreeSmoke3D(smv_case *scase, smoke3ddata *smoke3di){ meshi = scase->meshescoll.meshinfo + smoke3di->blocknumber; FREEMEMORY(meshi->is_firenode); meshi->is_firenodeptr = NULL; - smoke3di->lastiframe = -999; float ext; char *label; diff --git a/Source/shared/readsmvfile.c b/Source/shared/readsmvfile.c index 8e5a192eed..5b7a327981 100644 --- a/Source/shared/readsmvfile.c +++ b/Source/shared/readsmvfile.c @@ -3737,7 +3737,6 @@ int ParseSMOKE3DProcess(smv_case *scase, bufferstreamdata *stream, char *buffer, smoke3di->is_fire = 0; smoke3di->file_size = 0; smoke3di->blocknumber = blocknumber; - smoke3di->lastiframe = -999; smoke3di->ismoke3d_time = 0; STRCPY(buffer2, bufferptr); STRCAT(buffer2, ".svz"); diff --git a/Source/shared/shared_structures.h b/Source/shared/shared_structures.h index 8a86fcbda8..94702215bd 100644 --- a/Source/shared/shared_structures.h +++ b/Source/shared/shared_structures.h @@ -1447,7 +1447,7 @@ typedef struct _smoke3ddata { int fire_alpha, co2_alpha; float fire_alphas[256], co2_alphas[256]; int *timeslist; - int ntimes, ntimes_old, ismoke3d_time, lastiframe, ntimes_full; + int ntimes, ntimes_old, ismoke3d_time, ntimes_full; int nchars_uncompressed; int ncomp_smoke_total; diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index aebf73fcaa..9d3a324f60 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -4255,10 +4255,7 @@ void MergeSmoke3DAll(void){ if(smoke3di->timeslist==NULL)continue; smoke3di->ismoke3d_time = smoke3di->timeslist[itimes]; if(IsSmokeComponentPresent(smoke3di) == 0)continue; - if(smoke3di->ismoke3d_time != smoke3di->lastiframe){ - smoke3di->lastiframe = smoke3di->ismoke3d_time; - UpdateSmoke3D(smoke3di); - } + UpdateSmoke3D(smoke3di); MergeSmoke3D(smoke3di); } } From cd931ba30534938413c8011ef08f0cbd48d36221 Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 27 Mar 2026 20:21:59 -0400 Subject: [PATCH 12/46] smokeview source: split out uncompress porition of 3d smoke merge routine --- Source/smokeview/IOsmoke.c | 29 +++++++++++++++++++++++------ Source/smokeview/smokeheaders.h | 1 + Source/smokeview/update.c | 6 +++++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index e7b7445897..3de2714e04 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -3812,9 +3812,9 @@ void ReadSmoke3DAllMeshes(int iframe, int smoketype, int *errorcode){ } } -/* ------------------ UpdateSmoke3d ------------------------ */ +/* ------------------ UncompressSmoke3D ------------------------ */ -int UpdateSmoke3D(smoke3ddata *smoke3di){ +int UncompressSmoke3D(smoke3ddata *smoke3di){ int iframe_local; int countin; uLongf countout; @@ -4265,9 +4265,9 @@ void MergeSmoke3D(smoke3ddata *smoke3dset){ PRINT_TIMER(merge_smoke_time, "MergeSmoke3D"); } -/* ------------------ MergeSmoke3DAll ------------------------ */ +/* ------------------ UncompressSmoke3DAll ------------------------ */ -void MergeSmoke3DAll(void){ +void UncompressSmoke3DAll(void){ int i; for(i = 0;i < global_scase.smoke3dcoll.nsmoke3dinfo;i++){ @@ -4276,13 +4276,30 @@ void MergeSmoke3DAll(void){ smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; if(smoke3di->loaded == 0 || smoke3di->display == 0)continue; assert(smoke3di->timeslist != NULL); - if(smoke3di->timeslist==NULL)continue; + if(smoke3di->timeslist == NULL)continue; smoke3di->ismoke3d_time = smoke3di->timeslist[itimes]; if(IsSmokeComponentPresent(smoke3di) == 0)continue; if(smoke3di->ismoke3d_time != smoke3di->lastiframe){ smoke3di->lastiframe = smoke3di->ismoke3d_time; - UpdateSmoke3D(smoke3di); + UncompressSmoke3D(smoke3di); } + } +} + +/* ------------------ MergeSmoke3DAll ------------------------ */ + +void MergeSmoke3DAll(void){ + int i; + + for(i = 0;i < global_scase.smoke3dcoll.nsmoke3dinfo;i++){ + smoke3ddata *smoke3di; + + smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; + if(smoke3di->loaded == 0 || smoke3di->display == 0)continue; + assert(smoke3di->timeslist != NULL); + if(smoke3di->timeslist==NULL)continue; + smoke3di->ismoke3d_time = smoke3di->timeslist[itimes]; + if(IsSmokeComponentPresent(smoke3di) == 0)continue; MergeSmoke3D(smoke3di); } } diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 78be351404..9451bc350f 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -566,6 +566,7 @@ EXTERNCPP void MakeIBlankSmoke3D(void); EXTERNCPP void MakeTimesMap(float *times, unsigned char **times_map_ptr, int n); EXTERNCPP void MergeSmoke3D(smoke3ddata *smoke3dset); EXTERNCPP void MergeSmoke3DAll(void); +EXTERNCPP void UncompressSmoke3DAll(void); EXTERNCPP FILE_SIZE ReadSmoke3D(int iframe, int ifile, int flag, int first_time, int *errorcode); EXTERNCPP void ReadSmoke3DAllMeshes(int iframe, int smoketype, int *errorcode); EXTERNCPP void SmokeWrapup(void); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index bd38af31fa..eb32a43a75 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -170,10 +170,14 @@ void UpdateFrameNumber(int changetime){ } } if(show3dsmoke==1 && global_scase.smoke3dcoll.nsmoke3dinfo > 0){ + INIT_PRINT_TIMER(update_smoke_time); + UncompressSmoke3DAll(); + PRINT_TIMER(update_smoke_time, "UncompressSmoke3D"); + INIT_PRINT_TIMER(merge_smoke_time); MergeSmoke3DAll(); PrintMemoryInfo; - PRINT_TIMER(merge_smoke_time, "UpdateSmoke3D + MergeSmoke3D"); + PRINT_TIMER(merge_smoke_time, "MergeSmoke3D"); } if(showpatch==1){ for(i=0;i Date: Fri, 27 Mar 2026 22:06:23 -0400 Subject: [PATCH 13/46] smokeview source: merge and uncompress 3d smoke in parallel --- Source/shared/threader.c | 11 +++++++++ Source/shared/threader.h | 3 ++- Source/smokeview/IOsmoke.c | 38 ++++++++++++++++++++++++++++---- Source/smokeview/readsmv.c | 3 +++ Source/smokeview/smokeheaders.h | 8 +++++++ Source/smokeview/smokeviewvars.h | 8 +++++++ Source/smokeview/update.c | 10 +++++++++ 7 files changed, 76 insertions(+), 5 deletions(-) diff --git a/Source/shared/threader.c b/Source/shared/threader.c index e52e880795..2bc541b801 100644 --- a/Source/shared/threader.c +++ b/Source/shared/threader.c @@ -130,6 +130,17 @@ void THREADruni(threaderdata *thi, unsigned char *datainfo, int sizedatai){ #endif } +/* ------------------ THREADrunloop ------------------------ */ + +void THREADrunloop(threaderdata *thi){ + int i, thread_ids[MAX_THREADS]; + + for(i = 0;i < MAX_THREADS;i++){ + thread_ids[i] = i; + } + THREADruni(thi, (unsigned char *)thread_ids, sizeof(int)); +} + /* ------------------ THREADrun ------------------------ */ void THREADrun(threaderdata *thi){ diff --git a/Source/shared/threader.h b/Source/shared/threader.h index 4bc19ee78a..dd8d221e6d 100644 --- a/Source/shared/threader.h +++ b/Source/shared/threader.h @@ -33,7 +33,8 @@ typedef struct _threaderdata{ EXTERNCPP void THREADcontrol(threaderdata *thi, int var); EXTERNCPP void THREADrun(threaderdata *thi); -EXTERNCPP void THREADruni(threaderdata *thi, unsigned char *datainfo, int sizedatai); +EXTERNCPP void THREADrunloop(threaderdata *thi); +EXTERNCPP void THREADruni(threaderdata * thi, unsigned char *datainfo, int sizedatai); EXTERNCPP threaderdata *THREADinit(int *nthreads_arg, int *threading_on_arg, void *(*run_arg)(void *arg)); //*** threader controls diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 3de2714e04..a962b96b11 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -4267,10 +4267,22 @@ void MergeSmoke3D(smoke3ddata *smoke3dset){ /* ------------------ UncompressSmoke3DAll ------------------------ */ +#ifdef pp_SPEEDUP + void *UncompressSmoke3DAll(void *arg){ +#else void UncompressSmoke3DAll(void){ - int i; +#endif + int i, nthreads, thread_num; +#ifdef pp_SPEEDUP - for(i = 0;i < global_scase.smoke3dcoll.nsmoke3dinfo;i++){ + thread_num = *(int *)arg; + nthreads = uncompresssmoke3d_threads->n_threads; +#else + thread_num = 0; + nthreads = 1; +#endif + + for(i = thread_num;i < global_scase.smoke3dcoll.nsmoke3dinfo;i+=nthreads){ smoke3ddata *smoke3di; smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; @@ -4284,14 +4296,29 @@ void UncompressSmoke3DAll(void){ UncompressSmoke3D(smoke3di); } } +#ifdef pp_SPEEDUP + THREAD_EXIT(uncompresssmoke3d_threads); +#endif } /* ------------------ MergeSmoke3DAll ------------------------ */ +#ifdef pp_SPEEDUP + void *MergeSmoke3DAll(void *arg){ +#else void MergeSmoke3DAll(void){ - int i; +#endif + int i, nthreads, thread_num; +#ifdef pp_SPEEDUP - for(i = 0;i < global_scase.smoke3dcoll.nsmoke3dinfo;i++){ + thread_num = *(int *)arg; + nthreads = mergesmoke3d_threads->n_threads; +#else + thread_num = 0; + nthreads = 1; +#endif + + for(i = thread_num;i < global_scase.smoke3dcoll.nsmoke3dinfo;i+=nthreads){ smoke3ddata *smoke3di; smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; @@ -4302,6 +4329,9 @@ void MergeSmoke3DAll(void){ if(IsSmokeComponentPresent(smoke3di) == 0)continue; MergeSmoke3D(smoke3di); } +#ifdef pp_SPEEDUP + THREAD_EXIT(mergesmoke3d_threads); +#endif } /* ------------------ UpdateSmoke3dMenuLabels ------------------------ */ diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 6d3bb17fb2..ccfd10f63b 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -2840,6 +2840,9 @@ int ReadSMV_Configure(){ #ifdef pp_SPEEDUP makeiblank_threads = THREADinit(&n_makeiblank_threads, &use_makeiblank_threads, MakeIBlank); THREADrun(makeiblank_threads); + + mergesmoke3d_threads = THREADinit(&n_mergesmoke3d_threads, &use_mergesmoke3d_threads, MergeSmoke3DAll); + uncompresssmoke3d_threads = THREADinit(&n_uncompresssmoke3d_threads, &use_uncompresssmoke3d_threads, UncompressSmoke3DAll); #else MakeIBlank(); #endif diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 9451bc350f..223cad258e 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -565,8 +565,16 @@ EXTERNCPP int IsSmokeLoaded(smv_case *scase); EXTERNCPP void MakeIBlankSmoke3D(void); EXTERNCPP void MakeTimesMap(float *times, unsigned char **times_map_ptr, int n); EXTERNCPP void MergeSmoke3D(smoke3ddata *smoke3dset); +#ifdef pp_SPEEDUP +EXTERNCPP void *MergeSmoke3DAll(void *arg); +#else EXTERNCPP void MergeSmoke3DAll(void); +#endif +#ifdef pp_SPEEDUP +EXTERNCPP void *UncompressSmoke3DAll(void *arg); +#else EXTERNCPP void UncompressSmoke3DAll(void); +#endif EXTERNCPP FILE_SIZE ReadSmoke3D(int iframe, int ifile, int flag, int first_time, int *errorcode); EXTERNCPP void ReadSmoke3DAllMeshes(int iframe, int smoketype, int *errorcode); EXTERNCPP void SmokeWrapup(void); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 0987afd15d..8946814f64 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -82,6 +82,14 @@ SVEXTERN threaderdata SVDECL(*patchbound_threads, NULL); SVEXTERN int SVDECL(n_playmovie_threads, 1), SVDECL(use_playmovie_threads, 1); SVEXTERN threaderdata SVDECL(*playmovie_threads, NULL); +//*** merge smoke +SVEXTERN int SVDECL(n_mergesmoke3d_threads, 4), SVDECL(use_mergesmoke3d_threads, 1); +SVEXTERN threaderdata SVDECL(*mergesmoke3d_threads, NULL); + +//*** uncompress smoke +SVEXTERN int SVDECL(n_uncompresssmoke3d_threads, 4), SVDECL(use_uncompresssmoke3d_threads, 1); +SVEXTERN threaderdata SVDECL(*uncompresssmoke3d_threads, NULL); + //*** readallgeom SVEXTERN int SVDECL(n_readallgeom_threads, 4), SVDECL(use_readallgeom_threads, 1); SVEXTERN threaderdata SVDECL(*readallgeom_threads, NULL); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index eb32a43a75..a5914252ab 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -171,11 +171,21 @@ void UpdateFrameNumber(int changetime){ } if(show3dsmoke==1 && global_scase.smoke3dcoll.nsmoke3dinfo > 0){ INIT_PRINT_TIMER(update_smoke_time); +#ifdef pp_SPEEDUP + THREADrunloop(uncompresssmoke3d_threads); + THREADcontrol(uncompresssmoke3d_threads, THREAD_JOIN); +#else UncompressSmoke3DAll(); +#endif PRINT_TIMER(update_smoke_time, "UncompressSmoke3D"); INIT_PRINT_TIMER(merge_smoke_time); +#ifdef pp_SPEEDUP + THREADrunloop(mergesmoke3d_threads); + THREADcontrol(mergesmoke3d_threads, THREAD_JOIN); +#else MergeSmoke3DAll(); +#endif PrintMemoryInfo; PRINT_TIMER(merge_smoke_time, "MergeSmoke3D"); } From dcea341fa2b181ea59865b82e1db306b599ca413 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 29 Mar 2026 03:05:06 -0400 Subject: [PATCH 14/46] smokeview source: improve smoke/fire display --- Source/smokeview/IOsmoke.c | 4 ++-- Source/smokeview/callbacks.c | 38 +++++++++++++++++++++++--------- Source/smokeview/glui_bounds.cpp | 31 +++++++++++++++++++++++--- Source/smokeview/glui_bounds.h | 2 ++ Source/smokeview/smokeheaders.h | 5 +++++ 5 files changed, 65 insertions(+), 15 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 9d3a324f60..0269331124 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -4231,14 +4231,12 @@ void MergeSmoke3DBlack(smoke3ddata *smoke3dset){ /* ------------------ MergeSmoke3D ------------------------ */ void MergeSmoke3D(smoke3ddata *smoke3dset){ - INIT_PRINT_TIMER(merge_smoke_time); if(smoke3d_black==1){ MergeSmoke3DBlack(smoke3dset); } else{ MergeSmoke3DColors(smoke3dset); } - PRINT_TIMER(merge_smoke_time, "MergeSmoke3D"); } /* ------------------ MergeSmoke3DAll ------------------------ */ @@ -4246,6 +4244,7 @@ void MergeSmoke3D(smoke3ddata *smoke3dset){ void MergeSmoke3DAll(void){ int i; + INIT_PRINT_TIMER(merge_smoke_time); for(i = 0;i < global_scase.smoke3dcoll.nsmoke3dinfo;i++){ smoke3ddata *smoke3di; @@ -4258,6 +4257,7 @@ void MergeSmoke3DAll(void){ UpdateSmoke3D(smoke3di); MergeSmoke3D(smoke3di); } + PRINT_TIMER(merge_smoke_time, "MergeSmoke3DAll"); } /* ------------------ UpdateSmoke3dMenuLabels ------------------------ */ diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 4671f6979b..ac52f42cef 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -622,7 +622,7 @@ void MouseSelectGeom(int x, int y){ void CheckTimeBound(void){ int i; - if((timebar_drag==0&&itimes>nglobal_times-1)||(timebar_drag==1&&itimes<0)){ + if((timebar_drag==0&&(itimes>nglobal_times-1))||(timebar_drag==1&&itimes<=0)){ izone = 0; itimes=first_frame_index; if(render_status==RENDER_ON){ @@ -856,16 +856,31 @@ int TimebarClick(int xm, int ym){ return 0; } +/* ------------------ UpdateTime ------------------------ */ + +void UpdateTime(int time){ + if(nglobal_times > 0){ + itimes = time; + UpdateGluiFrame(itimes); + CheckTimeBound(); + IdleCB(); + } +} + /* ------------------ TimebarDrag ------------------------ */ void TimebarDrag(int xm){ if(nglobal_times>0){ - itimes = GetTimeBarFrame(xm); - CheckTimeBound(); + int itime; + + itime = GetTimeBarFrame(xm); + UpdateTime(itime); timebar_drag = 1; } - IdleCB(); -} + else{ + IdleCB(); + } +} /* ------------------ UpdateMouseInfo ------------------------ */ @@ -2815,9 +2830,8 @@ void Keyboard(unsigned char key, int flag){ break; case '0': if(plotstate==DYNAMIC_PLOTS){ - itimes = 0; - CheckTimeBound(); - IdleCB(); + SetFrameVal(0,0); + SetFrameVal(0,0); } break; case '~': @@ -3037,9 +3051,11 @@ void Keyboard(unsigned char key, int flag){ if(plotstate==DYNAMIC_PLOTS){ if(timebar_drag==0){ itimes += skip_global*FlowDir; + if(itimes<0)itimes = nglobal_times - 1; + if(itimes>nglobal_times - 1)itimes = 0; + SetFrameVal(itimes,stept); + SetFrameVal(itimes,stept); } - CheckTimeBound(); - IdleCB(); return; } switch(iplot_state){ @@ -3635,6 +3651,8 @@ void UpdateFrame(float thisinterval, int *changetime, int *redisplay){ itimes += render_skip*FlowDir; } } + SetFrameVal(itimes,stept); + SetFrameVal(itimes,stept); } if(script_render_flag == 1&&IS_LOADRENDER)itimes = script_itime; diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index d69f45bd98..d961bcae7a 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -4488,7 +4488,7 @@ void GLUISetTimeVal(float timeval){ /* ------------------ SetFrameVal ------------------------ */ -void SetFrameVal(int frameval){ +void SetFrameVal(int frameval, int stept_arg){ int changed_frame = 0; if(global_times == NULL)return; @@ -4505,13 +4505,20 @@ void SetFrameVal(int frameval){ force_redisplay = 1; UpdateFrameNumber(0); UpdateTimeLabels(); - Keyboard('t', FROM_SMOKEVIEW); + stept = stept_arg; + //Keyboard('t', FROM_SMOKEVIEW); float timeval; timeval = global_times[itimes]; SPINNER_timebounds->set_float_val(timeval); if(changed_frame==1)SPINNER_framebounds->set_int_val(frameval); } +/* ------------------ UpdateGluiFrame ------------------------ */ + +void UpdateGluiFrame(int val){ + if(SPINNER_framebounds!=NULL)SPINNER_framebounds->set_int_val(val); +} + /* ------------------ TimeBoundCB ------------------------ */ void TimeBoundCB(int var){ @@ -4519,9 +4526,25 @@ void TimeBoundCB(int var){ updatemenu = 1; switch(var){ case SET_FRAME: - SetFrameVal(glui_frame); + SetFrameVal(glui_frame,0); + SetFrameVal(glui_frame,0); + break; + case PREV_FRAME: + glui_frame--; + if(glui_frame<0)glui_frame = nglobal_times-1; + SetFrameVal(glui_frame,0); + SetFrameVal(glui_frame,0); + SPINNER_framebounds->set_int_val(glui_frame); + break; + case NEXT_FRAME: + glui_frame++; + if(glui_frame>nglobal_times-1)glui_frame=0; + SetFrameVal(glui_frame,0); + SetFrameVal(glui_frame,0); + SPINNER_framebounds->set_int_val(glui_frame); break; case SET_TIME: + GLUISetTimeVal(glui_time); GLUISetTimeVal(glui_time); break; case TBOUNDS_USE: @@ -5686,6 +5709,8 @@ extern "C" void GLUIBoundsSetup(int main_window){ SPINNER_framebounds = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Frame:", GLUI_SPINNER_INT, &glui_frame); BUTTON_SETFRAME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set frame", SET_FRAME, TimeBoundCB); + glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Prev frame", PREV_FRAME, TimeBoundCB); + glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Next frame", NEXT_FRAME, TimeBoundCB); glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Offset:", GLUI_SPINNER_FLOAT, &timeoffset); diff --git a/Source/smokeview/glui_bounds.h b/Source/smokeview/glui_bounds.h index b438653b78..d4ec661e3c 100644 --- a/Source/smokeview/glui_bounds.h +++ b/Source/smokeview/glui_bounds.h @@ -56,6 +56,8 @@ #define UNLOAD_QDATA 203 #define SET_TIME 204 #define SET_FRAME 229 +#define PREV_FRAME 230 +#define NEXT_FRAME 231 #define TBOUNDS 205 #define TBOUNDS_USE 206 #define RELOAD_ALL_DATA 207 diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 557eb23271..234da9c719 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -7,6 +7,11 @@ #include "shared_structures.h" +//*** glui_bounds.cpp headers + +EXTERNCPP void SetFrameVal(int frameval, int stept_arg); +EXTERNCPP void UpdateGluiFrame(int val); + //*** glui_clip.cpp headers EXTERNCPP void GLUIClipSetup(int main_window); From 447198803c592b9bc63153bc9b4d4aad1a13f12d Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 08:58:59 -0400 Subject: [PATCH 15/46] smokeview source: change itimes -> iglobal_times to be consiste t witnh other time variables --- Source/smokeview/IOboundary.c | 106 +++++++++++++++---------------- Source/smokeview/IOgeometry.c | 4 +- Source/smokeview/IOhvac.c | 2 +- Source/smokeview/IOiso.c | 4 +- Source/smokeview/IOobjects.c | 22 +++---- Source/smokeview/IOpart.c | 6 +- Source/smokeview/IOplot2d.c | 12 ++-- Source/smokeview/IOscript.c | 22 +++---- Source/smokeview/IOshooter.c | 2 +- Source/smokeview/IOslice.c | 18 +++--- Source/smokeview/IOsmoke.c | 12 ++-- Source/smokeview/IOtour.c | 6 +- Source/smokeview/IOvolsmoke.c | 2 +- Source/smokeview/IOwui.c | 6 +- Source/smokeview/IOzone.c | 4 +- Source/smokeview/callbacks.c | 58 ++++++++--------- Source/smokeview/colortimebar.c | 8 +-- Source/smokeview/drawGeometry.c | 38 +++++------ Source/smokeview/glui_bounds.cpp | 8 +-- Source/smokeview/output.c | 2 +- Source/smokeview/renderimage.c | 22 +++---- Source/smokeview/smokeviewvars.h | 2 +- Source/smokeview/update.c | 30 ++++----- Source/smokeview/viewports.c | 10 +-- 24 files changed, 203 insertions(+), 203 deletions(-) diff --git a/Source/smokeview/IOboundary.c b/Source/smokeview/IOboundary.c index b452d77df6..b03f1d3524 100644 --- a/Source/smokeview/IOboundary.c +++ b/Source/smokeview/IOboundary.c @@ -291,7 +291,7 @@ void DrawOnlyThreshold(const meshdata *meshi){ } patchi = global_scase.patchinfo+meshi->patchfilenum; - if(patch_times[0]>global_times[itimes]||patchi->display==0)return; + if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); /* if a contour boundary does not match a blockage face then draw "both sides" of boundary */ @@ -305,7 +305,7 @@ void DrawOnlyThreshold(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -335,19 +335,19 @@ void DrawOnlyThreshold(const meshdata *meshi){ color12 = NULL; color21 = NULL; color22 = NULL; - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol]){ + if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol]){ color11 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol+1]){ + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1]){ color12 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol]){ + if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol]){ color21 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol+1]){ + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1]){ color22 = &char_color[0]; nnulls--; } @@ -388,7 +388,7 @@ void DrawOnlyThreshold(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -420,19 +420,19 @@ void DrawOnlyThreshold(const meshdata *meshi){ color22 = NULL; nnulls = 4; - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol]){ + if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol]){ color11 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol+1]){ + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1]){ color12 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol]){ + if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol]){ color21 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol+1]){ + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1]){ color22 = &char_color[0]; nnulls--; } @@ -468,7 +468,7 @@ void DrawOnlyThreshold(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst != NULL && pfi->meshinfo != NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -498,19 +498,19 @@ void DrawOnlyThreshold(const meshdata *meshi){ color21 = NULL; color22 = NULL; nnulls = 4; - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol]){ + if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol]){ color11 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol+1]){ + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1]){ color12 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol]){ + if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol]){ color21 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol+1]){ + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1]){ color22 = &char_color[0]; nnulls--; } @@ -2196,7 +2196,7 @@ void SetTimeState(void){ if(timestate==DYNAMIC_PLOTS){ update_stept = 1; if(global_times!=NULL){ - time_paused = global_times[itimes]; + time_paused = global_times[iglobal_times]; } else{ time_paused = 0.0; @@ -2317,7 +2317,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ int is_time_arrival = 0; if(strcmp(patchi->label.shortlabel, "t_a") == 0)is_time_arrival = 1; - if(global_times!=NULL&&patch_times[0]>global_times[itimes])return; + if(global_times!=NULL&&patch_times[0]>global_times[iglobal_times])return; if(patchi->display == 0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); @@ -2358,7 +2358,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; CheckMemory; - if(pfi->obst != NULL && pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0)continue; + if(pfi->obst != NULL && pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0)continue; if(pfi->internal_mesh_face == 1)continue; drawit=0; @@ -2438,7 +2438,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; CheckMemory; if(pfi->internal_mesh_face == 1)continue; - if(pfi->obst!=NULL && pfi->obst->showtimelist!=NULL&& pfi->obst->showtimelist[itimes]==0)continue; + if(pfi->obst!=NULL && pfi->obst->showtimelist!=NULL&& pfi->obst->showtimelist[iglobal_times]==0)continue; drawit=0; if(pfi->vis==1&&pfi->dir>0){ @@ -2517,7 +2517,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; CheckMemory; if(pfi->internal_mesh_face==1)continue; - if(pfi->obst!=NULL && pfi->obst->showtimelist!=NULL && pfi->obst->showtimelist[itimes]==0)continue; + if(pfi->obst!=NULL && pfi->obst->showtimelist!=NULL && pfi->obst->showtimelist[iglobal_times]==0)continue; drawit=0; if(pfi->vis==1&&pfi->dir<0){ @@ -2615,7 +2615,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ patchval_iframe=meshi->patchval_iframe; patchi = global_scase.patchinfo + meshi->patchfilenum; - if(patch_times[0]>global_times[itimes]||patchi->display==0)return; + if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; int set_valmin, set_valmax; char *label; @@ -2639,7 +2639,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst!=NULL&&pfi->meshinfo!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -2674,10 +2674,10 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ color12=clear_color; color21=clear_color; color22=clear_color; - if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol ])color11=burn_color; - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; - if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol ])color21=burn_color; - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; + if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol ])color21=burn_color; + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; if(color11==color12&&color11==color21&&color11==color22){ glColor4fv(color11); glTexCoord1f(r11);glVertex3fv(xyzp1); @@ -2725,7 +2725,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -2760,10 +2760,10 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ color12=clear_color; color21=clear_color; color22=clear_color; - if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol ])color11=burn_color; - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; - if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol ])color21=burn_color; - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; + if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol ])color21=burn_color; + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; if(color11==color12&&color11==color21&&color11==color22){ glColor4fv(color11); glTexCoord1f(r11);glVertex3fv(xyzp1); @@ -2807,7 +2807,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ pfi = patchi->patchfaceinfo; if(pfi->obst!=NULL&&pfi->meshinfo!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -2841,10 +2841,10 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ color12=clear_color; color21=clear_color; color22=clear_color; - if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol ])color11=burn_color; - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; - if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol ])color21=burn_color; - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; + if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol ])color21=burn_color; + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; if(color11==color12&&color11==color21&&color11==color22){ glColor4fv(color11); glTexCoord1f(r11);glVertex3fv(xyzp1); @@ -2914,7 +2914,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ } patchi = global_scase.patchinfo + meshi->patchfilenum; - if(patch_times[0]>global_times[itimes]||patchi->display==0)return; + if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); /* if a contour boundary does not match a blockage face then draw "both sides" of boundary */ @@ -2926,7 +2926,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst != NULL && pfi->meshinfo != NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -2950,7 +2950,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ for(icol=0;icolthresholdtime[nn1+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; glColor4fv(color11); glVertex3fv(xyzp1); @@ -2980,7 +2980,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -3005,7 +3005,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ for(icol=0;icolthresholdtime[nn1+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; glColor4fv(color11); glVertex3fv(xyzp1); @@ -3031,7 +3031,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst != NULL && pfi->meshinfo != NULL){ - if(pfi->obst->showtimelist!=NULL&& pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&& pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -3055,7 +3055,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ for(icol=0;icolthresholdtime[nn1+icol ]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; glColor4fv(color11); glVertex3fv(xyzp1); @@ -3148,7 +3148,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchval_iframe == NULL)return; patchi = global_scase.patchinfo+meshi->patchfilenum; - if(patch_times[0]>global_times[itimes]||patchi->display==0)return; + if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); nn = 0; @@ -3159,7 +3159,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst != NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -3198,7 +3198,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchventcolors==NULL){ color11 = rgb_patch+4*cval; if(vis_threshold==1&&vis_onlythreshold==0&&do_threshold==1){ - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; + if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; } } else{ @@ -3233,7 +3233,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst!=NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -3276,7 +3276,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchventcolors==NULL){ color11 = rgb_patch+4*cval; if(vis_threshold==1&&vis_onlythreshold==0&&do_threshold==1){ - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; + if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; } } else{ @@ -3307,7 +3307,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ pfi = patchi->patchfaceinfo + n; if(pfi->obst != NULL){ - if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[itimes]==0){ + if(pfi->obst->showtimelist!=NULL&&pfi->obst->showtimelist[iglobal_times]==0){ nn += pfi->nrow*pfi->ncol; continue; } @@ -3345,7 +3345,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchventcolors==NULL){ color11 = rgb_patch+4*cval; if(vis_threshold==1&&vis_onlythreshold==0&&do_threshold==1){ - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[itimes]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; + if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; } } else{ @@ -3411,8 +3411,8 @@ meshdata *GetPatchMeshNabor(meshdata *meshi, int *ib){ void DrawBoundaryFrame(int flag){ int i; - if(use_tload_begin==1 && global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; for(i=0;igeomtype==GEOM_ISO){ if(plotstate != DYNAMIC_PLOTS)continue; - if(use_tload_begin==1&&global_times[itimes]global_scase.tload_end)continue; + if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)continue; } for(j = 0; j < geomlisti->ntriangles; j++){ diff --git a/Source/smokeview/IOhvac.c b/Source/smokeview/IOhvac.c index 6405e079b2..2babd6737a 100644 --- a/Source/smokeview/IOhvac.c +++ b/Source/smokeview/IOhvac.c @@ -278,7 +278,7 @@ void DrawHVACFan(hvacductdata *ducti, float *xyz, float size, float diam, int st if(state==1&&global_times != NULL){ float angle2, time2; - time2 = global_times[itimes]; + time2 = global_times[iglobal_times]; angle2 = 360.0*time2 / 10.0; glRotatef(angle2, 0.0, 1.0, 0.0); } diff --git a/Source/smokeview/IOiso.c b/Source/smokeview/IOiso.c index 3cd4c3d836..59660f7ed2 100644 --- a/Source/smokeview/IOiso.c +++ b/Source/smokeview/IOiso.c @@ -1279,8 +1279,8 @@ void DrawIsoOrig(int tranflag){ void DrawIso(int tranflag){ if(niso_opaques>0||niso_trans>0){ - if(use_tload_begin==1&&global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)return; DrawIsoOrig(tranflag); } } diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 8ea10bce1a..667591e267 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -594,7 +594,7 @@ unsigned char *GetDeviceColor(devicedata *devicei, unsigned char *colorval,float float *rgb_local; if(devicei==NULL||valmax<=valmin)return NULL; - val= GetDeviceVal(global_times[itimes],devicei,&valid); + val= GetDeviceVal(global_times[iglobal_times],devicei,&valid); if(valid!=1)return NULL; val = (val-valmin)/(valmax-valmin); colorindex=CLAMP(255*val,0,255); @@ -613,7 +613,7 @@ void OutputDeviceVal(devicedata *devicei){ int valid; if(fontindex==SCALED_FONT)ScaleFont3D(); - val= GetDeviceVal(global_times[itimes],devicei,&valid); + val= GetDeviceVal(global_times[iglobal_times],devicei,&valid); if(valid==1){ f_units *unitclass; char *unit; @@ -817,7 +817,7 @@ void DrawWindRosesDevices(void){ vdevi = global_scase.devicecoll.vdeviceinfo + i; if(vdevi->display==0||vdevi->unique==0)continue; itime = 0; - if(global_times!=NULL)itime = CLAMP(itimes, 0, vdevi->nwindroseinfo-1); + if(global_times!=NULL)itime = CLAMP(iglobal_times, 0, vdevi->nwindroseinfo-1); wr = vdevi->windroseinfo+itime; if(windrose_xy_vis==1)DrawWindRose(wr, WINDROSE_XY); if(windrose_xz_vis==1)DrawWindRose(wr, WINDROSE_XZ); @@ -3558,7 +3558,7 @@ void DrawDevices(int mode){ } } drawobjects_as_vectors = 0; - if(showtime == 1 && itimes >= 0 && itimes < nglobal_times&&showvdevice_val == 1 && global_scase.devicecoll.nvdeviceinfo>0){ + if(showtime == 1 && iglobal_times >= 0 && iglobal_times < nglobal_times&&showvdevice_val == 1 && global_scase.devicecoll.nvdeviceinfo>0){ unsigned char arrow_color[4]; float arrow_color_float[4]; int j; @@ -3608,7 +3608,7 @@ void DrawDevices(int mode){ if(devicei == NULL)continue; if(vdevi->unique == 0)continue; xyz = vdevi->valdev->xyz; - GetVDeviceVel(global_times[itimes], vdevi, vel, &angle, &dvel, &dangle, &velocity_type); + GetVDeviceVel(global_times[iglobal_times], vdevi, vel, &angle, &dvel, &dangle, &velocity_type); if(colordevice_val == 1){ int type, vistype = 0; @@ -4029,7 +4029,7 @@ void DrawDevices(int mode){ prop->vars_indep_index[j] = j; } } - if(showtime == 1 && itimes >= 0 && itimes < nglobal_times&&showdevice_val == 1 && ndevicetypes>0){ + if(showtime == 1 && iglobal_times >= 0 && iglobal_times < nglobal_times&&showdevice_val == 1 && ndevicetypes>0){ int type, vistype = 0; type = devicei->type2; @@ -4039,14 +4039,14 @@ void DrawDevices(int mode){ } } if(drawobjects_as_vectors == 0){ - if(select_device==0 && showtime == 1 && itimes >= 0 && itimes < nglobal_times){ + if(select_device==0 && showtime == 1 && iglobal_times >= 0 && iglobal_times < nglobal_times){ int state; if(devicei->showstatelist == NULL){ state = devicei->state0; } else{ - state = devicei->showstatelist[itimes]; + state = devicei->showstatelist[iglobal_times]; } if(colordevice_val == 1){ int type, vistype = 0; @@ -4062,7 +4062,7 @@ void DrawDevices(int mode){ if(target_index>=0&&izonetargets!=NULL&&have_target_data==1&&vis_target_data==1){ unsigned char color_index, target_color[4]; - color_index = izonetargets[itimes*nzone_targets+target_index]; + color_index = izonetargets[iglobal_times*nzone_targets+target_index]; target_color[0] = (float)rgb_full[color_index][0]*255.0; target_color[1] = (float)rgb_full[color_index][1]*255.0; target_color[2] = (float)rgb_full[color_index][2]*255.0; @@ -4395,7 +4395,7 @@ void DrawSmvObject(sv_object *object_dev, int iframe_local, propdata *prop, int float time_val = 0.0; if(nglobal_times > 0){ - time_val = global_times[itimes]; + time_val = global_times[iglobal_times]; } val_result = time_val; @@ -4412,7 +4412,7 @@ void DrawSmvObject(sv_object *object_dev, int iframe_local, propdata *prop, int val2 = arg[1]; if(nglobal_times > 0){ - time_val = global_times[itimes]; + time_val = global_times[iglobal_times]; } val_result = val1*time_val + val2; diff --git a/Source/smokeview/IOpart.c b/Source/smokeview/IOpart.c index c05dd86a72..23205dcb88 100644 --- a/Source/smokeview/IOpart.c +++ b/Source/smokeview/IOpart.c @@ -202,7 +202,7 @@ void DrawPart(const partdata *parti, int mode){ propdata *prop; float valmin, valmax; - if(nglobal_times<1||parti->times[0] > global_times[itimes])return; + if(nglobal_times<1||parti->times[0] > global_times[iglobal_times])return; if(global_scase.nterraininfo > 0 && ABS(vertical_factor - 1.0) > 0.01){ offset_terrain = 1; } @@ -591,8 +591,8 @@ void DrawPart(const partdata *parti, int mode){ void DrawPartFrame(int mode){ int i; - if(use_tload_begin==1&&global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)return; for(i=0;ivals; - highlight_time = global_times[itimes]; - highlight_val = GetCSVVal(global_times[itimes], csvfi->time->vals, vals, csvi->nvals); + highlight_time = global_times[iglobal_times]; + highlight_val = GetCSVVal(global_times[iglobal_times], csvfi->time->vals, vals, csvi->nvals); DrawGenCurve(option, plot2di, curve, plot2d_size_factor, csvfi->time->vals, vals, csvi->nvals, highlight_time, highlight_val, valmin, valmax, side, position, shortlabel, unit_display); @@ -991,8 +991,8 @@ void DrawDevicePlots(void){ valid = 0; if(global_times!=NULL){ - highlight_time = global_times[itimes]; - highlight_val = GetDeviceVal(global_times[itimes], devicei, &valid); + highlight_time = global_times[iglobal_times]; + highlight_val = GetDeviceVal(global_times[iglobal_times], devicei, &valid); } if(devicei->global_valmin>devicei->global_valmax){ GetGlobalDeviceBounds(devicei->type2); @@ -1033,8 +1033,8 @@ void DrawTreePlot(int first, int n){ } valid = 0; if(global_times!=NULL){ - highlight_time = global_times[itimes]; - highlight_val = GetDeviceVal(global_times[itimes], devicei, &valid); + highlight_time = global_times[iglobal_times]; + highlight_val = GetDeviceVal(global_times[iglobal_times], devicei, &valid); } if(devicei->global_valmin>devicei->global_valmax){ GetGlobalDeviceBounds(devicei->type2); diff --git a/Source/smokeview/IOscript.c b/Source/smokeview/IOscript.c index a0a5aa434d..728a804040 100644 --- a/Source/smokeview/IOscript.c +++ b/Source/smokeview/IOscript.c @@ -1570,7 +1570,7 @@ void ScriptRenderAll(scriptdata *scripti){ if(script_startframe>0)scripti->ival3=script_startframe; if(render_startframe0>=0)scripti->ival3=render_startframe0; first_frame_index=scripti->ival3; - itimes=first_frame_index; + iglobal_times=first_frame_index; if(script_skipframe>0)scripti->ival=script_skipframe; if(render_skipframe0>0)scripti->ival=render_skipframe0; @@ -1593,7 +1593,7 @@ void ScriptRender360All(scriptdata *scripti){ if(script_startframe>0)scripti->ival3 = script_startframe; if(render_startframe0 >= 0)scripti->ival3 = render_startframe0; first_frame_index = scripti->ival3; - itimes = first_frame_index; + iglobal_times = first_frame_index; if(script_skipframe>0)scripti->ival = script_skipframe; if(render_skipframe0>0)scripti->ival = render_skipframe0; @@ -1662,7 +1662,7 @@ void LoadSmokeFrame(int meshnum, int framenum){ force_redisplay = 1; UpdateFrameNumber(framenum); i = framenum; - itimes = i; + iglobal_times = i; script_itime = i; stept = 1; force_redisplay = 1; @@ -1742,7 +1742,7 @@ void ScriptLoadVolSmokeFrame2(void){ scriptdata scripti; scripti.ival = -1; - scripti.ival2 = itimes; + scripti.ival2 = iglobal_times; ScriptLoadVolSmokeFrame(&scripti, 0); } @@ -1762,7 +1762,7 @@ void ScriptVolSmokeRenderAll(scriptdata *scripti){ if(vol_startframe0>0)scripti->ival3=vol_startframe0; // check first_frame_index first_frame_index=scripti->ival3; - itimes=first_frame_index; + iglobal_times=first_frame_index; if(script_skipframe>0)scripti->ival=script_skipframe; if(vol_skipframe0>0)scripti->ival=vol_skipframe0; @@ -1804,7 +1804,7 @@ void ScriptLoadIsoFrame(scriptdata *scripti, int flag){ force_redisplay = 1; UpdateFrameNumber(framenum); i = framenum; - itimes = i; + iglobal_times = i; script_itime = i; stept = 1; force_redisplay = 1; @@ -1817,7 +1817,7 @@ void ScriptLoadIsoFrame(scriptdata *scripti, int flag){ /* ------------------ ScriptLoadIsoFrame2 ------------------------ */ void ScriptLoadIsoFrame2(scriptdata *scripti){ - scripti->ival2 = itimes; + scripti->ival2 = iglobal_times; ScriptLoadIsoFrame(scripti, 0); } @@ -1842,7 +1842,7 @@ void ScriptIsoRenderAll(scriptdata *scripti){ if(render_startframe0>0)scripti->ival3 = render_startframe0; // check first_frame_index first_frame_index = scripti->ival3; - itimes = first_frame_index; + iglobal_times = first_frame_index; if(script_skipframe>0)scripti->ival = script_skipframe; if(render_skipframe0>0)scripti->ival = render_skipframe0; @@ -2998,8 +2998,8 @@ void ScriptShowSmokeSensors(void){ stream_smokesensors = FOPEN(file_smokesensors, "a"); } - if(global_times!=NULL&&itimes>=0&&itimes=0&&iglobal_timescommand != SCRIPT_LOADSLICERENDER){ // don't draw slice if the global time is before the first or after the last slice time - if(global_times[itimes] < sd->times[0])return 0; - if(global_times[itimes] > sd->times[sd->ntimes - 1])return 0; + if(global_times[iglobal_times] < sd->times[0])return 0; + if(global_times[iglobal_times] > sd->times[sd->ntimes - 1])return 0; } if(sd->slice_filetype != SLICE_GEOM){ if(sd->compression_type != UNCOMPRESSED){ @@ -6619,8 +6619,8 @@ void DrawSliceFrame(){ DrawSlicePlots(); } - if(use_tload_begin==1 && global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; SortLoadedSliceList(); if(sortslices==1){ @@ -8046,8 +8046,8 @@ void DrawVVolSlice(const vslicedata *vd){ void DrawVSliceFrame(void){ int i; - if(use_tload_begin==1 && global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; for(i=0;iv; w = vd->w; if(u==NULL&&v==NULL&&w==NULL)continue; - if(global_scase.slicecoll.sliceinfo[vd->ival].times[0]>global_times[itimes])continue; + if(global_scase.slicecoll.sliceinfo[vd->ival].times[0]>global_times[iglobal_times])continue; IF_NOT_USEMESH_CONTINUE(USEMESH_DRAW,global_scase.slicecoll.sliceinfo[vd->ival].blocknumber); if(vd->vslice_filetype!=SLICE_GEOM){ if(val->compression_type!=UNCOMPRESSED){ @@ -8424,14 +8424,14 @@ void InitSliceData(void){ i = slice_loaded_list[ii]; sd = global_scase.slicecoll.sliceinfo + i; if(sd->display == 0 || sd->slicefile_labelindex != slicefile_labelindex)continue; - if(sd->times[0] > global_times[itimes])continue; + if(sd->times[0] > global_times[iglobal_times])continue; strcpy(datafile, sd->file); ext = strstr(datafile, "."); if(ext != NULL){ ext[0] = 0; } - sprintf(flabel, "%i", itimes); + sprintf(flabel, "%i", iglobal_times); TrimBack(flabel); strcat(datafile, "_sf_"); strcat(datafile, flabel); diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index b96d5509d8..83abc01120 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2679,8 +2679,8 @@ void DrawSmokeFrame(void){ int usegpu_local; #endif - if(use_tload_begin==1 && global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; #ifdef pp_GPU usegpu_local = usegpu; @@ -2796,8 +2796,8 @@ void DrawSmokeFrame(void){ void DrawVolSmokeFrame(void){ int load_shaders = 0; - if(use_tload_begin==1&&global_times[itimes]global_scase.tload_end)return; + if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)return; triangle_count = 0; CheckMemory; if(smoke3dVoldebug==1){ @@ -4287,7 +4287,7 @@ void UncompressSmoke3DAll(void){ if(smoke3di->loaded == 0 || smoke3di->display == 0)continue; assert(smoke3di->timeslist != NULL); if(smoke3di->timeslist == NULL)continue; - smoke3di->ismoke3d_time = smoke3di->timeslist[itimes]; + smoke3di->ismoke3d_time = smoke3di->timeslist[iglobal_times]; if(IsSmokeComponentPresent(smoke3di) == 0)continue; UncompressSmoke3D(smoke3di); } @@ -4320,7 +4320,7 @@ void MergeSmoke3DAll(void){ if(smoke3di->loaded == 0 || smoke3di->display == 0)continue; assert(smoke3di->timeslist != NULL); if(smoke3di->timeslist==NULL)continue; - smoke3di->ismoke3d_time = smoke3di->timeslist[itimes]; + smoke3di->ismoke3d_time = smoke3di->timeslist[iglobal_times]; if(IsSmokeComponentPresent(smoke3di) == 0)continue; MergeSmoke3D(smoke3di); } diff --git a/Source/smokeview/IOtour.c b/Source/smokeview/IOtour.c index 2f732365f2..032becd78b 100644 --- a/Source/smokeview/IOtour.c +++ b/Source/smokeview/IOtour.c @@ -272,7 +272,7 @@ void DrawTours(void){ float xyz[3], view[3]; float tour_time=0.0; - if(global_times!=NULL)tour_time = global_times[itimes]; + if(global_times!=NULL)tour_time = global_times[iglobal_times]; GetTourXYZ(tour_time, touri, xyz); GetTourView(tour_time, touri, view); @@ -295,7 +295,7 @@ void DrawTours(void){ float xyz[3]; float tour_time=0.0; - if(global_times!=NULL)tour_time = global_times[itimes]; + if(global_times!=NULL)tour_time = global_times[iglobal_times]; GetTourXYZ(tour_time, touri, xyz); DrawCir(xyz,tourrad_avatar,tourcol_avatar); } @@ -312,7 +312,7 @@ void DrawTours(void){ float xyz[3], tour_view[3]; float tour_time=0.0; - if(global_times!=NULL)tour_time = global_times[itimes]; + if(global_times!=NULL)tour_time = global_times[iglobal_times]; GetTourXYZ(tour_time, touri, xyz); GetTourView(tour_time, touri, tour_view); dxy[0]=tour_view[0]-xyz[0]; diff --git a/Source/smokeview/IOvolsmoke.c b/Source/smokeview/IOvolsmoke.c index 98d0631a59..37e40e7b4e 100644 --- a/Source/smokeview/IOvolsmoke.c +++ b/Source/smokeview/IOvolsmoke.c @@ -2769,7 +2769,7 @@ void ReadVolsmokeFrame(volrenderdata *vr, int framenum, int *first){ FSEEK(SLICEFILE,skip_local,SEEK_SET); // skip from beginning of file FORTVOLSLICEREAD(&time_local,1); - if(global_times!=NULL&&global_times[itimes]>time_local)restart_time=1; + if(global_times!=NULL&&global_times[iglobal_times]>time_local)restart_time=1; if(*first==1){ *first=0; print=1; diff --git a/Source/smokeview/IOwui.c b/Source/smokeview/IOwui.c index fe8c35cda8..1e72a9ec08 100644 --- a/Source/smokeview/IOwui.c +++ b/Source/smokeview/IOwui.c @@ -716,9 +716,9 @@ void DrawTrees(void){ state=0; if(showtime==1&&global_times!=NULL){ - assert(itimes>=0); - if(treei->time_char>0.0&&global_times[itimes]>treei->time_char)state=1; - if(treei->time_complete>0.0&&global_times[itimes]>treei->time_complete)state=2; + assert(iglobal_times>=0); + if(treei->time_char>0.0&&global_times[iglobal_times]>treei->time_char)state=1; + if(treei->time_complete>0.0&&global_times[iglobal_times]>treei->time_complete)state=2; } glPushMatrix(); diff --git a/Source/smokeview/IOzone.c b/Source/smokeview/IOzone.c index 21a6ad1908..94cc7fdb68 100644 --- a/Source/smokeview/IOzone.c +++ b/Source/smokeview/IOzone.c @@ -2268,7 +2268,7 @@ void DrawZoneFireData(void){ int i; float *zoneqfirebase, *zonefheightbase, *zonefdiambase, *zonefbasebase; - if(zone_times[0]>global_times[itimes])return; + if(zone_times[0]>global_times[iglobal_times])return; if(cullfaces==1)glDisable(GL_CULL_FACE); zoneqfirebase = zoneqfire + izone*global_scase.nfires; @@ -2338,7 +2338,7 @@ void DrawZoneRoomData(void){ float *colorvL; int i; - if(zone_times[0]>global_times[itimes])return; + if(zone_times[0]>global_times[iglobal_times])return; if(cullfaces==1)glDisable(GL_CULL_FACE); if(use_transparency_data==1)TransparentOn(); diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index ac52f42cef..64d2213cfa 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -622,9 +622,9 @@ void MouseSelectGeom(int x, int y){ void CheckTimeBound(void){ int i; - if((timebar_drag==0&&(itimes>nglobal_times-1))||(timebar_drag==1&&itimes<=0)){ + if((timebar_drag==0&&(iglobal_times>nglobal_times-1))||(timebar_drag==1&&iglobal_times<=0)){ izone = 0; - itimes=first_frame_index; + iglobal_times=first_frame_index; if(render_status==RENDER_ON){ RenderMenu(RenderCancel); if(current_script_command!=NULL&&NOT_LOADRENDER){ @@ -658,9 +658,9 @@ void CheckTimeBound(void){ meshi->iso_itime=0; } } - if((timebar_drag==0&&itimes<0)||(timebar_drag==1&&itimes>nglobal_times-1)){ + if((timebar_drag==0&&iglobal_times<0)||(timebar_drag==1&&iglobal_times>nglobal_times-1)){ izone=nzone_times-1; - itimes=nglobal_times-1; + iglobal_times=nglobal_times-1; for(i=0;iblockageinfoptrs[j]; if(bc->showtimelist==NULL)continue; - bc->show=bc->showtimelist[itimes]; + bc->show=bc->showtimelist[iglobal_times]; } } } @@ -845,7 +845,7 @@ int GetTimeBarFrame(int xm){ int TimebarClick(int xm, int ym){ if(screenHeight-ym0){ // PRINTF("ngt=%i xl=%i x=%i xr=%i\n",nglobal_times,timebar_left_pos,x,timebar_right_pos); - itimes = GetTimeBarFrame(xm); + iglobal_times = GetTimeBarFrame(xm); CheckTimeBound(); timebar_drag=1; stept=0; @@ -860,8 +860,8 @@ int TimebarClick(int xm, int ym){ void UpdateTime(int time){ if(nglobal_times > 0){ - itimes = time; - UpdateGluiFrame(itimes); + iglobal_times = time; + UpdateGluiFrame(iglobal_times); CheckTimeBound(); IdleCB(); } @@ -2013,7 +2013,7 @@ void Keyboard(unsigned char key, int flag){ force_redisplay=1; } else{ - itime_save=itimes; + itime_save=iglobal_times; ShowVSliceMenu(GLUI_HIDEALL_VSLICE); } } @@ -2023,7 +2023,7 @@ void Keyboard(unsigned char key, int flag){ force_redisplay=1; } else{ - itime_save=itimes; + itime_save=iglobal_times; ShowHideSliceMenu(GLUI_HIDEALL); } } @@ -2474,7 +2474,7 @@ void Keyboard(unsigned char key, int flag){ if(nglobal_times>0){ float timeval; - timeval=global_times[itimes]; + timeval=global_times[iglobal_times]; fprintf(scriptoutstream,"SETTIMEVAL\n"); fprintf(scriptoutstream," %f\n",timeval); if(nvolrenderinfo>0&&load_at_rendertimes==1){ @@ -3050,11 +3050,11 @@ void Keyboard(unsigned char key, int flag){ if(plotstate==DYNAMIC_PLOTS){ if(timebar_drag==0){ - itimes += skip_global*FlowDir; - if(itimes<0)itimes = nglobal_times - 1; - if(itimes>nglobal_times - 1)itimes = 0; - SetFrameVal(itimes,stept); - SetFrameVal(itimes,stept); + iglobal_times += skip_global*FlowDir; + if(iglobal_times<0)iglobal_times = nglobal_times - 1; + if(iglobal_times>nglobal_times - 1)iglobal_times = 0; + SetFrameVal(iglobal_times,stept); + SetFrameVal(iglobal_times,stept); } return; } @@ -3627,34 +3627,34 @@ void UpdateFrame(float thisinterval, int *changetime, int *redisplay){ ){ elapsed_time = GMod(elapsed_time,global_times[nglobal_times-1]-global_times[0])+global_times[0]; } - itimes = ISearch(global_times,nglobal_times,elapsed_time,itimes); + iglobal_times = ISearch(global_times,nglobal_times,elapsed_time,iglobal_times); } else{ if(script_render_flag==0){ - itimes += FlowDir; + iglobal_times += FlowDir; } else{ - itimes=script_itime; + iglobal_times=script_itime; } } } if(stept==1&&timebar_drag==0&&render_status==RENDER_ON){ if(render_firsttime==YES){ render_firsttime = NO; - itimes = first_frame_index; + iglobal_times = first_frame_index; } else{ if(render_skip==RENDER_CURRENT_SINGLE){ - itimes += FlowDir; + iglobal_times += FlowDir; } else{ - itimes += render_skip*FlowDir; + iglobal_times += render_skip*FlowDir; } } - SetFrameVal(itimes,stept); - SetFrameVal(itimes,stept); + SetFrameVal(iglobal_times,stept); + SetFrameVal(iglobal_times,stept); } - if(script_render_flag == 1&&IS_LOADRENDER)itimes = script_itime; + if(script_render_flag == 1&&IS_LOADRENDER)iglobal_times = script_itime; // if toggling time display with H then show the frame that was visible @@ -3663,7 +3663,7 @@ void UpdateFrame(float thisinterval, int *changetime, int *redisplay){ } else{ if(itime_save>=0){ - itimes=itime_save; + iglobal_times=itime_save; } } if(shooter_firstframe==1&&visShooter!=0&&shooter_active==1){ @@ -3701,7 +3701,7 @@ void IdleCB(void){ or if we are rendering images or stepping by hand */ UpdateFrame(thisinterval,&changetime,&redisplay); - if(showtime==1&&stept==0&&itimeold!=itimes){ + if(showtime==1&&stept==0&&itimeold!=iglobal_times){ changetime=1; CheckTimeBound(); UpdateTimeLabels(); @@ -3782,7 +3782,7 @@ void ReshapeCB(int width, int height){ void ResetGLTime(void){ if(showtime!=1)return; - reset_frame=itimes; + reset_frame=iglobal_times; START_TIMER(reset_time); if(global_times!=NULL&&nglobal_times>0){ start_frametime=global_times[0]; @@ -4191,7 +4191,7 @@ void DoNonStereo(void){ IdleDisplay(); stop_rendering = 0; - if(plotstate==DYNAMIC_PLOTS && nglobal_times>0&&itimes==nglobal_times-1)stop_rendering = 1; + if(plotstate==DYNAMIC_PLOTS && nglobal_times>0&&iglobal_times==nglobal_times-1)stop_rendering = 1; if(render_mode==RENDER_NORMAL){ int i, ibuffer = 0; GLubyte **screenbuffers; diff --git a/Source/smokeview/colortimebar.c b/Source/smokeview/colortimebar.c index 6660dc490c..193035ad21 100644 --- a/Source/smokeview/colortimebar.c +++ b/Source/smokeview/colortimebar.c @@ -20,7 +20,7 @@ void UpdateTimeLabels(void){ float time0; time0 = timeoffset; - if(global_times!=NULL)time0 = timeoffset+global_times[itimes]; + if(global_times!=NULL)time0 = timeoffset+global_times[iglobal_times]; if(current_script_command!=NULL&&IS_LOADRENDER){ time0 = current_script_command->fval4; } @@ -72,7 +72,7 @@ void UpdateTimeLabels(void){ itime_val = script_itime; } else{ - itime_val = itimes; + itime_val = iglobal_times; } if(visFrameTimelabel==1){ @@ -87,7 +87,7 @@ void UpdateTimeLabels(void){ float hrr; int itime; - itime = GetInterval(global_times[itimes], global_scase.timeptr->vals, global_scase.timeptr->nvals); + itime = GetInterval(global_times[iglobal_times], global_scase.timeptr->vals, global_scase.timeptr->nvals); hrr = global_scase.hrrptr->vals[itime]; if(hrr<1.0){ sprintf(hrrlabel,"HRR: %4.1f W",hrr*1000.0); @@ -141,7 +141,7 @@ void DrawTimebar(float xleft, float xright, float ybot, float ytop){ dtime = global_times[nglobal_times-1] - global_times[0]; } if(dtime!=0.0&&nglobal_times>1){ - factor = CLAMP((global_times[itimes] - global_times[0])/dtime, 0.0, 1.0); + factor = CLAMP((global_times[iglobal_times] - global_times[0])/dtime, 0.0, 1.0); } xxright = xleft*(1.0-factor) + xright*factor; } diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index 1280572f88..c6b5a27371 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -51,7 +51,7 @@ void DrawCircVentsApproxSolid(int option){ // check for visibility - if(cvi->showtimelist!=NULL&&cvi->showtimelist[itimes]==0)continue; + if(cvi->showtimelist!=NULL&&cvi->showtimelist[iglobal_times]==0)continue; glColor3fv(cvi->color); if(cvi->dir==UP_X||cvi->dir==UP_Y||cvi->dir==UP_Z){ @@ -204,7 +204,7 @@ void DrawCircVentsApproxOutline(int option){ // check for visibility - if(cvi->showtimelist!=NULL&&cvi->showtimelist[itimes]==0)continue; + if(cvi->showtimelist!=NULL&&cvi->showtimelist[iglobal_times]==0)continue; if(showpatch==1 && cvi->have_boundary_file == 1)continue; glColor3fv(cvi->color); @@ -375,7 +375,7 @@ void DrawCircVentsExactSolid(int option){ // check for visibility - if(cvi->showtimelist!=NULL&&cvi->showtimelist[itimes]==0)continue; + if(cvi->showtimelist!=NULL&&cvi->showtimelist[iglobal_times]==0)continue; if(showpatch==1 && cvi->have_boundary_file == 1)continue; if(option==VENT_CIRCLE){ @@ -507,7 +507,7 @@ void DrawCircVentsExactOutline(int option){ // check for visibility - if(cvi->showtimelist!=NULL&&cvi->showtimelist[itimes]==0)continue; + if(cvi->showtimelist!=NULL&&cvi->showtimelist[iglobal_times]==0)continue; if(showpatch==1 && cvi->have_boundary_file == 1)continue; if(option==VENT_CIRCLE){ @@ -719,7 +719,7 @@ void DrawObstOutlines(void){ bc = meshi->blockageinfoptrs[i]; if(bc == NULL)continue; - if(bc->showtimelist != NULL && bc->showtimelist[itimes] == 0)continue; + if(bc->showtimelist != NULL && bc->showtimelist[iglobal_times] == 0)continue; color = bc->color; if(color != oldcolor){ glColor3fv(color); @@ -784,7 +784,7 @@ void DrawOrigObstOutlines(void){ obi = global_scase.obstcoll.obstinfo + i; color = foregroundcolor; - if(obi->bc!=NULL&&obi->bc->showtimelist!=NULL&&obi->bc->showtimelist[itimes]==0)continue; + if(obi->bc!=NULL&&obi->bc->showtimelist!=NULL&&obi->bc->showtimelist[iglobal_times]==0)continue; if(obi->color!=NULL)color = obi->color; if(obi->color==NULL&&obi->surfs[0]->color!=NULL)color = obi->surfs[0]->color; if(color!=oldcolor){ @@ -1796,7 +1796,7 @@ void DrawCAD2Geom(const cadgeomdata *cd, int trans_flag){ if(global_times!=NULL){ float timeval; - timeval=global_times[itimes]; + timeval=global_times[iglobal_times]; if(quadi->time_show>=0.0&&timevaltime_show)continue; if(quadi->time_show <0.0&&timeval>-quadi->time_show)continue; } @@ -3061,7 +3061,7 @@ void DrawSelectFaces(){ \ showtimelist_handle = facei->showtimelist_handle;\ showtimelist = *showtimelist_handle;\ - if(showtimelist!=NULL&&showtimelist[itimes]==0)continue;\ + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0)continue;\ if(showedit_dialog==0){\ new_color=facei->color;\ }\ @@ -3179,7 +3179,7 @@ void DrawFacesOLD(int option){ } showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist != NULL && showtimelist[itimes] == 0)continue; + if(showtimelist != NULL && showtimelist[iglobal_times] == 0)continue; if(showedit_dialog == 0){ new_color = facei->color; } @@ -3262,7 +3262,7 @@ void DrawFacesOLD(int option){ } showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist != NULL && showtimelist[itimes] == 0)continue; + if(showtimelist != NULL && showtimelist[iglobal_times] == 0)continue; if(showedit_dialog == 0){ new_color = facei->color; } @@ -3334,7 +3334,7 @@ void DrawFacesOLD(int option){ if(facei->hidden == 1)continue; showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist != NULL && showtimelist[itimes] == 0 && facei->type2 == BLOCK_face)continue; + if(showtimelist != NULL && showtimelist[iglobal_times] == 0 && facei->type2 == BLOCK_face)continue; if(blocklocation == BLOCKlocation_grid){ vertices = facei->approx_vertex_coords; } @@ -3361,7 +3361,7 @@ void DrawFacesOLD(int option){ glVertex3fv(vertices + 9); glVertex3fv(vertices + 9); glVertex3fv(vertices); - if(showtimelist != NULL && showtimelist[itimes] == 0){ + if(showtimelist != NULL && showtimelist[iglobal_times] == 0){ glVertex3fv(vertices); glVertex3fv(vertices + 6); glVertex3fv(vertices + 3); @@ -3408,7 +3408,7 @@ void DrawFacesOLD(int option){ if(facei->hidden == 1)continue; showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist != NULL && showtimelist[itimes] == 0)continue; + if(showtimelist != NULL && showtimelist[iglobal_times] == 0)continue; texti = facei->textureinfo; if(blocklocation == BLOCKlocation_grid){ vertices = facei->approx_vertex_coords; @@ -3576,7 +3576,7 @@ void DrawFaces(){ } showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist!=NULL&&showtimelist[itimes]==0)continue; + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0)continue; if(showedit_dialog == 0){ new_color=facei->color; } @@ -3641,7 +3641,7 @@ void DrawFaces(){ facei = meshi->face_outlines[i]; showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist!=NULL&&showtimelist[itimes]==0&&facei->type2==BLOCK_face)continue; + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0&&facei->type2==BLOCK_face)continue; if(blocklocation==BLOCKlocation_grid){ vertices = facei->approx_vertex_coords; } @@ -3667,7 +3667,7 @@ void DrawFaces(){ glVertex3fv(vertices+9); glVertex3fv(vertices+9); glVertex3fv(vertices); - if(showtimelist!=NULL&&showtimelist[itimes]==0){ + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0){ glVertex3fv(vertices); glVertex3fv(vertices+6); glVertex3fv(vertices+3); @@ -3703,7 +3703,7 @@ void DrawFaces(){ facei=meshi->face_textures[i]; showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist!=NULL&&showtimelist[itimes]==0)continue; + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0)continue; texti=facei->textureinfo; if(blocklocation==BLOCKlocation_grid){ vertices = facei->approx_vertex_coords; @@ -3821,7 +3821,7 @@ void DrawTransparentFaces(){ } showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist!=NULL&&showtimelist[itimes]==0)continue; + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0)continue; if(showedit_dialog == 0){ new_color=facei->color; } @@ -3901,7 +3901,7 @@ void DrawTransparentFaces(){ } showtimelist_handle = facei->showtimelist_handle; showtimelist = *showtimelist_handle; - if(showtimelist!=NULL&&showtimelist[itimes]==0)continue; + if(showtimelist!=NULL&&showtimelist[iglobal_times]==0)continue; new_color=facei->color; if( ABS(new_color[0]-old_color[0])>0.0001|| diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index d961bcae7a..9843e2ff20 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -4473,13 +4473,13 @@ void GLUISetTimeVal(float timeval){ thigh = (global_times[i] + global_times[i + 1]) / 2.0; } if(tlow <= timeval && timeval < thigh){ - itimes = i; + iglobal_times = i; stept = 1; force_redisplay = 1; UpdateFrameNumber(0); UpdateTimeLabels(); Keyboard('t', FROM_SMOKEVIEW); - SPINNER_framebounds->set_int_val(itimes); + SPINNER_framebounds->set_int_val(iglobal_times); break; } } @@ -4500,7 +4500,7 @@ void SetFrameVal(int frameval, int stept_arg){ frameval = nglobal_times-1; changed_frame = 1; } - itimes = frameval; + iglobal_times = frameval; stept = 1; force_redisplay = 1; UpdateFrameNumber(0); @@ -4508,7 +4508,7 @@ void SetFrameVal(int frameval, int stept_arg){ stept = stept_arg; //Keyboard('t', FROM_SMOKEVIEW); float timeval; - timeval = global_times[itimes]; + timeval = global_times[iglobal_times]; SPINNER_timebounds->set_float_val(timeval); if(changed_frame==1)SPINNER_framebounds->set_int_val(frameval); } diff --git a/Source/smokeview/output.c b/Source/smokeview/output.c index 9dd495b608..5bb657653f 100644 --- a/Source/smokeview/output.c +++ b/Source/smokeview/output.c @@ -414,7 +414,7 @@ void DrawLabels(labels_collection *labelscoll_arg){ if(plotstate!=DYNAMIC_PLOTS||thislabel->show_always==1||showtime==0)drawlabel=1; if(drawlabel==0&&plotstate==DYNAMIC_PLOTS&&showtime==1){ if(tstart_stop[0]<0.0||tstart_stop[1]<0.0)drawlabel=1; - if(drawlabel==0&&global_times[itimes]>=tstart_stop[0]-0.05&&global_times[itimes]<=tstart_stop[1]+0.05)drawlabel=1; + if(drawlabel==0&&global_times[iglobal_times]>=tstart_stop[0]-0.05&&global_times[iglobal_times]<=tstart_stop[1]+0.05)drawlabel=1; } if(drawlabel==1){ Output3Text(labelcolor,xyz[0],xyz[1],xyz[2],thislabel->name); diff --git a/Source/smokeview/renderimage.c b/Source/smokeview/renderimage.c index 19fd5131ef..40303d1b02 100644 --- a/Source/smokeview/renderimage.c +++ b/Source/smokeview/renderimage.c @@ -213,17 +213,17 @@ void Render(int view_mode){ command = current_script_command->command; if(command == SCRIPT_VOLSMOKERENDERALL || command == SCRIPT_ISORENDERALL){ - if(itimes == 0){ - current_script_command->remove_frame = itimes; + if(iglobal_times == 0){ + current_script_command->remove_frame = iglobal_times; current_script_command->exit = 1; stept = 0; return; } - current_script_command->remove_frame = itimes; + current_script_command->remove_frame = iglobal_times; } } if(render_times == RENDER_ALLTIMES && render_status == RENDER_ON&&render_mode == RENDER_NORMAL && plotstate == DYNAMIC_PLOTS && nglobal_times > 0){ - if(itimes>=0&&itimes=0&&iglobal_timesdisplay == 0 || sd->slicefile_labelindex != slicefile_labelindex)continue; - if(global_times!=NULL&&sd->times[0] > global_times[itimes])continue; + if(global_times!=NULL&&sd->times[0] > global_times[iglobal_times])continue; if(sd->qslicedata == NULL){ PRINTF(" Slice data unavailable for output\n"); @@ -452,14 +452,14 @@ void OutputSliceData(void){ if(ext != NULL){ ext[0] = 0; } - sprintf(flabel, "%i", itimes); + sprintf(flabel, "%i", iglobal_times); TrimBack(flabel); strcat(datafile, "_sf_"); strcat(datafile, flabel); strcat(datafile, ".csv"); fileout = FOPEN(datafile, "a"); if(fileout == NULL)continue; - if(global_times != NULL)fprintf(fileout, "%f\n", global_times[itimes]); + if(global_times != NULL)fprintf(fileout, "%f\n", global_times[iglobal_times]); switch(sd->idir){ case XDIR: fprintf(fileout, "%i,%i\n", sd->ks2 + 1 - sd->ks1, sd->js2 + 1 - sd->js1); @@ -665,7 +665,7 @@ int GifAddFrameSpec() { else { struct gif_spec_frame this_frame = current_gif_spec->gif_frames[current_gif_frame]; - if(this_frame.frame_number == itimes) { + if(this_frame.frame_number == iglobal_times) { render = true; delay = this_frame.duration; current_gif_frame++; diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 45c42a45c3..3bfc754139 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1918,7 +1918,7 @@ SVEXTERN int minfill, maxfill; SVEXTERN int SVDECL(*plotiso,NULL); -SVEXTERN int nglobal_times, SVDECL(itimes,0), SVDECL(itime_save,-1), SVDECL(itimeold,-999); +SVEXTERN int SVDECL(nglobal_times,0), SVDECL(iglobal_times,0), SVDECL(itime_save,-1), SVDECL(itimeold,-999); SVEXTERN float SVDECL(*global_times,NULL), SVDECL(*times_buffer, NULL), cputimes[20]; SVEXTERN int SVDECL(ntimes_buffer, 0); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 589888dfc0..7ab773cc08 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -33,18 +33,18 @@ int CompareFloat(const void *arg1, const void *arg2){ /* ------------------ UpdateFrameNumber ------------------------ */ void UpdateFrameNumber(int changetime){ - if(force_redisplay==1||(itimeold!=itimes&&changetime==1)){ + if(force_redisplay==1||(itimeold!=iglobal_times&&changetime==1)){ int i; force_redisplay=0; - itimeold=itimes; + itimeold=iglobal_times; if(showsmoke==1){ for(i=0;iloaded==0||parti->timeslist==NULL)continue; - parti->itime=parti->timeslist[itimes]; + parti->itime=parti->timeslist[iglobal_times]; } } if(showvolrender==1){ @@ -62,7 +62,7 @@ void UpdateFrameNumber(int changetime){ smokeslice=vr->smokeslice; if(fireslice==NULL||smokeslice==NULL)continue; if(vr->loaded==0||vr->display==0)continue; - vr->itime = vr->timeslist[itimes]; + vr->itime = vr->timeslist[iglobal_times]; for(j=vr->itime;j>=0;j--){ if(vr->dataready[j]==1)break; } @@ -115,7 +115,7 @@ void UpdateFrameNumber(int changetime){ geomi = geominfoptrs[i]; if(geomi->loaded==0||geomi->timeslist==NULL)continue; - geomi->itime=geomi->timeslist[itimes]; + geomi->itime=geomi->timeslist[iglobal_times]; } if(showslice==1||showvslice==1){ int ii; @@ -135,7 +135,7 @@ void UpdateFrameNumber(int changetime){ patchi->geom_itime = 0; // only one frame loaded at a time when using LOADSLICERNDER } else{ - patchi->geom_itime = patchi->geom_timeslist[itimes]; + patchi->geom_itime = patchi->geom_timeslist[iglobal_times]; } patchi->geom_val_static = patchi->geom_vals + patchi->geom_vals_static_offset[patchi->geom_itime]; patchi->geom_ival_static = patchi->geom_ivals + patchi->geom_ivals_static_offset[patchi->geom_itime]; @@ -144,12 +144,12 @@ void UpdateFrameNumber(int changetime){ patchi->geom_val_dynamic = patchi->geom_vals + patchi->geom_vals_dynamic_offset[patchi->geom_itime]; patchi->geom_nval_static = patchi->geom_nstatics[patchi->geom_itime]; patchi->geom_nval_dynamic = patchi->geom_ndynamics[patchi->geom_itime]; - sd->itime = patchi->geom_timeslist[itimes]; + sd->itime = patchi->geom_timeslist[iglobal_times]; slice_time = sd->itime; } else{ if(sd->timeslist == NULL)continue; - sd->itime = sd->timeslist[itimes]; + sd->itime = sd->timeslist[iglobal_times]; assert(sd->times_map == NULL || sd->times_map[sd->itime] == 1); slice_time = sd->itime; @@ -160,7 +160,7 @@ void UpdateFrameNumber(int changetime){ patchi = global_scase.patchinfo + i; if(patchi->structured == YES || patchi->boundary == 1 || patchi->geom_times == NULL || patchi->geom_timeslist == NULL)continue; - patchi->geom_itime = patchi->geom_timeslist[itimes]; + patchi->geom_itime = patchi->geom_timeslist[iglobal_times]; patchi->geom_ival_static = patchi->geom_ivals + patchi->geom_ivals_static_offset[patchi->geom_itime]; patchi->geom_ival_dynamic = patchi->geom_ivals + patchi->geom_ivals_dynamic_offset[patchi->geom_itime]; patchi->geom_val_static = patchi->geom_vals + patchi->geom_vals_static_offset[patchi->geom_itime]; @@ -195,7 +195,7 @@ void UpdateFrameNumber(int changetime){ patchi = global_scase.patchinfo + i; if(patchi->structured == YES||patchi->boundary==0||patchi->geom_times==NULL||patchi->geom_timeslist==NULL)continue; - patchi->geom_itime=patchi->geom_timeslist[itimes]; + patchi->geom_itime=patchi->geom_timeslist[iglobal_times]; if(patchi->geom_ivals != NULL){ patchi->geom_ival_static = patchi->geom_ivals + patchi->geom_ivals_static_offset[patchi->geom_itime]; patchi->geom_ival_dynamic = patchi->geom_ivals + patchi->geom_ivals_dynamic_offset[patchi->geom_itime]; @@ -212,7 +212,7 @@ void UpdateFrameNumber(int changetime){ if(meshi->patchfilenum < 0||meshi->patchfilenum>global_scase.npatchinfo-1)continue; patchi=global_scase.patchinfo + meshi->patchfilenum; if(patchi->structured == NO||meshi->patch_times==NULL||meshi->patch_timeslist==NULL)continue; - meshi->patch_itime=meshi->patch_timeslist[itimes]; + meshi->patch_itime=meshi->patch_timeslist[iglobal_times]; if(patchi->compression_type==UNCOMPRESSED){ meshi->patchval_iframe = meshi->patchval + meshi->patch_itime*meshi->npatchsize; @@ -232,11 +232,11 @@ void UpdateFrameNumber(int changetime){ isoi = global_scase.isoinfo + i; meshi = global_scase.meshescoll.meshinfo + isoi->blocknumber; if(isoi->loaded==0||meshi->iso_times==NULL||meshi->iso_timeslist==NULL)continue; - meshi->iso_itime=meshi->iso_timeslist[itimes]; + meshi->iso_itime=meshi->iso_timeslist[iglobal_times]; } } if(showzone==1){ - izone=zone_timeslist[itimes]; + izone=zone_timeslist[iglobal_times]; } } } @@ -1065,7 +1065,7 @@ void ConvertSsf(void){ /* ------------------ GetTime ------------------------ */ float GetTime(void){ - if(global_times != NULL)return global_times[CLAMP(itimes,0,nglobal_times)]; + if(global_times != NULL)return global_times[CLAMP(iglobal_times,0,nglobal_times)]; return 0.0; } @@ -1901,7 +1901,7 @@ int ISearch(float *list, int nlist, float key, int guess){ void ResetItimes0(void){ if(current_script_command==NULL||(current_script_command->command!=SCRIPT_VOLSMOKERENDERALL&¤t_script_command->command!=SCRIPT_ISORENDERALL)){ - itimes=first_frame_index; + iglobal_times=first_frame_index; } } diff --git a/Source/smokeview/viewports.c b/Source/smokeview/viewports.c index 047eeaeb65..fc725eee63 100644 --- a/Source/smokeview/viewports.c +++ b/Source/smokeview/viewports.c @@ -997,7 +997,7 @@ void ViewportHrrPlot(int quad, GLint screen_left, GLint screen_down){ } update_avg = 0; } - highlight_time = global_times[itimes]; + highlight_time = global_times[iglobal_times]; itime = GetInterval(highlight_time, hitime->vals, hitime->nvals); itime = CLAMP(itime, 0, hitime->nvals-1); @@ -1140,7 +1140,7 @@ void ViewportSlicePlot(int quad, GLint screen_left, GLint screen_down){ devicei = &(slicei->vals2d); if(slicei->loaded==0||devicei->valid==0)continue; - highlight_val = devicei->vals[itimes]; + highlight_val = devicei->vals[iglobal_times]; boundsdata *sb; @@ -1162,7 +1162,7 @@ void ViewportSlicePlot(int quad, GLint screen_left, GLint screen_down){ update_avg = 0; } DrawPlot2D(PLOT_ALL, devicei->times, devicei->vals, NULL, devicei->nvals, - global_times[itimes], highlight_val, 0.0, 1, position, valmin, valmax, + global_times[iglobal_times], highlight_val, 0.0, 1, position, valmin, valmax, slicei->label.shortlabel, NULL, slicei->label.unit, VP_slice_plot.left, VP_slice_plot.right, VP_slice_plot.down, VP_slice_plot.top); position++; @@ -2348,7 +2348,7 @@ void ViewportScene(int quad, int view_mode, GLint screen_left, GLint screen_down tourdata *touri; touri = global_scase.tourcoll.tourinfo + selectedtour_index; - SetTourXYZView(global_times[itimes], touri); + SetTourXYZView(global_times[iglobal_times], touri); memcpy(camera_current->eye, touri->xyz_smv, 3*sizeof(float)); camera_current->az_elev[1]=0.0; camera_current->az_elev[0]=0.0; @@ -2469,7 +2469,7 @@ void ViewportScene(int quad, int view_mode, GLint screen_left, GLint screen_down if(plotstate==DYNAMIC_PLOTS&&selected_tour!=NULL&&selected_tour->timeslist!=NULL){ if(viewtourfrompath==1&&selectedtour_index>=0){ touri = global_scase.tourcoll.tourinfo + selectedtour_index; - SetTourXYZView(global_times[itimes], touri); + SetTourXYZView(global_times[iglobal_times], touri); viewx = touri->view_smv[0]+dEyeSeparation[0]; viewy = touri->view_smv[1]-dEyeSeparation[1]; viewz = touri->view_smv[2]; From 1683fa350015e6505da20c12866f6943e65651bb Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 09:17:18 -0400 Subject: [PATCH 16/46] smokeview source: change global_times[iglobal_times} to GetTime() --- Source/smokeview/IOboundary.c | 81 +++++++++++++++----------------- Source/smokeview/IOgeometry.c | 4 +- Source/smokeview/IOhvac.c | 6 +-- Source/smokeview/IOiso.c | 4 +- Source/smokeview/IOobjects.c | 10 ++-- Source/smokeview/IOpart.c | 6 +-- Source/smokeview/IOplot2d.c | 12 ++--- Source/smokeview/IOscript.c | 2 +- Source/smokeview/IOslice.c | 16 +++---- Source/smokeview/IOsmoke.c | 8 ++-- Source/smokeview/IOtour.c | 12 ++--- Source/smokeview/IOvolsmoke.c | 2 +- Source/smokeview/IOwui.c | 4 +- Source/smokeview/IOzone.c | 4 +- Source/smokeview/callbacks.c | 2 +- Source/smokeview/colortimebar.c | 7 ++- Source/smokeview/drawGeometry.c | 4 +- Source/smokeview/glui_bounds.cpp | 4 +- Source/smokeview/output.c | 2 +- Source/smokeview/renderimage.c | 6 +-- Source/smokeview/viewports.c | 8 ++-- 21 files changed, 96 insertions(+), 108 deletions(-) diff --git a/Source/smokeview/IOboundary.c b/Source/smokeview/IOboundary.c index b03f1d3524..10d4826489 100644 --- a/Source/smokeview/IOboundary.c +++ b/Source/smokeview/IOboundary.c @@ -291,7 +291,7 @@ void DrawOnlyThreshold(const meshdata *meshi){ } patchi = global_scase.patchinfo+meshi->patchfilenum; - if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; + if(patch_times[0]>GetTime()||patchi->display==0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); /* if a contour boundary does not match a blockage face then draw "both sides" of boundary */ @@ -335,19 +335,19 @@ void DrawOnlyThreshold(const meshdata *meshi){ color12 = NULL; color21 = NULL; color22 = NULL; - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol]){ + if(meshi->thresholdtime[nn1+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol]){ color11 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1]){ + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol+1]){ color12 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol]){ + if(meshi->thresholdtime[nn2+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol]){ color21 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1]){ + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol+1]){ color22 = &char_color[0]; nnulls--; } @@ -420,19 +420,19 @@ void DrawOnlyThreshold(const meshdata *meshi){ color22 = NULL; nnulls = 4; - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol]){ + if(meshi->thresholdtime[nn1+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol]){ color11 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1]){ + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol+1]){ color12 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol]){ + if(meshi->thresholdtime[nn2+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol]){ color21 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1]){ + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol+1]){ color22 = &char_color[0]; nnulls--; } @@ -498,19 +498,19 @@ void DrawOnlyThreshold(const meshdata *meshi){ color21 = NULL; color22 = NULL; nnulls = 4; - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol]){ + if(meshi->thresholdtime[nn1+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol]){ color11 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1]){ + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol+1]){ color12 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol]){ + if(meshi->thresholdtime[nn2+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol]){ color21 = &char_color[0]; nnulls--; } - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1]){ + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol+1]){ color22 = &char_color[0]; nnulls--; } @@ -2195,12 +2195,7 @@ void SetTimeState(void){ timestate = GetPlotState(DYNAMIC_PLOTS); if(timestate==DYNAMIC_PLOTS){ update_stept = 1; - if(global_times!=NULL){ - time_paused = global_times[iglobal_times]; - } - else{ - time_paused = 0.0; - } + time_paused = GetTime(); } } } @@ -2317,7 +2312,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ int is_time_arrival = 0; if(strcmp(patchi->label.shortlabel, "t_a") == 0)is_time_arrival = 1; - if(global_times!=NULL&&patch_times[0]>global_times[iglobal_times])return; + if(global_times!=NULL&&patch_times[0]>GetTime())return; if(patchi->display == 0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); @@ -2615,7 +2610,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ patchval_iframe=meshi->patchval_iframe; patchi = global_scase.patchinfo + meshi->patchfilenum; - if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; + if(patch_times[0]>GetTime()||patchi->display==0)return; int set_valmin, set_valmax; char *label; @@ -2674,10 +2669,10 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ color12=clear_color; color21=clear_color; color22=clear_color; - if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; - if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol ])color21=burn_color; - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol+1])color12=burn_color; + if(meshi->thresholdtime[nn2+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol ])color21=burn_color; + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol+1])color22=burn_color; if(color11==color12&&color11==color21&&color11==color22){ glColor4fv(color11); glTexCoord1f(r11);glVertex3fv(xyzp1); @@ -2760,10 +2755,10 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ color12=clear_color; color21=clear_color; color22=clear_color; - if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; - if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol ])color21=burn_color; - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol+1])color12=burn_color; + if(meshi->thresholdtime[nn2+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol ])color21=burn_color; + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol+1])color22=burn_color; if(color11==color12&&color11==color21&&color11==color22){ glColor4fv(color11); glTexCoord1f(r11);glVertex3fv(xyzp1); @@ -2841,10 +2836,10 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ color12=clear_color; color21=clear_color; color22=clear_color; - if(meshi->thresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; - if(meshi->thresholdtime[nn1+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol+1])color12=burn_color; - if(meshi->thresholdtime[nn2+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol ])color21=burn_color; - if(meshi->thresholdtime[nn2+icol+1]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn2+icol+1])color22=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol+1])color12=burn_color; + if(meshi->thresholdtime[nn2+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol ])color21=burn_color; + if(meshi->thresholdtime[nn2+icol+1]>=0.0&&GetTime()>meshi->thresholdtime[nn2+icol+1])color22=burn_color; if(color11==color12&&color11==color21&&color11==color22){ glColor4fv(color11); glTexCoord1f(r11);glVertex3fv(xyzp1); @@ -2914,7 +2909,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ } patchi = global_scase.patchinfo + meshi->patchfilenum; - if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; + if(patch_times[0]>GetTime()||patchi->display==0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); /* if a contour boundary does not match a blockage face then draw "both sides" of boundary */ @@ -2950,7 +2945,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ for(icol=0;icolthresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol ])color11=burn_color; glColor4fv(color11); glVertex3fv(xyzp1); @@ -3005,7 +3000,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ for(icol=0;icolthresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol ])color11=burn_color; glColor4fv(color11); glVertex3fv(xyzp1); @@ -3055,7 +3050,7 @@ void DrawBoundaryThresholdCellcenter(const meshdata *meshi){ for(icol=0;icolthresholdtime[nn1+icol ]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol ])color11=burn_color; + if(meshi->thresholdtime[nn1+icol ]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol ])color11=burn_color; glColor4fv(color11); glVertex3fv(xyzp1); @@ -3148,7 +3143,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchval_iframe == NULL)return; patchi = global_scase.patchinfo+meshi->patchfilenum; - if(patch_times[0]>global_times[iglobal_times]||patchi->display==0)return; + if(patch_times[0]>GetTime()||patchi->display==0)return; if(cullfaces==1)glDisable(GL_CULL_FACE); nn = 0; @@ -3198,7 +3193,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchventcolors==NULL){ color11 = rgb_patch+4*cval; if(vis_threshold==1&&vis_onlythreshold==0&&do_threshold==1){ - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; + if(meshi->thresholdtime[nn1+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; } } else{ @@ -3276,7 +3271,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchventcolors==NULL){ color11 = rgb_patch+4*cval; if(vis_threshold==1&&vis_onlythreshold==0&&do_threshold==1){ - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; + if(meshi->thresholdtime[nn1+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; } } else{ @@ -3345,7 +3340,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ if(patchventcolors==NULL){ color11 = rgb_patch+4*cval; if(vis_threshold==1&&vis_onlythreshold==0&&do_threshold==1){ - if(meshi->thresholdtime[nn1+icol]>=0.0&&global_times[iglobal_times]>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; + if(meshi->thresholdtime[nn1+icol]>=0.0&&GetTime()>meshi->thresholdtime[nn1+icol])color11 = &char_color[0]; } } else{ @@ -3411,8 +3406,8 @@ meshdata *GetPatchMeshNabor(meshdata *meshi, int *ib){ void DrawBoundaryFrame(int flag){ int i; - if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1 && GetTime()global_scase.tload_end)return; for(i=0;igeomtype==GEOM_ISO){ if(plotstate != DYNAMIC_PLOTS)continue; - if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)continue; + if(use_tload_begin==1&&GetTime()global_scase.tload_end)continue; } for(j = 0; j < geomlisti->ntriangles; j++){ diff --git a/Source/smokeview/IOhvac.c b/Source/smokeview/IOhvac.c index 2babd6737a..eadf5596f9 100644 --- a/Source/smokeview/IOhvac.c +++ b/Source/smokeview/IOhvac.c @@ -276,11 +276,7 @@ void DrawHVACFan(hvacductdata *ducti, float *xyz, float size, float diam, int st glRotatef(angle, axis[0], axis[1], axis[2]); glRotatef(90, 0.0,0.0,1.0); if(state==1&&global_times != NULL){ - float angle2, time2; - - time2 = global_times[iglobal_times]; - angle2 = 360.0*time2 / 10.0; - glRotatef(angle2, 0.0, 1.0, 0.0); + glRotatef(360.0*GetTime() / 10.0, 0.0, 1.0, 0.0); } glScalef(size,size,size); diff --git a/Source/smokeview/IOiso.c b/Source/smokeview/IOiso.c index 59660f7ed2..7cb27d7973 100644 --- a/Source/smokeview/IOiso.c +++ b/Source/smokeview/IOiso.c @@ -1279,8 +1279,8 @@ void DrawIsoOrig(int tranflag){ void DrawIso(int tranflag){ if(niso_opaques>0||niso_trans>0){ - if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1&&GetTime()global_scase.tload_end)return; DrawIsoOrig(tranflag); } } diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 667591e267..fbdc826716 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -594,7 +594,7 @@ unsigned char *GetDeviceColor(devicedata *devicei, unsigned char *colorval,float float *rgb_local; if(devicei==NULL||valmax<=valmin)return NULL; - val= GetDeviceVal(global_times[iglobal_times],devicei,&valid); + val= GetDeviceVal(GetTime(),devicei,&valid); if(valid!=1)return NULL; val = (val-valmin)/(valmax-valmin); colorindex=CLAMP(255*val,0,255); @@ -613,7 +613,7 @@ void OutputDeviceVal(devicedata *devicei){ int valid; if(fontindex==SCALED_FONT)ScaleFont3D(); - val= GetDeviceVal(global_times[iglobal_times],devicei,&valid); + val= GetDeviceVal(GetTime(),devicei,&valid); if(valid==1){ f_units *unitclass; char *unit; @@ -3608,7 +3608,7 @@ void DrawDevices(int mode){ if(devicei == NULL)continue; if(vdevi->unique == 0)continue; xyz = vdevi->valdev->xyz; - GetVDeviceVel(global_times[iglobal_times], vdevi, vel, &angle, &dvel, &dangle, &velocity_type); + GetVDeviceVel(GetTime(), vdevi, vel, &angle, &dvel, &dangle, &velocity_type); if(colordevice_val == 1){ int type, vistype = 0; @@ -4395,7 +4395,7 @@ void DrawSmvObject(sv_object *object_dev, int iframe_local, propdata *prop, int float time_val = 0.0; if(nglobal_times > 0){ - time_val = global_times[iglobal_times]; + time_val = GetTime(); } val_result = time_val; @@ -4412,7 +4412,7 @@ void DrawSmvObject(sv_object *object_dev, int iframe_local, propdata *prop, int val2 = arg[1]; if(nglobal_times > 0){ - time_val = global_times[iglobal_times]; + time_val = GetTime(); } val_result = val1*time_val + val2; diff --git a/Source/smokeview/IOpart.c b/Source/smokeview/IOpart.c index 23205dcb88..41e460ffb8 100644 --- a/Source/smokeview/IOpart.c +++ b/Source/smokeview/IOpart.c @@ -202,7 +202,7 @@ void DrawPart(const partdata *parti, int mode){ propdata *prop; float valmin, valmax; - if(nglobal_times<1||parti->times[0] > global_times[iglobal_times])return; + if(nglobal_times<1||parti->times[0] > GetTime())return; if(global_scase.nterraininfo > 0 && ABS(vertical_factor - 1.0) > 0.01){ offset_terrain = 1; } @@ -591,8 +591,8 @@ void DrawPart(const partdata *parti, int mode){ void DrawPartFrame(int mode){ int i; - if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1&&GetTime()global_scase.tload_end)return; for(i=0;ivals; - highlight_time = global_times[iglobal_times]; - highlight_val = GetCSVVal(global_times[iglobal_times], csvfi->time->vals, vals, csvi->nvals); + highlight_time = GetTime(); + highlight_val = GetCSVVal(GetTime(), csvfi->time->vals, vals, csvi->nvals); DrawGenCurve(option, plot2di, curve, plot2d_size_factor, csvfi->time->vals, vals, csvi->nvals, highlight_time, highlight_val, valmin, valmax, side, position, shortlabel, unit_display); @@ -991,8 +991,8 @@ void DrawDevicePlots(void){ valid = 0; if(global_times!=NULL){ - highlight_time = global_times[iglobal_times]; - highlight_val = GetDeviceVal(global_times[iglobal_times], devicei, &valid); + highlight_time = GetTime(); + highlight_val = GetDeviceVal(GetTime(), devicei, &valid); } if(devicei->global_valmin>devicei->global_valmax){ GetGlobalDeviceBounds(devicei->type2); @@ -1033,8 +1033,8 @@ void DrawTreePlot(int first, int n){ } valid = 0; if(global_times!=NULL){ - highlight_time = global_times[iglobal_times]; - highlight_val = GetDeviceVal(global_times[iglobal_times], devicei, &valid); + highlight_time = GetTime(); + highlight_val = GetDeviceVal(GetTime(), devicei, &valid); } if(devicei->global_valmin>devicei->global_valmax){ GetGlobalDeviceBounds(devicei->type2); diff --git a/Source/smokeview/IOscript.c b/Source/smokeview/IOscript.c index 728a804040..d279b96d68 100644 --- a/Source/smokeview/IOscript.c +++ b/Source/smokeview/IOscript.c @@ -2999,7 +2999,7 @@ void ScriptShowSmokeSensors(void){ } if(global_times!=NULL&&iglobal_times>=0&&iglobal_timescommand != SCRIPT_LOADSLICERENDER){ // don't draw slice if the global time is before the first or after the last slice time - if(global_times[iglobal_times] < sd->times[0])return 0; - if(global_times[iglobal_times] > sd->times[sd->ntimes - 1])return 0; + if(GetTime() < sd->times[0])return 0; + if(GetTime() > sd->times[sd->ntimes - 1])return 0; } if(sd->slice_filetype != SLICE_GEOM){ if(sd->compression_type != UNCOMPRESSED){ @@ -6619,8 +6619,8 @@ void DrawSliceFrame(){ DrawSlicePlots(); } - if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1 && GetTime()global_scase.tload_end)return; SortLoadedSliceList(); if(sortslices==1){ @@ -8046,8 +8046,8 @@ void DrawVVolSlice(const vslicedata *vd){ void DrawVSliceFrame(void){ int i; - if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1 && GetTime()global_scase.tload_end)return; for(i=0;iv; w = vd->w; if(u==NULL&&v==NULL&&w==NULL)continue; - if(global_scase.slicecoll.sliceinfo[vd->ival].times[0]>global_times[iglobal_times])continue; + if(global_scase.slicecoll.sliceinfo[vd->ival].times[0]>GetTime())continue; IF_NOT_USEMESH_CONTINUE(USEMESH_DRAW,global_scase.slicecoll.sliceinfo[vd->ival].blocknumber); if(vd->vslice_filetype!=SLICE_GEOM){ if(val->compression_type!=UNCOMPRESSED){ @@ -8424,7 +8424,7 @@ void InitSliceData(void){ i = slice_loaded_list[ii]; sd = global_scase.slicecoll.sliceinfo + i; if(sd->display == 0 || sd->slicefile_labelindex != slicefile_labelindex)continue; - if(sd->times[0] > global_times[iglobal_times])continue; + if(sd->times[0] > GetTime())continue; strcpy(datafile, sd->file); ext = strstr(datafile, "."); diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 83abc01120..f0b66014e8 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2679,8 +2679,8 @@ void DrawSmokeFrame(void){ int usegpu_local; #endif - if(use_tload_begin==1 && global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1 && GetTime()global_scase.tload_end)return; #ifdef pp_GPU usegpu_local = usegpu; @@ -2796,8 +2796,8 @@ void DrawSmokeFrame(void){ void DrawVolSmokeFrame(void){ int load_shaders = 0; - if(use_tload_begin==1&&global_times[iglobal_times]global_scase.tload_end)return; + if(use_tload_begin==1&&GetTime()global_scase.tload_end)return; triangle_count = 0; CheckMemory; if(smoke3dVoldebug==1){ diff --git a/Source/smokeview/IOtour.c b/Source/smokeview/IOtour.c index 032becd78b..c0e2974580 100644 --- a/Source/smokeview/IOtour.c +++ b/Source/smokeview/IOtour.c @@ -270,9 +270,9 @@ void DrawTours(void){ if(touri->timeslist==NULL)continue; float xyz[3], view[3]; - float tour_time=0.0; + float tour_time; - if(global_times!=NULL)tour_time = global_times[iglobal_times]; + tour_time = GetTime(); GetTourXYZ(tour_time, touri, xyz); GetTourView(tour_time, touri, view); @@ -293,9 +293,9 @@ void DrawTours(void){ if(touri->timeslist==NULL)continue; float xyz[3]; - float tour_time=0.0; + float tour_time; - if(global_times!=NULL)tour_time = global_times[iglobal_times]; + tour_time = GetTime(); GetTourXYZ(tour_time, touri, xyz); DrawCir(xyz,tourrad_avatar,tourcol_avatar); } @@ -310,9 +310,9 @@ void DrawTours(void){ if(touri->timeslist==NULL)continue; float xyz[3], tour_view[3]; - float tour_time=0.0; + float tour_time; - if(global_times!=NULL)tour_time = global_times[iglobal_times]; + tour_time = GetTime(); GetTourXYZ(tour_time, touri, xyz); GetTourView(tour_time, touri, tour_view); dxy[0]=tour_view[0]-xyz[0]; diff --git a/Source/smokeview/IOvolsmoke.c b/Source/smokeview/IOvolsmoke.c index 37e40e7b4e..ba881920f1 100644 --- a/Source/smokeview/IOvolsmoke.c +++ b/Source/smokeview/IOvolsmoke.c @@ -2769,7 +2769,7 @@ void ReadVolsmokeFrame(volrenderdata *vr, int framenum, int *first){ FSEEK(SLICEFILE,skip_local,SEEK_SET); // skip from beginning of file FORTVOLSLICEREAD(&time_local,1); - if(global_times!=NULL&&global_times[iglobal_times]>time_local)restart_time=1; + if(global_times!=NULL&&GetTime()>time_local)restart_time=1; if(*first==1){ *first=0; print=1; diff --git a/Source/smokeview/IOwui.c b/Source/smokeview/IOwui.c index 1e72a9ec08..13bbdf8628 100644 --- a/Source/smokeview/IOwui.c +++ b/Source/smokeview/IOwui.c @@ -717,8 +717,8 @@ void DrawTrees(void){ state=0; if(showtime==1&&global_times!=NULL){ assert(iglobal_times>=0); - if(treei->time_char>0.0&&global_times[iglobal_times]>treei->time_char)state=1; - if(treei->time_complete>0.0&&global_times[iglobal_times]>treei->time_complete)state=2; + if( treei->time_char>0.0&&GetTime()>treei->time_char)state=1; + if(treei->time_complete>0.0&&GetTime()>treei->time_complete)state=2; } glPushMatrix(); diff --git a/Source/smokeview/IOzone.c b/Source/smokeview/IOzone.c index 94cc7fdb68..11bb416905 100644 --- a/Source/smokeview/IOzone.c +++ b/Source/smokeview/IOzone.c @@ -2268,7 +2268,7 @@ void DrawZoneFireData(void){ int i; float *zoneqfirebase, *zonefheightbase, *zonefdiambase, *zonefbasebase; - if(zone_times[0]>global_times[iglobal_times])return; + if(zone_times[0]>GetTime())return; if(cullfaces==1)glDisable(GL_CULL_FACE); zoneqfirebase = zoneqfire + izone*global_scase.nfires; @@ -2338,7 +2338,7 @@ void DrawZoneRoomData(void){ float *colorvL; int i; - if(zone_times[0]>global_times[iglobal_times])return; + if(zone_times[0]>GetTime())return; if(cullfaces==1)glDisable(GL_CULL_FACE); if(use_transparency_data==1)TransparentOn(); diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 64d2213cfa..b85092baf1 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -2474,7 +2474,7 @@ void Keyboard(unsigned char key, int flag){ if(nglobal_times>0){ float timeval; - timeval=global_times[iglobal_times]; + timeval=GetTime(); fprintf(scriptoutstream,"SETTIMEVAL\n"); fprintf(scriptoutstream," %f\n",timeval); if(nvolrenderinfo>0&&load_at_rendertimes==1){ diff --git a/Source/smokeview/colortimebar.c b/Source/smokeview/colortimebar.c index 193035ad21..6900fb9c11 100644 --- a/Source/smokeview/colortimebar.c +++ b/Source/smokeview/colortimebar.c @@ -19,8 +19,7 @@ void UpdateTimeLabels(void){ float time0; - time0 = timeoffset; - if(global_times!=NULL)time0 = timeoffset+global_times[iglobal_times]; + time0 = timeoffset+GetTime(); if(current_script_command!=NULL&&IS_LOADRENDER){ time0 = current_script_command->fval4; } @@ -87,7 +86,7 @@ void UpdateTimeLabels(void){ float hrr; int itime; - itime = GetInterval(global_times[iglobal_times], global_scase.timeptr->vals, global_scase.timeptr->nvals); + itime = GetInterval(GetTime(), global_scase.timeptr->vals, global_scase.timeptr->nvals); hrr = global_scase.hrrptr->vals[itime]; if(hrr<1.0){ sprintf(hrrlabel,"HRR: %4.1f W",hrr*1000.0); @@ -141,7 +140,7 @@ void DrawTimebar(float xleft, float xright, float ybot, float ytop){ dtime = global_times[nglobal_times-1] - global_times[0]; } if(dtime!=0.0&&nglobal_times>1){ - factor = CLAMP((global_times[iglobal_times] - global_times[0])/dtime, 0.0, 1.0); + factor = CLAMP((GetTime() - global_times[0])/dtime, 0.0, 1.0); } xxright = xleft*(1.0-factor) + xright*factor; } diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index c6b5a27371..2385921741 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -1796,8 +1796,8 @@ void DrawCAD2Geom(const cadgeomdata *cd, int trans_flag){ if(global_times!=NULL){ float timeval; - timeval=global_times[iglobal_times]; - if(quadi->time_show>=0.0&&timevaltime_show)continue; + timeval=GetTime(); + if(quadi->time_show>=0.0&&timeval< quadi->time_show)continue; if(quadi->time_show <0.0&&timeval>-quadi->time_show)continue; } if(visCadTextures==1&&texti->loaded==1)continue; diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index 9843e2ff20..ea5a5ac5c5 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -4507,9 +4507,7 @@ void SetFrameVal(int frameval, int stept_arg){ UpdateTimeLabels(); stept = stept_arg; //Keyboard('t', FROM_SMOKEVIEW); - float timeval; - timeval = global_times[iglobal_times]; - SPINNER_timebounds->set_float_val(timeval); + SPINNER_timebounds->set_float_val(GetTime()); if(changed_frame==1)SPINNER_framebounds->set_int_val(frameval); } diff --git a/Source/smokeview/output.c b/Source/smokeview/output.c index 5bb657653f..0fe53be92f 100644 --- a/Source/smokeview/output.c +++ b/Source/smokeview/output.c @@ -414,7 +414,7 @@ void DrawLabels(labels_collection *labelscoll_arg){ if(plotstate!=DYNAMIC_PLOTS||thislabel->show_always==1||showtime==0)drawlabel=1; if(drawlabel==0&&plotstate==DYNAMIC_PLOTS&&showtime==1){ if(tstart_stop[0]<0.0||tstart_stop[1]<0.0)drawlabel=1; - if(drawlabel==0&&global_times[iglobal_times]>=tstart_stop[0]-0.05&&global_times[iglobal_times]<=tstart_stop[1]+0.05)drawlabel=1; + if(drawlabel==0&&GetTime()>=tstart_stop[0]-0.05&&GetTime()<=tstart_stop[1]+0.05)drawlabel=1; } if(drawlabel==1){ Output3Text(labelcolor,xyz[0],xyz[1],xyz[2],thislabel->name); diff --git a/Source/smokeview/renderimage.c b/Source/smokeview/renderimage.c index 40303d1b02..4bf2d81d0b 100644 --- a/Source/smokeview/renderimage.c +++ b/Source/smokeview/renderimage.c @@ -371,7 +371,7 @@ int GetRenderFileName(int view_mode, char *renderfile_dir, char *renderfile_full char timelabel_local[20], *timelabelptr; float dt, maxtime; - time_local = global_times[iglobal_times]; + time_local = GetTime(); dt = ABS(global_times[1] - global_times[0]); maxtime = MAX(ABS(global_times[nglobal_times-1]), ABS(global_scase.global_tend)); maxtime = MAX(maxtime, ABS(global_scase.global_tbegin)); @@ -440,7 +440,7 @@ void OutputSliceData(void){ i = slice_loaded_list[ii]; sd = global_scase.slicecoll.sliceinfo + i; if(sd->display == 0 || sd->slicefile_labelindex != slicefile_labelindex)continue; - if(global_times!=NULL&&sd->times[0] > global_times[iglobal_times])continue; + if(global_times!=NULL&&sd->times[0] > GetTime())continue; if(sd->qslicedata == NULL){ PRINTF(" Slice data unavailable for output\n"); @@ -459,7 +459,7 @@ void OutputSliceData(void){ strcat(datafile, ".csv"); fileout = FOPEN(datafile, "a"); if(fileout == NULL)continue; - if(global_times != NULL)fprintf(fileout, "%f\n", global_times[iglobal_times]); + if(global_times != NULL)fprintf(fileout, "%f\n", GetTime()); switch(sd->idir){ case XDIR: fprintf(fileout, "%i,%i\n", sd->ks2 + 1 - sd->ks1, sd->js2 + 1 - sd->js1); diff --git a/Source/smokeview/viewports.c b/Source/smokeview/viewports.c index fc725eee63..aca3316213 100644 --- a/Source/smokeview/viewports.c +++ b/Source/smokeview/viewports.c @@ -997,7 +997,7 @@ void ViewportHrrPlot(int quad, GLint screen_left, GLint screen_down){ } update_avg = 0; } - highlight_time = global_times[iglobal_times]; + highlight_time = GetTime(); itime = GetInterval(highlight_time, hitime->vals, hitime->nvals); itime = CLAMP(itime, 0, hitime->nvals-1); @@ -1162,7 +1162,7 @@ void ViewportSlicePlot(int quad, GLint screen_left, GLint screen_down){ update_avg = 0; } DrawPlot2D(PLOT_ALL, devicei->times, devicei->vals, NULL, devicei->nvals, - global_times[iglobal_times], highlight_val, 0.0, 1, position, valmin, valmax, + GetTime(), highlight_val, 0.0, 1, position, valmin, valmax, slicei->label.shortlabel, NULL, slicei->label.unit, VP_slice_plot.left, VP_slice_plot.right, VP_slice_plot.down, VP_slice_plot.top); position++; @@ -2348,7 +2348,7 @@ void ViewportScene(int quad, int view_mode, GLint screen_left, GLint screen_down tourdata *touri; touri = global_scase.tourcoll.tourinfo + selectedtour_index; - SetTourXYZView(global_times[iglobal_times], touri); + SetTourXYZView(GetTime(), touri); memcpy(camera_current->eye, touri->xyz_smv, 3*sizeof(float)); camera_current->az_elev[1]=0.0; camera_current->az_elev[0]=0.0; @@ -2469,7 +2469,7 @@ void ViewportScene(int quad, int view_mode, GLint screen_left, GLint screen_down if(plotstate==DYNAMIC_PLOTS&&selected_tour!=NULL&&selected_tour->timeslist!=NULL){ if(viewtourfrompath==1&&selectedtour_index>=0){ touri = global_scase.tourcoll.tourinfo + selectedtour_index; - SetTourXYZView(global_times[iglobal_times], touri); + SetTourXYZView(GetTime(), touri); viewx = touri->view_smv[0]+dEyeSeparation[0]; viewy = touri->view_smv[1]-dEyeSeparation[1]; viewz = touri->view_smv[2]; From 62104ad051f33e66193ecd1c31f1c99629aa37eb Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 09:57:49 -0400 Subject: [PATCH 17/46] smokeview source: SetFrameVal -> SetFrameIndex --- Source/smokeview/callbacks.c | 9 +++----- Source/smokeview/glui_bounds.cpp | 36 +++++++++++++++++++------------- Source/smokeview/smokeheaders.h | 2 +- Source/smokeview/smokeviewdefs.h | 2 ++ Source/smokeview/update.c | 2 +- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index b85092baf1..44d127d429 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -2830,8 +2830,7 @@ void Keyboard(unsigned char key, int flag){ break; case '0': if(plotstate==DYNAMIC_PLOTS){ - SetFrameVal(0,0); - SetFrameVal(0,0); + SetFrameIndex(0,PAUSE_TIME); } break; case '~': @@ -3053,8 +3052,7 @@ void Keyboard(unsigned char key, int flag){ iglobal_times += skip_global*FlowDir; if(iglobal_times<0)iglobal_times = nglobal_times - 1; if(iglobal_times>nglobal_times - 1)iglobal_times = 0; - SetFrameVal(iglobal_times,stept); - SetFrameVal(iglobal_times,stept); + SetFrameIndex(iglobal_times,stept); } return; } @@ -3651,8 +3649,7 @@ void UpdateFrame(float thisinterval, int *changetime, int *redisplay){ iglobal_times += render_skip*FlowDir; } } - SetFrameVal(iglobal_times,stept); - SetFrameVal(iglobal_times,stept); + SetFrameIndex(iglobal_times,stept); } if(script_render_flag == 1&&IS_LOADRENDER)iglobal_times = script_itime; diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index ea5a5ac5c5..ec70105e19 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -4486,21 +4486,21 @@ void GLUISetTimeVal(float timeval){ } } -/* ------------------ SetFrameVal ------------------------ */ +/* ------------------ SetFrameIndexWorker ------------------------ */ -void SetFrameVal(int frameval, int stept_arg){ +void SetFrameIndexWorker(int frameindex, int stept_arg){ int changed_frame = 0; if(global_times == NULL)return; - if(frameval < 0){ - frameval = 0; + if(frameindex < 0){ + frameindex = 0; changed_frame = 1; } - if(frameval > nglobal_times - 1){ - frameval = nglobal_times-1; + if(frameindex > nglobal_times - 1){ + frameindex = nglobal_times-1; changed_frame = 1; } - iglobal_times = frameval; + iglobal_times = frameindex; stept = 1; force_redisplay = 1; UpdateFrameNumber(0); @@ -4508,10 +4508,19 @@ void SetFrameVal(int frameval, int stept_arg){ stept = stept_arg; //Keyboard('t', FROM_SMOKEVIEW); SPINNER_timebounds->set_float_val(GetTime()); - if(changed_frame==1)SPINNER_framebounds->set_int_val(frameval); + if(changed_frame==1)SPINNER_framebounds->set_int_val(frameindex); } -/* ------------------ UpdateGluiFrame ------------------------ */ +/* ------------------ SetFrameIndex ------------------------ */ + +void SetFrameIndex(int frameindex, int stept_arg){ + INIT_PRINT_TIMER(frame_timer); + SetFrameIndexWorker(frameindex, stept_arg); + SetFrameIndexWorker(frameindex, stept_arg); + PRINT_TIMER(frame_timer, "SetFrameIndex"); +} + + /* ------------------ UpdateGluiFrame ------------------------ */ void UpdateGluiFrame(int val){ if(SPINNER_framebounds!=NULL)SPINNER_framebounds->set_int_val(val); @@ -4524,21 +4533,18 @@ void TimeBoundCB(int var){ updatemenu = 1; switch(var){ case SET_FRAME: - SetFrameVal(glui_frame,0); - SetFrameVal(glui_frame,0); + SetFrameIndex(glui_frame,PAUSE_TIME); break; case PREV_FRAME: glui_frame--; if(glui_frame<0)glui_frame = nglobal_times-1; - SetFrameVal(glui_frame,0); - SetFrameVal(glui_frame,0); + SetFrameIndex(glui_frame,PAUSE_TIME); SPINNER_framebounds->set_int_val(glui_frame); break; case NEXT_FRAME: glui_frame++; if(glui_frame>nglobal_times-1)glui_frame=0; - SetFrameVal(glui_frame,0); - SetFrameVal(glui_frame,0); + SetFrameIndex(glui_frame,PAUSE_TIME); SPINNER_framebounds->set_int_val(glui_frame); break; case SET_TIME: diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index bb1cc9e1b5..777ac1d9b6 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -9,7 +9,7 @@ //*** glui_bounds.cpp headers -EXTERNCPP void SetFrameVal(int frameval, int stept_arg); +EXTERNCPP void SetFrameIndex(int frameval, int stept_arg); EXTERNCPP void UpdateGluiFrame(int val); //*** glui_clip.cpp headers diff --git a/Source/smokeview/smokeviewdefs.h b/Source/smokeview/smokeviewdefs.h index d79abf11fd..c379a39ea6 100644 --- a/Source/smokeview/smokeviewdefs.h +++ b/Source/smokeview/smokeviewdefs.h @@ -242,6 +242,8 @@ EXTERNCPP void _Sniff_Errors(const char *whereat, const char *file, int line); #define TIMEBAR_OVERLAP_NEVER 1 #define TIMEBAR_OVERLAP_AUTO 2 +#define PAUSE_TIME 0 + #define RENDER_START 3 #define RENDER_START_NORMAL 12 #define RENDER_START_GIF 21 diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 7ab773cc08..5df277c35b 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -1065,7 +1065,7 @@ void ConvertSsf(void){ /* ------------------ GetTime ------------------------ */ float GetTime(void){ - if(global_times != NULL)return global_times[CLAMP(iglobal_times,0,nglobal_times)]; + if(global_times != NULL)return global_times[CLAMP(iglobal_times,0,nglobal_times-1)]; return 0.0; } From ad9e172696580d14866f0ce35af88d5a7c89f97c Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 10:33:48 -0400 Subject: [PATCH 18/46] smokeview source: always generate blanking data structures but do it in the background --- Source/smokeview/readsmv.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index ccfd10f63b..65770f5d96 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -2836,18 +2836,16 @@ int ReadSMV_Configure(){ MakeIBlankSmoke3D(); PRINT_TIMER(timer_readsmv, "MakeIBlankSmoke3D"); - if(HaveCircularVents()==1|| global_scase.meshescoll.nmeshes < 100 || parse_opts.fast_startup == 0){ #ifdef pp_SPEEDUP - makeiblank_threads = THREADinit(&n_makeiblank_threads, &use_makeiblank_threads, MakeIBlank); - THREADrun(makeiblank_threads); + makeiblank_threads = THREADinit(&n_makeiblank_threads, &use_makeiblank_threads, MakeIBlank); + THREADrun(makeiblank_threads); - mergesmoke3d_threads = THREADinit(&n_mergesmoke3d_threads, &use_mergesmoke3d_threads, MergeSmoke3DAll); - uncompresssmoke3d_threads = THREADinit(&n_uncompresssmoke3d_threads, &use_uncompresssmoke3d_threads, UncompressSmoke3DAll); + mergesmoke3d_threads = THREADinit(&n_mergesmoke3d_threads, &use_mergesmoke3d_threads, MergeSmoke3DAll); + uncompresssmoke3d_threads = THREADinit(&n_uncompresssmoke3d_threads, &use_uncompresssmoke3d_threads, UncompressSmoke3DAll); #else - MakeIBlank(); + MakeIBlank(); #endif - PRINT_TIMER(timer_readsmv, "MakeIBlank"); - } + PRINT_TIMER(timer_readsmv, "MakeIBlank"); SetCVentDirs(); PRINT_TIMER(timer_readsmv, "SetCVentDirs"); From 7a06539fa6580aa7953cdff5b5eefeda6513e4db Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 10:40:52 -0400 Subject: [PATCH 19/46] smokeview source: turn off multi threading for merging/uncompressing smoke3d and making iblank data sstructures when smokeview is running a script --- Source/smokeview/readsmv.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 65770f5d96..455429f6a5 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -3044,11 +3044,16 @@ int ReadSMV(bufferstreamdata *stream) { // InitScase(&global_scase); //** initialize multi-threading if(runscript == 1){ - use_checkfiles_threads = 0; - use_ffmpeg_threads = 0; - use_readallgeom_threads = 0; - use_isosurface_threads = 0; - use_meshnabors_threads = 0; + use_checkfiles_threads = 0; + use_ffmpeg_threads = 0; + use_readallgeom_threads = 0; + use_isosurface_threads = 0; + use_meshnabors_threads = 0; +#ifdef pp_SPEEDUP + use_makeiblank_threads = 0; + use_mergesmoke3d_threads = 0; + use_uncompresssmoke3d_threads = 0; +#endif } ReadSMV_Init(&global_scase); ReadSMV_Parse(&global_scase, stream); From b4aa257e3fef20b4fba4f2e20d82fed5a29bd09a Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 11:17:14 -0400 Subject: [PATCH 20/46] smokeview source: turn off menu update when a key is pressed --- Source/smokeview/callbacks.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 44d127d429..2d9021c816 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -3049,9 +3049,7 @@ void Keyboard(unsigned char key, int flag){ if(plotstate==DYNAMIC_PLOTS){ if(timebar_drag==0){ - iglobal_times += skip_global*FlowDir; - if(iglobal_times<0)iglobal_times = nglobal_times - 1; - if(iglobal_times>nglobal_times - 1)iglobal_times = 0; + iglobal_times = CLAMP(iglobal_times + skip_global * FlowDir,0, nglobal_times - 1); SetFrameIndex(iglobal_times,stept); } return; @@ -3087,7 +3085,6 @@ void Keyboard(unsigned char key, int flag){ void KeyboardCB(unsigned char key, int x, int y){ Keyboard(key,FROM_CALLBACK); GLUTPOSTREDISPLAY; - updatemenu=1; } /* ------------------ HandleRotationType ------------------------ */ From 574a74819c66717773e8210006e1cdcf35187185 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Mar 2026 22:44:04 -0400 Subject: [PATCH 21/46] smokeview source: modify merge smoke3d routines assuming only called one mesh at a time --- Source/smokeview/IOsmoke.c | 55 ++++++++++---------------------- Source/smokeview/callbacks.c | 6 ++-- Source/smokeview/glui_bounds.cpp | 32 +++++++------------ Source/smokeview/smokeheaders.h | 2 +- Source/smokeview/smokeviewdefs.h | 3 +- 5 files changed, 34 insertions(+), 64 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index f0b66014e8..8a7ee57251 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -3880,20 +3880,13 @@ int UncompressSmoke3D(smoke3ddata *smoke3di){ /* ------------------ MergeSmoke3DColors ------------------------ */ -void MergeSmoke3DColors(smoke3ddata *smoke3dset){ - int i,j; +void MergeSmoke3DColors(smoke3ddata *smoke3di){ + int i; int i_smoke3d_cutoff, i_co2_cutoff; int fire_index; unsigned char rgb_slicesmokecolormap_0255[4*MAXSMOKERGB]; unsigned char rgb_sliceco2colormap_0255[4*MAXSMOKERGB]; - int first, last; - first = 0; - last = global_scase.smoke3dcoll.nsmoke3dinfo-1; - if(smoke3dset != NULL){ - first = smoke3dset - global_scase.smoke3dcoll.smoke3dinfo; - last = first; - } if(have_fire==HRRPUV_index){ i_smoke3d_cutoff = 254*global_hrrpuv_cb_min/global_scase.hrrpuv_max; i_co2_cutoff = 254*(MAX(0.0,global_hrrpuv_cb_min))/global_scase.hrrpuv_max; @@ -3911,12 +3904,11 @@ void MergeSmoke3DColors(smoke3ddata *smoke3dset){ rgb_sliceco2colormap_0255[i] = 255*rgb_sliceco2colormap_01[i]; } - for(i=first;i<=last;i++){ - smoke3ddata *smoke3di, *smoke3d_soot; + for(i=0;i<1;i++){ + int j; + smoke3ddata *smoke3d_soot; meshdata *mesh_smoke3d; - smoke3di=global_scase.smoke3dcoll.smoke3dinfo + i; - if(smoke3dset!=NULL&&smoke3dset!=smoke3di)continue; smoke3di->primary_file=0; if(smoke3di->loaded==0||smoke3di->display==0)continue; if(smoke3di->is_fire == 1 && smoke3di->skip_fire == 1)continue; @@ -3953,22 +3945,20 @@ void MergeSmoke3DColors(smoke3ddata *smoke3dset){ float co2j, co2max=0.1; float tempj, tempmax=1200.0, tempmin=20.0; - co2j = co2max*(float)j/255.0; - smoke3di->co2_alphas[j] = 255.0*(1.0-pow(0.5, (mesh_smoke3d->dxyz_fds[0]/co2_halfdepth)*(co2j/co2max))); - tempj = tempmin + (tempmax-20.0)*(float)j/255.0; + co2j = co2max*(float)j/255.0; + smoke3di->co2_alphas[j] = 255.0*(1.0-pow(0.5, (mesh_smoke3d->dxyz_fds[0]/co2_halfdepth)*(co2j/co2max))); + tempj = tempmin + (tempmax-20.0)*(float)j/255.0; smoke3di->fire_alphas[j] = 255.0*(1.0-pow(0.5, (mesh_smoke3d->dxyz_fds[0]/fire_halfdepth)*((tempj-tempmin)/tempmax))); } } - for(i=first;i<=last;i++){ - smoke3ddata *smoke3di; + for(i=0;i<1;i++){ + int j; meshdata *mesh_smoke3d; unsigned char *firecolor_data,*smokecolor_data,*co2color_data; unsigned char *mergecolor,*mergealpha; unsigned char smokeval_uc[3], co2val_uc[3]; - smoke3di = global_scase.smoke3dcoll.smoke3dinfo + i; - if(smoke3dset!=NULL&&smoke3dset!=smoke3di)continue; if(smoke3di->loaded==0||smoke3di->primary_file==0)continue; if(smoke3di->is_fire == 1 && smoke3di->skip_fire == 1)continue; if(smoke3di->is_smoke == 1 && smoke3di->skip_smoke == 1)continue; @@ -4036,8 +4026,8 @@ void MergeSmoke3DColors(smoke3ddata *smoke3dset){ NewMemory((void **)&mesh_smoke3d->merge_alpha,smoke3di->nchars_uncompressed*sizeof(unsigned char)); } - mergecolor= mesh_smoke3d->merge_color; - mergealpha= mesh_smoke3d->merge_alpha; + mergecolor = mesh_smoke3d->merge_color; + mergealpha = mesh_smoke3d->merge_alpha; mesh_smoke3d->smokecolor_ptr = mergecolor; mesh_smoke3d->smokealpha_ptr = mergealpha; @@ -4148,25 +4138,15 @@ void MergeSmoke3DColors(smoke3ddata *smoke3dset){ /* ------------------ MergeSmoke3DBlack ------------------------ */ -void MergeSmoke3DBlack(smoke3ddata *smoke3dset){ +void MergeSmoke3DBlack(smoke3ddata *smoke3di){ int i; int fire_index; - int first, last; - - first = 0; - last = global_scase.smoke3dcoll.nsmoke3dinfo-1; - if(smoke3dset != NULL){ - first = smoke3dset - global_scase.smoke3dcoll.smoke3dinfo; - last = first; - } fire_index = HRRPUV_index; - for(i = first; i<=last; i++){ - smoke3ddata *smoke3di, *smoke3d_soot; + for(i = 0;i<1; i++){ + smoke3ddata *smoke3d_soot; meshdata *mesh_smoke3d; - smoke3di = global_scase.smoke3dcoll.smoke3dinfo+i; - if(smoke3dset!=NULL&&smoke3dset!=smoke3di)continue; smoke3di->primary_file = 0; if(smoke3di->loaded==0||smoke3di->display==0)continue; mesh_smoke3d = global_scase.meshescoll.meshinfo+smoke3di->blocknumber; @@ -4200,13 +4180,10 @@ void MergeSmoke3DBlack(smoke3ddata *smoke3dset){ } } - for(i = first; i <= last; i++){ - smoke3ddata *smoke3di; + for(i = 0; i <1; i++){ meshdata *meshi; unsigned char *firecolor_data, *smokecolor_data; - smoke3di = global_scase.smoke3dcoll.smoke3dinfo+i; - if(smoke3dset!=NULL&&smoke3dset!=smoke3di)continue; if(smoke3di->loaded==0||smoke3di->primary_file==0)continue; if(IsSmokeComponentPresent(smoke3di)==0)continue; meshi = global_scase.meshescoll.meshinfo+smoke3di->blocknumber; diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 2d9021c816..96c46f8b10 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -2830,7 +2830,7 @@ void Keyboard(unsigned char key, int flag){ break; case '0': if(plotstate==DYNAMIC_PLOTS){ - SetFrameIndex(0,PAUSE_TIME); + SetTimeFrameIndex(0,NO_PAUSE_TIME); } break; case '~': @@ -3050,7 +3050,7 @@ void Keyboard(unsigned char key, int flag){ if(plotstate==DYNAMIC_PLOTS){ if(timebar_drag==0){ iglobal_times = CLAMP(iglobal_times + skip_global * FlowDir,0, nglobal_times - 1); - SetFrameIndex(iglobal_times,stept); + SetTimeFrameIndex(iglobal_times,stept); } return; } @@ -3646,7 +3646,7 @@ void UpdateFrame(float thisinterval, int *changetime, int *redisplay){ iglobal_times += render_skip*FlowDir; } } - SetFrameIndex(iglobal_times,stept); + SetTimeFrameIndex(iglobal_times,stept); } if(script_render_flag == 1&&IS_LOADRENDER)iglobal_times = script_itime; diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index ec70105e19..9f241206f1 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -4486,21 +4486,13 @@ void GLUISetTimeVal(float timeval){ } } -/* ------------------ SetFrameIndexWorker ------------------------ */ +/* ------------------ SetTimeFrameIndexWorker ------------------------ */ -void SetFrameIndexWorker(int frameindex, int stept_arg){ +void SetTimeFrameIndexWorker(int frameindex, int stept_arg){ int changed_frame = 0; if(global_times == NULL)return; - if(frameindex < 0){ - frameindex = 0; - changed_frame = 1; - } - if(frameindex > nglobal_times - 1){ - frameindex = nglobal_times-1; - changed_frame = 1; - } - iglobal_times = frameindex; + iglobal_times = CLAMP(frameindex, 0, nglobal_times-1); stept = 1; force_redisplay = 1; UpdateFrameNumber(0); @@ -4508,16 +4500,16 @@ void SetFrameIndexWorker(int frameindex, int stept_arg){ stept = stept_arg; //Keyboard('t', FROM_SMOKEVIEW); SPINNER_timebounds->set_float_val(GetTime()); - if(changed_frame==1)SPINNER_framebounds->set_int_val(frameindex); + if(frameindex != iglobal_times)SPINNER_framebounds->set_int_val(iglobal_times); } -/* ------------------ SetFrameIndex ------------------------ */ +/* ------------------ SetTimeFrameIndex ------------------------ */ -void SetFrameIndex(int frameindex, int stept_arg){ +void SetTimeFrameIndex(int frameindex, int stept_arg){ INIT_PRINT_TIMER(frame_timer); - SetFrameIndexWorker(frameindex, stept_arg); - SetFrameIndexWorker(frameindex, stept_arg); - PRINT_TIMER(frame_timer, "SetFrameIndex"); + SetTimeFrameIndexWorker(frameindex, stept_arg); + SetTimeFrameIndexWorker(frameindex, stept_arg); + PRINT_TIMER(frame_timer, "SetTimeFrameIndex"); } /* ------------------ UpdateGluiFrame ------------------------ */ @@ -4533,18 +4525,18 @@ void TimeBoundCB(int var){ updatemenu = 1; switch(var){ case SET_FRAME: - SetFrameIndex(glui_frame,PAUSE_TIME); + SetTimeFrameIndex(glui_frame,PAUSE_TIME); break; case PREV_FRAME: glui_frame--; if(glui_frame<0)glui_frame = nglobal_times-1; - SetFrameIndex(glui_frame,PAUSE_TIME); + SetTimeFrameIndex(glui_frame,PAUSE_TIME); SPINNER_framebounds->set_int_val(glui_frame); break; case NEXT_FRAME: glui_frame++; if(glui_frame>nglobal_times-1)glui_frame=0; - SetFrameIndex(glui_frame,PAUSE_TIME); + SetTimeFrameIndex(glui_frame,PAUSE_TIME); SPINNER_framebounds->set_int_val(glui_frame); break; case SET_TIME: diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 777ac1d9b6..dd7d325808 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -9,7 +9,7 @@ //*** glui_bounds.cpp headers -EXTERNCPP void SetFrameIndex(int frameval, int stept_arg); +EXTERNCPP void SetTimeFrameIndex(int frameval, int stept_arg); EXTERNCPP void UpdateGluiFrame(int val); //*** glui_clip.cpp headers diff --git a/Source/smokeview/smokeviewdefs.h b/Source/smokeview/smokeviewdefs.h index c379a39ea6..c6f8a7ece3 100644 --- a/Source/smokeview/smokeviewdefs.h +++ b/Source/smokeview/smokeviewdefs.h @@ -242,7 +242,8 @@ EXTERNCPP void _Sniff_Errors(const char *whereat, const char *file, int line); #define TIMEBAR_OVERLAP_NEVER 1 #define TIMEBAR_OVERLAP_AUTO 2 -#define PAUSE_TIME 0 +#define PAUSE_TIME 0 +#define NO_PAUSE_TIME 1 #define RENDER_START 3 #define RENDER_START_NORMAL 12 From 4280b3ce98302f01d5f63c6b529700842334e7b1 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 31 Mar 2026 00:21:39 -0400 Subject: [PATCH 22/46] smokeview source: add some test code to 3d smoke vis routine (commented) --- Source/smokeview/IOsmoke.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 8a7ee57251..e919762b70 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2735,6 +2735,8 @@ void DrawSmokeFrame(void){ xyz = smokemesh->boxmiddle_smv; Output3Text(foregroundcolor, xyz[0], xyz[1], xyz[2], alabel); #endif + // DrawBoxMinMax(smokemesh->boxmin_smv,smokemesh->boxmax_smv,foregroundcolor); + // if(smokemesh->xplt_fds[1] - smokemesh->xplt_fds[0] > 0.2)continue; #ifdef pp_GPU if(usegpu_local == 1) { DrawSmoke3DGPU(smoke3di); From 1b4e17884c75e40b6410f5e3cb4d17679bef9326 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 31 Mar 2026 16:30:25 -0400 Subject: [PATCH 23/46] smokeview source: add option to show mesh 3d smoke is in (and hide smoke) --- Source/smokeview/IOsmoke.c | 8 ++++++-- Source/smokeview/glui_smoke.cpp | 5 +++-- Source/smokeview/smokeviewvars.h | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index e919762b70..640ffd09bd 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2735,8 +2735,12 @@ void DrawSmokeFrame(void){ xyz = smokemesh->boxmiddle_smv; Output3Text(foregroundcolor, xyz[0], xyz[1], xyz[2], alabel); #endif - // DrawBoxMinMax(smokemesh->boxmin_smv,smokemesh->boxmax_smv,foregroundcolor); - // if(smokemesh->xplt_fds[1] - smokemesh->xplt_fds[0] > 0.2)continue; +#ifdef pp_SPEEDUP + if(vis_smokemesh == 1){ + DrawBoxMinMax(smokemesh->boxmin_smv, smokemesh->boxmax_smv, foregroundcolor); + continue; + } +#endif #ifdef pp_GPU if(usegpu_local == 1) { DrawSmoke3DGPU(smoke3di); diff --git a/Source/smokeview/glui_smoke.cpp b/Source/smokeview/glui_smoke.cpp index 84cf4744f4..1018e499d6 100644 --- a/Source/smokeview/glui_smoke.cpp +++ b/Source/smokeview/glui_smoke.cpp @@ -489,8 +489,9 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "max blending", &hrrpuv_max_blending); CHECKBOX_smoke_flip = glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "flip background", &background_flip,BACKGROUND_FLIP, GLUISmoke3dCB); CHECKBOX_triangle_display_rate = glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "triangle display rate", &show_trirates); - glui_3dsmoke->add_checkbox_to_panel( - PANEL_settings1, "cull hidden meshes", &cull_meshes); + glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "cull hidden meshes", &cull_meshes); + glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "hide smoke/fire, show mesh", &vis_smokemesh); + //---------------------------------------------Slice render settings-------------------------------------------------------------- diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 3bfc754139..dd03b38d37 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -394,6 +394,9 @@ SVEXTERN int nplot3dloaded, nsmoke3dloaded, nisoloaded, nsliceloaded, nvsliceloa SVEXTERN int npartloaded, npatchloaded, nvolsmoke3dloaded, npart5loaded, npartloaded; SVEXTERN int nplot3dvis, nsmoke3dvis, nisovis, nslicevis, nvslicevis; SVEXTERN int npatchvis, nvolsmoke3dvis, npart5vis, npartvis; +#ifdef pp_SPEEDUP +SVEXTERN int SVDECL(vis_smokemesh, 0); +#endif SVEXTERN int SVDECL(nplot3dloaded_old,0), SVDECL(nsmoke3dloaded_old,0), SVDECL(nisoloaded_old,0); SVEXTERN int SVDECL(nsliceloaded_old,0), SVDECL(nvsliceloaded_old,0), SVDECL(npatchloaded_old,0); From 9dd1dddd68bd47f9ea6faf7917f60cd910f35c77 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 31 Mar 2026 22:53:36 -0400 Subject: [PATCH 24/46] smokeview source: correct frame update when time view min/max bounds are set --- Source/smokeview/callbacks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 96c46f8b10..9ba6a23940 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -3049,7 +3049,10 @@ void Keyboard(unsigned char key, int flag){ if(plotstate==DYNAMIC_PLOTS){ if(timebar_drag==0){ - iglobal_times = CLAMP(iglobal_times + skip_global * FlowDir,0, nglobal_times - 1); + iglobal_times = iglobal_times + skip_global * FlowDir; + if(use_tload_begin == 1 && iglobal_times<0)iglobal_times = nglobal_times-1; + if(use_tload_end == 1 && iglobal_times>nglobal_times-1)iglobal_times = 0; + iglobal_times = CLAMP(iglobal_times,0, nglobal_times - 1); SetTimeFrameIndex(iglobal_times,stept); } return; From 72eebb02e35410a7d887176eaafcb6620068c059 Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 1 Apr 2026 11:18:28 -0400 Subject: [PATCH 25/46] smokeview source: dont' change time state when setting labels --- Source/smokeview/menus.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index 434da8378a..0df2c585cb 100644 --- a/Source/smokeview/menus.c +++ b/Source/smokeview/menus.c @@ -885,12 +885,7 @@ void LabelMenu(int value){ break; case MENU_LABEL_framelabel: visFramelabel=1-visFramelabel; - if(visFramelabel==1){ - vis_hrr_label=0; - } - plotstate=GetPlotState(DYNAMIC_PLOTS); - UpdateShow(); - update_times = 1; + if(visFramelabel==1)vis_hrr_label=0; break; case MENU_LABEL_meshlabel: visMeshlabel=1-visMeshlabel; From a40b672b4bc71a7286979098dc55076191ac8612 Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 1 Apr 2026 11:22:19 -0400 Subject: [PATCH 26/46] smokeview source: update time gui widgets when time val and time frame index changes --- Source/smokeview/callbacks.c | 33 +++++++++++++--- Source/smokeview/glui_bounds.cpp | 68 +++++++++++--------------------- Source/smokeview/glui_bounds.h | 4 +- Source/smokeview/smokeheaders.h | 2 +- Source/smokeview/smokeviewvars.h | 3 +- Source/smokeview/update.c | 4 ++ 6 files changed, 59 insertions(+), 55 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 9ba6a23940..1f0b099937 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -861,7 +861,6 @@ int TimebarClick(int xm, int ym){ void UpdateTime(int time){ if(nglobal_times > 0){ iglobal_times = time; - UpdateGluiFrame(iglobal_times); CheckTimeBound(); IdleCB(); } @@ -1651,6 +1650,32 @@ void UpdateGridClip(int flag){ } } +/* ------------------ SetTimeFrameIndexWorker ------------------------ */ + +void SetTimeFrameIndexWorker(int frameindex, int stept_arg){ + int changed_frame = 0; + + if(global_times == NULL)return; + if(use_tload_begin == 1 && frameindex < 0)frameindex = nglobal_times - 1; + if(use_tload_end == 1 && frameindex > nglobal_times - 1)frameindex = 0; + iglobal_times = CLAMP(frameindex, 0, nglobal_times - 1); + stept = 1; + force_redisplay = 1; + UpdateFrameNumber(0); + UpdateTimeLabels(); + stept = stept_arg; + //Keyboard('t', FROM_SMOKEVIEW); +} + +/* ------------------ SetTimeFrameIndex ------------------------ */ + +void SetTimeFrameIndex(int frameindex, int stept_arg){ + INIT_PRINT_TIMER(frame_timer); + // SetTimeFrameIndexWorker(frameindex, stept_arg); + SetTimeFrameIndexWorker(frameindex, stept_arg); + PRINT_TIMER(frame_timer, "SetTimeFrameIndex"); +} + /* ------------------ Keyboard ------------------------ */ void Keyboard(unsigned char key, int flag){ @@ -3049,11 +3074,7 @@ void Keyboard(unsigned char key, int flag){ if(plotstate==DYNAMIC_PLOTS){ if(timebar_drag==0){ - iglobal_times = iglobal_times + skip_global * FlowDir; - if(use_tload_begin == 1 && iglobal_times<0)iglobal_times = nglobal_times-1; - if(use_tload_end == 1 && iglobal_times>nglobal_times-1)iglobal_times = 0; - iglobal_times = CLAMP(iglobal_times,0, nglobal_times - 1); - SetTimeFrameIndex(iglobal_times,stept); + SetTimeFrameIndex(iglobal_times + skip_global * FlowDir,stept); } return; } diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index 9f241206f1..e0e3530ed8 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -2807,8 +2807,8 @@ GLUI_Spinner *SPINNER_line_contour_num=NULL; GLUI_Spinner *SPINNER_line_contour_width=NULL; GLUI_Spinner *SPINNER_line_contour_min=NULL; GLUI_Spinner *SPINNER_line_contour_max=NULL; -GLUI_Spinner *SPINNER_timebounds=NULL; -GLUI_Spinner *SPINNER_framebounds=NULL; +GLUI_Spinner *SPINNER_timeval=NULL; +GLUI_Spinner *SPINNER_timeindex=NULL; GLUI_Spinner *SPINNER_tload_begin=NULL; GLUI_Spinner *SPINNER_tload_end=NULL; GLUI_Spinner *SPINNER_tload_skip=NULL; @@ -4479,67 +4479,35 @@ void GLUISetTimeVal(float timeval){ UpdateFrameNumber(0); UpdateTimeLabels(); Keyboard('t', FROM_SMOKEVIEW); - SPINNER_framebounds->set_int_val(iglobal_times); + SPINNER_timeindex->set_int_val(iglobal_times); break; } } } } -/* ------------------ SetTimeFrameIndexWorker ------------------------ */ - -void SetTimeFrameIndexWorker(int frameindex, int stept_arg){ - int changed_frame = 0; - - if(global_times == NULL)return; - iglobal_times = CLAMP(frameindex, 0, nglobal_times-1); - stept = 1; - force_redisplay = 1; - UpdateFrameNumber(0); - UpdateTimeLabels(); - stept = stept_arg; - //Keyboard('t', FROM_SMOKEVIEW); - SPINNER_timebounds->set_float_val(GetTime()); - if(frameindex != iglobal_times)SPINNER_framebounds->set_int_val(iglobal_times); -} - -/* ------------------ SetTimeFrameIndex ------------------------ */ - -void SetTimeFrameIndex(int frameindex, int stept_arg){ - INIT_PRINT_TIMER(frame_timer); - SetTimeFrameIndexWorker(frameindex, stept_arg); - SetTimeFrameIndexWorker(frameindex, stept_arg); - PRINT_TIMER(frame_timer, "SetTimeFrameIndex"); -} - - /* ------------------ UpdateGluiFrame ------------------------ */ - -void UpdateGluiFrame(int val){ - if(SPINNER_framebounds!=NULL)SPINNER_framebounds->set_int_val(val); -} - /* ------------------ TimeBoundCB ------------------------ */ void TimeBoundCB(int var){ updatemenu = 1; switch(var){ - case SET_FRAME: + case SET_TIME_FRAME: SetTimeFrameIndex(glui_frame,PAUSE_TIME); break; case PREV_FRAME: glui_frame--; if(glui_frame<0)glui_frame = nglobal_times-1; SetTimeFrameIndex(glui_frame,PAUSE_TIME); - SPINNER_framebounds->set_int_val(glui_frame); + SPINNER_timeindex->set_int_val(glui_frame); break; case NEXT_FRAME: glui_frame++; if(glui_frame>nglobal_times-1)glui_frame=0; SetTimeFrameIndex(glui_frame,PAUSE_TIME); - SPINNER_framebounds->set_int_val(glui_frame); + SPINNER_timeindex->set_int_val(glui_frame); break; - case SET_TIME: + case SET_TIME_VAL: GLUISetTimeVal(glui_time); GLUISetTimeVal(glui_time); break; @@ -5700,11 +5668,11 @@ extern "C" void GLUIBoundsSetup(int main_window){ ROLLOUT_time1a = glui_bounds->add_rollout_to_panel(PANEL_loadbounds, "Set time/frame", false, LOAD_TIMESET_ROLLOUT, LoadRolloutCB); TOGGLE_ROLLOUT(loadprocinfo, nloadprocinfo, ROLLOUT_time1a, LOAD_TIMESET_ROLLOUT, glui_bounds); - SPINNER_timebounds = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Time:", GLUI_SPINNER_FLOAT, &glui_time); - BUTTON_SETTIME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set time", SET_TIME, TimeBoundCB); + SPINNER_timeval = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Time:", GLUI_SPINNER_FLOAT, &glui_time, SET_TIME_VAL, TimeBoundCB); + BUTTON_SETTIME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set time", SET_TIME_VAL, TimeBoundCB); - SPINNER_framebounds = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Frame:", GLUI_SPINNER_INT, &glui_frame); - BUTTON_SETFRAME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set frame", SET_FRAME, TimeBoundCB); + SPINNER_timeindex = glui_bounds->add_spinner_to_panel(ROLLOUT_time1a, "Frame:", GLUI_SPINNER_INT, &glui_frame, SET_TIME_FRAME, TimeBoundCB); + BUTTON_SETFRAME = glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Set frame", SET_TIME_FRAME, TimeBoundCB); glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Prev frame", PREV_FRAME, TimeBoundCB); glui_bounds->add_button_to_panel(ROLLOUT_time1a, "Next frame", NEXT_FRAME, TimeBoundCB); @@ -7216,11 +7184,21 @@ extern "C" void GLUIUpdatePlot3dDisplay(void){ if(RADIO_plot3d_display!=NULL)RADIO_plot3d_display->set_int_val(contour_type); } + /* ------------------ GLUIUpdateTime ------------------------ */ + +void GLUIUpdateTime(void){ + if(SPINNER_timeval!=NULL)SPINNER_timeval->set_float_val(GetTime()); + if(SPINNER_timeindex!=NULL)SPINNER_timeindex->set_int_val(iglobal_times); +} + /* ------------------ GLUIUpdateTimeBounds ------------------------ */ extern "C" void GLUIUpdateTimeBounds(float time_min, float time_max){ - if(SPINNER_timebounds!=NULL){ - SPINNER_timebounds->set_float_limits(time_min,time_max); + if(SPINNER_timeval!=NULL){ + SPINNER_timeval->set_float_limits(time_min,time_max); + } + if(SPINNER_timeindex!=NULL && nglobal_times>0){ + SPINNER_timeindex->set_int_limits(0,nglobal_times); } } diff --git a/Source/smokeview/glui_bounds.h b/Source/smokeview/glui_bounds.h index d4ec661e3c..8cfdb0545d 100644 --- a/Source/smokeview/glui_bounds.h +++ b/Source/smokeview/glui_bounds.h @@ -54,8 +54,8 @@ #define SET_GLOBAL_BOUNDS 27 #define PARTSKIP 28 #define UNLOAD_QDATA 203 -#define SET_TIME 204 -#define SET_FRAME 229 +#define SET_TIME_VAL 204 +#define SET_TIME_FRAME 229 #define PREV_FRAME 230 #define NEXT_FRAME 231 #define TBOUNDS 205 diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index dd7d325808..75dde6de38 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -10,7 +10,7 @@ //*** glui_bounds.cpp headers EXTERNCPP void SetTimeFrameIndex(int frameval, int stept_arg); -EXTERNCPP void UpdateGluiFrame(int val); +EXTERNCPP void GLUIUpdateTime(void); //*** glui_clip.cpp headers diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index dd03b38d37..ca330b1601 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1921,7 +1921,8 @@ SVEXTERN int minfill, maxfill; SVEXTERN int SVDECL(*plotiso,NULL); -SVEXTERN int SVDECL(nglobal_times,0), SVDECL(iglobal_times,0), SVDECL(itime_save,-1), SVDECL(itimeold,-999); +SVEXTERN int SVDECL(nglobal_times,0), SVDECL(itime_save,-1), SVDECL(itimeold,-999); +SVEXTERN int SVDECL(iglobal_times,0), SVDECL(iglobal_times_last, -1); SVEXTERN float SVDECL(*global_times,NULL), SVDECL(*times_buffer, NULL), cputimes[20]; SVEXTERN int SVDECL(ntimes_buffer, 0); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 5df277c35b..0887101dd6 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -2439,6 +2439,10 @@ void UpdateShowScene(void){ PRINT_TIMER(timer_update_facelists, "UpdateFaceLists"); END_SHOW_UPDATE(updatefacelists); } + if(global_times != NULL && iglobal_times != iglobal_times_last){ + iglobal_times_last = iglobal_times; + GLUIUpdateTime(); + } #ifdef pp_SHOW_UPDATE if(updating==1){ printf("update complete\n\n"); From 24e64cff685726f4480519dbbce67bcad27aee0f Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 1 Apr 2026 21:21:00 -0400 Subject: [PATCH 27/46] smokezip source: add option to compress 3d smokeview after skipping specifified number of planes --- Source/smokezip/CNV3dsmoke.c | 57 ++++++++++++++++++++++++++++++++++++ Source/smokezip/main.c | 18 +++++++++++- Source/smokezip/options.h | 1 + Source/smokezip/svzip.h | 4 +++ 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/Source/smokezip/CNV3dsmoke.c b/Source/smokezip/CNV3dsmoke.c index 8bb94a496f..82f303e9c3 100644 --- a/Source/smokezip/CNV3dsmoke.c +++ b/Source/smokezip/CNV3dsmoke.c @@ -9,6 +9,37 @@ #include "dmalloc.h" #include "compress.h" +#ifdef pp_REDUCE_SMOKE3D +/* ------------------ Reduce3DSmoke ------------------------ */ + +#define IJKNODE(i,j,k) ((i)+(j)*nx+(k)*nxy) + +void ReduceSmoke3D(unsigned char *full_alphabuffer, int *nxyz_in, int skip_smokeplanes, + unsigned char *full_alphabuffer_out){ + + int k, nx, ny, nz, nxy; + + nx = nxyz_in[0]; + ny = nxyz_in[1]; + nz = nxyz_in[2]; + nxy = nx*ny; + + for(k = 0;k < nz;k += skip_smokeplanes){ + int j; + + for(j = 0;j < ny;j += skip_smokeplanes){ + int i; + + for(i = 0;i < nx;i+=skip_smokeplanes){ + + *full_alphabuffer_out = full_alphabuffer[IJKNODE(i, j, k)]; + full_alphabuffer_out++; + } + } + } +} +#endif + /* ------------------ Convert3DSmoke ------------------------ */ void Convert3DSmoke(smoke3d *smoke3di, int *thread_index){ @@ -156,6 +187,23 @@ void Convert3DSmoke(smoke3d *smoke3di, int *thread_index){ nx = nxyz[3]-nxyz[2]+1; ny = nxyz[5]-nxyz[4]+1; nz = nxyz[7]-nxyz[6]+1; + +#ifdef pp_REDUCE_SMOKE3D + int nxyz_in[3], [3], nxy; + unsigned char *full_alphabuffer_out; + + if(GLOBreduce_smoke3d == 1){ + nxyz_in[0] = nx; + nxyz_in[1] = ny; + nxyz_in[2] = nz; + nxy = nx*ny; + nxyz_out[0] = 1 + (nx - 1) / GLOBskip_smokeplanes; + nxyz_out[1] = 1 + (ny - 1) / GLOBskip_smokeplanes; + nxyz_out[2] = 1 + (nz - 1) / GLOBskip_smokeplanes; + NewMemory((void **)&full_alphabuffer_out, nxyz_out[0] * nxyz_out[1] * nxyz_out[2]); + } +#endif + buffersize=2*(1.01*nx*ny*nz+600); smoke3di->nx=nx; smoke3di->ny=ny; @@ -196,6 +244,15 @@ void Convert3DSmoke(smoke3d *smoke3di, int *thread_index){ fprintf(stderr,"*** Warning frame size expected=%i frame size found=%i\n",nfull_file,nfull_data); } +#ifdef pp_REDUCE_SMOKE3D + if(GLOBreduce_smoke3d == 1){ + ReduceSmoke3D(full_alphabuffer, nxyz_in, GLOBskip_smokeplanes, full_alphabuffer_out); + FREEMEMORY(full_alphabuffer); + full_alphabuffer = full_alphabuffer_out; + nfull_data = nxyz_out[0]*nxyz_out[1]*nxyz_out[2]; + } +#endif + // compress frame data (into ZLIB format) ncompressed_zlib=buffersize; diff --git a/Source/smokezip/main.c b/Source/smokezip/main.c index 36d184ad99..ed46fa8290 100644 --- a/Source/smokezip/main.c +++ b/Source/smokezip/main.c @@ -54,7 +54,11 @@ void Usage(int option){ PRINTF(" uses (20.0,620.0) and (0.0,0.23) for temperature and oxygen bounds\n"); PRINTF(" and creates the .svd file which activates the Smokeview demonstrator\n"); PRINTF(" mode.\n"); - PRINTF(" -skip skipval - skip frames when compressing files\n\n"); + PRINTF(" -skip skipval - skip frames when compressing files\n"); +#ifdef pp_REDUCE_SMOKE3D + PRINTF(" -smokeskip n - skip n smoke planes when compressing 3D smoke files\n"); +#endif + PRINTF("\n"); UsageCommon(HELP_ALL); } } @@ -125,6 +129,10 @@ int main(int argc, char **argv){ GLOBboundzipstep=1; GLOBslicezipstep=1; GLOBfilesremoved=0; +#ifdef pp_REDUCE_SMOKE3D + GLOBreduce_smoke3d = 0; + GLOBskip_smokeplanes = 1; +#endif npatchinfo=0; nsmoke3dinfo=0; @@ -223,6 +231,14 @@ int main(int argc, char **argv){ } i++; } +#ifdef pp_REDUCE_SMOKE3D + else if(strcmp(arg, "-smokeskip") == 0){ + arg2 = argv[i + 1]; + sscanf(arg2, "%i", &GLOBskip_smokeplanes); + GLOBreduce_smoke3d = 1; + i++; + } +#endif break; case 'd': if(strcmp(arg,"-demo")==0){ diff --git a/Source/smokezip/options.h b/Source/smokezip/options.h index 41f8f59302..d85c598da3 100644 --- a/Source/smokezip/options.h +++ b/Source/smokezip/options.h @@ -3,5 +3,6 @@ #include "options_common.h" #define pp_SMOKEZIP +//#define pp_REDUCE_SMOKE3D #endif diff --git a/Source/smokezip/svzip.h b/Source/smokezip/svzip.h index 6b697360b6..60e9a8ce81 100644 --- a/Source/smokezip/svzip.h +++ b/Source/smokezip/svzip.h @@ -285,5 +285,9 @@ EXTERN char *GLOBendianfile; EXTERN int GLOBmake_demo; EXTERN int GLOBpartfile2iso; EXTERN char GLOBsmvisofile[1024]; +#ifdef pp_REDUCE_SMOKE3D +EXTERN int GLOBreduce_smoke3d; +EXTERN int GLOBskip_smokeplanes; +#endif #endif From 0b7e71cc5bc5b013106bb59797fc4419a727640c Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 2 Apr 2026 08:53:49 -0400 Subject: [PATCH 28/46] smokeview source: fix problem reading compressed boundary files --- Source/smokeview/IOboundary.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/smokeview/IOboundary.c b/Source/smokeview/IOboundary.c index 44fdb34d80..d369c568be 100644 --- a/Source/smokeview/IOboundary.c +++ b/Source/smokeview/IOboundary.c @@ -728,19 +728,21 @@ void GetBoundaryHeader2(char *file, patchfacedata *patchfaceinfo, int nmeshes_ar fread(&npatches, 4, 1, stream); for(i = 0;iib, buffer, 6*sizeof(int)); - patchfaceinfo->dir = buffer[6]; + memcpy(patchi->ib, buffer, 6*sizeof(int)); + patchi->dir = buffer[6]; obst_index = buffer[7]; mesh_index = buffer[8] - 1; - patchfaceinfo->obst_index = obst_index; - patchfaceinfo->mesh_index = mesh_index; - patchfaceinfo->meshinfo = NULL; - patchfaceinfo->obst = NULL; - if(mesh_index >= 0 && mesh_index < nmeshes_arg)patchfaceinfo->meshinfo = global_scase.meshescoll.meshinfo + mesh_index; - if(patchfaceinfo->meshinfo != NULL && obst_index>=1 && obst_index<=patchfaceinfo->meshinfo->nbptrs)patchfaceinfo->obst = patchfaceinfo->meshinfo->blockageinfoptrs[obst_index-1]; + patchi->obst_index = obst_index; + patchi->mesh_index = mesh_index; + patchi->meshinfo = NULL; + patchi->obst = NULL; + if(mesh_index >= 0 && mesh_index < nmeshes_arg)patchi->meshinfo = global_scase.meshescoll.meshinfo + mesh_index; + if(patchi->meshinfo != NULL && obst_index>=1 && obst_index<= patchi->meshinfo->nbptrs)patchfaceinfo->obst = patchi->meshinfo->blockageinfoptrs[obst_index-1]; } fclose(stream); } From 8fa17f172ecc92aa01de41c92e84c87bdc59fd0c Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 2 Apr 2026 09:21:13 -0400 Subject: [PATCH 29/46] smokeview source: revert some load density 3d smoke code --- Source/smokeview/IOsmoke.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 640ffd09bd..fcc3ca1912 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -3170,37 +3170,25 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in times_map = *times_map_ptr; nch_smoke_compressed_full = *nchars_smoke_compressed_full; nch_smoke_compressed_found= *nchars_smoke_compressed_found; -#ifdef pp_SPEEDUP - maxvals = *maxvals_ptr; -#else if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1)maxvals = *maxvals_ptr; -#endif NewResizeMemory( use_smokeframe_full, (*ntimes_full) * sizeof(int)); NewResizeMemory( times, nframes_found * sizeof(float)); NewResizeMemory( times_map, nframes_found * sizeof(char)); NewResizeMemory( nch_smoke_compressed_full, (*ntimes_full) * sizeof(int)); NewResizeMemory(nch_smoke_compressed_found, (*ntimes_found) * sizeof(int)); -#ifdef pp_SPEEDUP - NewResizeMemory(maxvals, (*ntimes_full) * sizeof(float)); -#else if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ NewResizeMemory(maxvals, (*ntimes_full) * sizeof(float)); } -#endif *use_smokeframe = use_smokeframe_full; *times_ptr = times; *times_map_ptr = times_map; *nchars_smoke_compressed_full = nch_smoke_compressed_full; *nchars_smoke_compressed_found = nch_smoke_compressed_found; -#ifdef pp_SPEEDUP - *maxvals_ptr = maxvals; -#else if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ *maxvals_ptr = maxvals; } -#endif fgets(buffer, 255, SMOKE_SIZE); ntimes_full2 = 0; @@ -3227,24 +3215,13 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in sscanf(buffer, "%f %i %i %i %i %f", &time_local, &nch_uncompressed, &dummy, &nch_smoke_compressed, &nch_light, &maxvali); } *maxval = MAX(maxvali, *maxval); -#ifdef pp_SPEEDUP if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ *maxvals++ = maxval_density; *nch_smoke_compressed_full++ = nch_smoke_density; } else{ - *maxvals++ = maxvali; *nch_smoke_compressed_full++ = nch_smoke_compressed; } -#else - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ - *maxvals++ = maxval_density; - *nch_smoke_compressed_full++ = nch_smoke_density; - } - else{ - *nch_smoke_compressed_full++ = nch_smoke_compressed; - } -#endif *use_smokeframe_full = 0; if(use_tload_end == 1 && time_local > global_scase.tload_end)break; From c11dc6eeef0a8e6fd733665a9fab6422f6a8212a Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 3 Apr 2026 16:07:19 -0400 Subject: [PATCH 30/46] smokeview source: 3D smoke file loading if opacity 3d smoke file is missing --- Source/smokeview/IOsmoke.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index aebf73fcaa..4835343c7a 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2878,6 +2878,15 @@ FILE *GetSmokeFileSize(char *smokefile, int fortran_skip, int version){ strcat(smoke_sizefilename, ".sz"); SMOKE_SIZE = FOPEN_2DIR(smoke_sizefilename, "r"); } + if(SMOKE_SIZE == NULL){ + char *ext; + + strcpy(smoke_sizefilename, smokefile); + ext = strchr(smoke_sizefilename, '.'); + if(ext != NULL)ext[0] = 0; + strcat(smoke_sizefilename, ".s3d.sz"); + SMOKE_SIZE = FOPEN_2DIR(smoke_sizefilename, "r"); + } if(SMOKE_SIZE != NULL)return SMOKE_SIZE; // wasn't able to read the size file so try creating a new one @@ -3253,6 +3262,10 @@ int GetSmoke3DVersion2(smoke3ddata *smoke3di){ if(SMOKE3D_COMPFILE==NULL){ file = smoke3di->reg_file; SMOKE3D_REGFILE = FOPEN(file, "rb"); + if(SMOKE3D_REGFILE == NULL){ + file = smoke3di->smoke_density_file; + SMOKE3D_REGFILE = FOPEN(file, "rb"); + } } if(SMOKE3D_REGFILE==NULL&&SMOKE3D_COMPFILE==NULL)return -1; if(SMOKE3D_COMPFILE!=NULL)SMOKE3DFILE = SMOKE3D_COMPFILE; From daaf43bb149b8051105dae487aea96a5677c479c Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 3 Apr 2026 23:50:31 -0400 Subject: [PATCH 31/46] smokeview source: remove widgets for specifying 3d smoke file type --- Source/shared/readsmvfile.c | 1 + Source/smokeview/glui_smoke.cpp | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/shared/readsmvfile.c b/Source/shared/readsmvfile.c index 23e4e53def..6269242faf 100644 --- a/Source/shared/readsmvfile.c +++ b/Source/shared/readsmvfile.c @@ -3775,6 +3775,7 @@ int ParseSMOKE3DProcess(smv_case *scase, bufferstreamdata *stream, char *buffer, if(ReadLabels(&smoke3di->label, stream, NULL)==LABEL_ERR)return RETURN_TWO; if(strcmp(smoke3di->label.longlabel, "SOOT DENSITY") == 0){ smoke3di->is_smoke = 1; + smoke3di->reg_file = smoke3di->smoke_density_file; } if(strcmp(smoke3di->label.longlabel, "HRRPUV")==0){ scase->show_hrrcutoff_active = 1; diff --git a/Source/smokeview/glui_smoke.cpp b/Source/smokeview/glui_smoke.cpp index 84cf4744f4..72b844b05f 100644 --- a/Source/smokeview/glui_smoke.cpp +++ b/Source/smokeview/glui_smoke.cpp @@ -498,12 +498,6 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ glui_3dsmoke->add_column_to_panel(ROLLOUT_smoke_settings, false); ROLLOUT_slices = ROLLOUT_smoke_settings; - if(have_smoke_density == 1){ - PANEL_load_options = glui_3dsmoke->add_panel_to_panel(ROLLOUT_slices, "Load using"); - RADIO_sootdensity = glui_3dsmoke->add_radiogroup_to_panel(PANEL_load_options,&load_smoke_density); - glui_3dsmoke->add_radiobutton_to_group(RADIO_sootdensity,"soot opacity"); - glui_3dsmoke->add_radiobutton_to_group(RADIO_sootdensity,"soot density"); - } #ifdef pp_GPU if(gpuactive==0){ usegpu=0; From 9dcd4f1c7680ca112f4d963d13c7a5ed43113fca Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 18:30:15 -0400 Subject: [PATCH 32/46] smokeview source: remove some variable related to soot density files --- Source/shared/readsmvfile.c | 3 +-- Source/shared/shared_structures.h | 4 ++-- Source/smokeview/IOsmoke.c | 24 ++++++++++++------------ Source/smokeview/menus.c | 2 +- Source/smokeview/readsmv.c | 9 --------- Source/smokeview/smokeviewvars.h | 2 -- Source/smokeview/viewports.c | 2 +- 7 files changed, 17 insertions(+), 29 deletions(-) diff --git a/Source/shared/readsmvfile.c b/Source/shared/readsmvfile.c index 6269242faf..17cf7eeac5 100644 --- a/Source/shared/readsmvfile.c +++ b/Source/shared/readsmvfile.c @@ -3704,8 +3704,7 @@ int ParseSMOKE3DProcess(smv_case *scase, bufferstreamdata *stream, char *buffer, smoke3di->ntimes_old = 0; smoke3di->filetype = filetype; smoke3di->is_zlib = 0; - smoke3di->is_smoke_density = 0; - smoke3di->soot_density_loaded = 0; + smoke3di->soot_loaded = 0; smoke3di->seq_id = nn_smoke3d; smoke3di->autoload = 0; smoke3di->compression_type = COMPRESSED_UNKNOWN; diff --git a/Source/shared/shared_structures.h b/Source/shared/shared_structures.h index 6c9970803c..552624e191 100644 --- a/Source/shared/shared_structures.h +++ b/Source/shared/shared_structures.h @@ -1423,8 +1423,8 @@ typedef struct _smoke3ddata { int is_smoke, is_fire; int loaded, request_load, finalize, display, primary_file; int is_zlib; - int is_smoke_density; - int soot_density_loaded; + + int soot_loaded; smokestatedata *smokestate; int blocknumber; int type; diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 4835343c7a..c5cb3bdf05 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -1355,12 +1355,12 @@ void UpdateSmokeAlphas(void){ float maxval; assert( - (smoke3di->soot_density_loaded == 1 && smoke3di->maxvals!=NULL) || - (smoke3di->soot_density_loaded == 0 && smoke3di->maxvals==NULL) + (smoke3di->soot_loaded == 1 && smoke3di->maxvals!=NULL) || + (smoke3di->soot_loaded == 0 && smoke3di->maxvals==NULL) ); maxval = smoke3di->maxval; - if(smoke3di->soot_density_loaded == 1 && smoke3di->maxvals!=NULL)maxval = smoke3di->maxvals[smoke3di->ismoke3d_time]; - InitAlphas(smoke3di->alphas_smokedir[j], smoke3di->alphas_firedir[j], smoke3di->extinct, smoke3di->soot_density_loaded, maxval, glui_mass_extinct, smoke_mesh->dxyz_fds[0], dists[j]); + if(smoke3di->soot_loaded == 1 && smoke3di->maxvals!=NULL)maxval = smoke3di->maxvals[smoke3di->ismoke3d_time]; + InitAlphas(smoke3di->alphas_smokedir[j], smoke3di->alphas_firedir[j], smoke3di->extinct, smoke3di->soot_loaded, maxval, glui_mass_extinct, smoke_mesh->dxyz_fds[0], dists[j]); } } } @@ -3172,14 +3172,14 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in times_map = *times_map_ptr; nch_smoke_compressed_full = *nchars_smoke_compressed_full; nch_smoke_compressed_found= *nchars_smoke_compressed_found; - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1)maxvals = *maxvals_ptr; + if(smoke3di->type == SOOT_index)maxvals = *maxvals_ptr; NewResizeMemory( use_smokeframe_full, (*ntimes_full) * sizeof(int)); NewResizeMemory( times, nframes_found * sizeof(float)); NewResizeMemory( times_map, nframes_found * sizeof(char)); NewResizeMemory( nch_smoke_compressed_full, (*ntimes_full) * sizeof(int)); NewResizeMemory(nch_smoke_compressed_found, (*ntimes_found) * sizeof(int)); - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ + if(smoke3di->type == SOOT_index){ NewResizeMemory(maxvals, (*ntimes_full) * sizeof(float)); } @@ -3188,7 +3188,7 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in *times_map_ptr = times_map; *nchars_smoke_compressed_full = nch_smoke_compressed_full; *nchars_smoke_compressed_found = nch_smoke_compressed_found; - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ + if(smoke3di->type == SOOT_index){ *maxvals_ptr = maxvals; } @@ -3217,7 +3217,7 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in sscanf(buffer, "%f %i %i %i %i %f", &time_local, &nch_uncompressed, &dummy, &nch_smoke_compressed, &nch_light, &maxvali); } *maxval = MAX(maxvali, *maxval); - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ + if(smoke3di->type == SOOT_index){ *maxvals++ = maxval_density; *nch_smoke_compressed_full++ = nch_smoke_density; } @@ -3231,7 +3231,7 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in *use_smokeframe_full = 1; *times++ = time_local; count++; - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1){ + if(smoke3di->type == SOOT_index){ *nch_smoke_compressed_found++ = nch_smoke_density; } else{ @@ -3483,7 +3483,7 @@ int SetupSmoke3D(smoke3ddata *smoke3di, int load_flag, int iframe_arg, int *erro SetSmokeColorFlags(&global_scase.smoke3dcoll); update_fire_alpha = 1; - smoke3di->soot_density_loaded = 0; + smoke3di->soot_loaded = 0; if(smoke3di->type==HRRPUV_index)mesh_smoke3d->smoke3d_hrrpuv = NULL; if(smoke3di->type==TEMP_index)mesh_smoke3d->smoke3d_temp = NULL; if(smoke3di->type==SOOT_index)mesh_smoke3d->smoke3d_co2 = NULL; @@ -3647,7 +3647,7 @@ FILE_SIZE ReadSmoke3D(int time_frame,int ifile_arg,int load_flag, int first_time IF_NOT_USEMESH_RETURN0(smoke3di->loaded, smoke3di->blocknumber); char *file; file = smoke3di->file; - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1)file = smoke3di->smoke_density_file; + if(smoke3di->type == SOOT_index)file = smoke3di->smoke_density_file; SMOKE3DFILE=FOPEN(file,"rb"); if(SMOKE3DFILE==NULL){ SetupSmoke3D(smoke3di,UNLOAD, time_frame, &error_local); @@ -3749,7 +3749,7 @@ FILE_SIZE ReadSmoke3D(int time_frame,int ifile_arg,int load_flag, int first_time FCLOSE_SMOKE(SMOKE3DFILE); } - if(load_smoke_density == 1 && smoke3di->is_smoke_density == 1)smoke3di->soot_density_loaded = 1; + if(smoke3di->type == SOOT_index)smoke3di->soot_loaded = 1; smoke3di->loaded=1; smoke3di->display=1; diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index 3d697a773b..9c777fd763 100644 --- a/Source/smokeview/menus.c +++ b/Source/smokeview/menus.c @@ -3291,7 +3291,7 @@ void LoadPlot2DMenu(int value){ void UnloadSmoke3D(smoke3ddata *smoke3di){ smoke3di->request_load = 0; - smoke3di->soot_density_loaded = 0; + smoke3di->soot_loaded = 0; if(smoke3di->loaded == 0)return; FreeSmoke3D(&global_scase, smoke3di); smoke3di->loaded = 0; diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 2cc90feec2..e1ea661fb3 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -1116,15 +1116,6 @@ void UpdateSmoke3DTypes(void){ } } } - for(i = 0; itype == SOOT_index && FileExistsCaseDir(&global_scase, smoke3di->smoke_density_file)==YES){ - smoke3di->is_smoke_density = 1; - have_smoke_density = 1; - } - } } /* ------------------ UpdateMeshCoords ------------------------ */ diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 2bc5aa86c3..30418cf5e6 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -644,8 +644,6 @@ SVEXTERN int colorsplit[12] = {0,0,0, 64,64,255, 0,192,0, 255,0,0}; SVEXTERN int colorsplit[12]; #endif -SVEXTERN int SVDECL(load_smoke_density, 1); -SVEXTERN int SVDECL(have_smoke_density, 0); SVEXTERN int SVDECL(show_zlevel, 0); SVEXTERN float terrain_zlevel; SVEXTERN float terrain_zmin, terrain_zmax; diff --git a/Source/smokeview/viewports.c b/Source/smokeview/viewports.c index 047eeaeb65..97f71b5106 100644 --- a/Source/smokeview/viewports.c +++ b/Source/smokeview/viewports.c @@ -1946,7 +1946,7 @@ void GetSmokeDir(float *mm){ use_soot_density = 0; maxval = soot->maxval; - if(soot->soot_density_loaded == 1 && soot->maxvals!=NULL){ + if(soot->soot_loaded == 1 && soot->maxvals!=NULL){ use_soot_density = 1; maxval = soot->maxvals[soot->ismoke3d_time]; } From 2229248e9c99d499dcd796d24f5c4ca165d0d3b6 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 19:29:29 -0400 Subject: [PATCH 33/46] smokeviews source: call SetTimeFrameIndexWorker twice per time step --- Source/smokeview/callbacks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index cc28425c34..80a7d264c3 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -1671,7 +1671,7 @@ void SetTimeFrameIndexWorker(int frameindex, int stept_arg){ void SetTimeFrameIndex(int frameindex, int stept_arg){ INIT_PRINT_TIMER(frame_timer); - // SetTimeFrameIndexWorker(frameindex, stept_arg); + SetTimeFrameIndexWorker(frameindex, stept_arg); SetTimeFrameIndexWorker(frameindex, stept_arg); PRINT_TIMER(frame_timer, "SetTimeFrameIndex"); } From 9a241837b2191ffe6a10f4393bdd5a87883259f2 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 19:30:27 -0400 Subject: [PATCH 34/46] smokeview source: when drawing smoke/fire meshes also draw smoke/fire --- Source/smokeview/IOsmoke.c | 1 - Source/smokeview/glui_smoke.cpp | 2 +- Source/smokeview/viewports.c | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index fcc3ca1912..a86a53fb5d 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2738,7 +2738,6 @@ void DrawSmokeFrame(void){ #ifdef pp_SPEEDUP if(vis_smokemesh == 1){ DrawBoxMinMax(smokemesh->boxmin_smv, smokemesh->boxmax_smv, foregroundcolor); - continue; } #endif #ifdef pp_GPU diff --git a/Source/smokeview/glui_smoke.cpp b/Source/smokeview/glui_smoke.cpp index 1018e499d6..91d941d311 100644 --- a/Source/smokeview/glui_smoke.cpp +++ b/Source/smokeview/glui_smoke.cpp @@ -490,7 +490,7 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ CHECKBOX_smoke_flip = glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "flip background", &background_flip,BACKGROUND_FLIP, GLUISmoke3dCB); CHECKBOX_triangle_display_rate = glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "triangle display rate", &show_trirates); glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "cull hidden meshes", &cull_meshes); - glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "hide smoke/fire, show mesh", &vis_smokemesh); + glui_3dsmoke->add_checkbox_to_panel(PANEL_settings1, "show smoke/fire mesh", &vis_smokemesh); //---------------------------------------------Slice render settings-------------------------------------------------------------- diff --git a/Source/smokeview/viewports.c b/Source/smokeview/viewports.c index aca3316213..d6e8e7abf8 100644 --- a/Source/smokeview/viewports.c +++ b/Source/smokeview/viewports.c @@ -1348,10 +1348,8 @@ int CompareMeshes(const void *arg1, const void *arg2){ xyzmaxi = meshi->boxmax_fds; xyzminj = meshj->boxmin_fds; xyzmaxj = meshj->boxmax_fds; - if(dir == 0){ - if(xyzmaxi[0] <= xyzminj[0])dir = 1; - if(xyzmaxj[0] <= xyzmini[0])dir = -1; - } + if(xyzmaxi[0] <= xyzminj[0])dir = 1; + if(xyzmaxj[0] <= xyzmini[0])dir = -1; if(dir == 0){ if(xyzmaxi[1] <= xyzminj[1])dir = 2; if(xyzmaxj[1] <= xyzmini[1])dir = -2; From 20de77b6d262ac76eead5a39d8d5dc7e29e1f0e8 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 20:14:27 -0400 Subject: [PATCH 35/46] smokeview source: only call SetTimeFrameIndexWorker once per time step --- Source/smokeview/callbacks.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 80a7d264c3..778408fae8 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -1672,7 +1672,6 @@ void SetTimeFrameIndexWorker(int frameindex, int stept_arg){ void SetTimeFrameIndex(int frameindex, int stept_arg){ INIT_PRINT_TIMER(frame_timer); SetTimeFrameIndexWorker(frameindex, stept_arg); - SetTimeFrameIndexWorker(frameindex, stept_arg); PRINT_TIMER(frame_timer, "SetTimeFrameIndex"); } From 8062616fee93f5a0b8637412cf7e0aca83469cb1 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 21:30:22 -0400 Subject: [PATCH 36/46] smokeview source/bundle: remove FDEPTH and FIREDEPTH from smokeview.ini, set fire_halfdepth based on the size of the scene --- Build/for_bundle/smokeview.ini | 4 ---- Source/smokeview/readsmv.c | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Build/for_bundle/smokeview.ini b/Build/for_bundle/smokeview.ini index 3fa5208e12..32115ab504 100644 --- a/Build/for_bundle/smokeview.ini +++ b/Build/for_bundle/smokeview.ini @@ -432,10 +432,6 @@ EXTREMECOLORS 191 191 191 0 0 0 FIRECOLOR 255 128 0 -FIREDEPTH - 0.300000 10.000000 3.000000 0 0 -FDEPTH - 0.300000 10.000000 3.000000 0 0 HRRPUVCUTOFF 200.000000 1200.000000 0 255 SHOWEXTREMEDATA diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 1054af2bb1..fd6cd032f1 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -1373,6 +1373,8 @@ void UpdateMeshCoords(void){ float dy_scene = global_scase.ybar - global_scase.ybar0; float dz_scene = global_scase.zbar - global_scase.zbar0; xyzmaxdiff = MAX(MAX(dx_scene,dy_scene),dz_scene); + fire_halfdepth = (float)((int)(10.0*xyzmaxdiff/40.0+0.5))/10.0; + fire_halfdepth = MAX(fire_halfdepth, 0.3); vector_scalelength = MIN(dx_scene, dz_scene); if(global_scase.meshescoll.meshinfo[0].jbar > 1) { vector_scalelength = MIN(vector_scalelength, dy_scene); From 4663a46e981aba3c826363ef48e082f42d3ad671 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 21:33:32 -0400 Subject: [PATCH 37/46] smokeview source: minor edit - add a comment --- Source/smokeview/readsmv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index fd6cd032f1..597d5d4dc2 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -1373,6 +1373,7 @@ void UpdateMeshCoords(void){ float dy_scene = global_scase.ybar - global_scase.ybar0; float dz_scene = global_scase.zbar - global_scase.zbar0; xyzmaxdiff = MAX(MAX(dx_scene,dy_scene),dz_scene); + // set fire_half depth to max of 1/40 domain size (rounded to 0.1 m) and 0.3 fire_halfdepth = (float)((int)(10.0*xyzmaxdiff/40.0+0.5))/10.0; fire_halfdepth = MAX(fire_halfdepth, 0.3); vector_scalelength = MIN(dx_scene, dz_scene); From 5366b1d67e84c7929cdda79cdad03aa9881f9c87 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 23:17:40 -0400 Subject: [PATCH 38/46] smokeview source: corrections when regular soot file is replaced by soot density file --- Source/shared/readsmvfile.c | 1 + Source/smokeview/IOsmoke.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/shared/readsmvfile.c b/Source/shared/readsmvfile.c index 17cf7eeac5..18747f95ce 100644 --- a/Source/shared/readsmvfile.c +++ b/Source/shared/readsmvfile.c @@ -3752,6 +3752,7 @@ int ParseSMOKE3DProcess(smv_case *scase, bufferstreamdata *stream, char *buffer, } else{ smoke3di->file = smoke3di->reg_file; + smoke3di->compression_type = COMPRESSED_RLE; } #ifdef pp_SMOKE3D_FORCE if(strcmp(smoke3di->file, "dummy.xyz") == 0){ diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index c5cb3bdf05..57d51cfa2d 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -3645,10 +3645,13 @@ FILE_SIZE ReadSmoke3D(int time_frame,int ifile_arg,int load_flag, int first_time if(smoke3di->smokeframe_comp_list==NULL)return 0; IF_NOT_USEMESH_RETURN0(smoke3di->loaded, smoke3di->blocknumber); - char *file; - file = smoke3di->file; - if(smoke3di->type == SOOT_index)file = smoke3di->smoke_density_file; - SMOKE3DFILE=FOPEN(file,"rb"); + if(smoke3di->type == SOOT_index){ + SMOKE3DFILE=FOPEN(smoke3di->smoke_density_file,"rb"); + if(SMOKE3DFILE == NULL)SMOKE3DFILE = FOPEN(smoke3di->file, "rb"); + } + else{ + SMOKE3DFILE = FOPEN(smoke3di->file, "rb"); + } if(SMOKE3DFILE==NULL){ SetupSmoke3D(smoke3di,UNLOAD, time_frame, &error_local); *errorcode_arg =1; From 960ee64583c4d2e93caf1f67e1951acf4525e2f0 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 4 Apr 2026 23:41:19 -0400 Subject: [PATCH 39/46] smokeview source: remove an unused version parameter from 3d smoke code --- Source/smokeview/IOsmoke.c | 85 ++++---------------------------------- 1 file changed, 9 insertions(+), 76 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 57d51cfa2d..49d63a5d3e 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2849,16 +2849,11 @@ void SkipSmokeFrames(MFILE *SMOKE3DFILE, smoke3ddata *smoke3di, int nsteps){ /* ------------------ GetSmokeFileSize ------------------------ */ -FILE *GetSmokeFileSize(char *smokefile, int fortran_skip, int version){ +FILE *GetSmokeFileSize(char *smokefile, int fortran_skip){ FILE *SMOKE_SIZE; - MFILE *SMOKE3DFILE; char smoke_sizefilename[1024]; int lentext; char *textptr; - int nxyz[8]; - int nchars[2]; - float time_local; - int skip_local; // try .sz strcpy(smoke_sizefilename, smokefile); @@ -2889,62 +2884,8 @@ FILE *GetSmokeFileSize(char *smokefile, int fortran_skip, int version){ } if(SMOKE_SIZE != NULL)return SMOKE_SIZE; - // wasn't able to read the size file so try creating a new one - - strcpy(smoke_sizefilename, smokefile); - strcat(smoke_sizefilename, ".sz"); - SMOKE_SIZE = FOPEN_2DIR(smoke_sizefilename, "w"); - if(SMOKE_SIZE == NULL){ - printf("***error: was not able to read the size file for %s\n", smokefile); - printf(" and was not able to create a new size file: %s\n", smoke_sizefilename); - return NULL; // can't write size file in temp directory so give up - } - SMOKE3DFILE = FOPEN(smokefile, "rb"); - if(SMOKE3DFILE == NULL){ - fclose(SMOKE_SIZE); - return NULL; - } - - SKIP_SMOKE; FREAD_SMOKE(nxyz, 4, 8, SMOKE3DFILE); SKIP_SMOKE; - - if(version != 1)version = 0; - fprintf(SMOKE_SIZE, "%i\n", version); - - for(;;){ - int nframeboth; - size_t count; - - SKIP_SMOKE; count=FREAD_SMOKE(&time_local, 4, 1, SMOKE3DFILE); SKIP_SMOKE; - if(count!=1||FEOF_SMOKE(SMOKE3DFILE) != 0)break; - SKIP_SMOKE; FREAD_SMOKE(nchars, 4, 2, SMOKE3DFILE); SKIP_SMOKE; - if(version == 0){ // uncompressed data - fprintf(SMOKE_SIZE, "%f %i %i\n", time_local, nchars[0], nchars[1]); - } - else{ // compressed data - int nlightdata; - - // time, nframeboth, ncompressed_rle, ncompressed_zlib, nlightdata - // ncompessed_zlib and nlightdata are negative if there is radiance data present - - if(nchars[1] < 0){ // light data present - nframeboth = nchars[0]; - nlightdata = -nchars[0] / 2; - fprintf(SMOKE_SIZE, "%f %i %i %i %i \n", time_local, nframeboth, -1, nchars[1], nlightdata); - } - else{ - nframeboth = nchars[0]; - nlightdata = 0; - fprintf(SMOKE_SIZE, "%f %i %i %i %i \n", time_local, nframeboth, -1, nchars[1], nlightdata); - } - } - skip_local = ABS(nchars[1]); - SKIP_SMOKE; FSEEK_SMOKE(SMOKE3DFILE, skip_local, SEEK_CUR); SKIP_SMOKE; - } - - FCLOSE_SMOKE(SMOKE3DFILE); - fclose(SMOKE_SIZE); - SMOKE_SIZE = FOPEN_2DIR(smoke_sizefilename, "r"); - return SMOKE_SIZE; + printf("***error: was not able to read the size file for %s\n", smokefile); + return NULL; } /* ------------------ GetSmoke3DTimeSteps ------------------------ */ @@ -2960,7 +2901,7 @@ void GetSmoke3DTimeSteps(int fortran_skip, char *smokefile, int version, int *nt *ntimes_found = 0; *ntimes_full = 0; - SMOKE_SIZE = GetSmokeFileSize(smokefile,fortran_skip,version); + SMOKE_SIZE = GetSmokeFileSize(smokefile,fortran_skip); if(SMOKE_SIZE == NULL)return; nframes_found = 0; @@ -3097,7 +3038,8 @@ void MakeTimesMap(float *times, unsigned char **times_map_ptr, int n){ /* ------------------ GetSmoke3DSizes ------------------------ */ -int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, int version, unsigned char **times_map_ptr, float **times_ptr, int **use_smokeframe, +int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, + unsigned char **times_map_ptr, float **times_ptr, int **use_smokeframe, int *nchars_smoke_uncompressed, int **nchars_smoke_compressed_found, int **nchars_smoke_compressed_full, float **maxvals_ptr, float *maxval, int *ntimes_found, int *ntimes_full){ char buffer[255]; FILE *SMOKE_SIZE = NULL; @@ -3109,7 +3051,6 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in int *nch_smoke_compressed_full = NULL; int *nch_smoke_compressed_found = NULL; int iframe_local; - int dummy; int ntimes_full2; int iii; int first = 1; @@ -3121,7 +3062,7 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in printf("***error: smokefile pointer is NULL\n"); return 1; } - SMOKE_SIZE = GetSmokeFileSize(smokefile,fortran_skip,version); + SMOKE_SIZE = GetSmokeFileSize(smokefile,fortran_skip); if(SMOKE_SIZE == NULL){ printf("***warning: failed to open 3D smoke size file: %s\n", smokefile); return 1; @@ -3207,15 +3148,7 @@ int GetSmoke3DSizes(smoke3ddata *smoke3di, int fortran_skip, char *smokefile, in ntimes_full2++; if(ntimes_full2 > *ntimes_full)break; maxvali = -1.0; - if(version == 0){ - sscanf(buffer, "%f %i %i %f %i %f", &time_local, &nch_uncompressed, &nch_smoke_compressed, &maxvali, &nch_smoke_density, &maxval_density); - } - else{ - int nch_light; - - nch_light = 0; - sscanf(buffer, "%f %i %i %i %i %f", &time_local, &nch_uncompressed, &dummy, &nch_smoke_compressed, &nch_light, &maxvali); - } + sscanf(buffer, "%f %i %i %f %i %f", &time_local, &nch_uncompressed, &nch_smoke_compressed, &maxvali, &nch_smoke_density, &maxval_density); *maxval = MAX(maxvali, *maxval); if(smoke3di->type == SOOT_index){ *maxvals++ = maxval_density; @@ -3542,7 +3475,7 @@ int SetupSmoke3D(smoke3ddata *smoke3di, int load_flag, int iframe_arg, int *erro if(iframe_arg==ALL_SMOKE_FRAMES)PRINTF("\nLoading %s(%s)\n", smoke3di->file, smoke3di->label.shortlabel); CheckMemory; smoke3di->ntimes_old = smoke3di->ntimes; - if(GetSmoke3DSizes(smoke3di, fortran_skip, smoke3di->file, smoke3di->compression_type, &smoke3di->times_map, &smoke3di->times, &smoke3di->use_smokeframe, + if(GetSmoke3DSizes(smoke3di, fortran_skip, smoke3di->file, &smoke3di->times_map, &smoke3di->times, &smoke3di->use_smokeframe, &smoke3di->nchars_uncompressed, &smoke3di->nchars_compressed_smoke, &smoke3di->nchars_compressed_smoke_full, From b4c025c312b0065ed170b20f4597d3402447db30 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 5 Apr 2026 20:12:56 -0400 Subject: [PATCH 40/46] smokeview source: add checkbox for applying smoke skips to drawing grids --- Source/smokeview/IOplot3d.c | 5 +++++ Source/smokeview/glui_smoke.cpp | 1 + Source/smokeview/smokeviewvars.h | 1 + 3 files changed, 7 insertions(+) diff --git a/Source/smokeview/IOplot3d.c b/Source/smokeview/IOplot3d.c index 0f6043166a..619d0267c9 100644 --- a/Source/smokeview/IOplot3d.c +++ b/Source/smokeview/IOplot3d.c @@ -1601,6 +1601,11 @@ void DrawGrid(const meshdata *meshi){ skipj = jbar; skipk = kbar; } + if(use_smoke_grid == 1){ + skipi = smoke3d_skipx; + skipj = smoke3d_skipy; + skipk = smoke3d_skipz; + } glBegin(GL_LINES); if(visx_all==1&&plotx>=0){ diff --git a/Source/smokeview/glui_smoke.cpp b/Source/smokeview/glui_smoke.cpp index 2e9845f2f6..55f95f2141 100644 --- a/Source/smokeview/glui_smoke.cpp +++ b/Source/smokeview/glui_smoke.cpp @@ -697,6 +697,7 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ SPINNER_smoke3d_skipx = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "yz", GLUI_SPINNER_INT, &smoke3d_skipx, SMOKE_SKIP_X, GLUISmoke3dCB); SPINNER_smoke3d_skipy = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "xz", GLUI_SPINNER_INT, &smoke3d_skipy, SMOKE_SKIP_Y, GLUISmoke3dCB); SPINNER_smoke3d_skipz = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "xy", GLUI_SPINNER_INT, &smoke3d_skipz, SMOKE_SKIP_Z, GLUISmoke3dCB); + glui_3dsmoke->add_checkbox_to_panel(PANEL_skip_planes, "Use skips when drawing grids", &use_smoke_grid); glui_3dsmoke->add_column_to_panel(ROLLOUT_skip, false); PANEL_max_planes = glui_3dsmoke->add_panel_to_panel(ROLLOUT_skip, "max plane"); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 9cb052e84a..9d1b2068ff 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -481,6 +481,7 @@ SVEXTERN int SVDECL(smoke3d_skip, 1), SVDECL(smoke3d_skipxy, 1); SVEXTERN int SVDECL(smoke3d_skipx, 1), SVDECL(smoke3d_skipy, 1), SVDECL(smoke3d_skipz, 1); SVEXTERN int SVDECL(smoke3d_imax, -1), SVDECL(smoke3d_jmax, -1), SVDECL(smoke3d_kmax, -1); SVEXTERN int SVDECL(slice_skip, 1), SVDECL(slice_skipx, 1), SVDECL(slice_skipy, 1), SVDECL(slice_skipz, 1), SVDECL(max_slice_skip,-1); +SVEXTERN int SVDECL(use_smoke_grid, 1); SVEXTERN int SVDECL(update_research_mode, 1); SVEXTERN int SVDECL(research_mode, 1); From 66b591486a231de17d0435119f9e0fd024fc6035 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 5 Apr 2026 22:06:57 -0400 Subject: [PATCH 41/46] smokeview source: add some timers --- Source/smokeview/callbacks.c | 7 +++++++ Source/smokeview/showscene.c | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 778408fae8..919ecfc7cc 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -4202,6 +4202,7 @@ void IdleDisplay(void){ void DoNonStereo(void){ assert(opengl_finalized == 1); if(opengl_finalized == 0)return; + INIT_PRINT_TIMER(timer_dononstereo); if(render_status==RENDER_OFF){ glDrawBuffer(GL_BACK); ShowScene(DRAWSCENE, VIEW_CENTER, 0, 0, 0, NULL); @@ -4315,6 +4316,12 @@ void DoNonStereo(void){ RenderState(RENDER_OFF); } } + if(show_timings != 0){ + char label[256]; + + sprintf(label, "DoNonStereo(%i)", iglobal_times); + PRINT_TIMER(timer_dononstereo, label); + } } /* ------------------ DisplayCB ------------------------ */ diff --git a/Source/smokeview/showscene.c b/Source/smokeview/showscene.c index d23a0ce7c6..4c494393f7 100644 --- a/Source/smokeview/showscene.c +++ b/Source/smokeview/showscene.c @@ -529,7 +529,12 @@ void ShowScene2(int mode){ CLIP_VALS; INIT_PRINT_TIMER(timer_drawsmoke); DrawSmokeFrame(); - PRINT_TIMER(timer_drawsmoke, "DrawSmokeFrame"); + if(show_timings != 0){ + char label[256]; + + sprintf(label, "DrawSmokeFrame(%i)", iglobal_times); + PRINT_TIMER(timer_drawsmoke, label); + } } /* ++++++++++++++++++++++++ draw vol smoke +++++++++++++++++++++++++ */ @@ -632,7 +637,13 @@ void ShowScene(int mode, int view_mode, int quad, GLint s_left, GLint s_down, sc INIT_PRINT_TIMER(timer_showscene); UpdateShowScene(); - PRINT_TIMER(timer_showscene, "UpdateShowScene"); + + if(show_timings != 0){ + char label[256]; + + sprintf(label, "\nUpdateShowScene(%i)", iglobal_times); + PRINT_TIMER(timer_showscene, label); + } if(stereotype == STEREO_NONE || stereotype == STEREO_TIME)ClearBuffers(mode); /* ++++++++++++++++++++++++ setup viewports +++++++++++++++++++++++++ */ @@ -696,11 +707,5 @@ void ShowScene(int mode, int view_mode, int quad, GLint s_left, GLint s_down, sc } } if(viscolorbarpath==0||colorbar_showscene==1)ShowScene2(mode); - -/* ++++++++++++++++++++++++ render scene +++++++++++++++++++++++++ */ -// if rendering is not working remove following comment -// then determine where Render should have been called -// Render(view_mode); - SNIFF_ERRORS("end of ShowScene"); } From 28437993053c51a47367fdb5e06abc273c4b9334 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 6 Apr 2026 09:03:57 -0400 Subject: [PATCH 42/46] smokeview source: minor edit - add a line feed after timer output in display routine --- Source/shared/options_common.h | 4 ++++ Source/smokeview/callbacks.c | 1 + 2 files changed, 5 insertions(+) diff --git a/Source/shared/options_common.h b/Source/shared/options_common.h index 8460950f22..44aacb4d83 100644 --- a/Source/shared/options_common.h +++ b/Source/shared/options_common.h @@ -147,6 +147,10 @@ #define PRINT_TIMER(timer, label) PrintTime(__FILE__, __LINE__, &timer, label, 1) #endif +#ifndef PRINT_TIMER_LF +#define PRINT_TIMER_LF(timer) if(show_timings==1 && timer>0.1)printf("\n") +#endif + #ifndef PRINT_CUM_TIMER #define PRINT_CUM_TIMER(timer, label) PrintTime(__FILE__, __LINE__, &timer, label, 0) #endif diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 919ecfc7cc..9926f1c447 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -4321,6 +4321,7 @@ void DoNonStereo(void){ sprintf(label, "DoNonStereo(%i)", iglobal_times); PRINT_TIMER(timer_dononstereo, label); + PRINT_TIMER_LF(timer_dononstereo); } } From d657dfe933cc42ee971633d1d25b25c248840713 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 6 Apr 2026 11:14:00 -0400 Subject: [PATCH 43/46] smokeview source: change smoke plane skip widgets to horizontal, vertical and front back --- Source/smokeview/IOplot3d.c | 6 +- Source/smokeview/IOsmoke.c | 124 +++++++++++++++---------------- Source/smokeview/glui_smoke.cpp | 87 +++++++++++----------- Source/smokeview/glui_smoke.h | 9 +-- Source/smokeview/readsmv.c | 14 ++-- Source/smokeview/smokeviewvars.h | 6 +- 6 files changed, 121 insertions(+), 125 deletions(-) diff --git a/Source/smokeview/IOplot3d.c b/Source/smokeview/IOplot3d.c index 619d0267c9..ee0309f508 100644 --- a/Source/smokeview/IOplot3d.c +++ b/Source/smokeview/IOplot3d.c @@ -1602,9 +1602,9 @@ void DrawGrid(const meshdata *meshi){ skipk = kbar; } if(use_smoke_grid == 1){ - skipi = smoke3d_skipx; - skipj = smoke3d_skipy; - skipk = smoke3d_skipz; + skipi = smoke3d_skip_horiz; + skipj = smoke3d_skip_frontback; + skipk = smoke3d_skip_vert; } glBegin(GL_LINES); diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 7dac6d2247..7c72a8ee99 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -372,7 +372,6 @@ void DrawSmoke3DGPU(smoke3ddata *smoke3di){ int nx, ny, nz; int xyzindex1[6], xyzindex2[6], *xyzindex, node; float xnode[4], znode[4], ynode[4]; - int skip_local; int iterm, jterm, kterm, nxy; int n11, n12, n22, n21; int iii, jjj, kkk; @@ -457,7 +456,6 @@ void DrawSmoke3DGPU(smoke3ddata *smoke3di){ nxy = nx*ny; ssmokedir = meshi->smokedir; - skip_local = smoke3d_frame_inc; xyzindex1[0] = 0; xyzindex1[1] = 1; @@ -512,15 +510,15 @@ void DrawSmoke3DGPU(smoke3ddata *smoke3di){ glBegin(GL_TRIANGLES); slice_beg = is1; slice_end = is2; - for(iii = slice_beg;iiiis1); constval = xplt[i]+0.001; - for(k = ks1; ksmokedir; - skip_local = smoke3d_frame_inc; xyzindex1[0] = 0; xyzindex1[1] = 1; @@ -1509,7 +1505,7 @@ int DrawSmoke3D(smoke3ddata *smoke3di){ glBegin(GL_TRIANGLES); slice_beg = is1; slice_end = is2; - for(iii = slice_beg;iii=slice_end)continue; @@ -1518,10 +1514,10 @@ int DrawSmoke3D(smoke3ddata *smoke3di){ if(ssmokedir<0)i = is1+is2-iii-1; iterm = (i-smoke3di->is1); constval = xplt[i]+0.001; - for(k = ks1; kalphas_smokedir[ALPHA_XY]; firealpha_map = smoke3di->alphas_firedir[ALPHA_XY]; - for(iii = 1;iiialphas_smokedir[ALPHA_XY]; firealpha_map = smoke3di->alphas_firedir[ALPHA_XY]; - for(iii = 1;iiialphas_smokedir[ALPHA_YZ]; firealpha_map = smoke3di->alphas_firedir[ALPHA_YZ]; - for(iii = 1;iiialphas_smokedir[ALPHA_YZ]; firealpha_map = smoke3di->alphas_firedir[ALPHA_YZ]; - for(iii = 1;iiialphas_smokedir[ALPHA_XZ]; firealpha_map = smoke3di->alphas_firedir[ALPHA_XZ]; - for(iii = 1;iiialphas_smokedir[ALPHA_XZ]; firealpha_map = smoke3di->alphas_firedir[ALPHA_XZ]; - for(iii = 1;iiiadd_panel_to_panel(ROLLOUT_slices, "Display using"); - SPINNER_smoke3d_frame_inc = glui_3dsmoke->add_spinner_to_panel(PANEL_display, "frame display increment", + SPINNER_smoke3d_frame_inc = glui_3dsmoke->add_spinner_to_panel(PANEL_display, "smoke frame skip", GLUI_SPINNER_INT, &smoke3d_frame_inc, SMOKE_FRAME_INC, GLUISmoke3dCB); SPINNER_mass_extinct = glui_3dsmoke->add_spinner_to_panel(PANEL_display, "Extinction (m2/kg)", GLUI_SPINNER_FLOAT, &glui_mass_extinct, SMOKE_EXTINCT, GLUISmoke3dCB); @@ -691,12 +690,15 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ TOGGLE_ROLLOUT(smokeprocinfo, nsmokeprocinfo, ROLLOUT_skip, SKIP_ROLLOUT, glui_3dsmoke); - PANEL_skip_planes = glui_3dsmoke->add_panel_to_panel(ROLLOUT_skip, "skip planes"); - SPINNER_smoke3d_skip = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "yz/xz/xy", GLUI_SPINNER_INT, &smoke3d_skip, SMOKE_SKIP_XYZ, GLUISmoke3dCB); - SPINNER_smoke3d_skipxy = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "yz/xz", GLUI_SPINNER_INT, &smoke3d_skipxy, SMOKE_SKIP_XY, GLUISmoke3dCB); - SPINNER_smoke3d_skipx = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "yz", GLUI_SPINNER_INT, &smoke3d_skipx, SMOKE_SKIP_X, GLUISmoke3dCB); - SPINNER_smoke3d_skipy = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "xz", GLUI_SPINNER_INT, &smoke3d_skipy, SMOKE_SKIP_Y, GLUISmoke3dCB); - SPINNER_smoke3d_skipz = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "xy", GLUI_SPINNER_INT, &smoke3d_skipz, SMOKE_SKIP_Z, GLUISmoke3dCB); + PANEL_skip_planes = glui_3dsmoke->add_panel_to_panel(ROLLOUT_skip, "skip planes"); + SPINNER_smoke3d_skip = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "all", GLUI_SPINNER_INT, + &smoke3d_skip_all, SMOKE_SKIP_ALL, GLUISmoke3dCB); + SPINNER_smoke3d_skip_horiz = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "horizontal", GLUI_SPINNER_INT, + &smoke3d_skip_horiz, SMOKE_SKIP_HORIZ, GLUISmoke3dCB); + SPINNER_smoke3d_skip_vert = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "vertical", GLUI_SPINNER_INT, + &smoke3d_skip_vert, SMOKE_SKIP_VERT, GLUISmoke3dCB); + SPINNER_smoke3d_skip_frontback = glui_3dsmoke->add_spinner_to_panel(PANEL_skip_planes, "front/back", GLUI_SPINNER_INT, + &smoke3d_skip_frontback, SMOKE_SKIP_FRONTBACK, GLUISmoke3dCB); glui_3dsmoke->add_checkbox_to_panel(PANEL_skip_planes, "Use skips when drawing grids", &use_smoke_grid); glui_3dsmoke->add_column_to_panel(ROLLOUT_skip, false); @@ -710,7 +712,7 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ STATIC_pixels_per_triangle = glui_3dsmoke->add_statictext_to_panel(ROLLOUT_skip, label); CHECKBOX_smoke3d_demo_mode = glui_3dsmoke->add_checkbox_to_panel(ROLLOUT_skip, "Show only yz planes", &smoke3d_demo_mode, SMOKE_DEMO_MODE, GLUISmoke3dCB); - GLUISmoke3dCB(SMOKE_SKIP_X); + GLUISmoke3dCB(SMOKE_SKIP_HORIZ); //---------------------------------------------Volume render settings-------------------------------------------------------------- @@ -870,8 +872,8 @@ void GLUIGetPixelsPerTriangle(void){ char label[500]; if(STATIC_pixels_per_triangle == NULL)return; - if(nplotx_all>0)x_pixels_per_triangle = smoke3d_skipx*(float)glui_screenWidth/(float)nplotx_all; - if(nploty_all>0)y_pixels_per_triangle = smoke3d_skipy*(float)glui_screenHeight/(float)nploty_all; + if(nplotx_all>0)x_pixels_per_triangle = smoke3d_skip_horiz*(float)glui_screenWidth/(float)nplotx_all; + if(nploty_all>0)y_pixels_per_triangle = smoke3d_skip_vert*(float)glui_screenHeight/(float)nploty_all; pixels_per_triangle = MIN(x_pixels_per_triangle, y_pixels_per_triangle); if(pixels_per_triangle>10.0){ sprintf(label, "triangle/pixel size ratio: %.0f", pixels_per_triangle); @@ -969,40 +971,35 @@ extern "C" void GLUISmoke3dCB(int var){ break; case SMOKE_BLACK: break; - case SMOKE_SKIP_XYZ: - if(smoke3d_skip<1)smoke3d_skip = 1; - SPINNER_smoke3d_skip->set_int_val(smoke3d_skip); - smoke3d_skipx = smoke3d_skip; - smoke3d_skipy = smoke3d_skip; - smoke3d_skipz = smoke3d_skip; - SPINNER_smoke3d_skipx->set_int_val(smoke3d_skipx); - SPINNER_smoke3d_skipy->set_int_val(smoke3d_skipy); - SPINNER_smoke3d_skipz->set_int_val(smoke3d_skipz); - GLUIGetPixelsPerTriangle(); - break; - case SMOKE_SKIP_XY: - if(smoke3d_skipxy<1)smoke3d_skipxy = 1; - SPINNER_smoke3d_skipxy->set_int_val(smoke3d_skipxy); - smoke3d_skipx = smoke3d_skipxy; - smoke3d_skipy = smoke3d_skipxy; - SPINNER_smoke3d_skipx->set_int_val(smoke3d_skipx); - SPINNER_smoke3d_skipy->set_int_val(smoke3d_skipy); + case SMOKE_SKIP_ALL: + if(smoke3d_skip_all<1)smoke3d_skip_all = 1; + SPINNER_smoke3d_skip->set_int_val(smoke3d_skip_all); + smoke3d_skip_horiz = smoke3d_skip_all; + smoke3d_skip_vert = smoke3d_skip_all; + smoke3d_skip_frontback = smoke3d_skip_all; + SPINNER_smoke3d_skip_horiz->set_int_val(smoke3d_skip_horiz); + SPINNER_smoke3d_skip_vert->set_int_val(smoke3d_skip_vert); + SPINNER_smoke3d_skip_frontback->set_int_val(smoke3d_skip_frontback); GLUIGetPixelsPerTriangle(); + global_scase.update_smoke_alphas = 1; break; - case SMOKE_SKIP_X: - case SMOKE_SKIP_Y: - case SMOKE_SKIP_Z: - if(smoke3d_skipx<1)smoke3d_skipx = 1; - if(smoke3d_skipy<1)smoke3d_skipy = 1; - if(smoke3d_skipz<1)smoke3d_skipz = 1; - SPINNER_smoke3d_skipx->set_int_val(smoke3d_skipx); - SPINNER_smoke3d_skipy->set_int_val(smoke3d_skipy); - SPINNER_smoke3d_skipz->set_int_val(smoke3d_skipz); - if(smoke3d_skipx==smoke3d_skipy&&smoke3d_skipx==smoke3d_skipz){ - smoke3d_skip = smoke3d_skipx; - SPINNER_smoke3d_skip->set_int_val(smoke3d_skip); + case SMOKE_SKIP_HORIZ: + case SMOKE_SKIP_VERT: + case SMOKE_SKIP_FRONTBACK: + if(smoke3d_skip_horiz<1)smoke3d_skip_horiz = 1; + if(smoke3d_skip_vert<1)smoke3d_skip_vert = 1; + if(smoke3d_skip_frontback<1)smoke3d_skip_frontback = 1; + SPINNER_smoke3d_skip_horiz->set_int_val(smoke3d_skip_horiz); + SPINNER_smoke3d_skip_vert->set_int_val(smoke3d_skip_vert); + SPINNER_smoke3d_skip_frontback->set_int_val(smoke3d_skip_frontback); + if(smoke3d_skip_horiz==smoke3d_skip_vert&&smoke3d_skip_horiz==smoke3d_skip_frontback){ + smoke3d_skip_all = smoke3d_skip_horiz; + SPINNER_smoke3d_skip->set_int_val(smoke3d_frame_inc); } GLUIGetPixelsPerTriangle(); + smoke3d_frame_inc = smoke3d_skip_frontback; + SPINNER_smoke3d_frame_inc->set_int_val(smoke3d_frame_inc); + global_scase.update_smoke_alphas = 1; break; case CO2SMOKE: UpdateCO2Colormap(); @@ -1354,6 +1351,8 @@ extern "C" void GLUISmoke3dCB(int var){ smoke3d_frame_inc=1; SPINNER_smoke3d_frame_inc->set_int_val(1); } + smoke3d_skip_frontback = smoke3d_frame_inc; + SPINNER_smoke3d_skip_frontback->set_int_val(smoke3d_skip_frontback); break; case SMOKE_DEMO_MODE: if(smoke3d_demo_mode == 0){ diff --git a/Source/smokeview/glui_smoke.h b/Source/smokeview/glui_smoke.h index 66545bd87d..48b6c790d3 100644 --- a/Source/smokeview/glui_smoke.h +++ b/Source/smokeview/glui_smoke.h @@ -52,11 +52,10 @@ #define LOAD_TIMEFRAME 58 #define SMOKE3D_LOAD_INCREMENTAL 18 #define CO2_COLOR 71 -#define SMOKE_SKIP_XYZ 107 -#define SMOKE_SKIP_XY 108 -#define SMOKE_SKIP_X 109 -#define SMOKE_SKIP_Y 110 -#define SMOKE_SKIP_Z 111 +#define SMOKE_SKIP_ALL 107 +#define SMOKE_SKIP_HORIZ 109 +#define SMOKE_SKIP_VERT 110 +#define SMOKE_SKIP_FRONTBACK 111 #define SMOKE_BLACK 75 #define SMOKE_DELTA_PAR 76 #define SMOKE_NEW 77 diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 268e047e0e..0e2afcb41f 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -6113,13 +6113,13 @@ int ReadIni2(const char *inifile, int localfile){ int smokeskippm1_local; if(fgets(buffer, 255, stream) == NULL)break; - sscanf(buffer, "%i %i %i %i %i", &smokeskippm1_local, &smoke3d_skip, &smoke3d_skipx, &smoke3d_skipy, &smoke3d_skipz); + sscanf(buffer, "%i %i %i %i %i", &smokeskippm1_local, &smoke3d_skip_all, &smoke3d_skip_horiz, &smoke3d_skip_vert, &smoke3d_skip_frontback); if(smokeskippm1_local<0)smokeskippm1_local = 0; - smoke3d_frame_inc = smokeskippm1_local + 1; - smoke3d_skip = CLAMP(smoke3d_skip,1,10); - smoke3d_skipx = CLAMP(smoke3d_skipx, 1, 10); - smoke3d_skipy = CLAMP(smoke3d_skipy, 1, 10); - smoke3d_skipz = CLAMP(smoke3d_skipz, 1, 10); + smoke3d_frame_inc = smokeskippm1_local + 1; + smoke3d_skip_all = CLAMP(smoke3d_skip_all,1,20); + smoke3d_skip_horiz = CLAMP(smoke3d_skip_horiz, 1, 20); + smoke3d_skip_vert = CLAMP(smoke3d_skip_vert, 1, 20); + smoke3d_skip_frontback = CLAMP(smoke3d_skip_frontback, 1, 20); update_smoke3d_frame_inc = 1; continue; } @@ -8412,7 +8412,7 @@ void WriteIni(int flag,char *filename){ fprintf(fileout, " %f\n", glui_mass_extinct); glui_mass_extinct_default = glui_mass_extinct; fprintf(fileout, "SMOKESKIP\n"); - fprintf(fileout," %i %i %i %i %i\n", smoke3d_frame_inc-1,smoke3d_skip, smoke3d_skipx, smoke3d_skipy, smoke3d_skipz); + fprintf(fileout," %i %i %i %i %i\n", smoke3d_frame_inc-1,smoke3d_skip_all, smoke3d_skip_horiz, smoke3d_skip_vert, smoke3d_skip_frontback); #ifdef pp_GPU fprintf(fileout, "USEGPU\n"); fprintf(fileout, " %i\n", usegpu); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 9d1b2068ff..e47f55c04d 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -477,8 +477,10 @@ SVEXTERN int SVDECL(update_filesizes, 0); SVEXTERN int SVDECL(compute_smoke3d_planes_par, 0); SVEXTERN float SVDECL(smoke3d_delta_perp,0.5); SVEXTERN int SVDECL(smoke3d_black, 0); -SVEXTERN int SVDECL(smoke3d_skip, 1), SVDECL(smoke3d_skipxy, 1); -SVEXTERN int SVDECL(smoke3d_skipx, 1), SVDECL(smoke3d_skipy, 1), SVDECL(smoke3d_skipz, 1); +SVEXTERN int SVDECL(smoke3d_skip_all, 1); +SVEXTERN int SVDECL(smoke3d_skip_horiz, 1); +SVEXTERN int SVDECL(smoke3d_skip_vert, 1); +SVEXTERN int SVDECL(smoke3d_skip_frontback, 1); SVEXTERN int SVDECL(smoke3d_imax, -1), SVDECL(smoke3d_jmax, -1), SVDECL(smoke3d_kmax, -1); SVEXTERN int SVDECL(slice_skip, 1), SVDECL(slice_skipx, 1), SVDECL(slice_skipy, 1), SVDECL(slice_skipz, 1), SVDECL(max_slice_skip,-1); SVEXTERN int SVDECL(use_smoke_grid, 1); From bfaaafc7f13c56e34f33ff9b92981b418434d58e Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 6 Apr 2026 11:24:08 -0400 Subject: [PATCH 44/46] smokeview source: change ini keyword FDEPTH to FDEPTH2 (so update fire half def value will not be over written by old ini value) --- Source/smokeview/readsmv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 0e2afcb41f..a60b70becd 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -6190,7 +6190,7 @@ int ReadIni2(const char *inifile, int localfile){ global_cb_max_index = global_cb_max_index_default; continue; } - if(MatchINI(buffer, "FDEPTH") == 1){ + if(MatchINI(buffer, "FDEPTH2") == 1){ if(fgets(buffer, 255, stream) == NULL)break; sscanf(buffer, "%f %f %f %i %i", &fire_halfdepth,&co2_halfdepth,&emission_factor,&use_fire_alpha, &force_alpha_opaque); continue; @@ -8365,9 +8365,7 @@ void WriteIni(int flag,char *filename){ fprintf(fileout, "FIRECOLORMAP\n"); fprintf(fileout, " FIRE %i %s\n", fire_colormap_type, colorbars.colorbarinfo[colorbars.fire_colorbar_index].menu_label); } - fprintf(fileout, "FIREDEPTH\n"); - fprintf(fileout, " %f %f %f %i %i\n", fire_halfdepth, co2_halfdepth, emission_factor, use_fire_alpha, force_alpha_opaque); - fprintf(fileout, "FDEPTH\n"); + fprintf(fileout, "FDEPTH2\n"); fprintf(fileout, " %f %f %f %i %i\n", fire_halfdepth, co2_halfdepth, emission_factor, use_fire_alpha, force_alpha_opaque); if(colorbars.ncolorbars > colorbars.ndefaultcolorbars){ colorbardata *cbi; From 432159393fb16176e3f3c653af374d83c4496d05 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 6 Apr 2026 12:38:33 -0400 Subject: [PATCH 45/46] smokeview source: output 3d smoke triangle info when -timings option is invoked --- Source/smokeview/IOsmoke.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index 7c72a8ee99..1c6121fa1a 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -2749,8 +2749,8 @@ void DrawSmokeFrame(void){ #endif } STOP_TIMER(smoke3d_timer); - if(nsmoke_triangles>0&&show_trirates==1&&smoke3d_timer>0.0){ - float tri_fps = -1.0; + if( (show_trirates==1 && smoke3d_timer>0.0) || (show_timings==1 && smoke3d_timer>0.1) ){ + float tri_fps = -1.0; printf("3D smoke "); tri_fps = (float)nsmoke_triangles / smoke3d_timer; From 90d0230cd018c8237987ccea4a4d350baafe6229 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 6 Apr 2026 12:48:10 -0400 Subject: [PATCH 46/46] smokeview source: remove an unused variable --- Source/smokeview/callbacks.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index 9926f1c447..42ba11e3ed 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -1653,8 +1653,6 @@ void UpdateGridClip(int flag){ /* ------------------ SetTimeFrameIndexWorker ------------------------ */ void SetTimeFrameIndexWorker(int frameindex, int stept_arg){ - int changed_frame = 0; - if(global_times == NULL)return; if(use_tload_begin == 1 && frameindex < 0)frameindex = nglobal_times - 1; if(use_tload_end == 1 && frameindex > nglobal_times - 1)frameindex = 0;