@armyc2.c5isr.renderer/mil-sym-ts-web 2.2.0 → 2.2.1
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/{dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz → armyc2.c5isr.renderer-mil-sym-ts-web-2.2.1.tgz} +0 -0
- package/package.json +15 -39
- package/buildNode.bat +0 -2
- package/buildWeb.bat +0 -2
- package/dist/LICENSE +0 -201
- package/dist/README.md +0 -57
- package/dist/package.json +0 -16
- package/index.ts +0 -169
- package/package.bak +0 -50
- package/package.node.json +0 -43
- package/package.pack.json +0 -19
- package/package.packWeb.json +0 -16
- package/package.web.json +0 -40
- package/src/main/ts/android/graphics/Bitmap.ts +0 -7
- package/src/main/ts/android/graphics/Paint.ts +0 -26
- package/src/main/ts/android/graphics/Path.ts +0 -78
- package/src/main/ts/android/graphics/PointF.ts +0 -14
- package/src/main/ts/android/graphics/Rect.ts +0 -18
- package/src/main/ts/android/graphics/RectF.ts +0 -50
- package/src/main/ts/android/graphics/Region.ts +0 -36
- package/src/main/ts/android/graphics/Typeface.ts +0 -11
- package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +0 -99
- package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +0 -34
- package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +0 -193
- package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +0 -2971
- package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +0 -4008
- package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +0 -93
- package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +0 -89
- package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +0 -515
- package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +0 -5403
- package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +0 -1084
- package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +0 -2173
- package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +0 -4934
- package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +0 -7
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +0 -5601
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +0 -14
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +0 -648
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +0 -647
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +0 -2994
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +0 -2663
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +0 -669
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +0 -971
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +0 -871
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +0 -3507
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +0 -500
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +0 -1089
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +0 -2656
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +0 -1419
- package/src/main/ts/armyc2/c5isr/data/genc.json +0 -1407
- package/src/main/ts/armyc2/c5isr/data/msd.json +0 -17311
- package/src/main/ts/armyc2/c5isr/data/mse.json +0 -18500
- package/src/main/ts/armyc2/c5isr/data/svgd.json +0 -31214
- package/src/main/ts/armyc2/c5isr/data/svge.json +0 -30558
- package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +0 -10
- package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +0 -437
- package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +0 -429
- package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +0 -7
- package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +0 -35
- package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +0 -111
- package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +0 -29
- package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +0 -18
- package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +0 -211
- package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +0 -80
- package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +0 -33
- package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +0 -16
- package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +0 -726
- package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +0 -141
- package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +0 -112
- package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +0 -261
- package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +0 -391
- package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +0 -567
- package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +0 -445
- package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +0 -31
- package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +0 -18
- package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +0 -45
- package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +0 -25
- package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +0 -15
- package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +0 -22
- package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +0 -269
- package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +0 -9882
- package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +0 -146
- package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +0 -1265
- package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +0 -64
- package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +0 -95
- package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +0 -93
- package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +0 -114
- package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +0 -555
- package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +0 -62
- package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +0 -120
- package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +0 -431
- package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +0 -99
- package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +0 -25
- package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +0 -203
- package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +0 -104
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +0 -481
- package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +0 -40
- package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +0 -1323
- package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +0 -51
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +0 -736
- package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +0 -106
- package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +0 -84
- package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +0 -87
- package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +0 -34
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +0 -324
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +0 -127
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +0 -18
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +0 -111
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +0 -219
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +0 -1008
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +0 -882
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +0 -380
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +0 -797
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +0 -1699
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +0 -178
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +0 -45
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +0 -126
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +0 -118
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +0 -11
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +0 -1201
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +0 -591
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +0 -29
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +0 -753
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +0 -137
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +0 -438
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +0 -19
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +0 -10
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +0 -5
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +0 -404
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +0 -525
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +0 -55
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +0 -36
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +0 -1055
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +0 -2085
- package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +0 -157
- package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +0 -86
- package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +0 -3798
- package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +0 -412
- package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +0 -124
- package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +0 -26
- package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +0 -677
- package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +0 -484
- package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +0 -62
- package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +0 -46
- package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +0 -51
- package/src/main/ts/org/gavaghan/geodesy/Angle.ts +0 -31
- package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +0 -71
- package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +0 -200
- package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +0 -55
- package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +0 -68
- package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +0 -103
- package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +0 -90
- package/test/ExportSPImages.js +0 -692
- package/test/MPWW.html +0 -556
- package/test/MPWorker.js +0 -318
- package/test/SPWorker.js +0 -233
- package/test/SVGWW.html +0 -363
- package/test/singlePointTester3.html +0 -751
- package/tsconfig.json +0 -54
- package/typedoc.json +0 -30
- package/updateVersion.js +0 -21
- package/webpack.config.js +0 -34
- package/webpackn.config.js +0 -28
- package/webpackr.config.js +0 -47
- package/webpackw.config.js +0 -23
- /package/{dist/C5Ren.d.ts → C5Ren.d.ts} +0 -0
- /package/{dist/C5Ren.js → C5Ren.js} +0 -0
- /package/{dist/C5Ren.js.map → C5Ren.js.map} +0 -0
- /package/{dist/manifest.json → manifest.json} +0 -0
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
import { Point2D } from "../../graphics2d/Point2D";
|
|
2
|
-
import { Rectangle } from "../../renderer/shapes/rectangle";
|
|
3
|
-
import { ErrorLogger } from "../../renderer/utilities/ErrorLogger";
|
|
4
|
-
import { IPointConversion } from "../../renderer/utilities/IPointConversion";
|
|
5
|
-
import { RendererSettings } from "../../renderer/utilities/RendererSettings";
|
|
6
|
-
import { RendererUtilities } from "../../renderer/utilities/RendererUtilities";
|
|
7
|
-
import { ShapeInfo } from "../../renderer/utilities/ShapeInfo";
|
|
8
|
-
import { MultiPointHandler } from "./MultiPointHandler";
|
|
9
|
-
import { Path } from "../../renderer/shapes/path";
|
|
10
|
-
import { SVGTextInfo } from "../../renderer/utilities/SVGTextInfo";
|
|
11
|
-
import { Color } from "../../renderer/utilities/Color";
|
|
12
|
-
|
|
13
|
-
export class MultiPointHandlerSVG {
|
|
14
|
-
/**
|
|
15
|
-
* Generates an SVG which can be draped on a map.
|
|
16
|
-
* Better with RenderSymbol2D
|
|
17
|
-
*
|
|
18
|
-
* @param {string} id
|
|
19
|
-
* @param {string} name
|
|
20
|
-
* @param {string} description
|
|
21
|
-
* @param {string} symbolID
|
|
22
|
-
* @param {ShapeInfo[]} shapes
|
|
23
|
-
* @param {ShapeInfo[]} modifiers
|
|
24
|
-
* @param {IPointConversion} ipc
|
|
25
|
-
* @param {boolean} normalize
|
|
26
|
-
* @param {string} textColor
|
|
27
|
-
* @param {string} textBackgroundColor
|
|
28
|
-
* @param {boolean} wasClipped
|
|
29
|
-
* @return {string}
|
|
30
|
-
*/
|
|
31
|
-
public static GeoSVGize(id: string, name: string, description: string, symbolID: string, shapes: ShapeInfo[], modifiers: ShapeInfo[], ipc: IPointConversion, normalize: boolean, textColor: string, textBackgroundColor: string, wasClipped: boolean, bbox?: Rectangle): string {
|
|
32
|
-
|
|
33
|
-
let height = 10;
|
|
34
|
-
|
|
35
|
-
let tempBounds: Rectangle = null;
|
|
36
|
-
let paths: string[] = [];
|
|
37
|
-
let pathBounds: Rectangle = null;
|
|
38
|
-
let labels: SVGTextInfo[] = [];
|
|
39
|
-
let labelBounds: Rectangle = null;
|
|
40
|
-
let unionBounds: Rectangle = null;
|
|
41
|
-
let lineWidth: number = null;
|
|
42
|
-
let fillTexture: string = null
|
|
43
|
-
let geoCoordTL: Point2D = null;
|
|
44
|
-
let geoCoordTR: Point2D = null;
|
|
45
|
-
let geoCoordBL: Point2D = null;
|
|
46
|
-
let geoCoordBR: Point2D = null;
|
|
47
|
-
let west: Point2D = null;
|
|
48
|
-
let north: Point2D = null;
|
|
49
|
-
let south: Point2D = null;
|
|
50
|
-
let east: Point2D = null;
|
|
51
|
-
let len = shapes.length;
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const fontInfo = RendererSettings.getInstance().getMPLabelFont();
|
|
55
|
-
height = fontInfo.getSize();
|
|
56
|
-
|
|
57
|
-
for (let i = 0; i < len; i++) {
|
|
58
|
-
let pathInfo = MultiPointHandlerSVG.ShapesToGeoSVG(symbolID, shapes[i], ipc, normalize);
|
|
59
|
-
if (pathInfo.svg && pathInfo.bounds) {
|
|
60
|
-
tempBounds = pathInfo.bounds;
|
|
61
|
-
lineWidth = shapes[i].getStroke().getLineWidth()
|
|
62
|
-
tempBounds.grow(Math.round(lineWidth / 2));//adjust for line width so nothing gets clipped.
|
|
63
|
-
if (pathBounds == null)
|
|
64
|
-
pathBounds = tempBounds.clone();
|
|
65
|
-
else
|
|
66
|
-
pathBounds.union(tempBounds);
|
|
67
|
-
paths.push(pathInfo.svg);
|
|
68
|
-
|
|
69
|
-
if (pathInfo.fillPattern && !fillTexture)
|
|
70
|
-
fillTexture = pathInfo.fillPattern
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let tempModifier: ShapeInfo, len2 = modifiers.length;
|
|
75
|
-
let tiTemp: SVGTextInfo = null;
|
|
76
|
-
for (let j = 0; j < len2; j++) {
|
|
77
|
-
tempModifier = modifiers[j];
|
|
78
|
-
|
|
79
|
-
if (tempModifier.getModifierString()) {
|
|
80
|
-
let tempLocation: Point2D = tempModifier.getModifierPosition();
|
|
81
|
-
|
|
82
|
-
let justify = tempModifier.getTextJustify();
|
|
83
|
-
let strJustify = "start";
|
|
84
|
-
if (justify === ShapeInfo.justify_left)
|
|
85
|
-
strJustify = "start";
|
|
86
|
-
else if (justify === ShapeInfo.justify_center)
|
|
87
|
-
strJustify = "middle";
|
|
88
|
-
else if (justify === ShapeInfo.justify_right)
|
|
89
|
-
strJustify = "end";
|
|
90
|
-
|
|
91
|
-
let degrees = tempModifier.getModifierAngle();
|
|
92
|
-
tiTemp = new SVGTextInfo(tempModifier.getModifierString(), tempLocation, fontInfo, strJustify, degrees);
|
|
93
|
-
|
|
94
|
-
let bounds2D = tiTemp.getTextBounds();
|
|
95
|
-
let bounds = new Rectangle(bounds2D.x, bounds2D.y, bounds2D.width, bounds2D.height)
|
|
96
|
-
|
|
97
|
-
//make sure labels are in the bbox, otherwise they can
|
|
98
|
-
//make the canvas grow out of control.
|
|
99
|
-
//if (tiTemp && bbox.containsRectangle(bounds))
|
|
100
|
-
//if(bbox !== null)
|
|
101
|
-
if (tiTemp) {
|
|
102
|
-
if ((bbox && bbox.intersects(bounds)) || bbox == null) {
|
|
103
|
-
labels.push(tiTemp);
|
|
104
|
-
if (bounds) {
|
|
105
|
-
if (labelBounds)
|
|
106
|
-
labelBounds.union(bounds);
|
|
107
|
-
else
|
|
108
|
-
labelBounds = bounds;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
} else if (tempModifier.getModifierImageInfo()) {
|
|
113
|
-
let bounds2D = tempModifier.getModifierImageInfo().getImageBounds()
|
|
114
|
-
let bounds = new Rectangle(0, 0, bounds2D.width, bounds2D.height)
|
|
115
|
-
|
|
116
|
-
let tempLocation: Point2D = tempModifier.getModifierPosition();
|
|
117
|
-
tempLocation.setLocation(tempLocation.x - bounds.getWidth() / 2, tempLocation.y - bounds.getHeight() / 2);
|
|
118
|
-
let x = tempLocation.x
|
|
119
|
-
let y = tempLocation.y
|
|
120
|
-
bounds.setLocation(x, y)
|
|
121
|
-
|
|
122
|
-
let angle = tempModifier.getModifierAngle()
|
|
123
|
-
paths.push('<image transform="translate(' + x + ',' + y + ') rotate(' + angle + ')" href="' + tempModifier.getModifierImage() + '" />')
|
|
124
|
-
if (angle !== 0) {
|
|
125
|
-
bounds2D.x = tempLocation.x
|
|
126
|
-
bounds2D.y = tempLocation.y
|
|
127
|
-
bounds2D = SVGTextInfo.getRotatedRectangleBounds(bounds2D, tempLocation, -angle, "middle")
|
|
128
|
-
bounds = new Rectangle(bounds2D.x, bounds2D.y, bounds2D.width, bounds2D.height)
|
|
129
|
-
}
|
|
130
|
-
if (bounds) {
|
|
131
|
-
if ((bbox && bbox.intersects(bounds)) || bbox == null) {
|
|
132
|
-
if (pathBounds)
|
|
133
|
-
pathBounds.union(bounds);
|
|
134
|
-
else
|
|
135
|
-
pathBounds = bounds;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (pathBounds) {
|
|
141
|
-
unionBounds = pathBounds.clone();
|
|
142
|
-
}
|
|
143
|
-
if (labelBounds) {
|
|
144
|
-
if (unionBounds) {
|
|
145
|
-
unionBounds.union(labelBounds);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
unionBounds = labelBounds;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
//get geo bounds for canvas
|
|
153
|
-
if (unionBounds) {
|
|
154
|
-
let coordTL = new Point2D();
|
|
155
|
-
coordTL.setLocation(unionBounds.getX(), unionBounds.getY());
|
|
156
|
-
let coordBR = new Point2D();
|
|
157
|
-
coordBR.setLocation(unionBounds.getX() + unionBounds.getWidth(), unionBounds.getY() + unionBounds.getHeight());
|
|
158
|
-
|
|
159
|
-
let coordTR = new Point2D();
|
|
160
|
-
coordTR.setLocation(unionBounds.getX() + unionBounds.getWidth(), unionBounds.getY());
|
|
161
|
-
let coordBL = new Point2D();
|
|
162
|
-
coordBL.setLocation(unionBounds.getX(), unionBounds.getY() + unionBounds.getHeight());
|
|
163
|
-
|
|
164
|
-
south = new Point2D(unionBounds.getX() + unionBounds.getWidth() / 2, unionBounds.getY() + unionBounds.getHeight());
|
|
165
|
-
north = new Point2D(unionBounds.getX() + unionBounds.getWidth() / 2, unionBounds.getY());
|
|
166
|
-
east = new Point2D(unionBounds.getX() + unionBounds.getWidth(), unionBounds.getY() + unionBounds.getHeight() / 2);
|
|
167
|
-
west = new Point2D(unionBounds.getX(), unionBounds.getY() + unionBounds.getHeight() / 2);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
geoCoordTL = ipc.PixelsToGeo(coordTL);
|
|
171
|
-
geoCoordBR = ipc.PixelsToGeo(coordBR);
|
|
172
|
-
geoCoordTR = ipc.PixelsToGeo(coordTR);
|
|
173
|
-
geoCoordBL = ipc.PixelsToGeo(coordBL);
|
|
174
|
-
|
|
175
|
-
north = ipc.PixelsToGeo(north);
|
|
176
|
-
south = ipc.PixelsToGeo(south);
|
|
177
|
-
east = ipc.PixelsToGeo(east);
|
|
178
|
-
west = ipc.PixelsToGeo(west);
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (normalize) {
|
|
182
|
-
geoCoordTL = MultiPointHandler.NormalizeCoordToGECoord(geoCoordTL);
|
|
183
|
-
geoCoordBR = MultiPointHandler.NormalizeCoordToGECoord(geoCoordBR);
|
|
184
|
-
geoCoordTR = MultiPointHandler.NormalizeCoordToGECoord(geoCoordTR);
|
|
185
|
-
geoCoordBL = MultiPointHandler.NormalizeCoordToGECoord(geoCoordBL);
|
|
186
|
-
|
|
187
|
-
north = MultiPointHandler.NormalizeCoordToGECoord(north);
|
|
188
|
-
south = MultiPointHandler.NormalizeCoordToGECoord(south);
|
|
189
|
-
east = MultiPointHandler.NormalizeCoordToGECoord(east);
|
|
190
|
-
west = MultiPointHandler.NormalizeCoordToGECoord(west);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
else//nothing to draw
|
|
194
|
-
{
|
|
195
|
-
geoCoordTL = new Point2D(0, 0);
|
|
196
|
-
geoCoordBR = new Point2D(0, 0);
|
|
197
|
-
geoCoordTR = new Point2D(0, 0);
|
|
198
|
-
geoCoordBL = new Point2D(0, 0);
|
|
199
|
-
|
|
200
|
-
north = new Point2D(0, 0);
|
|
201
|
-
south = new Point2D(0, 0);
|
|
202
|
-
east = new Point2D(0, 0);
|
|
203
|
-
west = new Point2D(0, 0);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
catch (err) {
|
|
207
|
-
ErrorLogger.LogException("MultiPointHandler", "GeoSVGize", err);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (paths && len > 0 && unionBounds) {
|
|
211
|
-
//create group with offset translation
|
|
212
|
-
//ctx.translate(bounds.getX() * -1, bounds.getY() * -1);
|
|
213
|
-
let group = '<g transform="translate(' + (unionBounds.getX() * -1) + ',' + (unionBounds.getY() * -1) + ')">';
|
|
214
|
-
|
|
215
|
-
//loop through paths and labels and build SVG.
|
|
216
|
-
for (let i = 0; i < paths.length; i++) {
|
|
217
|
-
group += paths[i];
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
let labelStrs = this.renderTextElement(labels, textColor, textBackgroundColor);
|
|
221
|
-
for (let j = 0; j < labelStrs.length; j++) {
|
|
222
|
-
group += labelStrs[j];
|
|
223
|
-
}
|
|
224
|
-
//close
|
|
225
|
-
group += '</g>';
|
|
226
|
-
|
|
227
|
-
//wrap in SVG
|
|
228
|
-
let geoSVG = '<svg width="' + Math.ceil(unionBounds.getWidth()) + 'px" height="' + Math.ceil(unionBounds.getHeight()) + 'px" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" version="1.1">';
|
|
229
|
-
|
|
230
|
-
geoSVG += ("<metadata>\n");
|
|
231
|
-
geoSVG += ("<id>") + id + ("</id>\n");
|
|
232
|
-
geoSVG += ("<name>") + name + ("</name>\n");
|
|
233
|
-
geoSVG += ("<description>") + description + ("</description>\n");
|
|
234
|
-
geoSVG += ("<symbolID>") + symbolID + ("</symbolID>\n");
|
|
235
|
-
geoSVG += ("<geoTL>") + geoCoordTL.getX() + " " + geoCoordTL.getY() + ("</geoTL>\n")
|
|
236
|
-
geoSVG += ("<geoBR>") + geoCoordBR.getX() + " " + geoCoordBR.getY() + ("</geoBR>\n")
|
|
237
|
-
geoSVG += ("<geoTR>") + geoCoordTR.getX() + " " + geoCoordTR.getY() + ("</geoTR>\n")
|
|
238
|
-
geoSVG += ("<geoBL>") + geoCoordBL.getX() + " " + geoCoordBL.getY() + ("</geoBL>\n")
|
|
239
|
-
geoSVG += ("<north>") + north.getY() + ("</north>\n")
|
|
240
|
-
geoSVG += ("<south>") + south.getY() + ("</south>\n")
|
|
241
|
-
geoSVG += ("<east>") + east.getX() + ("</east>\n")
|
|
242
|
-
geoSVG += ("<west>") + west.getX() + ("</west>\n")
|
|
243
|
-
geoSVG += ("<wasClipped>") + wasClipped + ("</wasClipped>\n")
|
|
244
|
-
geoSVG += ("<width>") + unionBounds.getWidth() + ("</width>\n");
|
|
245
|
-
geoSVG += ("<height>") + unionBounds.getHeight() + ("</height>\n");
|
|
246
|
-
geoSVG += ("</metadata>\n");
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
/*//Scale the image, commented out as I decided to alter scale in getReasonableScale rather than adjust after the fact.
|
|
250
|
-
let tempWidth = Math.ceil(unionBounds.getWidth());
|
|
251
|
-
let tempHeight = Math.ceil(unionBounds.getHeight());
|
|
252
|
-
let quality = 1.0;
|
|
253
|
-
let bigger = Math.max(tempWidth, tempHeight);
|
|
254
|
-
let max = 1000;
|
|
255
|
-
if(!converter)
|
|
256
|
-
{
|
|
257
|
-
if(bigger < max)
|
|
258
|
-
{
|
|
259
|
-
if(bigger * 2 < max)
|
|
260
|
-
{
|
|
261
|
-
quality = 2;
|
|
262
|
-
}
|
|
263
|
-
else
|
|
264
|
-
{
|
|
265
|
-
quality = max / bigger;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
else
|
|
269
|
-
{
|
|
270
|
-
quality = 1;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
let geoSVG = '<svg viewBox="0 0 ' + tempWidth + ' ' + tempHeight + '"' + ' width="' + (tempWidth * quality) + 'px" height="' + (tempHeight * quality) + 'px" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" version="1.1">';//*/
|
|
274
|
-
if (fillTexture)
|
|
275
|
-
geoSVG += fillTexture;
|
|
276
|
-
geoSVG += group;
|
|
277
|
-
geoSVG += '</svg>';//*/
|
|
278
|
-
|
|
279
|
-
return geoSVG;
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
//return blank 2x2 SVG
|
|
284
|
-
return '<svg width="2px" height="2px" xmlns="http://www.w3.org/2000/svg" version="1.1"></svg>'
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @param {SVGTextInfo[]} tiArray
|
|
290
|
-
* @param {string} color a hex string "#000000"
|
|
291
|
-
* @param {string} outlineColor a hex string "#000000"
|
|
292
|
-
*/
|
|
293
|
-
static renderTextElement(tiArray: SVGTextInfo[], color: string, outlineColor: string): string[] {
|
|
294
|
-
//ctx.lineCap = "butt";
|
|
295
|
-
//ctx.lineJoin = "miter";
|
|
296
|
-
//ctx.miterLimit = 3;
|
|
297
|
-
/*ctx.lineCap = "round";
|
|
298
|
-
ctx.lineJoin = "round";
|
|
299
|
-
ctx.miterLimit = 3;*/
|
|
300
|
-
let svgElements: string[] = []
|
|
301
|
-
|
|
302
|
-
let size = tiArray.length,
|
|
303
|
-
tempShape: SVGTextInfo = null,
|
|
304
|
-
textColor = "#000000",
|
|
305
|
-
tbm = RendererSettings.getInstance().getTextBackgroundMethod(),
|
|
306
|
-
outlineWidth = RendererSettings.getInstance().getTextOutlineWidth();
|
|
307
|
-
|
|
308
|
-
if (color) {
|
|
309
|
-
textColor = color;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (!outlineColor) {
|
|
314
|
-
outlineColor = RendererUtilities.getIdealOutlineColor(new Color(textColor)).toHexString(false);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
if (tbm === RendererSettings.TextBackgroundMethod_OUTLINE) {
|
|
319
|
-
for (let i = 0; i < size; i++) {
|
|
320
|
-
tempShape = tiArray[i];
|
|
321
|
-
svgElements.push(tempShape.toSVGElement(textColor, outlineColor, outlineWidth));
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
else if (tbm === RendererSettings.TextBackgroundMethod_OUTLINE_QUICK) {
|
|
325
|
-
//TODO: need to update, this is regular outline approach
|
|
326
|
-
for (let i = 0; i < size; i++) {
|
|
327
|
-
tempShape = tiArray[i];
|
|
328
|
-
svgElements.push(tempShape.toSVGElement(textColor, outlineColor, outlineWidth));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
else if (tbm === RendererSettings.TextBackgroundMethod_COLORFILL) {
|
|
332
|
-
for (let i = 0; i < size; i++) {
|
|
333
|
-
tempShape = tiArray[i];
|
|
334
|
-
svgElements.push(tempShape.getTextOutlineBounds().toSVGElement(null, null, outlineColor));
|
|
335
|
-
svgElements.push(tempShape.toSVGElement(textColor, null));
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
else //if(tbm === RendererSettings.TextBackgroundMethod_NONE)
|
|
339
|
-
{
|
|
340
|
-
for (let j = 0; j < size; j++) {
|
|
341
|
-
tempShape = tiArray[j];
|
|
342
|
-
svgElements.push(tempShape.toSVGElement(textColor, null));
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return svgElements;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* @param {string} symbolID
|
|
351
|
-
* @param {ShapeInfo} shapeInfo
|
|
352
|
-
* @param {IPointConversion} ipc
|
|
353
|
-
* @param {boolean} normalize
|
|
354
|
-
* @returns {object} { svg: string, bounds: Rectangle, fillPattern: string }
|
|
355
|
-
*/
|
|
356
|
-
static ShapesToGeoSVG(symbolID: string, shapeInfo: ShapeInfo, ipc: IPointConversion, normalize: boolean): { svg: string, bounds: Rectangle, fillPattern: string } {
|
|
357
|
-
let path: Path = null;
|
|
358
|
-
let fillColor: string = null;
|
|
359
|
-
let lineColor: string = null;
|
|
360
|
-
let lineWidth: number = null;
|
|
361
|
-
let lineAlpha = 1.0;
|
|
362
|
-
let fillAlpha = 1.0;
|
|
363
|
-
let dashArray: number[] = null;
|
|
364
|
-
let fillPattern: string = null;
|
|
365
|
-
|
|
366
|
-
if (shapeInfo.getLineColor()) {
|
|
367
|
-
let lineColorTemp = shapeInfo.getLineColor();
|
|
368
|
-
lineAlpha = lineColorTemp.getAlpha() / 255;
|
|
369
|
-
lineColor = lineColorTemp.toHexString(false);
|
|
370
|
-
}
|
|
371
|
-
if (shapeInfo.getFillColor()) {
|
|
372
|
-
let fillColorTemp = shapeInfo.getFillColor();
|
|
373
|
-
fillAlpha = fillColorTemp.getAlpha() / 255;
|
|
374
|
-
fillColor = fillColorTemp.toHexString(false);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
if (shapeInfo.getPatternFillImageInfo()) {
|
|
378
|
-
let bounds = shapeInfo.getPatternFillImageInfo().getImageBounds();
|
|
379
|
-
fillPattern = '<defs><pattern id="fillPattern" patternUnits="userSpaceOnUse" width="' + bounds.width + '" height="' + bounds.height + '"><image href="' + shapeInfo.getPatternFillImage() + '" /></pattern></defs>'
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
let stroke = shapeInfo.getStroke();
|
|
383
|
-
if (stroke !== null) {
|
|
384
|
-
lineWidth = Math.round(stroke.getLineWidth());
|
|
385
|
-
dashArray = stroke.getDashArray();
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
let shapesArray = shapeInfo.getPolylines();
|
|
389
|
-
path = new Path();
|
|
390
|
-
if (dashArray)
|
|
391
|
-
path.setLineDash(dashArray.toString());
|
|
392
|
-
for (let i = 0; i < shapesArray.length; i++) {
|
|
393
|
-
let shape = shapesArray[i];
|
|
394
|
-
|
|
395
|
-
for (let j = 0; j < shape.length; j++) {
|
|
396
|
-
let coord = shape[j];
|
|
397
|
-
if (j === 0) {
|
|
398
|
-
path.moveTo(coord.x, coord.y);
|
|
399
|
-
} else if (dashArray) {
|
|
400
|
-
path.dashedLineTo(coord.x, coord.y, dashArray);
|
|
401
|
-
} else {
|
|
402
|
-
path.lineTo(coord.x, coord.y);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (fillPattern)
|
|
407
|
-
fillColor = "url(#fillPattern)";
|
|
408
|
-
let svgElement = path.toSVGElement(lineColor, lineWidth, fillColor, lineAlpha, fillAlpha,"round");
|
|
409
|
-
let svgInfo = { svg: svgElement, bounds: path.getBounds(), fillPattern: fillPattern };
|
|
410
|
-
return svgInfo;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { type double } from "../../../c5isr/graphics2d/BasicTypes";
|
|
2
|
-
import { Point } from "../../graphics2d/Point";
|
|
3
|
-
import { Point2D } from "../../graphics2d/Point2D";
|
|
4
|
-
import { IPointConversion } from "../../renderer/utilities/IPointConversion";
|
|
5
|
-
import { GeoPixelConversion } from "./GeoPixelConversion";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export class PointConverter implements IPointConversion {
|
|
13
|
-
private _controlLat: double = 0;
|
|
14
|
-
private _controlLong: double = 0;
|
|
15
|
-
private _scale: double = 0;
|
|
16
|
-
private _metersPerPixel: double = 0;
|
|
17
|
-
private _normalize: boolean = true;
|
|
18
|
-
public set_normalize(value: boolean): void {
|
|
19
|
-
this._normalize = value;
|
|
20
|
-
}
|
|
21
|
-
public constructor(controlLong: double, controlLat: double, scale: double);
|
|
22
|
-
/**
|
|
23
|
-
* add constructor to handle when earth is flipped about it's X axis (South is on top)
|
|
24
|
-
* @param left
|
|
25
|
-
* @param right
|
|
26
|
-
* @param top
|
|
27
|
-
* @param bottom
|
|
28
|
-
* @param scale
|
|
29
|
-
*/
|
|
30
|
-
public constructor(left: double, top: double, right: double, bottom: double, scale: double);
|
|
31
|
-
public constructor(...args: unknown[]) {
|
|
32
|
-
switch (args.length) {
|
|
33
|
-
case 3: {
|
|
34
|
-
const [controlLong, controlLat, scale] = args as [double, double, double];
|
|
35
|
-
try {
|
|
36
|
-
this._controlLat = controlLat;
|
|
37
|
-
this._controlLong = controlLong;
|
|
38
|
-
this._scale = scale;
|
|
39
|
-
this._metersPerPixel = GeoPixelConversion.metersPerPixel(scale);
|
|
40
|
-
} catch (e) {
|
|
41
|
-
if (e instanceof Error) {
|
|
42
|
-
throw e;
|
|
43
|
-
} else {
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
case 5: {
|
|
52
|
-
const [left, top, right, bottom, scale] = args as [double, double, double, double, double];
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
this._controlLat = top;
|
|
56
|
-
this._controlLong = left;
|
|
57
|
-
this._scale = scale;
|
|
58
|
-
this._metersPerPixel = GeoPixelConversion.metersPerPixel(scale);
|
|
59
|
-
if (top < bottom) {
|
|
60
|
-
|
|
61
|
-
this._metersPerPixel = -this._metersPerPixel;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
} catch (e) {
|
|
65
|
-
if (e instanceof Error) {
|
|
66
|
-
throw e;
|
|
67
|
-
} else {
|
|
68
|
-
throw e;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
default: {
|
|
76
|
-
throw Error(`Invalid number of arguments`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public PixelsToGeo(pixel: Point): Point;
|
|
82
|
-
public PixelsToGeo(pixel: Point2D): Point2D;
|
|
83
|
-
public PixelsToGeo(...args: unknown[]): Point | Point2D {
|
|
84
|
-
const [pixel] = args as [Point | Point2D];
|
|
85
|
-
try {
|
|
86
|
-
let y: double = GeoPixelConversion.y2lat(pixel.getY(), this._scale, this._controlLat, this._metersPerPixel);
|
|
87
|
-
let x: double = GeoPixelConversion.x2long(pixel.getX(), this._scale, this._controlLong, y, this._metersPerPixel);
|
|
88
|
-
if (pixel instanceof Point)
|
|
89
|
-
return new Point(x, y)
|
|
90
|
-
else
|
|
91
|
-
return new Point2D(x, y)
|
|
92
|
-
} catch (e) {
|
|
93
|
-
if (e instanceof Error) {
|
|
94
|
-
throw e;
|
|
95
|
-
} else {
|
|
96
|
-
throw e;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
public GeoToPixels(coord: Point): Point;
|
|
103
|
-
|
|
104
|
-
public GeoToPixels(coord: Point2D): Point2D;
|
|
105
|
-
public GeoToPixels(...args: unknown[]): Point | Point2D {
|
|
106
|
-
const [coord] = args as [Point | Point2D];
|
|
107
|
-
|
|
108
|
-
try {
|
|
109
|
-
let y: double = GeoPixelConversion.lat2y(coord.getY(), this._scale, this._controlLat, this._metersPerPixel);
|
|
110
|
-
let x: double = GeoPixelConversion.long2x(coord.getX(), this._scale, this._controlLong, coord.getY(), this._metersPerPixel, this._normalize);
|
|
111
|
-
if (coord instanceof Point)
|
|
112
|
-
return new Point(x, y)
|
|
113
|
-
else
|
|
114
|
-
return new Point2D(x, y)
|
|
115
|
-
} catch (e) {
|
|
116
|
-
if (e instanceof Error) {
|
|
117
|
-
throw e;
|
|
118
|
-
} else {
|
|
119
|
-
throw e;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export class SymbolModifiers {
|
|
6
|
-
public A_SYMBOL_ICON: string = "";
|
|
7
|
-
public B_ECHELON: string = "";
|
|
8
|
-
public C_QUANTITY: string = "";
|
|
9
|
-
public H_ADDITIONAL_INFO_1: string = "";
|
|
10
|
-
public H1_ADDITIONAL_INFO_2: string = "";
|
|
11
|
-
public H2_ADDITIONAL_INFO_3: string = "";
|
|
12
|
-
public N_HOSTILE: string = "";
|
|
13
|
-
public Q_DIRECTION_OF_MOVEMENT: string = "";
|
|
14
|
-
public S_OFFSET_INDICATOR: string = "";
|
|
15
|
-
public T_UNIQUE_DESIGNATION_1: string = "";
|
|
16
|
-
public T1_UNIQUE_DESIGNATION_2: string = "";
|
|
17
|
-
public V_EQUIP_TYPE: string = "";
|
|
18
|
-
public W_DTG_1: string = "";
|
|
19
|
-
public W1_DTG_2: string = "";
|
|
20
|
-
public X_ALTITUDE_DEPTH: Array<number> = new Array<number>();
|
|
21
|
-
public Y_LOCATION: string = "";
|
|
22
|
-
public AM_DISTANCE: Array<number> = new Array<number>();
|
|
23
|
-
public AN_AZIMUTH: Array<number> = new Array<number>();
|
|
24
|
-
public FillColor: string = "";
|
|
25
|
-
public LineColor: string = "";
|
|
26
|
-
}
|