diff --git a/Source/shared/shared_structures.h b/Source/shared/shared_structures.h index d2f3998df..7bb3b86ab 100644 --- a/Source/shared/shared_structures.h +++ b/Source/shared/shared_structures.h @@ -233,8 +233,7 @@ typedef struct _meshdata { int zdist_flag; unsigned char *iblank_smoke3d; int iblank_smoke3d_defined; - struct _blockagedata **blockageinfoptrs; - struct _blockagedata **bc_faces[6]; + struct _blockagedata **blockageinfoptrs, *blockageinfo, **bc_faces[6]; int n_bc_faces[6]; int *obst_bysize; struct _ventdata *ventinfo; @@ -277,10 +276,9 @@ typedef struct _meshdata { float norm[3]; float dplane_min[4], dplane_max[4]; - struct _meshdata *skip_nabors[6]; - - struct _meshdata *nabors[6]; + struct _meshdata *skip_nabors[6], *nabors[6]; struct _supermeshdata *super; + int *ptype; unsigned int *zipoffset, *zipsize; diff --git a/Source/smokeview/options.h b/Source/smokeview/options.h index f82ab715a..76de6a96a 100644 --- a/Source/smokeview/options.h +++ b/Source/smokeview/options.h @@ -12,6 +12,7 @@ #define pp_GPU // support the GPU #define pp_THREAD // turn on multi-threading //#define pp_FDS // create a 1 mesh input file +#define pp_HIDDEN6 // handle hidden6 info on obst line #ifdef pp_FRAME // turn on each frame type if pp_FRAME is set #define pp_BOUNDFRAME // turn on frame code for boundary files diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 143eff3f4..fc3a6ed54 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -1101,6 +1101,7 @@ void InitMesh(meshdata *meshi){ meshi->zheat = NULL; meshi->theat = NULL; meshi->blockageinfoptrs = NULL; + meshi->blockageinfo = NULL; meshi->faceinfo = NULL; meshi->face_normals_single = NULL; @@ -9251,14 +9252,6 @@ int ReadSMV_Parse(bufferstreamdata *stream){ float *xplt_cen, *yplt_cen,*zplt_cen; int *imap, *jmap, *kmap; -// int lenbuffer; - -// TrimBack(buffer); -// lenbuffer=strlen(buffer); -// if(lenbuffer>4){ -// if(buffer[5]!=' ')continue; -// } - igrid++; if(meshinfo!=NULL){ size_t len_meshlabel; @@ -10593,6 +10586,7 @@ typedef struct { meshi->blockageinfoptrs=NULL; if(n_blocks_normal>0){ NewMemory((void **)&meshi->blockageinfoptrs,sizeof(blockagedata *)*n_blocks_normal); + NewMemory(( void ** )&meshi->blockageinfo, sizeof(blockagedata) *n_blocks_normal); } ntotal_blockages+=n_blocks_normal; @@ -10606,8 +10600,7 @@ typedef struct { continue; } nn++; - meshi->blockageinfoptrs[nn]=NULL; - NewMemory((void **)&meshi->blockageinfoptrs[nn],sizeof(blockagedata)); + meshi->blockageinfoptrs[nn] = meshi->blockageinfo + nn; bc=meshi->blockageinfoptrs[nn]; InitObst(bc,surfacedefault,nn+1,iobst-1); FGETS(buffer,255,stream); @@ -10747,12 +10740,25 @@ typedef struct { FGETS(buffer,255,stream); { char *exclaim; + int hidden6[6] = {-1,-1,-1,-1,-1,-1}; + memcpy(bc->hidden6, hidden6, 6*sizeof(int)); exclaim = strchr(buffer, '!'); if(exclaim != NULL){ exclaim[0] = 0; exclaim = TrimFront(exclaim + 1); if(exclaim[0] == 'T' || exclaim[0] == 't')have_removable_obsts = 1; + exclaim++; + if(strlen(exclaim) > 0){ + sscanf(exclaim, "%i %i %i %i %i %i", + hidden6, hidden6 + 1, hidden6 + 2, hidden6 + 3, hidden6 + 4, hidden6 + 5); + int ii; + for(ii = 0; ii < 6; ii++){ + if(hidden6[i] >= 0)hidden6[ii] = 1 - hidden6[ii]; + } + memcpy(bc->hidden6, hidden6, 6*sizeof(int)); + if(hidden6[0] >= 0)have_hidden6 = 1; + } } } ijk = bc->ijk; diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 105f7bccc..3cead0b07 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -514,8 +514,6 @@ EXTERNCPP void CreatePartBoundFile(partdata *parti); EXTERNCPP void InitRolloutList(void); EXTERNCPP void GetTourXYZ(float t, tourdata *this_tour, float *xyz); EXTERNCPP int GetTourFrame(tourdata *touri, int itime); -EXTERNCPP int MeshConnect(meshdata *mesh_from, int val, meshdata *mesh_to); -EXTERNCPP int IsBottomMesh(meshdata *mesh_from); EXTERNCPP void *InitNabors(void *arg); EXTERNCPP int Smv2Html(char *html_out, int option, int from_where); EXTERNCPP int Smv2Geom(char *html_file); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 095f93785..ada1db1fa 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1569,6 +1569,7 @@ SVEXTERN int SVDECL(cullfaces,1); SVEXTERN int SVDECL(showonly_hiddenfaces,0); SVEXTERN int SVDECL(have_removable_obsts, 0); SVEXTERN int SVDECL(update_bound_chop_data, 0); +SVEXTERN int SVDECL(have_hidden6, 0); SVEXTERN int SVDECL(windowresized,0); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 63629fdeb..6de95a39f 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -3024,14 +3024,21 @@ void UpdateDisplay(void){ meshi->c_iblank_z0 = meshi->c_iblank_z0_temp; } INIT_PRINT_TIMER(timer_hidden_blockages); - int nhidden_faces = 0; + int nhidden_faces = 0, ntotal_obsts = 0; for(ig = 0; ig < nmeshes; ig++){ meshdata *meshi; int j; meshi = meshinfo + ig; void SetHiddenBlockages(meshdata *meshi); +#ifdef pp_HIDDEN6 + if(have_hidden6 == 0){ + if(ig == 0)printf("setting hidden blockages\n"); + SetHiddenBlockages(meshi); + } +#else SetHiddenBlockages(meshi); +#endif for(j = 0; j < meshi->nbptrs; j++){ blockagedata *bc; @@ -3043,8 +3050,9 @@ void UpdateDisplay(void){ if(bc->hidden6[4] == 1)nhidden_faces++; if(bc->hidden6[5] == 1)nhidden_faces++; } + ntotal_obsts += meshi->nbptrs; } - if(nhidden_faces > 0)printf("%i blockage faces out of %i hidden\n", nhidden_faces, 6*ntotal_blockages); + if(nhidden_faces > 0)printf("%i blockage faces out of %i hidden\n", nhidden_faces, 6*ntotal_obsts); PRINT_TIMER(timer_hidden_blockages, "SetHiddenBlockages"); update_make_iblank = 0; update_setvents = 1;