Commit 43bb4672 authored by rink's avatar rink
Browse files

allow timeStep to be scaled (Should only be used when using trajectory to render streamlines)

parent b3cb542f
......@@ -140,6 +140,8 @@ public class TrajectoryManager {
public FieldImpl tracerLocations;
double timeStepScaleFactor;
//- Listener per FlowControl for ProjectionControl events to auto resize tracer geometry.
public static HashMap<FlowControl, ControlListener> scaleChangeListeners = new HashMap<FlowControl, ControlListener>();
......@@ -180,6 +182,7 @@ public class TrajectoryManager {
zSkip = trajParams.getZStartSkip();
startPointType = trajParams.getStartType();
saveTracerLocations = trajParams.getSaveTracerLocations();
timeStepScaleFactor = trajParams.getTimeStepScaleFactor();
this.altToZ = altToZ;
if (terrainFollowEnabled) {
......@@ -409,6 +412,7 @@ public class TrajectoryManager {
}
float timeStep = (float) timeSteps[i]/numIntrpPts;
timeStep *= timeStepScaleFactor;
if (!trajDoIntrp && (method == TrajectoryParams.Method.RK4)) {
timeStep *= 2;
}
......@@ -2477,6 +2481,11 @@ public class TrajectoryManager {
trajParams.setTrajVisibilityTimeWindow(Double.valueOf(propStr.trim()));
}
propStr = prop.getProperty("TimeStepScaleFactor");
if (propStr != null) {
trajParams.setTimeStepScaleFactor(Double.valueOf(propStr.trim()));
}
propStr = prop.getProperty("StartSkip");
if (propStr != null) {
trajParams.setStartSkip(Integer.valueOf(propStr.trim()));
......
......@@ -100,6 +100,8 @@ public class TrajectoryParams {
Method method = Method.HySplit; //Default
InterpolationMethod interpMethod = InterpolationMethod.Cubic;
double timeStepScaleFactor = 1;
public TrajectoryParams() {
}
......@@ -130,6 +132,7 @@ public class TrajectoryParams {
this.interpMethod = params.getInterpolationMethod();
this.trcrStreamingEnabled = params.getTracerStreamingEnabled();
this.saveTracerLocations = params.getSaveTracerLocations();
this.timeStepScaleFactor = params.getTimeStepScaleFactor();
}
public TrajectoryParams(double trajVisibilityTimeWindow, double trajRefreshInterval, int numIntrpPts, int startSkip, SmoothParams smoothParams) {
......@@ -375,6 +378,14 @@ public class TrajectoryParams {
this.saveTracerLocations = yesno;
}
public double getTimeStepScaleFactor() {
return this.timeStepScaleFactor;
}
public void setTimeStepScaleFactor(double fac) {
this.timeStepScaleFactor = fac;
}
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof TrajectoryParams)) {
return false;
......@@ -432,6 +443,9 @@ public class TrajectoryParams {
else if (this.saveTracerLocations != trajParams.saveTracerLocations) {
return false;
}
else if (this.timeStepScaleFactor != trajParams.timeStepScaleFactor) {
return false;
}
}
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment