Class MilStd2525Util
- java.lang.Object
-
- gov.nasa.worldwind.symbology.milstd2525.MilStd2525Util
-
public class MilStd2525Util extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMilStd2525Util.SymbolInfo
-
Field Summary
Fields Modifier and Type Field Description protected static OffsetARCH_DOWN_OFFSETprotected static SizeARCH_DOWN_SIZEprotected static OffsetARCH_UP_OFFSETprotected static SizeARCH_UP_SIZEprotected static OffsetCIRCLE_OFFSETprotected static SizeCIRCLE_SIZEprotected static OffsetCLOVER_C2_HQ_OFFSETprotected static OffsetCLOVER_DOWN_OFFSETprotected static SizeCLOVER_DOWN_SIZEprotected static OffsetCLOVER_OFFSETprotected static SizeCLOVER_SIZEprotected static OffsetCLOVER_UP_OFFSETprotected static SizeCLOVER_UP_SIZEprotected static OffsetDIAMOND_C2_HQ_OFFSETprotected static OffsetDIAMOND_OFFSETprotected static SizeDIAMOND_SIZEprotected static OffsetHAT_DOWN_OFFSETprotected static SizeHAT_DOWN_SIZEprotected static OffsetHAT_UP_OFFSETprotected static SizeHAT_UP_SIZEprotected static OffsetRECTANGLE_C2_HQ_OFFSETprotected static OffsetRECTANGLE_OFFSETprotected static SizeRECTANGLE_SIZEprotected static OffsetSQUARE_C2_HQ_OFFSETprotected static OffsetSQUARE_OFFSETprotected static SizeSQUARE_SIZEprotected static OffsetTENT_DOWN_OFFSETprotected static SizeTENT_DOWN_SIZEprotected static OffsetTENT_UP_OFFSETprotected static SizeTENT_UP_SIZE
-
Constructor Summary
Constructors Constructor Description MilStd2525Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<? extends java.awt.geom.Point2D>computeCenterHeadingIndicatorPoints(DrawContext dc, Vec4 symbolPoint, Angle heading, double length)Compute screen points required to draw a leader line on a tactical symbol.protected static Vec4computeDirectionOfMovement(DrawContext dc, Vec4 symbolPoint, Angle heading, double length)Compute a vector in the direction that a symbol is moving.static java.util.List<? extends java.awt.geom.Point2D>computeGroundHeadingIndicatorPoints(DrawContext dc, Vec4 symbolPoint, Angle heading, double length, double frameHeight)Compute screen points required to draw a leader line on a tactical ground symbol.static MilStd2525Util.SymbolInfocomputeTacticalSymbolInfo(java.lang.String symbolId)static MaterialgetDefaultGraphicMaterial(SymbolCode symbolCode)Determines a default color to apply to a symbol.protected static booleanisObstacle(SymbolCode symbolCode)Indicates whether or not a symbol code identifiers an Obstacle.
-
-
-
Field Detail
-
CLOVER_OFFSET
protected static final Offset CLOVER_OFFSET
-
CLOVER_SIZE
protected static final Size CLOVER_SIZE
-
CLOVER_C2_HQ_OFFSET
protected static final Offset CLOVER_C2_HQ_OFFSET
-
CLOVER_UP_OFFSET
protected static final Offset CLOVER_UP_OFFSET
-
CLOVER_UP_SIZE
protected static final Size CLOVER_UP_SIZE
-
CLOVER_DOWN_OFFSET
protected static final Offset CLOVER_DOWN_OFFSET
-
CLOVER_DOWN_SIZE
protected static final Size CLOVER_DOWN_SIZE
-
ARCH_UP_OFFSET
protected static final Offset ARCH_UP_OFFSET
-
ARCH_UP_SIZE
protected static final Size ARCH_UP_SIZE
-
ARCH_DOWN_OFFSET
protected static final Offset ARCH_DOWN_OFFSET
-
ARCH_DOWN_SIZE
protected static final Size ARCH_DOWN_SIZE
-
CIRCLE_OFFSET
protected static final Offset CIRCLE_OFFSET
-
CIRCLE_SIZE
protected static final Size CIRCLE_SIZE
-
RECTANGLE_OFFSET
protected static final Offset RECTANGLE_OFFSET
-
RECTANGLE_SIZE
protected static final Size RECTANGLE_SIZE
-
RECTANGLE_C2_HQ_OFFSET
protected static final Offset RECTANGLE_C2_HQ_OFFSET
-
HAT_UP_OFFSET
protected static final Offset HAT_UP_OFFSET
-
HAT_UP_SIZE
protected static final Size HAT_UP_SIZE
-
HAT_DOWN_OFFSET
protected static final Offset HAT_DOWN_OFFSET
-
HAT_DOWN_SIZE
protected static final Size HAT_DOWN_SIZE
-
SQUARE_OFFSET
protected static final Offset SQUARE_OFFSET
-
SQUARE_SIZE
protected static final Size SQUARE_SIZE
-
SQUARE_C2_HQ_OFFSET
protected static final Offset SQUARE_C2_HQ_OFFSET
-
TENT_UP_OFFSET
protected static final Offset TENT_UP_OFFSET
-
TENT_UP_SIZE
protected static final Size TENT_UP_SIZE
-
TENT_DOWN_OFFSET
protected static final Offset TENT_DOWN_OFFSET
-
TENT_DOWN_SIZE
protected static final Size TENT_DOWN_SIZE
-
DIAMOND_OFFSET
protected static final Offset DIAMOND_OFFSET
-
DIAMOND_SIZE
protected static final Size DIAMOND_SIZE
-
DIAMOND_C2_HQ_OFFSET
protected static final Offset DIAMOND_C2_HQ_OFFSET
-
-
Method Detail
-
computeTacticalSymbolInfo
public static MilStd2525Util.SymbolInfo computeTacticalSymbolInfo(java.lang.String symbolId)
-
computeCenterHeadingIndicatorPoints
public static java.util.List<? extends java.awt.geom.Point2D> computeCenterHeadingIndicatorPoints(DrawContext dc, Vec4 symbolPoint, Angle heading, double length)
Compute screen points required to draw a leader line on a tactical symbol. This method returns two points that will draw a line out from the center of the symbol.- Parameters:
dc- Current draw context.symbolPoint- Symbol position in model coordinates.heading- Direction of movement, as a bearing clockwise from North.length- Length of the indicator line, in pixels.- Returns:
- List of screen points that describe the speed leader line.
-
computeGroundHeadingIndicatorPoints
public static java.util.List<? extends java.awt.geom.Point2D> computeGroundHeadingIndicatorPoints(DrawContext dc, Vec4 symbolPoint, Angle heading, double length, double frameHeight)
Compute screen points required to draw a leader line on a tactical ground symbol. This method returns three points that will draw a line down from the base of the symbol and then out in the direction of movement.- Parameters:
dc- Current draw context.symbolPoint- Symbol position in model coordinates.heading- Direction of movement, as a bearing clockwise from North.length- Length of the indicator line, in pixels.frameHeight- Height of the symbol's bounding rectangle, in pixels.- Returns:
- List of screen points that describe the speed leader line.
-
computeDirectionOfMovement
protected static Vec4 computeDirectionOfMovement(DrawContext dc, Vec4 symbolPoint, Angle heading, double length)
Compute a vector in the direction that a symbol is moving.- Parameters:
dc- Current draw context.symbolPoint- Symbol position in model coordinates.heading- Heading as a bearing clockwise from North.length- Length of the leader line, in pixels. The computed vector will have magnitude equal to this distance in pixels multiplied by the size of a pixel (in meters) at the position of the symbol relative to the current view.- Returns:
- A vector that points in the direction of a symbol's movement.
-
getDefaultGraphicMaterial
public static Material getDefaultGraphicMaterial(SymbolCode symbolCode)
Determines a default color to apply to a symbol. MIL-STD-2525C section 5.5.1.1 (pg. 37) states that obstacles should be displayed in green, friendly entities in black or blue, and hostile entities in red. This method return green for obstacles and neutral entities, black for friendly entities, red for hostile entities, and yellow for unknown and pending entities.- Parameters:
symbolCode- Symbol for which to determine color.- Returns:
- Default material for the specified symbol.
-
isObstacle
protected static boolean isObstacle(SymbolCode symbolCode)
Indicates whether or not a symbol code identifiers an Obstacle. Obstacles defined in the Mobility and Survivability category of MIL-STD-2525C Appendix B.- Parameters:
symbolCode- Symbol code to test.- Returns:
- True if the symbol code represents an obstacle, otherwise false.
-
-