Class BasicOrbitView

    • Field Detail

      • zoom

        protected double zoom
      • viewOutOfFocus

        protected boolean viewOutOfFocus
    • Constructor Detail

      • BasicOrbitView

        public BasicOrbitView()
    • Method Detail

      • loadConfigurationValues

        protected void loadConfigurationValues()
      • flagHadCollisions

        protected void flagHadCollisions()
      • stopMovementOnCenter

        public void stopMovementOnCenter()
        Description copied from interface: OrbitView
        Stop any changes to the center position.
        Specified by:
        stopMovementOnCenter in interface OrbitView
      • copyViewState

        public void copyViewState​(View view)
        Description copied from interface: View
        Copy the state of the given View.
        Specified by:
        copyViewState in interface View
        Overrides:
        copyViewState in class BasicView
        Parameters:
        view - The View whose state is to be copied.
      • getCenterPosition

        public Position getCenterPosition()
        Description copied from interface: OrbitView
        Get the center position of the OrbitView. The center position is used as the point about which the heading and pitch rotate. It is defined by the intersection of a ray from the eye position through the center of the viewport with the surface of the globe.
        Specified by:
        getCenterPosition in interface OrbitView
        Overrides:
        getCenterPosition in class BasicView
        Returns:
        the center position.
      • getCenterPoint

        public Vec4 getCenterPoint()
        Description copied from interface: View
        Gets the center point of the view.
        Specified by:
        getCenterPoint in interface View
        Overrides:
        getCenterPoint in class BasicView
        Returns:
        the center point of the view if that point is on the globe, otherwise, return null
      • setCenterPosition

        public void setCenterPosition​(Position center)
        Description copied from interface: OrbitView
        Sets the center position of the OrbitView. The center position is used as the point about which the heading and pitch rotate. It is defined by the intersection of a ray from the eye position through the center of the viewport with the surface of the globe.
        Specified by:
        setCenterPosition in interface OrbitView
        Parameters:
        center - The desired center position.
      • setHeading

        public void setHeading​(Angle heading)
        Description copied from interface: View
        Sets the heading of the view. The implementation may interpret this command in whatever way it chooses.
        Specified by:
        setHeading in interface View
        Overrides:
        setHeading in class BasicView
        Parameters:
        heading - The direction to aim the view in degrees
      • setPitch

        public void setPitch​(Angle pitch)
        Description copied from interface: View
        Sets the pitch of the view. The implementation may interpret pitch as it chooses
        Specified by:
        setPitch in interface View
        Overrides:
        setPitch in class BasicView
        Parameters:
        pitch - The pitch of the view.
      • getZoom

        public double getZoom()
        Description copied from interface: OrbitView
        Get the zoom value for the OrbitView. The zoom value is the distance between the eye position and the center position.
        Specified by:
        getZoom in interface OrbitView
        Returns:
        the zoom value
      • setZoom

        public void setZoom​(double zoom)
        Description copied from interface: OrbitView
        Set the zoom value for the OrbitVeiw. The zoom value is the distance between the eye position and the center position.
        Specified by:
        setZoom in interface OrbitView
        Parameters:
        zoom - The desired zoom value.
      • getOrbitViewLimits

        public OrbitViewLimits getOrbitViewLimits()
        Returns the OrbitViewLimits that apply to this OrbitView. Incoming parameters to the methods setCenterPosition, setHeading, setPitch, or setZoom are be limited by the parameters defined in this OrbitViewLimits.
        Specified by:
        getOrbitViewLimits in interface OrbitView
        Returns:
        the OrbitViewLimits that apply to this OrbitView
      • setOrbitViewLimits

        public void setOrbitViewLimits​(OrbitViewLimits viewLimits)
        Sets the OrbitViewLimits that will apply to this OrbitView. Incoming parameters to the methods setCenterPosition, setHeading, setPitch, or setZoom will be limited by the parameters defined in viewLimits.
        Specified by:
        setOrbitViewLimits in interface OrbitView
        Parameters:
        viewLimits - the OrbitViewLimits that will apply to this OrbitView.
        Throws:
        java.lang.IllegalArgumentException - if viewLimits is null.
      • normalizedCenterPosition

        public static Position normalizedCenterPosition​(Position unnormalizedPosition)
      • normalizedHeading

        public static Angle normalizedHeading​(Angle unnormalizedHeading)
      • normalizedPitch

        public static Angle normalizedPitch​(Angle unnormalizedPitch)
      • resolveCollisionsWithCenterPosition

        protected void resolveCollisionsWithCenterPosition()
      • resolveCollisionsWithPitch

        protected void resolveCollisionsWithPitch()
      • computeAndSetViewCenterIfNeeded

        public void computeAndSetViewCenterIfNeeded()
        Computes and sets the center of rotation for heading and pitch changes, if it is needed.
      • computeAndSetViewCenter

        public void computeAndSetViewCenter()
        Computes and sets the center of rotation for heading and pitch changes.
      • setViewOutOfFocus

        public void setViewOutOfFocus​(boolean b)
        Alerts the BasicOrbitView that the view requires the point of rotation for heading and pitch changes to be recalculated.
        Parameters:
        b - true if the point of rotation needs recalculation, false if it does not.
      • canFocusOnViewportCenter

        public boolean canFocusOnViewportCenter()
        Determines if the BasicOrbitView can be focused on the viewport center focusOnViewportCenter(). Focusing on the viewport center requires a non-null Globe, a non-null DrawContext, and the viewport center is on the terrain.
        Specified by:
        canFocusOnViewportCenter in interface OrbitView
        Returns:
        true if the BasicOrbitView can focus on the viewport center.
      • focusOnViewportCenter

        public void focusOnViewportCenter()
        Sets the point of rotation for heading and pitch changes to the surface position at the viewport center.
        Specified by:
        focusOnViewportCenter in interface OrbitView
      • canFocusOnTerrainCenter

        public boolean canFocusOnTerrainCenter()
      • focusOnTerrainCenter

        public void focusOnTerrainCenter()
      • setEyePosition

        public void setEyePosition​(Position eyePosition)
        Description copied from interface: View
        Sets the geographic position of the eye.
        Specified by:
        setEyePosition in interface View
        Overrides:
        setEyePosition in class BasicView
        Parameters:
        eyePosition - the eye position.
      • getCurrentEyePosition

        public Position getCurrentEyePosition()
        Description copied from interface: View
        Returns the current geographic coordinates of this view's eye position, as determined from this view's current parameters.

        Note: The value returned is not necessarily the value specified to View.setEyePosition(gov.nasa.worldwind.geom.Position) but is the eye position corresponding to this view's current parameters.

        Specified by:
        getCurrentEyePosition in interface View
        Overrides:
        getCurrentEyePosition in class BasicView
        Returns:
        the position of the eye corresponding to the current parameters of this view.
      • setOrientation

        public void setOrientation​(Position eyePosition,
                                   Position centerPosition)
        Description copied from interface: View
        Sets the location of the eye, and the center of the screen in geographic coordinates. The implementation may interpret this command in whatever way it chooses, so long as the eye is placed at the specified eyePosition, and the center of the screen is the specified centerPosition. Specifically, implementations must determine what the up direction will be given these parameters, and apply these parameters in a meaningful way.
        Specified by:
        setOrientation in interface View
        Overrides:
        setOrientation in class BasicView
        Parameters:
        eyePosition - Position of they eye.
        centerPosition - Position of the screen center.
      • afterDoApply

        protected void afterDoApply()
      • addPanToAnimator

        public void addPanToAnimator​(Position beginCenterPos,
                                     Position endCenterPos,
                                     Angle beginHeading,
                                     Angle endHeading,
                                     Angle beginPitch,
                                     Angle endPitch,
                                     double beginZoom,
                                     double endZoom,
                                     long timeToMove,
                                     boolean endCenterOnSurface)
      • addPanToAnimator

        public void addPanToAnimator​(Position beginCenterPos,
                                     Position endCenterPos,
                                     Angle beginHeading,
                                     Angle endHeading,
                                     Angle beginPitch,
                                     Angle endPitch,
                                     double beginZoom,
                                     double endZoom,
                                     boolean endCenterOnSurface)
      • addPanToAnimator

        public void addPanToAnimator​(Position centerPos,
                                     Angle heading,
                                     Angle pitch,
                                     double zoom,
                                     long timeToMove,
                                     boolean endCenterOnSurface)
      • addPanToAnimator

        public void addPanToAnimator​(Position centerPos,
                                     Angle heading,
                                     Angle pitch,
                                     double zoom,
                                     boolean endCenterOnSurface)
      • addPanToAnimator

        public void addPanToAnimator​(Position centerPos,
                                     Angle heading,
                                     Angle pitch,
                                     double zoom)
      • addEyePositionAnimator

        public void addEyePositionAnimator​(long timeToIterate,
                                           Position beginPosition,
                                           Position endPosition)
      • addHeadingAnimator

        public void addHeadingAnimator​(Angle begin,
                                       Angle end)
      • addPitchAnimator

        public void addPitchAnimator​(Angle begin,
                                     Angle end)
      • addHeadingPitchAnimator

        public void addHeadingPitchAnimator​(Angle beginHeading,
                                            Angle endHeading,
                                            Angle beginPitch,
                                            Angle endPitch)
      • addZoomAnimator

        public void addZoomAnimator​(double zoomStart,
                                    double zoomEnd)
      • addFlyToZoomAnimator

        public void addFlyToZoomAnimator​(Angle heading,
                                         Angle pitch,
                                         double zoomAmount)
      • addCenterAnimator

        public void addCenterAnimator​(Position begin,
                                      Position end,
                                      boolean smoothed)
      • addCenterAnimator

        public void addCenterAnimator​(Position begin,
                                      Position end,
                                      long lengthMillis,
                                      boolean smoothed)