gov.nasa.worldwind.render.airspaces
Class SphereAirspace
java.lang.Object
gov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.render.airspaces.AbstractAirspace
gov.nasa.worldwind.render.airspaces.SphereAirspace
- All Implemented Interfaces:
- AVList, ExtentHolder, Movable, Airspace, Renderable, Restorable
public class SphereAirspace
- extends AbstractAirspace
A spherical airspace shape defined by a center location and a radius. The sphere's center altitude and terrain
conformance attributes are taken from the lower altitude and lower terrain conformance. When terrain conformance is
disabled, the sphere's altitude behaves as a height above mean sea level. When terrain conformance is enabled, the
sphere's altitude will behave as a height offset above the terrain. Unlike other airspace shapes, the sphere's
geometry will not morph to the terrain beneath it.
| Fields inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace |
airspaceInfo, ARC_SLICES, DISABLE_TERRAIN_CONFORMANCE, EXPIRY_TIME, GEOMETRY_CACHE_KEY, GEOMETRY_CACHE_NAME, GLOBE_KEY, LENGTH_SLICES, LOOPS, PILLARS, SLICES, SPLIT_THRESHOLD, STACKS, SUBDIVISIONS, VERTICAL_EXAGGERATION |
| Methods inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace |
addDetailLevels, adjustForGroundReference, clearElevationMap, computeDetailLevel, computeElevationAt, computeMinimalGeometry, computePointFromPosition, computeReferencePosition, doRender, doRenderExtent, getAirspaceInfo, getAltitudeDatum, getAltitudes, getAltitudes, getAttributes, getDetailLevels, getExpiryRange, getExpiryTime, getExtent, getGeometryBuilder, getGeometryCache, getGroundReference, getRenderer, getRestorableState, isAirspaceCollapsed, isAirspaceVisible, isEnableLevelOfDetail, isExpired, isTerrainConforming, isVisible, makeExtremePoints, makeOrderedRenderable, move, moveTo, nextExpiryTime, render, renderExtent, renderGeometry, restoreState, setAltitude, setAltitudeDatum, setAltitudes, setAttributes, setDetailLevels, setEnableLevelOfDetail, setExpiryRange, setExpiryTime, setExtentOutOfDate, setGeometryBuilder, setGroundReference, setRenderer, setTerrainConforming, setTerrainConforming, setVisible, updateExpiryCriteria |
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, 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 |
DEFAULT_SUBDIVISIONS
protected static final int DEFAULT_SUBDIVISIONS
- See Also:
- Constant Field Values
SphereAirspace
public SphereAirspace()
SphereAirspace
public SphereAirspace(AirspaceAttributes attributes)
SphereAirspace
public SphereAirspace(LatLon location,
double radius)
computeExtent
protected Sphere computeExtent(DrawContext dc)
- Overrides:
computeExtent in class AbstractAirspace
computeExtent
protected Extent computeExtent(Globe globe,
double verticalExaggeration)
- Specified by:
computeExtent in class AbstractAirspace
computeEyeDistance
protected double computeEyeDistance(DrawContext dc)
- Overrides:
computeEyeDistance in class AbstractAirspace
computeMinimalGeometry
protected List<Vec4> computeMinimalGeometry(Globe globe,
double verticalExaggeration)
- Specified by:
computeMinimalGeometry in class AbstractAirspace
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs,
RestorableSupport.StateObject context)
- Overrides:
doGetRestorableState in class AbstractAirspace
doMoveTo
protected void doMoveTo(Position oldRef,
Position newRef)
- Overrides:
doMoveTo in class AbstractAirspace
doRenderGeometry
protected void doRenderGeometry(DrawContext dc,
String drawStyle)
- Specified by:
doRenderGeometry in class AbstractAirspace
doRestoreState
protected void doRestoreState(RestorableSupport rs,
RestorableSupport.StateObject context)
- Overrides:
doRestoreState in class AbstractAirspace
drawSphere
protected void drawSphere(DrawContext dc)
drawUnitSphere
protected void drawUnitSphere(DrawContext dc,
int subdivisions)
getExtent
public Extent getExtent(DrawContext dc)
- Returns this SphereAirspace's
Extent for the specified DrawContext. This
overrides AbstractAirspace.getExtent(gov.nasa.worldwind.render.DrawContext)
in order to bypass the superclass' extent caching. Unlike other Airspace's Extents, SphereAirspace's Extent is a
perfect fitting Sphere, who's center point depends on the current surface
geometry. For this reason SphereAirspace's exact bounding volume can be easily computed, and should not be
cached.
- Specified by:
getExtent in interface Airspace- Overrides:
getExtent in class AbstractAirspace
- Parameters:
dc - the current DrawContext.
- Returns:
- this SphereAirspace's Extent in model coordinates.
- Throws:
IllegalArgumentException - if the DrawContext is null, or if the Globe held by the DrawContext is null.
getLocation
public LatLon getLocation()
- Returns the center location of the sphere.
- Returns:
- location of the sphere.
getRadius
public double getRadius()
- Returns the radius of the sphere in meters.
- Returns:
- radius of the sphere in meters.
getReferencePosition
public Position getReferencePosition()
- Description copied from interface:
Movable
- A position associated with the object that indicates its aggregate geographic position. The chosen position
varies among implementers of this interface. For objects defined by a list of positions, the reference position
is typically the first position in the list. For symmetric objects the reference position is often the center of
the object. In many cases the object's reference position may be explicitly specified by the application.
- Returns:
- the object's reference position, or null if no reference position is available.
getSubdivisions
protected int getSubdivisions()
makeSphere
protected void makeSphere(double radius,
int subdivisions,
Geometry dest)
setLocation
public void setLocation(LatLon location)
- Sets the center location of the sphere.
- Parameters:
location - the location of the sphere.
- Throws:
IllegalArgumentException - if location is null
setRadius
public void setRadius(double radius)
- Sets the radius of the sphere in meters. This will also set the altitude limits to match the new radius and
center elevation.
- Parameters:
radius - the radius of the sphere.
- Throws:
IllegalArgumentException - if radius is less than zero
setSubdivisions
protected void setSubdivisions(int subdivisions)