NASA World Wind

gov.nasa.worldwind.view
Class ViewElevationAnimator

java.lang.Object
  extended by gov.nasa.worldwind.animation.BasicAnimator
      extended by gov.nasa.worldwind.animation.DoubleAnimator
          extended by gov.nasa.worldwind.view.ViewElevationAnimator
All Implemented Interfaces:
Animator

public class ViewElevationAnimator
extends DoubleAnimator

An Animator for elevation values. Calculates a mid-zoom value that gives the effect of flying up and them back down again.


Field Summary
protected  double midZoom
           
protected  double trueEndZoom
           
protected  boolean useMidZoom
           
 
Fields inherited from class gov.nasa.worldwind.animation.DoubleAnimator
begin, end, propertyAccessor
 
Fields inherited from class gov.nasa.worldwind.animation.BasicAnimator
interpolator
 
Constructor Summary
ViewElevationAnimator(Globe globe, double beginZoom, double endZoom, LatLon beginLatLon, LatLon endLatLon, PropertyAccessor.DoubleAccessor propertyAccessor)
           
 
Method Summary
protected static double computeMidZoom(Globe globe, LatLon beginLatLon, LatLon endLatLon, double beginZoom, double endZoom)
           
 double getTrueEndZoom()
          return the true position to end the elevation animation at.
 boolean getUseMidZoom()
          determines whether this Animator is using midZoom.
protected  double nextDouble(double interpolant, double start, double end)
          computes the value for the given interpolant.
 void set(double interpolant)
          Set the value of the field being animated based on the given interpolant.
protected  void setImpl(double interpolant)
          No-op intended to be overrided by deriving classes.
protected  boolean useMidZoom(double beginZoom, double endZoom, double midZoom)
          Determines if the animation will use mid-zoom.
 
Methods inherited from class gov.nasa.worldwind.animation.DoubleAnimator
getBegin, getEnd, getPropertyAccessor, nextDouble, setBegin, setEnd
 
Methods inherited from class gov.nasa.worldwind.animation.BasicAnimator
flagLastStateInvalid, hasNext, isLastStateValid, isStopOnInvalidState, next, setStopOnInvalidState, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

midZoom

protected double midZoom

trueEndZoom

protected double trueEndZoom

useMidZoom

protected boolean useMidZoom
Constructor Detail

ViewElevationAnimator

public ViewElevationAnimator(Globe globe,
                             double beginZoom,
                             double endZoom,
                             LatLon beginLatLon,
                             LatLon endLatLon,
                             PropertyAccessor.DoubleAccessor propertyAccessor)
Method Detail

computeMidZoom

protected static double computeMidZoom(Globe globe,
                                       LatLon beginLatLon,
                                       LatLon endLatLon,
                                       double beginZoom,
                                       double endZoom)

getTrueEndZoom

public double getTrueEndZoom()
return the true position to end the elevation animation at.

Returns:
the true end elevation position.

getUseMidZoom

public boolean getUseMidZoom()
determines whether this Animator is using midZoom. The mid-point zoom is an interpolated value between minimum(the lesser of beginZoom and endZoom, and maximum zoom (3* the radius of the globe).

Returns:
whether this Animator is using midZoom.

nextDouble

protected double nextDouble(double interpolant,
                            double start,
                            double end)
computes the value for the given interpolant.

Parameters:
interpolant - the interpolant to use for interpolating
start - the lower end of the interpolated range.
end - the upper end of the interpolated range.
Returns:
the interpolated value.

set

public void set(double interpolant)
Set the value of the field being animated based on the given interpolant.

Specified by:
set in interface Animator
Overrides:
set in class BasicAnimator
Parameters:
interpolant - A value between 0 and 1.

setImpl

protected void setImpl(double interpolant)
Description copied from class: BasicAnimator
No-op intended to be overrided by deriving classes. Deriving classes are expected to implement the desired action of a set operation in this method.

Overrides:
setImpl in class DoubleAnimator
Parameters:
interpolant - A value between 0 and 1.

useMidZoom

protected boolean useMidZoom(double beginZoom,
                             double endZoom,
                             double midZoom)
Determines if the animation will use mid-zoom. Mid-zoom animation is used if the difference between the beginZoom and endZoom values is less than the difference between the midZoom value and the larger of the beginZoom or endZoom values.

Parameters:
beginZoom - the begin zoom value
endZoom - the end zoom value
midZoom - the elevation at the middle of the animation
Returns:
true if it is appropriate to use the midZoom value.

NASA World Wind