Class Box
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.airspaces.AbstractAirspace
-
- gov.nasa.worldwind.render.airspaces.Box
-
- All Implemented Interfaces:
AVList,Draggable,MessageListener,ExtentHolder,Movable,Movable2,Airspace,Attributable,Highlightable,OrderedRenderable,PreRenderable,Renderable,Restorable,WWObject,java.beans.PropertyChangeListener,java.util.EventListener
public class Box extends AbstractAirspace
-
-
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 static doubleDEFAULT_CENTER_LINE_OFFSETprotected static intDEFAULT_CENTER_LINE_STIPPLE_FACTORprotected static shortDEFAULT_CENTER_LINE_STIPPLE_PATTERNprotected static intDEFAULT_PILLARSprotected static intDEFAULT_STACKS-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyCenterLineState(DrawContext dc)protected BoxcomputeExtent(Globe globe, double verticalExaggeration)protected java.util.List<Vec4>computeMinimalGeometry(Globe globe, double verticalExaggeration)protected Vec4computeReferenceCenter(DrawContext dc)protected SurfaceShapecreateSurfaceShape()Returns aSurfaceShapethat corresponds to this Airspace and is used for drawing on 2D globes.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)Angle[]getCornerAzimuths()Indicates the azimuth angles for this box's four corners, relative to geographic north.protected intgetHeightStacks()LatLon[]getLocations()protected intgetPillars()PositiongetReferencePosition()A position associated with the object that indicates its aggregate geographic position.protected intgetStacks()double[]getWidths()protected voidinvalidateGeometry()boolean[]isEnableCaps()booleanisEnableCenterLine()protected booleanisForceCullFace()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.voidsetCornerAzimuths(Angle beginLeftAzimuth, Angle beginRightAzimuth, Angle endLeftAzimuth, Angle endRightAzimuth)Specifies the azimuth angles for this box's four corners, relative to geographic north.voidsetEnableCaps(boolean enable)voidsetEnableCaps(boolean enableStartCap, boolean enableEndCap)voidsetEnableCenterLine(boolean enable)voidsetEnableEndCap(boolean enable)voidsetEnableStartCap(boolean enable)protected voidsetForceCullFace(boolean forceCullFace)voidsetLocations(LatLon beginLocation, LatLon endLocation)Sets the leg's locations, in geographic coordinates.protected voidsetPillars(int pillars)protected voidsetStacks(int stacks)voidsetWidths(double leftWidth, double rightWidth)-
Methods inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
addDetailLevels, adjustForGroundReference, beginRendering, clearElevationMap, computeDetailLevel, computeElevationAt, computeExtent, computeEyeDistance, computeMinimalGeometry, computePointFromPosition, computeReferencePosition, createPickedObject, 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, invalidateAirspaceData, isAirspaceCollapsed, isAirspaceVisible, isAlwaysOnTop, isDragEnabled, isDrawSurfaceShape, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isEnableLevelOfDetail, isExpired, isHighlighted, isTerrainConforming, isVisible, makeExtremePoints, makeOrderedRenderable, move, moveTo, moveTo, mustDrawInterior, mustDrawOutline, nextExpiryTime, pick, preRender, render, restoreState, setAltitude, setAltitudeDatum, setAltitudes, setAlwaysOnTop, setAttributes, setAttributes, setDelegateOwner, setDetailLevels, setDragEnabled, setDrawSurfaceShape, setEnableBatchPicking, setEnableBatchRendering, setEnableDepthOffset, setEnableLevelOfDetail, setExpiryRange, setExpiryTime, setGeometryBuilder, setGroundReference, setHighlightAttributes, setHighlightAttributes, setHighlighted, setOutlinePickWidth, setTerrainConforming, 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
-
DEFAULT_PILLARS
protected static final int DEFAULT_PILLARS
- See Also:
- Constant Field Values
-
DEFAULT_STACKS
protected static final int DEFAULT_STACKS
- See Also:
- Constant Field Values
-
DEFAULT_CENTER_LINE_STIPPLE_FACTOR
protected static final int DEFAULT_CENTER_LINE_STIPPLE_FACTOR
- See Also:
- Constant Field Values
-
DEFAULT_CENTER_LINE_STIPPLE_PATTERN
protected static final short DEFAULT_CENTER_LINE_STIPPLE_PATTERN
- See Also:
- Constant Field Values
-
DEFAULT_CENTER_LINE_OFFSET
protected static final double DEFAULT_CENTER_LINE_OFFSET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Box
public Box(Box source)
-
Box
public Box(AirspaceAttributes attributes)
-
Box
public Box()
-
-
Method Detail
-
getLocations
public LatLon[] getLocations()
-
setLocations
public void setLocations(LatLon beginLocation, LatLon endLocation)
Sets the leg's locations, in geographic coordinates.- Parameters:
beginLocation- geographic coordinates(latitude and longitude) specifying the center of the begining edge.endLocation- geographic coordinates(latitude and longitude) specifying the center of the ending edge.- Throws:
java.lang.IllegalArgumentException- if location1 or location2 is null
-
getWidths
public double[] getWidths()
-
setWidths
public void setWidths(double leftWidth, double rightWidth)
-
getCornerAzimuths
public Angle[] getCornerAzimuths()
Indicates the azimuth angles for this box's four corners, relative to geographic north. Angles are organized in the returned array as follows: begin left, begin right, end left, end right. Null elements in any index indicate that the default angle is used.- Returns:
- an array of length four indicating this box's corner azimuths.
-
setCornerAzimuths
public void setCornerAzimuths(Angle beginLeftAzimuth, Angle beginRightAzimuth, Angle endLeftAzimuth, Angle endRightAzimuth)
Specifies the azimuth angles for this box's four corners, relative to geographic north. Specifying a null argument indicates that the default angle should be used.- Parameters:
beginLeftAzimuth- Beginning left corner azimuth.beginRightAzimuth- Beginning right corner azimuth.endLeftAzimuth- Ending left corner azimuth.endRightAzimuth- Ending right corner azimuth.
-
isEnableCaps
public boolean[] isEnableCaps()
-
setEnableCaps
public void setEnableCaps(boolean enableStartCap, boolean enableEndCap)
-
setEnableCaps
public void setEnableCaps(boolean enable)
-
setEnableStartCap
public void setEnableStartCap(boolean enable)
-
setEnableEndCap
public void setEnableEndCap(boolean enable)
-
isEnableCenterLine
public boolean isEnableCenterLine()
-
setEnableCenterLine
public void setEnableCenterLine(boolean enable)
-
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.
-
invalidateGeometry
protected void invalidateGeometry()
-
computeExtent
protected Box computeExtent(Globe globe, double verticalExaggeration)
- Specified by:
computeExtentin classAbstractAirspace
-
computeMinimalGeometry
protected java.util.List<Vec4> computeMinimalGeometry(Globe globe, double verticalExaggeration)
- Specified by:
computeMinimalGeometryin classAbstractAirspace
-
createSurfaceShape
protected SurfaceShape createSurfaceShape()
Description copied from class:AbstractAirspaceReturns aSurfaceShapethat corresponds to this Airspace and is used for drawing on 2D globes.- Overrides:
createSurfaceShapein classAbstractAirspace- Returns:
- The surface shape to represent this Airspace on a 2D globe.
-
regenerateSurfaceShape
protected void regenerateSurfaceShape(DrawContext dc, SurfaceShape shape)
Description copied from class:AbstractAirspaceRegenerates surface shape geometry prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.- Overrides:
regenerateSurfaceShapein classAbstractAirspace- Parameters:
dc- the current drawing context.shape- the surface shape to regenerate.
-
doMoveTo
protected void doMoveTo(Globe globe, Position oldRef, Position newRef)
- Overrides:
doMoveToin classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Position oldRef, Position newRef)
- Overrides:
doMoveToin classAbstractAirspace
-
isForceCullFace
protected boolean isForceCullFace()
-
setForceCullFace
protected void setForceCullFace(boolean forceCullFace)
-
getPillars
protected int getPillars()
-
setPillars
protected void setPillars(int pillars)
-
getStacks
protected int getStacks()
-
setStacks
protected void setStacks(int stacks)
-
getHeightStacks
protected int getHeightStacks()
-
computeReferenceCenter
protected Vec4 computeReferenceCenter(DrawContext dc)
-
doRenderGeometry
protected void doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
- Specified by:
doRenderGeometryin classAbstractAirspace
-
applyCenterLineState
protected void applyCenterLineState(DrawContext dc)
-
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doGetRestorableStatein classAbstractAirspace
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doRestoreStatein classAbstractAirspace
-
-