Class AbstractAirspace
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.airspaces.AbstractAirspace
-
- All Implemented Interfaces:
AVList
,Draggable
,MessageListener
,ExtentHolder
,Movable
,Movable2
,Airspace
,Attributable
,Highlightable
,OrderedRenderable
,PreRenderable
,Renderable
,Restorable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
Box
,Cake
,CappedCylinder
,CappedEllipticalCylinder
,Curtain
,Orbit
,Polygon
,SphereAirspace
,TrackAirspace
public abstract class AbstractAirspace extends WWObjectImpl implements Airspace, OrderedRenderable, PreRenderable, Movable, Movable2, Draggable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractAirspace.AirspaceInfo
-
Field Summary
Fields Modifier and Type Field Description protected AirspaceAttributes
activeAttributes
protected java.util.HashMap<GlobeStateKey,AbstractAirspace.AirspaceInfo>
airspaceInfo
protected boolean
alwaysOnTop
protected static java.lang.String
ARC_SLICES
protected AirspaceAttributes
attributes
protected AbstractAirspace.AirspaceInfo
currentInfo
protected static Material
DEFAULT_HIGHLIGHT_MATERIAL
The default highlight color.protected static Material
DEFAULT_INTERIOR_MATERIAL
The default interior color.protected static Material
DEFAULT_OUTLINE_MATERIAL
The default outline color.protected static int
DEFAULT_OUTLINE_PICK_WIDTH
The default outline pick width.protected static AirspaceAttributes
defaultAttributes
The attributes used if attributes are not specified.protected java.lang.Object
delegateOwner
protected java.util.Collection<DetailLevel>
detailLevels
protected static java.lang.String
DISABLE_TERRAIN_CONFORMANCE
protected boolean
dragEnabled
protected DraggableSupport
draggableSupport
protected boolean
drawSurfaceShape
protected java.util.Map<LatLon,java.lang.Double>
elevationMap
protected boolean
enableBatchPicking
protected boolean
enableBatchRendering
protected boolean
enableDepthOffset
protected boolean
enableLevelOfDetail
protected static java.lang.String
EXPIRY_TIME
protected long
expiryTime
protected long
frameTimeStamp
protected static java.lang.String
GEOMETRY_CACHE_KEY
protected static java.lang.String
GEOMETRY_CACHE_NAME
protected GeometryBuilder
geometryBuilder
protected static java.lang.String
GLOBE_KEY
protected LatLon
groundReference
protected AirspaceAttributes
highlightAttributes
protected boolean
highlighted
protected static java.lang.String
LENGTH_SLICES
protected static java.lang.String
LOOPS
protected double
lowerAltitude
protected java.lang.String
lowerAltitudeDatum
protected boolean
lowerTerrainConforming
protected long
maxExpiryTime
protected long
minExpiryTime
protected boolean
mustRegenerateSurfaceShape
protected int
outlinePickWidth
protected OutlinedShape
outlineShapeRenderer
protected Layer
pickLayer
protected PickSupport
pickSupport
protected static java.lang.String
PILLARS
protected static java.util.Random
rand
protected static java.lang.String
SLICES
protected static java.lang.String
SPLIT_THRESHOLD
protected static java.lang.String
STACKS
protected static java.lang.String
SUBDIVISIONS
protected SurfaceShape
surfaceShape
protected double
upperAltitude
protected java.lang.String
upperAltitudeDatum
protected boolean
upperTerrainConforming
protected static java.lang.String
VERTICAL_EXAGGERATION
protected boolean
visible
-
Fields inherited from interface gov.nasa.worldwind.render.airspaces.Airspace
DRAW_STYLE_FILL, DRAW_STYLE_OUTLINE
-
-
Constructor Summary
Constructors Constructor Description AbstractAirspace()
AbstractAirspace(AbstractAirspace source)
AbstractAirspace(AirspaceAttributes attributes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addDetailLevels(java.util.Collection<DetailLevel> newDetailLevels)
protected void
adjustForGroundReference(DrawContext dc, boolean[] terrainConformant, double[] altitudes, LatLon groundRef)
protected void
beginRendering(DrawContext dc)
protected void
clearElevationMap()
protected DetailLevel
computeDetailLevel(DrawContext dc)
protected double
computeElevationAt(DrawContext dc, Angle latitude, Angle longitude)
protected abstract Extent
computeExtent(Globe globe, double verticalExaggeration)
protected Extent
computeExtent(DrawContext dc)
protected double
computeEyeDistance(DrawContext dc)
protected abstract java.util.List<Vec4>
computeMinimalGeometry(Globe globe, double verticalExaggeration)
protected java.util.List<Vec4>
computeMinimalGeometry(DrawContext dc)
Vec4
computePointFromPosition(DrawContext dc, Angle latitude, Angle longitude, double elevation, boolean terrainConformant)
protected Position
computeReferencePosition(java.util.List<? extends LatLon> locations, double[] altitudes)
protected PickedObject
createPickedObject(int colorCode)
protected SurfaceShape
createSurfaceShape()
Returns aSurfaceShape
that corresponds to this Airspace and is used for drawing on 2D globes.protected void
determineActiveAttributes(DrawContext dc)
Determines which attributes -- normal, highlight or default -- to use each frame.protected void
doDrag(DragContext dragContext)
protected void
doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidates)
protected void
doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void
doMoveTo(Position oldRef, Position newRef)
protected void
doMoveTo(Globe globe, Position oldRef, Position newRef)
protected abstract void
doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
protected void
doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
void
drag(DragContext dragContext)
Drag the object given the providedDragContext
.protected void
drawBatched(DrawContext dc)
protected void
drawGeometry(DrawContext dc, Geometry indices, Geometry vertices)
protected void
drawInterior(DrawContext dc)
protected void
drawOrderedRenderable(DrawContext dc)
protected void
drawOutline(DrawContext dc)
protected void
endRendering(DrawContext dc)
AirspaceAttributes
getActiveAttributes()
Returns this shape's currently active attributes, as determined during the most recent call todetermineActiveAttributes(gov.nasa.worldwind.render.DrawContext)
.protected AbstractAirspace.AirspaceInfo
getAirspaceInfo(DrawContext dc)
java.lang.String[]
getAltitudeDatum()
Returns the current altitude datum of the airspace's lower and upper surfaces.double[]
getAltitudes()
Returns the current airspace surface altitudes.protected double[]
getAltitudes(double verticalExaggeration)
AirspaceAttributes
getAttributes()
Return the shape's current attributes.java.lang.Object
getDelegateOwner()
java.lang.Iterable<DetailLevel>
getDetailLevels()
double
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point.protected long[]
getExpiryRange()
protected long
getExpiryTime()
Extent
getExtent(Globe globe, double verticalExaggeration)
Returns this Airspace's enclosing volume as anExtent
in model coordinates, given a specifiedGlobe
and vertical exaggeration (seeSceneController.getVerticalExaggeration()
.Extent
getExtent(DrawContext dc)
Returns this Airspace's enclosing volume as anExtent
in model coordinates, given a specifiedDrawContext
.protected GeometryBuilder
getGeometryBuilder()
protected MemoryCache
getGeometryCache()
LatLon
getGroundReference()
Returns the current ground reference location.AirspaceAttributes
getHighlightAttributes()
Returns this shape's highlight attributes.int
getOutlinePickWidth()
Indicates the outline line width to use during picking.java.lang.String
getRestorableState()
Returns an XML document string describing the object's state.protected void
invalidateAirspaceData()
boolean
isAirspaceCollapsed()
boolean
isAirspaceVisible(DrawContext dc)
Test if this airspace is visible in the specified draw context.boolean
isAlwaysOnTop()
Indicates the state of this airspace's always-on-top flag.boolean
isDragEnabled()
Indicates whether the object is enabled for dragging.boolean
isDrawSurfaceShape()
Indicates whether this surface shape is always drawn flat and on the surface.boolean
isEnableBatchPicking()
Indicates whether batch picking is enabled.boolean
isEnableBatchRendering()
Indicates whether batch rendering is enabled for the concrete shape type of this shape.boolean
isEnableDepthOffset()
Indicates whether the filled sides of this shape should be offset towards the viewer to help eliminate artifacts when two or more faces of this or other filled shapes are coincident.boolean
isEnableLevelOfDetail()
protected boolean
isExpired(DrawContext dc, Geometry geom)
boolean
isHighlighted()
Indicates whether to highlight the shape.boolean[]
isTerrainConforming()
Returns the old-style indicators of the airspace's lower and upper surface datums.boolean
isVisible()
protected void
makeExtremePoints(Globe globe, double verticalExaggeration, java.lang.Iterable<? extends LatLon> locations, java.util.List<Vec4> extremePoints)
protected void
makeOrderedRenderable(DrawContext dc)
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.void
moveTo(Globe globe, Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.protected boolean
mustDrawInterior(DrawContext dc)
protected boolean
mustDrawOutline(DrawContext dc)
protected long
nextExpiryTime(DrawContext dc, boolean[] terrainConformance)
void
pick(DrawContext dc, java.awt.Point pickPoint)
Executes a pick of the ordered renderable.void
preRender(DrawContext dc)
protected void
regenerateSurfaceShape(DrawContext dc, SurfaceShape shape)
Regenerates surface shape geometry prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.void
render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.void
restoreState(java.lang.String stateInXml)
Restores the object's state to what is described in the specified XML document string.void
setAltitude(double altitude)
Sets the lower and upper airspace surface altitudes to the same value.void
setAltitudeDatum(java.lang.String lowerAltitudeDatum, java.lang.String upperAltitudeDatum)
Sets the altitude datum, which indicates whether airspace altitudes are relative to mean sea level, ground level or a single ground reference location.void
setAltitudes(double lowerAltitude, double upperAltitude)
Sets the lower and upper airspace surface altitudes.void
setAlwaysOnTop(boolean alwaysOnTop)
Specifies whether this airspace should have visual priority over other displayed shapes in 3D mode.void
setAttributes(AirspaceAttributes attributes)
void
setAttributes(ShapeAttributes attributes)
Set the shape's attributes.void
setDelegateOwner(java.lang.Object delegateOwner)
void
setDetailLevels(java.util.Collection<DetailLevel> detailLevels)
void
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.void
setDrawSurfaceShape(boolean drawSurfaceShape)
Specifies whether this airspace should be drawn flat and on the surface, ignoring any altitude information specified in the shape.void
setEnableBatchPicking(boolean enableBatchPicking)
Specifies whether adjacent shapes of this shape's concrete type in the ordered renderable list may be pick-tested together if they are contained in the same layer.void
setEnableBatchRendering(boolean enableBatchRendering)
Specifies whether adjacent shapes of this shape's concrete type in the ordered renderable list may be rendered together if they are contained in the same layer.void
setEnableDepthOffset(boolean enableDepthOffset)
Specifies whether the filled sides of this shape should be offset towards the viewer to help eliminate artifacts when two or more faces of this or other filled shapes are coincident.void
setEnableLevelOfDetail(boolean enableLevelOfDetail)
protected void
setExpiryRange(long minTimeMillis, long maxTimeMillis)
protected void
setExpiryTime(long timeMillis)
protected void
setGeometryBuilder(GeometryBuilder gb)
void
setGroundReference(LatLon groundReference)
Sets the reference location used to determine the elevation offset for airspace surfaces whose altitude datum isAVKey.ABOVE_GROUND_REFERENCE
.void
setHighlightAttributes(AirspaceAttributes highlightAttrs)
Specifies this shape's highlight attributes.void
setHighlightAttributes(ShapeAttributes highlightAttributes)
Set the shape's highlight attributes.void
setHighlighted(boolean highlighted)
Specifies whether to highlight the shape.void
setOutlinePickWidth(int outlinePickWidth)
Specifies the outline line width to use during picking.void
setTerrainConforming(boolean terrainConformant)
Sets the altitude datum for both the lower and upper airspace surface to the same specified value.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.void
setVisible(boolean visible)
protected void
updateExpiryCriteria(DrawContext dc, Geometry geom)
protected void
updateSurfaceShape(DrawContext dc, SurfaceShape shape)
Sets surface shape parameters prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
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, 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
-
Methods inherited from interface gov.nasa.worldwind.Movable2
getReferencePosition
-
-
-
-
Field Detail
-
ARC_SLICES
protected static final java.lang.String ARC_SLICES
- See Also:
- Constant Field Values
-
DISABLE_TERRAIN_CONFORMANCE
protected static final java.lang.String DISABLE_TERRAIN_CONFORMANCE
- See Also:
- Constant Field Values
-
EXPIRY_TIME
protected static final java.lang.String EXPIRY_TIME
- See Also:
- Constant Field Values
-
GEOMETRY_CACHE_NAME
protected static final java.lang.String GEOMETRY_CACHE_NAME
- See Also:
- Constant Field Values
-
GEOMETRY_CACHE_KEY
protected static final java.lang.String GEOMETRY_CACHE_KEY
-
GLOBE_KEY
protected static final java.lang.String GLOBE_KEY
- See Also:
- Constant Field Values
-
LENGTH_SLICES
protected static final java.lang.String LENGTH_SLICES
- See Also:
- Constant Field Values
-
LOOPS
protected static final java.lang.String LOOPS
- See Also:
- Constant Field Values
-
PILLARS
protected static final java.lang.String PILLARS
- See Also:
- Constant Field Values
-
SLICES
protected static final java.lang.String SLICES
- See Also:
- Constant Field Values
-
SPLIT_THRESHOLD
protected static final java.lang.String SPLIT_THRESHOLD
- See Also:
- Constant Field Values
-
STACKS
protected static final java.lang.String STACKS
- See Also:
- Constant Field Values
-
SUBDIVISIONS
protected static final java.lang.String SUBDIVISIONS
- See Also:
- Constant Field Values
-
VERTICAL_EXAGGERATION
protected static final java.lang.String VERTICAL_EXAGGERATION
- See Also:
- Constant Field Values
-
DEFAULT_OUTLINE_PICK_WIDTH
protected static final int DEFAULT_OUTLINE_PICK_WIDTH
The default outline pick width.- See Also:
- Constant Field Values
-
DEFAULT_INTERIOR_MATERIAL
protected static final Material DEFAULT_INTERIOR_MATERIAL
The default interior color.
-
DEFAULT_OUTLINE_MATERIAL
protected static final Material DEFAULT_OUTLINE_MATERIAL
The default outline color.
-
DEFAULT_HIGHLIGHT_MATERIAL
protected static final Material DEFAULT_HIGHLIGHT_MATERIAL
The default highlight color.
-
defaultAttributes
protected static AirspaceAttributes defaultAttributes
The attributes used if attributes are not specified.
-
visible
protected boolean visible
-
highlighted
protected boolean highlighted
-
dragEnabled
protected boolean dragEnabled
-
draggableSupport
protected DraggableSupport draggableSupport
-
attributes
protected AirspaceAttributes attributes
-
highlightAttributes
protected AirspaceAttributes highlightAttributes
-
activeAttributes
protected AirspaceAttributes activeAttributes
-
lowerAltitude
protected double lowerAltitude
-
upperAltitude
protected double upperAltitude
-
lowerTerrainConforming
protected boolean lowerTerrainConforming
-
upperTerrainConforming
protected boolean upperTerrainConforming
-
lowerAltitudeDatum
protected java.lang.String lowerAltitudeDatum
-
upperAltitudeDatum
protected java.lang.String upperAltitudeDatum
-
groundReference
protected LatLon groundReference
-
enableLevelOfDetail
protected boolean enableLevelOfDetail
-
detailLevels
protected java.util.Collection<DetailLevel> detailLevels
-
enableBatchRendering
protected boolean enableBatchRendering
-
enableBatchPicking
protected boolean enableBatchPicking
-
enableDepthOffset
protected boolean enableDepthOffset
-
outlinePickWidth
protected int outlinePickWidth
-
delegateOwner
protected java.lang.Object delegateOwner
-
surfaceShape
protected SurfaceShape surfaceShape
-
mustRegenerateSurfaceShape
protected boolean mustRegenerateSurfaceShape
-
drawSurfaceShape
protected boolean drawSurfaceShape
-
frameTimeStamp
protected long frameTimeStamp
-
alwaysOnTop
protected boolean alwaysOnTop
-
currentInfo
protected AbstractAirspace.AirspaceInfo currentInfo
-
pickLayer
protected Layer pickLayer
-
pickSupport
protected PickSupport pickSupport
-
geometryBuilder
protected GeometryBuilder geometryBuilder
-
expiryTime
protected long expiryTime
-
minExpiryTime
protected long minExpiryTime
-
maxExpiryTime
protected long maxExpiryTime
-
rand
protected static java.util.Random rand
-
elevationMap
protected java.util.Map<LatLon,java.lang.Double> elevationMap
-
outlineShapeRenderer
protected OutlinedShape outlineShapeRenderer
-
airspaceInfo
protected java.util.HashMap<GlobeStateKey,AbstractAirspace.AirspaceInfo> airspaceInfo
-
-
Constructor Detail
-
AbstractAirspace
public AbstractAirspace(AirspaceAttributes attributes)
-
AbstractAirspace
public AbstractAirspace(AbstractAirspace source)
-
AbstractAirspace
public AbstractAirspace()
-
-
Method Detail
-
computeMinimalGeometry
protected abstract java.util.List<Vec4> computeMinimalGeometry(Globe globe, double verticalExaggeration)
-
setVisible
public void setVisible(boolean visible)
- Specified by:
setVisible
in interfaceAirspace
-
getAttributes
public AirspaceAttributes getAttributes()
Description copied from interface:Attributable
Return the shape's current attributes.- Specified by:
getAttributes
in interfaceAirspace
- Specified by:
getAttributes
in interfaceAttributable
- Returns:
- the shape's current attributes.
-
setAttributes
public void setAttributes(AirspaceAttributes attributes)
- Specified by:
setAttributes
in interfaceAirspace
-
setAttributes
public void setAttributes(ShapeAttributes attributes)
Description copied from interface:Attributable
Set the shape's attributes.- Specified by:
setAttributes
in interfaceAttributable
- Parameters:
attributes
- the attributes to assign to the shape.
-
setHighlightAttributes
public void setHighlightAttributes(ShapeAttributes highlightAttributes)
Description copied from interface:Attributable
Set the shape's highlight attributes.- Specified by:
setHighlightAttributes
in interfaceAttributable
- Parameters:
highlightAttributes
- the highlight attributes to assign to the shape.
-
getHighlightAttributes
public AirspaceAttributes getHighlightAttributes()
Description copied from interface:Airspace
Returns this shape's highlight attributes.- Specified by:
getHighlightAttributes
in interfaceAirspace
- Specified by:
getHighlightAttributes
in interfaceAttributable
- Returns:
- this shape's highlight attributes. May be null.
-
setHighlightAttributes
public void setHighlightAttributes(AirspaceAttributes highlightAttrs)
Description copied from interface:Airspace
Specifies this shape's highlight attributes.- Specified by:
setHighlightAttributes
in interfaceAirspace
- Parameters:
highlightAttrs
- the highlight attributes. May be null, in which case default attributes are used.
-
isHighlighted
public boolean isHighlighted()
Description copied from interface:Highlightable
Indicates whether to highlight the shape.- Specified by:
isHighlighted
in interfaceHighlightable
- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Description copied from interface:Highlightable
Specifies whether to highlight the shape.- Specified by:
setHighlighted
in interfaceHighlightable
- Parameters:
highlighted
- true to highlight the shape, otherwise false.
-
getAltitudes
public double[] getAltitudes()
Description copied from interface:Airspace
Returns the current airspace surface altitudes.- Specified by:
getAltitudes
in interfaceAirspace
- Returns:
- a two-element array of
double
with element 0 containing the lower surface altitude, and element 1 containing the upper surface altitude. - See Also:
Airspace.setAltitudes(double, double)
,Airspace.setAltitudeDatum(java.lang.String, java.lang.String)
,Airspace.setGroundReference(gov.nasa.worldwind.geom.LatLon)
-
getAltitudes
protected double[] getAltitudes(double verticalExaggeration)
-
setAltitudes
public void setAltitudes(double lowerAltitude, double upperAltitude)
Description copied from interface:Airspace
Sets the lower and upper airspace surface altitudes. The altitudes are interpreted according to the current altitude datum of the respective surface. SeeAirspace.setAltitudeDatum(String, String)
for a description of the possible interpretations and the means to specify them.- Specified by:
setAltitudes
in interfaceAirspace
- Parameters:
lowerAltitude
- the lower surface altitude, in meters.upperAltitude
- the upper surface altitude, in meters.- See Also:
Airspace.setAltitudes(double, double)
,Airspace.setAltitudeDatum(java.lang.String, java.lang.String)
,Airspace.setGroundReference(gov.nasa.worldwind.geom.LatLon)
-
setAltitude
public void setAltitude(double altitude)
Description copied from interface:Airspace
Sets the lower and upper airspace surface altitudes to the same value. The lower and upper altitudes are interpreted according to the current altitude datum of the respective surface. SeeAirspace.setAltitudeDatum(String, String)
for a description of the possible interpretations and the means to specify them.- Specified by:
setAltitude
in interfaceAirspace
- Parameters:
altitude
- the lower surface altitude, in meters.- See Also:
Airspace.setAltitudes(double, double)
,Airspace.setAltitudeDatum(java.lang.String, java.lang.String)
,Airspace.setGroundReference(gov.nasa.worldwind.geom.LatLon)
-
isTerrainConforming
public boolean[] isTerrainConforming()
Description copied from interface:Airspace
Returns the old-style indicators of the airspace's lower and upper surface datums.- Specified by:
isTerrainConforming
in interfaceAirspace
- Returns:
- the lower and upper surface datums.
-
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 viaAirspace.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 interfaceAirspace
- Parameters:
lowerTerrainConformant
- the lower altitude datum. A value of true indicates a lower altitude datum ofAVKey.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 ofAVKey.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)
-
getAltitudeDatum
public java.lang.String[] getAltitudeDatum()
Description copied from interface:Airspace
Returns the current altitude datum of the airspace's lower and upper surfaces.- Specified by:
getAltitudeDatum
in interfaceAirspace
- Returns:
- a two-element array containing at position 0 the lower altitude datum, and at position 1 the upper altitude datum.
- See Also:
Airspace.setAltitudeDatum(String, String)
-
setAltitudeDatum
public void setAltitudeDatum(java.lang.String lowerAltitudeDatum, java.lang.String upperAltitudeDatum)
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.A value of
AVKey.ABOVE_MEAN_SEA_LEVEL
, the default for both lower and upper datums, indicates a datum of mean sea level. The respective lower or upper surface of the airspace is drawn at the constant altitude specified byAirspace.setAltitude(double)
.A datum of
AVKey.ABOVE_GROUND_LEVEL
indicates that each position of the respective airspace surface is offset vertically from the altitude specified toAirspace.setAltitude(double)
by an amount equal to the terrain elevation at that position. For example, if the specified lower altitude is zero, the lower surface lies on and conforms to the terrain. If non-zero, the surface undulates in tandem with the terrain but relative to the specified altitude.A datum of
AVKey.ABOVE_GROUND_REFERENCE
combines both of the above datums. It indicates that the respective surface is drawn at the altitude specified toAirspace.setAltitude(double)
but offset vertically by an amount equal to the elevation at a single reference location on the ground. This is useful for displaying surfaces that are "flat" but are positioned relative to the ground. An example is the roof of a building, which maintains a constant altitude even as the base of its building may conform to varying terrain. One method of representing buildings is to specify a lower altitude of 0, a lower altitude datum ofAVKey.ABOVE_GROUND_LEVEL
, an upper altitude that's the building's height, and an upper altitude datum ofAVKey.ABOVE_GROUND_REFERENCE
, where the ground reference is a location at the building's base. The reference position is specifed byAirspace.setGroundReference(LatLon)
.- Specified by:
setAltitudeDatum
in interfaceAirspace
- Parameters:
lowerAltitudeDatum
- the lower altitude datum.upperAltitudeDatum
- the upper altitude datum- See Also:
Airspace.setGroundReference(gov.nasa.worldwind.geom.LatLon)
,Airspace.setAltitudes(double, double)
-
getGroundReference
public LatLon getGroundReference()
Description copied from interface:Airspace
Returns the current ground reference location.- Specified by:
getGroundReference
in interfaceAirspace
- Returns:
- the current ground reference location.
-
setGroundReference
public void setGroundReference(LatLon groundReference)
Description copied from interface:Airspace
Sets the reference location used to determine the elevation offset for airspace surfaces whose altitude datum isAVKey.ABOVE_GROUND_REFERENCE
. The reference location is unused if the altitude datum is a value other than this.- Specified by:
setGroundReference
in interfaceAirspace
- Parameters:
groundReference
- the location at which to compute the terrain elevation used to offset an upper or lower airspace surface. The location need not be within the airspace's bounds. If null, an airspace-specific position is chosen from those defining the airspace. See the method descriptions for the individual airspaces to determine the position used.- See Also:
Airspace.setAltitudeDatum(String, String)
-
isEnableBatchRendering
public boolean isEnableBatchRendering()
Indicates whether batch rendering is enabled for the concrete shape type of this shape.- Specified by:
isEnableBatchRendering
in interfaceAirspace
- Returns:
- true if batch rendering is enabled, otherwise false.
- See Also:
Airspace.setEnableBatchRendering(boolean)
-
setEnableBatchRendering
public void setEnableBatchRendering(boolean enableBatchRendering)
Specifies whether adjacent shapes of this shape's concrete type in the ordered renderable list may be rendered together if they are contained in the same layer. This increases performance. There is seldom a reason to disable it.- Specified by:
setEnableBatchRendering
in interfaceAirspace
- Parameters:
enableBatchRendering
- true to enable batch rendering, otherwise false.
-
isEnableBatchPicking
public boolean isEnableBatchPicking()
Indicates whether batch picking is enabled.- Specified by:
isEnableBatchPicking
in interfaceAirspace
- Returns:
- true if batch rendering is enabled, otherwise false.
- See Also:
Airspace.setEnableBatchPicking(boolean)
-
setEnableBatchPicking
public void setEnableBatchPicking(boolean enableBatchPicking)
Specifies whether adjacent shapes of this shape's concrete type in the ordered renderable list may be pick-tested together if they are contained in the same layer. This increases performance but allows only the top-most of the polygons to be reported in aSelectEvent
even if several of the polygons are at the pick position.Batch rendering (
Airspace.setEnableBatchRendering(boolean)
) must be enabled in order for batch picking to occur.- Specified by:
setEnableBatchPicking
in interfaceAirspace
- Parameters:
enableBatchPicking
- true to enable batch rendering, otherwise false.
-
isEnableDepthOffset
public boolean isEnableDepthOffset()
Indicates whether the filled sides of this shape should be offset towards the viewer to help eliminate artifacts when two or more faces of this or other filled shapes are coincident.- Specified by:
isEnableDepthOffset
in interfaceAirspace
- Returns:
- true if depth offset is applied, otherwise false.
-
setEnableDepthOffset
public void setEnableDepthOffset(boolean enableDepthOffset)
Specifies whether the filled sides of this shape should be offset towards the viewer to help eliminate artifacts when two or more faces of this or other filled shapes are coincident.- Specified by:
setEnableDepthOffset
in interfaceAirspace
- Parameters:
enableDepthOffset
- true if depth offset is applied, otherwise false.
-
getOutlinePickWidth
public int getOutlinePickWidth()
Indicates the outline line width to use during picking. A larger width than normal typically makes the outline easier to pick.- Specified by:
getOutlinePickWidth
in interfaceAirspace
- Returns:
- the outline line width used during picking.
-
setOutlinePickWidth
public void setOutlinePickWidth(int outlinePickWidth)
Specifies the outline line width to use during picking. A larger width than normal typically makes the outline easier to pick.Note that the size of the pick aperture also affects the precision necessary to pick.
- Specified by:
setOutlinePickWidth
in interfaceAirspace
- Parameters:
outlinePickWidth
- the outline pick width. The default is 10.
-
getDelegateOwner
public java.lang.Object getDelegateOwner()
- Specified by:
getDelegateOwner
in interfaceAirspace
-
setDelegateOwner
public void setDelegateOwner(java.lang.Object delegateOwner)
- Specified by:
setDelegateOwner
in interfaceAirspace
-
isAlwaysOnTop
public boolean isAlwaysOnTop()
Description copied from interface:Airspace
Indicates the state of this airspace's always-on-top flag.- Specified by:
isAlwaysOnTop
in interfaceAirspace
- Returns:
- the state of this airspace's always-on-top flag.
- See Also:
Airspace.isAlwaysOnTop()
-
setAlwaysOnTop
public void setAlwaysOnTop(boolean alwaysOnTop)
Description copied from interface:Airspace
Specifies whether this airspace should have visual priority over other displayed shapes in 3D mode. Iftrue
, this shape is drawn after all others. This property is ignored byCake
airspaces.- Specified by:
setAlwaysOnTop
in interfaceAirspace
- Parameters:
alwaysOnTop
- iftrue
, this airspace is drawn after all others. Otherwise this airspace is drawn with its normal priority, which is its relative distance to the eye point.
-
isDrawSurfaceShape
public boolean isDrawSurfaceShape()
Description copied from interface:Airspace
Indicates whether this surface shape is always drawn flat and on the surface.- Specified by:
isDrawSurfaceShape
in interfaceAirspace
- Returns:
true
if this shape is drawn flat and on the surface, otherwisefalse
.
-
setDrawSurfaceShape
public void setDrawSurfaceShape(boolean drawSurfaceShape)
Description copied from interface:Airspace
Specifies whether this airspace should be drawn flat and on the surface, ignoring any altitude information specified in the shape.- Specified by:
setDrawSurfaceShape
in interfaceAirspace
- Parameters:
drawSurfaceShape
-true
if this shape is drawn flat and on the surface, otherwisefalse
.
-
adjustForGroundReference
protected void adjustForGroundReference(DrawContext dc, boolean[] terrainConformant, double[] altitudes, LatLon groundRef)
-
isAirspaceCollapsed
public boolean isAirspaceCollapsed()
-
setTerrainConforming
public void setTerrainConforming(boolean terrainConformant)
Description copied from interface:Airspace
Sets the altitude datum for both the lower and upper airspace surface to the same specified value. The datum is normally set viaAirspace.setAltitudeDatum(String, String)
, but this method is provided for backwards compatibility with the means of originally setting the datum. See the argument descriptions for the mapping of the boolean values of this method to the altitude-datum values.- Specified by:
setTerrainConforming
in interfaceAirspace
- Parameters:
terrainConformant
- the altitude datum. SeeAirspace.setTerrainConforming(boolean, boolean)
for a description of the possible values.
-
isEnableLevelOfDetail
public boolean isEnableLevelOfDetail()
- Specified by:
isEnableLevelOfDetail
in interfaceAirspace
-
setEnableLevelOfDetail
public void setEnableLevelOfDetail(boolean enableLevelOfDetail)
- Specified by:
setEnableLevelOfDetail
in interfaceAirspace
-
getDetailLevels
public java.lang.Iterable<DetailLevel> getDetailLevels()
- Specified by:
getDetailLevels
in interfaceAirspace
-
setDetailLevels
public void setDetailLevels(java.util.Collection<DetailLevel> detailLevels)
- Specified by:
setDetailLevels
in interfaceAirspace
-
addDetailLevels
protected void addDetailLevels(java.util.Collection<DetailLevel> newDetailLevels)
-
isAirspaceVisible
public boolean isAirspaceVisible(DrawContext dc)
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 interfaceAirspace
- Parameters:
dc
- the draw context the airspace is related to.- Returns:
- true if this airspace is visible; false otherwise.
-
getExtent
public Extent getExtent(Globe globe, double verticalExaggeration)
Description copied from interface:Airspace
Returns this Airspace's enclosing volume as anExtent
in model coordinates, given a specifiedGlobe
and vertical exaggeration (seeSceneController.getVerticalExaggeration()
.- Specified by:
getExtent
in interfaceAirspace
- Specified by:
getExtent
in interfaceExtentHolder
- Parameters:
globe
- the Globe this Airspace is related to.verticalExaggeration
- the vertical exaggeration of the scene containing this Airspace.- Returns:
- this Airspace's Extent in model coordinates.
-
getExtent
public Extent getExtent(DrawContext dc)
Description copied from interface:Airspace
Returns this Airspace's enclosing volume as anExtent
in model coordinates, given a specifiedDrawContext
. The returned Extent may be different than the Extent returned by callingAirspace.getExtent(gov.nasa.worldwind.globes.Globe, double)
with the DrawContext's Globe and vertical exaggeration. Additionally, this may cache the computed extent and is therefore potentially faster than callingAirspace.getExtent(gov.nasa.worldwind.globes.Globe, double)
.
-
getAirspaceInfo
protected AbstractAirspace.AirspaceInfo getAirspaceInfo(DrawContext dc)
-
computeExtent
protected Extent computeExtent(DrawContext dc)
-
computeMinimalGeometry
protected java.util.List<Vec4> computeMinimalGeometry(DrawContext dc)
-
invalidateAirspaceData
protected void invalidateAirspaceData()
-
getDistanceFromEye
public double getDistanceFromEye()
Description copied from interface:OrderedRenderable
Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active.- Specified by:
getDistanceFromEye
in interfaceOrderedRenderable
- Returns:
- the distance of the ordered renderable from the current view's eye point.
-
determineActiveAttributes
protected void determineActiveAttributes(DrawContext dc)
Determines which attributes -- normal, highlight or default -- to use each frame. Places the result in this shape's current active attributes.- Parameters:
dc
- the current drawing context.- See Also:
getActiveAttributes()
-
getActiveAttributes
public AirspaceAttributes getActiveAttributes()
Returns this shape's currently active attributes, as determined during the most recent call todetermineActiveAttributes(gov.nasa.worldwind.render.DrawContext)
. The active attributes are either the normal or highlight attributes, depending on this shape's highlight flag, and incorporates default attributes for those not specified in the applicable attribute set.- Returns:
- this shape's currently active attributes.
-
preRender
public void preRender(DrawContext dc)
- Specified by:
preRender
in interfacePreRenderable
-
createSurfaceShape
protected SurfaceShape createSurfaceShape()
Returns aSurfaceShape
that corresponds to this Airspace and is used for drawing on 2D globes.- Returns:
- The surface shape to represent this Airspace on a 2D globe.
-
updateSurfaceShape
protected void updateSurfaceShape(DrawContext dc, SurfaceShape shape)
Sets surface shape parameters prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes. Subclasses should override this method if they need to update more than the attributes and the delegate owner.- Parameters:
dc
- the current drawing context.shape
- the surface shape to update.
-
regenerateSurfaceShape
protected void regenerateSurfaceShape(DrawContext dc, SurfaceShape shape)
Regenerates surface shape geometry prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.- Parameters:
dc
- the current drawing context.shape
- the surface shape to regenerate.
-
pick
public void pick(DrawContext dc, java.awt.Point pickPoint)
Description copied from interface:OrderedRenderable
Executes a pick of the ordered renderable.- Specified by:
pick
in interfaceOrderedRenderable
- Parameters:
dc
- the current draw context.pickPoint
- the pick point.
-
render
public void render(DrawContext dc)
Description copied from interface:Renderable
Causes thisRenderable
to render itself using the provided draw context.- Specified by:
render
in interfaceRenderable
- Parameters:
dc
- theDrawContext
to be used- See Also:
DrawContext
-
makeOrderedRenderable
protected void makeOrderedRenderable(DrawContext dc)
-
drawOrderedRenderable
protected void drawOrderedRenderable(DrawContext dc)
-
drawBatched
protected void drawBatched(DrawContext dc)
-
doDrawOrderedRenderable
protected void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidates)
-
createPickedObject
protected PickedObject createPickedObject(int colorCode)
-
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.
-
moveTo
public void moveTo(Globe globe, Position position)
Description copied from interface:Movable2
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
-
isDragEnabled
public boolean isDragEnabled()
Description copied from interface:Draggable
Indicates whether the object is enabled for dragging.- Specified by:
isDragEnabled
in interfaceDraggable
- Returns:
- true if the object is enabled, else false.
-
setDragEnabled
public void setDragEnabled(boolean enabled)
Description copied from interface:Draggable
Controls whether the object is enabled for dragging.- Specified by:
setDragEnabled
in interfaceDraggable
- Parameters:
enabled
-true
if the object is enabled, elsefalse
.
-
drag
public void drag(DragContext dragContext)
Description copied from interface:Draggable
Drag the object given the providedDragContext
.- Specified by:
drag
in interfaceDraggable
- Parameters:
dragContext
- theDragContext
of this dragging event.
-
doDrag
protected void doDrag(DragContext dragContext)
-
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.
-
computeReferencePosition
protected Position computeReferencePosition(java.util.List<? extends LatLon> locations, double[] altitudes)
-
computeEyeDistance
protected double computeEyeDistance(DrawContext dc)
-
doRenderGeometry
protected abstract void doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
-
beginRendering
protected void beginRendering(DrawContext dc)
-
endRendering
protected void endRendering(DrawContext dc)
-
mustDrawInterior
protected boolean mustDrawInterior(DrawContext dc)
-
drawInterior
protected void drawInterior(DrawContext dc)
-
mustDrawOutline
protected boolean mustDrawOutline(DrawContext dc)
-
drawOutline
protected void drawOutline(DrawContext dc)
-
drawGeometry
protected void drawGeometry(DrawContext dc, Geometry indices, Geometry vertices)
-
getGeometryBuilder
protected GeometryBuilder getGeometryBuilder()
-
setGeometryBuilder
protected void setGeometryBuilder(GeometryBuilder gb)
-
computeDetailLevel
protected DetailLevel computeDetailLevel(DrawContext dc)
-
getGeometryCache
protected MemoryCache getGeometryCache()
-
isExpired
protected boolean isExpired(DrawContext dc, Geometry geom)
-
updateExpiryCriteria
protected void updateExpiryCriteria(DrawContext dc, Geometry geom)
-
getExpiryTime
protected long getExpiryTime()
-
setExpiryTime
protected void setExpiryTime(long timeMillis)
-
getExpiryRange
protected long[] getExpiryRange()
-
setExpiryRange
protected void setExpiryRange(long minTimeMillis, long maxTimeMillis)
-
nextExpiryTime
protected long nextExpiryTime(DrawContext dc, boolean[] terrainConformance)
-
clearElevationMap
protected void clearElevationMap()
-
computePointFromPosition
public Vec4 computePointFromPosition(DrawContext dc, Angle latitude, Angle longitude, double elevation, boolean terrainConformant)
-
computeElevationAt
protected double computeElevationAt(DrawContext dc, Angle latitude, Angle longitude)
-
makeExtremePoints
protected void makeExtremePoints(Globe globe, double verticalExaggeration, java.lang.Iterable<? extends LatLon> locations, java.util.List<Vec4> extremePoints)
-
getRestorableState
public java.lang.String getRestorableState()
Description copied from interface:Restorable
Returns an XML document string describing the object's state. This state can be restored later by callingrestoreState
and passing the XML document.- Specified by:
getRestorableState
in interfaceRestorable
- Returns:
- an XML document string describing the object's state.
-
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
-
restoreState
public void restoreState(java.lang.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 interfaceRestorable
- Parameters:
stateInXml
- an XML document string describing an object's state.
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
-
-