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

remove pp_TOUR_ADJUST, pp_TOUR_DUP, pp_SMOKE_ADAPT and pp_GEOM directives #1617

Merged
merged 5 commits into from
Jun 23, 2023
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
5 changes: 0 additions & 5 deletions Source/smokeview/IOplot2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
#include <math.h>
#include <string.h>

#if defined(WIN32)
#include <windows.h>
#endif
#include GL_H

#include "datadefs.h"
#include "smokeviewvars.h"

Expand Down
100 changes: 0 additions & 100 deletions Source/smokeview/IOtour.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ void FreeTour(tourdata *touri){
FREEMEMORY(touri->keyframe_times);
FREEMEMORY(touri->timeslist);
FREEMEMORY(touri->path_times);
#ifdef pp_TOUR_ADJUST
FREEMEMORY(touri->path_dists);
#endif
}

/* ------------------ InitTour ------------------------ */
Expand All @@ -65,9 +62,6 @@ void InitTour(tourdata *touri){
touri->keyframe_list=NULL;
touri->timeslist=NULL;
touri->path_times=NULL;
#ifdef pp_TOUR_ADJUST
touri->path_dists = NULL;
#endif
touri->global_dist=0.0;
touri->startup=0;
touri->isDefault=0;
Expand Down Expand Up @@ -518,13 +512,6 @@ void HermiteView(float t, keyframe *kf1, keyframe *kf2, float *view){
view[2] = HERMVAL(p0[2],p1[2],m0[2],m1[2]);
}

/* ------------------ UpdateTourKeyframeDups ------------------------ */

#ifdef pp_TOUR_DUP
void UpdateKeyframeDups(tourdata *touri){
}
#endif

/* ------------------ GetKeyFrame ------------------------ */

keyframe *GetKeyFrame(tourdata *touri, float time){
Expand All @@ -545,61 +532,12 @@ keyframe *GetKeyFrame(tourdata *touri, float time){
return last_key->prev;
}

/* ------------------ GetTourXYZ0 ------------------------ */
#ifdef pp_TOUR_ADJUST
void GetTourXYZ0(float t, tourdata *this_tour, float *xyz){
keyframe *this_key;

this_key = GetKeyFrame(this_tour, t);
GetKeyXYZ(t, this_key, xyz);
}

/* ------------------ GetKeyXYZ ------------------------ */

void GetTourXYZ(float t, tourdata *this_tour, float *xyz){
keyframe *this_key;
int i;
float factor, dt, tdist, tnew;

// int ISearch(float *list, int nlist, float key, int guess){
dt = this_tour->path_times[this_tour->ntimes - 1] - this_tour->path_times[0];
factor = 1.0;
if(dt>0.0){
factor *= this_tour->path_dists[this_tour->ntimes - 1];
factor /= this_tour->path_times[this_tour->ntimes - 1];
}
tdist = t * factor;
i = ISearch(this_tour->path_dists, this_tour->ntimes, tdist, 0);
if(i==this_tour->ntimes-1){
tnew = this_tour->path_times[this_tour->ntimes-1];
}
else{
float t1, t2, d1, d2;

d1 = this_tour->path_dists[i];
d2 = this_tour->path_dists[i+1];
t1 = this_tour->path_times[i];
t2 = this_tour->path_times[i + 1];
// (tdist - d1)/(d2-d1) = (t-t1)/(t2-t1)
if(d2-d1>0.0){
tnew = t1 + (t2 - t1) * (tdist - d1) / (d2 - d1);
}
else{
tnew = t1;
}
}
if(adjust_tour_time == 0)tnew = t;
this_key = GetKeyFrame(this_tour, tnew);
GetKeyXYZ(t, this_key, xyz);
}
#else
void GetTourXYZ(float t, tourdata *this_tour, float *xyz){
keyframe *this_key;

this_key = GetKeyFrame(this_tour, t);
GetKeyXYZ(t, this_key, xyz);
}
#endif


/* ------------------ GetKeyXYZ ------------------------ */
Expand Down Expand Up @@ -762,11 +700,6 @@ void GetTourProperties(tourdata *touri){
NewMemory((void **)&(xyzs), 3*tour_ntimes*sizeof(float));
NewMemory((void **)&(views), 3*tour_ntimes*sizeof(float));

#ifdef pp_TOUR_ADJUST
touri->path_dists[0]=0.0;
float lastxyz[3], thisxyz[3], tourdist;
tourdist = 0.0;
#endif
for(j=0;j<tour_ntimes;j++){
float f1, vtime;

Expand All @@ -775,21 +708,6 @@ void GetTourProperties(tourdata *touri){
vtime = tour_tstart*(1.0-f1) + tour_tstop*f1;
tour_times[j] = vtime;
touri->path_times[j] = vtime;
#ifdef pp_TOUR_ADJUST
float dist;
GetTourXYZ0(vtime, touri, thisxyz);
if(j == 0){
dist = 0.0;
}
else{
float dx, dy, dz;

DDIST3(thisxyz, lastxyz, dist);
}
tourdist += dist;
touri->path_dists[j] = tourdist;
memcpy(lastxyz, thisxyz, 3 * sizeof(float));
#endif
{
if(j==0){
tour_times[j] = 0.0;
Expand Down Expand Up @@ -1165,9 +1083,6 @@ void InitCircularTour(tourdata *touri, int nkeyframes, int option){
if(option == UPDATE){
FREEMEMORY(touri->keyframe_times);
FREEMEMORY(touri->path_times);
#ifdef pp_TOUR_ADJUST
FREEMEMORY(touri->path_dists);
#endif
}
InitTour(touri);
touri->isDefault=1;
Expand All @@ -1177,9 +1092,6 @@ void InitCircularTour(tourdata *touri, int nkeyframes, int option){
strcpy(touri->label,"Circular");
NewMemory((void **)&touri->keyframe_times, nkeyframes*sizeof(float));
NewMemory((void **)&touri->path_times,tour_ntimes*sizeof(float));
#ifdef pp_TOUR_ADJUST
NewMemory((void **)&touri->path_dists, tour_ntimes * sizeof(float));
#endif
key_view[0]=tour_circular_view[0];
key_view[1]=tour_circular_view[1];
key_view[2]=tour_circular_view[2];
Expand Down Expand Up @@ -1220,9 +1132,6 @@ void InitCircularTour(tourdata *touri, int nkeyframes, int option){
touri->last_frame.prev = thisframe;
thisframe->next = &(touri->last_frame);
selected_frame = touri->first_frame.next;
#ifdef pp_TOUR_DUP
UpdateKeyframeDups(touri);
#endif
}


Expand Down Expand Up @@ -1319,9 +1228,6 @@ tourdata *AddTour(char *label){

NewMemory((void **)&touri->keyframe_times, nkeyframes*sizeof(float));
NewMemory((void **)&touri->path_times,tour_ntimes*sizeof(float));
#ifdef pp_TOUR_ADJUST
NewMemory((void **)&touri->path_dists, tour_ntimes * sizeof(float));
#endif

if(itour==-1){
VEC3EQCONS(key_view,0.0);
Expand Down Expand Up @@ -1384,9 +1290,6 @@ tourdata *AddTour(char *label){
}
updatemenu=1;

#ifdef pp_TOUR_DUP
UpdateKeyframeDups(tourinfo + ntourinfo-1);
#endif
UpdateTourMenuLabels();
CreateTourPaths();
UpdateTimes();
Expand Down Expand Up @@ -1456,9 +1359,6 @@ void ReallocTourMemory(void){
touri = tourinfo + i;
FREEMEMORY(touri->path_times);
NewMemory((void **)&touri->path_times,tour_ntimes*sizeof(float));
#ifdef pp_TOUR_ADJUST
NewMemory((void **)&touri->path_dists, tour_ntimes * sizeof(float));
#endif
touri->ntimes=tour_ntimes;
}
FREEMEMORY(tour_t);
Expand Down
25 changes: 0 additions & 25 deletions Source/smokeview/IOvolsmoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,28 +1184,6 @@ void IntegrateSmokeColors(float *integrated_smokecolor, float *xyzvert, float dl
GetSmokeColor(&smoke_transparency,&smoke_color, &scaled_intensity, &smoke_light_fraction,
dlength, xyz, meshi, &inobst, blank_local);
}
#ifdef pp_SMOKE_ADAPT
if(vol_adaptive==1&&xi>0.5){
float diff_color;

#define COLOREPS_MAX 0.04
#define COLOREPS_MIN 0.0
diff_color = MAXDIFF3(smoke_color,last_smoke_color);
if(
(diff_color>COLOREPS_MAX&&i_dlength>0.125)||
(diff_color<COLOREPS_MIN&&i_dlength<4.0)
){
float grid_factor;

grid_factor = 0.5;
if(diff_color<COLOREPS_MIN)grid_factor = 2.0;
i_dlength *= grid_factor;
dlength *= grid_factor;
xi = last_xi + i_dlength;
continue;
}
}
#endif
#ifdef pp_SMOKE_LIGHT
last_xi = xi;
#endif
Expand Down Expand Up @@ -2195,9 +2173,6 @@ void DrawSmoke3DGPUVol(void){
glUniform1f(GPUvol_xyzmaxdiff,xyzmaxdiff);
glUniform1f(GPUvol_gpu_vol_factor,gpu_vol_factor);
glUniform1f(GPUvol_fire_opacity_factor,fire_opacity_factor);
#ifdef pp_SMOKE_ADAPT
glUniform1i(GPUvol_vol_adaptive, vol_adaptive);
#endif
glUniform1f(GPUvol_mass_extinct,mass_extinct);
glUniform1i(GPUvol_volbw,volbw);
glUniform1f(GPUvol_temperature_min, global_temp_min);
Expand Down
4 changes: 0 additions & 4 deletions Source/smokeview/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#include <stdio.h>
#include <string.h>

#if defined(WIN32)
#include <windows.h>
#endif
#include GL_H

#include "smokeviewvars.h"

Expand Down
5 changes: 0 additions & 5 deletions Source/smokeview/getdatabounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
#include <string.h>
#include <math.h>

#if defined(WIN32)
#include <windows.h>
#endif
#include GL_H

#include "smokeviewvars.h"
#include "IOscript.h"

Expand Down
3 changes: 0 additions & 3 deletions Source/smokeview/glui_smoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,6 @@ extern "C" void Glui3dSmokeSetup(int main_window){
SPINNER_fire_opacity_factor->set_float_limits(1.0, 50.0);
SPINNER_mass_extinct = glui_3dsmoke->add_spinner_to_panel(ROLLOUT_volsmoke_compute, _("Mass extinction coeff (m2/g)"), GLUI_SPINNER_FLOAT, &mass_extinct, MASS_EXTINCTION, Smoke3dCB);
Smoke3dCB(MASS_EXTINCTION);
#ifdef pp_SMOKE_ADAPT
glui_3dsmoke->add_checkbox_to_panel(ROLLOUT_volsmoke_compute, _("adaptive integration"), &vol_adaptive);
#endif
CHECKBOX_combine_meshes = glui_3dsmoke->add_checkbox_to_panel(ROLLOUT_volsmoke_compute, _("Combine meshes"), &combine_meshes, COMBINE_MESHES, Smoke3dCB);
SPINNER_nongpu_vol_factor = glui_3dsmoke->add_spinner_to_panel(ROLLOUT_volsmoke_compute, _("non-gpu grid multiplier"), GLUI_SPINNER_FLOAT, &nongpu_vol_factor, NONGPU_VOL_FACTOR, Smoke3dCB);
SPINNER_nongpu_vol_factor->set_float_limits(1.0, 10.0);
Expand Down
12 changes: 0 additions & 12 deletions Source/smokeview/glui_tour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ extern "C" void GluiTourSetup(int main_window){
glui_tour->add_spinner_to_panel(PANEL_path, _("start time"), GLUI_SPINNER_FLOAT, &tour_tstart, VIEW_times, TourCB);
glui_tour->add_spinner_to_panel(PANEL_path, _("stop time:"), GLUI_SPINNER_FLOAT, &tour_tstop, VIEW_times, TourCB);
glui_tour->add_spinner_to_panel(PANEL_path, _("points"), GLUI_SPINNER_INT, &tour_ntimes, VIEW_times, TourCB);
#ifdef pp_TOUR_ADJUST
glui_tour->add_checkbox_to_panel(PANEL_path, _("Adjust tour times(experimental)"), &adjust_tour_time);
#endif
PANEL_misc = glui_tour->add_panel_to_panel(ROLLOUT_settings, "Misc", true);
CHECKBOX_showintermediate = glui_tour->add_checkbox_to_panel(PANEL_misc, _("Show intermediate path nodes"), &show_path_knots);
if(navatar_types > 0){
Expand Down Expand Up @@ -677,9 +674,6 @@ void TourCB(int var){
SMV2FDS_XYZ(key_view, key_view);
}
newframe = AddFrame(selected_frame, key_time_in, 0.0, key_xyz, key_view);
#ifdef pp_TOUR_DUP
UpdateKeyframeDups(thistour);
#endif
CreateTourPaths();
NewSelect(newframe);
SetGluiTourKeyframe();
Expand All @@ -691,9 +685,6 @@ void TourCB(int var){
selected_frame=DeleteFrame(selected_frame);
if(selected_frame!=NULL){
selected_frame->selected=1;
#ifdef pp_TOUR_DUP
UpdateKeyframeDups(thistour);
#endif
CreateTourPaths();
}
else{
Expand Down Expand Up @@ -773,9 +764,6 @@ void TourCB(int var){
case TOUR_REVERSE:
if(selectedtour_index>=0&&selectedtour_index<ntourinfo){
ReverseTour(tourinfo[selectedtour_index].label);
#ifdef pp_TOUR_DUP
UpdateKeyframeDups(tourinfo + selectedtour_index);
#endif
}
break;
case TOUR_INSERT_NEW:
Expand Down
6 changes: 0 additions & 6 deletions Source/smokeview/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@
#define pp_PART_MULTI // load particle files in parallel
#define pp_CSV_MULTI // read in csv files in parallel

#define pp_PART_BOUND // use .prt.bnd for global part bound file extension

//#define pp_COLOR_HIDE // add checkbox to hide/unhide scene when editing a colorbar

//#define pp_SMOKE_LIGHT // turn on smoke lighting
//#define pp_SMOKE_ADAPT // turn on volume render smoke adaptive integration
#define pp_BGEOM // parse BGEOM smv keywords

//#define pp_TOUR_ADJUST // adjust tour times
#define pp_TOUR_DUP // handle duplicate keyframes
//#define pp_BNDF // merge geometry and structured boundary files in load menus

//#define pp_DPRINT // turn on debug print (file, line number)
Expand Down
Loading