Class DirectionOfAttackAviation
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.symbology.AbstractTacticalGraphic
-
- gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
-
- gov.nasa.worldwind.symbology.milstd2525.graphics.lines.DirectionOfAttack
-
- gov.nasa.worldwind.symbology.milstd2525.graphics.lines.DirectionOfAttackAviation
-
- All Implemented Interfaces:
AVList
,Draggable
,Movable
,Highlightable
,Renderable
,MilStd2525TacticalGraphic
,TacticalGraphic
public class DirectionOfAttackAviation extends DirectionOfAttack
Implementation of the Direction of Attack, Aviation graphic (2.X.2.5.2.2.1).
-
-
Field Summary
Fields Modifier and Type Field Description protected double
bowTieLength
Length of the bow tie part of the graphic, as a fraction of the graphic's total length.protected double
bowTieWidth
Width of the bow tie part of the graphic, as a fraction of the length of the bow tie.protected Angle
curvature
Angle that controls the curve of the line.static double
DEFAULT_BOW_TIE_LENGTH
Default length of the bow tie part of the graphic, as a fraction of the graphic's total length.static double
DEFAULT_BOW_TIE_WIDTH
Default width of the bow tie part of the graphic, as a fraction of the length of the bow tie.static Angle
DEFAULT_CURVATURE
Default angle that determines the curvature of the line.static int
DEFAULT_NUM_INTERVALS
Default number of intervals used to draw the curve.protected int
intervals
Number of intervals used to draw the curve.-
Fields inherited from class gov.nasa.worldwind.symbology.milstd2525.graphics.lines.DirectionOfAttack
arrowAngle, arrowLength, DEFAULT_ARROWHEAD_ANGLE, DEFAULT_ARROWHEAD_LENGTH, DEFAULT_ARROWHEAD_OUTLINE_WIDTH, endPosition, outlineWidth, paths, startPosition
-
Fields inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
maskedSymbolCode, OUTLINE_STIPPLE_FACTOR_ANTICIPATED, OUTLINE_STIPPLE_FACTOR_PRESENT, OUTLINE_STIPPLE_PATTERN, symbolCode
-
Fields inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
activeOverrides, activeShapeAttributes, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_LABEL_INTERIOR_OPACITY, delegateOwner, dragEnabled, draggableSupport, frameTimestamp, highlightAttributes, highlighted, labelOffset, labels, modifiers, mustCreateLabels, normalAttributes, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, text, unitsFormat, visible
-
-
Constructor Summary
Constructors Constructor Description DirectionOfAttackAviation(java.lang.String sidc)
Create a new arrow graphic.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<Position>
createBowTie(DrawContext dc, Position pos1, Position pos2)
Create positions required to to draw the bow tie part of the graphic.protected void
createLabels()
protected void
createShapes(DrawContext dc)
Create the list of positions that describe the arrow.protected void
determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.double
getBowTieLength()
Indicates the length of the bow tie part of the graphic, as a fraction of the graphic's total length.double
getBowTieWidth()
Indicates the width of the bow tie part of the graphic, as a fraction of the length of the bow tie.Angle
getCurvature()
Indicates the angle that determines the curvature of the line.int
getIntervals()
Indicates the number of intervals used to draw the curve in this graphic.static java.util.List<java.lang.String>
getSupportedGraphics()
Indicates the graphics supported by this class.protected Vec4
hermiteCurve(Vec4 pt1, Vec4 pt2, Vec4 tangent1, Vec4 tangent2, double t)
Compute a point along a Hermite curve defined by two control point and tangent vectors at those points.protected void
onShapeChanged()
void
setBowTieLength(double bowTieLength)
Specifies the length of the bow tie part of the graphic, as a fraction of the graphic's total length.void
setBowTieWidth(double bowTieWidth)
Specifies the width of the bow tie part of the graphic, as a fraction of the length of the bow tie.void
setCurvature(Angle angle)
Specifies the angle that determines the curvature of the line.void
setIntervals(int intervals)
Specifies the number of intervals used to draw the curve in this graphic.-
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.graphics.lines.DirectionOfAttack
applyDelegateOwner, computeArrowheadPositions, computeGeometry, createPath, doRenderGraphic, getArrowAngle, getArrowLength, getOutlineWidth, getPositions, getReferencePosition, isDrawOutlined, setArrowAngle, setArrowLength, setOutlineWidth, setPositions
-
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
applyDefaultAttributes, createSymbol, getDefaultMaterial, getIdentifier, getModifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setModifier, setStatus
-
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
addLabel, applyLabelAttributes, applyOverrideAttributes, computeLabelInteriorOpacity, determineActiveAttributes, determineDelegateOwner, determinePerFrameAttributes, doDrag, doRenderGraphicModifiers, doRenderTextModifiers, drag, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDefaultLabelOffset, getDelegateOwner, getHighlightAttributes, getLabelMaterial, getLabelOffset, getUnitsFormat, isDragEnabled, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, move, moveTo, onModifierChanged, render, setAttributes, setDelegateOwner, setDragEnabled, setHighlightAttributes, setHighlighted, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
-
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.render.Highlightable
isHighlighted, setHighlighted
-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
Methods inherited from interface gov.nasa.worldwind.symbology.TacticalGraphic
getAttributes, getDelegateOwner, getHighlightAttributes, getLabelOffset, getUnitsFormat, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, setAttributes, setDelegateOwner, setHighlightAttributes, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
-
-
-
-
Field Detail
-
DEFAULT_NUM_INTERVALS
public static final int DEFAULT_NUM_INTERVALS
Default number of intervals used to draw the curve.- See Also:
- Constant Field Values
-
DEFAULT_BOW_TIE_LENGTH
public static final double DEFAULT_BOW_TIE_LENGTH
Default length of the bow tie part of the graphic, as a fraction of the graphic's total length.- See Also:
- Constant Field Values
-
DEFAULT_BOW_TIE_WIDTH
public static final double DEFAULT_BOW_TIE_WIDTH
Default width of the bow tie part of the graphic, as a fraction of the length of the bow tie.- See Also:
- Constant Field Values
-
DEFAULT_CURVATURE
public static final Angle DEFAULT_CURVATURE
Default angle that determines the curvature of the line.
-
intervals
protected int intervals
Number of intervals used to draw the curve.
-
bowTieLength
protected double bowTieLength
Length of the bow tie part of the graphic, as a fraction of the graphic's total length.
-
bowTieWidth
protected double bowTieWidth
Width of the bow tie part of the graphic, as a fraction of the length of the bow tie.
-
curvature
protected Angle curvature
Angle that controls the curve of the line. A large angle results in a more pronounced curve. An angle of zero results in a straight line.
-
-
Method Detail
-
getSupportedGraphics
public static java.util.List<java.lang.String> getSupportedGraphics()
Indicates the graphics supported by this class.- Returns:
- List of masked SIDC strings that identify graphics that this class supports.
-
getIntervals
public int getIntervals()
Indicates the number of intervals used to draw the curve in this graphic. More intervals results in a smoother curve.- Returns:
- Intervals used to draw arc.
-
setIntervals
public void setIntervals(int intervals)
Specifies the number of intervals used to draw the curve in this graphic. More intervals will result in a smoother looking curve.- Parameters:
intervals
- Number of intervals for drawing the curve.
-
getBowTieLength
public double getBowTieLength()
Indicates the length of the bow tie part of the graphic, as a fraction of the graphic's total length.- Returns:
- Length of the bow tie as a fraction of the total length of the graphic.
-
setBowTieLength
public void setBowTieLength(double bowTieLength)
Specifies the length of the bow tie part of the graphic, as a fraction of the graphic's total length.- Parameters:
bowTieLength
- Length of the bow tie as a fraction of the total length of the graphic.
-
getBowTieWidth
public double getBowTieWidth()
Indicates the width of the bow tie part of the graphic, as a fraction of the length of the bow tie.- Returns:
- Width of the bow tie as a fraction of the length of the bow tie.
-
setBowTieWidth
public void setBowTieWidth(double bowTieWidth)
Specifies the width of the bow tie part of the graphic, as a fraction of the length of the bow tie.- Parameters:
bowTieWidth
- Width of the bow tie as a fraction of the length of the bow tie.
-
getCurvature
public Angle getCurvature()
Indicates the angle that determines the curvature of the line. A large angle results in a more pronounced curve. An angle of zero results in a straight line.- Returns:
- The angle that determines the curvature of the line.
-
setCurvature
public void setCurvature(Angle angle)
Specifies the angle that determines the curvature of the line. A large angle results in a more pronounced curve. An angle of zero results in a straight line.- Parameters:
angle
- The angle that determines the curvature of the line.
-
onShapeChanged
protected void onShapeChanged()
-
createShapes
protected void createShapes(DrawContext dc)
Create the list of positions that describe the arrow.- Overrides:
createShapes
in classDirectionOfAttack
- Parameters:
dc
- Current draw context.
-
createBowTie
protected java.util.List<Position> createBowTie(DrawContext dc, Position pos1, Position pos2)
Create positions required to to draw the bow tie part of the graphic.- Parameters:
dc
- Current draw context.pos1
- Position at the center of one side of the bow tie.pos2
- Position at the center of the other side of the bow tie.- Returns:
- Positions that describe the bow tie.
-
hermiteCurve
protected Vec4 hermiteCurve(Vec4 pt1, Vec4 pt2, Vec4 tangent1, Vec4 tangent2, double t)
Compute a point along a Hermite curve defined by two control point and tangent vectors at those points.This function implements the Hermite curve equation from "Mathematics for 3D Game Programming and Computer Graphics, Second Edition" by Eric Lengyel (equation 15.15, pg. 457).
H(t) = (1 - 3t2 + 2t3)P1 + t2(3 - 2t)P2 + t(t - 1)2T1 + t2(t - 1)T2
- Parameters:
pt1
- First control point.pt2
- Second control point.tangent1
- Vector tangent to the curve at the first control point.tangent2
- Vector tangent to the curve at the second control point.t
- Interpolation parameter in the range [0..1].- Returns:
- A point along the curve.
-
createLabels
protected void createLabels()
- Overrides:
createLabels
in classAbstractTacticalGraphic
-
determineLabelPositions
protected void determineLabelPositions(DrawContext dc)
Description copied from class:AbstractTacticalGraphic
Determine positions for the start and end labels.- Overrides:
determineLabelPositions
in classAbstractTacticalGraphic
- Parameters:
dc
- Current draw context.
-
-