Skip to content

Commit

Permalink
smokeview source: specify min and number of blockages (rather than mi…
Browse files Browse the repository at this point in the history
…n and max) when drawing debug blockages
  • Loading branch information
gforney committed Nov 8, 2024
1 parent a7aa7c6 commit bb2e857
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 2 deletions.
60 changes: 60 additions & 0 deletions Source/smokeview/IOgeometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand All @@ -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)){
Expand All @@ -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)){
Expand All @@ -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)){
Expand All @@ -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)){
Expand All @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions Source/smokeview/drawGeometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/glui_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/smokeviewvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb2e857

Please sign in to comment.