NASA World Wind

gov.nasa.worldwind.render.airspaces
Class AbstractAirspace

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.render.airspaces.AbstractAirspace
All Implemented Interfaces:
AVList, Movable, Airspace, Renderable, Restorable
Direct Known Subclasses:
Box, Cake, CappedCylinder, Curtain, Orbit, Polygon, SphereAirspace, TrackAirspace

public abstract class AbstractAirspace
extends AVListImpl
implements Airspace, Movable


Field Summary
protected static String ARC_SLICES
           
protected static String DISABLE_TERRAIN_CONFORMANCE
           
protected static String EXPIRY_TIME
           
protected static String GEOMETRY_CACHE_KEY
           
protected static String GEOMETRY_CACHE_NAME
           
protected static String GLOBE_KEY
           
protected static String LENGTH_SLICES
           
protected static String LOOPS
           
protected static String PILLARS
           
protected static String SLICES
           
protected static String SPLIT_THRESHOLD
           
protected static String STACKS
           
protected static String SUBDIVISIONS
           
protected static String VERTICAL_EXAGGERATION
           
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Fields inherited from interface gov.nasa.worldwind.render.airspaces.Airspace
DRAW_STYLE_FILL, DRAW_STYLE_OUTLINE
 
Constructor Summary
AbstractAirspace()
           
AbstractAirspace(AirspaceAttributes attributes)
           
 
Method Summary
protected  void addDetailLevels(Collection<DetailLevel> newDetailLevels)
           
protected  void clearElevationMap()
           
protected  Cylinder computeBoundingCylinder(DrawContext dc, Iterable<? extends LatLon> locations)
           
protected  DetailLevel computeDetailLevel(DrawContext dc)
           
protected  double computeElevationAt(DrawContext dc, Angle latitude, Angle longitude)
           
 Vec4 computePointFromPosition(DrawContext dc, Angle latitude, Angle longitude, double elevation, boolean terrainConformant)
           
protected  Position computeReferencePosition(List<? extends LatLon> locations, double[] altitudes)
           
protected  Sector[] computeSplitSectors(Iterable<? extends LatLon> locations)
          Returns two 'mirror' sectors each on one side of the longitude boundary - for boundary crossing shapes
protected abstract  Extent doComputeExtent(DrawContext dc)
           
protected  void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
           
protected  void doMoveTo(Position oldRef, Position newRef)
           
protected  void doRender(DrawContext dc)
           
protected  void doRenderExtent(DrawContext dc)
           
protected abstract  void doRenderGeometry(DrawContext dc, String drawStyle)
           
protected  void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
           
 double[] getAltitudes()
          Returns the altitude limits.
protected  double[] getAltitudes(double verticalExaggeration)
           
 AirspaceAttributes getAttributes()
           
 Iterable<DetailLevel> getDetailLevels()
           
protected  long[] getExpiryRange()
           
protected  long getExpiryTime()
           
 Extent getExtent(DrawContext dc)
           
protected  GeometryBuilder getGeometryBuilder()
           
protected  MemoryCache getGeometryCache()
           
protected  AirspaceRenderer getRenderer()
           
 String getRestorableState()
          Returns an XML document string describing the object’s state.
 boolean isAirspaceCollapsed()
           
 boolean isAirspaceVisible(DrawContext dc)
           
 boolean isEnableLevelOfDetail()
           
protected  boolean isExpired(DrawContext dc, Geometry geom)
           
protected  boolean isExtentOutOfDate()
           
 boolean[] isTerrainConforming()
          Returns the value of the terrain-conforming attribute.
 boolean isVisible()
           
 void move(Position position)
          Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
 void moveTo(Position position)
          Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
protected  long nextExpiryTime(DrawContext dc, boolean[] terrainConformance)
           
 void render(DrawContext dc)
          Causes this Renderable to render itself using the DrawContext provided.
 void renderExtent(DrawContext dc)
           
 void renderGeometry(DrawContext dc, String drawStyle)
           
 void restoreState(String stateInXml)
          Restores the object’s state to what is described in the specified XML document string.
 void setAltitude(double altitude)
           
 void setAltitudes(double lowerAltitude, double upperAltitude)
          Set the upper and lower altitude limits.
 void setAttributes(AirspaceAttributes attributes)
           
 void setDetailLevels(Collection<DetailLevel> detailLevels)
           
 void setEnableLevelOfDetail(boolean enableLevelOfDetail)
           
protected  void setExpiryRange(long minTimeMillis, long maxTimeMillis)
           
protected  void setExpiryTime(long timeMillis)
           
protected  void setExtentOutOfDate()
           
protected  void setGeometryBuilder(GeometryBuilder gb)
           
protected  void setRenderer(AirspaceRenderer renderer)
           
 void setTerrainConforming(boolean terrainConformant)
           
 void setTerrainConforming(boolean lowerTerrainConformant, boolean upperTerrainConformant)
          Sets the value of the terrain-conforming attribute.
 void setVisible(boolean visible)
           
protected  void updateExpiryCriteria(DrawContext dc, Geometry geom)
           
 
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
 
Methods inherited from interface gov.nasa.worldwind.Movable
getReferencePosition
 

Field Detail

ARC_SLICES

protected static final String ARC_SLICES
See Also:
Constant Field Values

DISABLE_TERRAIN_CONFORMANCE

protected static final String DISABLE_TERRAIN_CONFORMANCE
See Also:
Constant Field Values

EXPIRY_TIME

protected static final String EXPIRY_TIME
See Also:
Constant Field Values

GEOMETRY_CACHE_KEY

protected static final String GEOMETRY_CACHE_KEY

GEOMETRY_CACHE_NAME

protected static final String GEOMETRY_CACHE_NAME
See Also:
Constant Field Values

GLOBE_KEY

protected static final String GLOBE_KEY
See Also:
Constant Field Values

LENGTH_SLICES

protected static final String LENGTH_SLICES
See Also:
Constant Field Values

LOOPS

protected static final String LOOPS
See Also:
Constant Field Values

PILLARS

protected static final String PILLARS
See Also:
Constant Field Values

SLICES

protected static final String SLICES
See Also:
Constant Field Values

SPLIT_THRESHOLD

protected static final String SPLIT_THRESHOLD
See Also:
Constant Field Values

STACKS

protected static final String STACKS
See Also:
Constant Field Values

SUBDIVISIONS

protected static final String SUBDIVISIONS
See Also:
Constant Field Values

VERTICAL_EXAGGERATION

protected static final String VERTICAL_EXAGGERATION
See Also:
Constant Field Values
Constructor Detail

AbstractAirspace

public AbstractAirspace()

AbstractAirspace

public AbstractAirspace(AirspaceAttributes attributes)
Method Detail

addDetailLevels

protected void addDetailLevels(Collection<DetailLevel> newDetailLevels)

clearElevationMap

protected void clearElevationMap()

computeBoundingCylinder

protected Cylinder computeBoundingCylinder(DrawContext dc,
                                           Iterable<? extends LatLon> locations)

computeDetailLevel

protected DetailLevel computeDetailLevel(DrawContext dc)

computeElevationAt

protected double computeElevationAt(DrawContext dc,
                                    Angle latitude,
                                    Angle longitude)

computePointFromPosition

public Vec4 computePointFromPosition(DrawContext dc,
                                     Angle latitude,
                                     Angle longitude,
                                     double elevation,
                                     boolean terrainConformant)

computeReferencePosition

protected Position computeReferencePosition(List<? extends LatLon> locations,
                                            double[] altitudes)

computeSplitSectors

protected Sector[] computeSplitSectors(Iterable<? extends LatLon> locations)
Returns two 'mirror' sectors each on one side of the longitude boundary - for boundary crossing shapes

Parameters:
locations - the shape positions
Returns:
an array of two sectors representing the shape

doComputeExtent

protected abstract Extent doComputeExtent(DrawContext dc)

doGetRestorableState

protected void doGetRestorableState(RestorableSupport rs,
                                    RestorableSupport.StateObject context)

doMoveTo

protected void doMoveTo(Position oldRef,
                        Position newRef)

doRender

protected void doRender(DrawContext dc)

doRenderExtent

protected void doRenderExtent(DrawContext dc)

doRenderGeometry

protected abstract void doRenderGeometry(DrawContext dc,
                                         String drawStyle)

doRestoreState

protected void doRestoreState(RestorableSupport rs,
                              RestorableSupport.StateObject context)

getAltitudes

public double[] getAltitudes()
Returns the altitude limits.

Specified by:
getAltitudes in interface Airspace
Returns:
an array of two values indicating the lower and upper altitude limits, respectively.

getAltitudes

protected double[] getAltitudes(double verticalExaggeration)

getAttributes

public AirspaceAttributes getAttributes()
Specified by:
getAttributes in interface Airspace

getDetailLevels

public Iterable<DetailLevel> getDetailLevels()
Specified by:
getDetailLevels in interface Airspace

getExpiryRange

protected long[] getExpiryRange()

getExpiryTime

protected long getExpiryTime()

getExtent

public Extent getExtent(DrawContext dc)
Specified by:
getExtent in interface Airspace

getGeometryBuilder

protected GeometryBuilder getGeometryBuilder()

getGeometryCache

protected MemoryCache getGeometryCache()

getRenderer

protected AirspaceRenderer getRenderer()

getRestorableState

public String getRestorableState()
Description copied from interface: Restorable
Returns an XML document string describing the object’s state. This state can be restored later by calling restoreState and passing the XML document.

Specified by:
getRestorableState in interface Restorable
Returns:
an XML document string describing the object's state.

isAirspaceCollapsed

public boolean isAirspaceCollapsed()

isAirspaceVisible

public boolean isAirspaceVisible(DrawContext dc)
Specified by:
isAirspaceVisible in interface Airspace

isEnableLevelOfDetail

public boolean isEnableLevelOfDetail()
Specified by:
isEnableLevelOfDetail in interface Airspace

isExpired

protected boolean isExpired(DrawContext dc,
                            Geometry geom)

isExtentOutOfDate

protected boolean isExtentOutOfDate()

isTerrainConforming

public boolean[] isTerrainConforming()
Returns the value of the terrain-conforming attribute.

Specified by:
isTerrainConforming in interface Airspace
Returns:
the value of the terrain-conforming attribute. A valud of true indicates the object is terrain-conforming, a value of false indicates that it's not.

isVisible

public boolean isVisible()
Specified by:
isVisible in interface Airspace

move

public void move(Position position)
Description copied from interface: Movable
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Specified by:
move in interface Movable
Parameters:
position - the latitude and longitude to add to the shape's reference position.

moveTo

public void moveTo(Position position)
Description copied from interface: Movable
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Specified by:
moveTo in interface Movable
Parameters:
position - the new position of the shape's reference position.

nextExpiryTime

protected long nextExpiryTime(DrawContext dc,
                              boolean[] terrainConformance)

render

public void render(DrawContext dc)
Description copied from interface: Renderable
Causes this Renderable to render itself using the DrawContext provided. The DrawContext provides the elevation model, openGl instance, globe and other information required for drawing. It is recommended that the DrawContext is non-null as most implementations do not support null DrawContexts.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

renderExtent

public void renderExtent(DrawContext dc)
Specified by:
renderExtent in interface Airspace

renderGeometry

public void renderGeometry(DrawContext dc,
                           String drawStyle)
Specified by:
renderGeometry in interface Airspace

restoreState

public void restoreState(String stateInXml)
Description copied from interface: Restorable
Restores the object’s state to what is described in the specified XML document string.

Specified by:
restoreState in interface Restorable
Parameters:
stateInXml - an XML document string describing an object's state.

setAltitude

public void setAltitude(double altitude)
Specified by:
setAltitude in interface Airspace

setAltitudes

public void setAltitudes(double lowerAltitude,
                         double upperAltitude)
Set the upper and lower altitude limits.

Specified by:
setAltitudes in interface Airspace
Parameters:
lowerAltitude - the lower altitude limit, in meters relative to mean sea level
upperAltitude - the upper altitude limit, in meters relative to mean sea level

setAttributes

public void setAttributes(AirspaceAttributes attributes)
Specified by:
setAttributes in interface Airspace

setDetailLevels

public void setDetailLevels(Collection<DetailLevel> detailLevels)
Specified by:
setDetailLevels in interface Airspace

setEnableLevelOfDetail

public void setEnableLevelOfDetail(boolean enableLevelOfDetail)
Specified by:
setEnableLevelOfDetail in interface Airspace

setExpiryRange

protected void setExpiryRange(long minTimeMillis,
                              long maxTimeMillis)

setExpiryTime

protected void setExpiryTime(long timeMillis)

setExtentOutOfDate

protected void setExtentOutOfDate()

setGeometryBuilder

protected void setGeometryBuilder(GeometryBuilder gb)

setRenderer

protected void setRenderer(AirspaceRenderer renderer)

setTerrainConforming

public void setTerrainConforming(boolean terrainConformant)
Specified by:
setTerrainConforming in interface Airspace

setTerrainConforming

public void setTerrainConforming(boolean lowerTerrainConformant,
                                 boolean upperTerrainConformant)
Sets the value of the terrain-conforming attribute.

Specified by:
setTerrainConforming in interface Airspace
Parameters:
lowerTerrainConformant - the value of the lower altitude terrain-conforming attribute. A value of true indicates the object's lower altitude is terrain-conforming, a value of false indicates that it's not.
upperTerrainConformant - the value of the upper altitude terrain-conforming attribute. A value of true indicates the object's upper altitude is terrain-conforming, a value of false indicates that it's not.

setVisible

public void setVisible(boolean visible)
Specified by:
setVisible in interface Airspace

updateExpiryCriteria

protected void updateExpiryCriteria(DrawContext dc,
                                    Geometry geom)

NASA World Wind