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 ofBoxobjects.
-
-
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 booleanenableCenterLineprotected booleanenableInnerCapsprotected java.util.List<Box>legsprotected booleanlegsOutOfDateprotected AnglesmallAngleThresholdDenotes 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 BoxaddLeg(LatLon start, LatLon end, double lowerAltitude, double upperAltitude, double leftWidth, double rightWidth)protected voidaddLeg(Box leg)protected voidaddLegs(java.lang.Iterable<Box> newLegs)protected ExtentcomputeExtent(Globe globe, double verticalExaggeration)protected ExtentcomputeExtent(DrawContext dc)protected java.util.List<Vec4>computeMinimalGeometry(Globe globe, double verticalExaggeration)protected voiddoGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)protected voiddoMoveTo(Position oldRef, Position newRef)protected voiddoMoveTo(Globe globe, Position oldRef, Position newRef)protected voiddoRenderGeometry(DrawContext dc, java.lang.String drawStyle)protected voiddoRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)protected voiddoUpdateLegs()java.util.List<Box>getLegs()PositiongetReferencePosition()A position associated with the object that indicates its aggregate geographic position.AnglegetSmallAngleThreshold()Desnotes the threshold that defines whether the angle between two adjacent legs is small.protected voidinvalidateAirspaceData()booleanisAirspaceVisible(DrawContext dc)Test if this airspace is visible in the specified draw context.booleanisEnableCenterLine()booleanisEnableInnerCaps()protected booleanisLegsOutOfDate()protected voidjoinLegs(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 booleanmustJoinLegs(Box leg1, Box leg2)Specifies whether the legs must have their adjacent edges joined.voidpreRender(DrawContext dc)voidremoveAllLegs()voidrender(DrawContext dc)Causes thisRenderableto render itself using the provided draw context.voidsetAltitudes(double lowerAltitude, double upperAltitude)Sets the lower and upper airspace surface altitudes.voidsetAlwaysOnTop(boolean alwaysOnTop)Specifies whether this airspace should have visual priority over other displayed shapes in 3D mode.voidsetDrawSurfaceShape(boolean drawSurfaceShape)Specifies whether this airspace should be drawn flat and on the surface, ignoring any altitude information specified in the shape.voidsetEnableCenterLine(boolean enable)voidsetEnableDepthOffset(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.voidsetEnableInnerCaps(boolean draw)voidsetLegs(java.util.Collection<Box> legs)protected voidsetLegsOutOfDate(boolean tf)voidsetSmallAngleThreshold(Angle angle)Specifies the threshold that defines whether the angle between two adjacent legs is small.voidsetTerrainConforming(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:AbstractAirspaceSpecifies 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:
setEnableDepthOffsetin interfaceAirspace- Overrides:
setEnableDepthOffsetin 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
TrackAirspaceuses 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- ifangleisnull.- See Also:
getSmallAngleThreshold()
-
setAltitudes
public void setAltitudes(double lowerAltitude, double upperAltitude)Description copied from interface:AirspaceSets 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:
setAltitudesin interfaceAirspace- Overrides:
setAltitudesin 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:AirspaceSets 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:
setTerrainConformingin interfaceAirspace- Overrides:
setTerrainConformingin 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:AirspaceSpecifies 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 byCakeairspaces.- Specified by:
setAlwaysOnTopin interfaceAirspace- Overrides:
setAlwaysOnTopin 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:AirspaceSpecifies whether this airspace should be drawn flat and on the surface, ignoring any altitude information specified in the shape.- Specified by:
setDrawSurfaceShapein interfaceAirspace- Overrides:
setDrawSurfaceShapein classAbstractAirspace- Parameters:
drawSurfaceShape-trueif this shape is drawn flat and on the surface, otherwisefalse.
-
isAirspaceVisible
public boolean isAirspaceVisible(DrawContext dc)
Description copied from class:AbstractAirspaceTest 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:
isAirspaceVisiblein interfaceAirspace- Overrides:
isAirspaceVisiblein 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:MovableA 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:
computeExtentin classAbstractAirspace
-
computeExtent
protected Extent computeExtent(Globe globe, double verticalExaggeration)
- Specified by:
computeExtentin classAbstractAirspace
-
computeMinimalGeometry
protected java.util.List<Vec4> computeMinimalGeometry(Globe globe, double verticalExaggeration)
- Specified by:
computeMinimalGeometryin classAbstractAirspace
-
invalidateAirspaceData
protected void invalidateAirspaceData()
- Overrides:
invalidateAirspaceDatain classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Globe globe, Position oldRef, Position newRef)
- Overrides:
doMoveToin classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Position oldRef, Position newRef)
- Overrides:
doMoveToin 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.leg1must 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:
trueif 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.leg1must precedeleg2, and they must share a common location at the end ofleg1and 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:
preRenderin interfacePreRenderable- Overrides:
preRenderin classAbstractAirspace
-
render
public void render(DrawContext dc)
Description copied from interface:RenderableCauses thisRenderableto render itself using the provided draw context.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classAbstractAirspace- Parameters:
dc- theDrawContextto be used- See Also:
DrawContext
-
doRenderGeometry
protected void doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
- Specified by:
doRenderGeometryin classAbstractAirspace
-
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doGetRestorableStatein classAbstractAirspace
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doRestoreStatein classAbstractAirspace
-
-