Interface Terrain

  • All Known Implementing Classes:
    HighResolutionTerrain

    public interface Terrain
    Provides operations on the best available terrain. Operations such as line/terrain intersection and surface point computation use the highest resolution terrain data available from the globe's elevation model. Because the best available data may not be available when the operations are performed, the operations block while they retrieve the required data from either the local disk cache or a remote server. A timeout may be specified to limit the amount of time allowed for retrieving data. Operations fail if the timeout is exceeded.
    • Method Detail

      • getGlobe

        Globe getGlobe()
        Returns the object's globe.
        Returns:
        the globe specified to the constructor.
      • getVerticalExaggeration

        double getVerticalExaggeration()
      • getSurfacePoint

        Vec4 getSurfacePoint​(Position position)
        Computes the Cartesian, model-coordinate point of a position on the terrain.

        This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

        Parameters:
        position - the position.
        Returns:
        the Cartesian, model-coordinate point of the specified position, or null if the specified position does not exist within this instance's sector or if the operation is interrupted.
        Throws:
        java.lang.IllegalArgumentException - if the position is null.
        WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
        WWRuntimeException - if the operation is interrupted.
      • getSurfacePoint

        Vec4 getSurfacePoint​(Angle latitude,
                             Angle longitude,
                             double metersOffset)
        Computes the Cartesian, model-coordinate point of a location on the terrain.

        This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

        Parameters:
        latitude - the location's latitude.
        longitude - the location's longitude.
        metersOffset - the location's distance above the terrain.
        Returns:
        the Cartesian, model-coordinate point of the specified location, or null if the specified location does not exist within this instance's sector or if the operation is interrupted.
        Throws:
        java.lang.IllegalArgumentException - if the latitude or longitude are null.
        WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
        WWRuntimeException - if the operation is interrupted.
      • intersect

        Intersection[] intersect​(Position pA,
                                 Position pB)
        Computes the intersections of a line with the terrain. The line is specified by two positions whose altitude field indicates the height above the terrain (not the altitude relative to sea level). All intersection points are returned.

        This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

        Parameters:
        pA - the line's first position.
        pB - the line's second position.
        Returns:
        an array of Cartesian model-coordinate intersection points, or null if no intersections occur or the operation is interrupted.
        Throws:
        java.lang.IllegalArgumentException - if either position is null.
        WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
        WWRuntimeException - if the operation is interrupted.
      • intersect

        Intersection[] intersect​(Position pA,
                                 Position pB,
                                 int altitudeMode)
        Computes the intersections of a line with the terrain. The line is specified by two positions whose altitude field is interpreted according to the specified altitude mode. All intersection points are returned.

        This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

        Parameters:
        pA - the line's first position.
        pB - the line's second position.
        altitudeMode - the altitude mode indicating the reference for the altitudes in the specified positions.
        Returns:
        an array of Cartesian model-coordinate intersection points, or null if no intersections occur or the operation is interrupted.
        Throws:
        java.lang.IllegalArgumentException - if either position is null.
        WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
        WWRuntimeException - if the operation is interrupted.
      • getElevation

        java.lang.Double getElevation​(LatLon location)
        Computes the elevation at a specified location.

        This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

        Parameters:
        location - the location at which to compute the elevation.
        Returns:
        the elevation at the location, or null if the elevation could not be determined.
        Throws:
        java.lang.IllegalArgumentException - if the specified location in null.
        WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
        WWRuntimeException - if the operation is interrupted.