NASA World Wind

gov.nasa.worldwind.symbology.milstd2525.graphics.lines
Class DirectionOfAttackAviation

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.symbology.AbstractTacticalGraphic
          extended by gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
              extended by gov.nasa.worldwind.symbology.milstd2525.graphics.lines.DirectionOfAttack
                  extended by gov.nasa.worldwind.symbology.milstd2525.graphics.lines.DirectionOfAttackAviation
All Implemented Interfaces:
AVList, 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
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, frameTimestamp, highlightAttributes, highlighted, labelOffset, labels, modifiers, mustCreateLabels, normalAttributes, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, text, unitsFormat, visible
 
Constructor Summary
DirectionOfAttackAviation(String sidc)
          Create a new arrow graphic.
 
Method Summary
protected  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 List<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, doRenderGraphicModifiers, doRenderTextModifiers, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDefaultLabelOffset, getDelegateOwner, getHighlightAttributes, getLabelMaterial, getLabelOffset, getUnitsFormat, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, move, moveTo, onModifierChanged, render, setAttributes, setDelegateOwner, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
 
Methods inherited from interface gov.nasa.worldwind.render.Highlightable
isHighlighted, setHighlighted
 
Methods inherited from interface gov.nasa.worldwind.Movable
move, moveTo
 
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

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.


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.


DEFAULT_NUM_INTERVALS

public static final int DEFAULT_NUM_INTERVALS
Default number of intervals used to draw the curve.

See Also:
Constant Field Values

intervals

protected int intervals
Number of intervals used to draw the curve.

Constructor Detail

DirectionOfAttackAviation

public DirectionOfAttackAviation(String sidc)
Create a new arrow graphic.

Parameters:
sidc - Symbol code the identifies the graphic.
Method Detail

createBowTie

protected 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.

createLabels

protected void createLabels()
Overrides:
createLabels in class AbstractTacticalGraphic

createShapes

protected void createShapes(DrawContext dc)
Create the list of positions that describe the arrow.

Overrides:
createShapes in class DirectionOfAttack
Parameters:
dc - Current draw context.

determineLabelPositions

protected void determineLabelPositions(DrawContext dc)
Description copied from class: AbstractTacticalGraphic
Determine positions for the start and end labels.

Overrides:
determineLabelPositions in class AbstractTacticalGraphic
Parameters:
dc - Current draw context.

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.

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.

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.

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.

getSupportedGraphics

public static List<String> getSupportedGraphics()
Indicates the graphics supported by this class.

Returns:
List of masked SIDC strings that identify graphics that this class supports.

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.

onShapeChanged

protected void onShapeChanged()

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.

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.

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.

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.

NASA World Wind