From bb2e857474be9fc105fa831ab0e4434ccc26f714 Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 8 Nov 2024 14:56:35 -0500 Subject: [PATCH] smokeview source: specify min and number of blockages (rather than min and max) when drawing debug blockages --- Source/smokeview/IOgeometry.c | 60 +++++++++++++++++++++++++++++++ Source/smokeview/drawGeometry.c | 2 ++ Source/smokeview/glui_display.cpp | 2 +- Source/smokeview/smokeviewvars.h | 2 +- 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/Source/smokeview/IOgeometry.c b/Source/smokeview/IOgeometry.c index 3f97280a0..968f57faf 100644 --- a/Source/smokeview/IOgeometry.c +++ b/Source/smokeview/IOgeometry.c @@ -347,6 +347,16 @@ void DrawBoxShaded(float *bb, int flag, int *hidden6, float *box_color){ glVertex3f(x0, y0, z0); glVertex3f(x0, y0, z1); glVertex3f(x0, y1, z1); + + if(flag == 3 && hidden6[0] == 0){ + glNormal3f(1.0, 0.0, 0.0); + glVertex3f(x0, y0, z0); + glVertex3f(x0, y1, z0); + glVertex3f(x0, y1, z1); + glVertex3f(x0, y0, z0); + glVertex3f(x0, y1, z1); + glVertex3f(x0, y0, z1); + } } if(flag==2||(flag==3&&hidden6[1]==0)){ @@ -357,6 +367,16 @@ void DrawBoxShaded(float *bb, int flag, int *hidden6, float *box_color){ glVertex3f(x1, y0, z0); glVertex3f(x1, y1, z1); glVertex3f(x1, y0, z1); + + if(flag == 3 && hidden6[1] == 0){ + glNormal3f(-1.0, 0.0, 0.0); + glVertex3f(x1, y0, z0); + glVertex3f(x1, y1, z1); + glVertex3f(x1, y1, z0); + glVertex3f(x1, y0, z0); + glVertex3f(x1, y0, z1); + glVertex3f(x1, y1, z1); + } } if(flag==2||(flag==3&&hidden6[2]==0)){ @@ -367,6 +387,16 @@ void DrawBoxShaded(float *bb, int flag, int *hidden6, float *box_color){ glVertex3f(x0, y0, z0); glVertex3f(x1, y0, z1); glVertex3f(x0, y0, z1); + + if(flag == 3 && hidden6[2] == 0){ + glNormal3f(0.0, 1.0, 0.0); + glVertex3f(x0, y0, z0); + glVertex3f(x1, y0, z1); + glVertex3f(x1, y0, z0); + glVertex3f(x0, y0, z0); + glVertex3f(x0, y0, z1); + glVertex3f(x1, y0, z1); + } } if(flag==2||(flag==3&&hidden6[3]==0)){ @@ -377,6 +407,16 @@ void DrawBoxShaded(float *bb, int flag, int *hidden6, float *box_color){ glVertex3f(x0, y1, z0); glVertex3f(x0, y1, z1); glVertex3f(x1, y1, z1); + + if(flag == 3 && hidden6[3] == 0){ + glNormal3f(0.0, -1.0, 0.0); + glVertex3f(x0, y1, z0); + glVertex3f(x1, y1, z0); + glVertex3f(x1, y1, z1); + glVertex3f(x0, y1, z0); + glVertex3f(x1, y1, z1); + glVertex3f(x0, y1, z1); + } } if(flag==2||(flag==3&&hidden6[4]==0)){ @@ -387,6 +427,16 @@ void DrawBoxShaded(float *bb, int flag, int *hidden6, float *box_color){ glVertex3f(x0, y0, z0); glVertex3f(x0, y1, z0); glVertex3f(x1, y1, z0); + + if(flag == 3 && hidden6[4] == 0){ + glNormal3f(0.0, 0.0, 1.0); + glVertex3f(x1, y0, z0); + glVertex3f(x1, y1, z0); + glVertex3f(x0, y0, z0); + glVertex3f(x0, y0, z0); + glVertex3f(x1, y1, z0); + glVertex3f(x0, y1, z0); + } } if(flag==2||(flag==3&&hidden6[5]==0)){ @@ -397,6 +447,16 @@ void DrawBoxShaded(float *bb, int flag, int *hidden6, float *box_color){ glVertex3f(x0, y0, z1); glVertex3f(x1, y1, z1); glVertex3f(x0, y1, z1); + + if(flag == 3 && hidden6[5] == 0){ + glNormal3f(0.0, 0.0, -1.0); + glVertex3f(x0, y0, z1); + glVertex3f(x1, y1, z1); + glVertex3f(x1, y0, z1); + glVertex3f(x0, y0, z1); + glVertex3f(x0, y1, z1); + glVertex3f(x1, y1, z1); + } } glEnd(); } diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index db258e3d9..0aee17215 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -3086,7 +3086,9 @@ void DrawObstsDebug(void){ jmin = 0; jmax = meshi->nbptrs-1; if(mesh_index_debug >= 0 && mesh_index_debug < nmeshes){ + int max_blockage_index_debug; if(mesh_index_debug!=i)continue; + max_blockage_index_debug = min_blockage_index_debug + n_blockages_debug - 1; if(min_blockage_index_debug >= 0 && min_blockage_index_debug < meshi->nbptrs){ if(max_blockage_index_debug >= 0 && max_blockage_index_debug < meshi->nbptrs){ if(min_blockage_index_debug <= max_blockage_index_debug){ diff --git a/Source/smokeview/glui_display.cpp b/Source/smokeview/glui_display.cpp index 6f22ed8ac..47375546d 100644 --- a/Source/smokeview/glui_display.cpp +++ b/Source/smokeview/glui_display.cpp @@ -890,7 +890,7 @@ extern "C" void GLUIDisplaySetup(int main_window){ glui_labels->add_radiobutton_to_group(RADIOBUTTON_label_1, _("debug - draw only hidden faces")); glui_labels->add_spinner_to_panel(PANEL_blockage_drawing, "mesh:", GLUI_SPINNER_INT, &mesh_index_debug); glui_labels->add_spinner_to_panel(PANEL_blockage_drawing, "min blockage index:", GLUI_SPINNER_INT, &min_blockage_index_debug); - glui_labels->add_spinner_to_panel(PANEL_blockage_drawing, "max blockage index:", GLUI_SPINNER_INT, &max_blockage_index_debug); + glui_labels->add_spinner_to_panel(PANEL_blockage_drawing, "number of blockages:", GLUI_SPINNER_INT, &n_blockages_debug); #endif CHECKBOX_label_2=glui_labels->add_checkbox_to_panel(PANEL_gen3,_("Sort transparent faces"),&sort_transparent_faces,LABELS_drawface,GLUILabelsCB); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index c0340d6b8..8052bced4 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1818,7 +1818,7 @@ SVEXTERN int SVDECL(blockage_draw_option, 0); #endif SVEXTERN int SVDECL(mesh_index_debug, -1); SVEXTERN int SVDECL(min_blockage_index_debug, -1); -SVEXTERN int SVDECL(max_blockage_index_debug, -1); +SVEXTERN int SVDECL(n_blockages_debug, 0); #ifdef INMAIN SVEXTERN unsigned char rgb_below_min[3]={255-64,255-64,255-64}, rgb_above_max[3]={0,0,0}; #else