@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,269 @@
|
|
|
1
|
+
|
|
2
|
+
import { type int } from "../graphics2d/BasicTypes";
|
|
3
|
+
|
|
4
|
+
import { SinglePointSVGRenderer } from "../renderer/SinglePointSVGRenderer"
|
|
5
|
+
import { DrawRules } from "../renderer/utilities/DrawRules"
|
|
6
|
+
import { ErrorLogger } from "../renderer/utilities/ErrorLogger"
|
|
7
|
+
import { GENCLookup } from "../renderer/utilities/GENCLookup"
|
|
8
|
+
import { ImageInfo } from "../renderer/utilities/ImageInfo"
|
|
9
|
+
import { MilStdAttributes } from "../renderer/utilities/MilStdAttributes"
|
|
10
|
+
import { MSInfo } from "../renderer/utilities/MSInfo"
|
|
11
|
+
import { MSLookup } from "../renderer/utilities/MSLookup"
|
|
12
|
+
import { RendererSettings } from "../renderer/utilities/RendererSettings"
|
|
13
|
+
import { RendererUtilities } from "../renderer/utilities/RendererUtilities"
|
|
14
|
+
import { SVGInfo } from "../renderer/utilities/SVGInfo"
|
|
15
|
+
import { SVGLookup } from "../renderer/utilities/SVGLookup"
|
|
16
|
+
import { SVGSymbolInfo } from "../renderer/utilities/SVGSymbolInfo"
|
|
17
|
+
import { SymbolID } from "../renderer/utilities/SymbolID"
|
|
18
|
+
import { LogLevel } from "./utilities/LogLevel";
|
|
19
|
+
import { SymbolUtilities } from "./utilities/SymbolUtilities";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This class is used for rendering icons that represent the single point graphics in the MilStd 2525.
|
|
24
|
+
* It can also be used for rendering icon previews for multipoint graphics.
|
|
25
|
+
*/
|
|
26
|
+
export class MilStdIconRenderer
|
|
27
|
+
/* implements IIconRenderer */ {
|
|
28
|
+
|
|
29
|
+
private TAG: string = "MilStdIconRenderer";
|
|
30
|
+
|
|
31
|
+
private static _instance: MilStdIconRenderer;
|
|
32
|
+
private _initSuccess: boolean = false;
|
|
33
|
+
//private _SPR: SinglePointRenderer;
|
|
34
|
+
private _SPSVGR: SinglePointSVGRenderer;
|
|
35
|
+
|
|
36
|
+
private constructor() {
|
|
37
|
+
this.init();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static getInstance(): MilStdIconRenderer {
|
|
41
|
+
if (!MilStdIconRenderer._instance) {
|
|
42
|
+
MilStdIconRenderer._instance = new MilStdIconRenderer();
|
|
43
|
+
}
|
|
44
|
+
return MilStdIconRenderer._instance;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
private init(): void// List<Typeface> fonts, List<String> xml
|
|
52
|
+
{
|
|
53
|
+
try {
|
|
54
|
+
if (!this._initSuccess) {
|
|
55
|
+
|
|
56
|
+
//Make sure Lookups are loaded in init so they're not loaded during the first render call
|
|
57
|
+
SVGLookup.getInstance();
|
|
58
|
+
MSLookup.getInstance();
|
|
59
|
+
|
|
60
|
+
//test SVGLookup////////////////////////////////////////////////////////////////////
|
|
61
|
+
/*SVGInfo oct = SVGLookup.getInstance().getSVGLInfo("octagon");
|
|
62
|
+
console.log(oct.toString());*/
|
|
63
|
+
|
|
64
|
+
//test MSLookup/////////////////////////////////////////////////////////////////////
|
|
65
|
+
/*MSInfo msi = MSLookup.getInstance().getMSLInfo("50110100",0);//
|
|
66
|
+
msi = MSLookup.getInstance().getMSLInfo("36190100",0);//"Non-Mine Mine–Like Object, Bottom"
|
|
67
|
+
console.log(msi.getPath());
|
|
68
|
+
console.log(msi.getName());
|
|
69
|
+
msi = MSLookup.getInstance().getMSLInfo("01110300",0);//"Unmanned Aircraft (UA) / Unmanned Aerial Vehicle (UAV) / Unmanned Aircraft System (UAS) / Remotely Piloted Vehicle (RPV)"
|
|
70
|
+
console.log(msi.getPath());
|
|
71
|
+
console.log(msi.getName());//*/
|
|
72
|
+
|
|
73
|
+
// setup single point renderer
|
|
74
|
+
//this._SPR = SinglePointRenderer.getInstance();
|
|
75
|
+
this._SPSVGR = SinglePointSVGRenderer.getInstance();
|
|
76
|
+
|
|
77
|
+
//Load country codes
|
|
78
|
+
GENCLookup.getInstance();
|
|
79
|
+
|
|
80
|
+
this._initSuccess = true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
} catch (exc) {
|
|
84
|
+
if (exc instanceof Error) {
|
|
85
|
+
ErrorLogger.LogException(this.TAG, "init", exc);
|
|
86
|
+
} else {
|
|
87
|
+
throw exc;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public isReady(): boolean {
|
|
93
|
+
return this._initSuccess;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// @Override
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Checks symbol codes and returns whether they can be rendered.
|
|
100
|
+
* For multi-point graphics, modifiers are ignored because we don't need that
|
|
101
|
+
* information to show preview icons in the SymbolPicker.
|
|
102
|
+
*
|
|
103
|
+
* @param symbolID 20-30 digit 2525D Symbol ID Code
|
|
104
|
+
* @param attributes (currently unused)
|
|
105
|
+
* @return true if the basic form of the graphic can be rendered
|
|
106
|
+
*/
|
|
107
|
+
public CanRender(symbolID: string, attributes: Map<string, string>): boolean {
|
|
108
|
+
let message: string = "";
|
|
109
|
+
try {
|
|
110
|
+
// Extract 8-digit ID to use with SVGLookup.
|
|
111
|
+
// MSLookup can handle long codes, but SVGLookup can't because it also takes other strings.
|
|
112
|
+
let lookupID: string = SymbolUtilities.getBasicSymbolID(symbolID);
|
|
113
|
+
let lookupSVGID: string = SVGLookup.getMainIconID(symbolID);
|
|
114
|
+
|
|
115
|
+
// Renderer only supports 2525D at the moment. 2525E will be in the future.
|
|
116
|
+
/*
|
|
117
|
+
int symStd = -1;
|
|
118
|
+
int version = SymbolID.getVersion(symbolID);
|
|
119
|
+
//SymbolID.Version_2525Dch1
|
|
120
|
+
//SymbolID.Version_2525E
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
let msi: MSInfo = MSLookup.getInstance().getMSLInfo(symbolID);
|
|
124
|
+
if (msi == null) {
|
|
125
|
+
message = `Cannot find ${lookupID} in MSLookup`
|
|
126
|
+
} else {
|
|
127
|
+
if (msi.getDrawRule() === DrawRules.DONOTDRAW) {
|
|
128
|
+
message = `${lookupID} (${msi.getName()}) is DoNotDraw`
|
|
129
|
+
} else {
|
|
130
|
+
let version: int = SymbolID.getVersion(symbolID);
|
|
131
|
+
let si: SVGInfo = SVGLookup.getInstance().getSVGLInfo(lookupSVGID, version);
|
|
132
|
+
if (si != null)// || (SymbolID.getEntityCode(symbolID)==000000 && SVGLookup.getInstance().getSVGLInfo(SVGLookup.getFrameID(symbolID)) != null))
|
|
133
|
+
{
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
message = `Cannot find ${lookupID} (${msi.getName()}) in SVGLookup`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
} catch (exc) {
|
|
143
|
+
if (exc instanceof Error) {
|
|
144
|
+
ErrorLogger.LogException("MilStdIconRenderer", "CanRender", exc);
|
|
145
|
+
} else {
|
|
146
|
+
throw exc;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
ErrorLogger.LogMessage("MilStdIconRenderer", "CanRender()", message, LogLevel.FINE);
|
|
150
|
+
//ErrorLogger.LogMessage("MilStdIconRenderer", "CanRender", message);
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
public RenderSVG(symbolID: string, modifiers: Map<string, string>,
|
|
156
|
+
attributes: Map<string, string>): SVGSymbolInfo | null {
|
|
157
|
+
|
|
158
|
+
//Update to use _SPSVGR.RenderUnit
|
|
159
|
+
let ss: int = SymbolID.getSymbolSet(symbolID);
|
|
160
|
+
|
|
161
|
+
let temp: ImageInfo;
|
|
162
|
+
let svgTemp: SVGSymbolInfo;
|
|
163
|
+
let msi: MSInfo = MSLookup.getInstance().getMSLInfo(symbolID);
|
|
164
|
+
if (msi == null)
|
|
165
|
+
{
|
|
166
|
+
//TODO: if null, try to fix the code so that something renders
|
|
167
|
+
//This check currently happening in RenderUnit & RenderSP via renconcileSymbolID()
|
|
168
|
+
//Checks for bad codes and tries to resolve. IF it can't returns unknown symbol.
|
|
169
|
+
}
|
|
170
|
+
if (msi != null && msi.getDrawRule() === DrawRules.DONOTDRAW) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
//Check in case attributes are something other than Map<string,string>, null or undefined
|
|
175
|
+
if(attributes != null && attributes instanceof Map === false)
|
|
176
|
+
attributes = new Map<string,string>();
|
|
177
|
+
if(modifiers != null && modifiers instanceof Map === false)
|
|
178
|
+
modifiers = new Map<string,string>();
|
|
179
|
+
|
|
180
|
+
if (ss === SymbolID.SymbolSet_ControlMeasure)
|
|
181
|
+
{
|
|
182
|
+
if (msi != null)
|
|
183
|
+
{
|
|
184
|
+
//Point12 is actually a multipoint and 17 & 18 are rectangular target and sector range fan
|
|
185
|
+
if (SymbolUtilities.isMultiPoint(symbolID) === false) {
|
|
186
|
+
svgTemp = this._SPSVGR.RenderSP(symbolID, modifiers, attributes);
|
|
187
|
+
} else {
|
|
188
|
+
svgTemp = this._SPSVGR.RenderSP(symbolID, null, attributes);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else if (ss === SymbolID.SymbolSet_Atmospheric ||
|
|
193
|
+
ss === SymbolID.SymbolSet_Oceanographic ||
|
|
194
|
+
ss === SymbolID.SymbolSet_MeteorologicalSpace)
|
|
195
|
+
{
|
|
196
|
+
svgTemp = this._SPSVGR.RenderSP(symbolID, modifiers, attributes);
|
|
197
|
+
}
|
|
198
|
+
else
|
|
199
|
+
{
|
|
200
|
+
svgTemp = this._SPSVGR.RenderUnit(symbolID, modifiers, attributes);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return svgTemp;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public AddCustomSymbol(msInfo:MSInfo,svgInfo:SVGInfo):boolean
|
|
207
|
+
{
|
|
208
|
+
let success:boolean = false;
|
|
209
|
+
if(msInfo.getBasicSymbolID()===svgInfo.getID())//Make sure IDs match
|
|
210
|
+
{
|
|
211
|
+
//Make sure entry isn't already there
|
|
212
|
+
if(MSLookup.getInstance().getMSLInfo(msInfo.getBasicSymbolID(),msInfo.getVersion())==null &&
|
|
213
|
+
SVGLookup.getInstance().getSVGLInfo(svgInfo.getID(),msInfo.getVersion())==null)
|
|
214
|
+
{
|
|
215
|
+
if(MSLookup.getInstance().addCustomSymbol(msInfo))
|
|
216
|
+
success = SVGLookup.getInstance().addCustomSymbol(svgInfo,msInfo.getVersion());
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
else
|
|
221
|
+
{
|
|
222
|
+
ErrorLogger.LogMessage("Symbol Set and Entity Codes do not match", LogLevel.INFO,false);
|
|
223
|
+
}
|
|
224
|
+
return success;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
/*private getDefaultAttributes(symbolID: string): Map<string, string> | null {
|
|
229
|
+
let map: Map<string, string> = new Map<string, string>();
|
|
230
|
+
try {
|
|
231
|
+
if (symbolID == null || symbolID.length !== 15) {
|
|
232
|
+
if (symbolID == null) {
|
|
233
|
+
symbolID = "null";
|
|
234
|
+
}
|
|
235
|
+
ErrorLogger.LogMessage("MilStdIconRenderer", "getDefaultAttributes",
|
|
236
|
+
"getDefaultAttributes passed bad symbolID: " + symbolID);
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
map.set(MilStdAttributes.Alpha, "255");
|
|
241
|
+
if (SymbolUtilities.hasDefaultFill(symbolID)) {
|
|
242
|
+
map.set(MilStdAttributes.FillColor,
|
|
243
|
+
RendererUtilities.colorToHexString(SymbolUtilities.getFillColorOfAffiliation(symbolID), false));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
map.set(MilStdAttributes.LineColor,
|
|
247
|
+
RendererUtilities.colorToHexString(SymbolUtilities.getLineColorOfAffiliation(symbolID), false));
|
|
248
|
+
|
|
249
|
+
map.set(MilStdAttributes.OutlineSymbol, "false");
|
|
250
|
+
// attribute[MilStdAttributes.SymbolOutlineColor] = null;
|
|
251
|
+
// map.set(MilStdAttributes.OutlineWidth,"1");
|
|
252
|
+
|
|
253
|
+
map.set(MilStdAttributes.DrawAsIcon, "false");
|
|
254
|
+
|
|
255
|
+
let rs: RendererSettings = RendererSettings.getInstance();
|
|
256
|
+
|
|
257
|
+
map.set(MilStdAttributes.KeepUnitRatio, "true");
|
|
258
|
+
return map;
|
|
259
|
+
} catch (exc) {
|
|
260
|
+
if (exc instanceof Error) {
|
|
261
|
+
ErrorLogger.LogException("MilStdIconRenderer", "getDefaultAttributes", exc);
|
|
262
|
+
} else {
|
|
263
|
+
throw exc;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return map;
|
|
267
|
+
}//*/
|
|
268
|
+
|
|
269
|
+
}
|