Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code cleanup - remove several preprocessing directives #2070

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 0 additions & 178 deletions Source/smokeview/IOboundary.c
Original file line number Diff line number Diff line change
Expand Up @@ -2591,9 +2591,6 @@ void Global2GLUIBoundaryBounds(const char *key){
patchmin_unit = (unsigned char *)patchi->label.unit;
patchmax_unit = patchmin_unit;

#ifdef pp_PATCH_HIDE
UpdateHideBoundarySurface();
#endif
updatefacelists = 1;

GLUI2GlobalBoundaryBounds(key);
Expand All @@ -2617,26 +2614,10 @@ void DrawBoundaryTexture(const meshdata *meshi){
float *xyzpatch;
int *patchblank;
patchdata *patchi;
#ifdef pp_PATCH_HIDE
float dboundx,dboundy,dboundz;
float *xplt, *yplt, *zplt;
#endif

CheckMemory;
if(vis_threshold==1&&vis_onlythreshold==1&&do_threshold==1)return;

#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
xplt=meshi->xplt;
yplt=meshi->yplt;
zplt=meshi->zplt;

dboundx = (xplt[1]-xplt[0])/10.0;
dboundy = (yplt[1]-yplt[0])/10.0;
dboundz = (zplt[1]-zplt[0])/10.0;
}
#endif

patch_times=meshi->patch_times;
xyzpatch = GetPatchXYZ(meshi);
patchblank=meshi->patchblank;
Expand Down Expand Up @@ -2749,14 +2730,7 @@ void DrawBoundaryTexture(const meshdata *meshi){

/* if a contour boundary DOES match a blockage face then draw "one sides" of boundary */

#ifdef pp_PATCH_HIDE
if(hidepatchsurface==1){
glBegin(GL_TRIANGLES);
}
#else
glBegin(GL_TRIANGLES);
#endif

for(n=0;n<patchi->npatches;n++){
int drawit;
patchfacedata *pfi;
Expand Down Expand Up @@ -2784,26 +2758,6 @@ void DrawBoundaryTexture(const meshdata *meshi){
if(patchi->compression_type != COMPRESSED_ZLIB)patchvals = meshi->patchval_iframe + pfi->start;
#endif
if(patchi->compression_type == COMPRESSED_ZLIB)cpatchvals = meshi->cpatchval_iframe_zlib + pfi->start;
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glPushMatrix();
switch(pfi->dir){
case XDIR:
glTranslatef(dboundx,0.0,0.0);
break;
case YDIR:
glTranslatef(0.0,-dboundy,0.0);
break;
case ZDIR:
glTranslatef(0.00,0.0,dboundz);
break;
default:
assert(FFALSE);
break;
}
glBegin(GL_TRIANGLES);
}
#endif
for(irow=0;irow<nrow-1;irow++){
int *patchblank1, *patchblank2;
float *xyzp1, *xyzp2;
Expand Down Expand Up @@ -2861,12 +2815,6 @@ void DrawBoundaryTexture(const meshdata *meshi){
xyzp2+=3;
}
}
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glEnd();
glPopMatrix();
}
#endif
}
}

Expand Down Expand Up @@ -2897,26 +2845,6 @@ void DrawBoundaryTexture(const meshdata *meshi){
if(patchi->compression_type != COMPRESSED_ZLIB)patchvals = meshi->patchval_iframe + pfi->start;
#endif
if(patchi->compression_type == COMPRESSED_ZLIB)cpatchvals = meshi->cpatchval_iframe_zlib + pfi->start;
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glPushMatrix();
switch(pfi->dir){
case XDIRNEG:
glTranslatef(-dboundx,0.0,0.0);
break;
case YDIRNEG:
glTranslatef(0.0,dboundy,0.0);
break;
case ZDIRNEG:
glTranslatef(0.0,0.0,-dboundz);
break;
default:
assert(FFALSE);
break;
}
glBegin(GL_TRIANGLES);
}
#endif
for(irow=0;irow<nrow-1;irow++){
int *patchblank1, *patchblank2;
float *xyzp1, *xyzp2;
Expand Down Expand Up @@ -2973,21 +2901,9 @@ void DrawBoundaryTexture(const meshdata *meshi){
xyzp2+=3;
}
}
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glEnd();
glPopMatrix();
}
#endif
}
}
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==1){
glEnd();
}
#else
glEnd();
#endif
glDisable(GL_TEXTURE_1D);
}

Expand Down Expand Up @@ -3695,29 +3611,10 @@ void DrawBoundaryCellCenter(const meshdata *meshi){
glEnd();
if(cullfaces==1)glEnable(GL_CULL_FACE);

#ifdef pp_PATCH_HIDE
float *xplt, *yplt, *zplt;
float dboundx, dboundy, dboundz;

xplt = meshi->xplt;
yplt = meshi->yplt;
zplt = meshi->zplt;

dboundx = (xplt[1]-xplt[0])/10.0;
dboundy = (yplt[1]-yplt[0])/10.0;
dboundz = (zplt[1]-zplt[0])/10.0;
#endif

/* if a contour boundary DOES match a blockage face then draw "one sides" of boundary */

nn = 0;
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==1){
glBegin(GL_TRIANGLES);
}
#else
glBegin(GL_TRIANGLES);
#endif
for(n = 0;n<patchi->npatches;n++){
int drawit;
patchfacedata *pfi;
Expand Down Expand Up @@ -3749,26 +3646,6 @@ void DrawBoundaryCellCenter(const meshdata *meshi){
patchvals = patchval_iframe+ pfi->start;
#endif
if(patchi->compression_type == COMPRESSED_ZLIB)cpatchvals = meshi->cpatchval_iframe_zlib + pfi->start;
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glPushMatrix();
switch(pfi->dir){
case XDIR:
glTranslatef(dboundx, 0.0, 0.0);
break;
case YDIR:
glTranslatef(0.0, -dboundy, 0.0);
break;
case ZDIR:
glTranslatef(0.0, 0.0, dboundz);
break;
default:
assert(FFALSE);
break;
}
glBegin(GL_TRIANGLES);
}
#endif
for(irow = 0;irow<nrow-1;irow++){
int *patchblank1, *patchblank2;
float *xyzp1, *xyzp2;
Expand Down Expand Up @@ -3816,12 +3693,6 @@ void DrawBoundaryCellCenter(const meshdata *meshi){
xyzp2 += 3;
}
}
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glEnd();
glPopMatrix();
}
#endif
}
nn += pfi->nrow*pfi->ncol;
}
Expand Down Expand Up @@ -3855,26 +3726,6 @@ void DrawBoundaryCellCenter(const meshdata *meshi){
patchvals = patchval_iframe+ pfi->start;
#endif
if(patchi->compression_type == COMPRESSED_ZLIB)cpatchvals = meshi->cpatchval_iframe_zlib + pfi->start;
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glPushMatrix();
switch(pfi->dir){
case XDIRNEG:
glTranslatef(-dboundx, 0.0, 0.0);
break;
case YDIRNEG:
glTranslatef(0.0, dboundy, 0.0);
break;
case ZDIRNEG:
glTranslatef(0.0, 0.0, -dboundz);
break;
default:
assert(FFALSE);
break;
}
glBegin(GL_TRIANGLES);
}
#endif
for(irow = 0;irow<nrow-1;irow++){
int *patchblank1, *patchblank2;
float *xyzp1, *xyzp2;
Expand Down Expand Up @@ -3921,22 +3772,10 @@ void DrawBoundaryCellCenter(const meshdata *meshi){
xyzp2 += 3;
}
}
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==0){
glEnd();
glPopMatrix();
}
#endif
}
nn += pfi->nrow*pfi->ncol;
}
#ifdef pp_PATCH_HIDE
if(hidepatchsurface==1){
glEnd();
}
#else
glEnd();
#endif
}

/* ------------------ GetPatchMeshNabor ------------------------ */
Expand Down Expand Up @@ -4512,20 +4351,3 @@ void UncompressBoundaryDataBNDF(meshdata *meshi,int local_iframe){
countout=meshi->npatchsize;
UnCompressZLIB(meshi->cpatchval_iframe_zlib,&countout,compressed_data,countin);
}

/* ------------------ UpdateHideBoundarySurface ------------------------ */

#ifdef pp_PATCH_HIDE
void UpdateHideBoundarySurface(void){
int hidepatchsurface_old;

hidepatchsurface_old=hidepatchsurface;
if(setpatchchopmin==1||setpatchchopmax==1){
hidepatchsurface=0;
}
else{
hidepatchsurface=1;
}
if(hidepatchsurface_old!=hidepatchsurface)updatefacelists=1;
}
#endif
Loading
Loading