@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,26 @@
|
|
|
1
|
+
import { Rect } from "./Rect";
|
|
2
|
+
import { type float } from "../../armyc2/c5isr/graphics2d/BasicTypes";
|
|
3
|
+
|
|
4
|
+
export class Paint
|
|
5
|
+
{
|
|
6
|
+
public constructor()
|
|
7
|
+
{
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
public getTextBounds(str:string, xstart:number, end:number, rect:Rect) {
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
13
|
+
public setTextSize(size:float) {
|
|
14
|
+
return;
|
|
15
|
+
};
|
|
16
|
+
public setAntiAlias(b:boolean) {
|
|
17
|
+
return;
|
|
18
|
+
};
|
|
19
|
+
public setColor(color) {
|
|
20
|
+
return;
|
|
21
|
+
};
|
|
22
|
+
public setTypeface(tf) {
|
|
23
|
+
return;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { POINT2 } from "../../armyc2/c5isr/JavaLineArray/POINT2"
|
|
2
|
+
|
|
3
|
+
export class Path {
|
|
4
|
+
private pts: Array<POINT2> = [];
|
|
5
|
+
|
|
6
|
+
public lineTo(x, y) {
|
|
7
|
+
if (this.pts.length > 0)
|
|
8
|
+
{
|
|
9
|
+
var lastPt = this.pts[this.pts.length - 1];
|
|
10
|
+
if (lastPt.x === x && lastPt.y === y)
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
this.pts.push(new POINT2(x, y));
|
|
14
|
+
};
|
|
15
|
+
public moveTo(x, y) {
|
|
16
|
+
if (this.pts.length > 0)
|
|
17
|
+
{
|
|
18
|
+
var lastPt = this.pts[this.pts.length - 1];
|
|
19
|
+
if (lastPt.x === x && lastPt.y === y)
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this.pts.push(new POINT2(x, y));
|
|
23
|
+
};
|
|
24
|
+
public curveTo(x1, y1, x2, y2, x3, y3) {
|
|
25
|
+
this.pts.push(new POINT2(x1, y1));
|
|
26
|
+
this.pts.push(new POINT2(x2, y2));
|
|
27
|
+
this.pts.push(new POINT2(x3, y3));
|
|
28
|
+
};
|
|
29
|
+
public cubicTo(x1, y1, x2, y2, x3, y3) {
|
|
30
|
+
this.pts.push(new POINT2(x1, y1));
|
|
31
|
+
this.pts.push(new POINT2(x2, y2));
|
|
32
|
+
this.pts.push(new POINT2(x3, y3));
|
|
33
|
+
};
|
|
34
|
+
public quadTo(x1, y1, x2, y2) {
|
|
35
|
+
this.pts.push(new POINT2(x1, y1));
|
|
36
|
+
this.pts.push(new POINT2(x2, y2));
|
|
37
|
+
};
|
|
38
|
+
public addPath(path) {
|
|
39
|
+
this.pts.push(...path.getPts());
|
|
40
|
+
return;
|
|
41
|
+
};
|
|
42
|
+
public computeBounds(rect, exact) {
|
|
43
|
+
var j = 0;
|
|
44
|
+
var left = this.pts[0].x;
|
|
45
|
+
var right = this.pts[0].x;
|
|
46
|
+
var top = this.pts[0].y;
|
|
47
|
+
var bottom = this.pts[0].y;
|
|
48
|
+
var pt = null;
|
|
49
|
+
for (j = 1; j < this.pts.length; j++) {
|
|
50
|
+
pt = this.pts[j];
|
|
51
|
+
if (pt.x < left)
|
|
52
|
+
left = pt.x;
|
|
53
|
+
if (pt.x > right)
|
|
54
|
+
right = pt.x;
|
|
55
|
+
if (pt.y < top)
|
|
56
|
+
top = pt.y;
|
|
57
|
+
if (pt.y > bottom)
|
|
58
|
+
bottom = pt.y;
|
|
59
|
+
}
|
|
60
|
+
rect.left = left;
|
|
61
|
+
rect.top = top;
|
|
62
|
+
rect.right = right;
|
|
63
|
+
rect.bottom = bottom;
|
|
64
|
+
return;
|
|
65
|
+
};
|
|
66
|
+
public close() {
|
|
67
|
+
};
|
|
68
|
+
public getPts() {
|
|
69
|
+
return this.pts;
|
|
70
|
+
};
|
|
71
|
+
public reset() {
|
|
72
|
+
this.pts.length = 0;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class RectF
|
|
2
|
+
{
|
|
3
|
+
public top = 0;
|
|
4
|
+
public left = 0;
|
|
5
|
+
public bottom = 0;
|
|
6
|
+
public right = 0;
|
|
7
|
+
|
|
8
|
+
public constructor();
|
|
9
|
+
public constructor(left:number,top:number,right:number,bottom:number);
|
|
10
|
+
public constructor(...args: unknown[])
|
|
11
|
+
{
|
|
12
|
+
switch (args.length)
|
|
13
|
+
{
|
|
14
|
+
case 4: {
|
|
15
|
+
const [left, top, right, bottom] = args as [number, number,number, number];
|
|
16
|
+
if (arguments.length === 4)
|
|
17
|
+
{
|
|
18
|
+
this.left = left;
|
|
19
|
+
this.top = top;
|
|
20
|
+
this.right = right;
|
|
21
|
+
this.bottom = bottom;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public static intersects(a:RectF, b:RectF): boolean {
|
|
28
|
+
if (a.contains(b.left, b.top))
|
|
29
|
+
return true;
|
|
30
|
+
else if (a.contains(b.left, b.bottom))
|
|
31
|
+
return true;
|
|
32
|
+
else if (a.contains(b.right, b.top))
|
|
33
|
+
return true;
|
|
34
|
+
else if (a.contains(b.right, b.bottom))
|
|
35
|
+
return true;
|
|
36
|
+
return false;
|
|
37
|
+
};
|
|
38
|
+
public width():number {
|
|
39
|
+
return this.right - this.left;
|
|
40
|
+
};
|
|
41
|
+
public height():number {
|
|
42
|
+
return this.bottom - this.top;
|
|
43
|
+
};
|
|
44
|
+
public contains(x:number, y:number):boolean {
|
|
45
|
+
if (this.left < x && x < this.right)
|
|
46
|
+
if (this.top < y && y < this.bottom)
|
|
47
|
+
return true;
|
|
48
|
+
return false;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GeneralPath } from "../../armyc2/c5isr/graphics2d/GeneralPath";
|
|
2
|
+
import { RectF } from "./RectF";
|
|
3
|
+
import { Rectangle } from "../../armyc2/c5isr/graphics2d/Rectangle";
|
|
4
|
+
|
|
5
|
+
export class Region
|
|
6
|
+
{
|
|
7
|
+
private _gp:GeneralPath = new GeneralPath();
|
|
8
|
+
private _rect:RectF = null;
|
|
9
|
+
public constructor()
|
|
10
|
+
{
|
|
11
|
+
if (arguments.length === 1)
|
|
12
|
+
{
|
|
13
|
+
var rect = arguments[0];
|
|
14
|
+
this._gp.moveTo(rect.x, rect.y);
|
|
15
|
+
this._gp.lineTo(rect.x + rect.width, rect.y);
|
|
16
|
+
this._gp.lineTo(rect.x + rect.width, rect.y + rect.height);
|
|
17
|
+
this._gp.lineTo(rect.x, rect.y + rect.height);
|
|
18
|
+
this._gp.lineTo(rect.x, rect.y);
|
|
19
|
+
this._rect = rect;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public setPath(path, clipRegion) {
|
|
24
|
+
return true;
|
|
25
|
+
};
|
|
26
|
+
public contains(x:number, y:number) {
|
|
27
|
+
return this._gp.contains(x, y);
|
|
28
|
+
};
|
|
29
|
+
public getBounds = function() {
|
|
30
|
+
var rect = this._gp.getBounds();
|
|
31
|
+
return new Rectangle(rect.x, rect.y, rect.width, rect.height);
|
|
32
|
+
};
|
|
33
|
+
public op = function(region:any, op:any) {
|
|
34
|
+
return false;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { TacticalLines } from "./TacticalLines";
|
|
2
|
+
import { DrawRules } from "../renderer/utilities/DrawRules";
|
|
3
|
+
|
|
4
|
+
export class BasicShapes {
|
|
5
|
+
/**
|
|
6
|
+
* Anchor Points: This symbol requires at least two anchor points, points 1
|
|
7
|
+
* and 2, to define the line. Additional points can be defined to extend the
|
|
8
|
+
* line.
|
|
9
|
+
* <p>
|
|
10
|
+
* Size/Shape: The first and last anchor points determine the length of the
|
|
11
|
+
* line.
|
|
12
|
+
* <p>
|
|
13
|
+
* Orientation: Orientation is determined by the order in which the anchor points are entered.
|
|
14
|
+
* <p>
|
|
15
|
+
* Modifiers: T
|
|
16
|
+
*
|
|
17
|
+
* @see DrawRules.LINE1
|
|
18
|
+
*/
|
|
19
|
+
public static readonly LINE = TacticalLines.BS_LINE;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Anchor Points: This symbol requires at least three anchor points to
|
|
23
|
+
* define the boundary of the area. Add as many points as necessary to
|
|
24
|
+
* accurately reflect the area’s size and shape.
|
|
25
|
+
* <p>
|
|
26
|
+
* Size/Shape: Determined by the anchor points. The information fields
|
|
27
|
+
* should be moveable and scalable as a block within the area.
|
|
28
|
+
* <p>
|
|
29
|
+
* Modifiers: T
|
|
30
|
+
*
|
|
31
|
+
* @see DrawRules.AREA1
|
|
32
|
+
*/
|
|
33
|
+
public static readonly AREA = TacticalLines.BS_AREA;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Anchor Points: This symbol requires one anchor point. This anchor point
|
|
37
|
+
* represents the center of an ellipse and, therefore, the geographic
|
|
38
|
+
* location of that ellipse.
|
|
39
|
+
* <p>
|
|
40
|
+
* Size/Shape: The size and shape of this symbol is determined by three
|
|
41
|
+
* additional numeric values; A major axis radius, a minor axis radius, and
|
|
42
|
+
* a rotation angle. The radii should be expressed in the appropriate map
|
|
43
|
+
* distance units.
|
|
44
|
+
* <p>
|
|
45
|
+
* Orientation: The orientation of this symbol is determined by the rotation
|
|
46
|
+
* angle provided, where 0 degrees is east/west and a positive rotation
|
|
47
|
+
* angle rotates the ellipse in a counter-clockwise direction.
|
|
48
|
+
* <p>
|
|
49
|
+
* Modifiers: AM, AN, T
|
|
50
|
+
*
|
|
51
|
+
* @see DrawRules.ELLIPSE1
|
|
52
|
+
*/
|
|
53
|
+
public static readonly ELLIPSE = TacticalLines.PBS_ELLIPSE;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Anchor Points: This symbol requires one (1) anchor point and a radius.
|
|
57
|
+
* Point 1 defines the center point of the symbol.
|
|
58
|
+
* <p>
|
|
59
|
+
* Size/Shape: Size: The radius defines the size.
|
|
60
|
+
* <p>
|
|
61
|
+
* Orientation: Not applicable
|
|
62
|
+
* <p>
|
|
63
|
+
* Modifiers: AM, T
|
|
64
|
+
*
|
|
65
|
+
* @see DrawRules.CIRCULAR1
|
|
66
|
+
*/
|
|
67
|
+
public static readonly CIRCLE = TacticalLines.PBS_CIRCLE;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Anchor Points: This symbol requires one (1) anchor point to define the
|
|
71
|
+
* center of the area.
|
|
72
|
+
* <p>
|
|
73
|
+
* Size/Shape: Size is determined by the anchor point, the length (in meters)
|
|
74
|
+
* and width (in meters).
|
|
75
|
+
* <p>
|
|
76
|
+
* Orientation: The orientation of this symbol is determined by the rotation
|
|
77
|
+
* angle provided, where 0 degrees is east/west and a positive rotation
|
|
78
|
+
* angle rotates the ellipse in a clockwise direction.
|
|
79
|
+
* <p>
|
|
80
|
+
* Modifiers: AM, AN, T
|
|
81
|
+
*
|
|
82
|
+
* @see DrawRules.RECTANGULAR2
|
|
83
|
+
*/
|
|
84
|
+
public static readonly RECTANGLE = TacticalLines.PBS_RECTANGLE;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Anchor Points: This symbol requires one anchor point. The center point
|
|
88
|
+
* defines/is the center of the symbol.
|
|
89
|
+
* <p>
|
|
90
|
+
* Size/Shape: Line width defines the size of the point. The radius defines the size of the outline.
|
|
91
|
+
* <p>
|
|
92
|
+
* Orientation: Not applicable
|
|
93
|
+
* <p>
|
|
94
|
+
* Modifiers: AM, T
|
|
95
|
+
*
|
|
96
|
+
* @see DrawRules.POINT2
|
|
97
|
+
*/
|
|
98
|
+
public static readonly POINT = TacticalLines.BBS_POINT;
|
|
99
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { POINT2 } from "../JavaLineArray/POINT2"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A class for channel points used by clsChannelUtility
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export class CChannelPoints2 {
|
|
9
|
+
m_Line1: POINT2;
|
|
10
|
+
m_Line2: POINT2;
|
|
11
|
+
constructor();
|
|
12
|
+
constructor(pts: CChannelPoints2);
|
|
13
|
+
constructor(...args: unknown[]) {
|
|
14
|
+
switch (args.length) {
|
|
15
|
+
case 0: {
|
|
16
|
+
this.m_Line1 = new POINT2();
|
|
17
|
+
this.m_Line2 = new POINT2();
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
case 1: {
|
|
22
|
+
const [pts] = args as [CChannelPoints2];
|
|
23
|
+
this.m_Line1 = new POINT2(pts.m_Line1);
|
|
24
|
+
this.m_Line2 = new POINT2(pts.m_Line2);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
default: {
|
|
29
|
+
throw Error(`Invalid number of arguments`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { type int } from "../graphics2d/BasicTypes";
|
|
2
|
+
import { arraysupport } from "../JavaLineArray/arraysupport"
|
|
3
|
+
import { Channels } from "../JavaLineArray/Channels"
|
|
4
|
+
import { countsupport } from "../JavaLineArray/countsupport"
|
|
5
|
+
import { flot } from "../JavaLineArray/flot"
|
|
6
|
+
import { lineutility } from "../JavaLineArray/lineutility"
|
|
7
|
+
import { POINT2 } from "../JavaLineArray/POINT2"
|
|
8
|
+
import { TacticalLines } from "../JavaLineArray/TacticalLines"
|
|
9
|
+
import { TGLight } from "../JavaTacticalRenderer/TGLight"
|
|
10
|
+
import { ErrorLogger } from "../renderer/utilities/ErrorLogger"
|
|
11
|
+
import { RendererException } from "../renderer/utilities/RendererException"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A class for the interface between the points calculation CELineArray and
|
|
15
|
+
* the tactical renderer.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class CELineArray {
|
|
20
|
+
private static readonly _className: string = "CELineArray";
|
|
21
|
+
/**
|
|
22
|
+
* public function to return the line count required for all of the symbols
|
|
23
|
+
*
|
|
24
|
+
* @param plArrayOfLongs the client points as an array of POINT2 in pixels.
|
|
25
|
+
* @param lElements the number of client points.
|
|
26
|
+
* @param ChannelWidth the chanel width in pixels
|
|
27
|
+
*
|
|
28
|
+
* @return the number of points which will be required for the symbol.
|
|
29
|
+
*/
|
|
30
|
+
public static CGetLineCountDouble(tg: TGLight,
|
|
31
|
+
plArrayOfLongs: number[],
|
|
32
|
+
lElements: int, //number of points
|
|
33
|
+
ChannelWidth: int): int {
|
|
34
|
+
let lResult: int = 0;
|
|
35
|
+
try {
|
|
36
|
+
//declarations
|
|
37
|
+
let lPtrcntr: int = 0;
|
|
38
|
+
let lLowerFlotCount: int = 0;
|
|
39
|
+
let lUpperFlotCount: int = 0;
|
|
40
|
+
let pLinePoints: POINT2[] = new Array<POINT2>(lElements);
|
|
41
|
+
let pLowerLinePoints: POINT2[] = new Array<POINT2>(lElements);
|
|
42
|
+
let
|
|
43
|
+
pUpperLinePoints: POINT2[] = new Array<POINT2>(lElements);
|
|
44
|
+
let
|
|
45
|
+
pUpperLowerLinePoints: POINT2[] = new Array<POINT2>(2 * lElements + 2);
|
|
46
|
+
let i: number = 0;
|
|
47
|
+
//end declarations
|
|
48
|
+
|
|
49
|
+
if (lElements <= 0) {
|
|
50
|
+
return -1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
lineutility.InitializePOINT2Array(pLinePoints);
|
|
54
|
+
lineutility.InitializePOINT2Array(pUpperLinePoints);
|
|
55
|
+
lineutility.InitializePOINT2Array(pLowerLinePoints);
|
|
56
|
+
for (i = 0; i < lElements; i++) {
|
|
57
|
+
pLinePoints[i].x = plArrayOfLongs[lPtrcntr];
|
|
58
|
+
lPtrcntr++;
|
|
59
|
+
pLinePoints[i].y = plArrayOfLongs[lPtrcntr];
|
|
60
|
+
lPtrcntr++;
|
|
61
|
+
}
|
|
62
|
+
for (i = 0; i < lElements; i++) {
|
|
63
|
+
pLowerLinePoints[i] = new POINT2(pLinePoints[i]);
|
|
64
|
+
pUpperLinePoints[i] = new POINT2(pLinePoints[i]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
switch (tg.get_LineType()) {
|
|
68
|
+
case TacticalLines.CHANNEL:
|
|
69
|
+
case TacticalLines.CHANNEL_FLARED:
|
|
70
|
+
case TacticalLines.CHANNEL_DASHED: {
|
|
71
|
+
lResult = 2 * lElements;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
case TacticalLines.MAIN:
|
|
76
|
+
case TacticalLines.MAIN_STRAIGHT:
|
|
77
|
+
case TacticalLines.AIRAOA:
|
|
78
|
+
case TacticalLines.SPT:
|
|
79
|
+
case TacticalLines.SPT_STRAIGHT: {
|
|
80
|
+
//points for these need not be bounded
|
|
81
|
+
//they have an extra 8 points for the arrowhead
|
|
82
|
+
lResult = 2 * lElements + 8;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
case TacticalLines.CATK: {
|
|
87
|
+
lResult = 2 * lElements + 8;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
case TacticalLines.CATKBYFIRE: {
|
|
92
|
+
lResult = 2 * lElements + 17;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
case TacticalLines.AAAAA: {
|
|
97
|
+
lResult = 2 * lElements + 19;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
case TacticalLines.LC: {
|
|
102
|
+
pUpperLinePoints = Channels.GetChannelArray2Double(1, pUpperLinePoints, 1, lElements, tg.get_LineType(), ChannelWidth);
|
|
103
|
+
pLowerLinePoints = Channels.GetChannelArray2Double(1, pLowerLinePoints, 0, lElements, tg.get_LineType(), ChannelWidth);
|
|
104
|
+
lUpperFlotCount = flot.GetFlotCountDouble(pUpperLinePoints, arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale()), lElements);
|
|
105
|
+
lLowerFlotCount = flot.GetFlotCountDouble(pLowerLinePoints, arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale()), lElements);
|
|
106
|
+
lResult = lUpperFlotCount + lLowerFlotCount;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
default: {
|
|
111
|
+
//call GetCountersDouble for the remaining line types.
|
|
112
|
+
lResult = countsupport.GetCountersDouble(tg, lElements, pLinePoints, null);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
} catch (exc) {
|
|
118
|
+
if (exc instanceof Error) {
|
|
119
|
+
ErrorLogger.LogException(CELineArray._className, "CGetLineCountDouble",
|
|
120
|
+
new RendererException("Failed inside CGetLineCount " + tg.get_LineType().toString(), exc));
|
|
121
|
+
} else {
|
|
122
|
+
throw exc;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return (lResult);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Return true is the line type is a channel type
|
|
129
|
+
* @param lineType line type
|
|
130
|
+
* @return
|
|
131
|
+
*/
|
|
132
|
+
public static CIsChannel(lineType: int): int {
|
|
133
|
+
let lResult: int = 0;
|
|
134
|
+
try {
|
|
135
|
+
switch (lineType) {
|
|
136
|
+
case TacticalLines.CATK:
|
|
137
|
+
case TacticalLines.CATKBYFIRE:
|
|
138
|
+
case TacticalLines.LC:
|
|
139
|
+
case TacticalLines.AIRAOA:
|
|
140
|
+
case TacticalLines.AAAAA:
|
|
141
|
+
case TacticalLines.MAIN:
|
|
142
|
+
case TacticalLines.MAIN_STRAIGHT:
|
|
143
|
+
case TacticalLines.SPT:
|
|
144
|
+
case TacticalLines.SPT_STRAIGHT:
|
|
145
|
+
case TacticalLines.UNSP:
|
|
146
|
+
case TacticalLines.SFENCE:
|
|
147
|
+
case TacticalLines.DFENCE:
|
|
148
|
+
case TacticalLines.DOUBLEA:
|
|
149
|
+
case TacticalLines.LWFENCE:
|
|
150
|
+
case TacticalLines.HWFENCE:
|
|
151
|
+
case TacticalLines.BBS_LINE:
|
|
152
|
+
case TacticalLines.SINGLEC:
|
|
153
|
+
case TacticalLines.DOUBLEC:
|
|
154
|
+
case TacticalLines.TRIPLE:
|
|
155
|
+
case TacticalLines.CHANNEL:
|
|
156
|
+
case TacticalLines.CHANNEL_FLARED:
|
|
157
|
+
case TacticalLines.CHANNEL_DASHED: {
|
|
158
|
+
lResult = 1;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
default: {
|
|
163
|
+
lResult = 0;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
} catch (exc) {
|
|
169
|
+
if (exc instanceof Error) {
|
|
170
|
+
ErrorLogger.LogException(CELineArray._className, "CIsChannel",
|
|
171
|
+
new RendererException("Failed inside CIsChannel " + lineType.toString(), exc));
|
|
172
|
+
} else {
|
|
173
|
+
throw exc;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return lResult;
|
|
177
|
+
}
|
|
178
|
+
private static _client: string = "";
|
|
179
|
+
public static setClient(value: string): void {
|
|
180
|
+
CELineArray._client = value;
|
|
181
|
+
Channels.setClient(value);
|
|
182
|
+
}
|
|
183
|
+
public static getClient(): string {
|
|
184
|
+
return CELineArray._client;
|
|
185
|
+
}
|
|
186
|
+
// public static void setMinLength(double value)
|
|
187
|
+
// {
|
|
188
|
+
// DISMSupport.setMinLength(value);
|
|
189
|
+
// arraysupport.setMinLength(value);
|
|
190
|
+
// countsupport.setMinLength(value);
|
|
191
|
+
// return;
|
|
192
|
+
// }
|
|
193
|
+
}
|