2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
;
9 import gov
.nasa
.worldwind
.geom
.*;
13 * Provides the elevations of all points on a {@link Globe} . Every <code>Globe</code> has an elevation model
14 * implementing this interface.
16 * Elevations are organized by {@link Sector}. Elevation models return an {@link Elevations} object for requested
17 * sectors. This object is then used to query elevations at latitude/longitude positions within that sector.
19 * An <code>ElevationModel</code> typically approximates elevations at multiple levels of spatial resolution. For any
20 * given viewing position the model determines an appropriate target resolution. That target resolution may not be
21 * immediately achievable, however, because the corresponding elevation data might not be locally available and must be
22 * retrieved from a remote location. When this is the case, the <code>Elevations</code> object returned for a sector
23 * holds the resolution achievable with the data currently available. That resolution may not be the same as the target
24 * resolution. The target resolution and the actual resolution are made available in the interface so that users of this
25 * class may use the resolution values to compare previously computed elevation sectors with newly computed ones, and
26 * thereby enable effective caching of elevations computed for the sector.
30 * @version $Id: ElevationModel.java 2211 2007-07-03 22:15:13Z tgaskins $
32 public interface ElevationModel
extends WWObject
36 void setEnabled(boolean enable
);
39 * Returns the maximum elevation contained in the elevevation model. This value is the height of the highest point
42 * @return The maximum elevation of the model
44 double getMaximumElevation();
47 * Returns the minimum elevation contained in the elevevation model. This value is the height of the lowest point on
48 * the globe. It may be negative, indicating a value below mean surface level. (Sea level in the case of Earth.)
50 * @return The minimum elevation of the model
52 double getMinimumElevation();
55 * Computes and returns an {@link Elevations} object for the specified {@link Sector} and target resolution. If the
56 * target resolution can not currently be achieved, the best available elevations are returned.
58 * Implementing classes of <code>ElevationModel</code> interpret <code>resolution</code> in a class-specific way.
59 * See the descriptions of those classes to learn their use of this value. The elevations returned are in the form
60 * of an {@link Elevations} object. Specific elevations are returned by that object.
62 * @param sector the sector to return elevations for.
63 * @param resolution a value interpreted in a class-specific way by implementing classes.
64 * @return An object representing the elevations for the specified sector. Its resolution value will be either the
65 * specified resolution or the best available alternative.
67 Elevations
getElevations(Sector sector
, int resolution
);
70 * Returns the resolution appropriate to the given {@link Sector} and view parameters. The view parameters are read
71 * from the specified {@link DrawContext}. Implementing classes of <code>ElevationModel</code> interpret
72 * <code>resolution</code> in class-specific ways. See the descriptions of subclasses to learn their use of this
73 * value. This method is used to determine the resolution the model will use if all resources are available to
74 * compute that resolution. It is subsequently passed to {@link #getElevations(Sector, int)} when a sector's
75 * resolutions are queried.
77 * @param dc the draw context to read the view and rendering parameters from.
78 * @param sector the {@link Sector} to compute the target resolution for.
79 * @return The appropriate resolution for the sector and draw context values.
81 int getTargetResolution(DrawContext dc
, Sector sector
, int density
);
83 double getElevation(Angle latitude
, Angle longitude
);
85 Elevations
getBestElevations(Sector sector
);
87 Elevations
getElevationsAtResolution(Sector sector
, int resolution
);
90 * The <code>Elevations</code> interface provides elevations at specified latitude and longitude positions. Objects
91 * implementing this interface are created by {@link ElevationModel#getElevations(Sector, int)}.
93 public interface Elevations
96 * Indicates whether the object contains useful elevations. An <code>Elevations</code> instance may exist
97 * without holding any elevations. This can occur when the resources needed to determine elevations are not yet
98 * local. This method enables the detection of that case. Callers typically use it to avoid time-consuming
99 * computations that require valid elevations.
101 * @return <code>true</code> if a call to {@link #getElevation(double, double)} will return valid elevations,
102 * otherwise <code>false</code> indicating that the value 0 will always be returned from that method.
104 boolean hasElevations();
107 * Returns the elevation at a specific latitude and longitude, each specified in radians.
109 * @param latRadians the position's latitude in radians, in the range [-π/2, +π/2].
110 * @param lonRadians the position's longitude in radians, in the range [-π, +π].
111 * @return The elevation at the given position, or 0 if elevations are not available.
113 double getElevation(double latRadians
, double lonRadians
);
116 * Returns the resolution value of the elevations. The meaning and use of this value is defined by subclasses of
117 * <code>ElevationModel</code>.
119 * @return the resolution associated with <code>this</code>.
124 * Returns the {@link Sector} the elevations pertain to.
126 * @return The sector the elevations pertain to.