diff --git a/Manuals/SMV_User_Guide/SMV_User_Guide.tex b/Manuals/SMV_User_Guide/SMV_User_Guide.tex index b67e0b514..ea4ea3a18 100644 --- a/Manuals/SMV_User_Guide/SMV_User_Guide.tex +++ b/Manuals/SMV_User_Guide/SMV_User_Guide.tex @@ -6096,11 +6096,9 @@ \chapter{Keyboard Shortcuts} \item only translate the scene left and right when the mouse is moved left and right (ignore up and down mouse movement) \end{itemize} -\kitem{f}Activates the {\tt ALT}\ key when moving the scene with the mouse. -Pressing and releasing the {\tt f}\ key then moving the mouse causes the scene to go in and out until the -mouse button is released. +\kitem{f}Decrease distance by 25 percent at which fire opacity is one half. This increases fire opaqueness. -\kitem{F}Toggle algorithm for hiding blockage overlaps. +\kitem{F, ALT f}Increase distance by 25 percent at which fire opacity is one half. This decreases fire opaqueness. \kitem{g}Toggle the grid visibility. When the grid display option is active, the x, y and z keys may be used to show or hide the @@ -6130,6 +6128,10 @@ \chapter{Keyboard Shortcuts} \kitem{ALT k}Toggle device selection. +\kitem{l}Increase the mass extinction coefficient by 25 percent. This increases smoke opaqueness. + +\kitem{L, ALT l}Decrease the mass extinction coefficient by 25 percent. This decreases smoke opaqueness. + \kitem{m}Switch between meshes in multiple mesh cases. \kitem{M}Toggle command line scene clipping. When turned on, the diff --git a/Source/smokeview/callbacks.c b/Source/smokeview/callbacks.c index e1758c160..f5f1952aa 100644 --- a/Source/smokeview/callbacks.c +++ b/Source/smokeview/callbacks.c @@ -1886,6 +1886,28 @@ void Keyboard(unsigned char key, int flag){ break; } break; +#ifdef pp_OPACITY_SHORTCUTS + case 'f': + case 'F': + if(global_scase.smoke3dcoll.nsmoke3dinfo<=0){ + printf("***warning: 3D smoke files not present, fire opacity setting not changed\n"); + break; + } + if(use_opacity_depth == 0){ + use_opacity_depth = 1; + GLUISmoke3dCB(USE_OPACITY_DEPTH); + GLUIUpdateUseOpacityDepth(); + } + if(key2 == 'F' || keystate == GLUT_ACTIVE_ALT){ + fire_halfdepth *= 1.25; + } + else{ + fire_halfdepth /= 1.25; + } + GLUISmoke3dCB(UPDATE_SMOKEFIRE_COLORS); + printf("50%% opacity at depth: %f (m)\n", fire_halfdepth); + break; +#else case 'f': alt_ctrl_key_state = KEY_ALT; break; @@ -1894,6 +1916,7 @@ void Keyboard(unsigned char key, int flag){ GLUIUpdateShowHideButtons(); glutPostRedisplay(); break; +#endif case 'g': switch(keystate){ case GLUT_ACTIVE_ALT: @@ -2091,12 +2114,30 @@ void Keyboard(unsigned char key, int flag){ if(visTimebar==1)PRINTF("Time bar visible\n"); } break; +#ifdef pp_OPACITY_SHORTCUTS + case 'l': + case 'L': + if(global_scase.smoke3dcoll.nsmoke3dinfo<=0){ + printf("***warning: 3D smoke files are present, smoke opacity setting not changed\n"); + break; + } + if(key2 == 'L' || keystate == GLUT_ACTIVE_ALT){ + glui_mass_extinct *= 1.25; + } + else{ + glui_mass_extinct /= 1.25; + } + GLUISmoke3dCB(SMOKE_EXTINCT); + printf("Mass extinction : %f (m2/kg)\n", glui_mass_extinct); + break; +#else case 'l': case 'L': #ifdef pp_MEMDEBUG printf("memory blocks: %i total size: %i\n", COUNTMEMORYBLOCKS(0), (int)GETTOTALMEMORY); #endif break; +#endif case 'm': switch(keystate){ case GLUT_ACTIVE_ALT: diff --git a/Source/smokeview/glui_smoke.cpp b/Source/smokeview/glui_smoke.cpp index ea67cba47..ea17e9588 100644 --- a/Source/smokeview/glui_smoke.cpp +++ b/Source/smokeview/glui_smoke.cpp @@ -328,6 +328,14 @@ extern "C" void GLUICreateVolTourList(void){ } } +#ifdef pp_OPACITY_SHORTCUTS +/* ------------------ GLUIUpdateUseOpacityDepth ------------------------ */ + +extern "C" void GLUIUpdateUseOpacityDepth(void){ + CHECKBOX_use_opacity_depth->set_int_val(use_opacity_depth); +} +#endif + /* ------------------ UpdateCombineMeshes ------------------------ */ void UpdateCombineMeshes(void){ @@ -610,7 +618,7 @@ extern "C" void GLUI3dSmokeSetup(int main_window){ SPINNER_emission_factor = glui_3dsmoke->add_spinner_to_panel(PANEL_fire_opacity, "opacity multiplier:", GLUI_SPINNER_FLOAT, &emission_factor, USE_FIRE_ALPHA, GLUISmoke3dCB); glui_3dsmoke->add_checkbox_to_panel(PANEL_fire_opacity, "off axis planes", &smoke_offaxis); glui_3dsmoke->add_checkbox_to_panel(PANEL_fire_opacity, "adjust opacities", &smoke_adjust); - SPINNER_smoke3d_fire_halfdepth->set_float_limits(0.01, 100.0); + SPINNER_smoke3d_fire_halfdepth->set_float_limits(0.001, 1000.0); CHECKBOX_force_alpha_opaque = glui_3dsmoke->add_checkbox_to_panel(PANEL_fire_opacity, "force opaque", &force_alpha_opaque, FORCE_ALPHA_OPAQUE, GLUISmoke3dCB); GLUISmoke3dCB(USE_OPACITY_DEPTH); diff --git a/Source/smokeview/glui_smoke.h b/Source/smokeview/glui_smoke.h index 732092ea7..0b772c3f5 100644 --- a/Source/smokeview/glui_smoke.h +++ b/Source/smokeview/glui_smoke.h @@ -106,6 +106,9 @@ EXTERNCPP void GLUIUpdateFireAlpha(void); EXTERNCPP void GLUIUpdateSmoke3dFlags(void); EXTERNCPP void GLUICreateVolTourList(void); EXTERNCPP void GLUIDeleteVolTourList(void); +#ifdef pp_OPACITY_SHORTCUTS +EXTERNCPP void GLUIUpdateUseOpacityDepth(void); +#endif #endif diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index 7c3299ad3..27f0a08f6 100644 --- a/Source/smokeview/menus.c +++ b/Source/smokeview/menus.c @@ -11814,8 +11814,10 @@ static int menu_count=0; glutAddMenuEntry(" 0: reset animation to the initial time", MENU_DUMMY); glutAddMenuEntry(" 1-9: number of frames to skip", MENU_DUMMY); glutAddMenuEntry(" a/ALT a: increase/decrease flow vector length by 1.5", MENU_DUMMY); + glutAddMenuEntry(" f/ALT f: increase/decrease 50% fire opacity depth by 1.25", MENU_DUMMY); glutAddMenuEntry(" H: toggle slice and vector slice visibility", MENU_DUMMY); glutAddMenuEntry(" I: toggle visibility of slices in blockages", MENU_DUMMY); + glutAddMenuEntry(" l/ALT l: increase/decrease mass extinction coef by 1.25", MENU_DUMMY); glutAddMenuEntry(" N: force bound update when loading files (assume fds is running)", MENU_DUMMY); glutAddMenuEntry(" p,P: increment particle variable displayed", MENU_DUMMY); glutAddMenuEntry(" s,S: increase/decrease interval between adjacent vectors", MENU_DUMMY); diff --git a/Source/smokeview/options.h b/Source/smokeview/options.h index 24f0053da..541cf108f 100644 --- a/Source/smokeview/options.h +++ b/Source/smokeview/options.h @@ -13,7 +13,8 @@ //#define pp_SHOW_UPDATE // show what is being updated in the UpdateShowScene routine //#define pp_TERRAIN_HIDE // hide terrain when hiding internal blockages -//#define pp_OPACITY_DEBUG // output hrrpuv opacity in center of each mesh +//#define pp_OPACITY_DEBUG // output hrrpuv opacity in center of each mesh +#define pp_OPACITY_SHORTCUTS // add shortcuts for increasing/decreasing opacity depth //*** options: windows diff --git a/Source/smokeview/renderimage.c b/Source/smokeview/renderimage.c index af8eccdba..19fd5131e 100644 --- a/Source/smokeview/renderimage.c +++ b/Source/smokeview/renderimage.c @@ -836,7 +836,7 @@ int MergeRenderScreenBuffers(int nfactor, GLubyte **screenbuffers){ } } - char infobuffer[100]; + char infobuffer[512]; int ninfobuffer; int skip=3, channel=2; char fds_label[256], smv_label[256];