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 classAbstractAirspace.AirspaceInfo
-
Field Summary
Fields Modifier and Type Field Description protected AirspaceAttributesactiveAttributesprotected java.util.HashMap<GlobeStateKey,AbstractAirspace.AirspaceInfo>airspaceInfoprotected booleanalwaysOnTopprotected static java.lang.StringARC_SLICESprotected AirspaceAttributesattributesprotected AbstractAirspace.AirspaceInfocurrentInfoprotected static MaterialDEFAULT_HIGHLIGHT_MATERIALThe default highlight color.protected static MaterialDEFAULT_INTERIOR_MATERIALThe default interior color.protected static MaterialDEFAULT_OUTLINE_MATERIALThe default outline color.protected static intDEFAULT_OUTLINE_PICK_WIDTHThe default outline pick width.protected static AirspaceAttributesdefaultAttributesThe attributes used if attributes are not specified.protected java.lang.ObjectdelegateOwnerprotected java.util.Collection<DetailLevel>detailLevelsprotected static java.lang.StringDISABLE_TERRAIN_CONFORMANCEprotected booleandragEnabledprotected DraggableSupportdraggableSupportprotected booleandrawSurfaceShapeprotected java.util.Map<LatLon,java.lang.Double>elevationMapprotected booleanenableBatchPickingprotected booleanenableBatchRenderingprotected booleanenableDepthOffsetprotected booleanenableLevelOfDetailprotected static java.lang.StringEXPIRY_TIMEprotected longexpiryTimeprotected longframeTimeStampprotected static java.lang.StringGEOMETRY_CACHE_KEYprotected static java.lang.StringGEOMETRY_CACHE_NAMEprotected GeometryBuildergeometryBuilderprotected static java.lang.StringGLOBE_KEYprotected LatLongroundReferenceprotected AirspaceAttributeshighlightAttributesprotected booleanhighlightedprotected static java.lang.StringLENGTH_SLICESprotected static java.lang.StringLOOPSprotected doublelowerAltitudeprotected java.lang.StringlowerAltitudeDatumprotected booleanlowerTerrainConformingprotected longmaxExpiryTimeprotected longminExpiryTimeprotected booleanmustRegenerateSurfaceShapeprotected intoutlinePickWidthprotected OutlinedShapeoutlineShapeRendererprotected LayerpickLayerprotected PickSupportpickSupportprotected static java.lang.StringPILLARSprotected static java.util.Randomrandprotected static java.lang.StringSLICESprotected static java.lang.StringSPLIT_THRESHOLDprotected static java.lang.StringSTACKSprotected static java.lang.StringSUBDIVISIONSprotected SurfaceShapesurfaceShapeprotected doubleupperAltitudeprotected java.lang.StringupperAltitudeDatumprotected booleanupperTerrainConformingprotected static java.lang.StringVERTICAL_EXAGGERATIONprotected booleanvisible-
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 voidaddDetailLevels(java.util.Collection<DetailLevel> newDetailLevels)protected voidadjustForGroundReference(DrawContext dc, boolean[] terrainConformant, double[] altitudes, LatLon groundRef)protected voidbeginRendering(DrawContext dc)protected voidclearElevationMap()protected DetailLevelcomputeDetailLevel(DrawContext dc)protected doublecomputeElevationAt(DrawContext dc, Angle latitude, Angle longitude)protected abstract ExtentcomputeExtent(Globe globe, double verticalExaggeration)protected ExtentcomputeExtent(DrawContext dc)protected doublecomputeEyeDistance(DrawContext dc)protected abstract java.util.List<Vec4>computeMinimalGeometry(Globe globe, double verticalExaggeration)protected java.util.List<Vec4>computeMinimalGeometry(DrawContext dc)Vec4computePointFromPosition(DrawContext dc, Angle latitude, Angle longitude, double elevation, boolean terrainConformant)protected PositioncomputeReferencePosition(java.util.List<? extends LatLon> locations, double[] altitudes)protected PickedObjectcreatePickedObject(int colorCode)protected SurfaceShapecreateSurfaceShape()Returns aSurfaceShapethat corresponds to this Airspace and is used for drawing on 2D globes.protected voiddetermineActiveAttributes(DrawContext dc)Determines which attributes -- normal, highlight or default -- to use each frame.protected voiddoDrag(DragContext dragContext)protected voiddoDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidates)protected voiddoGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)protected voiddoMoveTo(Position oldRef, Position newRef)protected voiddoMoveTo(Globe globe, Position oldRef, Position newRef)protected abstract voiddoRenderGeometry(DrawContext dc, java.lang.String drawStyle)protected voiddoRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)voiddrag(DragContext dragContext)Drag the object given the providedDragContext.protected voiddrawBatched(DrawContext dc)protected voiddrawGeometry(DrawContext dc, Geometry indices, Geometry vertices)protected voiddrawInterior(DrawContext dc)protected voiddrawOrderedRenderable(DrawContext dc)protected voiddrawOutline(DrawContext dc)protected voidendRendering(DrawContext dc)AirspaceAttributesgetActiveAttributes()Returns this shape's currently active attributes, as determined during the most recent call todetermineActiveAttributes(gov.nasa.worldwind.render.DrawContext).protected AbstractAirspace.AirspaceInfogetAirspaceInfo(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)AirspaceAttributesgetAttributes()Return the shape's current attributes.java.lang.ObjectgetDelegateOwner()java.lang.Iterable<DetailLevel>getDetailLevels()doublegetDistanceFromEye()Returns the ordered renderable's distance from the current view's eye point.protected long[]getExpiryRange()protected longgetExpiryTime()ExtentgetExtent(Globe globe, double verticalExaggeration)Returns this Airspace's enclosing volume as anExtentin model coordinates, given a specifiedGlobeand vertical exaggeration (seeSceneController.getVerticalExaggeration().ExtentgetExtent(DrawContext dc)Returns this Airspace's enclosing volume as anExtentin model coordinates, given a specifiedDrawContext.protected GeometryBuildergetGeometryBuilder()protected MemoryCachegetGeometryCache()LatLongetGroundReference()Returns the current ground reference location.AirspaceAttributesgetHighlightAttributes()Returns this shape's highlight attributes.intgetOutlinePickWidth()Indicates the outline line width to use during picking.java.lang.StringgetRestorableState()Returns an XML document string describing the object's state.protected voidinvalidateAirspaceData()booleanisAirspaceCollapsed()booleanisAirspaceVisible(DrawContext dc)Test if this airspace is visible in the specified draw context.booleanisAlwaysOnTop()Indicates the state of this airspace's always-on-top flag.booleanisDragEnabled()Indicates whether the object is enabled for dragging.booleanisDrawSurfaceShape()Indicates whether this surface shape is always drawn flat and on the surface.booleanisEnableBatchPicking()Indicates whether batch picking is enabled.booleanisEnableBatchRendering()Indicates whether batch rendering is enabled for the concrete shape type of this shape.booleanisEnableDepthOffset()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.booleanisEnableLevelOfDetail()protected booleanisExpired(DrawContext dc, Geometry geom)booleanisHighlighted()Indicates whether to highlight the shape.boolean[]isTerrainConforming()Returns the old-style indicators of the airspace's lower and upper surface datums.booleanisVisible()protected voidmakeExtremePoints(Globe globe, double verticalExaggeration, java.lang.Iterable<? extends LatLon> locations, java.util.List<Vec4> extremePoints)protected voidmakeOrderedRenderable(DrawContext dc)voidmove(Position position)Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.voidmoveTo(Position position)Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.voidmoveTo(Globe globe, Position position)Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.protected booleanmustDrawInterior(DrawContext dc)protected booleanmustDrawOutline(DrawContext dc)protected longnextExpiryTime(DrawContext dc, boolean[] terrainConformance)voidpick(DrawContext dc, java.awt.Point pickPoint)Executes a pick of the ordered renderable.voidpreRender(DrawContext dc)protected voidregenerateSurfaceShape(DrawContext dc, SurfaceShape shape)Regenerates surface shape geometry prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.voidrender(DrawContext dc)Causes thisRenderableto render itself using the provided draw context.voidrestoreState(java.lang.String stateInXml)Restores the object's state to what is described in the specified XML document string.voidsetAltitude(double altitude)Sets the lower and upper airspace surface altitudes to the same value.voidsetAltitudeDatum(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.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.voidsetAttributes(AirspaceAttributes attributes)voidsetAttributes(ShapeAttributes attributes)Set the shape's attributes.voidsetDelegateOwner(java.lang.Object delegateOwner)voidsetDetailLevels(java.util.Collection<DetailLevel> detailLevels)voidsetDragEnabled(boolean enabled)Controls whether the object is enabled for dragging.voidsetDrawSurfaceShape(boolean drawSurfaceShape)Specifies whether this airspace should be drawn flat and on the surface, ignoring any altitude information specified in the shape.voidsetEnableBatchPicking(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.voidsetEnableBatchRendering(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.voidsetEnableDepthOffset(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.voidsetEnableLevelOfDetail(boolean enableLevelOfDetail)protected voidsetExpiryRange(long minTimeMillis, long maxTimeMillis)protected voidsetExpiryTime(long timeMillis)protected voidsetGeometryBuilder(GeometryBuilder gb)voidsetGroundReference(LatLon groundReference)Sets the reference location used to determine the elevation offset for airspace surfaces whose altitude datum isAVKey.ABOVE_GROUND_REFERENCE.voidsetHighlightAttributes(AirspaceAttributes highlightAttrs)Specifies this shape's highlight attributes.voidsetHighlightAttributes(ShapeAttributes highlightAttributes)Set the shape's highlight attributes.voidsetHighlighted(boolean highlighted)Specifies whether to highlight the shape.voidsetOutlinePickWidth(int outlinePickWidth)Specifies the outline line width to use during picking.voidsetTerrainConforming(boolean terrainConformant)Sets the altitude datum for both the lower and upper airspace surface to the same specified value.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.voidsetVisible(boolean visible)protected voidupdateExpiryCriteria(DrawContext dc, Geometry geom)protected voidupdateSurfaceShape(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:
setVisiblein interfaceAirspace
-
getAttributes
public AirspaceAttributes getAttributes()
Description copied from interface:AttributableReturn the shape's current attributes.- Specified by:
getAttributesin interfaceAirspace- Specified by:
getAttributesin interfaceAttributable- Returns:
- the shape's current attributes.
-
setAttributes
public void setAttributes(AirspaceAttributes attributes)
- Specified by:
setAttributesin interfaceAirspace
-
setAttributes
public void setAttributes(ShapeAttributes attributes)
Description copied from interface:AttributableSet the shape's attributes.- Specified by:
setAttributesin interfaceAttributable- Parameters:
attributes- the attributes to assign to the shape.
-
setHighlightAttributes
public void setHighlightAttributes(ShapeAttributes highlightAttributes)
Description copied from interface:AttributableSet the shape's highlight attributes.- Specified by:
setHighlightAttributesin interfaceAttributable- Parameters:
highlightAttributes- the highlight attributes to assign to the shape.
-
getHighlightAttributes
public AirspaceAttributes getHighlightAttributes()
Description copied from interface:AirspaceReturns this shape's highlight attributes.- Specified by:
getHighlightAttributesin interfaceAirspace- Specified by:
getHighlightAttributesin interfaceAttributable- Returns:
- this shape's highlight attributes. May be null.
-
setHighlightAttributes
public void setHighlightAttributes(AirspaceAttributes highlightAttrs)
Description copied from interface:AirspaceSpecifies this shape's highlight attributes.- Specified by:
setHighlightAttributesin interfaceAirspace- Parameters:
highlightAttrs- the highlight attributes. May be null, in which case default attributes are used.
-
isHighlighted
public boolean isHighlighted()
Description copied from interface:HighlightableIndicates whether to highlight the shape.- Specified by:
isHighlightedin interfaceHighlightable- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Description copied from interface:HighlightableSpecifies whether to highlight the shape.- Specified by:
setHighlightedin interfaceHighlightable- Parameters:
highlighted- true to highlight the shape, otherwise false.
-
getAltitudes
public double[] getAltitudes()
Description copied from interface:AirspaceReturns the current airspace surface altitudes.- Specified by:
getAltitudesin interfaceAirspace- Returns:
- a two-element array of
doublewith 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: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- 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:AirspaceSets 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:
setAltitudein 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:AirspaceReturns the old-style indicators of the airspace's lower and upper surface datums.- Specified by:
isTerrainConformingin interfaceAirspace- Returns:
- the lower and upper surface datums.
-
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- 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:AirspaceReturns the current altitude datum of the airspace's lower and upper surfaces.- Specified by:
getAltitudeDatumin 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:AirspaceSets 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_LEVELindicates 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_REFERENCEcombines 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:
setAltitudeDatumin 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:AirspaceReturns the current ground reference location.- Specified by:
getGroundReferencein interfaceAirspace- Returns:
- the current ground reference location.
-
setGroundReference
public void setGroundReference(LatLon groundReference)
Description copied from interface:AirspaceSets 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:
setGroundReferencein 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:
isEnableBatchRenderingin 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:
setEnableBatchRenderingin interfaceAirspace- Parameters:
enableBatchRendering- true to enable batch rendering, otherwise false.
-
isEnableBatchPicking
public boolean isEnableBatchPicking()
Indicates whether batch picking is enabled.- Specified by:
isEnableBatchPickingin 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 aSelectEventeven 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:
setEnableBatchPickingin 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:
isEnableDepthOffsetin 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:
setEnableDepthOffsetin 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:
getOutlinePickWidthin 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:
setOutlinePickWidthin interfaceAirspace- Parameters:
outlinePickWidth- the outline pick width. The default is 10.
-
getDelegateOwner
public java.lang.Object getDelegateOwner()
- Specified by:
getDelegateOwnerin interfaceAirspace
-
setDelegateOwner
public void setDelegateOwner(java.lang.Object delegateOwner)
- Specified by:
setDelegateOwnerin interfaceAirspace
-
isAlwaysOnTop
public boolean isAlwaysOnTop()
Description copied from interface:AirspaceIndicates the state of this airspace's always-on-top flag.- Specified by:
isAlwaysOnTopin 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: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- 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:AirspaceIndicates whether this surface shape is always drawn flat and on the surface.- Specified by:
isDrawSurfaceShapein interfaceAirspace- Returns:
trueif this shape is drawn flat and on the surface, otherwisefalse.
-
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- Parameters:
drawSurfaceShape-trueif 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:AirspaceSets 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:
setTerrainConformingin interfaceAirspace- Parameters:
terrainConformant- the altitude datum. SeeAirspace.setTerrainConforming(boolean, boolean)for a description of the possible values.
-
isEnableLevelOfDetail
public boolean isEnableLevelOfDetail()
- Specified by:
isEnableLevelOfDetailin interfaceAirspace
-
setEnableLevelOfDetail
public void setEnableLevelOfDetail(boolean enableLevelOfDetail)
- Specified by:
setEnableLevelOfDetailin interfaceAirspace
-
getDetailLevels
public java.lang.Iterable<DetailLevel> getDetailLevels()
- Specified by:
getDetailLevelsin interfaceAirspace
-
setDetailLevels
public void setDetailLevels(java.util.Collection<DetailLevel> detailLevels)
- Specified by:
setDetailLevelsin 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:
isAirspaceVisiblein 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:AirspaceReturns this Airspace's enclosing volume as anExtentin model coordinates, given a specifiedGlobeand vertical exaggeration (seeSceneController.getVerticalExaggeration().- Specified by:
getExtentin interfaceAirspace- Specified by:
getExtentin 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:AirspaceReturns this Airspace's enclosing volume as anExtentin 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:OrderedRenderableReturns 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:
getDistanceFromEyein 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:
preRenderin interfacePreRenderable
-
createSurfaceShape
protected SurfaceShape createSurfaceShape()
Returns aSurfaceShapethat 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:OrderedRenderableExecutes a pick of the ordered renderable.- Specified by:
pickin interfaceOrderedRenderable- Parameters:
dc- the current draw context.pickPoint- the pick point.
-
render
public void render(DrawContext dc)
Description copied from interface:RenderableCauses thisRenderableto render itself using the provided draw context.- Specified by:
renderin interfaceRenderable- Parameters:
dc- theDrawContextto 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:MovableShift 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:Movable2Move 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:DraggableIndicates whether the object is enabled for dragging.- Specified by:
isDragEnabledin interfaceDraggable- Returns:
- true if the object is enabled, else false.
-
setDragEnabled
public void setDragEnabled(boolean enabled)
Description copied from interface:DraggableControls whether the object is enabled for dragging.- Specified by:
setDragEnabledin interfaceDraggable- Parameters:
enabled-trueif the object is enabled, elsefalse.
-
drag
public void drag(DragContext dragContext)
Description copied from interface:DraggableDrag the object given the providedDragContext.- Specified by:
dragin interfaceDraggable- Parameters:
dragContext- theDragContextof this dragging event.
-
doDrag
protected void doDrag(DragContext dragContext)
-
moveTo
public void moveTo(Position position)
Description copied from interface:MovableMove 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:RestorableReturns an XML document string describing the object's state. This state can be restored later by callingrestoreStateand passing the XML document.- Specified by:
getRestorableStatein 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:RestorableRestores the object's state to what is described in the specified XML document string.- Specified by:
restoreStatein interfaceRestorable- Parameters:
stateInXml- an XML document string describing an object's state.
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
-
-