Class ViewElevationAnimator

    • Field Detail

      • globe

        protected Globe globe
      • endLatLon

        protected LatLon endLatLon
      • altitudeMode

        protected int altitudeMode
      • midZoom

        protected double midZoom
      • useMidZoom

        protected boolean useMidZoom
      • trueEndZoom

        protected double trueEndZoom
    • Constructor Detail

      • ViewElevationAnimator

        public ViewElevationAnimator​(Globe globe,
                                     double beginZoom,
                                     double endZoom,
                                     LatLon beginLatLon,
                                     LatLon endLatLon,
                                     int altitudeMode,
                                     PropertyAccessor.DoubleAccessor propertyAccessor)
        Create the animator. If the altitude mode is relative to surface elevation, the ending elevation will be re-calculated as the animation runs to ensure that the final elevation is based on the most accurate elevation data available.
        Parameters:
        globe - Globe used to evaluate altitude mode and determine if mid-zoom is necessary. May be null.
        beginZoom - Beginning elevation.
        endZoom - Ending elevation.
        beginLatLon - Beginning location.
        endLatLon - Ending location.
        altitudeMode - Altitude mode of ending elevation (WorldWind.CLAMP_TO_GROUND, WorldWind.RELATIVE_TO_GROUND, or WorldWind.ABSOLUTE. Altitude mode is not used if globe is null.
        propertyAccessor - Accessor to set elevation.
    • Method Detail

      • 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.
      • setEnd

        public void setEnd​(java.lang.Double end)
        Set the animator's end zoom level. Setting the end zoom does not change the mid-zoom.
        Overrides:
        setEnd in class DoubleAnimator
        Parameters:
        end - New end zoom.
      • 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.
      • nextDouble

        public java.lang.Double nextDouble​(double interpolant)
        Overrides:
        nextDouble in class DoubleAnimator
      • 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.
      • 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.
      • computeMidZoom

        protected static double computeMidZoom​(Globe globe,
                                               LatLon beginLatLon,
                                               LatLon endLatLon,
                                               double beginZoom,
                                               double endZoom)
      • 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.