NASA World Wind

gov.nasa.worldwind.render.airspaces
Class Cake

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.render.airspaces.AbstractAirspace
          extended by gov.nasa.worldwind.render.airspaces.Cake
All Implemented Interfaces:
AVList, ExtentHolder, Movable, Airspace, Renderable, Restorable

public class Cake
extends AbstractAirspace

A cake consists of mutiple adjacent cylinder segments. Each cylinder is defined by its center location in latitude longitude, its radius in meters, and two aziumths specifying the active circumferential portion of the cylinder. Cake segments are altitude-limited shapes and therefore have an associated minimum and maximum altitude.


Nested Class Summary
static class Cake.Layer
          An inner class of Cake defining the parameters of one of the cake's cylinders.
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
AbstractAirspace.AirspaceInfo
 
Field Summary
 
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
 
Fields inherited from interface gov.nasa.worldwind.render.airspaces.Airspace
DRAW_STYLE_FILL, DRAW_STYLE_OUTLINE
 
Constructor Summary
Cake()
           
Cake(AirspaceAttributes attributes)
           
Cake(Collection<Cake.Layer> layers)
           
 
Method Summary
protected  void addLayers(Iterable<Cake.Layer> newLayers)
           
protected  Extent computeExtent(Globe globe, double verticalExaggeration)
           
protected  List<Vec4> computeMinimalGeometry(Globe globe, double verticalExaggeration)
           
protected  void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
           
protected  void doMoveTo(Position oldRef, Position newRef)
           
 void doRenderExtent(DrawContext dc)
           
protected  void doRenderGeometry(DrawContext dc, String drawStyle)
           
protected  void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
           
 List<Cake.Layer> getLayers()
          Returns the partial cylinders comprising the shape.
 Position getReferencePosition()
          A position associated with the object that indicates its aggregate geographic position.
 boolean isAirspaceVisible(DrawContext dc)
          Test if this airspace is visible in the specified draw context.
 void makeOrderedRenderable(DrawContext dc, AirspaceRenderer renderer)
           
 void setEnableCaps(boolean enable)
           
 void setLayers(Collection<Cake.Layer> layers)
          Set the partial cylinders comprising the shape.
 void setTerrainConforming(boolean lowerTerrainConformant, boolean upperTerrainConformant)
          Sets the altitude datum, which indicates whether airspace altitudes are relative to mean sea level, ground level or a single ground reference location.
 
Methods inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
addDetailLevels, adjustForGroundReference, clearElevationMap, computeDetailLevel, computeElevationAt, computeExtent, computeEyeDistance, computeMinimalGeometry, computePointFromPosition, computeReferencePosition, doRender, getAirspaceInfo, getAltitudeDatum, getAltitudes, getAltitudes, getAttributes, getDetailLevels, getExpiryRange, getExpiryTime, getExtent, getExtent, getGeometryBuilder, getGeometryCache, getGroundReference, getRenderer, getRestorableState, isAirspaceCollapsed, isEnableLevelOfDetail, isExpired, isTerrainConforming, isVisible, makeExtremePoints, move, moveTo, nextExpiryTime, render, renderExtent, renderGeometry, restoreState, setAltitude, setAltitudeDatum, setAltitudes, setAttributes, setDetailLevels, setEnableLevelOfDetail, setExpiryRange, setExpiryTime, setExtentOutOfDate, setGeometryBuilder, setGroundReference, setRenderer, 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
 

Constructor Detail

Cake

public Cake()

Cake

public Cake(AirspaceAttributes attributes)

Cake

public Cake(Collection<Cake.Layer> layers)
Method Detail

addLayers

protected void addLayers(Iterable<Cake.Layer> newLayers)

computeExtent

protected Extent computeExtent(Globe globe,
                               double verticalExaggeration)
Specified by:
computeExtent 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

doRenderExtent

public void doRenderExtent(DrawContext dc)
Overrides:
doRenderExtent 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

getLayers

public List<Cake.Layer> getLayers()
Returns the partial cylinders comprising the shape.

Returns:
the cylinders comprising the shape, or an empty list if the shape contains no layers.

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.

isAirspaceVisible

public boolean isAirspaceVisible(DrawContext dc)
Description copied from class: AbstractAirspace
Test if this airspace is visible in the specified draw context. During picking mode, this tests intersection against all of the draw context's pick frustums. During rendering mode, this tests intersection against the draw context's viewing frustum.

Specified by:
isAirspaceVisible in interface Airspace
Overrides:
isAirspaceVisible in class AbstractAirspace
Parameters:
dc - the draw context the airspace is related to.
Returns:
true if this airspace is visible; false otherwise.

makeOrderedRenderable

public void makeOrderedRenderable(DrawContext dc,
                                  AirspaceRenderer renderer)
Specified by:
makeOrderedRenderable in interface Airspace
Overrides:
makeOrderedRenderable in class AbstractAirspace

setEnableCaps

public void setEnableCaps(boolean enable)

setLayers

public void setLayers(Collection<Cake.Layer> layers)
Set the partial cylinders comprising the shape.

Parameters:
layers - the cylinders comprising the shape. May be an empty list.
Throws:
IllegalArgumentException - if the list reference is null.

setTerrainConforming

public void setTerrainConforming(boolean lowerTerrainConformant,
                                 boolean upperTerrainConformant)
Description copied from interface: Airspace
Sets the altitude datum, which indicates whether airspace altitudes are relative to mean sea level, ground level or a single ground reference location. The datum is normally set via Airspace.setAltitudeDatum(String, String), but this method is provided for backwards compatibility with the means of originally setting the datum. See the argument descriptions below for the mapping of the boolean values of this method to the altitude-datum values.

Specified by:
setTerrainConforming in interface Airspace
Overrides:
setTerrainConforming in class AbstractAirspace
Parameters:
lowerTerrainConformant - the lower altitude datum. A value of true indicates a lower altitude datum of AVKey.ABOVE_GROUND_LEVEL (terrain conforming), a value of false indicates a lower altitude datum of {link AVKey#ABOVE_MEAN_SEA_LEVEL} (not terrain conforming). the terrain-conforming, a value of false indicates that it's not.
upperTerrainConformant - the upper altitude datum. A value of true indicates an upper altitude datum of AVKey.ABOVE_GROUND_LEVEL (terrain conforming), a value of false indicates an upper altitude datum of {link AVKey#ABOVE_MEAN_SEA_LEVEL} (not terrain conforming. the terrain-conforming, a value of false indicates that it's not.
See Also:
Airspace.setAltitudeDatum(String, String)

NASA World Wind