gov.nasa.worldwind.globes
Class BasicElevationModel
java.lang.Object
gov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.globes.BasicElevationModel
- All Implemented Interfaces:
- AVList, ElevationModel, WWObject, PropertyChangeListener, EventListener
- Direct Known Subclasses:
- EarthElevationModel, MarsElevationModel, MoonElevationModel
public class BasicElevationModel
- extends WWObjectImpl
- implements ElevationModel
This class represents a single tile in the data set and contains the information that needs to be cached.
|
Method Summary |
Double |
getBestElevation(Angle latitude,
Angle longitude)
|
ElevationModel.Elevations |
getBestElevations(Sector sector)
|
double |
getElevation(Angle latitude,
Angle longitude)
|
Double |
getElevationAtResolution(Angle latitude,
Angle longitude,
int resolution)
|
ElevationModel.Elevations |
getElevations(Sector sector,
int resolution)
Computes and returns an ElevationModel.Elevations object for the specified Sector and target resolution. |
ElevationModel.Elevations |
getElevationsAtResolution(Sector sector,
int resolution)
|
LevelSet |
getLevels()
|
double |
getMaxElevation()
Returns the maximum elevation contained in the elevevation model. |
double[] |
getMinAndMaxElevations(Sector sector)
|
double |
getMinElevation()
Returns the minimum elevation contained in the elevevation model. |
long |
getNumExpectedValuesPerTile()
|
int |
getTargetResolution(DrawContext dc,
Sector sector,
int density)
Returns the resolution appropriate to the given Sector and view parameters. |
int |
getTargetResolution(Globe globe,
double size)
|
int |
getTileCount(Sector sector,
int resolution)
|
int |
getTileCountAtResolution(Sector sector,
int resolution)
|
boolean |
isEnabled()
|
protected void |
loadExtremeElevations(String extremesFileName)
|
void |
setEnabled(boolean enabled)
|
void |
setNumExpectedValuesPerTile(long numExpectedValues)
|
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
BasicElevationModel
public BasicElevationModel(LevelSet levels,
double minElevation,
double maxElevation)
- Parameters:
levels - minElevation - maxElevation -
- Throws:
IllegalArgumentException - if levels is null or invalid
getBestElevation
public Double getBestElevation(Angle latitude,
Angle longitude)
- Specified by:
getBestElevation in interface ElevationModel
getBestElevations
public final ElevationModel.Elevations getBestElevations(Sector sector)
- Specified by:
getBestElevations in interface ElevationModel
getElevation
public final double getElevation(Angle latitude,
Angle longitude)
- Specified by:
getElevation in interface ElevationModel
- Parameters:
latitude - longitude -
- Returns:
-
- Throws:
IllegalArgumentException - if latitude or longitude is null
getElevationAtResolution
public Double getElevationAtResolution(Angle latitude,
Angle longitude,
int resolution)
- Specified by:
getElevationAtResolution in interface ElevationModel
getElevations
public final ElevationModel.Elevations getElevations(Sector sector,
int resolution)
- Description copied from interface:
ElevationModel
- Computes and returns an
ElevationModel.Elevations object for the specified Sector and target resolution. If the
target resolution can not currently be achieved, the best available elevations are returned.
Implementing classes of ElevationModel interpret resolution in a class-specific way.
See the descriptions of those classes to learn their use of this value. The elevations returned are in the form
of an ElevationModel.Elevations object. Specific elevations are returned by that object.
- Specified by:
getElevations in interface ElevationModel
- Parameters:
sector - resolution -
- Returns:
-
- Throws:
IllegalArgumentException - if sector is null
getElevationsAtResolution
public final ElevationModel.Elevations getElevationsAtResolution(Sector sector,
int resolution)
- Specified by:
getElevationsAtResolution in interface ElevationModel
getLevels
public LevelSet getLevels()
getMaxElevation
public final double getMaxElevation()
- Description copied from interface:
ElevationModel
- Returns the maximum elevation contained in the elevevation model. This value is the height of the highest point
on the globe.
- Specified by:
getMaxElevation in interface ElevationModel
- Returns:
- The maximum elevation of the model
getMinAndMaxElevations
public double[] getMinAndMaxElevations(Sector sector)
- Specified by:
getMinAndMaxElevations in interface ElevationModel
getMinElevation
public final double getMinElevation()
- Description copied from interface:
ElevationModel
- Returns the minimum elevation contained in the elevevation model. This value is the height of the lowest point on
the globe. It may be negative, indicating a value below mean surface level. (Sea level in the case of Earth.)
- Specified by:
getMinElevation in interface ElevationModel
- Returns:
- The minimum elevation of the model
getNumExpectedValuesPerTile
public long getNumExpectedValuesPerTile()
getTargetResolution
public final int getTargetResolution(DrawContext dc,
Sector sector,
int density)
- Description copied from interface:
ElevationModel
- Returns the resolution appropriate to the given
Sector and view parameters. The view parameters are read
from the specified DrawContext. Implementing classes of ElevationModel interpret
resolution in class-specific ways. See the descriptions of subclasses to learn their use of this
value. This method is used to determine the resolution the model will use if all resources are available to
compute that resolution. It is subsequently passed to ElevationModel.getElevations(Sector, int) when a sector's
resolutions are queried.
- Specified by:
getTargetResolution in interface ElevationModel
- Parameters:
dc - sector - density -
- Returns:
-
- Throws:
IllegalArgumentException - if dc is null, sector is null or density is
negative
getTargetResolution
public final int getTargetResolution(Globe globe,
double size)
- Specified by:
getTargetResolution in interface ElevationModel
getTileCount
public final int getTileCount(Sector sector,
int resolution)
getTileCountAtResolution
public final int getTileCountAtResolution(Sector sector,
int resolution)
- Specified by:
getTileCountAtResolution in interface ElevationModel
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled in interface ElevationModel
loadExtremeElevations
protected void loadExtremeElevations(String extremesFileName)
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled in interface ElevationModel
setNumExpectedValuesPerTile
public void setNumExpectedValuesPerTile(long numExpectedValues)