public class DirectedSurfacePolyline extends SurfacePolyline
SurfacePolyline
that draws arrowheads between the polyline positions to indicate direction. All arrowheads
are drawn at a constant geographic size (the arrows get smaller as the view moves away from the path, and larger as
the view get closer to the path). One arrowhead is drawn on each polyline segment, unless the segment is smaller than
the arrowhead, in which case the arrowhead is not drawn.AbstractSurfaceShape.GeometryKey, AbstractSurfaceShape.SurfaceShapeStateKey
AbstractSurfaceObject.CacheEntry, AbstractSurfaceObject.SurfaceObjectStateKey
Modifier and Type | Field and Description |
---|---|
protected Angle |
arrowAngle
The angle of the arrowhead tip.
|
protected double |
arrowLength
The length, in meters, of the arrowhead, from tip to base.
|
static Angle |
DEFAULT_ARROW_ANGLE
Default arrow angle.
|
static double |
DEFAULT_ARROW_LENGTH
Default arrow length, in meters.
|
static double |
DEFAULT_MAX_SCREEN_SIZE
Default maximum screen size of the arrowheads, in pixels.
|
protected double |
maxScreenSize
The maximum screen size, in pixels, of the direction arrowheads.
|
closed, locations
activeAttrs, activeGeometry, activeOutlineGeometry, areaMeasurer, areaMeasurerLastModifiedTime, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_INTERIOR_MATERIAL, DEFAULT_MAX_EDGE_INTERVALS, DEFAULT_MIN_EDGE_INTERVALS, DEFAULT_OUTLINE_MATERIAL, DEFAULT_PATH_TYPE, DEFAULT_TEXELS_PER_EDGE_INTERVAL, defaultAttrs, dragEnabled, draggableSupport, geometryCache, highlightAttrs, highlighted, maxEdgeIntervals, minEdgeIntervals, normalAttrs, pathType, sectorCache, stackHandler, texelsPerEdgeInterval, texture, vertexBuffer
delegateOwner, drawBoundingSectors, enableBatchPicking, extentCache, lastModifiedTime, nextUniqueId, pickLayer, pickSupport, pickTileBuilder, uniqueId, visible
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
Constructor and Description |
---|
DirectedSurfacePolyline()
Constructs a new directed surface polyline with the default attributes and no locations.
|
DirectedSurfacePolyline(DirectedSurfacePolyline source)
Creates a shallow copy of the specified source shape.
|
DirectedSurfacePolyline(java.lang.Iterable<? extends LatLon> iterable)
Constructs a new directed surface polyline with the default attributes and the specified iterable of locations.
|
DirectedSurfacePolyline(ShapeAttributes normalAttrs)
Constructs a new directed surface polyline with the specified normal (as opposed to highlight) attributes and no
locations.
|
DirectedSurfacePolyline(ShapeAttributes normalAttrs,
java.lang.Iterable<? extends LatLon> iterable)
Constructs a new directed surface polyline with the specified normal (as opposed to highlight) attributes and the
specified iterable of locations.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeArrowheadGeometry(DrawContext dc,
SurfaceTileDrawContext sdc,
LatLon begin,
LatLon end)
Compute the geometry of a direction arrow for a polyline segment.
|
protected void |
computeDirectionArrows(DrawContext dc,
SurfaceTileDrawContext sdc)
Computes the geometry of the direction arrows.
|
protected void |
drawDirectionArrows(DrawContext dc)
Draws this DirectedSurfacePolyline's direction arrows.
|
protected void |
drawOutline(DrawContext dc,
SurfaceTileDrawContext sdc)
Overridden to also draw direction arrows.
|
Angle |
getArrowAngle()
Indicates the angle of the direction arrowheads.
|
double |
getArrowLength()
Indicates the length, in meters, of the direction arrowheads, from base to tip.
|
double |
getMaxScreenSize()
Indicates the maximum screen size, in pixels, of the direction arrowheads.
|
void |
setArrowAngle(Angle arrowAngle)
Specifies the angle of the direction arrowheads.
|
void |
setArrowLength(double arrowLength)
Specifies the length, in meters, of the direction arrowheads, from base to tip.
|
void |
setMaxScreenSize(double maxScreenSize)
Specifies the maximum screen size, in pixels, of the direction arrowheads.
|
canContainPole, createGeometry, doGetRestorableState, doMoveTo, doMoveTo, doRestoreState, drawInterior, exportAsKML, getLocations, getLocations, getReferencePosition, isClosed, legacyRestoreState, setClosed, setLocations
addIntermediateLocations, applyInteriorState, applyInteriorTextureState, applyModelviewTransform, applyOutlineState, beginDrawing, clearCaches, combine, combineBounds, combineContours, computeEdgeIntervalsPerDegree, computeEdgeIntervalsPerDegree, computeSectors, computeSectors, containsPole, createActiveAttributes, createGeometry, createGeometryKey, cutAlongDateLine, determineActiveAttributes, determineActiveGeometry, doCombineContour, doCombineContours, doDrag, doDrawGeographic, doTessellateInterior, drag, drawGeographic, drawLineStrip, endDrawing, export, generateIntermediateLocations, getActiveAttributes, getActiveGeometry, getArea, getArea, getAttributes, getCachedGeometry, getExtent, getHeight, getHighlightAttributes, getInteriorTexture, getLength, getMinAndMaxEdgeIntervals, getPathType, getPerimeter, getRestorableState, getSectors, getStateKey, getTexelsPerEdgeInterval, getWidth, handleUnsuccessfulInteriorTessellation, isDragEnabled, isExportFormatSupported, isHighlighted, isSectorEmpty, makeOrderedPreRenderable, move, moveTo, moveTo, pathTypeFromString, repeatAroundDateline, restoreState, setAttributes, setDragEnabled, setHighlightAttributes, setHighlighted, setMinAndMaxEdgeIntervals, setPathType, setTexelsPerEdgeInterval, setupAreaMeasurer, tessellateInterior, tessellateInteriorVertices
buildPickRepresentation, computeExtent, computeExtent, createPickedObject, createPickTileBuilder, drawBoundingSectors, drawOrderedRenderable, drawPickRepresentation, getDelegateOwner, getDistanceFromEye, getExtent, getUniqueId, intersectsFrustum, intersectsPickFrustum, intersectsVisibleSector, isDrawBoundingSectors, isEnableBatchPicking, isVisible, makeOrderedRenderable, nextUniqueId, onShapeChanged, pick, pickBatched, pickOrderedRenderable, preRender, render, setDelegateOwner, setDrawBoundingSectors, setEnableBatchPicking, setVisible, updateModifiedTime
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
export, isExportFormatSupported
getDelegateOwner, getDistanceFromEye, getExtent, isEnableBatchPicking, isVisible, pick, preRender, setDelegateOwner, setEnableBatchPicking, setVisible
render
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected Angle arrowAngle
protected double arrowLength
public static final Angle DEFAULT_ARROW_ANGLE
public static final double DEFAULT_ARROW_LENGTH
public static final double DEFAULT_MAX_SCREEN_SIZE
protected double maxScreenSize
public DirectedSurfacePolyline()
public DirectedSurfacePolyline(DirectedSurfacePolyline source)
source
- the shape to copy.public DirectedSurfacePolyline(java.lang.Iterable<? extends LatLon> iterable)
iterable
- the polyline locations.java.lang.IllegalArgumentException
- if the locations iterable is null.public DirectedSurfacePolyline(ShapeAttributes normalAttrs)
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.public DirectedSurfacePolyline(ShapeAttributes normalAttrs, java.lang.Iterable<? extends LatLon> iterable)
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.iterable
- the polyline locations.java.lang.IllegalArgumentException
- if the locations iterable is null.protected void computeArrowheadGeometry(DrawContext dc, SurfaceTileDrawContext sdc, LatLon begin, LatLon end)
dc
- the current draw context.sdc
- the context containing a geographic region and screen viewport corresponding to a surface tile.begin
- the polyline segment's beginning location.end
- the polyline segment's ending location.protected void computeDirectionArrows(DrawContext dc, SurfaceTileDrawContext sdc)
drawOutline(gov.nasa.worldwind.render.DrawContext,
gov.nasa.worldwind.util.SurfaceTileDrawContext)
.dc
- the current draw context.sdc
- the context containing a geographic region and screen viewport corresponding to a surface tile.protected void drawDirectionArrows(DrawContext dc)
drawOutline(gov.nasa.worldwind.render.DrawContext,
gov.nasa.worldwind.util.SurfaceTileDrawContext)
after drawing the polyline's actual outline.dc
- the current draw context.protected void drawOutline(DrawContext dc, SurfaceTileDrawContext sdc)
drawOutline
in class AbstractSurfaceShape
dc
- the current draw context.sdc
- the context containing a geographic region and screen viewport corresponding to a surface tile.public Angle getArrowAngle()
public double getArrowLength()
public double getMaxScreenSize()
maxScreenSize
pixels.public void setArrowAngle(Angle arrowAngle)
arrowAngle
- angle of the direction arrowhead tip. Valid values are between 0 degrees and 90 degrees.public void setArrowLength(double arrowLength)
arrowLength
- length, in meters, of the direction arrowheads. The length must be greater than zero.public void setMaxScreenSize(double maxScreenSize)
maxScreenSize
pixels.maxScreenSize
- the maximum screen size, in pixels, of the direction arrowheads, measured tip to base.