From 4aa1e72caf274232b8945d72e99a4e0f8be51606 Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 23 Oct 2024 13:14:58 -0400 Subject: [PATCH 1/5] smokeview source: minor formatting to boundary file show/hide dialog box --- Source/smokeview/glui_bounds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/smokeview/glui_bounds.cpp b/Source/smokeview/glui_bounds.cpp index 12e1bfaee..210a295bc 100644 --- a/Source/smokeview/glui_bounds.cpp +++ b/Source/smokeview/glui_bounds.cpp @@ -5117,8 +5117,8 @@ extern "C" void GLUIBoundsSetup(int main_window){ PANEL_boundary_exterior_data = glui_bounds->add_panel_to_panel(ROLLOUT_boundary_settings,"exterior data"); CHECKBOX_show_all_exterior_patch_data = glui_bounds->add_checkbox_to_panel(PANEL_boundary_exterior_data, _("Show all"), &show_all_exterior_patch_data, SHOW_ALL_EXTERIOR_PATCH_DATA, BoundBoundCB); - CHECKBOX_show_exterior_walls[FRONTwall] = glui_bounds->add_checkbox_to_panel(PANEL_boundary_exterior_data, _("front wall"), vis_boundary_type + FRONTwall, SHOW_EXTERIOR_PATCH_DATA, BoundBoundCB); CHECKBOX_show_exterior_walls[LEFTwall] = glui_bounds->add_checkbox_to_panel(PANEL_boundary_exterior_data, _("left wall"), vis_boundary_type + LEFTwall, SHOW_EXTERIOR_PATCH_DATA, BoundBoundCB); + CHECKBOX_show_exterior_walls[FRONTwall] = glui_bounds->add_checkbox_to_panel(PANEL_boundary_exterior_data, _("front wall"), vis_boundary_type + FRONTwall, SHOW_EXTERIOR_PATCH_DATA, BoundBoundCB); CHECKBOX_show_exterior_walls[DOWNwall] = glui_bounds->add_checkbox_to_panel(PANEL_boundary_exterior_data, _("lower wall"), vis_boundary_type + DOWNwall, SHOW_EXTERIOR_PATCH_DATA, BoundBoundCB); glui_bounds->add_column_to_panel(PANEL_boundary_exterior_data, false); From 39316baff262581e421f119db05b77ab5afc4e47 Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 23 Oct 2024 13:35:22 -0400 Subject: [PATCH 2/5] smokeview source: minor formatting edit to boundary file external face show/hide menu --- Source/smokeview/menus.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index 15b20c182..fd91b86fc 100644 --- a/Source/smokeview/menus.c +++ b/Source/smokeview/menus.c @@ -9162,18 +9162,30 @@ static int menu_count=0; glutAddMenuEntry(_("#Hide all"), HIDE_EXTERIOR_WALL_MENU); } UpdateShowExtPatch(show_all_exterior_patch_data, hide_all_exterior_patch_data); - if(IsBoundaryType(FRONTwall) == 1 && vis_boundary_type[FRONTwall] == 1)glutAddMenuEntry(_("*Front"), FRONTwallmenu); - if(IsBoundaryType(FRONTwall) == 1 && vis_boundary_type[FRONTwall] == 0)glutAddMenuEntry(_("Front"), FRONTwallmenu); - if(IsBoundaryType(BACKwall) == 1 && vis_boundary_type[BACKwall] == 1)glutAddMenuEntry(_("*Back"), BACKwallmenu); - if(IsBoundaryType(BACKwall) == 1 && vis_boundary_type[BACKwall] == 0)glutAddMenuEntry(_("Back"), BACKwallmenu); - if(IsBoundaryType(LEFTwall) == 1 && vis_boundary_type[LEFTwall] == 1)glutAddMenuEntry(_("*Left"), LEFTwallmenu); - if(IsBoundaryType(LEFTwall) == 1 && vis_boundary_type[LEFTwall] == 0)glutAddMenuEntry(_("Left"), LEFTwallmenu); - if(IsBoundaryType(RIGHTwall) == 1 && vis_boundary_type[RIGHTwall] == 1)glutAddMenuEntry(_("*Right"), RIGHTwallmenu); - if(IsBoundaryType(RIGHTwall) == 1 && vis_boundary_type[RIGHTwall] == 0)glutAddMenuEntry(_("Right"), RIGHTwallmenu); - if(IsBoundaryType(UPwall) == 1 && vis_boundary_type[UPwall] == 1)glutAddMenuEntry(_("*Up"), UPwallmenu); - if(IsBoundaryType(UPwall) == 1 && vis_boundary_type[UPwall] == 0)glutAddMenuEntry(_("Up"), UPwallmenu); - if(IsBoundaryType(DOWNwall) == 1 && vis_boundary_type[DOWNwall] == 1)glutAddMenuEntry(_("*Down"), DOWNwallmenu); - if(IsBoundaryType(DOWNwall) == 1 && vis_boundary_type[DOWNwall] == 0)glutAddMenuEntry(_("Down"), DOWNwallmenu); + if(IsBoundaryType(FRONTwall) == 1){ + if(vis_boundary_type[FRONTwall] == 1)glutAddMenuEntry(_("*Front"), FRONTwallmenu); + if(vis_boundary_type[FRONTwall] == 0)glutAddMenuEntry(_("Front"), FRONTwallmenu); + } + if(IsBoundaryType(BACKwall) == 1){ + if(vis_boundary_type[BACKwall] == 1)glutAddMenuEntry(_("*Back"), BACKwallmenu); + if(vis_boundary_type[BACKwall] == 0)glutAddMenuEntry(_("Back"), BACKwallmenu); + } + if(IsBoundaryType(LEFTwall) == 1){ + if(vis_boundary_type[LEFTwall] == 1)glutAddMenuEntry(_("*Leftxx"), LEFTwallmenu); + if(vis_boundary_type[LEFTwall] == 0)glutAddMenuEntry(_("Leftxx"), LEFTwallmenu); + } + if(IsBoundaryType(RIGHTwall) == 1){ + if(vis_boundary_type[RIGHTwall] == 1)glutAddMenuEntry(_("*Right"), RIGHTwallmenu); + if(vis_boundary_type[RIGHTwall] == 0)glutAddMenuEntry(_("Right"), RIGHTwallmenu); + } + if(IsBoundaryType(UPwall) == 1){ + if(vis_boundary_type[UPwall] == 1)glutAddMenuEntry(_("*Up"), UPwallmenu); + if(vis_boundary_type[UPwall] == 0)glutAddMenuEntry(_("Up"), UPwallmenu); + } + if(IsBoundaryType(DOWNwall) == 1){ + if(vis_boundary_type[DOWNwall] == 1)glutAddMenuEntry(_("*Down"), DOWNwallmenu); + if(vis_boundary_type[DOWNwall] == 0)glutAddMenuEntry(_("Down"), DOWNwallmenu); + } CREATEMENU(showpatchmenu,ShowBoundaryMenu); if(npatchloaded>0){ From 8865b780e95bea66ad88e3809403bea90c330c54 Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 23 Oct 2024 19:14:58 -0400 Subject: [PATCH 3/5] smokeview source: remove debug boundary file menu labels --- Source/smokeview/menus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index fd91b86fc..a5d229b20 100644 --- a/Source/smokeview/menus.c +++ b/Source/smokeview/menus.c @@ -9171,8 +9171,8 @@ static int menu_count=0; if(vis_boundary_type[BACKwall] == 0)glutAddMenuEntry(_("Back"), BACKwallmenu); } if(IsBoundaryType(LEFTwall) == 1){ - if(vis_boundary_type[LEFTwall] == 1)glutAddMenuEntry(_("*Leftxx"), LEFTwallmenu); - if(vis_boundary_type[LEFTwall] == 0)glutAddMenuEntry(_("Leftxx"), LEFTwallmenu); + if(vis_boundary_type[LEFTwall] == 1)glutAddMenuEntry(_("*Left"), LEFTwallmenu); + if(vis_boundary_type[LEFTwall] == 0)glutAddMenuEntry(_("Left"), LEFTwallmenu); } if(IsBoundaryType(RIGHTwall) == 1){ if(vis_boundary_type[RIGHTwall] == 1)glutAddMenuEntry(_("*Right"), RIGHTwallmenu); From 2455727613e336c3a9cf7b833bc4533bf49ea94b Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 23 Oct 2024 22:13:44 -0400 Subject: [PATCH 4/5] smokeview source: fix to boundary file external surface show/hide menu --- Source/smokeview/drawGeometry.c | 98 +++++++++++++++------------------ Source/smokeview/readsmv.c | 36 ++++++------ Source/smokeview/smv_geometry.c | 9 +-- Source/smokeview/structures.h | 2 +- 4 files changed, 67 insertions(+), 78 deletions(-) diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index 55ffc019c..35185bd1f 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -2586,67 +2586,55 @@ int CompareColorFaces(const void *arg1, const void *arg2){ /* ------------------ ShowHideInternalFaces ------------------------ */ -void ShowHideInternalFaces(void){ - int i; - int show; +//***need to update +void ShowHideInternalFaces(meshdata *meshi, int show){ + int j; - show = GetInternalFaceShow(); - for(i = 0;i < nmeshes;i++){ - int j; - meshdata *meshi; + for(j = 0;j < meshi->nbptrs;j++){ + facedata *facej; + blockagedata *bc; - meshi = meshinfo + i; - for(j = 0;j < meshi->nbptrs;j++){ - facedata *facej; - blockagedata *bc; + bc = meshi->blockageinfoptrs[j]; + facej = meshi->faceinfo + 6 * j; + facej->hidden = 0; facej++; + facej->hidden = 0; facej++; + facej->hidden = 0; facej++; + facej->hidden = 0; facej++; + facej->hidden = 0; facej++; + facej->hidden = 0; facej++; + } + if(show == 1)return; + for(j = 0;j < meshi->nbptrs;j++){ + facedata *facej; + blockagedata *bc; + + bc = meshi->blockageinfoptrs[j]; + facej = meshi->faceinfo + 6 * j; - bc = meshi->blockageinfoptrs[j]; - facej = meshi->faceinfo + 6 * j; - -/* down y 2 - up x 1 - up y 3 - down x 0 - down z 4 - up z 5 - */ #define EPS 0.01 //down y - facej->hidden = 0; -// if(bc->inside_domain[2]==1)facej->hidden = 1; - if(show==0 && bc->xyzEXACT[2] > ybar0FDS + EPS)facej->hidden = 1; - facej++; + if(bc->xyzEXACT[2] > ybar0FDS + EPS)facej->hidden = 1; + facej++; // up x - facej->hidden = 0; -// if(bc->inside_domain[1] == 1)facej->hidden = 1; - if(show == 0 && bc->xyzEXACT[1] < xbarFDS - EPS)facej->hidden = 1; - facej++; + if(bc->xyzEXACT[1] < xbarFDS - EPS)facej->hidden = 1; + facej++; //up y - facej->hidden = 0; - // if(bc->inside_domain[3] == 1)facej->hidden = 1; - if(show == 0 && bc->xyzEXACT[3] < ybarFDS - EPS)facej->hidden = 1; - facej++; + if(bc->xyzEXACT[3] < ybarFDS - EPS)facej->hidden = 1; + facej++; // down x - facej->hidden = 0; -// if(bc->inside_domain[0] == 1)facej->hidden = 1; - if(show == 0 && bc->xyzEXACT[0] > xbar0FDS + EPS)facej->hidden = 1; - facej++; + if(bc->xyzEXACT[0] > xbar0FDS + EPS)facej->hidden = 1; + facej++; // down z - facej->hidden = 0; -// if(bc->inside_domain[4] == 1)facej->hidden = 1; - if(show == 0 && bc->xyzEXACT[4] > zbar0FDS + EPS)facej->hidden = 1; - facej++; + if(bc->xyzEXACT[4] > zbar0FDS + EPS)facej->hidden = 1; + facej++; // up z - facej->hidden = 0; -// if(bc->inside_domain[5] == 1)facej->hidden = 1; - if(show == 0 && bc->xyzEXACT[5] < zbarFDS - EPS)facej->hidden = 1; - facej++; - } + if(bc->xyzEXACT[5] < zbarFDS - EPS)facej->hidden = 1; + facej++; } } @@ -2654,12 +2642,12 @@ void ShowHideInternalFaces(void){ int IsVentVisible(ventdata *vi){ if(boundary_loaded == 1){ - if(vi->isExterior == DOWN_X && vis_boundary_type[LEFTwall] == 0)return 1; - if(vi->isExterior == UP_X && vis_boundary_type[RIGHTwall] == 0)return 1; - if(vi->isExterior == DOWN_Y && vis_boundary_type[FRONTwall] == 0)return 1; - if(vi->isExterior == UP_Y && vis_boundary_type[BACKwall] == 0)return 1; - if(vi->isExterior == DOWN_Z && vis_boundary_type[DOWNwall] == 0)return 1; - if(vi->isExterior == UP_Z && vis_boundary_type[UPwall] == 0)return 1; + if(vi->wall_type == LEFTwall && vis_boundary_type[LEFTwall] == 0)return 1; + if(vi->wall_type == RIGHTwall && vis_boundary_type[RIGHTwall] == 0)return 1; + if(vi->wall_type == FRONTwall && vis_boundary_type[FRONTwall] == 0)return 1; + if(vi->wall_type == BACKwall && vis_boundary_type[BACKwall] == 0)return 1; + if(vi->wall_type == DOWNwall && vis_boundary_type[DOWNwall] == 0)return 1; + if(vi->wall_type == UPwall && vis_boundary_type[UPwall] == 0)return 1; return 0; } return 1; @@ -2686,6 +2674,10 @@ void UpdateFaceLists(void){ if(opengldefined==1){ glutPostRedisplay(); } + + int show; + show = GetInternalFaceShow(); + // if we are not showing boundary files then don't try to hide blockages for(i=0;ipatchfilenum; patchi=NULL; if(showplot3d == 0 && patchfilenum>=0 && patchfilenumventinfo + j; - vj->isExterior = -1; + vj->wall_type = INTERIORwall; switch(vj->dir){ case UP_X: - xyz[0] = vj->xvent1_orig + VENT_EPS; + xyz[0] = vj->xvent1_orig - VENT_EPS; xyz[1] = (vj->yvent1_orig + vj->yvent2_orig) / 2.0; xyz[2] = (vj->zvent1_orig + vj->zvent2_orig) / 2.0; - if(InExterior(xyz)==1)vj->isExterior = UP_X; + if(InExterior(xyz)==1)vj->wall_type = LEFTwall; break; case DOWN_X: - xyz[0] = vj->xvent1_orig - VENT_EPS; + xyz[0] = vj->xvent1_orig + VENT_EPS; xyz[1] = (vj->yvent1_orig + vj->yvent2_orig) / 2.0; xyz[2] = (vj->zvent1_orig + vj->zvent2_orig) / 2.0; - if(InExterior(xyz) == 1)vj->isExterior = DOWN_X; + if(InExterior(xyz) == 1)vj->wall_type = RIGHTwall; break; case UP_Y: - xyz[0] = (vj->xvent1_orig - vj->xvent2_orig) / 2.0; - xyz[1] = vj->yvent1_orig - VENT_EPS; + xyz[0] = (vj->xvent1_orig + vj->xvent2_orig) / 2.0; + xyz[1] = vj->yvent1_orig - VENT_EPS; xyz[2] = (vj->zvent1_orig + vj->zvent2_orig) / 2.0; - if(InExterior(xyz)==1)vj->isExterior = UP_Y; + if(InExterior(xyz)==1)vj->wall_type = FRONTwall; break; case DOWN_Y: - xyz[0] = (vj->xvent1_orig - vj->xvent2_orig) / 2.0; - xyz[1] = vj->yvent1_orig + VENT_EPS; + xyz[0] = (vj->xvent1_orig + vj->xvent2_orig) / 2.0; + xyz[1] = vj->yvent1_orig + VENT_EPS; xyz[2] = (vj->zvent1_orig + vj->zvent2_orig) / 2.0; - if(InExterior(xyz)==1)vj->isExterior = DOWN_Y; + if(InExterior(xyz)==1)vj->wall_type = BACKwall; break; case UP_Z: xyz[0] = (vj->xvent1_orig + vj->xvent2_orig) / 2.0; xyz[1] = (vj->yvent1_orig + vj->yvent2_orig) / 2.0; - xyz[2] = vj->zvent1_orig + VENT_EPS; - if(InExterior(xyz)==1)vj->isExterior = UP_Z; + xyz[2] = vj->zvent1_orig - VENT_EPS; + if(InExterior(xyz)==1)vj->wall_type = DOWNwall; break; case DOWN_Z: - xyz[0] = (vj->xvent1_orig - vj->xvent2_orig) / 2.0; + xyz[0] = (vj->xvent1_orig + vj->xvent2_orig) / 2.0; xyz[1] = (vj->yvent1_orig + vj->yvent2_orig) / 2.0; - xyz[2] = vj->zvent1_orig + VENT_EPS; - if(InExterior(xyz)==1)vj->isExterior = DOWN_Z; + xyz[2] = vj->zvent1_orig + VENT_EPS; + if(InExterior(xyz)==1)vj->wall_type = UPwall; break; default: - vj->isExterior = -1; + vj->wall_type = INTERIORwall; } } } @@ -11092,7 +11092,7 @@ typedef struct { vi->usecolorindex=0; vi->nshowtime=0; vi->isOpenvent=0; - vi->isExterior = -1; + vi->wall_type = INTERIORwall; vi->isMirrorvent = 0; vi->hideboundary=0; vi->surf[0]=vent_surfacedefault; diff --git a/Source/smokeview/smv_geometry.c b/Source/smokeview/smv_geometry.c index 622d338bc..44b13df7f 100644 --- a/Source/smokeview/smv_geometry.c +++ b/Source/smokeview/smv_geometry.c @@ -475,12 +475,9 @@ int InExterior(float *xyz){ x = xyz[0]; y = xyz[1]; z = xyz[2]; - if(x < xbar0FDS - MESH_EPS)return 1; - if(x > xbarFDS + MESH_EPS)return 1; - if(y < ybar0FDS - MESH_EPS)return 1; - if(y > ybarFDS + MESH_EPS)return 1; - if(z < zbar0FDS - MESH_EPS)return 1; - if(z > zbarFDS + MESH_EPS)return 1; + if(x < xbar0FDS - MESH_EPS || x > xbarFDS + MESH_EPS)return 1; + if(y < ybar0FDS - MESH_EPS || y > ybarFDS + MESH_EPS)return 1; + if(z < zbar0FDS - MESH_EPS || z > zbarFDS + MESH_EPS)return 1; for(i = 0;i < nmeshes;i++){ meshdata *meshi; diff --git a/Source/smokeview/structures.h b/Source/smokeview/structures.h index f39211dd7..53aa6a174 100644 --- a/Source/smokeview/structures.h +++ b/Source/smokeview/structures.h @@ -401,7 +401,7 @@ typedef struct _ventdata { int dir,dir2,vent_id; int useventcolor; int isOpenvent, isMirrorvent; - int isExterior; + int wall_type; float xvent1_orig, xvent2_orig; float yvent1_orig, yvent2_orig; float zvent1_orig, zvent2_orig; From 087f65eadb3b6d180fdecc7e633a7facd78f2a6f Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 23 Oct 2024 22:20:00 -0400 Subject: [PATCH 5/5] smokevijew source: remove unused variable --- Source/smokeview/drawGeometry.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index 35185bd1f..7fcee9f55 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -2592,9 +2592,7 @@ void ShowHideInternalFaces(meshdata *meshi, int show){ for(j = 0;j < meshi->nbptrs;j++){ facedata *facej; - blockagedata *bc; - bc = meshi->blockageinfoptrs[j]; facej = meshi->faceinfo + 6 * j; facej->hidden = 0; facej++; facej->hidden = 0; facej++;