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, 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 |
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, clearElevationMap, computeBoundingCylinder, computeDetailLevel, computeElevationAt, computePointFromPosition, computeReferencePosition, computeSplitSectors, doRender, doRenderExtent, getAltitudes, getAltitudes, getAttributes, getDetailLevels, getExpiryRange, getExpiryTime, getExtent, getGeometryBuilder, getGeometryCache, getRenderer, getRestorableState, isAirspaceCollapsed, isAirspaceVisible, isEnableLevelOfDetail, isExpired, isExtentOutOfDate, isTerrainConforming, isVisible, move, moveTo, nextExpiryTime, render, renderExtent, renderGeometry, restoreState, setAltitude, setAltitudes, setAttributes, setDetailLevels, setEnableLevelOfDetail, setExpiryRange, setExpiryTime, setExtentOutOfDate, setGeometryBuilder, setRenderer, setTerrainConforming, setTerrainConforming, setVisible, updateExpiryCriteria |
| 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 |
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)
doComputeExtent
protected Extent doComputeExtent(DrawContext dc)
- Specified by:
doComputeExtent 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)
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()
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)