@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,500 +0,0 @@
|
|
|
1
|
-
import { BasicStroke } from "../graphics2d/BasicStroke"
|
|
2
|
-
import { Graphics2D } from "../graphics2d/Graphics2D"
|
|
3
|
-
import { Point2D } from "../graphics2d/Point2D"
|
|
4
|
-
import { Rectangle } from "../graphics2d/Rectangle"
|
|
5
|
-
import { Rectangle2D } from "../graphics2d/Rectangle2D"
|
|
6
|
-
import { arraysupport } from "../JavaLineArray/arraysupport"
|
|
7
|
-
import { CELineArray } from "../JavaLineArray/CELineArray"
|
|
8
|
-
import { lineutility } from "../JavaLineArray/lineutility"
|
|
9
|
-
import { POINT2 } from "../JavaLineArray/POINT2"
|
|
10
|
-
import { Shape2 } from "../JavaLineArray/Shape2"
|
|
11
|
-
import { TacticalLines } from "../JavaLineArray/TacticalLines"
|
|
12
|
-
import { clsChannelUtility } from "../JavaTacticalRenderer/clsChannelUtility"
|
|
13
|
-
import { clsUtility as clsUtilityJTR } from "../JavaTacticalRenderer/clsUtility"
|
|
14
|
-
import { Modifier2 } from "../JavaTacticalRenderer/Modifier2"
|
|
15
|
-
import { TGLight } from "../JavaTacticalRenderer/TGLight"
|
|
16
|
-
import { Color } from "../renderer/utilities/Color"
|
|
17
|
-
import { ErrorLogger } from "../renderer/utilities/ErrorLogger"
|
|
18
|
-
import { IPointConversion } from "../renderer/utilities/IPointConversion"
|
|
19
|
-
import { MSInfo } from "../renderer/utilities/MSInfo"
|
|
20
|
-
import { MSLookup } from "../renderer/utilities/MSLookup"
|
|
21
|
-
import { RendererException } from "../renderer/utilities/RendererException"
|
|
22
|
-
import { RendererSettings } from "../renderer/utilities/RendererSettings"
|
|
23
|
-
import { clsUtility } from "../RenderMultipoints/clsUtility"
|
|
24
|
-
import { clsUtilityCPOF } from "../RenderMultipoints/clsUtilityCPOF"
|
|
25
|
-
import { clsMETOC } from "../JavaTacticalRenderer/clsMETOC";
|
|
26
|
-
|
|
27
|
-
import { type int, type double } from "../../c5isr/graphics2d/BasicTypes";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Rendering helper class
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
export class clsRenderer2 {
|
|
34
|
-
private static readonly _className: string = "clsRenderer2";
|
|
35
|
-
/**
|
|
36
|
-
* MSR and ASR use segment data for segment colors
|
|
37
|
-
* Assumes tg.H has been revised for clipping
|
|
38
|
-
* @param tg
|
|
39
|
-
* @param shapes
|
|
40
|
-
*/
|
|
41
|
-
private static getMSRShapes(tg: TGLight,
|
|
42
|
-
shapes: Array<Shape2>): void {
|
|
43
|
-
try {
|
|
44
|
-
let linetype: int = tg.get_LineType();
|
|
45
|
-
if (linetype !== TacticalLines.MSR && linetype !== TacticalLines.ASR && linetype !== TacticalLines.ROUTE) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
let hmap: Map<number, Color> = clsUtilityJTR.getMSRSegmentColors(tg);
|
|
51
|
-
let shape: Shape2;
|
|
52
|
-
|
|
53
|
-
let stroke: BasicStroke = clsUtilityJTR.getLineStroke(tg.get_LineThickness(), tg.get_LineStyle(), tg.get_lineCap(), BasicStroke.JOIN_ROUND);
|
|
54
|
-
|
|
55
|
-
let j: int = 0;
|
|
56
|
-
let n: int = tg.Pixels.length;
|
|
57
|
-
let color: Color;
|
|
58
|
-
let segShape: Shape2;
|
|
59
|
-
shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
|
|
60
|
-
shape.setLineColor(tg.get_LineColor());
|
|
61
|
-
shape.setStroke(stroke);
|
|
62
|
-
|
|
63
|
-
//if colors are not set then use one shape
|
|
64
|
-
//assumes colors may be set if string is comma delimited
|
|
65
|
-
// String strH=tg.get_H();
|
|
66
|
-
// if(strH != null && strH.length > 0)
|
|
67
|
-
// {
|
|
68
|
-
// String[] strs=strH.split(",");
|
|
69
|
-
// if(strs.length<2)
|
|
70
|
-
// {
|
|
71
|
-
// shape.moveTo(tg.Pixels[0]);
|
|
72
|
-
// //n=tg.Pixels.length;
|
|
73
|
-
// //for(j=1;j<tg.Pixels.length;j++)
|
|
74
|
-
// for(j=1;j<n;j++)
|
|
75
|
-
// {
|
|
76
|
-
// shape.lineTo(tg.Pixels[j]);
|
|
77
|
-
// }
|
|
78
|
-
// shapes.push(shape);
|
|
79
|
-
// return;
|
|
80
|
-
// }
|
|
81
|
-
// }
|
|
82
|
-
|
|
83
|
-
//if the hashmap contains the segment then use the color corresponding to the segment
|
|
84
|
-
//in the hashtable to create a one segment shape to add to the shape array.
|
|
85
|
-
//else sdd the segment to the original shape
|
|
86
|
-
let lastColor: Color; //diagnostic
|
|
87
|
-
let dist: double = 0;
|
|
88
|
-
let dist2: double = 0;
|
|
89
|
-
let pt0: POINT2;
|
|
90
|
-
let pt1: POINT2;
|
|
91
|
-
let lastPt: POINT2;
|
|
92
|
-
//for(j=0;j<tg.Pixels.length-1;j++)
|
|
93
|
-
for (j = 0; j < n - 1; j++) {
|
|
94
|
-
pt0 = tg.Pixels[j];
|
|
95
|
-
pt1 = tg.Pixels[j + 1];
|
|
96
|
-
if (hmap != null && hmap.has(j)) {
|
|
97
|
-
color = hmap.get(j) as Color;
|
|
98
|
-
if (color !== lastColor) {
|
|
99
|
-
if (segShape != null) {
|
|
100
|
-
|
|
101
|
-
shapes.push(segShape);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
segShape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
|
|
106
|
-
segShape.setLineColor(color);
|
|
107
|
-
segShape.set_Style(tg.get_LineStyle());
|
|
108
|
-
segShape.setStroke(stroke);
|
|
109
|
-
}
|
|
110
|
-
segShape.moveTo(pt0);
|
|
111
|
-
segShape.lineTo(pt1);
|
|
112
|
-
//lastColor=new Color(Integer.toHexString(color.getRGB()));
|
|
113
|
-
lastColor = color;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
if (hmap != null && hmap.has(j + 1)) {
|
|
117
|
-
shape.moveTo(pt0);
|
|
118
|
-
shape.lineTo(pt1);
|
|
119
|
-
lastPt = new POINT2(pt1);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
if (hmap != null && hmap.has(j - 1)) {
|
|
123
|
-
shape.moveTo(pt0);
|
|
124
|
-
shape.lineTo(pt1);
|
|
125
|
-
lastPt = new POINT2(pt1);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
if (j === tg.Pixels.length - 2) {
|
|
129
|
-
shape.moveTo(pt0);
|
|
130
|
-
shape.lineTo(pt1);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
if (lastPt == null) {
|
|
134
|
-
lastPt = new POINT2(pt0);
|
|
135
|
-
shape.moveTo(lastPt);
|
|
136
|
-
//shape.lineTo(lastPt);
|
|
137
|
-
}
|
|
138
|
-
dist = lineutility.CalcDistanceDouble(pt0, pt1);
|
|
139
|
-
if (dist > 10) {
|
|
140
|
-
//shape.moveTo(pt0);
|
|
141
|
-
shape.lineTo(pt1);
|
|
142
|
-
lastPt = new POINT2(pt1);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
dist2 = lineutility.CalcDistanceDouble(lastPt, pt1);
|
|
146
|
-
if (dist2 > 10) {
|
|
147
|
-
//shape.moveTo(pt0);
|
|
148
|
-
shape.lineTo(pt1);
|
|
149
|
-
lastPt = new POINT2(pt1);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
//shapes.push(shape);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if (segShape != null) {
|
|
161
|
-
shapes.push(segShape);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
shapes.push(shape);
|
|
166
|
-
} catch (exc) {
|
|
167
|
-
if (exc instanceof Error) {
|
|
168
|
-
ErrorLogger.LogException(clsRenderer2._className, "getMSRShapes",
|
|
169
|
-
new RendererException("Failed inside getMSRShapes", exc));
|
|
170
|
-
} else {
|
|
171
|
-
throw exc;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @param tg
|
|
178
|
-
* @param converter client converter
|
|
179
|
-
* @param isTextFlipped
|
|
180
|
-
* @return
|
|
181
|
-
*/
|
|
182
|
-
public static GetLineArray(tg: TGLight,
|
|
183
|
-
converter: IPointConversion,
|
|
184
|
-
isTextFlipped: boolean,
|
|
185
|
-
clipBounds: Rectangle2D | Rectangle | Array<Point2D> | null): Array<Shape2> | null {
|
|
186
|
-
let shapes: Array<Shape2> = new Array();
|
|
187
|
-
try {
|
|
188
|
-
if (tg.Pixels == null || tg.Pixels.length === 0) {
|
|
189
|
-
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
let x: double = 0;
|
|
194
|
-
let y: double = 0;
|
|
195
|
-
let width: double = 0;
|
|
196
|
-
let height: double = 0;
|
|
197
|
-
let clipBounds2: Rectangle2D;
|
|
198
|
-
|
|
199
|
-
let clipRect: Rectangle2D;
|
|
200
|
-
let clipArray: Array<Point2D>;
|
|
201
|
-
if (clipBounds != null) {
|
|
202
|
-
if (clipBounds instanceof Rectangle2D) {
|
|
203
|
-
//clipRect=(Rectangle2D)clipBounds;
|
|
204
|
-
clipRect = clipBounds as Rectangle2D;
|
|
205
|
-
x = clipRect.getMinX() - 50;
|
|
206
|
-
y = clipRect.getMinY() - 50;
|
|
207
|
-
width = clipRect.getWidth() + 100;
|
|
208
|
-
height = clipRect.getHeight() + 100;
|
|
209
|
-
clipBounds2 = new Rectangle2D(x, y, width, height);
|
|
210
|
-
} else if (clipBounds instanceof Rectangle) {
|
|
211
|
-
let rectx: Rectangle = clipBounds as Rectangle;
|
|
212
|
-
clipRect = new Rectangle2D(rectx.x, rectx.y, rectx.width, rectx.height);
|
|
213
|
-
x = clipRect.getMinX() - 50;
|
|
214
|
-
y = clipRect.getMinY() - 50;
|
|
215
|
-
width = clipRect.getWidth() + 100;
|
|
216
|
-
height = clipRect.getHeight() + 100;
|
|
217
|
-
clipBounds2 = new Rectangle2D(x, y, width, height);
|
|
218
|
-
} else if (clipBounds instanceof Array) {
|
|
219
|
-
clipArray = clipBounds as Array<Point2D>;
|
|
220
|
-
clipBounds2 = clsUtility.getMBR(clipArray);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
let lineType: int = tg.get_LineType();
|
|
228
|
-
// In some cases render shapes as another line type but return to input line type before adding modifiers
|
|
229
|
-
let inputLineType: int = lineType;
|
|
230
|
-
|
|
231
|
-
// Render complex arrows as simple arrow when very small
|
|
232
|
-
let DPIScaleFactor: double = RendererSettings.getInstance().getDeviceDPI() / 96.0;
|
|
233
|
-
if ((lineType === TacticalLines.FOLLA || lineType === TacticalLines.FOLSP || lineType === TacticalLines.CONVOY)
|
|
234
|
-
&& lineutility.CalcDistanceDouble(tg.Pixels[0], tg.Pixels[1]) <= 30 * DPIScaleFactor) {
|
|
235
|
-
lineType = TacticalLines.DIRATKSPT;
|
|
236
|
-
tg.set_LineType(lineType);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
let minPoints2: int = 0;
|
|
240
|
-
let msInfo: MSInfo = MSLookup.getInstance().getMSLInfo(tg.get_SymbolId());
|
|
241
|
-
if (msInfo != null) {
|
|
242
|
-
minPoints2 = msInfo.getMinPointCount();
|
|
243
|
-
} else {
|
|
244
|
-
minPoints2 = -1;
|
|
245
|
-
}
|
|
246
|
-
let bolResult: boolean = clsUtilityJTR.IsChange1Area(lineType);
|
|
247
|
-
let bolMeTOC: int = clsMETOC.IsWeather(tg.get_SymbolId());
|
|
248
|
-
|
|
249
|
-
let pts: Array<POINT2> = new Array();
|
|
250
|
-
//uncomment one line for usas1314
|
|
251
|
-
let usas1314: boolean = true;
|
|
252
|
-
let j: int = 0;
|
|
253
|
-
let n: int = tg.Pixels.length;
|
|
254
|
-
if (tg.get_LineType() === TacticalLines.SINGLEC) {
|
|
255
|
-
//reverse single concertina
|
|
256
|
-
pts = [...tg.Pixels];
|
|
257
|
-
//for(j=0;j<tg.Pixels.length;j++)
|
|
258
|
-
for (j = 0; j < n; j++) {
|
|
259
|
-
tg.Pixels[j] = pts[pts.length - j - 1];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
let g2d: Graphics2D = new Graphics2D();
|
|
265
|
-
g2d.setFont(tg.get_Font());
|
|
266
|
-
|
|
267
|
-
if (tg.Pixels.length < minPoints2) {
|
|
268
|
-
bolResult = false;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (bolResult) {
|
|
272
|
-
tg.Pixels.length = 0; // tg.Pixels.clear()
|
|
273
|
-
bolResult = clsUtilityCPOF.Change1TacticalAreas(tg, lineType, converter, shapes);
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
if (bolMeTOC > 0) {
|
|
277
|
-
if (tg.Pixels.length < 2) {
|
|
278
|
-
return null;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
try {
|
|
282
|
-
clsMETOC.GetMeTOCShape(tg, shapes);
|
|
283
|
-
} catch (exc) {
|
|
284
|
-
if (exc instanceof Error) {
|
|
285
|
-
ErrorLogger.LogException(clsRenderer2._className, "GetLineArray",
|
|
286
|
-
new RendererException("Failed inside GetLineArray", exc));
|
|
287
|
-
} else {
|
|
288
|
-
throw exc;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
//this will help with click-drag mode
|
|
294
|
-
if (tg.Pixels.length < 2) {
|
|
295
|
-
if(lineType != TacticalLines.BS_CROSS)
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
if (CELineArray.CIsChannel(lineType) === 0) {
|
|
301
|
-
if (lineType === TacticalLines.ASR || lineType === TacticalLines.MSR || lineType === TacticalLines.ROUTE) {
|
|
302
|
-
clsRenderer2.getMSRShapes(tg, shapes);
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
tg.Pixels = arraysupport.GetLineArray2(tg, tg.Pixels, shapes, clipBounds2, converter);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
else //channel type
|
|
309
|
-
{
|
|
310
|
-
clsChannelUtility.DrawChannel(tg.Pixels, lineType, tg, shapes, null, clipBounds2, converter);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
//set CELineArray.shapes properties
|
|
316
|
-
if (bolMeTOC <= 0) {
|
|
317
|
-
if (lineType !== TacticalLines.ASR && lineType !== TacticalLines.MSR && lineType !== TacticalLines.ROUTE) {
|
|
318
|
-
clsUtilityJTR.SetShapeProperties(tg, shapes);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
if (lineType !== inputLineType) {
|
|
324
|
-
// lineType was switched temporarily while rendering shapes
|
|
325
|
-
tg.set_LineType(inputLineType);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
//at this point tg.Pixels has the points from CELineArray
|
|
329
|
-
//the following line adds modifiers for those sybmols which require
|
|
330
|
-
//the calculated points to use for the modifiers.
|
|
331
|
-
//currentlly only BLOCK and CONTAIN use tg.Pixels for computing
|
|
332
|
-
//the modifiers after the call to GetLineArray
|
|
333
|
-
//Modifier2.AddModifiers2(tg);//flipped only for 3d for change 1 symbols
|
|
334
|
-
Modifier2.AddModifiers2(tg, converter);
|
|
335
|
-
|
|
336
|
-
//boundary has shapes for line break
|
|
337
|
-
Modifier2.GetIntegralTextShapes(tg, g2d, shapes);
|
|
338
|
-
} catch (exc) {
|
|
339
|
-
if (exc instanceof Error) {
|
|
340
|
-
ErrorLogger.LogException(clsRenderer2._className, "GetLineArray",
|
|
341
|
-
new RendererException("Failed inside GetLineArray", exc));
|
|
342
|
-
} else {
|
|
343
|
-
throw exc;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
return shapes;
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Isolate and others require special handling for the fill shapes.
|
|
350
|
-
* @param tg
|
|
351
|
-
* @param shapes the existing shapes which characterize the graphic
|
|
352
|
-
*/
|
|
353
|
-
static getAutoshapeFillShape(tg: TGLight, shapes: Array<Shape2>): void {
|
|
354
|
-
try {
|
|
355
|
-
if (shapes == null || shapes.length === 0) {
|
|
356
|
-
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (tg.Pixels == null || tg.Pixels.length === 0) {
|
|
361
|
-
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
if (tg.get_FillColor() == null) {
|
|
366
|
-
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
let linetype: int = tg.get_LineType();
|
|
372
|
-
let j: int = 0;
|
|
373
|
-
let shape: Shape2 = new Shape2(Shape2.SHAPE_TYPE_FILL);
|
|
374
|
-
shape.setFillColor(tg.get_FillColor());
|
|
375
|
-
shape.setLineColor(null);
|
|
376
|
-
let t: int = shapes.length;
|
|
377
|
-
let n: int = tg.Pixels.length;
|
|
378
|
-
switch (linetype) {
|
|
379
|
-
case TacticalLines.RETAIN: {
|
|
380
|
-
if (shapes != null && shapes.length > 0) {
|
|
381
|
-
|
|
382
|
-
//for(j=0;j<shapes.length;j++)
|
|
383
|
-
for (j = 0; j < t; j++) {
|
|
384
|
-
|
|
385
|
-
shapes[j].setFillColor(null);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
shape.moveTo(tg.Pixels[0]);
|
|
392
|
-
for (j = 1; j < 26; j++) {
|
|
393
|
-
|
|
394
|
-
shape.lineTo(tg.Pixels[j]);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
shape.lineTo(tg.Pixels[0]);
|
|
399
|
-
shapes.splice(0, 0, shape);
|
|
400
|
-
break;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
case TacticalLines.SECURE:
|
|
404
|
-
case TacticalLines.OCCUPY: {
|
|
405
|
-
if (shapes != null && shapes.length > 0) {
|
|
406
|
-
|
|
407
|
-
//for(j=0;j<shapes.length;j++)
|
|
408
|
-
for (j = 0; j < t; j++) {
|
|
409
|
-
|
|
410
|
-
shapes[j].setFillColor(null);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
shape.moveTo(tg.Pixels[0]);
|
|
417
|
-
//for(j=1;j<tg.Pixels.length-3;j++)
|
|
418
|
-
for (j = 1; j < n - 3; j++) {
|
|
419
|
-
|
|
420
|
-
shape.lineTo(tg.Pixels[j]);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
shape.lineTo(tg.Pixels[0]);
|
|
425
|
-
shapes.splice(0, 0, shape);
|
|
426
|
-
break;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
case TacticalLines.CONVOY:
|
|
430
|
-
case TacticalLines.HCONVOY: {
|
|
431
|
-
if (shapes != null && shapes.length > 0) {
|
|
432
|
-
|
|
433
|
-
//for(j=0;j<shapes.length;j++)
|
|
434
|
-
for (j = 0; j < t; j++) {
|
|
435
|
-
|
|
436
|
-
shapes[j].setFillColor(null);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
shape.moveTo(tg.Pixels[0]);
|
|
443
|
-
//for(j=1;j<tg.Pixels.length;j++)
|
|
444
|
-
for (j = 1; j < n; j++) {
|
|
445
|
-
|
|
446
|
-
shape.lineTo(tg.Pixels[j]);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
shape.lineTo(tg.Pixels[0]);
|
|
451
|
-
shapes.splice(0, 0, shape);
|
|
452
|
-
break;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
case TacticalLines.CORDONSEARCH:
|
|
456
|
-
case TacticalLines.CORDONKNOCK:
|
|
457
|
-
case TacticalLines.ISOLATE: {
|
|
458
|
-
//set the fillcolor to null for the existing shapes
|
|
459
|
-
//we are going to create a new fill shape
|
|
460
|
-
if (shapes != null && shapes.length > 0) {
|
|
461
|
-
|
|
462
|
-
//for(j=0;j<shapes.length;j++)
|
|
463
|
-
for (j = 0; j < t; j++) {
|
|
464
|
-
|
|
465
|
-
shapes[j].setFillColor(null);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
shape.moveTo(tg.Pixels[0]);
|
|
472
|
-
for (j = 26; j < 47; j++) {
|
|
473
|
-
|
|
474
|
-
shape.lineTo(tg.Pixels[j]);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
shape.lineTo(tg.Pixels[23]);
|
|
479
|
-
shape.lineTo(tg.Pixels[24]);
|
|
480
|
-
shape.lineTo(tg.Pixels[25]);
|
|
481
|
-
shape.lineTo(tg.Pixels[0]);
|
|
482
|
-
shapes.splice(0, 0, shape);
|
|
483
|
-
break;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
default: {
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
} catch (exc) {
|
|
492
|
-
if (exc instanceof Error) {
|
|
493
|
-
ErrorLogger.LogException(clsRenderer2._className, "getAutoshapeFillShape",
|
|
494
|
-
new RendererException("Failed inside getAutoshapeFillShape", exc));
|
|
495
|
-
} else {
|
|
496
|
-
throw exc;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|