Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MUG
visad
Commits
43bb4672
Commit
43bb4672
authored
Sep 28, 2018
by
rink
Browse files
allow timeStep to be scaled (Should only be used when using trajectory to render streamlines)
parent
b3cb542f
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/src/visad/TrajectoryManager.java
View file @
43bb4672
...
...
@@ -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
()));
...
...
core/src/visad/TrajectoryParams.java
View file @
43bb4672
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment