Class InfiltrationLane
- 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.InfiltrationLane
-
- All Implemented Interfaces:
AVList,Draggable,Movable,Highlightable,Renderable,MilStd2525TacticalGraphic,TacticalGraphic
public class InfiltrationLane extends AbstractMilStd2525TacticalGraphic
Implementation of the Infiltration Lane graphic (2.X.2.5.2.4).
-
-
Field Summary
Fields Modifier and Type Field Description protected doublecurvatureFactor that controls the curve of the line.static doubleDEFAULT_CURVATUREDefault factor that determines the curvature of the line.static intDEFAULT_NUM_INTERVALSDefault number of intervals used to draw the curve.protected intintervalsNumber of intervals used to draw the curve.protected static intNUM_CONTROL_POINTSNumber of control points that define the curve.protected Path[]pathsPath used to render the line.protected Positionposition1First control point.protected Positionposition2Second control point.protected Positionposition3Third control point.-
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 InfiltrationLane(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 voidapplyDelegateOwner(java.lang.Object owner)Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic.protected Vec4bezierNearestPointToSegment(Vec4 p0, Vec4 p1, Vec4[] controlPoints, int[] coefficients, double tolerance)Determine the point along a Bezier curve that is closest to a line segment.protected Vec4[]computeBezierControlPoints(DrawContext dc, Vec4 start, Vec4 end, int numControlPoints, double curvature)Compute the position of control points that will generate a Bezier curve that looks like the Infiltration Lane graphic in MIL-STD-2525C (pg.protected voidcreateLabels()Create labels for the start and end of the path.protected PathcreatePath(java.util.List<Position> positions)Create and configure the Path used to render this graphic.protected voidcreateShapes(DrawContext dc)Create the list of positions that describe the arrow.protected voiddetermineLabelPositions(DrawContext dc)Determine positions for the start and end labels.protected voiddoRenderGraphic(DrawContext dc)Render this graphic, without modifiers.doublegetCurvature()Indicates a factor that determines the curvature of the line.intgetIntervals()Indicates the number of intervals used to draw the curve in this graphic.protected intgetNumControlPoints()Indicates the number of control points that define the curve.java.lang.Iterable<? extends Position>getPositions()Indicates the positions of the control points that place and orient the graphic.PositiongetReferencePosition()A position associated with the object that indicates its aggregate geographic position.static java.util.List<java.lang.String>getSupportedGraphics()Indicates the graphics supported by this class.protected voidonShapeChanged()voidsetCurvature(double factor)Specifies a factor that determines the curvature of the line.voidsetIntervals(int intervals)Specifies the number of intervals used to draw the curve in this graphic.voidsetPositions(java.lang.Iterable<? extends Position> positions)Specifies the positions of the control points that place and orient the graphic.-
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, computeGeometry, 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_CURVATURE
public static final double DEFAULT_CURVATURE
Default factor that determines the curvature of the line.- See Also:
- Constant Field Values
-
NUM_CONTROL_POINTS
protected static final int NUM_CONTROL_POINTS
Number of control points that define the curve.- See Also:
- Constant Field Values
-
intervals
protected int intervals
Number of intervals used to draw the curve.
-
curvature
protected double curvature
Factor that controls the curve of the line. Valid values are 0 to 1. Larger values result in a more pronounced curve.
-
position1
protected Position position1
First control point.
-
position2
protected Position position2
Second control point.
-
position3
protected Position position3
Third control point.
-
paths
protected Path[] paths
Path used to render the 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.
-
getCurvature
public double getCurvature()
Indicates a factor that determines the curvature of the line. Valid values are zero to one. A large value results in a more pronounced curve.- Returns:
- The factor that determines the curvature of the line.
-
setCurvature
public void setCurvature(double factor)
Specifies a factor that determines the curvature of the line. Valid values are zero to one. A large value results in a more pronounced curve.- Parameters:
factor- The factor that determines the curvature of the line.
-
setPositions
public void setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.- Parameters:
positions- Control points that orient the graphic. Must provide at least three points.
-
getPositions
public java.lang.Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.- Returns:
- positions that orient the graphic. How many positions are returned depends on the type of graphic. Some graphics require only a single position, others require many.
-
getReferencePosition
public Position getReferencePosition()
A 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.
-
getNumControlPoints
protected int getNumControlPoints()
Indicates the number of control points that define the curve.- Returns:
- the number of control points.
-
onShapeChanged
protected void onShapeChanged()
-
doRenderGraphic
protected void doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.- Specified by:
doRenderGraphicin classAbstractTacticalGraphic- Parameters:
dc- Current draw context.- See Also:
AbstractTacticalGraphic.doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext),AbstractTacticalGraphic.doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)
-
applyDelegateOwner
protected void applyDelegateOwner(java.lang.Object owner)
Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic. This base class will apply the delegate owner to Label objects. Subclasses must implement this method to apply the delegate owner to any Renderables that they will draw in order to render the graphic.- Specified by:
applyDelegateOwnerin classAbstractTacticalGraphic- Parameters:
owner- Current delegate owner.
-
createShapes
protected void createShapes(DrawContext dc)
Create the list of positions that describe the arrow.- Parameters:
dc- Current draw context.
-
bezierNearestPointToSegment
protected Vec4 bezierNearestPointToSegment(Vec4 p0, Vec4 p1, Vec4[] controlPoints, int[] coefficients, double tolerance)
Determine the point along a Bezier curve that is closest to a line segment.- Parameters:
p0- First line segment point.p1- Second line segment point.controlPoints- Control points for Bezier curve.coefficients- Binomial coefficients for computing curve.tolerance- Numerical tolerance. Smaller values will yield a more accurate answer, but will take more iterations to compute.- Returns:
- the point on the curve that is closest to the specified line segment.
-
computeBezierControlPoints
protected Vec4[] computeBezierControlPoints(DrawContext dc, Vec4 start, Vec4 end, int numControlPoints, double curvature)
Compute the position of control points that will generate a Bezier curve that looks like the Infiltration Lane graphic in MIL-STD-2525C (pg. 526).- Parameters:
dc- Current draw context.start- Beginning of the infiltration lane control line.end- End of the infiltration lane control line.numControlPoints- Number of control points to generate. More control points result in more "wiggles" in the line.curvature- Factor that controls the curvature of the line. Valid values are between zero and one. A higher value results in a more pronounced curve.- Returns:
- Control points for a Bezier curve. The first control point is equal to
start, and the last point is equal toend.
-
createLabels
protected void createLabels()
Create labels for the start and end of the path.- Overrides:
createLabelsin classAbstractTacticalGraphic
-
determineLabelPositions
protected void determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.- Overrides:
determineLabelPositionsin classAbstractTacticalGraphic- Parameters:
dc- Current draw context.
-
-