@armyc2.c5isr.renderer/mil-sym-ts-web 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +57 -0
- package/buildNode.bat +2 -0
- package/buildWeb.bat +2 -0
- package/dist/C5Ren.d.ts +6970 -0
- package/dist/C5Ren.js +2 -0
- package/dist/C5Ren.js.map +1 -0
- package/dist/LICENSE +201 -0
- package/dist/README.md +57 -0
- package/dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz +0 -0
- package/dist/manifest.json +4 -0
- package/dist/package.json +16 -0
- package/index.ts +169 -0
- package/package.bak +50 -0
- package/package.json +40 -0
- package/package.node.json +43 -0
- package/package.pack.json +19 -0
- package/package.packWeb.json +16 -0
- package/package.web.json +40 -0
- package/src/main/ts/android/graphics/Bitmap.ts +7 -0
- package/src/main/ts/android/graphics/Paint.ts +26 -0
- package/src/main/ts/android/graphics/Path.ts +78 -0
- package/src/main/ts/android/graphics/PointF.ts +14 -0
- package/src/main/ts/android/graphics/Rect.ts +18 -0
- package/src/main/ts/android/graphics/RectF.ts +50 -0
- package/src/main/ts/android/graphics/Region.ts +36 -0
- package/src/main/ts/android/graphics/Typeface.ts +11 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +99 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +34 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +193 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +2971 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +4008 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +93 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +89 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +515 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +5403 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +1084 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +2173 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +4934 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +7 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +5601 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +14 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +648 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +647 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +2994 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +2663 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +669 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +971 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +871 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +3507 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +500 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +1089 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +2656 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +1419 -0
- package/src/main/ts/armyc2/c5isr/data/genc.json +1407 -0
- package/src/main/ts/armyc2/c5isr/data/msd.json +17311 -0
- package/src/main/ts/armyc2/c5isr/data/mse.json +18500 -0
- package/src/main/ts/armyc2/c5isr/data/svgd.json +31214 -0
- package/src/main/ts/armyc2/c5isr/data/svge.json +30558 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +10 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +437 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +429 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +7 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +35 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +111 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +29 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +18 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +211 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +80 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +33 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +16 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +726 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +141 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +112 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +261 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +391 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +567 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +445 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +31 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +18 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +45 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +25 -0
- package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +15 -0
- package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +22 -0
- package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +269 -0
- package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +9882 -0
- package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +146 -0
- package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +1265 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +64 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +95 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +93 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +114 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +555 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +62 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +120 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +431 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +99 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +25 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +203 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +104 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +481 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +40 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +1323 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +51 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +736 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +106 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +84 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +87 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +34 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +324 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +127 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +18 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +111 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +219 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +1008 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +882 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +380 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +797 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +1699 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +178 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +45 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +126 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +118 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +11 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +1201 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +591 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +29 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +753 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +137 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +438 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +19 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +10 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +5 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +404 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +525 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +55 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +36 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +1055 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +2085 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +157 -0
- package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +86 -0
- package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +3798 -0
- package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +412 -0
- package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +124 -0
- package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +26 -0
- package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +677 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +484 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +62 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +46 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +51 -0
- package/src/main/ts/org/gavaghan/geodesy/Angle.ts +31 -0
- package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +71 -0
- package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +200 -0
- package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +55 -0
- package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +68 -0
- package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +103 -0
- package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +90 -0
- package/test/ExportSPImages.js +692 -0
- package/test/MPWW.html +556 -0
- package/test/MPWorker.js +318 -0
- package/test/SPWorker.js +233 -0
- package/test/SVGWW.html +363 -0
- package/test/singlePointTester3.html +751 -0
- package/tsconfig.json +54 -0
- package/typedoc.json +30 -0
- package/updateVersion.js +21 -0
- package/webpack.config.js +34 -0
- package/webpackn.config.js +28 -0
- package/webpackr.config.js +47 -0
- package/webpackw.config.js +23 -0
|
@@ -0,0 +1,3507 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A class to serve JavaRendererServer
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import { type int, type double } from "../../c5isr/graphics2d/BasicTypes";
|
|
7
|
+
import { BasicStroke } from "../graphics2d/BasicStroke"
|
|
8
|
+
import { Font } from "../graphics2d/Font"
|
|
9
|
+
import { Graphics2D } from "../graphics2d/Graphics2D"
|
|
10
|
+
import { Point2D } from "../graphics2d/Point2D"
|
|
11
|
+
import { Rectangle } from "../graphics2d/Rectangle"
|
|
12
|
+
import { Rectangle2D } from "../graphics2d/Rectangle2D"
|
|
13
|
+
import { CELineArray } from "../JavaLineArray/CELineArray"
|
|
14
|
+
import { DISMSupport } from "../JavaLineArray/DISMSupport"
|
|
15
|
+
import { lineutility } from "../JavaLineArray/lineutility"
|
|
16
|
+
import { POINT2 } from "../JavaLineArray/POINT2"
|
|
17
|
+
import { Shape2 } from "../JavaLineArray/Shape2"
|
|
18
|
+
import { TacticalLines } from "../JavaLineArray/TacticalLines"
|
|
19
|
+
import { clsUtility as clsUtilityJTR } from "../JavaTacticalRenderer/clsUtility"
|
|
20
|
+
import { mdlGeodesic } from "../JavaTacticalRenderer/mdlGeodesic"
|
|
21
|
+
import { Modifier2 } from "../JavaTacticalRenderer/Modifier2"
|
|
22
|
+
import { TGLight } from "../JavaTacticalRenderer/TGLight"
|
|
23
|
+
import { Color } from "../renderer/utilities/Color"
|
|
24
|
+
import { DistanceUnit } from "../renderer/utilities/DistanceUnit"
|
|
25
|
+
import { DrawRules } from "../renderer/utilities/DrawRules"
|
|
26
|
+
import { ErrorLogger } from "../renderer/utilities/ErrorLogger"
|
|
27
|
+
import { IPointConversion } from "../renderer/utilities/IPointConversion"
|
|
28
|
+
import { MilStdSymbol } from "../renderer/utilities/MilStdSymbol"
|
|
29
|
+
import { Modifiers } from "../renderer/utilities/Modifiers"
|
|
30
|
+
import { MSInfo } from "../renderer/utilities/MSInfo"
|
|
31
|
+
import { MSLookup } from "../renderer/utilities/MSLookup"
|
|
32
|
+
import { RendererException } from "../renderer/utilities/RendererException"
|
|
33
|
+
import { RendererSettings } from "../renderer/utilities/RendererSettings"
|
|
34
|
+
import { ShapeInfo } from "../renderer/utilities/ShapeInfo"
|
|
35
|
+
import { SymbolID } from "../renderer/utilities/SymbolID"
|
|
36
|
+
import { SymbolUtilities } from "../renderer/utilities/SymbolUtilities"
|
|
37
|
+
import { clsClipPolygon2 } from "../RenderMultipoints/clsClipPolygon2"
|
|
38
|
+
import { clsClipQuad } from "../RenderMultipoints/clsClipQuad"
|
|
39
|
+
import { clsRenderer2 } from "../RenderMultipoints/clsRenderer2"
|
|
40
|
+
import { clsUtility } from "../RenderMultipoints/clsUtility"
|
|
41
|
+
import { clsUtilityCPOF } from "../RenderMultipoints/clsUtilityCPOF"
|
|
42
|
+
import { clsUtilityGE } from "../RenderMultipoints/clsUtilityGE"
|
|
43
|
+
import { BasicShapes } from "../JavaLineArray/BasicShapes";
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Rendering class
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
export class clsRenderer {
|
|
51
|
+
|
|
52
|
+
private static readonly _className: string = "clsRenderer";
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Set tg geo points from the client points
|
|
56
|
+
*
|
|
57
|
+
* @param milStd
|
|
58
|
+
* @param tg
|
|
59
|
+
*/
|
|
60
|
+
private static setClientCoords(milStd: MilStdSymbol,
|
|
61
|
+
tg: TGLight): void {
|
|
62
|
+
try {
|
|
63
|
+
let latLongs: Array<POINT2> = new Array();
|
|
64
|
+
let j: int = 0;
|
|
65
|
+
let coords: Array<Point2D> = milStd.getCoordinates();
|
|
66
|
+
let pt2d: Point2D;
|
|
67
|
+
let pt2: POINT2;
|
|
68
|
+
let n: int = coords.length;
|
|
69
|
+
//for (j = 0; j < coords.length; j++)
|
|
70
|
+
for (j = 0; j < n; j++) {
|
|
71
|
+
pt2d = coords[j];
|
|
72
|
+
pt2 = clsUtility.Point2DToPOINT2(pt2d);
|
|
73
|
+
latLongs.push(pt2);
|
|
74
|
+
}
|
|
75
|
+
tg.set_LatLongs(latLongs);
|
|
76
|
+
} catch (exc) {
|
|
77
|
+
if (exc instanceof Error) {
|
|
78
|
+
ErrorLogger.LogException("clsRenderer", "setClientCoords",
|
|
79
|
+
new RendererException("Failed to set geo points or pixels for " + milStd.getSymbolID(), exc));
|
|
80
|
+
} else {
|
|
81
|
+
throw exc;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private static getClientCoords(tg: TGLight): Array<Point2D> {
|
|
87
|
+
let coords: Array<Point2D>;
|
|
88
|
+
try {
|
|
89
|
+
let j: int = 0;
|
|
90
|
+
let pt2d: Point2D;
|
|
91
|
+
let pt2: POINT2;
|
|
92
|
+
coords = new Array();
|
|
93
|
+
let n: int = tg.LatLongs.length;
|
|
94
|
+
//for (j = 0; j < tg.LatLongs.length; j++)
|
|
95
|
+
for (j = 0; j < n; j++) {
|
|
96
|
+
pt2 = tg.LatLongs[j];
|
|
97
|
+
pt2d = new Point2D(pt2.x, pt2.y);
|
|
98
|
+
coords.push(pt2d);
|
|
99
|
+
}
|
|
100
|
+
} catch (exc) {
|
|
101
|
+
if (exc instanceof Error) {
|
|
102
|
+
ErrorLogger.LogException("clsRenderer", "getClientCoords",
|
|
103
|
+
new RendererException("Failed to set geo points or pixels for " + tg.get_SymbolId(), exc));
|
|
104
|
+
} else {
|
|
105
|
+
throw exc;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return coords;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Build a tactical graphic object from the client MilStdSymbol
|
|
113
|
+
*
|
|
114
|
+
* @param milStd MilstdSymbol object
|
|
115
|
+
* @param converter geographic to pixels converter
|
|
116
|
+
* @param lineType {@link BasicShapes}
|
|
117
|
+
* @return tactical graphic
|
|
118
|
+
*/
|
|
119
|
+
public static createTGLightFromMilStdSymbolBasicShape(milStd: MilStdSymbol,
|
|
120
|
+
converter: IPointConversion,
|
|
121
|
+
lineType: int): TGLight {
|
|
122
|
+
let tg: TGLight = new TGLight();
|
|
123
|
+
try {
|
|
124
|
+
let useLineInterpolation: boolean = milStd.getUseLineInterpolation();
|
|
125
|
+
tg.set_UseLineInterpolation(useLineInterpolation);
|
|
126
|
+
tg.set_LineType(lineType);
|
|
127
|
+
let status: string = tg.get_Status();
|
|
128
|
+
tg.set_VisibleModifiers(true);
|
|
129
|
+
//set tg latlongs and pixels
|
|
130
|
+
clsRenderer.setClientCoords(milStd, tg);
|
|
131
|
+
//build tg.Pixels
|
|
132
|
+
tg.Pixels = clsUtility.LatLongToPixels(tg.LatLongs, converter);
|
|
133
|
+
//tg.set_Font(new Font("Arial", Font.PLAIN, 12));
|
|
134
|
+
let r: RendererSettings = RendererSettings.getInstance();
|
|
135
|
+
let type: int = r.getMPLabelFontType();
|
|
136
|
+
let name: string = r.getMPLabelFontName();
|
|
137
|
+
let sz: int = r.getMPLabelFontSize();
|
|
138
|
+
let font: Font = new Font(name, type, sz);
|
|
139
|
+
tg.set_Font(font);
|
|
140
|
+
tg.set_FillColor(milStd.getFillColor());
|
|
141
|
+
tg.set_LineColor(milStd.getLineColor());
|
|
142
|
+
tg.set_LineThickness(milStd.getLineWidth());
|
|
143
|
+
tg.set_TexturePaint(milStd.getFillStyle());
|
|
144
|
+
tg.set_Fillstyle(milStd.getPatternFillType());
|
|
145
|
+
tg.set_patternScale(milStd.getPatternScale());
|
|
146
|
+
|
|
147
|
+
tg.setIconSize(milStd.getUnitSize());
|
|
148
|
+
tg.set_KeepUnitRatio(milStd.getKeepUnitRatio());
|
|
149
|
+
|
|
150
|
+
tg.set_FontBackColor(Color.WHITE);
|
|
151
|
+
tg.set_TextColor(milStd.getTextColor());
|
|
152
|
+
if (milStd.getModifier(Modifiers.W_DTG_1) != null) {
|
|
153
|
+
tg.set_DTG(milStd.getModifier(Modifiers.W_DTG_1));
|
|
154
|
+
}
|
|
155
|
+
if (milStd.getModifier(Modifiers.W1_DTG_2) != null) {
|
|
156
|
+
tg.set_DTG1(milStd.getModifier(Modifiers.W1_DTG_2));
|
|
157
|
+
}
|
|
158
|
+
if (milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1) != null) {
|
|
159
|
+
tg.set_H(milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1));
|
|
160
|
+
}
|
|
161
|
+
if (milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2) != null) {
|
|
162
|
+
tg.set_H1(milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2));
|
|
163
|
+
}
|
|
164
|
+
if (milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3) != null) {
|
|
165
|
+
tg.set_H2(milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3));
|
|
166
|
+
}
|
|
167
|
+
if (milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1) != null) {
|
|
168
|
+
tg.set_Name(milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1));
|
|
169
|
+
}
|
|
170
|
+
if (milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2) != null) {
|
|
171
|
+
tg.set_T1(milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2));
|
|
172
|
+
}
|
|
173
|
+
if (milStd.getModifier(Modifiers.V_EQUIP_TYPE) != null) {
|
|
174
|
+
tg.set_V(milStd.getModifier(Modifiers.V_EQUIP_TYPE));
|
|
175
|
+
}
|
|
176
|
+
if (milStd.getModifier(Modifiers.AS_COUNTRY) != null) {
|
|
177
|
+
tg.set_AS(milStd.getModifier(Modifiers.AS_COUNTRY));
|
|
178
|
+
}
|
|
179
|
+
if (milStd.getModifier(Modifiers.AP_TARGET_NUMBER) != null) {
|
|
180
|
+
tg.set_AP(milStd.getModifier(Modifiers.AP_TARGET_NUMBER));
|
|
181
|
+
}
|
|
182
|
+
if (milStd.getModifier(Modifiers.Y_LOCATION) != null) {
|
|
183
|
+
tg.set_Location(milStd.getModifier(Modifiers.Y_LOCATION));
|
|
184
|
+
}
|
|
185
|
+
if (milStd.getModifier(Modifiers.N_HOSTILE) != null) {
|
|
186
|
+
tg.set_N(milStd.getModifier(Modifiers.N_HOSTILE));
|
|
187
|
+
}
|
|
188
|
+
tg.set_UseDashArray(milStd.getUseDashArray());
|
|
189
|
+
tg.set_UseHatchFill(milStd.getUseFillPattern());
|
|
190
|
+
//tg.set_UsePatternFill(milStd.getUseFillPattern());
|
|
191
|
+
tg.set_HideOptionalLabels(milStd.getHideOptionalLabels());
|
|
192
|
+
let isClosedArea: boolean = clsUtilityJTR.isClosedPolygon(lineType);
|
|
193
|
+
|
|
194
|
+
if (isClosedArea) {
|
|
195
|
+
clsUtilityJTR.ClosePolygon(tg.Pixels);
|
|
196
|
+
clsUtilityJTR.ClosePolygon(tg.LatLongs);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let strXAlt: string = "";
|
|
200
|
+
//construct the H1 and H2 modifiers for sector from the mss AM, AN, and X arraylists
|
|
201
|
+
if (lineType == TacticalLines.BS_ELLIPSE) {
|
|
202
|
+
let AM: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
203
|
+
let AN: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
204
|
+
//ensure array length 3
|
|
205
|
+
let r2: double =0;
|
|
206
|
+
let b: double =0;
|
|
207
|
+
if(AM.length==1)
|
|
208
|
+
{
|
|
209
|
+
r2=AM[0];
|
|
210
|
+
AM.push(r2);
|
|
211
|
+
AM.push(0);
|
|
212
|
+
}
|
|
213
|
+
else if(AM.length==2)
|
|
214
|
+
{
|
|
215
|
+
r2=AM[0];
|
|
216
|
+
b=AM[1];
|
|
217
|
+
AM[1] = r2;
|
|
218
|
+
AM.push(b);
|
|
219
|
+
}
|
|
220
|
+
if (AN == null) {
|
|
221
|
+
AN = [];
|
|
222
|
+
}
|
|
223
|
+
if (AN.length < 1) {
|
|
224
|
+
AN.push(0);
|
|
225
|
+
}
|
|
226
|
+
if (AM != null && AM.length >= 2 && AN != null && AN.length >= 1) {
|
|
227
|
+
let ptAzimuth: POINT2 = new POINT2(0, 0);
|
|
228
|
+
ptAzimuth.x = AN[0];
|
|
229
|
+
let ptCenter: POINT2 = tg.Pixels[0];
|
|
230
|
+
let pt0: POINT2 = mdlGeodesic.geodesic_coordinate(tg.LatLongs[0], AM[0], 90);//semi-major axis
|
|
231
|
+
let pt1: POINT2 = mdlGeodesic.geodesic_coordinate(tg.LatLongs[0], AM[1], 0);//semi-minor axis
|
|
232
|
+
let pt02d: Point2D = new Point2D(pt0.x, pt0.y);
|
|
233
|
+
let pt12d: Point2D = new Point2D(pt1.x, pt1.y);
|
|
234
|
+
pt02d = converter.GeoToPixels(pt02d);
|
|
235
|
+
pt12d = converter.GeoToPixels(pt12d);
|
|
236
|
+
pt0 = new POINT2(pt02d.getX(), pt02d.getY());
|
|
237
|
+
pt1 = new POINT2(pt12d.getX(), pt12d.getY());
|
|
238
|
+
tg.Pixels = [];
|
|
239
|
+
tg.Pixels.push(ptCenter);
|
|
240
|
+
tg.Pixels.push(pt0);
|
|
241
|
+
tg.Pixels.push(pt1);
|
|
242
|
+
tg.Pixels.push(ptAzimuth);
|
|
243
|
+
}
|
|
244
|
+
if(AM != null && AM.length>2)
|
|
245
|
+
{
|
|
246
|
+
//use AM[2] for the buffer, so PBS_CIRCLE requires AM size 3 like PBS_ELLIPSE to use a buffer
|
|
247
|
+
let dist: double=AM[2];
|
|
248
|
+
let pt0: POINT2=mdlGeodesic.geodesic_coordinate(tg.LatLongs[0], dist, 45); //azimuth 45 is arbitrary
|
|
249
|
+
let pt02d: Point2D = new Point2D(tg.LatLongs[0].x,tg.LatLongs[0].y);
|
|
250
|
+
let pt12d: Point2D = new Point2D(pt0.x, pt0.y);
|
|
251
|
+
pt02d = converter.GeoToPixels(pt02d);
|
|
252
|
+
pt12d = converter.GeoToPixels(pt12d);
|
|
253
|
+
pt0=new POINT2(pt02d.getX(),pt02d.getY());
|
|
254
|
+
let pt1: POINT2=new POINT2(pt12d.getX(),pt12d.getY());
|
|
255
|
+
dist=lineutility.CalcDistanceDouble(pt0, pt1);
|
|
256
|
+
//arraysupport will use line style to create the buffer shape
|
|
257
|
+
tg.Pixels[0].style=Math.trunc(dist);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
let j: int = 0;
|
|
261
|
+
if (lineType == TacticalLines.BBS_RECTANGLE || lineType == TacticalLines.BS_BBOX) {
|
|
262
|
+
let minLat: double = tg.LatLongs[0].y;
|
|
263
|
+
let maxLat: double = tg.LatLongs[0].y;
|
|
264
|
+
let minLong: double = tg.LatLongs[0].x;
|
|
265
|
+
let maxLong: double = tg.LatLongs[0].x;
|
|
266
|
+
for (j = 1; j < tg.LatLongs.length; j++) {
|
|
267
|
+
if (tg.LatLongs[j].x < minLong) {
|
|
268
|
+
minLong = tg.LatLongs[j].x;
|
|
269
|
+
}
|
|
270
|
+
if (tg.LatLongs[j].x > maxLong) {
|
|
271
|
+
maxLong = tg.LatLongs[j].x;
|
|
272
|
+
}
|
|
273
|
+
if (tg.LatLongs[j].y < minLat) {
|
|
274
|
+
minLat = tg.LatLongs[j].y;
|
|
275
|
+
}
|
|
276
|
+
if (tg.LatLongs[j].y > maxLat) {
|
|
277
|
+
maxLat = tg.LatLongs[j].y;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
tg.LatLongs = [];
|
|
281
|
+
tg.LatLongs.push(new POINT2(minLong, maxLat));
|
|
282
|
+
tg.LatLongs.push(new POINT2(maxLong, maxLat));
|
|
283
|
+
tg.LatLongs.push(new POINT2(maxLong, minLat));
|
|
284
|
+
tg.LatLongs.push(new POINT2(minLong, minLat));
|
|
285
|
+
if (lineType == TacticalLines.BS_BBOX) {
|
|
286
|
+
tg.LatLongs.push(new POINT2(minLong, maxLat));
|
|
287
|
+
}
|
|
288
|
+
tg.Pixels = clsUtility.LatLongToPixels(tg.LatLongs, converter);
|
|
289
|
+
}
|
|
290
|
+
//these have a buffer value in meters which we'll stuff tg.H2
|
|
291
|
+
//and use the style member of tg.Pixels to stuff the buffer width in pixels
|
|
292
|
+
switch (lineType) {
|
|
293
|
+
case TacticalLines.BBS_AREA:
|
|
294
|
+
case TacticalLines.BBS_LINE:
|
|
295
|
+
case TacticalLines.BBS_RECTANGLE:
|
|
296
|
+
let H2: string = null;
|
|
297
|
+
let dist: double = 0;
|
|
298
|
+
let pt0: POINT2;
|
|
299
|
+
let pt1: POINT2;//45 is arbitrary
|
|
300
|
+
let AM: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
301
|
+
if (AM != null && AM.length > 0) {
|
|
302
|
+
H2 = AM[0].toString();
|
|
303
|
+
tg.set_H2(H2);
|
|
304
|
+
}
|
|
305
|
+
if (H2 != null && !(H2.length === 0)) {
|
|
306
|
+
for (j = 0; j < tg.LatLongs.length; j++) {
|
|
307
|
+
if (tg.LatLongs.length > j) {
|
|
308
|
+
if (!isNaN(parseFloat(H2))) {
|
|
309
|
+
if (j == 0) {
|
|
310
|
+
dist = parseFloat(H2);
|
|
311
|
+
pt0 = new POINT2(tg.LatLongs[0]);
|
|
312
|
+
pt1 = mdlGeodesic.geodesic_coordinate(pt0, dist, 45);//45 is arbitrary
|
|
313
|
+
let pt02d: Point2D = new Point2D(pt0.x, pt0.y);
|
|
314
|
+
let pt12d: Point2D = new Point2D(pt1.x, pt1.y);
|
|
315
|
+
pt02d = converter.GeoToPixels(pt02d);
|
|
316
|
+
pt12d = converter.GeoToPixels(pt12d);
|
|
317
|
+
pt0.x = pt02d.getX();
|
|
318
|
+
pt0.y = pt02d.getY();
|
|
319
|
+
pt1.x = pt12d.getX();
|
|
320
|
+
pt1.y = pt12d.getY();
|
|
321
|
+
dist = lineutility.CalcDistanceDouble(pt0, pt1);
|
|
322
|
+
}
|
|
323
|
+
tg.Pixels[j].style = Math.round(dist);
|
|
324
|
+
} else {
|
|
325
|
+
tg.Pixels[j].style = 0;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
break;
|
|
331
|
+
default:
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
if (lineType == TacticalLines.PBS_ELLIPSE) //geo ellipse
|
|
335
|
+
{
|
|
336
|
+
let AM: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
337
|
+
let AN: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
338
|
+
if (AM != null && AM.length > 1) {
|
|
339
|
+
let strAM: string = AM[0].toString(); // major axis
|
|
340
|
+
tg.set_AM(strAM);
|
|
341
|
+
let strAM1: string = AM[1].toString(); // minor axis
|
|
342
|
+
tg.set_AM1(strAM1);
|
|
343
|
+
}
|
|
344
|
+
if (AN != null && AN.length > 0) {
|
|
345
|
+
let strAN: string = AN[0].toString(); // rotation
|
|
346
|
+
tg.set_AN(strAN);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
switch (lineType) {
|
|
350
|
+
case TacticalLines.BBS_AREA:
|
|
351
|
+
case TacticalLines.BBS_LINE:
|
|
352
|
+
case TacticalLines.BBS_POINT:
|
|
353
|
+
case TacticalLines.BBS_RECTANGLE:
|
|
354
|
+
if (tg.get_FillColor() == null) {
|
|
355
|
+
tg.set_FillColor(Color.LIGHT_GRAY);
|
|
356
|
+
}
|
|
357
|
+
break;
|
|
358
|
+
default:
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
switch (lineType) {
|
|
362
|
+
case TacticalLines.PBS_CIRCLE:
|
|
363
|
+
case TacticalLines.BBS_POINT:
|
|
364
|
+
let AM: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
365
|
+
if (AM != null && AM.length > 0) {
|
|
366
|
+
let strAM: string = String(AM[0]);
|
|
367
|
+
//set width for rectangles or radius for circles
|
|
368
|
+
tg.set_AM(strAM);
|
|
369
|
+
} else if (lineType == TacticalLines.BBS_POINT && tg.LatLongs.length > 1) {
|
|
370
|
+
let dist: double = mdlGeodesic.geodesic_distance(tg.LatLongs[0], tg.LatLongs[1], null, null);
|
|
371
|
+
let strT1: string = String(dist);
|
|
372
|
+
tg.set_T1(strT1);
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
default:
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
if (lineType == TacticalLines.PBS_RECTANGLE || lineType == TacticalLines.PBS_SQUARE) {
|
|
379
|
+
let AM: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
380
|
+
let AN: Array<double> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
381
|
+
if (lineType == TacticalLines.PBS_SQUARE) //for square
|
|
382
|
+
{
|
|
383
|
+
let r2: double=AM[0];
|
|
384
|
+
let b: double=0;
|
|
385
|
+
if(AM.length==1)
|
|
386
|
+
{
|
|
387
|
+
AM.push(r2);
|
|
388
|
+
AM.push(b);
|
|
389
|
+
}
|
|
390
|
+
else if(AM.length==2)
|
|
391
|
+
{
|
|
392
|
+
b=AM[1];
|
|
393
|
+
AM[1] = r2;
|
|
394
|
+
AM.push(b);
|
|
395
|
+
}
|
|
396
|
+
else if(AM.length>2)
|
|
397
|
+
AM[1] = r2;
|
|
398
|
+
}
|
|
399
|
+
//if all these conditions are not met we do not want to set any tg modifiers
|
|
400
|
+
if (lineType == TacticalLines.PBS_SQUARE) //square
|
|
401
|
+
{
|
|
402
|
+
let am0: double = AM[0];
|
|
403
|
+
if (AM.length == 1) {
|
|
404
|
+
AM.push(am0);
|
|
405
|
+
} else if (AM.length >= 2) {
|
|
406
|
+
AM[1] = am0;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (AN == null) {
|
|
410
|
+
AN = [];
|
|
411
|
+
}
|
|
412
|
+
if (AN.length === 0) {
|
|
413
|
+
AN.push(0);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (AM != null && AM.length > 1) {
|
|
417
|
+
let strAM: string = String(AM[0]); //width
|
|
418
|
+
let strAM1: string = String(AM[1]); //length
|
|
419
|
+
//set width and length in meters for rectangular target
|
|
420
|
+
tg.set_AM(strAM);
|
|
421
|
+
tg.set_AM1(strAM1);
|
|
422
|
+
//set attitude in degrees
|
|
423
|
+
let strAN: string = String(AN[0]);
|
|
424
|
+
tg.set_AN(strAN);
|
|
425
|
+
}
|
|
426
|
+
/*
|
|
427
|
+
if(AM.length>2)
|
|
428
|
+
{
|
|
429
|
+
let strH1: string = string(AM.get(2)); //buffer size
|
|
430
|
+
tg.set_H1(strH1);
|
|
431
|
+
}
|
|
432
|
+
*/
|
|
433
|
+
}
|
|
434
|
+
} catch (exc) {
|
|
435
|
+
if (exc instanceof Error) {
|
|
436
|
+
ErrorLogger.LogException("clsRenderer", "createTGLightFromBasicMilStdSymbol",
|
|
437
|
+
new RendererException("Failed to build multipoint TG for " + lineType, exc));
|
|
438
|
+
} else {
|
|
439
|
+
throw exc;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return tg;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Create MilStdSymbol from tactical graphic
|
|
448
|
+
*
|
|
449
|
+
* @deprecated
|
|
450
|
+
* @param tg tactical graphic
|
|
451
|
+
* @param converter geographic to pixels to converter
|
|
452
|
+
* @return MilstdSymbol object
|
|
453
|
+
*/
|
|
454
|
+
public static createMilStdSymboFromTGLight(tg: TGLight, converter: IPointConversion): MilStdSymbol {
|
|
455
|
+
let milStd: MilStdSymbol;
|
|
456
|
+
try {
|
|
457
|
+
let symbolId: string = tg.get_SymbolId();
|
|
458
|
+
let lineType: int = clsUtilityJTR.GetLinetypeFromString(symbolId);
|
|
459
|
+
let status: string = tg.get_Status();
|
|
460
|
+
//build tg.Pixels
|
|
461
|
+
tg.Pixels = clsUtility.LatLongToPixels(tg.LatLongs, converter);
|
|
462
|
+
let isClosedArea: boolean = clsUtilityJTR.isClosedPolygon(lineType);
|
|
463
|
+
if (isClosedArea) {
|
|
464
|
+
clsUtilityJTR.ClosePolygon(tg.Pixels);
|
|
465
|
+
clsUtilityJTR.ClosePolygon(tg.LatLongs);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
let coords: Array<Point2D> = clsRenderer.getClientCoords(tg);
|
|
469
|
+
tg.set_Font(new Font("Arial", Font.PLAIN, 12));
|
|
470
|
+
let modifiers: Map<string, string> = new Map();
|
|
471
|
+
modifiers.set(Modifiers.W_DTG_1, tg.get_DTG());
|
|
472
|
+
modifiers.set(Modifiers.W1_DTG_2, tg.get_DTG1());
|
|
473
|
+
modifiers.set(Modifiers.H_ADDITIONAL_INFO_1, tg.get_H());
|
|
474
|
+
modifiers.set(Modifiers.H1_ADDITIONAL_INFO_2, tg.get_H1());
|
|
475
|
+
modifiers.set(Modifiers.H2_ADDITIONAL_INFO_3, tg.get_H2());
|
|
476
|
+
modifiers.set(Modifiers.T_UNIQUE_DESIGNATION_1, tg.get_Name());
|
|
477
|
+
modifiers.set(Modifiers.T1_UNIQUE_DESIGNATION_2, tg.get_T1());
|
|
478
|
+
modifiers.set(Modifiers.Y_LOCATION, tg.get_Location());
|
|
479
|
+
modifiers.set(Modifiers.N_HOSTILE, tg.get_N());
|
|
480
|
+
|
|
481
|
+
milStd = new MilStdSymbol(symbolId, "1", coords, modifiers);
|
|
482
|
+
milStd.setFillColor(tg.get_FillColor());
|
|
483
|
+
milStd.setLineColor(tg.get_LineColor());
|
|
484
|
+
milStd.setLineWidth(tg.get_LineThickness());
|
|
485
|
+
milStd.setFillStyle(tg.get_TexturePaint());
|
|
486
|
+
milStd.setPatternScale(tg.get_patternScale());
|
|
487
|
+
} catch (exc) {
|
|
488
|
+
if (exc instanceof Error) {
|
|
489
|
+
ErrorLogger.LogException("clsRenderer", "createMilStdSymboFromTGLight",
|
|
490
|
+
new RendererException("Failed to set geo points or pixels for " + tg.get_SymbolId(), exc));
|
|
491
|
+
} else {
|
|
492
|
+
throw exc;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return milStd;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Build a tactical graphic object from the client MilStdSymbol
|
|
500
|
+
*
|
|
501
|
+
* @param milStd MilstdSymbol object
|
|
502
|
+
* @param converter geographic to pixels converter
|
|
503
|
+
* @return tactical graphic
|
|
504
|
+
*/
|
|
505
|
+
public static createTGLightFromMilStdSymbol(milStd: MilStdSymbol,
|
|
506
|
+
converter: IPointConversion): TGLight;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* @deprecated @param milStd
|
|
510
|
+
* @param converter
|
|
511
|
+
* @param computeChannelPt
|
|
512
|
+
* @return
|
|
513
|
+
*/
|
|
514
|
+
public static createTGLightFromMilStdSymbol(milStd: MilStdSymbol,
|
|
515
|
+
converter: IPointConversion, computeChannelPt: boolean): TGLight;
|
|
516
|
+
public static createTGLightFromMilStdSymbol(...args: unknown[]): TGLight {
|
|
517
|
+
switch (args.length) {
|
|
518
|
+
case 2: {
|
|
519
|
+
const [milStd, converter] = args as [MilStdSymbol, IPointConversion];
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
let tg: TGLight = new TGLight();
|
|
523
|
+
try {
|
|
524
|
+
let symbolId: string = milStd.getSymbolID();
|
|
525
|
+
tg.set_SymbolId(symbolId);
|
|
526
|
+
let useLineInterpolation: boolean = milStd.getUseLineInterpolation();
|
|
527
|
+
tg.set_UseLineInterpolation(useLineInterpolation);
|
|
528
|
+
let lineType: int = clsUtilityJTR.GetLinetypeFromString(symbolId);
|
|
529
|
+
tg.set_LineType(lineType);
|
|
530
|
+
let status: string = tg.get_Status();
|
|
531
|
+
if (status != null && status === "A") {
|
|
532
|
+
tg.set_LineStyle(1);
|
|
533
|
+
}
|
|
534
|
+
tg.set_VisibleModifiers(true);
|
|
535
|
+
//set tg latlongs and pixels
|
|
536
|
+
clsRenderer.setClientCoords(milStd, tg);
|
|
537
|
+
//build tg.Pixels
|
|
538
|
+
tg.Pixels = clsUtility.LatLongToPixels(tg.LatLongs, converter);
|
|
539
|
+
//tg.set_Font(new Font("Arial", Font.PLAIN, 12));
|
|
540
|
+
tg.set_Font(RendererSettings.getInstance().getMPLabelFont());
|
|
541
|
+
|
|
542
|
+
tg.set_FillColor(milStd.getFillColor());
|
|
543
|
+
tg.set_LineColor(milStd.getLineColor());
|
|
544
|
+
tg.set_LineThickness(milStd.getLineWidth());
|
|
545
|
+
tg.set_TexturePaint(milStd.getFillStyle());
|
|
546
|
+
tg.set_patternScale(milStd.getPatternScale());
|
|
547
|
+
|
|
548
|
+
tg.setIconSize(milStd.getUnitSize());
|
|
549
|
+
tg.set_KeepUnitRatio(milStd.getKeepUnitRatio());
|
|
550
|
+
|
|
551
|
+
tg.set_FontBackColor(Color.WHITE);
|
|
552
|
+
tg.set_TextColor(milStd.getTextColor());
|
|
553
|
+
if (milStd.getModifier(Modifiers.W_DTG_1) != null) {
|
|
554
|
+
tg.set_DTG(milStd.getModifier(Modifiers.W_DTG_1));
|
|
555
|
+
}
|
|
556
|
+
if (milStd.getModifier(Modifiers.W1_DTG_2) != null) {
|
|
557
|
+
tg.set_DTG1(milStd.getModifier(Modifiers.W1_DTG_2));
|
|
558
|
+
}
|
|
559
|
+
if (milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1) != null) {
|
|
560
|
+
tg.set_H(milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1));
|
|
561
|
+
}
|
|
562
|
+
if (milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2) != null) {
|
|
563
|
+
tg.set_H1(milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2));
|
|
564
|
+
}
|
|
565
|
+
if (milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3) != null) {
|
|
566
|
+
tg.set_H2(milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3));
|
|
567
|
+
}
|
|
568
|
+
if (milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1) != null) {
|
|
569
|
+
tg.set_Name(milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1));
|
|
570
|
+
}
|
|
571
|
+
if (milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2) != null) {
|
|
572
|
+
tg.set_T1(milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2));
|
|
573
|
+
}
|
|
574
|
+
if (milStd.getModifier(Modifiers.V_EQUIP_TYPE) != null) {
|
|
575
|
+
tg.set_V(milStd.getModifier(Modifiers.V_EQUIP_TYPE));
|
|
576
|
+
}
|
|
577
|
+
if (milStd.getModifier(Modifiers.AS_COUNTRY) != null) {
|
|
578
|
+
tg.set_AS(milStd.getModifier(Modifiers.AS_COUNTRY));
|
|
579
|
+
}
|
|
580
|
+
if (milStd.getModifier(Modifiers.AP_TARGET_NUMBER) != null) {
|
|
581
|
+
tg.set_AP(milStd.getModifier(Modifiers.AP_TARGET_NUMBER));
|
|
582
|
+
}
|
|
583
|
+
if (milStd.getModifier(Modifiers.Y_LOCATION) != null) {
|
|
584
|
+
tg.set_Location(milStd.getModifier(Modifiers.Y_LOCATION));
|
|
585
|
+
}
|
|
586
|
+
if (milStd.getModifier(Modifiers.N_HOSTILE) != null) {
|
|
587
|
+
tg.set_N(milStd.getModifier(Modifiers.N_HOSTILE));
|
|
588
|
+
}
|
|
589
|
+
tg.set_UseDashArray(milStd.getUseDashArray());
|
|
590
|
+
tg.set_UseHatchFill(milStd.getUseFillPattern());
|
|
591
|
+
//tg.set_UsePatternFill(milStd.getUseFillPattern());
|
|
592
|
+
tg.set_HideOptionalLabels(milStd.getHideOptionalLabels());
|
|
593
|
+
let isClosedArea: boolean = clsUtilityJTR.isClosedPolygon(lineType);
|
|
594
|
+
|
|
595
|
+
if (lineType === TacticalLines.STRIKWARN) {
|
|
596
|
+
let poly1Pixels: Array<POINT2> = tg.Pixels.slice(0, tg.Pixels.length / 2);
|
|
597
|
+
let poly1LatLons: Array<POINT2> = tg.LatLongs.slice(0, tg.LatLongs.length / 2);
|
|
598
|
+
let poly2Pixels: Array<POINT2> = tg.Pixels.slice(tg.Pixels.length / 2, tg.Pixels.length);
|
|
599
|
+
let poly2LatLons: Array<POINT2> = tg.LatLongs.slice(tg.LatLongs.length / 2, tg.LatLongs.length);
|
|
600
|
+
|
|
601
|
+
clsUtilityJTR.ClosePolygon(poly1Pixels);
|
|
602
|
+
clsUtilityJTR.ClosePolygon(poly1LatLons);
|
|
603
|
+
tg.Pixels = poly1Pixels;
|
|
604
|
+
tg.LatLongs = poly1LatLons;
|
|
605
|
+
|
|
606
|
+
clsUtilityJTR.ClosePolygon(poly2Pixels);
|
|
607
|
+
clsUtilityJTR.ClosePolygon(poly2LatLons);
|
|
608
|
+
tg.Pixels.push(...poly2Pixels);
|
|
609
|
+
tg.LatLongs.push(...poly2LatLons);
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
if (isClosedArea) {
|
|
613
|
+
clsUtilityJTR.ClosePolygon(tg.Pixels);
|
|
614
|
+
clsUtilityJTR.ClosePolygon(tg.LatLongs);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
//implement meters to feet for altitude labels
|
|
620
|
+
let altitudeLabel: string = milStd.getAltitudeMode();
|
|
621
|
+
if (altitudeLabel == null || altitudeLabel.length === 0) {
|
|
622
|
+
altitudeLabel = "AMSL";
|
|
623
|
+
}
|
|
624
|
+
let altitudeUnit: DistanceUnit = milStd.getAltitudeUnit();
|
|
625
|
+
if (altitudeUnit == null) {
|
|
626
|
+
altitudeUnit = DistanceUnit.FEET;
|
|
627
|
+
}
|
|
628
|
+
let distanceUnit: DistanceUnit = milStd.getDistanceUnit();
|
|
629
|
+
if (distanceUnit == null) {
|
|
630
|
+
distanceUnit = DistanceUnit.METERS;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
let strXAlt: string = "";
|
|
634
|
+
//construct the H1 and H2 modifiers for sector from the mss AM, AN, and X arraylists
|
|
635
|
+
if (lineType === TacticalLines.RANGE_FAN_SECTOR) {
|
|
636
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
637
|
+
let AN: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
638
|
+
let X: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.X_ALTITUDE_DEPTH);
|
|
639
|
+
if (AM != null) {
|
|
640
|
+
let strAM: string = "";
|
|
641
|
+
for (let j: int = 0; j < AM.length; j++) {
|
|
642
|
+
strAM += AM[j].toString();
|
|
643
|
+
if (j < AM.length - 1) {
|
|
644
|
+
strAM += ",";
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
tg.set_AM(strAM);
|
|
648
|
+
}
|
|
649
|
+
if (AN != null) {
|
|
650
|
+
let strAN: string = "";
|
|
651
|
+
for (let j: int = 0; j < AN.length; j++) {
|
|
652
|
+
strAN += AN[j];
|
|
653
|
+
if (j < AN.length - 1) {
|
|
654
|
+
strAN += ",";
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
tg.set_AN(strAN);
|
|
658
|
+
}
|
|
659
|
+
if (X != null) {
|
|
660
|
+
let strX: string = "";
|
|
661
|
+
for (let j: int = 0; j < X.length; j++) {
|
|
662
|
+
strXAlt = clsRenderer.createAltitudeLabel(X[j], altitudeUnit, altitudeLabel);
|
|
663
|
+
strX += strXAlt;
|
|
664
|
+
|
|
665
|
+
if (j < X.length - 1) {
|
|
666
|
+
strX += ",";
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
tg.set_X(strX);
|
|
670
|
+
}
|
|
671
|
+
if (AM != null && AN != null) {
|
|
672
|
+
let numSectors: int = AN.length / 2;
|
|
673
|
+
let left: double = 0;
|
|
674
|
+
let right: double = 0;
|
|
675
|
+
let min: double = 0;
|
|
676
|
+
let max: double = 0;
|
|
677
|
+
//construct left,right,min,max from the arraylists
|
|
678
|
+
let strLeftRightMinMax: string = "";
|
|
679
|
+
for (let j: int = 0; j < numSectors; j++) {
|
|
680
|
+
left = AN[2 * j];
|
|
681
|
+
right = AN[2 * j + 1];
|
|
682
|
+
if (j + 1 === AM.length) {
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
min = AM[j];
|
|
686
|
+
max = AM[j + 1];
|
|
687
|
+
strLeftRightMinMax += left.toString() + "," + right.toString() + "," + min.toString() + "," + max.toString();
|
|
688
|
+
if (j < numSectors - 1) {
|
|
689
|
+
strLeftRightMinMax += ",";
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
}
|
|
693
|
+
let len: int = strLeftRightMinMax.length;
|
|
694
|
+
let c: string = strLeftRightMinMax.substring(len - 1, len);
|
|
695
|
+
if (c === ",") {
|
|
696
|
+
strLeftRightMinMax = strLeftRightMinMax.substring(0, len - 1);
|
|
697
|
+
}
|
|
698
|
+
tg.set_LRMM(strLeftRightMinMax);
|
|
699
|
+
}
|
|
700
|
+
} else {
|
|
701
|
+
if (lineType === TacticalLines.RADAR_SEARCH) {
|
|
702
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
703
|
+
let AN: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
704
|
+
if (AM != null) {
|
|
705
|
+
let strAM: string = "";
|
|
706
|
+
for (let j: int = 0; j < AM.length && j < 2; j++) {
|
|
707
|
+
strAM += AM[j].toString();
|
|
708
|
+
if (j < AM.length - 1) {
|
|
709
|
+
strAM += ",";
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
tg.set_AM(strAM);
|
|
713
|
+
}
|
|
714
|
+
if (AN != null) {
|
|
715
|
+
let strAN: string = "";
|
|
716
|
+
for (let j: int = 0; j < AN.length && j < 2; j++) {
|
|
717
|
+
strAN += AN[j];
|
|
718
|
+
if (j < AN.length - 1) {
|
|
719
|
+
strAN += ",";
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
tg.set_AN(strAN);
|
|
723
|
+
}
|
|
724
|
+
if (AM != null && AN != null) {
|
|
725
|
+
let left: double = 0;
|
|
726
|
+
let right: double = 0;
|
|
727
|
+
let min: double = 0;
|
|
728
|
+
let max: double = 0;
|
|
729
|
+
//construct left,right,min,max from the arraylists
|
|
730
|
+
let strLeftRightMinMax: string = "";
|
|
731
|
+
left = AN[0];
|
|
732
|
+
right = AN[1];
|
|
733
|
+
min = AM[0];
|
|
734
|
+
max = AM[1];
|
|
735
|
+
strLeftRightMinMax += left.toString() + "," + right.toString() + "," + min.toString() + "," + max.toString();
|
|
736
|
+
tg.set_LRMM(strLeftRightMinMax);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
let j: int = 0;
|
|
742
|
+
if (lineType === TacticalLines.LAUNCH_AREA || lineType === TacticalLines.DEFENDED_AREA_CIRCULAR || lineType === TacticalLines.SHIP_AOI_CIRCULAR) //geo ellipse
|
|
743
|
+
{
|
|
744
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
745
|
+
let AN: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
746
|
+
if (AM != null && AM.length > 1) {
|
|
747
|
+
let strAM: string = AM[0].toString(); // major axis
|
|
748
|
+
tg.set_AM(strAM);
|
|
749
|
+
let strAM1: string = AM[1].toString(); // minor axis
|
|
750
|
+
tg.set_AM1(strAM1);
|
|
751
|
+
}
|
|
752
|
+
if (AN != null && AN.length > 0) {
|
|
753
|
+
let strAN: string = AN[0].toString(); // rotation
|
|
754
|
+
tg.set_AN(strAN);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
switch (lineType) {
|
|
758
|
+
case TacticalLines.ROZ:
|
|
759
|
+
case TacticalLines.AARROZ:
|
|
760
|
+
case TacticalLines.UAROZ:
|
|
761
|
+
case TacticalLines.WEZ:
|
|
762
|
+
case TacticalLines.FEZ:
|
|
763
|
+
case TacticalLines.JEZ:
|
|
764
|
+
case TacticalLines.FAADZ:
|
|
765
|
+
case TacticalLines.HIDACZ:
|
|
766
|
+
case TacticalLines.MEZ:
|
|
767
|
+
case TacticalLines.LOMEZ:
|
|
768
|
+
case TacticalLines.HIMEZ:
|
|
769
|
+
case TacticalLines.ACA:
|
|
770
|
+
case TacticalLines.ACA_RECTANGULAR:
|
|
771
|
+
case TacticalLines.ACA_CIRCULAR: {
|
|
772
|
+
let X: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.X_ALTITUDE_DEPTH);
|
|
773
|
+
if (X != null && X.length > 0) {
|
|
774
|
+
strXAlt = clsRenderer.createAltitudeLabel(X[0], altitudeUnit, altitudeLabel);
|
|
775
|
+
tg.set_X(strXAlt);
|
|
776
|
+
}
|
|
777
|
+
if (X != null && X.length > 1) {
|
|
778
|
+
strXAlt = clsRenderer.createAltitudeLabel(X[1], altitudeUnit, altitudeLabel);
|
|
779
|
+
tg.set_X1(strXAlt);
|
|
780
|
+
}
|
|
781
|
+
break;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
case TacticalLines.SC:
|
|
785
|
+
case TacticalLines.MRR:
|
|
786
|
+
case TacticalLines.SL:
|
|
787
|
+
case TacticalLines.TC:
|
|
788
|
+
case TacticalLines.LLTR:
|
|
789
|
+
case TacticalLines.AC:
|
|
790
|
+
case TacticalLines.SAAFR: {
|
|
791
|
+
let pt: POINT2 = tg.LatLongs[0];
|
|
792
|
+
let pt2d0: Point2D = new Point2D(pt.x, pt.y);
|
|
793
|
+
let pt2d0Pixels: Point2D = converter.GeoToPixels(pt2d0);
|
|
794
|
+
let pt0Pixels: POINT2 = new POINT2(pt2d0Pixels.getX(), pt2d0Pixels.getY());
|
|
795
|
+
|
|
796
|
+
//get some point 10000 meters away from pt
|
|
797
|
+
//10000 should work for any scale
|
|
798
|
+
let dist: double = 10000;
|
|
799
|
+
let pt2: POINT2 = mdlGeodesic.geodesic_coordinate(pt, dist, 0);
|
|
800
|
+
let pt2d1: Point2D = new Point2D(pt2.x, pt2.y);
|
|
801
|
+
let pt2d1Pixels: Point2D = converter.GeoToPixels(pt2d1);
|
|
802
|
+
let pt1Pixels: POINT2 = new POINT2(pt2d1Pixels.getX(), pt2d1Pixels.getY());
|
|
803
|
+
//calculate pixels per meter
|
|
804
|
+
let distPixels: double = lineutility.CalcDistanceDouble(pt0Pixels, pt1Pixels);
|
|
805
|
+
let pixelsPerMeter: double = distPixels / dist;
|
|
806
|
+
|
|
807
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
808
|
+
if (AM != null) {
|
|
809
|
+
let strAM: string = "";
|
|
810
|
+
for (j = 0; j < AM.length; j++) {
|
|
811
|
+
strAM += AM[j].toString();
|
|
812
|
+
if (j < AM.length - 1) {
|
|
813
|
+
strAM += ",";
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
tg.set_AM(strAM);
|
|
817
|
+
}
|
|
818
|
+
let strRadii: string[];
|
|
819
|
+
//get the widest value
|
|
820
|
+
//the current requirement is to use the greatest width as the default width
|
|
821
|
+
let maxWidth: double = 0;
|
|
822
|
+
let
|
|
823
|
+
temp: double = 0;
|
|
824
|
+
let maxWidthMeters: double = 0;
|
|
825
|
+
if (tg.get_AM() != null && tg.get_AM().length > 0) {
|
|
826
|
+
strRadii = tg.get_AM().split(",");
|
|
827
|
+
if (strRadii.length > 0) {
|
|
828
|
+
for (j = 0; j < strRadii.length; j++) {
|
|
829
|
+
if (!Number.isNaN(parseFloat(strRadii[j]))) {
|
|
830
|
+
temp = parseFloat(strRadii[j]);
|
|
831
|
+
if (temp > maxWidth) {
|
|
832
|
+
maxWidth = temp;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
maxWidthMeters = maxWidth;
|
|
837
|
+
maxWidth *= pixelsPerMeter / 2;
|
|
838
|
+
|
|
839
|
+
for (j = 0; j < tg.Pixels.length; j++) {
|
|
840
|
+
if (strRadii.length > j) {
|
|
841
|
+
if (!Number.isNaN(parseFloat(strRadii[j]))) {
|
|
842
|
+
let pixels: double = parseFloat(strRadii[j]) * pixelsPerMeter / 2;
|
|
843
|
+
tg.Pixels[j].style = pixels as int;
|
|
844
|
+
tg.LatLongs[j].style = pixels as int;
|
|
845
|
+
} else {
|
|
846
|
+
tg.Pixels[j].style = maxWidth as int;
|
|
847
|
+
tg.LatLongs[j].style = maxWidth as int;
|
|
848
|
+
}
|
|
849
|
+
} else {
|
|
850
|
+
tg.Pixels[j].style = maxWidth as int;
|
|
851
|
+
tg.LatLongs[j].style = maxWidth as int;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
maxWidthMeters *= distanceUnit.conversionFactor;
|
|
858
|
+
maxWidthMeters *= 10.0;
|
|
859
|
+
maxWidthMeters = Math.round(maxWidthMeters);
|
|
860
|
+
let tempWidth: int = maxWidthMeters as int;
|
|
861
|
+
maxWidthMeters = tempWidth / 10.0;
|
|
862
|
+
|
|
863
|
+
tg.set_AM(maxWidthMeters.toString() + " " + distanceUnit.label);
|
|
864
|
+
//use X, X1 to set tg.H, tg.H1
|
|
865
|
+
let X = milStd.getModifiers_AM_AN_X(Modifiers.X_ALTITUDE_DEPTH);
|
|
866
|
+
if (X != null && X.length > 0) {
|
|
867
|
+
strXAlt = clsRenderer.createAltitudeLabel(X[0], altitudeUnit, altitudeLabel);
|
|
868
|
+
tg.set_X(strXAlt);
|
|
869
|
+
}
|
|
870
|
+
if (X != null && X.length > 1) {
|
|
871
|
+
strXAlt = clsRenderer.createAltitudeLabel(X[1], altitudeUnit, altitudeLabel);
|
|
872
|
+
tg.set_X1(strXAlt);
|
|
873
|
+
}
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
default: {
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
}
|
|
882
|
+
//circular range fans
|
|
883
|
+
if (lineType === TacticalLines.RANGE_FAN) {
|
|
884
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
885
|
+
let X: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.X_ALTITUDE_DEPTH);
|
|
886
|
+
let strAM: string = "";
|
|
887
|
+
let strX: string = "";
|
|
888
|
+
if (AM != null) {
|
|
889
|
+
// Range fan circular has a maximum of 3 circles
|
|
890
|
+
for (j = 0; j < AM.length && j < 3; j++) {
|
|
891
|
+
strAM += AM[j].toString();
|
|
892
|
+
if (j < AM.length - 1) {
|
|
893
|
+
strAM += ",";
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
if (X != null && j < X.length) {
|
|
897
|
+
strXAlt = clsRenderer.createAltitudeLabel(X[j], altitudeUnit, altitudeLabel);
|
|
898
|
+
strX += strXAlt;
|
|
899
|
+
if (j < X.length - 1) {
|
|
900
|
+
strX += ",";
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
tg.set_AM(strAM);
|
|
906
|
+
tg.set_X(strX);
|
|
907
|
+
}
|
|
908
|
+
switch (lineType) {
|
|
909
|
+
case TacticalLines.PAA_RECTANGULAR:
|
|
910
|
+
case TacticalLines.RECTANGULAR_TARGET:
|
|
911
|
+
case TacticalLines.FSA_RECTANGULAR:
|
|
912
|
+
case TacticalLines.SHIP_AOI_RECTANGULAR:
|
|
913
|
+
case TacticalLines.DEFENDED_AREA_RECTANGULAR:
|
|
914
|
+
case TacticalLines.FFA_RECTANGULAR:
|
|
915
|
+
case TacticalLines.ACA_RECTANGULAR:
|
|
916
|
+
case TacticalLines.NFA_RECTANGULAR:
|
|
917
|
+
case TacticalLines.RFA_RECTANGULAR:
|
|
918
|
+
case TacticalLines.ATI_RECTANGULAR:
|
|
919
|
+
case TacticalLines.CFFZ_RECTANGULAR:
|
|
920
|
+
case TacticalLines.SENSOR_RECTANGULAR:
|
|
921
|
+
case TacticalLines.CENSOR_RECTANGULAR:
|
|
922
|
+
case TacticalLines.DA_RECTANGULAR:
|
|
923
|
+
case TacticalLines.CFZ_RECTANGULAR:
|
|
924
|
+
case TacticalLines.ZOR_RECTANGULAR:
|
|
925
|
+
case TacticalLines.TBA_RECTANGULAR:
|
|
926
|
+
case TacticalLines.TVAR_RECTANGULAR:
|
|
927
|
+
case TacticalLines.CIRCULAR:
|
|
928
|
+
case TacticalLines.BDZ:
|
|
929
|
+
case TacticalLines.FSA_CIRCULAR:
|
|
930
|
+
case TacticalLines.NOTACK:
|
|
931
|
+
case TacticalLines.ACA_CIRCULAR:
|
|
932
|
+
case TacticalLines.FFA_CIRCULAR:
|
|
933
|
+
case TacticalLines.NFA_CIRCULAR:
|
|
934
|
+
case TacticalLines.RFA_CIRCULAR:
|
|
935
|
+
case TacticalLines.PAA_CIRCULAR:
|
|
936
|
+
case TacticalLines.ATI_CIRCULAR:
|
|
937
|
+
case TacticalLines.CFFZ_CIRCULAR:
|
|
938
|
+
case TacticalLines.SENSOR_CIRCULAR:
|
|
939
|
+
case TacticalLines.CENSOR_CIRCULAR:
|
|
940
|
+
case TacticalLines.DA_CIRCULAR:
|
|
941
|
+
case TacticalLines.CFZ_CIRCULAR:
|
|
942
|
+
case TacticalLines.ZOR_CIRCULAR:
|
|
943
|
+
case TacticalLines.TBA_CIRCULAR:
|
|
944
|
+
case TacticalLines.TVAR_CIRCULAR:
|
|
945
|
+
case TacticalLines.KILLBOXBLUE_CIRCULAR:
|
|
946
|
+
case TacticalLines.KILLBOXPURPLE_CIRCULAR:
|
|
947
|
+
case TacticalLines.KILLBOXBLUE_RECTANGULAR:
|
|
948
|
+
case TacticalLines.KILLBOXPURPLE_RECTANGULAR: {
|
|
949
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
950
|
+
if (AM != null && AM.length > 0) {
|
|
951
|
+
let strAM: string = AM[0].toString();
|
|
952
|
+
//set width for rectangles or radius for circles
|
|
953
|
+
tg.set_AM(strAM);
|
|
954
|
+
}
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
default: {
|
|
959
|
+
break;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
}
|
|
963
|
+
if (lineType === TacticalLines.RECTANGULAR || lineType === TacticalLines.CUED_ACQUISITION) {
|
|
964
|
+
let AM: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AM_DISTANCE);
|
|
965
|
+
let AN: Array<number> = milStd.getModifiers_AM_AN_X(Modifiers.AN_AZIMUTH);
|
|
966
|
+
if (AN == null) {
|
|
967
|
+
AN = new Array();
|
|
968
|
+
}
|
|
969
|
+
if (AN.length === 0) {
|
|
970
|
+
AN.push(0);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
if (AM != null && AM.length > 1) {
|
|
974
|
+
let strAM: string = AM[0].toString(); //width
|
|
975
|
+
let strAM1: string = AM[1].toString(); //length
|
|
976
|
+
//set width and length in meters for rectangular target
|
|
977
|
+
tg.set_AM(strAM);
|
|
978
|
+
tg.set_AM1(strAM1);
|
|
979
|
+
//set attitude in degrees
|
|
980
|
+
let strAN: string = AN[0].toString();
|
|
981
|
+
tg.set_AN(strAN);
|
|
982
|
+
}
|
|
983
|
+
/*
|
|
984
|
+
if(AM.length>2)
|
|
985
|
+
{
|
|
986
|
+
let strH1: string = string(AM[2]); //buffer size
|
|
987
|
+
tg.set_H1(strH1);
|
|
988
|
+
}
|
|
989
|
+
*/
|
|
990
|
+
}
|
|
991
|
+
} catch (exc) {
|
|
992
|
+
if (exc instanceof Error) {
|
|
993
|
+
ErrorLogger.LogException("clsRenderer", "createTGLightfromMilStdSymbol",
|
|
994
|
+
new RendererException("Failed to build multipoint TG for " + milStd.getSymbolID(), exc));
|
|
995
|
+
} else {
|
|
996
|
+
throw exc;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
return tg;
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
break;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
case 3: {
|
|
1006
|
+
const [milStd, converter, computeChannelPt] = args as [MilStdSymbol, IPointConversion, boolean];
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
let tg: TGLight = new TGLight();
|
|
1010
|
+
try {
|
|
1011
|
+
let symbolId: string = milStd.getSymbolID();
|
|
1012
|
+
tg.set_SymbolId(symbolId);
|
|
1013
|
+
let status: string = tg.get_Status();
|
|
1014
|
+
if (status != null && status === "A") {
|
|
1015
|
+
//lineStyle=GraphicProperties.LINE_TYPE_DASHED;
|
|
1016
|
+
tg.set_LineStyle(1);
|
|
1017
|
+
}
|
|
1018
|
+
tg.set_VisibleModifiers(true);
|
|
1019
|
+
//set tg latlongs and pixels
|
|
1020
|
+
clsRenderer.setClientCoords(milStd, tg);
|
|
1021
|
+
//build tg.Pixels
|
|
1022
|
+
tg.Pixels = clsUtility.LatLongToPixels(tg.LatLongs, converter);
|
|
1023
|
+
tg.set_Font(new Font("Arial", Font.PLAIN, 12));
|
|
1024
|
+
tg.set_FillColor(milStd.getFillColor());
|
|
1025
|
+
tg.set_LineColor(milStd.getLineColor());
|
|
1026
|
+
tg.set_LineThickness(milStd.getLineWidth());
|
|
1027
|
+
tg.set_TexturePaint(milStd.getFillStyle());
|
|
1028
|
+
tg.set_patternScale(milStd.getPatternScale());
|
|
1029
|
+
tg.set_FontBackColor(Color.WHITE);
|
|
1030
|
+
tg.set_TextColor(milStd.getTextColor());
|
|
1031
|
+
|
|
1032
|
+
// tg.set_DTG(milStd.getModifier(Modifiers.W_DTG_1));
|
|
1033
|
+
// tg.set_DTG1(milStd.getModifier(Modifiers.W1_DTG_2));
|
|
1034
|
+
// tg.set_H(milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1));
|
|
1035
|
+
// tg.set_H1(milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2));
|
|
1036
|
+
// tg.set_H2(milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3));
|
|
1037
|
+
// tg.set_Name(milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1));
|
|
1038
|
+
// tg.set_T1(milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2));
|
|
1039
|
+
// tg.set_Location(milStd.getModifier(Modifiers.Y_LOCATION));
|
|
1040
|
+
// tg.set_N(Modifiers.N_HOSTILE);
|
|
1041
|
+
if (milStd.getModifier(Modifiers.W_DTG_1) != null) {
|
|
1042
|
+
tg.set_DTG(milStd.getModifier(Modifiers.W_DTG_1));
|
|
1043
|
+
}
|
|
1044
|
+
if (milStd.getModifier(Modifiers.W1_DTG_2) != null) {
|
|
1045
|
+
tg.set_DTG1(milStd.getModifier(Modifiers.W1_DTG_2));
|
|
1046
|
+
}
|
|
1047
|
+
if (milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1) != null) {
|
|
1048
|
+
tg.set_H(milStd.getModifier(Modifiers.H_ADDITIONAL_INFO_1));
|
|
1049
|
+
}
|
|
1050
|
+
if (milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2) != null) {
|
|
1051
|
+
tg.set_H1(milStd.getModifier(Modifiers.H1_ADDITIONAL_INFO_2));
|
|
1052
|
+
}
|
|
1053
|
+
if (milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3) != null) {
|
|
1054
|
+
tg.set_H2(milStd.getModifier(Modifiers.H2_ADDITIONAL_INFO_3));
|
|
1055
|
+
}
|
|
1056
|
+
if (milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1) != null) {
|
|
1057
|
+
tg.set_Name(milStd.getModifier(Modifiers.T_UNIQUE_DESIGNATION_1));
|
|
1058
|
+
}
|
|
1059
|
+
if (milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2) != null) {
|
|
1060
|
+
tg.set_T1(milStd.getModifier(Modifiers.T1_UNIQUE_DESIGNATION_2));
|
|
1061
|
+
}
|
|
1062
|
+
if (milStd.getModifier(Modifiers.V_EQUIP_TYPE) != null) {
|
|
1063
|
+
tg.set_V(milStd.getModifier(Modifiers.V_EQUIP_TYPE));
|
|
1064
|
+
}
|
|
1065
|
+
if (milStd.getModifier(Modifiers.AS_COUNTRY) != null) {
|
|
1066
|
+
tg.set_AS(milStd.getModifier(Modifiers.AS_COUNTRY));
|
|
1067
|
+
}
|
|
1068
|
+
if (milStd.getModifier(Modifiers.AP_TARGET_NUMBER) != null) {
|
|
1069
|
+
tg.set_AP(milStd.getModifier(Modifiers.AP_TARGET_NUMBER));
|
|
1070
|
+
}
|
|
1071
|
+
if (milStd.getModifier(Modifiers.Y_LOCATION) != null) {
|
|
1072
|
+
tg.set_Location(milStd.getModifier(Modifiers.Y_LOCATION));
|
|
1073
|
+
}
|
|
1074
|
+
if (milStd.getModifier(Modifiers.N_HOSTILE) != null) {
|
|
1075
|
+
tg.set_N(milStd.getModifier(Modifiers.N_HOSTILE));
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
//int lineType=CELineArray.CGetLinetypeFromString(tg.get_SymbolId());
|
|
1079
|
+
let lineType: int = clsUtilityJTR.GetLinetypeFromString(symbolId);
|
|
1080
|
+
let isClosedArea: boolean = clsUtilityJTR.isClosedPolygon(lineType);
|
|
1081
|
+
|
|
1082
|
+
if (isClosedArea) {
|
|
1083
|
+
clsUtilityJTR.ClosePolygon(tg.Pixels);
|
|
1084
|
+
clsUtilityJTR.ClosePolygon(tg.LatLongs);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
//these channels need a channel point added
|
|
1088
|
+
if (computeChannelPt) {
|
|
1089
|
+
switch (lineType) {
|
|
1090
|
+
case TacticalLines.CATK:
|
|
1091
|
+
case TacticalLines.CATKBYFIRE:
|
|
1092
|
+
case TacticalLines.AAAAA:
|
|
1093
|
+
case TacticalLines.AIRAOA:
|
|
1094
|
+
case TacticalLines.MAIN:
|
|
1095
|
+
case TacticalLines.SPT: {
|
|
1096
|
+
let ptPixels: POINT2 = clsUtilityJTR.ComputeLastPoint(tg.Pixels);
|
|
1097
|
+
tg.Pixels.push(ptPixels);
|
|
1098
|
+
//Point pt = clsUtility.POINT2ToPoint(ptPixels);
|
|
1099
|
+
let pt: Point2D = new Point2D(ptPixels.x, ptPixels.y);
|
|
1100
|
+
//in case it needs the corresponding geo point
|
|
1101
|
+
let ptGeo2d: Point2D = converter.PixelsToGeo(pt);
|
|
1102
|
+
let ptGeo: POINT2 = clsUtility.Point2DToPOINT2(ptGeo2d);
|
|
1103
|
+
tg.LatLongs.push(ptGeo);
|
|
1104
|
+
//}
|
|
1105
|
+
break;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
default: {
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
} catch (exc) {
|
|
1115
|
+
if (exc instanceof Error) {
|
|
1116
|
+
ErrorLogger.LogException("clsRenderer", "createTGLightfromMilStdSymbol",
|
|
1117
|
+
new RendererException("Failed to build multipoint TG for " + milStd.getSymbolID(), exc));
|
|
1118
|
+
} else {
|
|
1119
|
+
throw exc;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
return tg;
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
default: {
|
|
1129
|
+
throw Error(`Invalid number of arguments`);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
private static createAltitudeLabel(distance: double, altitudeUnit: DistanceUnit, altitudeLabel: string): string {
|
|
1136
|
+
let conversionFactor: double = 0;
|
|
1137
|
+
|
|
1138
|
+
// if using "FL" (Flight Level) for altitudeLabel, override conversion factor to avoid potential user error with altitudeUnit
|
|
1139
|
+
if (altitudeLabel === "FL") {
|
|
1140
|
+
conversionFactor = DistanceUnit.FLIGHT_LEVEL.conversionFactor;
|
|
1141
|
+
} else {
|
|
1142
|
+
conversionFactor = altitudeUnit.conversionFactor;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// Truncate the result
|
|
1146
|
+
let result: double = distance * conversionFactor;
|
|
1147
|
+
result *= 10.0;
|
|
1148
|
+
result = Math.round(result);
|
|
1149
|
+
let tempResult: int = Math.trunc(result);
|
|
1150
|
+
let truncatedResult: int = Math.trunc(tempResult / 10);
|
|
1151
|
+
// MIL-STD-2525D says altitude/depth must be an integer
|
|
1152
|
+
|
|
1153
|
+
// Simplifies labels of "0 units AGL" to "GL" (Ground Level) and "0 units AMSL/BMSL" to "MSL" (Mean Sea Level)
|
|
1154
|
+
// as permitted by MIL-STD-2525D 5.3.7.5.1.
|
|
1155
|
+
// Also works for "0 units GL" and "0 units MSL", which are improperly labeled but can be understood to mean the same thing.
|
|
1156
|
+
if (truncatedResult === 0) {
|
|
1157
|
+
if (altitudeLabel === "AGL" || altitudeLabel === "GL") {
|
|
1158
|
+
return "GL";
|
|
1159
|
+
}
|
|
1160
|
+
if (altitudeLabel === "AMSL" || altitudeLabel === "BMSL" || altitudeLabel === "MSL") {
|
|
1161
|
+
return "MSL";
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
// Flight level is a special altitude displayed as "FL ###" where ### are 3 digits representing hundreds of feet.
|
|
1166
|
+
if (altitudeLabel === "FL") {
|
|
1167
|
+
return "FL " + String(truncatedResult).padStart(3, '0');
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
return truncatedResult + " " + altitudeUnit.label + " " + altitudeLabel;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
private static Shape2ToShapeInfo(shapeInfos: Array<ShapeInfo>, shapes: Array<Shape2>): void {
|
|
1174
|
+
try {
|
|
1175
|
+
let j: int = 0;
|
|
1176
|
+
let shape: Shape2;
|
|
1177
|
+
if (shapes == null || shapeInfos == null || shapes.length === 0) {
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
for (j = 0; j < shapes.length; j++)
|
|
1182
|
+
{
|
|
1183
|
+
shape = shapes[j];
|
|
1184
|
+
if(shape != null && shape !== undefined)
|
|
1185
|
+
shapeInfos.push(shape as ShapeInfo);
|
|
1186
|
+
}
|
|
1187
|
+
} catch (exc) {
|
|
1188
|
+
if (exc instanceof Error) {
|
|
1189
|
+
ErrorLogger.LogException("clsRenderer", "Shape2ToShapeInfo",
|
|
1190
|
+
new RendererException("Failed to build ShapeInfo ArrayList", exc));
|
|
1191
|
+
} else {
|
|
1192
|
+
throw exc;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Added function to handle when coords or display area spans IDL but not
|
|
1199
|
+
* both, it prevents the symbol from rendering if the bounding rectangles
|
|
1200
|
+
* don't intersect.
|
|
1201
|
+
*
|
|
1202
|
+
* @param tg
|
|
1203
|
+
* @param converter
|
|
1204
|
+
* @param clipArea
|
|
1205
|
+
* @return
|
|
1206
|
+
*/
|
|
1207
|
+
public static intersectsClipArea(tg: TGLight, converter: IPointConversion, clipArea: Point2D[] | Rectangle | Rectangle2D): boolean {
|
|
1208
|
+
let result: boolean = false;
|
|
1209
|
+
try {
|
|
1210
|
+
if (clipArea == null || tg.LatLongs.length < 2) {
|
|
1211
|
+
return true;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
let clipBounds: Rectangle2D = null;
|
|
1215
|
+
let clipPoints: Array<Point2D> = null;
|
|
1216
|
+
|
|
1217
|
+
// if (clipArea != null) {
|
|
1218
|
+
// if (clipArea.getClass().isAssignableFrom(Rectangle2D.class)) {
|
|
1219
|
+
// clipBounds = (Rectangle2D) clipArea;
|
|
1220
|
+
// } else if (clipArea.getClass().isAssignableFrom(Rectangle.class)) {
|
|
1221
|
+
// clipBounds = (Rectangle2D) clipArea;
|
|
1222
|
+
// } else if (clipArea.getClass().isAssignableFrom(ArrayList.class)) {
|
|
1223
|
+
// clipPoints = (ArrayList<Point2D>) clipArea;
|
|
1224
|
+
// }
|
|
1225
|
+
// }
|
|
1226
|
+
if (clipArea != null) {
|
|
1227
|
+
if (clipArea instanceof Rectangle2D) {
|
|
1228
|
+
clipBounds = clipArea as Rectangle2D;
|
|
1229
|
+
} else {
|
|
1230
|
+
if (clipArea instanceof Rectangle) {
|
|
1231
|
+
let rectx: Rectangle = clipArea as Rectangle;
|
|
1232
|
+
clipBounds = new Rectangle2D(rectx.x, rectx.y, rectx.width, rectx.height);
|
|
1233
|
+
} else {
|
|
1234
|
+
if (clipArea instanceof Array) {
|
|
1235
|
+
clipPoints = clipArea as Array<Point2D>;
|
|
1236
|
+
//let x0: double=clipPoints[0].getX(),y0=clipPoints[0].getY();
|
|
1237
|
+
//let w: double=clipPoints[1].getX()-x0,h=clipPoints[3].getY()-y0;
|
|
1238
|
+
//clipBounds = new Rectangle2D(x0, y0, w, h);
|
|
1239
|
+
clipBounds = clsUtility.getMBR(clipPoints);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
}
|
|
1246
|
+
//assumes we are using clipBounds
|
|
1247
|
+
let j: int = 0;
|
|
1248
|
+
let x: double = clipBounds.getMinX();
|
|
1249
|
+
let y: double = clipBounds.getMinY();
|
|
1250
|
+
let width: double = clipBounds.getWidth();
|
|
1251
|
+
let height: double = clipBounds.getHeight();
|
|
1252
|
+
let tl: POINT2 = new POINT2(x, y);
|
|
1253
|
+
let br: POINT2 = new POINT2(x + width, y + height);
|
|
1254
|
+
tl = clsUtility.PointPixelsToLatLong(tl, converter);
|
|
1255
|
+
br = clsUtility.PointPixelsToLatLong(br, converter);
|
|
1256
|
+
//the latitude range
|
|
1257
|
+
//boolean ptInside = false, ptAbove = false, ptBelow = false;
|
|
1258
|
+
let coordsLeft: double = tg.LatLongs[0].x;
|
|
1259
|
+
let coordsRight: double = coordsLeft;
|
|
1260
|
+
let coordsTop: double = tg.LatLongs[0].y;
|
|
1261
|
+
let coordsBottom: double = coordsTop;
|
|
1262
|
+
let intersects: boolean = false;
|
|
1263
|
+
let minx: double = tg.LatLongs[0].x;
|
|
1264
|
+
let maxx: double = minx;
|
|
1265
|
+
let maxNegX: double = 0;
|
|
1266
|
+
for (j = 0; j < tg.LatLongs.length; j++) {
|
|
1267
|
+
let pt: POINT2 = tg.LatLongs[j];
|
|
1268
|
+
if (pt.x < minx) {
|
|
1269
|
+
|
|
1270
|
+
minx = pt.x;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
if (pt.x > maxx) {
|
|
1274
|
+
|
|
1275
|
+
maxx = pt.x;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
if (maxNegX === 0 && pt.x < 0) {
|
|
1279
|
+
|
|
1280
|
+
maxNegX = pt.x;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
if (maxNegX < 0 && pt.x < 0 && pt.x > maxNegX) {
|
|
1284
|
+
|
|
1285
|
+
maxNegX = pt.x;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
if (pt.y < coordsBottom) {
|
|
1289
|
+
|
|
1290
|
+
coordsBottom = pt.y;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
if (pt.y > coordsTop) {
|
|
1294
|
+
|
|
1295
|
+
coordsTop = pt.y;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
}
|
|
1299
|
+
let coordSpanIDL: boolean = false;
|
|
1300
|
+
if (maxx === 180 || minx === -180) {
|
|
1301
|
+
|
|
1302
|
+
coordSpanIDL = true;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
if (maxx - minx >= 180) {
|
|
1306
|
+
coordSpanIDL = true;
|
|
1307
|
+
coordsLeft = maxx;
|
|
1308
|
+
coordsRight = maxNegX;
|
|
1309
|
+
} else {
|
|
1310
|
+
coordsLeft = minx;
|
|
1311
|
+
coordsRight = maxx;
|
|
1312
|
+
}
|
|
1313
|
+
//if(canClipPoints)
|
|
1314
|
+
//{
|
|
1315
|
+
if (br.y <= coordsBottom && coordsBottom <= tl.y) {
|
|
1316
|
+
intersects = true;
|
|
1317
|
+
} else if (coordsBottom <= br.y && br.y <= coordsTop) {
|
|
1318
|
+
intersects = true;
|
|
1319
|
+
}
|
|
1320
|
+
else {
|
|
1321
|
+
return false;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
//}
|
|
1325
|
+
//if it gets this far then the latitude ranges intersect
|
|
1326
|
+
//re-initialize intersects for the longitude ranges
|
|
1327
|
+
intersects = false;
|
|
1328
|
+
//the longitude range
|
|
1329
|
+
//the min and max coords longitude
|
|
1330
|
+
let boxSpanIDL: boolean = false;
|
|
1331
|
+
//boolean coordSpanIDL = false;
|
|
1332
|
+
if (tl.x === 180 || tl.x === -180 || br.x === 180 || br.x === -180) {
|
|
1333
|
+
|
|
1334
|
+
boxSpanIDL = true;
|
|
1335
|
+
} else if (Math.abs(br.x - tl.x) > 180) {
|
|
1336
|
+
boxSpanIDL = true;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
// if (coordsRight - coordsLeft > 180)
|
|
1341
|
+
// {
|
|
1342
|
+
// let temp: double = coordsLeft;
|
|
1343
|
+
// coordsLeft = coordsRight;
|
|
1344
|
+
// coordsRight = temp;
|
|
1345
|
+
// coordSpanIDL=true;
|
|
1346
|
+
// }
|
|
1347
|
+
//boolean intersects=false;
|
|
1348
|
+
if (coordSpanIDL && boxSpanIDL) {
|
|
1349
|
+
intersects = true;
|
|
1350
|
+
} else if (!coordSpanIDL && !boxSpanIDL) //was && canclipPoints
|
|
1351
|
+
{
|
|
1352
|
+
if (coordsLeft <= tl.x && tl.x <= coordsRight) {
|
|
1353
|
+
intersects = true;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
if (coordsLeft <= br.x && br.x <= coordsRight) {
|
|
1357
|
+
intersects = true;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
if (tl.x <= coordsLeft && coordsLeft <= br.x) {
|
|
1361
|
+
intersects = true;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
if (tl.x <= coordsRight && coordsRight <= br.x) {
|
|
1365
|
+
intersects = true;
|
|
1366
|
+
}
|
|
1367
|
+
} else if (!coordSpanIDL && boxSpanIDL) //box spans IDL and coords do not
|
|
1368
|
+
{
|
|
1369
|
+
if (tl.x < coordsRight && coordsRight < 180) {
|
|
1370
|
+
intersects = true;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
if (-180 < coordsLeft && coordsLeft < br.x) {
|
|
1374
|
+
intersects = true;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
} else if (coordSpanIDL && !boxSpanIDL) //coords span IDL and box does not
|
|
1378
|
+
{
|
|
1379
|
+
if (coordsLeft < br.x && br.x < 180) {
|
|
1380
|
+
intersects = true;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
if (-180 < tl.x && tl.x < coordsRight) {
|
|
1384
|
+
intersects = true;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
return intersects;
|
|
1389
|
+
} catch (exc) {
|
|
1390
|
+
if (exc instanceof Error) {
|
|
1391
|
+
ErrorLogger.LogException("clsRenderer", "intersectsClipArea",
|
|
1392
|
+
new RendererException("Failed inside intersectsClipArea", exc));
|
|
1393
|
+
} else {
|
|
1394
|
+
throw exc;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
return result;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* Adds Feint, decoy, or dummy indicator to shapes. Does not check if tactical graphic should have indicator
|
|
1402
|
+
*/
|
|
1403
|
+
private static addFDI(tg: TGLight, shapes: Array<Shape2>): void {
|
|
1404
|
+
try {
|
|
1405
|
+
let msi: MSInfo = MSLookup.getInstance().getMSLInfo(tg.get_SymbolId());
|
|
1406
|
+
let drawRule: int = msi != null ? msi.getDrawRule() : -1;
|
|
1407
|
+
let lineType: int = tg.get_LineType();
|
|
1408
|
+
|
|
1409
|
+
if (lineType === TacticalLines.MAIN) {
|
|
1410
|
+
// Only Axis of Advance with arrowhead in a different location
|
|
1411
|
+
let points: Array<POINT2> = shapes[1].getPoints();
|
|
1412
|
+
let ptA: POINT2 = new POINT2(points[points.length - 3]);
|
|
1413
|
+
let ptB: POINT2 = new POINT2(points[points.length - 8]);
|
|
1414
|
+
let ptC: POINT2 = new POINT2(points[points.length - 7]);
|
|
1415
|
+
shapes.push(DISMSupport.getFDIShape(tg, ptA, ptB, ptC));
|
|
1416
|
+
} else if (drawRule === DrawRules.AXIS1 || drawRule === DrawRules.AXIS2) {
|
|
1417
|
+
// Axis of Advance symbols
|
|
1418
|
+
let points: Array<POINT2> = shapes[0].getPoints();
|
|
1419
|
+
let midPointIndex = Math.trunc(points.length / 2);
|
|
1420
|
+
let ptA: POINT2 = new POINT2(points[midPointIndex - 1]);
|
|
1421
|
+
let ptB: POINT2 = new POINT2(points[midPointIndex]);
|
|
1422
|
+
let ptC: POINT2 = new POINT2(points[midPointIndex + 1]);
|
|
1423
|
+
shapes.push(DISMSupport.getFDIShape(tg, ptA, ptB, ptC));
|
|
1424
|
+
}
|
|
1425
|
+
// Direction of attack symbols
|
|
1426
|
+
else if (lineType === TacticalLines.DIRATKAIR) {
|
|
1427
|
+
let points: Array<POINT2> = shapes[2].getPoints();
|
|
1428
|
+
let ptA: POINT2 = new POINT2(points[0]);
|
|
1429
|
+
let ptB: POINT2 = new POINT2(points[1]);
|
|
1430
|
+
let ptC: POINT2 = new POINT2(points[2]);
|
|
1431
|
+
shapes.push(DISMSupport.getFDIShape(tg, ptA, ptB, ptC));
|
|
1432
|
+
} else if (lineType === TacticalLines.DIRATKGND) {
|
|
1433
|
+
let points: Array<POINT2> = shapes[1].getPoints();
|
|
1434
|
+
let ptA: POINT2 = new POINT2(points[7]);
|
|
1435
|
+
let ptB: POINT2 = new POINT2(points[4]);
|
|
1436
|
+
let ptC: POINT2 = new POINT2(points[9]);
|
|
1437
|
+
shapes.push(DISMSupport.getFDIShape(tg, ptA, ptB, ptC));
|
|
1438
|
+
} else if (lineType === TacticalLines.DIRATKSPT) {
|
|
1439
|
+
let points: Array<POINT2> = shapes[1].getPoints();
|
|
1440
|
+
let ptA: POINT2 = new POINT2(points[0]);
|
|
1441
|
+
let ptB: POINT2 = new POINT2(points[1]);
|
|
1442
|
+
let ptC: POINT2 = new POINT2(points[2]);
|
|
1443
|
+
shapes.push(DISMSupport.getFDIShape(tg, ptA, ptB, ptC));
|
|
1444
|
+
} else {
|
|
1445
|
+
// Shape has no arrow. Put on top of shape
|
|
1446
|
+
let firstPoint: POINT2 = shapes[0].getPoints()[0];
|
|
1447
|
+
let ptUl: POINT2 = new POINT2(firstPoint);
|
|
1448
|
+
let ptUr: POINT2 = new POINT2(firstPoint);
|
|
1449
|
+
let ptLr: POINT2 = new POINT2(firstPoint);
|
|
1450
|
+
let ptLl: POINT2 = new POINT2(firstPoint);
|
|
1451
|
+
clsUtility.GetMBR(shapes, ptUl, ptUr, ptLr, ptLl);
|
|
1452
|
+
shapes.push(DISMSupport.getFDIShape(tg, ptUl, ptUr));
|
|
1453
|
+
}
|
|
1454
|
+
} catch (exc) {
|
|
1455
|
+
if (exc instanceof Error) {
|
|
1456
|
+
ErrorLogger.LogException(clsRenderer._className, "addFDI", new RendererException("failed inside addFDI", exc));
|
|
1457
|
+
} else {
|
|
1458
|
+
throw exc;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* GoogleEarth renderer uses polylines for rendering
|
|
1465
|
+
*
|
|
1466
|
+
* @param mss MilStdSymbol object
|
|
1467
|
+
* @param converter the geographic to pixels coordinate converter
|
|
1468
|
+
* @param clipArea the clip bounds
|
|
1469
|
+
*/
|
|
1470
|
+
public static renderWithPolylines(mss: MilStdSymbol,
|
|
1471
|
+
converter: IPointConversion,
|
|
1472
|
+
clipArea: Point2D[] | Rectangle | Rectangle2D): void;
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* @param mss
|
|
1476
|
+
* @param converter
|
|
1477
|
+
* @param clipArea
|
|
1478
|
+
* @param g2d
|
|
1479
|
+
* @deprecated Graphics2D not used
|
|
1480
|
+
*/
|
|
1481
|
+
public static renderWithPolylines(mss: MilStdSymbol,
|
|
1482
|
+
converter: IPointConversion,
|
|
1483
|
+
clipArea: Point2D[] | Rectangle | Rectangle2D,
|
|
1484
|
+
g2d: Graphics2D): void;
|
|
1485
|
+
public static renderWithPolylines(...args: unknown[]): void {
|
|
1486
|
+
switch (args.length) {
|
|
1487
|
+
case 3: {
|
|
1488
|
+
const [mss, converter, clipArea] = args as [MilStdSymbol, IPointConversion, Point2D[] | Rectangle | Rectangle2D];
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
try {
|
|
1492
|
+
let tg: TGLight = clsRenderer.createTGLightFromMilStdSymbol(mss, converter);
|
|
1493
|
+
let shapeInfos: Array<ShapeInfo> = new Array();
|
|
1494
|
+
let modifierShapeInfos: Array<ShapeInfo> = new Array();
|
|
1495
|
+
if (clsRenderer.intersectsClipArea(tg, converter, clipArea)) {
|
|
1496
|
+
clsRenderer.render_GE(tg, shapeInfos, modifierShapeInfos, converter, clipArea);
|
|
1497
|
+
}
|
|
1498
|
+
mss.setSymbolShapes(shapeInfos);
|
|
1499
|
+
mss.setModifierShapes(modifierShapeInfos);
|
|
1500
|
+
mss.set_WasClipped(tg.get_WasClipped());
|
|
1501
|
+
} catch (exc) {
|
|
1502
|
+
if (exc instanceof Error) {
|
|
1503
|
+
ErrorLogger.LogException("clsRenderer", "renderWithPolylines",
|
|
1504
|
+
new RendererException("Failed inside renderWithPolylines", exc));
|
|
1505
|
+
} else {
|
|
1506
|
+
throw exc;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
break;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
case 4: {
|
|
1515
|
+
const [mss, converter, clipArea, g2d] = args as [MilStdSymbol, IPointConversion, Point2D[] | Rectangle | Rectangle2D, Graphics2D];
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
try {
|
|
1519
|
+
let tg: TGLight = clsRenderer.createTGLightFromMilStdSymbol(mss, converter);
|
|
1520
|
+
let shapeInfos: Array<ShapeInfo> = new Array();
|
|
1521
|
+
let modifierShapeInfos: Array<ShapeInfo> = new Array();
|
|
1522
|
+
if (clsRenderer.intersectsClipArea(tg, converter, clipArea)) {
|
|
1523
|
+
clsRenderer.render_GE(tg, shapeInfos, modifierShapeInfos, converter, clipArea, g2d);
|
|
1524
|
+
}
|
|
1525
|
+
mss.setSymbolShapes(shapeInfos);
|
|
1526
|
+
mss.setModifierShapes(modifierShapeInfos);
|
|
1527
|
+
} catch (exc) {
|
|
1528
|
+
if (exc instanceof Error) {
|
|
1529
|
+
ErrorLogger.LogException("clsRenderer", "renderWithPolylines",
|
|
1530
|
+
new RendererException("Failed inside renderWithPolylines", exc));
|
|
1531
|
+
} else {
|
|
1532
|
+
throw exc;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
break;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
default: {
|
|
1541
|
+
throw Error(`Invalid number of arguments`);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* Google Earth renderer: Called by mapfragment-demo This is the public
|
|
1549
|
+
* interface for Google Earth renderer assumes tg.Pixels is filled assumes
|
|
1550
|
+
* the caller instantiated the ShapeInfo arrays
|
|
1551
|
+
*
|
|
1552
|
+
* @param tg tactical graphic
|
|
1553
|
+
* @param shapeInfos symbol ShapeInfo array
|
|
1554
|
+
* @param modifierShapeInfos modifier ShapeInfo array
|
|
1555
|
+
* @param converter geographic to pixels coordinate converter
|
|
1556
|
+
* @param clipArea clipping bounds in pixels
|
|
1557
|
+
*/
|
|
1558
|
+
public static render_GE(tg: TGLight,
|
|
1559
|
+
shapeInfos: Array<ShapeInfo>,
|
|
1560
|
+
modifierShapeInfos: Array<ShapeInfo>,
|
|
1561
|
+
converter: IPointConversion,
|
|
1562
|
+
clipArea: Point2D[] | Rectangle | Rectangle2D): void;
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* See render_GE below for comments
|
|
1566
|
+
*
|
|
1567
|
+
* @param tg
|
|
1568
|
+
* @param shapeInfos
|
|
1569
|
+
* @param modifierShapeInfos
|
|
1570
|
+
* @param converter
|
|
1571
|
+
* @param clipArea
|
|
1572
|
+
* @param g2d test android-gradle
|
|
1573
|
+
* @deprecated Graphics2D not used
|
|
1574
|
+
*/
|
|
1575
|
+
public static render_GE(tg: TGLight,
|
|
1576
|
+
shapeInfos: Array<ShapeInfo>,
|
|
1577
|
+
modifierShapeInfos: Array<ShapeInfo>,
|
|
1578
|
+
converter: IPointConversion,
|
|
1579
|
+
clipArea: Point2D[] | Rectangle | Rectangle2D,
|
|
1580
|
+
g2d: Graphics2D): void;
|
|
1581
|
+
public static render_GE(...args: unknown[]): void {
|
|
1582
|
+
switch (args.length) {
|
|
1583
|
+
case 5: {
|
|
1584
|
+
const [tg, shapeInfos, modifierShapeInfos, converter, clipArea] = args as [TGLight, Array<ShapeInfo>, Array<ShapeInfo>, IPointConversion, Point2D[] | Rectangle2D];
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
try {
|
|
1588
|
+
clsRenderer.reversePointsRevD(tg);
|
|
1589
|
+
|
|
1590
|
+
let clipBounds: Rectangle2D = null;
|
|
1591
|
+
CELineArray.setClient("ge");
|
|
1592
|
+
// ArrayList<POINT2> origPixels = null;
|
|
1593
|
+
// ArrayList<POINT2> origLatLongs = null;
|
|
1594
|
+
// if (clsUtilityGE.segmentColorsSet(tg)) {
|
|
1595
|
+
// origPixels=lineutility.getDeepCopy(tg.Pixels);
|
|
1596
|
+
// origLatLongs=lineutility.getDeepCopy(tg.LatLongs);
|
|
1597
|
+
// }
|
|
1598
|
+
let origFillPixels: Array<POINT2> = lineutility.getDeepCopy(tg.Pixels);
|
|
1599
|
+
|
|
1600
|
+
if (tg.get_LineType() === TacticalLines.LC) {
|
|
1601
|
+
|
|
1602
|
+
clsUtilityJTR.SegmentLCPoints(tg, converter);
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
// boolean shiftLines = Channels.getShiftLines();
|
|
1607
|
+
// if (shiftLines) {
|
|
1608
|
+
// let affiliation: string = tg.get_Affiliation();
|
|
1609
|
+
// Channels.setAffiliation(affiliation);
|
|
1610
|
+
// }
|
|
1611
|
+
//CELineArray.setMinLength(2.5); //2-27-2013
|
|
1612
|
+
let clipPoints: Array<Point2D> = null;
|
|
1613
|
+
if (clipArea != null) {
|
|
1614
|
+
if (clipArea instanceof Rectangle2D) {
|
|
1615
|
+
clipBounds = clipArea as Rectangle2D;
|
|
1616
|
+
} else if (clipArea instanceof Rectangle) {
|
|
1617
|
+
let rectx: Rectangle = clipArea as Rectangle;
|
|
1618
|
+
clipBounds = new Rectangle2D(rectx.x, rectx.y, rectx.width, rectx.height);
|
|
1619
|
+
} else if (clipArea instanceof Array) {
|
|
1620
|
+
clipPoints = clipArea as Array<Point2D>;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
let zoomFactor: double = clsUtilityGE.getZoomFactor(clipBounds, clipPoints, tg.Pixels);
|
|
1624
|
+
//add sub-section to test clipArea if client passes the rectangle
|
|
1625
|
+
/*
|
|
1626
|
+
let useClipPoints: boolean = false; //currently not used
|
|
1627
|
+
if (useClipPoints === true && clipBounds != null) {
|
|
1628
|
+
let x: double = clipBounds.getMinX();
|
|
1629
|
+
let y: double = clipBounds.getMinY();
|
|
1630
|
+
let width: double = clipBounds.getWidth();
|
|
1631
|
+
let height: double = clipBounds.getHeight();
|
|
1632
|
+
clipPoints = new Array();
|
|
1633
|
+
clipPoints.push(new Point2D(x, y));
|
|
1634
|
+
clipPoints.push(new Point2D(x + width, y));
|
|
1635
|
+
clipPoints.push(new Point2D(x + width, y + height));
|
|
1636
|
+
clipPoints.push(new Point2D(x, y + height));
|
|
1637
|
+
clipPoints.push(new Point2D(x, y));
|
|
1638
|
+
clipBounds = null;
|
|
1639
|
+
}
|
|
1640
|
+
//end section
|
|
1641
|
+
*/
|
|
1642
|
+
if (tg.get_Client() == null || tg.get_Client().length === 0) {
|
|
1643
|
+
tg.set_client("ge");
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
clsUtility.RemoveDuplicatePoints(tg);
|
|
1647
|
+
|
|
1648
|
+
let linetype: int = tg.get_LineType();
|
|
1649
|
+
if (linetype < 0) {
|
|
1650
|
+
linetype = clsUtilityJTR.GetLinetypeFromString(tg.get_SymbolId());
|
|
1651
|
+
//clsUtilityCPOF.SegmentGeoPoints(tg, converter);
|
|
1652
|
+
tg.set_LineType(linetype);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
let isTextFlipped: boolean = false;
|
|
1656
|
+
let shapes: Array<Shape2>; //use this to collect all the shapes
|
|
1657
|
+
clsUtilityGE.setSplineLinetype(tg);
|
|
1658
|
+
|
|
1659
|
+
clsUtilityCPOF.SegmentGeoPoints(tg, converter, zoomFactor);
|
|
1660
|
+
if (clipBounds != null || clipPoints != null) {
|
|
1661
|
+
if (clsUtilityCPOF.canClipPoints(tg)) {
|
|
1662
|
+
//check assignment
|
|
1663
|
+
if (clipBounds != null) {
|
|
1664
|
+
clsClipPolygon2.ClipPolygon(tg, clipBounds);
|
|
1665
|
+
} else {
|
|
1666
|
+
if (clipPoints != null) {
|
|
1667
|
+
clsClipQuad.ClipPolygon(tg, clipPoints);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
clsUtilityGE.removeTrailingPoints(tg, clipArea);
|
|
1672
|
+
tg.LatLongs = clsUtility.PixelsToLatLong(tg.Pixels, converter);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
//if MSR segment data set use original pixels unless tg.Pixels is empty from clipping
|
|
1677
|
+
// if (origPixels != null) {
|
|
1678
|
+
// if (tg.Pixels.length === 0) {
|
|
1679
|
+
// return;
|
|
1680
|
+
// } else {
|
|
1681
|
+
// tg.Pixels = origPixels;
|
|
1682
|
+
// tg.LatLongs = origLatLongs;
|
|
1683
|
+
// clipArea = null;
|
|
1684
|
+
// }
|
|
1685
|
+
// }
|
|
1686
|
+
clsUtilityJTR.InterpolatePixels(tg);
|
|
1687
|
+
|
|
1688
|
+
tg.modifiers = new Array();
|
|
1689
|
+
let g2d: Graphics2D = new Graphics2D();
|
|
1690
|
+
g2d.setFont(tg.get_Font());
|
|
1691
|
+
Modifier2.AddModifiersGeo(tg, g2d, clipArea, converter);
|
|
1692
|
+
|
|
1693
|
+
clsUtilityCPOF.FilterPoints2(tg, converter);
|
|
1694
|
+
clsUtilityJTR.FilterVerticalSegments(tg);
|
|
1695
|
+
clsUtility.FilterAXADPoints(tg, converter);
|
|
1696
|
+
clsUtilityCPOF.ClearPixelsStyle(tg);
|
|
1697
|
+
|
|
1698
|
+
let linesWithFillShapes: Array<Shape2> = null;
|
|
1699
|
+
|
|
1700
|
+
let savePixels: Array<POINT2> = tg.Pixels;
|
|
1701
|
+
tg.Pixels = origFillPixels;
|
|
1702
|
+
|
|
1703
|
+
//check assignment
|
|
1704
|
+
if (clipBounds != null) {
|
|
1705
|
+
linesWithFillShapes = clsClipPolygon2.LinesWithFill(tg, clipBounds);
|
|
1706
|
+
} else if (clipPoints != null) {
|
|
1707
|
+
linesWithFillShapes = clsClipQuad.LinesWithFill(tg, clipPoints);
|
|
1708
|
+
} else if (clipArea == null) {
|
|
1709
|
+
linesWithFillShapes = clsClipPolygon2.LinesWithFill(tg, null);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
tg.Pixels = savePixels;
|
|
1713
|
+
|
|
1714
|
+
let rangeFanFillShapes: Array<Shape2>;
|
|
1715
|
+
//do not fill the original shapes for circular range fans
|
|
1716
|
+
let savefillStyle: int = tg.get_FillStyle();
|
|
1717
|
+
if (linetype === TacticalLines.RANGE_FAN) {
|
|
1718
|
+
tg.set_Fillstyle(0);
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
//check assignment (pass which clip object is not null)
|
|
1722
|
+
if (clipBounds != null) {
|
|
1723
|
+
shapes = clsRenderer2.GetLineArray(tg, converter, isTextFlipped, clipBounds); //takes clip object
|
|
1724
|
+
} else if (clipPoints != null) {
|
|
1725
|
+
shapes = clsRenderer2.GetLineArray(tg, converter, isTextFlipped, clipPoints);
|
|
1726
|
+
} else if (clipArea == null) {
|
|
1727
|
+
shapes = clsRenderer2.GetLineArray(tg, converter, isTextFlipped, null);
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
// Add Feint, decoy, or dummy indicator
|
|
1731
|
+
if (shapes != null
|
|
1732
|
+
&& SymbolID.getSymbolSet(tg.get_SymbolId()) === SymbolID.SymbolSet_ControlMeasure
|
|
1733
|
+
&& SymbolUtilities.hasFDI(tg.get_SymbolId())) {
|
|
1734
|
+
clsRenderer.addFDI(tg, shapes);
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
switch (linetype) {
|
|
1738
|
+
case TacticalLines.RANGE_FAN:
|
|
1739
|
+
case TacticalLines.RANGE_FAN_SECTOR:
|
|
1740
|
+
case TacticalLines.RADAR_SEARCH: {
|
|
1741
|
+
if (tg.get_FillColor() == null || tg.get_FillColor().getAlpha() < 2) {
|
|
1742
|
+
break;
|
|
1743
|
+
}
|
|
1744
|
+
let tg1: TGLight = clsUtilityCPOF.GetCircularRangeFanFillTG(tg);
|
|
1745
|
+
tg1.set_Fillstyle(savefillStyle);
|
|
1746
|
+
tg1.set_SymbolId(tg.get_SymbolId());
|
|
1747
|
+
//check assignment (pass which clip object is not null)
|
|
1748
|
+
if (clipBounds != null) {
|
|
1749
|
+
rangeFanFillShapes = clsRenderer2.GetLineArray(tg1, converter, isTextFlipped, clipBounds);
|
|
1750
|
+
} else {
|
|
1751
|
+
if (clipPoints != null) {
|
|
1752
|
+
rangeFanFillShapes = clsRenderer2.GetLineArray(tg1, converter, isTextFlipped, clipPoints);
|
|
1753
|
+
} else {
|
|
1754
|
+
if (clipArea == null) {
|
|
1755
|
+
rangeFanFillShapes = clsRenderer2.GetLineArray(tg1, converter, isTextFlipped, null);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
if (rangeFanFillShapes != null) {
|
|
1763
|
+
if (shapes == null) {
|
|
1764
|
+
console.log("shapes is null");
|
|
1765
|
+
break;
|
|
1766
|
+
} else {
|
|
1767
|
+
shapes.splice(0, 0, ...rangeFanFillShapes);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
}
|
|
1771
|
+
break;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
default: {
|
|
1775
|
+
clsRenderer2.getAutoshapeFillShape(tg, shapes);
|
|
1776
|
+
break;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
}
|
|
1780
|
+
//end section
|
|
1781
|
+
|
|
1782
|
+
//undo any fillcolor for lines with fill
|
|
1783
|
+
clsUtilityCPOF.LinesWithSeparateFill(tg.get_LineType(), shapes);
|
|
1784
|
+
clsClipPolygon2.addAbatisFill(tg, shapes);
|
|
1785
|
+
|
|
1786
|
+
//if this line is commented then the extra line in testbed goes away
|
|
1787
|
+
if (shapes != null && linesWithFillShapes != null && linesWithFillShapes.length > 0) {
|
|
1788
|
+
shapes.splice(0, 0, ...linesWithFillShapes);
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
if (clsUtilityCPOF.canClipPoints(tg) === false && clipBounds != null) {
|
|
1792
|
+
shapes = clsUtilityCPOF.postClipShapes(tg, shapes, clipBounds);
|
|
1793
|
+
} else {
|
|
1794
|
+
if (clsUtilityCPOF.canClipPoints(tg) === false && clipPoints != null) {
|
|
1795
|
+
shapes = clsUtilityCPOF.postClipShapes(tg, shapes, clipPoints);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
clsRenderer.resolvePostClippedShapes(tg,shapes);
|
|
1799
|
+
|
|
1800
|
+
//returns early if textSpecs are null
|
|
1801
|
+
//currently the client is ignoring these
|
|
1802
|
+
if (modifierShapeInfos != null) {
|
|
1803
|
+
let textSpecs: Array<Shape2> = new Array();
|
|
1804
|
+
Modifier2.DisplayModifiers2(tg, g2d, textSpecs, isTextFlipped, converter);
|
|
1805
|
+
clsRenderer.Shape2ToShapeInfo(modifierShapeInfos, textSpecs);
|
|
1806
|
+
}
|
|
1807
|
+
clsRenderer.Shape2ToShapeInfo(shapeInfos, shapes);
|
|
1808
|
+
clsUtility.addHatchFills(tg, shapeInfos);
|
|
1809
|
+
|
|
1810
|
+
//check assignment (pass which clip object is not null)
|
|
1811
|
+
if (clipBounds != null) {
|
|
1812
|
+
clsUtilityGE.SetShapeInfosPolylines(tg, shapeInfos, clipBounds);//takes a clip object
|
|
1813
|
+
} else {
|
|
1814
|
+
if (clipPoints != null) {
|
|
1815
|
+
clsUtilityGE.SetShapeInfosPolylines(tg, shapeInfos, clipPoints);
|
|
1816
|
+
} else {
|
|
1817
|
+
if (clipArea == null) {
|
|
1818
|
+
clsUtilityGE.SetShapeInfosPolylines(tg, shapeInfos, null);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
} catch (exc) {
|
|
1825
|
+
if (exc instanceof Error) {
|
|
1826
|
+
ErrorLogger.LogException(clsRenderer._className, "render_GE",
|
|
1827
|
+
new RendererException("Failed inside render_GE", exc));
|
|
1828
|
+
|
|
1829
|
+
} else {
|
|
1830
|
+
throw exc;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
break;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
case 6: {
|
|
1839
|
+
const [tg, shapeInfos, modifierShapeInfos, converter, clipArea, g2d] = args as [TGLight, Array<ShapeInfo>, Array<ShapeInfo>, IPointConversion, Point2D[] | Rectangle | Rectangle2D, Graphics2D];
|
|
1840
|
+
|
|
1841
|
+
clsRenderer.render_GE(tg, shapeInfos, modifierShapeInfos, converter, clipArea);
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
break;
|
|
1845
|
+
|
|
1846
|
+
}
|
|
1847
|
+
default: {
|
|
1848
|
+
throw Error(`Invalid number of arguments`);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
/**
|
|
1854
|
+
* creates a shape for known symbols. The intent is to use client points for
|
|
1855
|
+
* the shape and is intended for use with ellipse. If hatch > 1 it creates 2 shapes
|
|
1856
|
+
* one for the hatch pattern, the second one is for the outline.
|
|
1857
|
+
*
|
|
1858
|
+
* @param milStd
|
|
1859
|
+
* @param ipc
|
|
1860
|
+
* @param clipArea
|
|
1861
|
+
* @param shapeType
|
|
1862
|
+
* @param lineColor
|
|
1863
|
+
* @param fillColor
|
|
1864
|
+
* @param hatch
|
|
1865
|
+
*/
|
|
1866
|
+
public static render_Shape(milStd: MilStdSymbol,
|
|
1867
|
+
ipc: IPointConversion,
|
|
1868
|
+
clipArea: Point2D[] | Rectangle | Rectangle2D = null,
|
|
1869
|
+
shapeType: int,
|
|
1870
|
+
lineColor: Color = null,
|
|
1871
|
+
fillColor: Color = null,
|
|
1872
|
+
hatch: int): void {
|
|
1873
|
+
try {
|
|
1874
|
+
let clipBounds: Rectangle2D = null;
|
|
1875
|
+
//CELineArray.setClient("ge");
|
|
1876
|
+
let clipPoints: Array<Point2D> = null;
|
|
1877
|
+
|
|
1878
|
+
if (clipArea != null) {
|
|
1879
|
+
if (clipArea instanceof Rectangle2D) {
|
|
1880
|
+
clipBounds = clipArea as Rectangle2D;
|
|
1881
|
+
} else if (clipArea instanceof Rectangle) {
|
|
1882
|
+
clipBounds = new Rectangle2D(clipArea.x, clipArea.y, clipArea.width, clipArea.height); // clipArea as Rectangle2D;
|
|
1883
|
+
} else if (clipArea instanceof Array) {
|
|
1884
|
+
clipPoints = clipArea as Array<Point2D>;
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
//can't use following line because it resets the pixels
|
|
1890
|
+
//TGLight tg = createTGLightFromMilStdSymbol(milStd, ipc);
|
|
1891
|
+
let tg: TGLight = new TGLight();
|
|
1892
|
+
tg.set_SymbolId(milStd.getSymbolID());
|
|
1893
|
+
//tg.set_VisibleModifiers(true);
|
|
1894
|
+
//set tg latlongs and pixels
|
|
1895
|
+
clsRenderer.setClientCoords(milStd, tg);
|
|
1896
|
+
//build tg.Pixels
|
|
1897
|
+
tg.Pixels = clsUtility.LatLongToPixels(tg.LatLongs, ipc);
|
|
1898
|
+
|
|
1899
|
+
//int fillStyle = milStd.getPatternFillType();
|
|
1900
|
+
let shape: Shape2 = new Shape2(shapeType);
|
|
1901
|
+
shape.setFillColor(fillColor);
|
|
1902
|
+
if (lineColor != null) {
|
|
1903
|
+
shape.setLineColor(lineColor);
|
|
1904
|
+
shape.setStroke(new BasicStroke(milStd.getLineWidth()));
|
|
1905
|
+
}
|
|
1906
|
+
//the client has already set the coordinates for the shape
|
|
1907
|
+
let pt: POINT2;
|
|
1908
|
+
for (let j: int = 0; j < tg.Pixels.length; j++) {
|
|
1909
|
+
pt = tg.Pixels[j];
|
|
1910
|
+
if (j === 0) {
|
|
1911
|
+
shape.moveTo(pt);
|
|
1912
|
+
} else {
|
|
1913
|
+
shape.lineTo(pt);
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
//post clip the shape and set the polylines
|
|
1918
|
+
let shapes: Array<Shape2> = new Array();
|
|
1919
|
+
shapes.push(shape);
|
|
1920
|
+
//post-clip the shape
|
|
1921
|
+
if (clsUtilityCPOF.canClipPoints(tg) === false && clipBounds != null) {
|
|
1922
|
+
shapes = clsUtilityCPOF.postClipShapes(tg, shapes, clipBounds);
|
|
1923
|
+
} else {
|
|
1924
|
+
if (clsUtilityCPOF.canClipPoints(tg) === false && clipPoints != null) {
|
|
1925
|
+
shapes = clsUtilityCPOF.postClipShapes(tg, shapes, clipPoints);
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
shape = shapes[0];
|
|
1930
|
+
if (hatch > 1) {
|
|
1931
|
+
shape = clsUtility.buildHatchArea(tg, shape, hatch, 20);
|
|
1932
|
+
shape.setLineColor(lineColor);
|
|
1933
|
+
shape.setStroke(new BasicStroke(1));
|
|
1934
|
+
//shapes.clear();
|
|
1935
|
+
shapes.push(shape);
|
|
1936
|
+
}
|
|
1937
|
+
let shapeInfos: Array<ShapeInfo> = new Array();
|
|
1938
|
+
clsRenderer.Shape2ToShapeInfo(shapeInfos, shapes);
|
|
1939
|
+
//set the shapeInfo polylines
|
|
1940
|
+
if (clipBounds != null) {
|
|
1941
|
+
clsUtilityGE.SetShapeInfosPolylines(tg, shapeInfos, clipBounds);
|
|
1942
|
+
} else {
|
|
1943
|
+
if (clipPoints != null) {
|
|
1944
|
+
clsUtilityGE.SetShapeInfosPolylines(tg, shapeInfos, clipPoints);
|
|
1945
|
+
} else {
|
|
1946
|
+
if (clipArea == null) {
|
|
1947
|
+
clsUtilityGE.SetShapeInfosPolylines(tg, shapeInfos, null);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
//set milStd symbol shapes
|
|
1954
|
+
if (milStd.getSymbolShapes() == null) {
|
|
1955
|
+
milStd.setSymbolShapes(shapeInfos);
|
|
1956
|
+
} else {
|
|
1957
|
+
milStd.getSymbolShapes().push(...shapeInfos);
|
|
1958
|
+
}
|
|
1959
|
+
return;
|
|
1960
|
+
} catch (exc) {
|
|
1961
|
+
if (exc instanceof Error) {
|
|
1962
|
+
ErrorLogger.LogException(clsRenderer._className, "render_Shape",
|
|
1963
|
+
new RendererException("Failed inside render_Shape", exc));
|
|
1964
|
+
|
|
1965
|
+
} else {
|
|
1966
|
+
throw exc;
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
private static resolvePostClippedShapes(tg: TGLight, shapes: Array<Shape2>): void {
|
|
1972
|
+
try {
|
|
1973
|
+
//resolve the PBS and BBS shape properties after the post clip, regardless whether they were clipped
|
|
1974
|
+
switch (tg.get_LineType()) {
|
|
1975
|
+
case TacticalLines.BBS_RECTANGLE:
|
|
1976
|
+
case TacticalLines.BBS_POINT:
|
|
1977
|
+
case TacticalLines.BBS_LINE:
|
|
1978
|
+
case TacticalLines.BBS_AREA:
|
|
1979
|
+
case TacticalLines.PBS_RECTANGLE:
|
|
1980
|
+
case TacticalLines.PBS_SQUARE:
|
|
1981
|
+
break;
|
|
1982
|
+
default:
|
|
1983
|
+
return;
|
|
1984
|
+
}
|
|
1985
|
+
let fillColor: Color = tg.get_FillColor();
|
|
1986
|
+
shapes[0].setFillColor(fillColor);
|
|
1987
|
+
shapes[1].setFillColor(null);
|
|
1988
|
+
let fillStyle: int = tg.get_FillStyle();
|
|
1989
|
+
shapes[0].setFillStyle(0);
|
|
1990
|
+
shapes[1].setFillStyle(fillStyle);
|
|
1991
|
+
return;
|
|
1992
|
+
|
|
1993
|
+
} catch (exc) {
|
|
1994
|
+
if (exc instanceof Error) {
|
|
1995
|
+
ErrorLogger.LogException(clsRenderer._className, "resolvePostClippedShapes",
|
|
1996
|
+
new RendererException("Failed inside resolvePostClippedShapes", exc));
|
|
1997
|
+
} else {
|
|
1998
|
+
throw exc;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
/**
|
|
2004
|
+
* set the clip rectangle as an arraylist or a Rectangle2D depending on the
|
|
2005
|
+
* object
|
|
2006
|
+
*
|
|
2007
|
+
* @param clipBounds
|
|
2008
|
+
* @param clipRect
|
|
2009
|
+
* @param clipArray
|
|
2010
|
+
* @return
|
|
2011
|
+
*/
|
|
2012
|
+
private static setClip(clipBounds: Rectangle2D | Rectangle | Array<Point2D> | null, clipRect: Rectangle2D, clipArray: Array<Point2D>): boolean {
|
|
2013
|
+
try {
|
|
2014
|
+
if (clipBounds == null) {
|
|
2015
|
+
return false;
|
|
2016
|
+
} else if (clipBounds instanceof Rectangle2D) {
|
|
2017
|
+
clipRect.setRect(clipBounds as Rectangle2D);
|
|
2018
|
+
} else if (clipBounds instanceof Rectangle) {
|
|
2019
|
+
//clipRect.setRect((Rectangle2D)clipBounds);
|
|
2020
|
+
let rectx: Rectangle = clipBounds as Rectangle;
|
|
2021
|
+
//clipBounds=new Rectangle2D(rectx.x,rectx.y,rectx.width,rectx.height);
|
|
2022
|
+
clipRect.setRect(rectx.x, rectx.y, rectx.width, rectx.height);
|
|
2023
|
+
} else if (clipBounds instanceof Array) {
|
|
2024
|
+
clipArray.push(...clipBounds);
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
} catch (exc) {
|
|
2028
|
+
if (exc instanceof Error) {
|
|
2029
|
+
ErrorLogger.LogException(clsRenderer._className, "setClip",
|
|
2030
|
+
new RendererException("Failed inside setClip", exc));
|
|
2031
|
+
|
|
2032
|
+
} else {
|
|
2033
|
+
throw exc;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
return true;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
/**
|
|
2040
|
+
* public render function transferred from JavaLineArrayCPOF project. Use
|
|
2041
|
+
* this function to replicate CPOF renderer functionality.
|
|
2042
|
+
*
|
|
2043
|
+
* @param mss the milStdSymbol object
|
|
2044
|
+
* @param converter the geographic to pixels coordinate converter
|
|
2045
|
+
* @param clipBounds the pixels based clip bounds
|
|
2046
|
+
*/
|
|
2047
|
+
public static render(mss: MilStdSymbol,
|
|
2048
|
+
converter: IPointConversion,
|
|
2049
|
+
clipBounds: Rectangle2D | Array<Point2D> | null): void;
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Generic tester button says Tiger or use JavaRendererSample. Generic
|
|
2053
|
+
* renderer testers: called by JavaRendererSample and TestJavaLineArray
|
|
2054
|
+
* public render function transferred from JavaLineArrayCPOF project. Use
|
|
2055
|
+
* this function to replicate CPOF renderer functionality.
|
|
2056
|
+
*
|
|
2057
|
+
* @param mss MilStdSymbol
|
|
2058
|
+
* @param converter geographic to pixels converter
|
|
2059
|
+
* @param shapeInfos ShapeInfo array
|
|
2060
|
+
* @param modifierShapeInfos modifier ShapeInfo array
|
|
2061
|
+
* @param clipBounds clip bounds
|
|
2062
|
+
*/
|
|
2063
|
+
public static render(mss: MilStdSymbol,
|
|
2064
|
+
converter: IPointConversion,
|
|
2065
|
+
shapeInfos: Array<ShapeInfo>,
|
|
2066
|
+
modifierShapeInfos: Array<ShapeInfo>,
|
|
2067
|
+
clipBounds: Rectangle2D | Rectangle | Array<Point2D> | null): void;
|
|
2068
|
+
public static render(...args: unknown[]): void {
|
|
2069
|
+
switch (args.length) {
|
|
2070
|
+
case 3: {
|
|
2071
|
+
const [mss, converter, clipBounds] = args as [MilStdSymbol, IPointConversion, Rectangle2D | Rectangle | Array<Point2D> | null];
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
try {
|
|
2075
|
+
let shapeInfos: Array<ShapeInfo> = new Array();
|
|
2076
|
+
let modifierShapeInfos: Array<ShapeInfo> = new Array();
|
|
2077
|
+
clsRenderer.render(mss, converter, shapeInfos, modifierShapeInfos, clipBounds);
|
|
2078
|
+
} catch (exc) {
|
|
2079
|
+
if (exc instanceof Error) {
|
|
2080
|
+
ErrorLogger.LogException(clsRenderer._className, "render",
|
|
2081
|
+
new RendererException("render", exc));
|
|
2082
|
+
|
|
2083
|
+
} else {
|
|
2084
|
+
throw exc;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
|
|
2089
|
+
break;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
case 5: {
|
|
2093
|
+
const [mss, converter, shapeInfos, modifierShapeInfos, clipBounds] = args as [MilStdSymbol, IPointConversion, Array<ShapeInfo>, Array<ShapeInfo>, Rectangle2D | Array<Point2D> | null];
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
try {
|
|
2097
|
+
//boolean shiftLines = Channels.getShiftLines();
|
|
2098
|
+
//end section
|
|
2099
|
+
|
|
2100
|
+
let clipRect: Rectangle2D = new Rectangle2D();
|
|
2101
|
+
let clipArray: Array<Point2D> = new Array();
|
|
2102
|
+
clsRenderer.setClip(clipBounds, clipRect, clipArray);
|
|
2103
|
+
|
|
2104
|
+
let tg: TGLight = clsRenderer.createTGLightFromMilStdSymbol(mss, converter);
|
|
2105
|
+
clsRenderer.reversePointsRevD(tg);
|
|
2106
|
+
CELineArray.setClient("generic");
|
|
2107
|
+
// if (shiftLines) {
|
|
2108
|
+
// let affiliation: string = tg.get_Affiliation();
|
|
2109
|
+
// Channels.setAffiliation(affiliation);
|
|
2110
|
+
// }
|
|
2111
|
+
//CELineArray.setMinLength(2.5); //2-27-2013
|
|
2112
|
+
|
|
2113
|
+
let linetype: int = tg.get_LineType();
|
|
2114
|
+
//replace calls to MovePixels
|
|
2115
|
+
clsUtility.RemoveDuplicatePoints(tg);
|
|
2116
|
+
|
|
2117
|
+
let g2d: Graphics2D = new Graphics2D();
|
|
2118
|
+
g2d.setFont(tg.get_Font());
|
|
2119
|
+
clsUtilityCPOF.SegmentGeoPoints(tg, converter, 1);
|
|
2120
|
+
clsUtility.FilterAXADPoints(tg, converter);
|
|
2121
|
+
|
|
2122
|
+
//prevent vertical segments for oneway, twoway, alt
|
|
2123
|
+
clsUtilityJTR.FilterVerticalSegments(tg);
|
|
2124
|
+
let isChange1Area: boolean = clsUtilityJTR.IsChange1Area(linetype);
|
|
2125
|
+
let isTextFlipped: boolean = false;
|
|
2126
|
+
//for 3d change 1 symbols we do not transform the points
|
|
2127
|
+
|
|
2128
|
+
//if it is world view then we want to flip the far points about
|
|
2129
|
+
//the left and right sides to get two symbols
|
|
2130
|
+
let farLeftPixels: Array<POINT2> = new Array();
|
|
2131
|
+
let farRightPixels: Array<POINT2> = new Array();
|
|
2132
|
+
if (isChange1Area === false) {
|
|
2133
|
+
clsUtilityCPOF.GetFarPixels(tg, converter, farLeftPixels, farRightPixels);
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
let shapesLeft: Array<Shape2> = new Array();
|
|
2137
|
+
let shapesRight: Array<Shape2> = new Array();
|
|
2138
|
+
let shapes: Array<Shape2>; //use this to collect all the shapes
|
|
2139
|
+
|
|
2140
|
+
//CPOF 6.0 diagnostic
|
|
2141
|
+
let textSpecsLeft: Array<Shape2>;
|
|
2142
|
+
let textSpecsRight: Array<Shape2>;
|
|
2143
|
+
//Note: DisplayModifiers3 returns early if textSpecs are null
|
|
2144
|
+
textSpecsLeft = new Array();
|
|
2145
|
+
textSpecsRight = new Array();
|
|
2146
|
+
|
|
2147
|
+
if (farLeftPixels.length > 0) {
|
|
2148
|
+
tg.Pixels = farLeftPixels;
|
|
2149
|
+
shapesLeft = clsRenderer2.GetLineArray(tg, converter, isTextFlipped, clipBounds);
|
|
2150
|
+
//CPOF 6.0
|
|
2151
|
+
//returns early if textSpecs are null
|
|
2152
|
+
Modifier2.DisplayModifiers2(tg, g2d, textSpecsLeft, isTextFlipped, null);
|
|
2153
|
+
}
|
|
2154
|
+
if (farRightPixels.length > 0) {
|
|
2155
|
+
tg.Pixels = farRightPixels;
|
|
2156
|
+
shapesRight = clsRenderer2.GetLineArray(tg, converter, isTextFlipped, clipBounds);
|
|
2157
|
+
//CPOF 6.0
|
|
2158
|
+
//returns early if textSpecs are null
|
|
2159
|
+
Modifier2.DisplayModifiers2(tg, g2d, textSpecsRight, isTextFlipped, null);
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
//CPOF 6.0 diagnostic
|
|
2163
|
+
let textSpecs: Array<Shape2> = new Array();
|
|
2164
|
+
|
|
2165
|
+
if (shapesLeft.length === 0 || shapesRight.length === 0) {
|
|
2166
|
+
let linesWithFillShapes: Array<Shape2> = null;
|
|
2167
|
+
if (clipArray != null && clipArray.length > 0) {
|
|
2168
|
+
linesWithFillShapes = clsClipQuad.LinesWithFill(tg, clipArray);
|
|
2169
|
+
} else {
|
|
2170
|
+
if (clipRect != null && clipRect.getWidth() !== 0) {
|
|
2171
|
+
linesWithFillShapes = clsClipPolygon2.LinesWithFill(tg, clipRect);
|
|
2172
|
+
} else {
|
|
2173
|
+
linesWithFillShapes = clsClipPolygon2.LinesWithFill(tg, null);
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
|
|
2178
|
+
//diagnostic: comment two lines if using the WW tester
|
|
2179
|
+
if (clsUtilityCPOF.canClipPoints(tg) && clipBounds != null) {
|
|
2180
|
+
if (clipArray != null && clipArray.length > 0) {
|
|
2181
|
+
clsClipQuad.ClipPolygon(tg, clipArray);
|
|
2182
|
+
} else {
|
|
2183
|
+
if (clipRect != null && clipRect.getWidth() !== 0) {
|
|
2184
|
+
clsClipPolygon2.ClipPolygon(tg, clipRect);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
|
|
2189
|
+
tg.LatLongs = clsUtility.PixelsToLatLong(tg.Pixels, converter);
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
//diagnostic 1-28-13
|
|
2193
|
+
clsUtilityJTR.InterpolatePixels(tg);
|
|
2194
|
+
|
|
2195
|
+
tg.modifiers = new Array();
|
|
2196
|
+
Modifier2.AddModifiersGeo(tg, g2d, clipBounds, converter);
|
|
2197
|
+
|
|
2198
|
+
clsUtilityCPOF.FilterPoints2(tg, converter);
|
|
2199
|
+
clsUtilityCPOF.ClearPixelsStyle(tg);
|
|
2200
|
+
//add section to replace preceding line M. Deutch 11-4-2011
|
|
2201
|
+
let rangeFanFillShapes: Array<Shape2> | null;
|
|
2202
|
+
//do not fill the original shapes for circular range fans
|
|
2203
|
+
let savefillStyle: int = tg.get_FillStyle();
|
|
2204
|
+
if (linetype === TacticalLines.RANGE_FAN) {
|
|
2205
|
+
tg.set_Fillstyle(0);
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
shapes = clsRenderer2.GetLineArray(tg, converter, isTextFlipped, clipBounds);
|
|
2209
|
+
|
|
2210
|
+
// Add Feint, decoy, or dummy indicator
|
|
2211
|
+
if (shapes != null
|
|
2212
|
+
&& SymbolID.getSymbolSet(tg.get_SymbolId()) === SymbolID.SymbolSet_ControlMeasure
|
|
2213
|
+
&& SymbolUtilities.hasFDI(tg.get_SymbolId())) {
|
|
2214
|
+
clsRenderer.addFDI(tg, shapes);
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
switch (linetype) {
|
|
2218
|
+
case TacticalLines.RANGE_FAN:
|
|
2219
|
+
case TacticalLines.RANGE_FAN_SECTOR:
|
|
2220
|
+
case TacticalLines.RADAR_SEARCH: {
|
|
2221
|
+
if (tg.get_FillColor() == null || tg.get_FillColor().getAlpha() < 2) {
|
|
2222
|
+
break;
|
|
2223
|
+
}
|
|
2224
|
+
let tg1: TGLight = clsUtilityCPOF.GetCircularRangeFanFillTG(tg);
|
|
2225
|
+
tg1.set_Fillstyle(savefillStyle);
|
|
2226
|
+
tg1.set_SymbolId(tg.get_SymbolId());
|
|
2227
|
+
rangeFanFillShapes = clsRenderer2.GetLineArray(tg1, converter, isTextFlipped, clipBounds);
|
|
2228
|
+
|
|
2229
|
+
if (rangeFanFillShapes != null) {
|
|
2230
|
+
shapes.splice(0, 0, ...rangeFanFillShapes);
|
|
2231
|
+
}
|
|
2232
|
+
break;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
default: {
|
|
2236
|
+
break;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
//undo any fillcolor for lines with fill
|
|
2242
|
+
clsUtilityCPOF.LinesWithSeparateFill(tg.get_LineType(), shapes);
|
|
2243
|
+
clsClipPolygon2.addAbatisFill(tg, shapes);
|
|
2244
|
+
|
|
2245
|
+
//if this line is commented then the extra line in testbed goes away
|
|
2246
|
+
if (shapes != null && linesWithFillShapes != null && linesWithFillShapes.length > 0) {
|
|
2247
|
+
shapes.splice(0, 0, ...linesWithFillShapes);
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
if (shapes != null && shapes.length > 0) {
|
|
2251
|
+
Modifier2.DisplayModifiers2(tg, g2d, textSpecs, isTextFlipped, null);
|
|
2252
|
+
clsRenderer.Shape2ToShapeInfo(modifierShapeInfos, textSpecs);
|
|
2253
|
+
mss.setModifierShapes(modifierShapeInfos);
|
|
2254
|
+
}
|
|
2255
|
+
} else //symbol was more than 180 degrees wide, use left and right symbols
|
|
2256
|
+
{
|
|
2257
|
+
shapes = shapesLeft;
|
|
2258
|
+
shapes.push(...shapesRight);
|
|
2259
|
+
|
|
2260
|
+
if (textSpecs != null) {
|
|
2261
|
+
textSpecs.push(...textSpecsLeft);
|
|
2262
|
+
textSpecs.push(...textSpecsRight);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
//post-clip the points if the tg could not be pre-clipped
|
|
2266
|
+
if (clsUtilityCPOF.canClipPoints(tg) === false && clipBounds != null) {
|
|
2267
|
+
shapes = clsUtilityCPOF.postClipShapes(tg, shapes, clipBounds);
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
clsRenderer.Shape2ToShapeInfo(shapeInfos, shapes);
|
|
2271
|
+
clsUtility.addHatchFills(tg, shapeInfos);
|
|
2272
|
+
mss.setSymbolShapes(shapeInfos);
|
|
2273
|
+
} catch (exc) {
|
|
2274
|
+
if (exc instanceof Error) {
|
|
2275
|
+
ErrorLogger.LogException(clsRenderer._className, "render",
|
|
2276
|
+
new RendererException("Failed inside render", exc));
|
|
2277
|
+
|
|
2278
|
+
} else {
|
|
2279
|
+
throw exc;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
break;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
default: {
|
|
2288
|
+
throw Error(`Invalid number of arguments`);
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
public static getCMLineType(version: int, entityCode: int): int {
|
|
2295
|
+
// Check if line type is specific to a version
|
|
2296
|
+
if (version === SymbolID.Version_2525E) {
|
|
2297
|
+
switch (entityCode) {
|
|
2298
|
+
// Added in 2525E
|
|
2299
|
+
case 110400: {
|
|
2300
|
+
return TacticalLines.GENERIC_LINE;
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
case 120700: {
|
|
2304
|
+
return TacticalLines.GENERIC_AREA;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
case 141800: {
|
|
2308
|
+
return TacticalLines.HOL;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
case 141900: {
|
|
2312
|
+
return TacticalLines.BHL;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
case 310800: {
|
|
2316
|
+
return TacticalLines.CSA;
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
case 330500: {
|
|
2320
|
+
return TacticalLines.ROUTE;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
case 330501: {
|
|
2324
|
+
return TacticalLines.ROUTE_ONEWAY;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
case 330502: {
|
|
2328
|
+
return TacticalLines.ROUTE_ALT;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
case 344100: {
|
|
2332
|
+
return TacticalLines.FPOL;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
case 344200: {
|
|
2336
|
+
return TacticalLines.RPOL;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
// Updated in 2525E
|
|
2340
|
+
case 120500: {
|
|
2341
|
+
return TacticalLines.BASE_CAMP;
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
case 120600: {
|
|
2345
|
+
return TacticalLines.GUERILLA_BASE;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
case 151000: {
|
|
2349
|
+
return TacticalLines.FORT;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
case 260400: {
|
|
2353
|
+
return TacticalLines.BCL;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
case 310100: {
|
|
2357
|
+
return TacticalLines.DHA;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
|
|
2361
|
+
default:
|
|
2362
|
+
|
|
2363
|
+
}
|
|
2364
|
+
} else { // 2525Dchange 1 and older
|
|
2365
|
+
switch (entityCode) {
|
|
2366
|
+
// Updated in 2525E
|
|
2367
|
+
case 120500: {
|
|
2368
|
+
return TacticalLines.BASE_CAMP_REVD;
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
case 120600: {
|
|
2372
|
+
return TacticalLines.GUERILLA_BASE_REVD;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
case 151000: {
|
|
2376
|
+
return TacticalLines.FORT_REVD;
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
case 260400: {
|
|
2380
|
+
return TacticalLines.BCL_REVD;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
case 310100: {
|
|
2384
|
+
return TacticalLines.DHA_REVD;
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
// Removed in 2525E
|
|
2388
|
+
case 150300: {
|
|
2389
|
+
return TacticalLines.ASSY;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
case 241601: {
|
|
2393
|
+
return TacticalLines.SENSOR;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
case 241602: {
|
|
2397
|
+
return TacticalLines.SENSOR_RECTANGULAR;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
case 241603: {
|
|
2401
|
+
return TacticalLines.SENSOR_CIRCULAR;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
default:
|
|
2406
|
+
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
// Line type isn't specific to a version or doesn't exist
|
|
2410
|
+
switch (entityCode) {
|
|
2411
|
+
case 200101: {
|
|
2412
|
+
return TacticalLines.LAUNCH_AREA;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
case 200201: {
|
|
2416
|
+
return TacticalLines.DEFENDED_AREA_CIRCULAR;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
case 200202: {
|
|
2420
|
+
return TacticalLines.DEFENDED_AREA_RECTANGULAR;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
case 120100: {
|
|
2424
|
+
return TacticalLines.AO;
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
case 120200: {
|
|
2428
|
+
return TacticalLines.NAI;
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
case 120300: {
|
|
2432
|
+
return TacticalLines.TAI;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
case 120400: {
|
|
2436
|
+
return TacticalLines.AIRFIELD;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
case 151401: {
|
|
2440
|
+
return TacticalLines.AIRAOA;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
case 151402: {
|
|
2444
|
+
return TacticalLines.AAAAA;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
case 151403: {
|
|
2448
|
+
return TacticalLines.MAIN;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
case 151404: {
|
|
2452
|
+
return TacticalLines.SPT;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
case 110100: {
|
|
2456
|
+
return TacticalLines.BOUNDARY;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
case 110200: {
|
|
2460
|
+
return TacticalLines.LL;
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
case 110300: {
|
|
2464
|
+
return TacticalLines.EWL;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
case 140100: {
|
|
2468
|
+
return TacticalLines.FLOT;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
case 140200: {
|
|
2472
|
+
return TacticalLines.LC;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
case 140300: {
|
|
2476
|
+
return TacticalLines.PL;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
case 140400: {
|
|
2480
|
+
return TacticalLines.FEBA;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
case 140500: {
|
|
2484
|
+
return TacticalLines.PDF;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
case 140601: {
|
|
2488
|
+
return TacticalLines.DIRATKAIR;
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
case 140602: {
|
|
2492
|
+
return TacticalLines.DIRATKGND;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
case 140603: {
|
|
2496
|
+
return TacticalLines.DIRATKSPT;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
case 140700: {
|
|
2500
|
+
return TacticalLines.FCL;
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
case 140800: {
|
|
2504
|
+
return TacticalLines.IL;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
case 140900: {
|
|
2508
|
+
return TacticalLines.LOA;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
case 141000: {
|
|
2512
|
+
return TacticalLines.LOD;
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
case 141100: {
|
|
2516
|
+
return TacticalLines.LDLC;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
case 141200: {
|
|
2520
|
+
return TacticalLines.PLD;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
case 150200: {
|
|
2524
|
+
return TacticalLines.ASSY;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
case 150100: {
|
|
2528
|
+
return TacticalLines.GENERAL;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
case 150501: {
|
|
2532
|
+
return TacticalLines.JTAA;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
case 150502: {
|
|
2536
|
+
return TacticalLines.SAA;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
case 150503: {
|
|
2540
|
+
return TacticalLines.SGAA;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
case 150600: { //dz no eny
|
|
2544
|
+
return TacticalLines.DZ;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
case 150700: { //ez no eny
|
|
2548
|
+
return TacticalLines.EZ;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
case 150800: { //lz no eny
|
|
2552
|
+
return TacticalLines.LZ;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
case 150900: { //pz no eny
|
|
2556
|
+
return TacticalLines.PZ;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
case 151100: {
|
|
2560
|
+
return TacticalLines.LAA;
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
case 151200: {
|
|
2564
|
+
return TacticalLines.BATTLE;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
case 151202: {
|
|
2568
|
+
return TacticalLines.PNO;
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
case 151204: {
|
|
2572
|
+
return TacticalLines.CONTAIN;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
case 151205: {
|
|
2576
|
+
return TacticalLines.RETAIN;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
case 151300: {
|
|
2580
|
+
return TacticalLines.EA;
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
case 151203: {
|
|
2584
|
+
return TacticalLines.STRONG;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
case 151500: {
|
|
2588
|
+
return TacticalLines.ASSAULT;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
case 151600: {
|
|
2592
|
+
return TacticalLines.ATKPOS;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
case 151700: {
|
|
2596
|
+
return TacticalLines.OBJ;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
case 151800: {
|
|
2600
|
+
return TacticalLines.ENCIRCLE;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
case 151900: {
|
|
2604
|
+
return TacticalLines.PEN;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
case 152000: {
|
|
2608
|
+
return TacticalLines.ATKBYFIRE;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
case 152100: {
|
|
2612
|
+
return TacticalLines.SPTBYFIRE;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
case 152200: {
|
|
2616
|
+
return TacticalLines.SARA;
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
case 141300: {
|
|
2620
|
+
return TacticalLines.AIRHEAD;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
case 141400: {
|
|
2624
|
+
return TacticalLines.BRDGHD;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
case 141500: {
|
|
2628
|
+
return TacticalLines.HOLD;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
case 141600: {
|
|
2632
|
+
return TacticalLines.RELEASE;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
case 141700: {
|
|
2636
|
+
return TacticalLines.AMBUSH;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
case 170100: {
|
|
2640
|
+
return TacticalLines.AC;
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
case 170200: {
|
|
2644
|
+
return TacticalLines.LLTR;
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
case 170300: {
|
|
2648
|
+
return TacticalLines.MRR;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
case 170400: {
|
|
2652
|
+
return TacticalLines.SL;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
case 170500: {
|
|
2656
|
+
return TacticalLines.SAAFR;
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
case 170600: {
|
|
2660
|
+
return TacticalLines.TC;
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
case 170700: {
|
|
2664
|
+
return TacticalLines.SC;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
case 170800: {
|
|
2668
|
+
return TacticalLines.BDZ;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
case 170900: {
|
|
2672
|
+
return TacticalLines.HIDACZ;
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
case 171000: {
|
|
2676
|
+
return TacticalLines.ROZ;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
case 171100: {
|
|
2680
|
+
return TacticalLines.AARROZ;
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
case 171200: {
|
|
2684
|
+
return TacticalLines.UAROZ;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
case 171300: {
|
|
2688
|
+
return TacticalLines.WEZ;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
case 171400: {
|
|
2692
|
+
return TacticalLines.FEZ;
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
case 171500: {
|
|
2696
|
+
return TacticalLines.JEZ;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
case 171600: {
|
|
2700
|
+
return TacticalLines.MEZ;
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
case 171700: {
|
|
2704
|
+
return TacticalLines.LOMEZ;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
case 171800: {
|
|
2708
|
+
return TacticalLines.HIMEZ;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
case 171900: {
|
|
2712
|
+
return TacticalLines.FAADZ;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
case 172000: {
|
|
2716
|
+
return TacticalLines.WFZ;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
case 200401: {
|
|
2720
|
+
return TacticalLines.SHIP_AOI_CIRCULAR;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
case 240804: {
|
|
2724
|
+
return TacticalLines.RECTANGULAR_TARGET;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
case 220100: {
|
|
2728
|
+
return TacticalLines.BEARING;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
case 220101: {
|
|
2732
|
+
return TacticalLines.ELECTRO;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
case 220102: { //EW //new label
|
|
2736
|
+
return TacticalLines.BEARING_EW;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
case 220103: {
|
|
2740
|
+
return TacticalLines.ACOUSTIC;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
case 220104: {
|
|
2744
|
+
return TacticalLines.ACOUSTIC_AMB;
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
case 220105: {
|
|
2748
|
+
return TacticalLines.TORPEDO;
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
case 220106: {
|
|
2752
|
+
return TacticalLines.OPTICAL;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
case 218400: {
|
|
2756
|
+
return TacticalLines.NAVIGATION;
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2759
|
+
case 220107: { //Jammer //new label
|
|
2760
|
+
return TacticalLines.BEARING_J;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
case 220108: { //RDF //new label
|
|
2764
|
+
return TacticalLines.BEARING_RDF;
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
case 240101: {
|
|
2768
|
+
return TacticalLines.ACA;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
case 240102: {
|
|
2772
|
+
return TacticalLines.ACA_RECTANGULAR;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
case 240103: {
|
|
2776
|
+
return TacticalLines.ACA_CIRCULAR;
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
case 240201: {
|
|
2781
|
+
return TacticalLines.FFA;
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
case 240202: {
|
|
2785
|
+
return TacticalLines.FFA_RECTANGULAR;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
case 240203: {
|
|
2789
|
+
return TacticalLines.FFA_CIRCULAR;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
|
|
2793
|
+
case 240301: {
|
|
2794
|
+
return TacticalLines.NFA;
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
case 240302: {
|
|
2798
|
+
return TacticalLines.NFA_RECTANGULAR;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
case 240303: {
|
|
2802
|
+
return TacticalLines.NFA_CIRCULAR;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
|
|
2806
|
+
case 240401: {
|
|
2807
|
+
return TacticalLines.RFA;
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
case 240402: {
|
|
2811
|
+
return TacticalLines.RFA_RECTANGULAR;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
case 240403: {
|
|
2815
|
+
return TacticalLines.RFA_CIRCULAR;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
case 240503: {
|
|
2819
|
+
return TacticalLines.PAA;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
case 240501: {
|
|
2823
|
+
return TacticalLines.PAA_RECTANGULAR;
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
case 240502: {
|
|
2827
|
+
return TacticalLines.PAA_CIRCULAR;
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
case 260100: {
|
|
2831
|
+
return TacticalLines.FSCL;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
case 300100: {
|
|
2835
|
+
return TacticalLines.ICL;
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
case 190100: {
|
|
2839
|
+
return TacticalLines.IFF_OFF;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
case 190200: {
|
|
2843
|
+
return TacticalLines.IFF_ON;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
case 260200: {
|
|
2847
|
+
return TacticalLines.CFL;
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
case 260300: {
|
|
2851
|
+
return TacticalLines.NFL;
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
case 260500: {
|
|
2855
|
+
return TacticalLines.RFL;
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
case 260600: {
|
|
2859
|
+
return TacticalLines.MFP;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
case 240701: {
|
|
2863
|
+
return TacticalLines.LINTGT;
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
case 240702: {
|
|
2867
|
+
return TacticalLines.LINTGTS;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
case 240703: {
|
|
2871
|
+
return TacticalLines.FPF;
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
case 240801: {
|
|
2875
|
+
return TacticalLines.AT;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
case 240802: {
|
|
2879
|
+
return TacticalLines.RECTANGULAR;
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
case 240803: {
|
|
2883
|
+
return TacticalLines.CIRCULAR;
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
case 240805: {
|
|
2887
|
+
return TacticalLines.SERIES;
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2890
|
+
case 240806: {
|
|
2891
|
+
return TacticalLines.SMOKE;
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
case 240808: {
|
|
2895
|
+
return TacticalLines.BOMB;
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
case 241001: {
|
|
2899
|
+
return TacticalLines.FSA;
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
case 241002: {
|
|
2903
|
+
return TacticalLines.FSA_RECTANGULAR;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
case 200402: {
|
|
2907
|
+
return TacticalLines.SHIP_AOI_RECTANGULAR;
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
case 200600: {
|
|
2911
|
+
return TacticalLines.CUED_ACQUISITION;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
case 200700: {
|
|
2915
|
+
return TacticalLines.RADAR_SEARCH;
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
case 241003: {
|
|
2919
|
+
return TacticalLines.FSA_CIRCULAR;
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
case 200300: {
|
|
2923
|
+
return TacticalLines.NOTACK;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
case 241101: {
|
|
2927
|
+
return TacticalLines.ATI;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
case 241102: {
|
|
2931
|
+
return TacticalLines.ATI_RECTANGULAR;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
case 241103: {
|
|
2935
|
+
return TacticalLines.ATI_CIRCULAR;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
case 241201: {
|
|
2939
|
+
return TacticalLines.CFFZ;
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
case 241202: {
|
|
2943
|
+
return TacticalLines.CFFZ_RECTANGULAR;
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
case 241203: {
|
|
2947
|
+
return TacticalLines.CFFZ_CIRCULAR;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
case 241301: {
|
|
2951
|
+
return TacticalLines.CENSOR;
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
case 241302: {
|
|
2955
|
+
return TacticalLines.CENSOR_RECTANGULAR;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
case 241303: {
|
|
2959
|
+
return TacticalLines.CENSOR_CIRCULAR;
|
|
2960
|
+
}
|
|
2961
|
+
|
|
2962
|
+
case 241401: {
|
|
2963
|
+
return TacticalLines.CFZ;
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
case 241402: {
|
|
2967
|
+
return TacticalLines.CFZ_RECTANGULAR;
|
|
2968
|
+
}
|
|
2969
|
+
|
|
2970
|
+
case 241403: {
|
|
2971
|
+
return TacticalLines.CFZ_CIRCULAR;
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
case 241501: {
|
|
2975
|
+
return TacticalLines.DA;
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
case 241502: {
|
|
2979
|
+
return TacticalLines.DA_RECTANGULAR;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
case 241503: {
|
|
2983
|
+
return TacticalLines.DA_CIRCULAR;
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
case 241701: {
|
|
2987
|
+
return TacticalLines.TBA;
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
case 241702: {
|
|
2991
|
+
return TacticalLines.TBA_RECTANGULAR;
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
case 241703: {
|
|
2995
|
+
return TacticalLines.TBA_CIRCULAR;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
case 241801: {
|
|
2999
|
+
return TacticalLines.TVAR;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
case 241802: {
|
|
3003
|
+
return TacticalLines.TVAR_RECTANGULAR;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
case 241803: {
|
|
3007
|
+
return TacticalLines.TVAR_CIRCULAR;
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
case 241901: {
|
|
3011
|
+
return TacticalLines.ZOR;
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
case 241902: {
|
|
3015
|
+
return TacticalLines.ZOR_RECTANGULAR;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
case 241903: {
|
|
3019
|
+
return TacticalLines.ZOR_CIRCULAR;
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
case 242000: {
|
|
3023
|
+
return TacticalLines.TGMF;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
case 242100: {
|
|
3027
|
+
return TacticalLines.RANGE_FAN;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
case 242200: {
|
|
3031
|
+
return TacticalLines.RANGE_FAN_SECTOR;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
case 242301: {
|
|
3035
|
+
return TacticalLines.KILLBOXBLUE;
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
case 242302: {
|
|
3039
|
+
return TacticalLines.KILLBOXBLUE_RECTANGULAR;
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
case 242303: {
|
|
3043
|
+
return TacticalLines.KILLBOXBLUE_CIRCULAR;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
case 242304: {
|
|
3047
|
+
return TacticalLines.KILLBOXPURPLE;
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
case 242305: {
|
|
3051
|
+
return TacticalLines.KILLBOXPURPLE_RECTANGULAR;
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3054
|
+
case 242306: {
|
|
3055
|
+
return TacticalLines.KILLBOXPURPLE_CIRCULAR;
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
case 270100:
|
|
3059
|
+
case 270200: {
|
|
3060
|
+
return TacticalLines.ZONE;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
case 270300: {
|
|
3064
|
+
return TacticalLines.OBSFAREA;
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
case 270400: {
|
|
3068
|
+
return TacticalLines.OBSAREA;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
case 270501: {
|
|
3072
|
+
return TacticalLines.MNFLDBLK;
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3075
|
+
case 270502: {
|
|
3076
|
+
return TacticalLines.MNFLDDIS;
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
case 270503: {
|
|
3080
|
+
return TacticalLines.MNFLDFIX;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
case 270504: {
|
|
3084
|
+
return TacticalLines.TURN;
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
case 270601: {
|
|
3088
|
+
return TacticalLines.EASY;
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
case 270602: {
|
|
3092
|
+
return TacticalLines.BYDIF;
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
case 270603: {
|
|
3096
|
+
return TacticalLines.BYIMP;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
case 271100: {
|
|
3100
|
+
return TacticalLines.GAP;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
case 271201: {
|
|
3104
|
+
return TacticalLines.PLANNED;
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
case 271202: {
|
|
3108
|
+
return TacticalLines.ESR1;
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
case 271203: {
|
|
3112
|
+
return TacticalLines.ESR2;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
case 271204: {
|
|
3116
|
+
return TacticalLines.ROADBLK;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
case 280100: {
|
|
3120
|
+
return TacticalLines.ABATIS;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
case 290100: {
|
|
3124
|
+
return TacticalLines.LINE;
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
case 290201: {
|
|
3128
|
+
return TacticalLines.ATDITCH;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
case 290202: {
|
|
3132
|
+
return TacticalLines.ATDITCHC;
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
case 290203: {
|
|
3136
|
+
return TacticalLines.ATDITCHM;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
case 290204: {
|
|
3140
|
+
return TacticalLines.ATWALL;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
case 290301: {
|
|
3144
|
+
return TacticalLines.UNSP;
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
case 290302: {
|
|
3148
|
+
return TacticalLines.SFENCE;
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3151
|
+
case 290303: {
|
|
3152
|
+
return TacticalLines.DFENCE;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
case 290304: {
|
|
3156
|
+
return TacticalLines.DOUBLEA;
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
case 290305: {
|
|
3160
|
+
return TacticalLines.LWFENCE;
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
case 290306: {
|
|
3164
|
+
return TacticalLines.HWFENCE;
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
case 290307: {
|
|
3168
|
+
return TacticalLines.SINGLEC;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
case 290308: {
|
|
3172
|
+
return TacticalLines.DOUBLEC;
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
case 290309: {
|
|
3176
|
+
return TacticalLines.TRIPLE;
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
case 290600: {
|
|
3180
|
+
return TacticalLines.MFLANE;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
case 270707: {
|
|
3184
|
+
return TacticalLines.DEPICT;
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
case 270800: {
|
|
3188
|
+
return TacticalLines.MINED;
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
case 270801: {
|
|
3192
|
+
return TacticalLines.FENCED;
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
case 290101: {
|
|
3196
|
+
return TacticalLines.MINE_LINE;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
case 271000: {
|
|
3200
|
+
return TacticalLines.UXO;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
case 271700: {
|
|
3204
|
+
return TacticalLines.BIO;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
case 271800: {
|
|
3208
|
+
return TacticalLines.CHEM;
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
case 271900: {
|
|
3212
|
+
return TacticalLines.NUC;
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
case 272000: {
|
|
3216
|
+
return TacticalLines.RAD;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
case 290400: {
|
|
3220
|
+
return TacticalLines.CLUSTER;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
case 290500: {
|
|
3224
|
+
return TacticalLines.TRIP;
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3227
|
+
case 282003: {
|
|
3228
|
+
return TacticalLines.OVERHEAD_WIRE;
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
case 271300: {
|
|
3232
|
+
return TacticalLines.ASLTXING;
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
case 271500: {
|
|
3236
|
+
return TacticalLines.FORDSITE;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
case 271600: {
|
|
3240
|
+
return TacticalLines.FORDIF;
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
case 290700: {
|
|
3244
|
+
return TacticalLines.FERRY;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
case 290800: {
|
|
3248
|
+
return TacticalLines.RAFT;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
case 290900: {
|
|
3252
|
+
return TacticalLines.FORTL;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
case 291000: {
|
|
3256
|
+
return TacticalLines.FOXHOLE;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
case 272100: {
|
|
3260
|
+
return TacticalLines.MSDZ;
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
case 272200: {
|
|
3264
|
+
return TacticalLines.DRCL;
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3267
|
+
|
|
3268
|
+
case 310200: {
|
|
3269
|
+
return TacticalLines.EPW;
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3272
|
+
case 310300: {
|
|
3273
|
+
return TacticalLines.FARP;
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
case 310400: {
|
|
3277
|
+
return TacticalLines.RHA;
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
case 310500: {
|
|
3281
|
+
return TacticalLines.RSA;
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
case 310600: {
|
|
3285
|
+
return TacticalLines.BSA;
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
case 310700: {
|
|
3289
|
+
return TacticalLines.DSA;
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
case 330100: {
|
|
3293
|
+
return TacticalLines.CONVOY;
|
|
3294
|
+
}
|
|
3295
|
+
|
|
3296
|
+
case 330200: {
|
|
3297
|
+
return TacticalLines.HCONVOY;
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
case 330300: {
|
|
3301
|
+
return TacticalLines.MSR;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
case 330301: {
|
|
3305
|
+
return TacticalLines.MSR_ONEWAY;
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
case 330401: {
|
|
3309
|
+
return TacticalLines.ASR_ONEWAY;
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
case 330302: {
|
|
3313
|
+
return TacticalLines.MSR_TWOWAY;
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3316
|
+
case 330402: {
|
|
3317
|
+
return TacticalLines.ASR_TWOWAY;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
case 330303: {
|
|
3321
|
+
return TacticalLines.MSR_ALT;
|
|
3322
|
+
}
|
|
3323
|
+
|
|
3324
|
+
case 330403: {
|
|
3325
|
+
return TacticalLines.ASR_ALT;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
|
|
3329
|
+
case 330400: {
|
|
3330
|
+
return TacticalLines.ASR;
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
|
|
3334
|
+
case 340100: {
|
|
3335
|
+
return TacticalLines.BLOCK;
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
case 340200: {
|
|
3339
|
+
return TacticalLines.BREACH;
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
case 340300: {
|
|
3343
|
+
return TacticalLines.BYPASS;
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
case 340400: {
|
|
3347
|
+
return TacticalLines.CANALIZE;
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
case 340500: {
|
|
3351
|
+
return TacticalLines.CLEAR;
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
case 340600: {
|
|
3355
|
+
return TacticalLines.CATK;
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
case 340700: {
|
|
3359
|
+
return TacticalLines.CATKBYFIRE;
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
|
|
3363
|
+
case 340800: {
|
|
3364
|
+
return TacticalLines.DELAY;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
case 341000: {
|
|
3368
|
+
return TacticalLines.DISRUPT;
|
|
3369
|
+
}
|
|
3370
|
+
|
|
3371
|
+
case 341100: {
|
|
3372
|
+
return TacticalLines.FIX;
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
case 341200: {
|
|
3376
|
+
return TacticalLines.FOLLA;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
case 341300: {
|
|
3380
|
+
return TacticalLines.FOLSP;
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
case 341500: {
|
|
3384
|
+
return TacticalLines.ISOLATE;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
case 341700: {
|
|
3388
|
+
return TacticalLines.OCCUPY;
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3391
|
+
case 341800: {
|
|
3392
|
+
return TacticalLines.PENETRATE;
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
case 341900: {
|
|
3396
|
+
return TacticalLines.RIP;
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
case 342000: {
|
|
3400
|
+
return TacticalLines.RETIRE;
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3403
|
+
case 342100: {
|
|
3404
|
+
return TacticalLines.SECURE;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
case 342201: {
|
|
3408
|
+
return TacticalLines.COVER;
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
case 342202: {
|
|
3412
|
+
return TacticalLines.GUARD;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
case 342203: {
|
|
3416
|
+
return TacticalLines.SCREEN;
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
case 342300: {
|
|
3420
|
+
return TacticalLines.SEIZE;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
case 342400: {
|
|
3424
|
+
return TacticalLines.WITHDRAW;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
case 342500: {
|
|
3428
|
+
return TacticalLines.WDRAWUP;
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
case 342600: {
|
|
3432
|
+
return TacticalLines.CORDONKNOCK;
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
case 342700: {
|
|
3436
|
+
return TacticalLines.CORDONSEARCH;
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
case 272101: {
|
|
3440
|
+
return TacticalLines.STRIKWARN;
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
default: {
|
|
3444
|
+
break;
|
|
3445
|
+
}
|
|
3446
|
+
|
|
3447
|
+
}
|
|
3448
|
+
return -1;
|
|
3449
|
+
}
|
|
3450
|
+
|
|
3451
|
+
/**
|
|
3452
|
+
* Some symbol's points are reversed when moving from 2525C to 2525D. This method should be called at the start of each render.
|
|
3453
|
+
*
|
|
3454
|
+
* It's a simpler fix to reverse the points order at start than to reverse order when rendering.
|
|
3455
|
+
*
|
|
3456
|
+
* Note: Make sure to only call once to not reverse reversed points
|
|
3457
|
+
* @param tg
|
|
3458
|
+
*/
|
|
3459
|
+
private static reversePointsRevD(tg: TGLight): void {
|
|
3460
|
+
try {
|
|
3461
|
+
if (tg.get_SymbolId().length < 20 || SymbolID.getSymbolSet(tg.get_SymbolId()) !== 25) {
|
|
3462
|
+
return;
|
|
3463
|
+
}
|
|
3464
|
+
switch (tg.get_LineType()) {
|
|
3465
|
+
case TacticalLines.UNSP:
|
|
3466
|
+
case TacticalLines.LWFENCE:
|
|
3467
|
+
case TacticalLines.HWFENCE:
|
|
3468
|
+
case TacticalLines.SINGLEC:
|
|
3469
|
+
case TacticalLines.DOUBLEC:
|
|
3470
|
+
case TacticalLines.TRIPLE:
|
|
3471
|
+
case TacticalLines.LINE: {
|
|
3472
|
+
if (tg.Pixels != null) {
|
|
3473
|
+
tg.Pixels.reverse();
|
|
3474
|
+
}
|
|
3475
|
+
if (tg.LatLongs != null) {
|
|
3476
|
+
tg.LatLongs.reverse();
|
|
3477
|
+
}
|
|
3478
|
+
break;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
case TacticalLines.CLUSTER: {
|
|
3482
|
+
if (SymbolID.getVersion(tg.get_SymbolId()) < SymbolID.Version_2525E) {
|
|
3483
|
+
if (tg.Pixels != null) {
|
|
3484
|
+
tg.Pixels.reverse();
|
|
3485
|
+
}
|
|
3486
|
+
if (tg.LatLongs != null) {
|
|
3487
|
+
tg.LatLongs.reverse();
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
break;
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
default: {
|
|
3494
|
+
break;
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
}
|
|
3498
|
+
} catch (exc) {
|
|
3499
|
+
if (exc instanceof Error) {
|
|
3500
|
+
ErrorLogger.LogException("clsRenderer", "reversePointsRevD",
|
|
3501
|
+
new RendererException("Failed inside reversePointsRevD", exc));
|
|
3502
|
+
} else {
|
|
3503
|
+
throw exc;
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
}
|