diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index 55ffc019c..7fcee9f55 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -2586,67 +2586,53 @@ 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; - meshi = meshinfo + i; - for(j = 0;j < meshi->nbptrs;j++){ - facedata *facej; - blockagedata *bc; + 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 +2640,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 +2672,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 && patchfilenumadd_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); diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index 15b20c182..a5d229b20 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(_("*Left"), LEFTwallmenu); + if(vis_boundary_type[LEFTwall] == 0)glutAddMenuEntry(_("Left"), 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){ diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index bb4b25f39..fd2fbedcd 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -7352,46 +7352,46 @@ void SetExternalVents(void){ float xyz[3]; vj = meshi->ventinfo + 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;