Class TrackAirspace
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.airspaces.AbstractAirspace
-
- gov.nasa.worldwind.render.airspaces.TrackAirspace
-
- 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:
Route
public class TrackAirspace extends AbstractAirspace
Creates a sequence of potentially disconnected rectangular airspaces specified by a collection ofBox
objects.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
AbstractAirspace.AirspaceInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
enableCenterLine
protected boolean
enableInnerCaps
protected java.util.List<Box>
legs
protected boolean
legsOutOfDate
protected Angle
smallAngleThreshold
Denotes the the threshold that defines whether the angle between two adjacent legs is small.-
Fields inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
activeAttributes, airspaceInfo, alwaysOnTop, ARC_SLICES, attributes, currentInfo, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_INTERIOR_MATERIAL, DEFAULT_OUTLINE_MATERIAL, DEFAULT_OUTLINE_PICK_WIDTH, defaultAttributes, delegateOwner, detailLevels, DISABLE_TERRAIN_CONFORMANCE, dragEnabled, draggableSupport, drawSurfaceShape, elevationMap, enableBatchPicking, enableBatchRendering, enableDepthOffset, enableLevelOfDetail, EXPIRY_TIME, expiryTime, frameTimeStamp, GEOMETRY_CACHE_KEY, GEOMETRY_CACHE_NAME, geometryBuilder, GLOBE_KEY, groundReference, highlightAttributes, highlighted, LENGTH_SLICES, LOOPS, lowerAltitude, lowerAltitudeDatum, lowerTerrainConforming, maxExpiryTime, minExpiryTime, mustRegenerateSurfaceShape, outlinePickWidth, outlineShapeRenderer, pickLayer, pickSupport, PILLARS, rand, SLICES, SPLIT_THRESHOLD, STACKS, SUBDIVISIONS, surfaceShape, upperAltitude, upperAltitudeDatum, upperTerrainConforming, VERTICAL_EXAGGERATION, visible
-
Fields inherited from interface gov.nasa.worldwind.render.airspaces.Airspace
DRAW_STYLE_FILL, DRAW_STYLE_OUTLINE
-
-
Constructor Summary
Constructors Constructor Description TrackAirspace()
TrackAirspace(AirspaceAttributes attributes)
TrackAirspace(TrackAirspace source)
TrackAirspace(java.util.Collection<Box> legs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Box
addLeg(LatLon start, LatLon end, double lowerAltitude, double upperAltitude, double leftWidth, double rightWidth)
protected void
addLeg(Box leg)
protected void
addLegs(java.lang.Iterable<Box> newLegs)
protected Extent
computeExtent(Globe globe, double verticalExaggeration)
protected Extent
computeExtent(DrawContext dc)
protected java.util.List<Vec4>
computeMinimalGeometry(Globe globe, double verticalExaggeration)
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 void
doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
protected void
doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void
doUpdateLegs()
java.util.List<Box>
getLegs()
Position
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.Angle
getSmallAngleThreshold()
Desnotes the threshold that defines whether the angle between two adjacent legs is small.protected void
invalidateAirspaceData()
boolean
isAirspaceVisible(DrawContext dc)
Test if this airspace is visible in the specified draw context.boolean
isEnableCenterLine()
boolean
isEnableInnerCaps()
protected boolean
isLegsOutOfDate()
protected void
joinLegs(Box leg1, Box leg2)
Modifies the adjacent edges of the specified adjacent legs to produce a seamless transition from the first leg to the second.protected boolean
mustJoinLegs(Box leg1, Box leg2)
Specifies whether the legs must have their adjacent edges joined.void
preRender(DrawContext dc)
void
removeAllLegs()
void
render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.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
setDrawSurfaceShape(boolean drawSurfaceShape)
Specifies whether this airspace should be drawn flat and on the surface, ignoring any altitude information specified in the shape.void
setEnableCenterLine(boolean enable)
void
setEnableDepthOffset(boolean enable)
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
setEnableInnerCaps(boolean draw)
void
setLegs(java.util.Collection<Box> legs)
protected void
setLegsOutOfDate(boolean tf)
void
setSmallAngleThreshold(Angle angle)
Specifies the threshold that defines whether the angle between two adjacent legs is small.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, beginRendering, clearElevationMap, computeDetailLevel, computeElevationAt, computeEyeDistance, computeMinimalGeometry, computePointFromPosition, computeReferencePosition, createPickedObject, createSurfaceShape, determineActiveAttributes, doDrag, doDrawOrderedRenderable, drag, drawBatched, drawGeometry, drawInterior, drawOrderedRenderable, drawOutline, endRendering, getActiveAttributes, getAirspaceInfo, getAltitudeDatum, getAltitudes, getAltitudes, getAttributes, getDelegateOwner, getDetailLevels, getDistanceFromEye, getExpiryRange, getExpiryTime, getExtent, getExtent, getGeometryBuilder, getGeometryCache, getGroundReference, getHighlightAttributes, getOutlinePickWidth, getRestorableState, isAirspaceCollapsed, isAlwaysOnTop, isDragEnabled, isDrawSurfaceShape, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isEnableLevelOfDetail, isExpired, isHighlighted, isTerrainConforming, isVisible, makeExtremePoints, makeOrderedRenderable, move, moveTo, moveTo, mustDrawInterior, mustDrawOutline, nextExpiryTime, pick, regenerateSurfaceShape, restoreState, setAltitude, setAltitudeDatum, setAttributes, setAttributes, setDelegateOwner, setDetailLevels, setDragEnabled, setEnableBatchPicking, setEnableBatchRendering, setEnableLevelOfDetail, setExpiryRange, setExpiryTime, setGeometryBuilder, setGroundReference, setHighlightAttributes, setHighlightAttributes, setHighlighted, setOutlinePickWidth, setTerrainConforming, setVisible, updateExpiryCriteria, updateSurfaceShape
-
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
-
-
-
-
Field Detail
-
legs
protected java.util.List<Box> legs
-
legsOutOfDate
protected boolean legsOutOfDate
-
enableInnerCaps
protected boolean enableInnerCaps
-
enableCenterLine
protected boolean enableCenterLine
-
smallAngleThreshold
protected Angle smallAngleThreshold
Denotes the the threshold that defines whether the angle between two adjacent legs is small. Initially 22.5 degrees.
-
-
Constructor Detail
-
TrackAirspace
public TrackAirspace(java.util.Collection<Box> legs)
-
TrackAirspace
public TrackAirspace(AirspaceAttributes attributes)
-
TrackAirspace
public TrackAirspace()
-
TrackAirspace
public TrackAirspace(TrackAirspace source)
-
-
Method Detail
-
getLegs
public java.util.List<Box> getLegs()
-
setLegs
public void setLegs(java.util.Collection<Box> legs)
-
addLegs
protected void addLegs(java.lang.Iterable<Box> newLegs)
-
addLeg
public Box addLeg(LatLon start, LatLon end, double lowerAltitude, double upperAltitude, double leftWidth, double rightWidth)
-
addLeg
protected void addLeg(Box leg)
-
removeAllLegs
public void removeAllLegs()
-
isEnableInnerCaps
public boolean isEnableInnerCaps()
-
setEnableInnerCaps
public void setEnableInnerCaps(boolean draw)
-
isEnableCenterLine
public boolean isEnableCenterLine()
-
setEnableCenterLine
public void setEnableCenterLine(boolean enable)
-
setEnableDepthOffset
public void setEnableDepthOffset(boolean enable)
Description copied from class:AbstractAirspace
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
- Overrides:
setEnableDepthOffset
in classAbstractAirspace
- Parameters:
enable
- true if depth offset is applied, otherwise false.
-
getSmallAngleThreshold
public Angle getSmallAngleThreshold()
Desnotes the threshold that defines whether the angle between two adjacent legs is small. This threshold is used to determine the best method for adjusting the vertices of adjacent legs.- Returns:
- the angle used to determine when the angle between two adjacent legs is small.
- See Also:
setSmallAngleThreshold(gov.nasa.worldwind.geom.Angle)
-
setSmallAngleThreshold
public void setSmallAngleThreshold(Angle angle)
Specifies the threshold that defines whether the angle between two adjacent legs is small. This threshold is used to determine the best method for adjusting the vertices of adjacent legs.When the angle between adjacent legs is small, the standard method of joining the leg's vertices forms a very large peak pointing away from the leg's common point. In this case
TrackAirspace
uses a method that avoids this peak and produces a seamless transition between the adjacent legs.- Parameters:
angle
- the angle to use when determining when the angle between two adjacent legs is small.- Throws:
java.lang.IllegalArgumentException
- ifangle
isnull
.- See Also:
getSmallAngleThreshold()
-
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
- Overrides:
setAltitudes
in classAbstractAirspace
- 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)
-
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
- Overrides:
setTerrainConforming
in classAbstractAirspace
- 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)
-
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
- Overrides:
setAlwaysOnTop
in classAbstractAirspace
- 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.
-
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
- Overrides:
setDrawSurfaceShape
in classAbstractAirspace
- Parameters:
drawSurfaceShape
-true
if this shape is drawn flat and on the surface, otherwisefalse
.
-
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 interfaceAirspace
- Overrides:
isAirspaceVisible
in classAbstractAirspace
- Parameters:
dc
- the draw context the airspace is related to.- Returns:
- true if this airspace is visible; false otherwise.
-
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.
-
computeExtent
protected Extent computeExtent(DrawContext dc)
- Overrides:
computeExtent
in classAbstractAirspace
-
computeExtent
protected Extent computeExtent(Globe globe, double verticalExaggeration)
- Specified by:
computeExtent
in classAbstractAirspace
-
computeMinimalGeometry
protected java.util.List<Vec4> computeMinimalGeometry(Globe globe, double verticalExaggeration)
- Specified by:
computeMinimalGeometry
in classAbstractAirspace
-
invalidateAirspaceData
protected void invalidateAirspaceData()
- Overrides:
invalidateAirspaceData
in classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Globe globe, Position oldRef, Position newRef)
- Overrides:
doMoveTo
in classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Position oldRef, Position newRef)
- Overrides:
doMoveTo
in classAbstractAirspace
-
isLegsOutOfDate
protected boolean isLegsOutOfDate()
-
setLegsOutOfDate
protected void setLegsOutOfDate(boolean tf)
-
doUpdateLegs
protected void doUpdateLegs()
-
mustJoinLegs
protected boolean mustJoinLegs(Box leg1, Box leg2)
Specifies whether the legs must have their adjacent edges joined.leg1
must precedeleg2
. A track's legs must be joined when two adjacent legs share a common location. In this case, the geometry of the two adjacent boxes contains a gap on one side and an intersection on the other. Joining the legs modifies the edges of each leg at their common location to produce a seamless transition from the first leg to the second.- Parameters:
leg1
- the first leg.leg2
- the second leg.- Returns:
true
if the legs must be joined, otherwisefalse
.
-
joinLegs
protected void joinLegs(Box leg1, Box leg2)
Modifies the adjacent edges of the specified adjacent legs to produce a seamless transition from the first leg to the second.leg1
must precedeleg2
, and they must share a common location at the end ofleg1
and the beginning ofleg2
. Without joining the adjacent edges, the geometry of the two adjacent boxes contains a gap on one side and an intersection on the other.This has no effect if the legs cannot be joined for any reason.
- Parameters:
leg1
- the first leg.leg2
- the second leg.
-
preRender
public void preRender(DrawContext dc)
- Specified by:
preRender
in interfacePreRenderable
- Overrides:
preRender
in classAbstractAirspace
-
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
- Overrides:
render
in classAbstractAirspace
- Parameters:
dc
- theDrawContext
to be used- See Also:
DrawContext
-
doRenderGeometry
protected void doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
- Specified by:
doRenderGeometry
in classAbstractAirspace
-
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doGetRestorableState
in classAbstractAirspace
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doRestoreState
in classAbstractAirspace
-
-