@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.
Files changed (170) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +57 -0
  3. package/buildNode.bat +2 -0
  4. package/buildWeb.bat +2 -0
  5. package/dist/C5Ren.d.ts +6970 -0
  6. package/dist/C5Ren.js +2 -0
  7. package/dist/C5Ren.js.map +1 -0
  8. package/dist/LICENSE +201 -0
  9. package/dist/README.md +57 -0
  10. package/dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz +0 -0
  11. package/dist/manifest.json +4 -0
  12. package/dist/package.json +16 -0
  13. package/index.ts +169 -0
  14. package/package.bak +50 -0
  15. package/package.json +40 -0
  16. package/package.node.json +43 -0
  17. package/package.pack.json +19 -0
  18. package/package.packWeb.json +16 -0
  19. package/package.web.json +40 -0
  20. package/src/main/ts/android/graphics/Bitmap.ts +7 -0
  21. package/src/main/ts/android/graphics/Paint.ts +26 -0
  22. package/src/main/ts/android/graphics/Path.ts +78 -0
  23. package/src/main/ts/android/graphics/PointF.ts +14 -0
  24. package/src/main/ts/android/graphics/Rect.ts +18 -0
  25. package/src/main/ts/android/graphics/RectF.ts +50 -0
  26. package/src/main/ts/android/graphics/Region.ts +36 -0
  27. package/src/main/ts/android/graphics/Typeface.ts +11 -0
  28. package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +99 -0
  29. package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +34 -0
  30. package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +193 -0
  31. package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +2971 -0
  32. package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +4008 -0
  33. package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +93 -0
  34. package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +89 -0
  35. package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +515 -0
  36. package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +5403 -0
  37. package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +1084 -0
  38. package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +2173 -0
  39. package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +4934 -0
  40. package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +7 -0
  41. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +5601 -0
  42. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +14 -0
  43. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +648 -0
  44. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +647 -0
  45. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +2994 -0
  46. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +2663 -0
  47. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +669 -0
  48. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +971 -0
  49. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +871 -0
  50. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +3507 -0
  51. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +500 -0
  52. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +1089 -0
  53. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +2656 -0
  54. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +1419 -0
  55. package/src/main/ts/armyc2/c5isr/data/genc.json +1407 -0
  56. package/src/main/ts/armyc2/c5isr/data/msd.json +17311 -0
  57. package/src/main/ts/armyc2/c5isr/data/mse.json +18500 -0
  58. package/src/main/ts/armyc2/c5isr/data/svgd.json +31214 -0
  59. package/src/main/ts/armyc2/c5isr/data/svge.json +30558 -0
  60. package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +10 -0
  61. package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +437 -0
  62. package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +429 -0
  63. package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +7 -0
  64. package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +35 -0
  65. package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +111 -0
  66. package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +29 -0
  67. package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +18 -0
  68. package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +211 -0
  69. package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +80 -0
  70. package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +33 -0
  71. package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +16 -0
  72. package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +726 -0
  73. package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +141 -0
  74. package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +112 -0
  75. package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +261 -0
  76. package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +391 -0
  77. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +567 -0
  78. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +445 -0
  79. package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +31 -0
  80. package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +18 -0
  81. package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +45 -0
  82. package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +25 -0
  83. package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +15 -0
  84. package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +22 -0
  85. package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +269 -0
  86. package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +9882 -0
  87. package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +146 -0
  88. package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +1265 -0
  89. package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +64 -0
  90. package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +95 -0
  91. package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +93 -0
  92. package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +114 -0
  93. package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +555 -0
  94. package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +62 -0
  95. package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +120 -0
  96. package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +431 -0
  97. package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +99 -0
  98. package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +25 -0
  99. package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +203 -0
  100. package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +104 -0
  101. package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +481 -0
  102. package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +40 -0
  103. package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +1323 -0
  104. package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +51 -0
  105. package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +736 -0
  106. package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +106 -0
  107. package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +84 -0
  108. package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +87 -0
  109. package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +34 -0
  110. package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +324 -0
  111. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +127 -0
  112. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +18 -0
  113. package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +111 -0
  114. package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +219 -0
  115. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +1008 -0
  116. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +882 -0
  117. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +380 -0
  118. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +797 -0
  119. package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +1699 -0
  120. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +178 -0
  121. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +45 -0
  122. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +126 -0
  123. package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +118 -0
  124. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +11 -0
  125. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +1201 -0
  126. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +591 -0
  127. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +29 -0
  128. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +753 -0
  129. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +137 -0
  130. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +438 -0
  131. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +19 -0
  132. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +10 -0
  133. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +5 -0
  134. package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +404 -0
  135. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +525 -0
  136. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +55 -0
  137. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +36 -0
  138. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +1055 -0
  139. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +2085 -0
  140. package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +157 -0
  141. package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +86 -0
  142. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +3798 -0
  143. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +412 -0
  144. package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +124 -0
  145. package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +26 -0
  146. package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +677 -0
  147. package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +484 -0
  148. package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +62 -0
  149. package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +46 -0
  150. package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +51 -0
  151. package/src/main/ts/org/gavaghan/geodesy/Angle.ts +31 -0
  152. package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +71 -0
  153. package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +200 -0
  154. package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +55 -0
  155. package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +68 -0
  156. package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +103 -0
  157. package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +90 -0
  158. package/test/ExportSPImages.js +692 -0
  159. package/test/MPWW.html +556 -0
  160. package/test/MPWorker.js +318 -0
  161. package/test/SPWorker.js +233 -0
  162. package/test/SVGWW.html +363 -0
  163. package/test/singlePointTester3.html +751 -0
  164. package/tsconfig.json +54 -0
  165. package/typedoc.json +30 -0
  166. package/updateVersion.js +21 -0
  167. package/webpack.config.js +34 -0
  168. package/webpackn.config.js +28 -0
  169. package/webpackr.config.js +47 -0
  170. package/webpackw.config.js +23 -0
@@ -0,0 +1,2994 @@
1
+ import { type int, type double} from "../graphics2d/BasicTypes";
2
+
3
+
4
+ import { BasicStroke } from "../graphics2d/BasicStroke"
5
+ import { GeneralPath } from "../graphics2d/GeneralPath"
6
+ import { Rectangle2D } from "../graphics2d/Rectangle2D"
7
+ import { TexturePaint } from "../graphics2d/TexturePaint"
8
+ import { arraysupport } from "../JavaLineArray/arraysupport"
9
+ import { Channels } from "../JavaLineArray/Channels"
10
+ import { lineutility } from "../JavaLineArray/lineutility"
11
+ import { POINT2 } from "../JavaLineArray/POINT2"
12
+ import { Shape2 } from "../JavaLineArray/Shape2"
13
+ import { TacticalLines } from "../JavaLineArray/TacticalLines"
14
+ import { clsChannelUtility } from "../JavaTacticalRenderer/clsChannelUtility"
15
+ import { P1 } from "../JavaTacticalRenderer/P1"
16
+ import { TGLight } from "../JavaTacticalRenderer/TGLight"
17
+ import { PatternFillRenderer } from "../renderer/PatternFillRenderer"
18
+ import { Color } from "../renderer/utilities/Color"
19
+ import { ErrorLogger } from "../renderer/utilities/ErrorLogger"
20
+ import { RendererException } from "../renderer/utilities/RendererException"
21
+ import { RendererSettings } from "../renderer/utilities/RendererSettings"
22
+ import { SymbolID } from "../renderer/utilities/SymbolID"
23
+ import { clsUtility } from "./clsUtility";
24
+ import { SVGSymbolInfo } from "../renderer/utilities/SVGSymbolInfo";
25
+
26
+ /**
27
+ * Class to calculate the points for the Weather symbols
28
+ *
29
+ */
30
+ export class clsMETOC {
31
+ private static readonly _className: string = "clsMETOC";
32
+ public static getWeatherLinetype(version: int, entityCode: int): int {
33
+ switch (entityCode) {
34
+ case 110301: {
35
+ return TacticalLines.CF;
36
+ }
37
+
38
+ case 110302: {
39
+ return TacticalLines.UCF;
40
+ }
41
+
42
+ case 110303: {
43
+ return TacticalLines.CFG;
44
+ }
45
+
46
+ case 110304: {
47
+ return TacticalLines.CFY;
48
+ }
49
+
50
+ case 110305: {
51
+ return TacticalLines.WF;
52
+ }
53
+
54
+ case 110306: {
55
+ return TacticalLines.UWF;
56
+ }
57
+
58
+ case 110307: {
59
+ return TacticalLines.WFG;
60
+ }
61
+
62
+ case 110308: {
63
+ return TacticalLines.WFY;
64
+ }
65
+
66
+ case 110309: {
67
+ return TacticalLines.OCCLUDED;
68
+ }
69
+
70
+ case 110310: {
71
+ return TacticalLines.UOF;
72
+ }
73
+
74
+ case 110311: {
75
+ return TacticalLines.OFY;
76
+ }
77
+
78
+ case 110312: {
79
+ return TacticalLines.SF;
80
+ }
81
+
82
+ case 110313: {
83
+ return TacticalLines.USF;
84
+ }
85
+
86
+ case 110314: {
87
+ return TacticalLines.SFG;
88
+ }
89
+
90
+ case 110315: {
91
+ return TacticalLines.SFY;
92
+ }
93
+
94
+ case 110401: {
95
+ return TacticalLines.TROUGH;
96
+ }
97
+
98
+ case 110402: {
99
+ return TacticalLines.UPPER_TROUGH;
100
+ }
101
+
102
+ case 110403: {
103
+ return TacticalLines.RIDGE;
104
+ }
105
+
106
+ case 110404: {
107
+ return TacticalLines.SQUALL;
108
+ }
109
+
110
+ case 110405: {
111
+ return TacticalLines.INSTABILITY;
112
+ }
113
+
114
+ case 110406: {
115
+ return TacticalLines.SHEAR;
116
+ }
117
+
118
+ case 110407: {
119
+ return TacticalLines.ITC;
120
+ }
121
+
122
+ case 110408: {
123
+ return TacticalLines.CONVERGENCE;
124
+ }
125
+
126
+ case 110409: {
127
+ return TacticalLines.ITD;
128
+ }
129
+
130
+ case 140300: {
131
+ return TacticalLines.JET;
132
+ }
133
+
134
+ case 140400: {
135
+ return TacticalLines.STREAM;
136
+ }
137
+
138
+ case 162004: { //tropical storm wind
139
+ break;
140
+ }
141
+
142
+ case 170100: {
143
+ return TacticalLines.IFR;
144
+ }
145
+
146
+ case 170200: {
147
+ return TacticalLines.MVFR;
148
+ }
149
+
150
+ case 170300: {
151
+ return TacticalLines.TURBULENCE;
152
+ }
153
+
154
+ case 170400: {
155
+ return TacticalLines.ICING;
156
+ }
157
+
158
+ case 170500: {
159
+ return TacticalLines.NON_CONVECTIVE;
160
+ }
161
+
162
+ case 170501: {
163
+ return TacticalLines.CONVECTIVE;
164
+ }
165
+
166
+ case 170600: {
167
+ return TacticalLines.FROZEN;
168
+ }
169
+
170
+ case 170700: {
171
+ return TacticalLines.THUNDERSTORMS;
172
+ }
173
+
174
+ case 170800: {
175
+ return TacticalLines.FOG;
176
+ }
177
+
178
+ case 170900: {
179
+ return TacticalLines.SAND;
180
+ }
181
+
182
+ case 171000: {
183
+ return TacticalLines.FREEFORM;
184
+ }
185
+
186
+ case 180100: {
187
+ return TacticalLines.ISOBAR;
188
+ }
189
+
190
+ case 180200: {
191
+ return TacticalLines.UPPER_AIR;
192
+ }
193
+
194
+ case 180300: {
195
+ return TacticalLines.ISOTHERM;
196
+ }
197
+
198
+ case 180400: {
199
+ return TacticalLines.ISOTACH;
200
+ }
201
+
202
+ case 180500: {
203
+ return TacticalLines.ISODROSOTHERM;
204
+ }
205
+
206
+ case 180600: {
207
+ return TacticalLines.ISOPLETHS;
208
+ }
209
+
210
+ case 180700: {
211
+ return TacticalLines.OPERATOR_FREEFORM;
212
+ }
213
+
214
+ case 110501: {
215
+ return TacticalLines.LVO;
216
+ }
217
+
218
+ case 110502: {
219
+ return TacticalLines.UNDERCAST;
220
+ }
221
+
222
+ case 110503: {
223
+ return TacticalLines.LRO;
224
+ }
225
+
226
+ case 110504: {
227
+ return TacticalLines.ICE_EDGE;
228
+ }
229
+
230
+ case 110505: {
231
+ return TacticalLines.ESTIMATED_ICE_EDGE;
232
+ }
233
+
234
+ case 110506: {
235
+ return TacticalLines.ICE_EDGE_RADAR;
236
+ }
237
+
238
+ case 110601: {
239
+ return TacticalLines.CRACKS;
240
+ }
241
+
242
+ case 110602: {
243
+ return TacticalLines.CRACKS_SPECIFIC_LOCATION;
244
+ }
245
+
246
+ case 110603: {
247
+ return TacticalLines.ICE_OPENINGS_LEAD;
248
+ }
249
+
250
+ case 110604: {
251
+ return TacticalLines.ICE_OPENINGS_FROZEN;
252
+ }
253
+
254
+ case 120102: {
255
+ return TacticalLines.DEPTH_CURVE;
256
+ }
257
+
258
+ case 120103: {
259
+ return TacticalLines.DEPTH_CONTOUR;
260
+ }
261
+
262
+ case 120104: {
263
+ return TacticalLines.DEPTH_AREA;
264
+ }
265
+
266
+ case 120201: {
267
+ return TacticalLines.COASTLINE;
268
+ }
269
+
270
+ case 120202: {
271
+ return TacticalLines.ISLAND;
272
+ }
273
+
274
+ case 120203: {
275
+ return TacticalLines.BEACH;
276
+ }
277
+
278
+ case 120204: {
279
+ return TacticalLines.WATER;
280
+ }
281
+
282
+ case 120205: {
283
+ return TacticalLines.FORESHORE_LINE;
284
+ }
285
+
286
+ case 120206: {
287
+ return TacticalLines.FORESHORE_AREA;
288
+ }
289
+
290
+ case 120305: {
291
+ return TacticalLines.ANCHORAGE_LINE;
292
+ }
293
+
294
+ case 120306: {
295
+ return TacticalLines.ANCHORAGE_AREA;
296
+ }
297
+
298
+
299
+ case 120308: {
300
+ return TacticalLines.PIER;
301
+ }
302
+
303
+ case 120312: {
304
+ return TacticalLines.FISH_TRAPS;
305
+ }
306
+
307
+ case 120314: {
308
+ return TacticalLines.DRYDOCK;
309
+ }
310
+
311
+ case 120317: {
312
+ return TacticalLines.LOADING_FACILITY_LINE;
313
+ }
314
+
315
+ case 120318: {
316
+ return TacticalLines.LOADING_FACILITY_AREA;
317
+ }
318
+
319
+
320
+ case 120319: {
321
+ return TacticalLines.RAMP_ABOVE_WATER;
322
+ }
323
+
324
+ case 120320: {
325
+ return TacticalLines.RAMP_BELOW_WATER;
326
+ }
327
+
328
+
329
+ case 120326: {
330
+ return TacticalLines.JETTY_ABOVE_WATER;
331
+ }
332
+
333
+ case 120327: {
334
+ return TacticalLines.JETTY_BELOW_WATER;
335
+ }
336
+
337
+ case 120328: {
338
+ return TacticalLines.SEAWALL;
339
+ }
340
+
341
+ case 120405: {
342
+ return TacticalLines.PERCHES;
343
+ }
344
+
345
+ case 120407: {
346
+ return TacticalLines.LEADING_LINE;
347
+ }
348
+
349
+ case 120503: {
350
+ return TacticalLines.UNDERWATER_HAZARD;
351
+ }
352
+
353
+ case 120505: {
354
+ return TacticalLines.FOUL_GROUND;
355
+ }
356
+
357
+ case 120507: {
358
+ return TacticalLines.KELP;
359
+ }
360
+
361
+ case 120511: {
362
+ return TacticalLines.BREAKERS;
363
+ }
364
+
365
+ case 120512: {
366
+ return TacticalLines.REEF;
367
+ }
368
+
369
+ case 120514: {
370
+ return TacticalLines.DISCOLORED_WATER;
371
+ }
372
+
373
+ case 120702: {
374
+ return TacticalLines.EBB_TIDE;
375
+ }
376
+
377
+ case 120703: {
378
+ return TacticalLines.FLOOD_TIDE;
379
+ }
380
+
381
+
382
+ case 130101: {
383
+ return TacticalLines.VDR_LEVEL_12;
384
+ }
385
+
386
+ case 130102: {
387
+ return TacticalLines.VDR_LEVEL_23;
388
+ }
389
+
390
+ case 130103: {
391
+ return TacticalLines.VDR_LEVEL_34;
392
+ }
393
+
394
+ case 130104: {
395
+ return TacticalLines.VDR_LEVEL_45;
396
+ }
397
+
398
+ case 130105: {
399
+ return TacticalLines.VDR_LEVEL_56;
400
+ }
401
+
402
+ case 130106: {
403
+ return TacticalLines.VDR_LEVEL_67;
404
+ }
405
+
406
+ case 130107: {
407
+ return TacticalLines.VDR_LEVEL_78;
408
+ }
409
+
410
+ case 130108: {
411
+ return TacticalLines.VDR_LEVEL_89;
412
+ }
413
+
414
+ case 130109: {
415
+ return TacticalLines.VDR_LEVEL_910;
416
+ }
417
+
418
+ case 130201: {
419
+ return TacticalLines.BEACH_SLOPE_FLAT;
420
+ }
421
+
422
+ case 130202: {
423
+ return TacticalLines.BEACH_SLOPE_GENTLE;
424
+ }
425
+
426
+ case 130203: {
427
+ return TacticalLines.BEACH_SLOPE_MODERATE;
428
+ }
429
+
430
+ case 130204: {
431
+ return TacticalLines.BEACH_SLOPE_STEEP;
432
+ }
433
+
434
+ case 140101: {
435
+ return TacticalLines.SOLID_ROCK;
436
+ }
437
+
438
+ case 140102: {
439
+ return TacticalLines.CLAY;
440
+ }
441
+
442
+ case 140103: {
443
+ return TacticalLines.VERY_COARSE_SAND;
444
+ }
445
+
446
+ case 140104: {
447
+ return TacticalLines.COARSE_SAND;
448
+ }
449
+
450
+ case 140105: {
451
+ return TacticalLines.MEDIUM_SAND;
452
+ }
453
+
454
+ case 140106: {
455
+ return TacticalLines.FINE_SAND;
456
+ }
457
+
458
+ case 140107: {
459
+ return TacticalLines.VERY_FINE_SAND;
460
+ }
461
+
462
+ case 140108: {
463
+ return TacticalLines.VERY_FINE_SILT;
464
+ }
465
+
466
+ case 140109: {
467
+ return TacticalLines.FINE_SILT;
468
+ }
469
+
470
+ case 140110: {
471
+ return TacticalLines.MEDIUM_SILT;
472
+ }
473
+
474
+ case 140111: {
475
+ return TacticalLines.COARSE_SILT;
476
+ }
477
+
478
+ case 140112: {
479
+ return TacticalLines.BOULDERS;
480
+ }
481
+
482
+ case 140113: {
483
+ return TacticalLines.OYSTER_SHELLS;
484
+ }
485
+
486
+ case 140114: {
487
+ return TacticalLines.PEBBLES;
488
+ }
489
+
490
+ case 140115: {
491
+ return TacticalLines.SAND_AND_SHELLS;
492
+ }
493
+
494
+ case 140116: {
495
+ return TacticalLines.BOTTOM_SEDIMENTS_LAND;
496
+ }
497
+
498
+ case 140117: {
499
+ return TacticalLines.BOTTOM_SEDIMENTS_NO_DATA;
500
+ }
501
+
502
+ case 140118: {
503
+ return TacticalLines.BOTTOM_ROUGHNESS_SMOOTH;
504
+ }
505
+
506
+ case 140119: {
507
+ return TacticalLines.BOTTOM_ROUGHNESS_MODERATE;
508
+ }
509
+
510
+ case 140120: {
511
+ return TacticalLines.BOTTOM_ROUGHNESS_ROUGH;
512
+ }
513
+
514
+ case 140121: {
515
+ return TacticalLines.CLUTTER_LOW;
516
+ }
517
+
518
+ case 140122: {
519
+ return TacticalLines.CLUTTER_MEDIUM;
520
+ }
521
+
522
+ case 140123: {
523
+ return TacticalLines.CLUTTER_HIGH;
524
+ }
525
+
526
+ case 140124: {
527
+ return TacticalLines.IMPACT_BURIAL_0;
528
+ }
529
+
530
+ case 140125: {
531
+ return TacticalLines.IMPACT_BURIAL_10;
532
+ }
533
+
534
+ case 140126: {
535
+ return TacticalLines.IMPACT_BURIAL_20;
536
+ }
537
+
538
+ case 140127: {
539
+ return TacticalLines.IMPACT_BURIAL_75;
540
+ }
541
+
542
+ case 140128: {
543
+ return TacticalLines.IMPACT_BURIAL_100;
544
+ }
545
+
546
+ case 140129: {
547
+ return TacticalLines.BOTTOM_CATEGORY_A;
548
+ }
549
+
550
+ case 140130: {
551
+ return TacticalLines.BOTTOM_CATEGORY_B;
552
+ }
553
+
554
+ case 140131: {
555
+ return TacticalLines.BOTTOM_CATEGORY_C;
556
+ }
557
+
558
+ case 140132: {
559
+ return TacticalLines.BOTTOM_TYPE_A1;
560
+ }
561
+
562
+ case 140133: {
563
+ return TacticalLines.BOTTOM_TYPE_A2;
564
+ }
565
+
566
+ case 140134: {
567
+ return TacticalLines.BOTTOM_TYPE_A3;
568
+ }
569
+
570
+ case 140135: {
571
+ return TacticalLines.BOTTOM_TYPE_B1;
572
+ }
573
+
574
+ case 140136: {
575
+ return TacticalLines.BOTTOM_TYPE_B2;
576
+ }
577
+
578
+ case 140137: {
579
+ return TacticalLines.BOTTOM_TYPE_B3;
580
+ }
581
+
582
+ case 140138: {
583
+ return TacticalLines.BOTTOM_TYPE_C1;
584
+ }
585
+
586
+ case 140139: {
587
+ return TacticalLines.BOTTOM_TYPE_C2;
588
+ }
589
+
590
+ case 140140: {
591
+ return TacticalLines.BOTTOM_TYPE_C3;
592
+ }
593
+
594
+
595
+ case 150100: {
596
+ return TacticalLines.MARITIME_LIMIT;
597
+ }
598
+
599
+ case 150200: {
600
+ return TacticalLines.MARITIME_AREA;
601
+ }
602
+
603
+ case 150300: {
604
+ return TacticalLines.RESTRICTED_AREA;
605
+ }
606
+
607
+ case 150400: {
608
+ return TacticalLines.SWEPT_AREA;
609
+ }
610
+
611
+ case 150500: {
612
+ return TacticalLines.TRAINING_AREA;
613
+ }
614
+
615
+ case 150600: {
616
+ return TacticalLines.OPERATOR_DEFINED;
617
+ }
618
+
619
+ case 160100: {
620
+ return TacticalLines.CABLE;
621
+ }
622
+
623
+ case 160200: {
624
+ return TacticalLines.SUBMERGED_CRIB;
625
+ }
626
+
627
+ case 160300: {
628
+ return TacticalLines.CANAL;
629
+ }
630
+
631
+ case 160700: {
632
+ return TacticalLines.OIL_RIG_FIELD;
633
+ }
634
+
635
+ case 160800: {
636
+ return TacticalLines.PIPE;
637
+ }
638
+
639
+
640
+ default: {
641
+ return -1;
642
+ }
643
+
644
+ }
645
+ return -1;
646
+ }
647
+ /**
648
+ * @param symbolID Mil-Standard 2525 20-30 digit code
649
+ * @return the line type as an integer if it is a weather symbol, else return -1
650
+ */
651
+ public static IsWeather(symbolID: string): int {
652
+ //the MeTOCs
653
+ try {
654
+ if (symbolID == null) {
655
+
656
+ return -1;
657
+ }
658
+
659
+
660
+ if (symbolID.length > 15) {
661
+ let symbolSet: int = SymbolID.getSymbolSet(symbolID);
662
+ let entityCode: int = SymbolID.getEntityCode(symbolID);
663
+ let version: int = SymbolID.getVersion(symbolID);
664
+
665
+ switch (symbolSet) {
666
+ case 45:
667
+ case 46: {
668
+ return clsMETOC.getWeatherLinetype(version, entityCode);
669
+ }
670
+
671
+
672
+ default:
673
+
674
+ }
675
+ }
676
+ } catch (exc) {
677
+ if (exc instanceof Error) {
678
+ //clsUtility.WriteFile("Error in clsMETOC.IsWeather");
679
+ ErrorLogger.LogException(clsMETOC._className, "isWeather",
680
+ new RendererException("Failed inside isWeather", exc));
681
+ } else {
682
+ throw exc;
683
+ }
684
+ }
685
+ return -1;
686
+ }
687
+ /**
688
+ * Sets tactical graphic properties based on Mil-Std-2525 Appendix C.
689
+ * @param tg
690
+ */
691
+ private static SetMeTOCProperties(tg: TGLight): void {
692
+ try {
693
+ //METOC's have no user defined fills
694
+ //any fills per Mil-Std-2525 will be set below
695
+ //tg.set_FillColor(null);
696
+ let symbolId: string = tg.get_SymbolId();
697
+ switch (tg.get_LineType()) { //255:150:150
698
+ case TacticalLines.SQUALL: {
699
+ tg.set_LineColor(Color.BLACK);
700
+ tg.set_lineCap(BasicStroke.CAP_BUTT);
701
+ break;
702
+ }
703
+
704
+ case TacticalLines.TROUGH: {
705
+ tg.set_LineStyle(1);
706
+ tg.set_LineColor(Color.BLACK);
707
+ tg.set_lineCap(BasicStroke.CAP_ROUND);
708
+ break;
709
+ }
710
+
711
+ case TacticalLines.UPPER_TROUGH: {
712
+ tg.set_LineColor(Color.BLACK);
713
+ tg.set_lineCap(BasicStroke.CAP_ROUND);
714
+ break;
715
+ }
716
+
717
+ case TacticalLines.BOTTOM_TYPE_A1: {
718
+ tg.set_LineColor(new Color(48, 255, 0)); // green
719
+ tg.set_FillColor(new Color(48, 255, 0));
720
+ break;
721
+ }
722
+
723
+ case TacticalLines.BOTTOM_TYPE_A2: {
724
+ tg.set_LineColor(new Color(127, 255, 0)); //light green
725
+ tg.set_FillColor(new Color(127, 255, 0));
726
+ break;
727
+ }
728
+
729
+ case TacticalLines.BOTTOM_TYPE_C2: {
730
+ tg.set_LineColor(new Color(255, 80, 0)); //dark orange
731
+ tg.set_FillColor(new Color(255, 80, 0));
732
+ break;
733
+ }
734
+
735
+ case TacticalLines.BOTTOM_TYPE_C3: {
736
+ tg.set_LineColor(new Color(255, 48, 0)); //orange red
737
+ tg.set_FillColor(new Color(255, 48, 0));
738
+ break;
739
+ }
740
+
741
+ case TacticalLines.IMPACT_BURIAL_0: {
742
+ tg.set_LineColor(new Color(0, 0, 255)); //blue
743
+ tg.set_FillColor(new Color(0, 0, 255));
744
+ break;
745
+ }
746
+
747
+ case TacticalLines.BOTTOM_TYPE_C1:
748
+ case TacticalLines.IMPACT_BURIAL_75: {
749
+ tg.set_LineColor(new Color(255, 127, 0)); //orange
750
+ tg.set_FillColor(new Color(255, 127, 0));
751
+ break;
752
+ }
753
+
754
+ case TacticalLines.BOTTOM_CATEGORY_C:
755
+ case TacticalLines.IMPACT_BURIAL_100:
756
+ case TacticalLines.CLUTTER_HIGH:
757
+ case TacticalLines.BOTTOM_ROUGHNESS_ROUGH: {
758
+ tg.set_LineColor(new Color(255, 0, 0)); //red
759
+ tg.set_FillColor(new Color(255, 0, 0));
760
+ break;
761
+ }
762
+
763
+ case TacticalLines.BOTTOM_TYPE_B2:
764
+ case TacticalLines.BOTTOM_CATEGORY_B:
765
+ case TacticalLines.IMPACT_BURIAL_20:
766
+ case TacticalLines.CLUTTER_MEDIUM:
767
+ case TacticalLines.BOTTOM_ROUGHNESS_MODERATE: {
768
+ tg.set_LineColor(new Color(255, 255, 0)); //yellow
769
+ tg.set_FillColor(new Color(255, 255, 0));
770
+ break;
771
+ }
772
+
773
+ case TacticalLines.BOTTOM_CATEGORY_A:
774
+ case TacticalLines.IMPACT_BURIAL_10:
775
+ case TacticalLines.CLUTTER_LOW:
776
+ case TacticalLines.BOTTOM_ROUGHNESS_SMOOTH: {
777
+ tg.set_LineColor(new Color(0, 255, 0)); //green
778
+ tg.set_FillColor(new Color(0, 255, 0));
779
+ break;
780
+ }
781
+
782
+ case TacticalLines.BOTTOM_SEDIMENTS_NO_DATA: {
783
+ tg.set_LineColor(new Color(230, 230, 230)); //light gray
784
+ tg.set_FillColor(new Color(230, 230, 230));
785
+ break;
786
+ }
787
+
788
+ case TacticalLines.BOTTOM_SEDIMENTS_LAND: {
789
+ tg.set_LineColor(new Color(220, 220, 220)); //gray
790
+ tg.set_FillColor(new Color(220, 220, 220));
791
+ break;
792
+ }
793
+
794
+ case TacticalLines.SAND_AND_SHELLS: {
795
+ tg.set_LineColor(new Color(255, 220, 220)); //light peach
796
+ tg.set_FillColor(new Color(255, 220, 220));
797
+ break;
798
+ }
799
+
800
+ case TacticalLines.PEBBLES: {
801
+ tg.set_LineColor(new Color(255, 190, 190)); //peach
802
+ tg.set_FillColor(new Color(255, 190, 190));
803
+ break;
804
+ }
805
+
806
+ case TacticalLines.OYSTER_SHELLS: {
807
+ tg.set_LineColor(new Color(255, 150, 150)); //dark peach
808
+ tg.set_FillColor(new Color(255, 150, 150));
809
+ break;
810
+ }
811
+
812
+ case TacticalLines.BOULDERS: {
813
+ tg.set_LineColor(new Color(255, 0, 0));
814
+ tg.set_FillColor(new Color(255, 0, 0));
815
+ break;
816
+ }
817
+
818
+ case TacticalLines.COARSE_SILT: {
819
+ tg.set_LineColor(new Color(200, 255, 105));
820
+ tg.set_FillColor(new Color(200, 255, 105));
821
+ break;
822
+ }
823
+
824
+ case TacticalLines.MEDIUM_SILT: {
825
+ tg.set_LineColor(new Color(0, 255, 0)); //green
826
+ tg.set_FillColor(new Color(0, 255, 0));
827
+ break;
828
+ }
829
+
830
+ case TacticalLines.FINE_SILT: {
831
+ tg.set_LineColor(new Color(25, 255, 230)); //turquoise
832
+ tg.set_FillColor(new Color(25, 255, 230));
833
+ break;
834
+ }
835
+
836
+ case TacticalLines.VERY_FINE_SILT: {
837
+ tg.set_LineColor(new Color(0, 215, 255)); //turquoise
838
+ tg.set_FillColor(new Color(0, 215, 255));
839
+ break;
840
+ }
841
+
842
+ case TacticalLines.VERY_FINE_SAND: {
843
+ tg.set_LineColor(new Color(255, 255, 220)); //pale yellow
844
+ tg.set_FillColor(new Color(255, 255, 220));
845
+ break;
846
+ }
847
+
848
+ case TacticalLines.FINE_SAND: {
849
+ tg.set_LineColor(new Color(255, 255, 140)); //light yellow
850
+ tg.set_FillColor(new Color(255, 255, 140));
851
+ break;
852
+ }
853
+
854
+ case TacticalLines.MEDIUM_SAND: {
855
+ tg.set_LineColor(new Color(255, 235, 0)); //yellow
856
+ tg.set_FillColor(new Color(255, 235, 0));
857
+ break;
858
+ }
859
+
860
+ case TacticalLines.COARSE_SAND: {
861
+ tg.set_LineColor(new Color(255, 215, 0)); //light gold
862
+ tg.set_FillColor(new Color(255, 215, 0));
863
+ break;
864
+ }
865
+
866
+ case TacticalLines.BOTTOM_TYPE_B3: {
867
+ tg.set_LineColor(new Color(255, 207, 0)); //gold
868
+ tg.set_FillColor(new Color(255, 207, 0));
869
+ break;
870
+ }
871
+
872
+ case TacticalLines.VERY_COARSE_SAND: {
873
+ tg.set_LineColor(new Color(255, 180, 0)); //gold
874
+ tg.set_FillColor(new Color(255, 180, 0));
875
+ break;
876
+ }
877
+
878
+ case TacticalLines.CLAY: {
879
+ tg.set_LineColor(new Color(100, 130, 255)); //periwinkle
880
+ tg.set_FillColor(new Color(100, 130, 255));
881
+ break;
882
+ }
883
+
884
+ case TacticalLines.SOLID_ROCK: {
885
+ //tg.set_LineColor(new Color(160, 32, 240)); //purple
886
+ //tg.set_FillColor(new Color(160, 32, 240));
887
+ tg.set_LineColor(new Color(255, 0, 255)); //magenta
888
+ tg.set_FillColor(new Color(255, 0, 255));
889
+ break;
890
+ }
891
+
892
+ case TacticalLines.VDR_LEVEL_12: {
893
+ tg.set_LineColor(new Color(26, 153, 77)); //dark green
894
+ tg.set_FillColor(new Color(26, 153, 77));
895
+ break;
896
+ }
897
+
898
+ case TacticalLines.VDR_LEVEL_23: {
899
+ tg.set_LineColor(new Color(26, 204, 77)); //light green
900
+ tg.set_FillColor(new Color(26, 204, 77));
901
+ break;
902
+ }
903
+
904
+ case TacticalLines.BOTTOM_TYPE_A3: {
905
+ tg.set_LineColor(new Color(175, 255, 0)); //lime green
906
+ tg.set_FillColor(new Color(175, 255, 0));
907
+ break;
908
+ }
909
+
910
+ case TacticalLines.VDR_LEVEL_34: {
911
+ tg.set_LineColor(new Color(128, 255, 51)); //lime green
912
+ tg.set_FillColor(new Color(128, 255, 51));
913
+ break;
914
+ }
915
+
916
+ case TacticalLines.BOTTOM_TYPE_B1: {
917
+ tg.set_LineColor(new Color(207, 255, 0)); //yellow green
918
+ tg.set_FillColor(new Color(207, 255, 0));
919
+ break;
920
+ }
921
+
922
+ case TacticalLines.VDR_LEVEL_45: {
923
+ tg.set_LineColor(new Color(204, 255, 26)); //yellow green
924
+ tg.set_FillColor(new Color(204, 255, 26));
925
+ break;
926
+ }
927
+
928
+ case TacticalLines.VDR_LEVEL_56: {
929
+ tg.set_LineColor(new Color(255, 255, 0)); //yellow
930
+ tg.set_FillColor(new Color(255, 255, 0));
931
+ break;
932
+ }
933
+
934
+ case TacticalLines.VDR_LEVEL_67: {
935
+ tg.set_LineColor(new Color(255, 204, 0)); //gold
936
+ tg.set_FillColor(new Color(255, 204, 0));
937
+ break;
938
+ }
939
+
940
+ case TacticalLines.VDR_LEVEL_78: {
941
+ tg.set_LineColor(new Color(255, 128, 0)); //light orange
942
+ tg.set_FillColor(new Color(255, 128, 0));
943
+ break;
944
+ }
945
+
946
+ case TacticalLines.VDR_LEVEL_89: {
947
+ tg.set_LineColor(new Color(255, 77, 0)); //dark orange
948
+ tg.set_FillColor(new Color(255, 77, 0));
949
+ break;
950
+ }
951
+
952
+ case TacticalLines.VDR_LEVEL_910: {
953
+ tg.set_LineColor(Color.RED);
954
+ tg.set_FillColor(Color.RED);
955
+ break;
956
+ }
957
+
958
+ case TacticalLines.CANAL: {
959
+ tg.set_LineColor(Color.BLACK);
960
+ tg.set_LineThickness(2 * tg.get_LineThickness()); // Thick line
961
+ break;
962
+ }
963
+
964
+ case TacticalLines.OPERATOR_DEFINED: {
965
+ tg.set_LineColor(new Color(255, 128, 0));
966
+ break;
967
+ }
968
+
969
+ case TacticalLines.MARITIME_LIMIT:
970
+ case TacticalLines.MARITIME_AREA: {
971
+ tg.set_LineColor(Color.MAGENTA);
972
+ tg.set_LineStyle(1);
973
+ break;
974
+ }
975
+
976
+ case TacticalLines.PERCHES:
977
+ case TacticalLines.SUBMERGED_CRIB: {
978
+ tg.set_LineColor(Color.BLACK);
979
+ tg.set_LineStyle(2);
980
+ tg.set_lineCap(BasicStroke.CAP_ROUND);
981
+ tg.set_FillColor(Color.BLUE);
982
+ break;
983
+ }
984
+
985
+ case TacticalLines.DISCOLORED_WATER:
986
+ case TacticalLines.UNDERWATER_HAZARD: {
987
+ tg.set_LineColor(Color.BLACK);
988
+ tg.set_LineStyle(2);
989
+ tg.set_FillColor(new Color(0, 191, 255)); //deep sky blue
990
+ break;
991
+ }
992
+
993
+ case TacticalLines.LOADING_FACILITY_AREA: {
994
+ tg.set_LineColor(new Color(210, 180, 140));
995
+ tg.set_FillColor(new Color(210, 180, 140));
996
+ break;
997
+ }
998
+
999
+ case TacticalLines.LOADING_FACILITY_LINE: {
1000
+ tg.set_LineColor(Color.GRAY);
1001
+ tg.set_LineThickness(2 * tg.get_LineThickness()); // Thick line
1002
+ break;
1003
+ }
1004
+
1005
+ case TacticalLines.DRYDOCK: {
1006
+ tg.set_LineColor(Color.BLACK);
1007
+ //tg.set_FillColor(new Color(165, 42, 42)); //brown
1008
+ tg.set_FillColor(new Color(205, 133, 63)); //brown
1009
+ tg.set_LineStyle(1);
1010
+ break;
1011
+ }
1012
+
1013
+ case TacticalLines.FORESHORE_AREA: {
1014
+ //tg.set_LineColor(new Color(154, 205, 50));
1015
+ //tg.set_FillColor(new Color(154, 205, 50));
1016
+ tg.set_LineColor(new Color(173, 255, 47));
1017
+ tg.set_FillColor(new Color(173, 255, 47));
1018
+ break;
1019
+ }
1020
+
1021
+ case TacticalLines.FORESHORE_LINE: {
1022
+ //tg.set_LineColor(new Color(154, 205, 50));
1023
+ tg.set_LineColor(new Color(173, 255, 47));
1024
+ break;
1025
+ }
1026
+
1027
+ case TacticalLines.RESTRICTED_AREA:
1028
+ case TacticalLines.TRAINING_AREA:
1029
+ case TacticalLines.ANCHORAGE_LINE:
1030
+ case TacticalLines.ANCHORAGE_AREA: {
1031
+ tg.set_LineColor(Color.MAGENTA);
1032
+ //tg.set_LineStyle(1); //dashed
1033
+ break;
1034
+ }
1035
+
1036
+ case TacticalLines.PIPE: {
1037
+ tg.set_LineColor(Color.GRAY);
1038
+ tg.set_FillColor(Color.GRAY);
1039
+ break;
1040
+ }
1041
+
1042
+ case TacticalLines.WATER: {
1043
+ tg.set_LineColor(Color.WHITE);
1044
+ tg.set_FillColor(Color.WHITE);
1045
+ break;
1046
+ }
1047
+
1048
+ case TacticalLines.FISH_TRAPS: {
1049
+ tg.set_LineColor(new Color(192, 192, 192));
1050
+ tg.set_LineStyle(1);
1051
+ break;
1052
+ }
1053
+
1054
+ case TacticalLines.SWEPT_AREA:
1055
+ case TacticalLines.OIL_RIG_FIELD:
1056
+ case TacticalLines.FOUL_GROUND:
1057
+ case TacticalLines.KELP: {
1058
+ tg.set_LineColor(null);
1059
+ break;
1060
+ }
1061
+
1062
+ case TacticalLines.BEACH: {
1063
+ tg.set_LineColor(new Color(206, 158, 140));
1064
+ tg.set_FillColor(new Color(206, 158, 140, Math.trunc(255 * 0.12)));
1065
+ break;
1066
+ }
1067
+
1068
+ case TacticalLines.DEPTH_AREA: {
1069
+ tg.set_LineColor(Color.BLUE);
1070
+ tg.set_FillColor(Color.WHITE);
1071
+ break;
1072
+ }
1073
+
1074
+ case TacticalLines.CONVERGENCE:
1075
+ case TacticalLines.ITC: {
1076
+ tg.set_LineColor(new Color(255, 128, 0));
1077
+ tg.set_lineCap(BasicStroke.CAP_BUTT);
1078
+ break;
1079
+ }
1080
+
1081
+ case TacticalLines.OFY:
1082
+ case TacticalLines.OCCLUDED: {
1083
+ tg.set_LineColor(new Color(160, 32, 240));
1084
+ tg.set_FillColor(new Color(160, 32, 240));
1085
+ break;
1086
+ }
1087
+
1088
+ case TacticalLines.UOF: {
1089
+ tg.set_LineColor(new Color(160, 32, 240));
1090
+ break;
1091
+ }
1092
+
1093
+ case TacticalLines.WFY:
1094
+ case TacticalLines.WFG:
1095
+ case TacticalLines.WF: {
1096
+ tg.set_FillColor(Color.RED);
1097
+ tg.set_LineColor(Color.RED);
1098
+ break;
1099
+ }
1100
+
1101
+ case TacticalLines.UWF:
1102
+ case TacticalLines.IFR: {
1103
+ tg.set_LineColor(Color.RED);
1104
+ break;
1105
+ }
1106
+
1107
+ case TacticalLines.CFG:
1108
+ case TacticalLines.CFY:
1109
+ case TacticalLines.CF: {
1110
+ tg.set_LineColor(Color.BLUE);
1111
+ tg.set_FillColor(Color.BLUE);
1112
+ break;
1113
+ }
1114
+
1115
+ case TacticalLines.UCF:
1116
+ case TacticalLines.MVFR: {
1117
+ tg.set_LineColor(Color.BLUE);
1118
+ break;
1119
+ }
1120
+
1121
+ case TacticalLines.TURBULENCE: {
1122
+ tg.set_LineColor(Color.BLUE);
1123
+ tg.set_LineStyle(2);
1124
+ tg.set_lineCap(BasicStroke.CAP_ROUND);
1125
+ let minThickness: int = Math.max(RendererSettings.getInstance().getDeviceDPI() / 96, 1) * 6;
1126
+ if (tg.get_LineThickness() < minThickness) {
1127
+
1128
+ tg.set_LineThickness(minThickness);
1129
+ }
1130
+
1131
+ break;
1132
+ }
1133
+
1134
+ case TacticalLines.CABLE: {
1135
+ tg.set_LineColor(Color.MAGENTA);
1136
+ break;
1137
+ }
1138
+
1139
+ case TacticalLines.ISLAND: {
1140
+ //tg.set_LineColor(new Color(165, 42, 42)); //brown
1141
+ //tg.set_FillColor(new Color(165, 42, 42)); //brown
1142
+ tg.set_LineColor(new Color(210, 180, 140)); //tan
1143
+ tg.set_FillColor(new Color(210, 180, 140)); //tan
1144
+ break;
1145
+ }
1146
+
1147
+ case TacticalLines.SEAWALL:
1148
+ case TacticalLines.SEAWALL_GE:
1149
+ case TacticalLines.FLOOD_TIDE:
1150
+ case TacticalLines.FLOOD_TIDE_GE:
1151
+ case TacticalLines.EBB_TIDE:
1152
+ case TacticalLines.EBB_TIDE_GE:
1153
+ case TacticalLines.JETTY_ABOVE_WATER:
1154
+ case TacticalLines.JETTY_ABOVE_WATER_GE: {
1155
+ tg.set_LineColor(Color.GRAY);
1156
+ break;
1157
+ }
1158
+
1159
+ case TacticalLines.BEACH_SLOPE_MODERATE:
1160
+ case TacticalLines.BEACH_SLOPE_FLAT: {
1161
+ tg.set_LineColor(new Color(179, 179, 179));
1162
+ tg.set_FillColor(null);
1163
+ break;
1164
+ }
1165
+
1166
+ case TacticalLines.BEACH_SLOPE_GENTLE:
1167
+ case TacticalLines.BEACH_SLOPE_STEEP: {
1168
+ tg.set_LineColor(new Color(128, 128, 128));
1169
+ tg.set_FillColor(null);
1170
+ break;
1171
+ }
1172
+
1173
+ case TacticalLines.BREAKERS: {
1174
+ tg.set_LineStyle(1);
1175
+ tg.set_LineColor(Color.GRAY);
1176
+ break;
1177
+ }
1178
+
1179
+ case TacticalLines.JETTY_BELOW_WATER:
1180
+ case TacticalLines.JETTY_BELOW_WATER_GE: {
1181
+ tg.set_LineStyle(1);
1182
+ tg.set_LineColor(Color.GRAY);
1183
+ break;
1184
+ }
1185
+
1186
+ case TacticalLines.DEPTH_CURVE:
1187
+ case TacticalLines.DEPTH_CURVE_GE:
1188
+ case TacticalLines.DEPTH_CONTOUR:
1189
+ case TacticalLines.DEPTH_CONTOUR_GE:
1190
+ case TacticalLines.COASTLINE:
1191
+ case TacticalLines.COASTLINE_GE:
1192
+ case TacticalLines.PIER:
1193
+ case TacticalLines.PIER_GE: {
1194
+ tg.set_LineColor(Color.GRAY);
1195
+ break;
1196
+ }
1197
+
1198
+ case TacticalLines.FROZEN:
1199
+ case TacticalLines.JET:
1200
+ case TacticalLines.JET_GE: {
1201
+ tg.set_LineColor(Color.RED);
1202
+ break;
1203
+ }
1204
+
1205
+ case TacticalLines.THUNDERSTORMS: {
1206
+ tg.set_LineColor(Color.RED);
1207
+ tg.set_LineStyle(3);
1208
+ break;
1209
+ }
1210
+
1211
+ case TacticalLines.RAMP_BELOW_WATER:
1212
+ case TacticalLines.RAMP_BELOW_WATER_GE:
1213
+ case TacticalLines.ESTIMATED_ICE_EDGE:
1214
+ case TacticalLines.ESTIMATED_ICE_EDGE_GE: {
1215
+ tg.set_LineStyle(1);
1216
+ tg.set_LineColor(Color.BLACK);
1217
+ break;
1218
+ }
1219
+
1220
+ case TacticalLines.ISODROSOTHERM:
1221
+ case TacticalLines.ISODROSOTHERM_GE: {
1222
+ tg.set_LineColor(Color.GREEN);
1223
+ break;
1224
+ }
1225
+
1226
+ case TacticalLines.LRO:
1227
+ case TacticalLines.UNDERCAST:
1228
+ case TacticalLines.LVO:
1229
+ case TacticalLines.RIDGE:
1230
+ //case TacticalLines.TROUGH:
1231
+ case TacticalLines.ICE_OPENINGS_LEAD:
1232
+ case TacticalLines.ICE_OPENINGS_LEAD_GE:
1233
+ case TacticalLines.ICE_OPENINGS_FROZEN:
1234
+ case TacticalLines.ICE_OPENINGS_FROZEN_GE:
1235
+ case TacticalLines.LEADING_LINE:
1236
+ case TacticalLines.STREAM:
1237
+ case TacticalLines.STREAM_GE:
1238
+ case TacticalLines.CRACKS:
1239
+ case TacticalLines.CRACKS_GE:
1240
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION:
1241
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION_GE:
1242
+ case TacticalLines.ISOBAR:
1243
+ case TacticalLines.ISOBAR_GE:
1244
+ case TacticalLines.UPPER_AIR:
1245
+ case TacticalLines.UPPER_AIR_GE:
1246
+ case TacticalLines.ICE_EDGE:
1247
+ case TacticalLines.ICE_EDGE_GE:
1248
+ case TacticalLines.ICE_EDGE_RADAR:
1249
+ case TacticalLines.ICE_EDGE_RADAR_GE:
1250
+ case TacticalLines.REEF: {
1251
+ tg.set_LineColor(Color.BLACK);
1252
+ break;
1253
+ }
1254
+
1255
+ case TacticalLines.INSTABILITY: {
1256
+ tg.set_LineStyle(4);
1257
+ tg.set_lineCap(BasicStroke.CAP_ROUND);
1258
+ tg.set_LineColor(Color.BLACK);
1259
+ break;
1260
+ }
1261
+
1262
+ case TacticalLines.SHEAR: {
1263
+ tg.set_LineStyle(3);
1264
+ tg.set_lineCap(BasicStroke.CAP_ROUND);
1265
+ tg.set_LineColor(Color.BLACK);
1266
+ break;
1267
+ }
1268
+
1269
+ case TacticalLines.ISOPLETHS:
1270
+ case TacticalLines.ISOPLETHS_GE:
1271
+ case TacticalLines.ISOTHERM:
1272
+ case TacticalLines.ISOTHERM_GE: {
1273
+ tg.set_LineStyle(1);
1274
+ tg.set_LineColor(Color.RED);
1275
+ break;
1276
+ }
1277
+
1278
+ case TacticalLines.ISOTACH:
1279
+ case TacticalLines.ISOTACH_GE: {
1280
+ tg.set_LineStyle(1);
1281
+ tg.set_LineColor(new Color(160, 32, 240));
1282
+ break;
1283
+ }
1284
+
1285
+ case TacticalLines.SAND: {
1286
+ tg.set_LineColor(new Color(165, 121, 82)); //brown
1287
+ break;
1288
+ }
1289
+
1290
+ case TacticalLines.ICING: {
1291
+ tg.set_LineColor(new Color(189, 154, 56)); //brown
1292
+ break;
1293
+ }
1294
+
1295
+ case TacticalLines.NON_CONVECTIVE: {
1296
+ tg.set_LineColor(Color.GREEN);
1297
+ break;
1298
+ }
1299
+
1300
+ case TacticalLines.CONVECTIVE: {
1301
+ tg.set_LineColor(Color.GREEN);
1302
+ tg.set_LineStyle(3);
1303
+ break;
1304
+ }
1305
+
1306
+ case TacticalLines.FOG: {
1307
+ tg.set_LineColor(Color.YELLOW);
1308
+ break;
1309
+ }
1310
+
1311
+ case TacticalLines.RAMP_ABOVE_WATER:
1312
+ case TacticalLines.RAMP_ABOVE_WATER_GE: {
1313
+ tg.set_LineColor(Color.BLACK);
1314
+ break;
1315
+ }
1316
+
1317
+ default: {
1318
+ break;
1319
+ }
1320
+
1321
+ }
1322
+ } catch (exc) {
1323
+ if (exc instanceof Error) {
1324
+ //clsUtility.WriteFile("Error in clsMETOC.SetMeTOCProperties");
1325
+ ErrorLogger.LogException(clsMETOC._className, "SetMeTOCProperties",
1326
+ new RendererException("Failed inside SetMeTOCProperties", exc));
1327
+ } else {
1328
+ throw exc;
1329
+ }
1330
+ }
1331
+ }
1332
+
1333
+ /**
1334
+ *
1335
+ * Rotates axis by theta for point and curve
1336
+ * Finds next closest point with same x position on the splinePoints curve as pt
1337
+ * walks up the curve and if it does not find a range that straddles x it return null.
1338
+ * We ultimately will draw a line from pt to the extrapolated point on the splinePoints spline.
1339
+ * used for ICE_OPENINGS_FROZEN_LEAD
1340
+ *
1341
+ * @param splinePoints - the points on the opposite spline
1342
+ * @param pt - the point in the original curve from which the line will start
1343
+ * @param theta angle of curve at pt. Perpendicular to new line to be drawn
1344
+ *
1345
+ * @return The extrapolated point on the opposite spline to which the line will be drawn
1346
+ */
1347
+ private static ExtrapolatePointFromCurve(splinePoints: Array<POINT2>,
1348
+ pt: POINT2, theta: double): POINT2 | null {
1349
+ try {
1350
+ // cos(theta) and sin(theta) only need to be calculated once
1351
+ let cosTheta: double = Math.cos(theta);
1352
+ let sinTheta: double = Math.sin(theta);
1353
+
1354
+ // p at the end of variable name represents "prime" and means it's a rotated coordinate
1355
+ let xp: double = pt.x * cosTheta + pt.y * sinTheta;
1356
+
1357
+ //if we find a pair which straddle xp then extrapolate the y value from the curve and
1358
+ //return the point
1359
+ for (let j: int = 0; j < splinePoints.length - 1; j++) {
1360
+ let x1p: double = splinePoints[j].x * cosTheta + splinePoints[j].y * sinTheta;
1361
+ let x2p: double = splinePoints[j + 1].x * cosTheta + splinePoints[j + 1].y * sinTheta;
1362
+ if ((x1p <= xp && x2p >= xp) || (x1p >= xp && x2p <= xp)) {
1363
+ let y1p: double = -splinePoints[j].x * sinTheta + splinePoints[j].y * cosTheta;
1364
+ let y2p: double = -splinePoints[j + 1].x * sinTheta + splinePoints[j + 1].y * cosTheta;
1365
+
1366
+ let mp: double = (y2p - y1p) / (x2p - x1p); // slope
1367
+ let yp: double = y1p + (xp - x1p) * mp;
1368
+
1369
+ // Rotate back to normal coordinates
1370
+ let x: double = xp * cosTheta - yp * sinTheta;
1371
+ let y: double = xp * sinTheta + yp * cosTheta;
1372
+ return new POINT2(x, y);
1373
+ }
1374
+ }
1375
+ } catch (exc) {
1376
+ if (exc instanceof Error) {
1377
+ ErrorLogger.LogException(clsMETOC._className, "ExtrapolatePointFromCurve",
1378
+ new RendererException("Failed inside ExtrapolatePointFromCurve", exc));
1379
+ } else {
1380
+ throw exc;
1381
+ }
1382
+ }
1383
+ return null;
1384
+ }
1385
+ /**
1386
+ * The public interface, main function to return METOC shapes
1387
+ * @param tg the tactical graphic
1388
+ * @param shapes the ShapeInfo array
1389
+ */
1390
+ public static GetMeTOCShape(tg: TGLight,
1391
+ shapes: Array<Shape2>): void {
1392
+ try {
1393
+ if (shapes == null) {
1394
+
1395
+ return;
1396
+ }
1397
+
1398
+ let lineObject: GeneralPath;
1399
+ let lineObject2: GeneralPath;
1400
+ let splinePoints: Array<POINT2> = new Array();
1401
+ let splinePoints2: Array<POINT2> = new Array();
1402
+ let d: double = 0;
1403
+ let j: int = 0;
1404
+ let k: int = 0;
1405
+ let l: int = 0;
1406
+ let shape: Shape2;
1407
+ let ptLast: POINT2 = tg.Pixels[tg.Pixels.length - 1];
1408
+ let twoSplines: Array<POINT2>;
1409
+ let upperSpline: Array<POINT2>;
1410
+ let lowerSpline: Array<POINT2>;
1411
+ let originalPixels: Array<POINT2>;
1412
+ let t: int = 0;
1413
+ let u: int = 0;
1414
+ let v: int = 0;
1415
+ let w: int = 0;
1416
+ let tt: int = 0;
1417
+ let uu: int = 0;
1418
+ let vv: int = 0;
1419
+ let ww: int = 0;
1420
+
1421
+ let pixels: Array<POINT2>;
1422
+ originalPixels = null;
1423
+ let partitions: Array<P1>;
1424
+ clsMETOC.SetMeTOCProperties(tg);
1425
+ switch (tg.get_LineType()) {
1426
+ case TacticalLines.SF:
1427
+ case TacticalLines.USF:
1428
+ case TacticalLines.SFG:
1429
+ case TacticalLines.SFY:
1430
+ case TacticalLines.WFY:
1431
+ case TacticalLines.WFG:
1432
+ case TacticalLines.WF:
1433
+ case TacticalLines.UWF:
1434
+ case TacticalLines.UCF:
1435
+ case TacticalLines.CF:
1436
+ case TacticalLines.CFG:
1437
+ case TacticalLines.CFY:
1438
+ case TacticalLines.OCCLUDED:
1439
+ case TacticalLines.UOF:
1440
+ case TacticalLines.OFY:
1441
+ case TacticalLines.TROUGH:
1442
+ case TacticalLines.UPPER_TROUGH:
1443
+ case TacticalLines.CABLE:
1444
+ case TacticalLines.INSTABILITY:
1445
+ case TacticalLines.SHEAR:
1446
+ case TacticalLines.RIDGE:
1447
+ case TacticalLines.SQUALL:
1448
+ case TacticalLines.ITC:
1449
+ case TacticalLines.CONVERGENCE:
1450
+ case TacticalLines.ITD:
1451
+ case TacticalLines.IFR:
1452
+ case TacticalLines.MVFR:
1453
+ case TacticalLines.TURBULENCE:
1454
+ case TacticalLines.ICING:
1455
+ case TacticalLines.NON_CONVECTIVE:
1456
+ case TacticalLines.CONVECTIVE:
1457
+ case TacticalLines.FROZEN:
1458
+ case TacticalLines.THUNDERSTORMS:
1459
+ case TacticalLines.FOG:
1460
+ case TacticalLines.SAND:
1461
+ case TacticalLines.FREEFORM:
1462
+ case TacticalLines.OPERATOR_FREEFORM:
1463
+ case TacticalLines.LVO:
1464
+ case TacticalLines.UNDERCAST:
1465
+ case TacticalLines.LRO:
1466
+ case TacticalLines.DEPTH_AREA:
1467
+ case TacticalLines.ISLAND:
1468
+ case TacticalLines.BEACH:
1469
+ case TacticalLines.WATER:
1470
+ case TacticalLines.FISH_TRAPS:
1471
+ case TacticalLines.SWEPT_AREA:
1472
+ case TacticalLines.OIL_RIG_FIELD:
1473
+ case TacticalLines.FOUL_GROUND:
1474
+ case TacticalLines.KELP:
1475
+ case TacticalLines.BEACH_SLOPE_MODERATE:
1476
+ case TacticalLines.BEACH_SLOPE_STEEP:
1477
+ case TacticalLines.ANCHORAGE_AREA:
1478
+ case TacticalLines.ANCHORAGE_LINE:
1479
+ case TacticalLines.PIPE:
1480
+ case TacticalLines.TRAINING_AREA:
1481
+ case TacticalLines.RESTRICTED_AREA:
1482
+ case TacticalLines.REEF:
1483
+ case TacticalLines.FORESHORE_AREA:
1484
+ case TacticalLines.FORESHORE_LINE:
1485
+ case TacticalLines.DRYDOCK:
1486
+ case TacticalLines.LOADING_FACILITY_LINE:
1487
+ case TacticalLines.LOADING_FACILITY_AREA:
1488
+ case TacticalLines.PERCHES:
1489
+ case TacticalLines.UNDERWATER_HAZARD:
1490
+ case TacticalLines.BREAKERS:
1491
+ case TacticalLines.DISCOLORED_WATER:
1492
+ case TacticalLines.BEACH_SLOPE_FLAT:
1493
+ case TacticalLines.BEACH_SLOPE_GENTLE:
1494
+ case TacticalLines.MARITIME_LIMIT:
1495
+ case TacticalLines.MARITIME_AREA:
1496
+ case TacticalLines.OPERATOR_DEFINED:
1497
+ case TacticalLines.SUBMERGED_CRIB:
1498
+ case TacticalLines.CANAL:
1499
+ case TacticalLines.VDR_LEVEL_12:
1500
+ case TacticalLines.VDR_LEVEL_23:
1501
+ case TacticalLines.VDR_LEVEL_34:
1502
+ case TacticalLines.VDR_LEVEL_45:
1503
+ case TacticalLines.VDR_LEVEL_56:
1504
+ case TacticalLines.VDR_LEVEL_67:
1505
+ case TacticalLines.VDR_LEVEL_78:
1506
+ case TacticalLines.VDR_LEVEL_89:
1507
+ case TacticalLines.VDR_LEVEL_910:
1508
+ case TacticalLines.SOLID_ROCK:
1509
+ case TacticalLines.CLAY:
1510
+ case TacticalLines.VERY_COARSE_SAND:
1511
+ case TacticalLines.COARSE_SAND:
1512
+ case TacticalLines.MEDIUM_SAND:
1513
+ case TacticalLines.FINE_SAND:
1514
+ case TacticalLines.VERY_FINE_SAND:
1515
+ case TacticalLines.VERY_FINE_SILT:
1516
+ case TacticalLines.FINE_SILT:
1517
+ case TacticalLines.MEDIUM_SILT:
1518
+ case TacticalLines.COARSE_SILT:
1519
+ case TacticalLines.BOULDERS:
1520
+ case TacticalLines.OYSTER_SHELLS:
1521
+ case TacticalLines.PEBBLES:
1522
+ case TacticalLines.SAND_AND_SHELLS:
1523
+ case TacticalLines.BOTTOM_SEDIMENTS_LAND:
1524
+ case TacticalLines.BOTTOM_SEDIMENTS_NO_DATA:
1525
+ case TacticalLines.BOTTOM_ROUGHNESS_SMOOTH:
1526
+ case TacticalLines.BOTTOM_ROUGHNESS_MODERATE:
1527
+ case TacticalLines.BOTTOM_ROUGHNESS_ROUGH:
1528
+ case TacticalLines.CLUTTER_LOW:
1529
+ case TacticalLines.CLUTTER_MEDIUM:
1530
+ case TacticalLines.CLUTTER_HIGH:
1531
+ case TacticalLines.IMPACT_BURIAL_0:
1532
+ case TacticalLines.IMPACT_BURIAL_10:
1533
+ case TacticalLines.IMPACT_BURIAL_20:
1534
+ case TacticalLines.IMPACT_BURIAL_75:
1535
+ case TacticalLines.IMPACT_BURIAL_100:
1536
+ case TacticalLines.BOTTOM_CATEGORY_A:
1537
+ case TacticalLines.BOTTOM_CATEGORY_B:
1538
+ case TacticalLines.BOTTOM_CATEGORY_C:
1539
+ case TacticalLines.BOTTOM_TYPE_A1:
1540
+ case TacticalLines.BOTTOM_TYPE_A2:
1541
+ case TacticalLines.BOTTOM_TYPE_A3:
1542
+ case TacticalLines.BOTTOM_TYPE_B1:
1543
+ case TacticalLines.BOTTOM_TYPE_B2:
1544
+ case TacticalLines.BOTTOM_TYPE_B3:
1545
+ case TacticalLines.BOTTOM_TYPE_C1:
1546
+ case TacticalLines.BOTTOM_TYPE_C2:
1547
+ case TacticalLines.BOTTOM_TYPE_C3: {
1548
+ arraysupport.GetLineArray2(tg, tg.Pixels, shapes, null, null);
1549
+ break;
1550
+ }
1551
+
1552
+ case TacticalLines.ISOBAR:
1553
+ case TacticalLines.ISOBAR_GE:
1554
+ case TacticalLines.UPPER_AIR:
1555
+ case TacticalLines.UPPER_AIR_GE:
1556
+ case TacticalLines.ISOTHERM:
1557
+ case TacticalLines.ISOTHERM_GE:
1558
+ case TacticalLines.ISOTACH:
1559
+ case TacticalLines.ISOTACH_GE:
1560
+ case TacticalLines.ISODROSOTHERM:
1561
+ case TacticalLines.ISODROSOTHERM_GE:
1562
+ case TacticalLines.ISOPLETHS:
1563
+ case TacticalLines.ISOPLETHS_GE:
1564
+ case TacticalLines.ICE_EDGE:
1565
+ case TacticalLines.ICE_EDGE_GE:
1566
+ case TacticalLines.ESTIMATED_ICE_EDGE:
1567
+ case TacticalLines.ESTIMATED_ICE_EDGE_GE:
1568
+ case TacticalLines.CRACKS:
1569
+ case TacticalLines.CRACKS_GE:
1570
+ case TacticalLines.DEPTH_CURVE:
1571
+ case TacticalLines.DEPTH_CURVE_GE:
1572
+ case TacticalLines.DEPTH_CONTOUR:
1573
+ case TacticalLines.DEPTH_CONTOUR_GE:
1574
+ case TacticalLines.COASTLINE:
1575
+ case TacticalLines.COASTLINE_GE:
1576
+ case TacticalLines.PIER:
1577
+ case TacticalLines.PIER_GE:
1578
+ case TacticalLines.RAMP_ABOVE_WATER:
1579
+ case TacticalLines.RAMP_ABOVE_WATER_GE:
1580
+ case TacticalLines.RAMP_BELOW_WATER:
1581
+ case TacticalLines.RAMP_BELOW_WATER_GE:
1582
+ case TacticalLines.JETTY_ABOVE_WATER:
1583
+ case TacticalLines.JETTY_ABOVE_WATER_GE:
1584
+ case TacticalLines.JETTY_BELOW_WATER:
1585
+ case TacticalLines.JETTY_BELOW_WATER_GE:
1586
+ case TacticalLines.SEAWALL:
1587
+ case TacticalLines.SEAWALL_GE:
1588
+ case TacticalLines.EBB_TIDE:
1589
+ case TacticalLines.FLOOD_TIDE:
1590
+ case TacticalLines.EBB_TIDE_GE:
1591
+ case TacticalLines.FLOOD_TIDE_GE:
1592
+ case TacticalLines.JET:
1593
+ case TacticalLines.STREAM:
1594
+ case TacticalLines.JET_GE:
1595
+ case TacticalLines.STREAM_GE: {
1596
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1597
+ lineObject2.lineTo(ptLast.x, ptLast.y);
1598
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1599
+ shape.setShape(lineObject2);
1600
+ shapes.push(shape);
1601
+ break;
1602
+ }
1603
+
1604
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION:
1605
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION_GE:
1606
+ case TacticalLines.ICE_EDGE_RADAR:
1607
+ case TacticalLines.ICE_EDGE_RADAR_GE: {
1608
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1609
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1610
+ shape.setShape(lineObject2);
1611
+ shapes.push(shape);
1612
+ break;
1613
+ }
1614
+
1615
+ case TacticalLines.ICE_OPENINGS_LEAD: {
1616
+ originalPixels = tg.Pixels;
1617
+ partitions = clsChannelUtility.GetPartitions2(tg);
1618
+ v = partitions.length;
1619
+ //for(l=0;l<partitions.length;l++)
1620
+ for (l = 0; l < v; l++) {
1621
+ tg.Pixels = originalPixels;
1622
+ pixels = new Array();
1623
+ for (k = partitions[l].start; k <= partitions[l].end_Renamed + 1; k++) {
1624
+
1625
+ pixels.push(tg.Pixels[k]);
1626
+ }
1627
+
1628
+
1629
+ if (pixels == null || pixels.length === 0) {
1630
+
1631
+ continue;
1632
+ }
1633
+
1634
+
1635
+ twoSplines = new Array();
1636
+ twoSplines = clsMETOC.ParallelLines2(pixels, arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale()) as int);
1637
+
1638
+ upperSpline = new Array();
1639
+ lowerSpline = new Array();
1640
+ w = twoSplines.length;
1641
+ //for (j = 0; j < twoSplines.length / 2; j++)
1642
+ for (j = 0; j < w / 2; j++) {
1643
+ upperSpline.push(twoSplines[j]);
1644
+ }
1645
+
1646
+ //for (j = twoSplines.length / 2; j < twoSplines.length; j++)
1647
+ for (j = w / 2; j < w; j++) {
1648
+ lowerSpline.push(twoSplines[j]);
1649
+ }
1650
+
1651
+ tg.Pixels = lowerSpline;
1652
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1653
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1654
+ shape.setShape(lineObject2);
1655
+ shapes.push(shape);
1656
+
1657
+ tg.Pixels = upperSpline;
1658
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1659
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1660
+ shape.setShape(lineObject2);
1661
+ shapes.push(shape);
1662
+ }
1663
+ break;
1664
+ }
1665
+
1666
+ case TacticalLines.ICE_OPENINGS_LEAD_GE: {
1667
+ originalPixels = tg.Pixels;
1668
+ partitions = clsChannelUtility.GetPartitions2(tg);
1669
+ t = partitions.length;
1670
+ //for(l=0;l<partitions.length;l++)
1671
+ for (l = 0; l < t; l++) {
1672
+ tg.Pixels = originalPixels;
1673
+ pixels = new Array();
1674
+ for (k = partitions[l].start; k <= partitions[l].end_Renamed + 1; k++) {
1675
+
1676
+ pixels.push(tg.Pixels[k]);
1677
+ }
1678
+
1679
+
1680
+ if (pixels == null || pixels.length === 0) {
1681
+
1682
+ continue;
1683
+ }
1684
+
1685
+
1686
+ twoSplines = new Array();
1687
+ twoSplines = clsMETOC.ParallelLines2(pixels, arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale()) as int);
1688
+
1689
+ upperSpline = new Array();
1690
+ lowerSpline = new Array();
1691
+ u = twoSplines.length;
1692
+ //for (j = 0; j < twoSplines.length / 2; j++)
1693
+ for (j = 0; j < u / 2; j++) {
1694
+ upperSpline.push(twoSplines[j]);
1695
+ }
1696
+
1697
+ //for (j = twoSplines.length / 2; j < twoSplines.length; j++)
1698
+ for (j = u / 2; j < u; j++) {
1699
+ lowerSpline.push(twoSplines[j]);
1700
+ }
1701
+
1702
+ tg.Pixels = lowerSpline;
1703
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1704
+ ptLast = tg.Pixels[tg.Pixels.length - 1];
1705
+ lineObject2.lineTo(ptLast.x, ptLast.y);
1706
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1707
+ shape.setShape(lineObject2);
1708
+ shapes.push(shape);
1709
+
1710
+ tg.Pixels = upperSpline;
1711
+ splinePoints = new Array();
1712
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1713
+ ptLast = tg.Pixels[tg.Pixels.length - 1];
1714
+ lineObject2.lineTo(ptLast.x, ptLast.y);
1715
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1716
+ shape.setShape(lineObject2);
1717
+ shapes.push(shape);
1718
+ }
1719
+ break;
1720
+ }
1721
+
1722
+ case TacticalLines.ICE_OPENINGS_FROZEN:
1723
+ case TacticalLines.ICE_OPENINGS_FROZEN_GE: {
1724
+ originalPixels = tg.Pixels;
1725
+ partitions = clsChannelUtility.GetPartitions2(tg);
1726
+ t = partitions.length;
1727
+ //for(l=0;l<partitions.length;l++)
1728
+ for (l = 0; l < t; l++) {
1729
+ tg.Pixels = originalPixels;
1730
+ pixels = new Array();
1731
+ for (k = partitions[l].start; k <= partitions[l].end_Renamed + 1; k++) {
1732
+
1733
+ pixels.push(tg.Pixels[k]);
1734
+ }
1735
+
1736
+
1737
+ if (pixels.length === 0) {
1738
+
1739
+ continue;
1740
+ }
1741
+
1742
+
1743
+ twoSplines = clsMETOC.ParallelLines2(pixels, arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale()) as int);
1744
+ upperSpline = new Array();
1745
+ lowerSpline = new Array();
1746
+ u = twoSplines.length;
1747
+ //for (j = 0; j < twoSplines.length / 2; j++)
1748
+ for (j = 0; j < u / 2; j++) {
1749
+ upperSpline.push(twoSplines[j]);
1750
+ }
1751
+
1752
+ //for (j = twoSplines.length / 2; j < twoSplines.length; j++)
1753
+ for (j = u / 2; j < u; j++) {
1754
+ lowerSpline.push(twoSplines[j]);
1755
+ }
1756
+
1757
+ tg.Pixels = lowerSpline;
1758
+ if (tg.get_LineType() === TacticalLines.ICE_OPENINGS_FROZEN) {
1759
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints);
1760
+ } else {
1761
+ let splinePoints3: Array<POINT2> = new Array();
1762
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints3);
1763
+ splinePoints.push(...splinePoints3);
1764
+ ptLast = tg.Pixels[tg.Pixels.length - 1];
1765
+ lineObject2.lineTo(ptLast.x, ptLast.y);
1766
+ }
1767
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1768
+ shape.setShape(lineObject2);
1769
+ shapes.push(shape);
1770
+
1771
+ tg.Pixels = upperSpline;
1772
+ if (tg.get_LineType() === TacticalLines.ICE_OPENINGS_FROZEN) {
1773
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints2);
1774
+ } else {
1775
+ let splinePoints4: Array<POINT2> = new Array();
1776
+ lineObject2 = clsMETOC.DrawSplines(tg, splinePoints4);
1777
+ splinePoints2.push(...splinePoints4);
1778
+ ptLast = tg.Pixels[tg.Pixels.length - 1];
1779
+ lineObject2.lineTo(ptLast.x, ptLast.y);
1780
+ }
1781
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1782
+ shape.setShape(lineObject2);
1783
+ shapes.push(shape);
1784
+
1785
+ //parse upper and lower arrays to find the corresponding splines
1786
+ let splinePointsArrays: Array<Array<POINT2>> = new Array();
1787
+ let splinePoints2Arrays: Array<Array<POINT2>> = new Array();
1788
+ let ptsArray: Array<POINT2> = new Array();
1789
+ for (j = 0; j < splinePoints.length; j++) {
1790
+ if (splinePoints[j].style !== 47) {
1791
+ ptsArray.push(splinePoints[j]);
1792
+ } else {
1793
+ splinePointsArrays.push(ptsArray);
1794
+ ptsArray = new Array();
1795
+ }
1796
+ }
1797
+ for (j = 0; j < splinePoints2.length; j++) {
1798
+ if (splinePoints2[j].style !== 47) {
1799
+ ptsArray.push(splinePoints2[j]);
1800
+ } else {
1801
+ splinePoints2Arrays.push(ptsArray);
1802
+ ptsArray = new Array();
1803
+ }
1804
+ }
1805
+
1806
+ lineObject = new GeneralPath();
1807
+ for (j = 0; j < splinePointsArrays.length; j++) {
1808
+ //the lines to connect the extrapolated points
1809
+ let array: Array<POINT2>;
1810
+ let array2: Array<POINT2>;
1811
+ if (splinePoints2Arrays.length <= j) {
1812
+
1813
+ break;
1814
+ }
1815
+
1816
+ if (splinePointsArrays.length >= splinePoints2Arrays.length) {
1817
+ array = splinePointsArrays[j];
1818
+ array2 = splinePoints2Arrays[j];
1819
+ } else {
1820
+ array = splinePoints2Arrays[j];
1821
+ array2 = splinePointsArrays[j];
1822
+ }
1823
+ //extrapolate against points in the shortest array
1824
+ for (k = 0; k < array.length; k++) {
1825
+ let theta: double = 0;
1826
+ if (array.length === 1) {
1827
+ // Unable to find slope
1828
+ continue;
1829
+ }
1830
+
1831
+ else {
1832
+ if (k === 0) {
1833
+
1834
+ theta = Math.atan2(array[k + 1].y - array[k].y, array[k + 1].x - array[k].x);
1835
+ }
1836
+
1837
+ else {
1838
+ if (k === array.length - 1) {
1839
+
1840
+ theta = Math.atan2(array[k].y - array[k - 1].y, array[k].x - array[k - 1].x);
1841
+ }
1842
+
1843
+ else {
1844
+
1845
+ theta = Math.atan2(array[k + 1].y - array[k - 1].y, array[k + 1].x - array[k - 1].x);
1846
+ }
1847
+
1848
+ }
1849
+
1850
+ }
1851
+
1852
+
1853
+ let pt: POINT2 = array[k];
1854
+ let pt2: POINT2 = clsMETOC.ExtrapolatePointFromCurve(array2, pt, theta);
1855
+ //if we got a valid extrapolation point then draw the line
1856
+ if (pt2 != null) {
1857
+ lineObject.moveTo(pt.x, pt.y);
1858
+ lineObject.lineTo(pt2.x, pt2.y);
1859
+ }
1860
+ }
1861
+ }
1862
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1863
+ shape.setShape(lineObject);
1864
+ shapes.push(shape);
1865
+ }
1866
+ break;
1867
+ }
1868
+
1869
+ case TacticalLines.LEADING_LINE: {
1870
+ //the solid line
1871
+ lineObject = clsMETOC.DrawSplines(tg, splinePoints);
1872
+ lineObject2 = new GeneralPath();
1873
+ if (splinePoints.length > 0) {
1874
+
1875
+ lineObject2.moveTo(splinePoints[0].x, splinePoints[0].y);
1876
+ }
1877
+
1878
+ else {
1879
+ lineObject2.moveTo(tg.Pixels[0].x, tg.Pixels[0].y);
1880
+ t = tg.Pixels.length;
1881
+ //for(j=0;j<tg.Pixels.length;j++)
1882
+ for (j = 0; j < t; j++) {
1883
+
1884
+ lineObject2.lineTo(tg.Pixels[j].x, tg.Pixels[j].y);
1885
+ }
1886
+
1887
+
1888
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1889
+ shape.setShape(lineObject2);
1890
+ shape.set_Style(1);
1891
+ shapes.push(shape);
1892
+ return;
1893
+ }
1894
+
1895
+ let n: int = splinePoints.length / 2;
1896
+ for (j = 1; j <= n; j++) {
1897
+ if (splinePoints.length >= j - 1) {
1898
+
1899
+ lineObject2.lineTo(splinePoints[j].x, splinePoints[j].y);
1900
+ }
1901
+
1902
+ }
1903
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1904
+ shape.setShape(lineObject2);
1905
+ shapes.push(shape);
1906
+
1907
+ //the dashed line
1908
+ lineObject2 = new GeneralPath();
1909
+ lineObject2.moveTo(splinePoints[n].x, splinePoints[n].y);
1910
+ u = splinePoints.length;
1911
+ //for (j = n + 1; j < splinePoints.length; j++)
1912
+ for (j = n + 1; j < u; j++) {
1913
+ if (splinePoints.length >= j - 1) {
1914
+
1915
+ lineObject2.lineTo(splinePoints[j].x, splinePoints[j].y);
1916
+ }
1917
+
1918
+ }
1919
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1920
+ shape.setShape(lineObject2);
1921
+ shape.set_Style(1);
1922
+ shapes.push(shape);
1923
+ break;
1924
+ }
1925
+
1926
+ default: {
1927
+ break;
1928
+ }
1929
+
1930
+ }
1931
+ //add the last point
1932
+ if (tg.get_LineType() !== TacticalLines.ICE_OPENINGS_LEAD &&
1933
+ tg.get_LineType() !== TacticalLines.ICE_OPENINGS_LEAD_GE &&
1934
+ tg.get_LineType() !== TacticalLines.ICE_OPENINGS_FROZEN &&
1935
+ tg.get_LineType() !== TacticalLines.ICE_OPENINGS_FROZEN_GE &&
1936
+ tg.get_LineType() !== TacticalLines.ICE_EDGE_RADAR) {
1937
+ if (splinePoints != null && splinePoints.length > 0) {
1938
+ lineObject2 = new GeneralPath();
1939
+ lineObject2.moveTo(splinePoints[splinePoints.length - 1].x, splinePoints[splinePoints.length - 1].y);
1940
+ lineObject2.lineTo(ptLast.x, ptLast.y);
1941
+ shape = new Shape2(Shape2.SHAPE_TYPE_POLYLINE);
1942
+ shape.setShape(lineObject2);
1943
+ shape.set_Style(0);
1944
+ shapes.push(shape);
1945
+ }
1946
+ }
1947
+ clsMETOC.SetShapeProperties(tg, shapes);
1948
+ } catch (exc) {
1949
+ if (exc instanceof Error) {
1950
+ ErrorLogger.LogException(clsMETOC._className, "GetMeTOCShape",
1951
+ new RendererException("Failed inside GetMeTOCShape", exc));
1952
+ } else {
1953
+ throw exc;
1954
+ }
1955
+ }
1956
+ }
1957
+ /**
1958
+ * Sets the shape properties based on the tacttical graphic properties and also based on shape
1959
+ * styles which may have been set by JavaLineArray
1960
+ * @param tg
1961
+ * @param shapes shapes array to set properties
1962
+ */
1963
+ protected static async SetShapeProperties(tg: TGLight, shapes: Array<Shape2>): Promise<void> {
1964
+ try {
1965
+ if (shapes == null) {
1966
+ return;
1967
+ }
1968
+ switch (tg.get_LineType()) {
1969
+ case TacticalLines.DEPTH_AREA: {
1970
+ return;
1971
+ }
1972
+
1973
+ default: {
1974
+ break;
1975
+ }
1976
+
1977
+ }
1978
+
1979
+ let j: int = 0;
1980
+ let n: int = 0;
1981
+ let shape: Shape2;
1982
+ let stroke: BasicStroke;
1983
+ let patternFill: SVGSymbolInfo;
1984
+ let lineThickness: int = tg.get_LineThickness();
1985
+ let rect: Rectangle2D;
1986
+ let tp: TexturePaint = tg.get_TexturePaint();
1987
+ switch (tg.get_LineType()) {
1988
+ case TacticalLines.FISH_TRAPS:
1989
+ case TacticalLines.SWEPT_AREA:
1990
+ case TacticalLines.OIL_RIG_FIELD:
1991
+ case TacticalLines.FOUL_GROUND:
1992
+ case TacticalLines.KELP:
1993
+ case TacticalLines.BEACH_SLOPE_MODERATE:
1994
+ case TacticalLines.BEACH_SLOPE_STEEP: {
1995
+ patternFill = PatternFillRenderer.MakeMetocPatternFill(tg);
1996
+ shape = shapes[0];
1997
+ shape.setLineColor(tg.get_LineColor());
1998
+ shape.setPatternFillImage(patternFill);
1999
+ break;
2000
+ }
2001
+
2002
+ case TacticalLines.SF:
2003
+ case TacticalLines.USF:
2004
+ case TacticalLines.SFG:
2005
+ case TacticalLines.SFY: {
2006
+ n = shapes.length;
2007
+ //for (j = 0; j < shapes.length; j++)
2008
+ for (j = 0; j < n; j++) {
2009
+ shape = shapes[j];
2010
+ if (shape == null || shape.getShape() == null) {
2011
+ continue;
2012
+ }
2013
+
2014
+ shape.set_Style(tg.get_LineStyle());
2015
+ stroke = clsUtility.getLineStroke(lineThickness, shape.get_Style(), tg.get_lineCap(), BasicStroke.JOIN_ROUND);
2016
+ shape.setStroke(stroke);
2017
+ }
2018
+ return;
2019
+ }
2020
+
2021
+ default: {
2022
+ break;
2023
+ }
2024
+
2025
+ }
2026
+
2027
+ let shapeType: int = -1;
2028
+ let lineType: int = tg.get_LineType();
2029
+ let isChange1Area: boolean = clsUtility.IsChange1Area(lineType);
2030
+ let isClosedPolygon: boolean = clsUtility.isClosedPolygon(lineType);
2031
+ n = shapes.length;
2032
+ //for (j = 0; j < shapes.length; j++)
2033
+ for (j = 0; j < n; j++) {
2034
+ shape = shapes[j];
2035
+ if (shape == null || shape.getShape() == null) {
2036
+ continue;
2037
+ }
2038
+
2039
+ if (shape.getShapeType() === Shape2.SHAPE_TYPE_FILL) {
2040
+ shape.setFillColor(tg.get_FillColor());
2041
+ }
2042
+
2043
+ //clsUtility.ResolveModifierShape(tg,shape);
2044
+
2045
+ shapeType = shape.getShapeType();
2046
+ switch (tg.get_LineType()) {
2047
+ case TacticalLines.SF:
2048
+ case TacticalLines.USF:
2049
+ case TacticalLines.SFG:
2050
+ case TacticalLines.SFY:
2051
+ case TacticalLines.ITD: {
2052
+ break;
2053
+ }
2054
+
2055
+ case TacticalLines.LEADING_LINE:
2056
+ case TacticalLines.TRAINING_AREA: {
2057
+ shape.setLineColor(tg.get_LineColor());
2058
+ break;
2059
+ }
2060
+
2061
+ default: {
2062
+ shape.setLineColor(tg.get_LineColor());
2063
+ shape.set_Style(tg.get_LineStyle());
2064
+ break;
2065
+ }
2066
+
2067
+ }
2068
+
2069
+ if (isClosedPolygon || shapeType === Shape2.SHAPE_TYPE_FILL) {
2070
+ switch (tg.get_LineType())//these have fill instead of TexturePaint
2071
+ {
2072
+ case TacticalLines.FORESHORE_AREA:
2073
+ case TacticalLines.WATER:
2074
+ case TacticalLines.BEACH:
2075
+ case TacticalLines.ISLAND:
2076
+ case TacticalLines.DRYDOCK:
2077
+ case TacticalLines.LOADING_FACILITY_AREA:
2078
+ case TacticalLines.PERCHES:
2079
+ case TacticalLines.UNDERWATER_HAZARD:
2080
+ case TacticalLines.DISCOLORED_WATER:
2081
+ case TacticalLines.VDR_LEVEL_12:
2082
+ case TacticalLines.VDR_LEVEL_23:
2083
+ case TacticalLines.VDR_LEVEL_34:
2084
+ case TacticalLines.VDR_LEVEL_45:
2085
+ case TacticalLines.VDR_LEVEL_56:
2086
+ case TacticalLines.VDR_LEVEL_67:
2087
+ case TacticalLines.VDR_LEVEL_78:
2088
+ case TacticalLines.VDR_LEVEL_89:
2089
+ case TacticalLines.VDR_LEVEL_910:
2090
+ case TacticalLines.SOLID_ROCK:
2091
+ case TacticalLines.CLAY:
2092
+ case TacticalLines.FINE_SAND:
2093
+ case TacticalLines.MEDIUM_SAND:
2094
+ case TacticalLines.COARSE_SAND:
2095
+ case TacticalLines.VERY_COARSE_SAND:
2096
+ case TacticalLines.VERY_FINE_SAND:
2097
+ case TacticalLines.VERY_FINE_SILT:
2098
+ case TacticalLines.FINE_SILT:
2099
+ case TacticalLines.MEDIUM_SILT:
2100
+ case TacticalLines.COARSE_SILT:
2101
+ case TacticalLines.BOULDERS:
2102
+ case TacticalLines.OYSTER_SHELLS:
2103
+ case TacticalLines.PEBBLES:
2104
+ case TacticalLines.SAND_AND_SHELLS:
2105
+ case TacticalLines.BOTTOM_SEDIMENTS_LAND:
2106
+ case TacticalLines.BOTTOM_SEDIMENTS_NO_DATA:
2107
+ case TacticalLines.BOTTOM_ROUGHNESS_MODERATE:
2108
+ case TacticalLines.BOTTOM_ROUGHNESS_ROUGH:
2109
+ case TacticalLines.BOTTOM_ROUGHNESS_SMOOTH:
2110
+ case TacticalLines.CLUTTER_HIGH:
2111
+ case TacticalLines.CLUTTER_MEDIUM:
2112
+ case TacticalLines.CLUTTER_LOW:
2113
+ case TacticalLines.IMPACT_BURIAL_0:
2114
+ case TacticalLines.IMPACT_BURIAL_10:
2115
+ case TacticalLines.IMPACT_BURIAL_100:
2116
+ case TacticalLines.IMPACT_BURIAL_20:
2117
+ case TacticalLines.IMPACT_BURIAL_75:
2118
+ case TacticalLines.BOTTOM_CATEGORY_A:
2119
+ case TacticalLines.BOTTOM_CATEGORY_B:
2120
+ case TacticalLines.BOTTOM_CATEGORY_C:
2121
+ case TacticalLines.BOTTOM_TYPE_A1:
2122
+ case TacticalLines.BOTTOM_TYPE_A2:
2123
+ case TacticalLines.BOTTOM_TYPE_A3:
2124
+ case TacticalLines.BOTTOM_TYPE_B1:
2125
+ case TacticalLines.BOTTOM_TYPE_B2:
2126
+ case TacticalLines.BOTTOM_TYPE_B3:
2127
+ case TacticalLines.BOTTOM_TYPE_C1:
2128
+ case TacticalLines.BOTTOM_TYPE_C2:
2129
+ case TacticalLines.BOTTOM_TYPE_C3:
2130
+ case TacticalLines.SUBMERGED_CRIB:
2131
+ case TacticalLines.FREEFORM: {
2132
+ shape.setFillColor(tg.get_FillColor());
2133
+ break;
2134
+ }
2135
+
2136
+ default: {
2137
+ break;
2138
+ }
2139
+
2140
+ }
2141
+ }
2142
+
2143
+ if (lineType === TacticalLines.INSTABILITY || lineType === TacticalLines.SHEAR) {
2144
+ // Calculate dash array for instability and shear so that dots are on peak of curves
2145
+ let dotLength: double = 1;
2146
+ let spacing: double = lineThickness * 2;
2147
+
2148
+ let points: Array<POINT2> = shape.getPoints();
2149
+
2150
+ let arcLength: double = 0;
2151
+ for (let i: int = 0; i < 6; i++) { // 6 segments in each arc
2152
+ arcLength += lineutility.CalcDistanceDouble(points[i], points[i + 1]) as double;
2153
+ }
2154
+
2155
+ // For very large line thicknesses get a reasonable spacing
2156
+ // Helps avoid calculating negative dashLength if spacing is longer than arc
2157
+ spacing = Math.min(spacing, arcLength / 5);
2158
+
2159
+ // dashLength is space remaining in arc after adding dots and spacing.
2160
+ // Divide remaining space by two because there's a dash on both sides of the dots
2161
+ let dash: number[];
2162
+ if (lineType === TacticalLines.INSTABILITY) {
2163
+ let dotAndSpaceLength: double = dotLength * 2 + spacing * 3;
2164
+ let dashLength: double = (arcLength - dotAndSpaceLength) / 2;
2165
+ dash = [dashLength, spacing, dotLength, spacing, dotLength, spacing, dashLength, 0];
2166
+ } else { // SHEAR
2167
+ let dotAndSpaceLength: double = dotLength + spacing * 2;
2168
+ let dashLength: double = (arcLength - dotAndSpaceLength) / 2;
2169
+ dash = [dashLength, spacing, dotLength, spacing, dashLength, 0];
2170
+ }
2171
+ stroke = new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 4, dash, 0);
2172
+ } else {
2173
+ if (lineType === TacticalLines.TROUGH) {
2174
+ // The dashed lines look odd when longer than the arc length. This will set a max length for dashes relative to the arc length.
2175
+ let points: Array<POINT2> = shape.getPoints();
2176
+
2177
+ let arcLength: double = 0;
2178
+ for (let i: int = 0; i < 6; i++) { // 6 segments in each arc
2179
+ arcLength += lineutility.CalcDistanceDouble(points[i], points[i + 1]) as double;
2180
+ }
2181
+
2182
+ let dashLength: double = 2 * lineThickness; // from clsUtility.getLineStroke
2183
+
2184
+ dashLength = Math.min(dashLength, arcLength / 4);
2185
+
2186
+ let dash: number[] = [dashLength, dashLength];
2187
+ stroke = new BasicStroke(lineThickness, tg.get_lineCap(), BasicStroke.JOIN_ROUND, 4, dash, 0);
2188
+ } else {
2189
+ stroke = clsUtility.getLineStroke(lineThickness, shape.get_Style(), tg.get_lineCap(), BasicStroke.JOIN_ROUND);
2190
+ }
2191
+ }
2192
+
2193
+ shape.setStroke(stroke);
2194
+ }
2195
+ } catch (exc) {
2196
+ if (exc instanceof Error) {
2197
+ //clsUtility.WriteFile("error in clsMETOC.SetShapeProperties");
2198
+ ErrorLogger.LogException(clsMETOC._className, "SetShapeProperties",
2199
+ new RendererException("Failed inside SetShapeProperties", exc));
2200
+ } else {
2201
+ throw exc;
2202
+ }
2203
+ }
2204
+ }
2205
+
2206
+ /**
2207
+ * Draws an arrow to the GeneralPath object from pt1 to pt2.
2208
+ *
2209
+ * @param pt1 arrow tip
2210
+ * @param pt2 - arrow base
2211
+ * @param size - arrow size in pixels
2212
+ * @param lineObject - general path to draw the arrow
2213
+ *
2214
+ * @return arrow sprite
2215
+ */
2216
+ private static DrawArrow(pt1: POINT2,
2217
+ pt2: POINT2,
2218
+ size: double,
2219
+ lineObject: GeneralPath): void {
2220
+ try {
2221
+ let ptBase: POINT2 = new POINT2();
2222
+ let ptTemp: POINT2 = new POINT2();
2223
+ let pts: Array<POINT2> = new Array();
2224
+ ptBase = lineutility.ExtendAlongLineDouble(pt2, pt1, size);
2225
+ ptTemp = lineutility.ExtendDirectedLine(pt1, ptBase, ptBase, 2, size);
2226
+
2227
+ pts.push(ptTemp);
2228
+ pts.push(pt2);
2229
+ ptTemp = lineutility.ExtendDirectedLine(pt1, ptBase, ptBase, 3, size);
2230
+ pts.push(ptTemp);
2231
+ lineObject.moveTo(pts[0].x, pts[0].y);
2232
+ lineObject.lineTo(pts[1].x, pts[1].y);
2233
+ lineObject.lineTo(pts[2].x, pts[2].y);
2234
+ pts.length = 0; // pts.clear()
2235
+ pts = null;
2236
+ } catch (exc) {
2237
+ if (exc instanceof Error) {
2238
+ ErrorLogger.LogException(clsMETOC._className, "DrawArrow",
2239
+ new RendererException("Failed inside DrawArrow", exc));
2240
+ } else {
2241
+ throw exc;
2242
+ }
2243
+ }
2244
+ }
2245
+ /**
2246
+ * Returns a GeneralPath for symbols which require splines. Also returns the calculated
2247
+ * spline points for those symbols with additional features based on them.
2248
+ * @param tg
2249
+ * @param splinePoints2 spline points in pixels
2250
+ * @return
2251
+ */
2252
+ private static DrawSplines(tg: TGLight,
2253
+ splinePoints2: Array<POINT2>): GeneralPath {
2254
+ let lineObject: GeneralPath = new GeneralPath();
2255
+ try {
2256
+ let i: int = 0;
2257
+ let j: int = 0;
2258
+ let n: int = 0;
2259
+ let t: int = 0;
2260
+ let splinePoints: Array<POINT2>;
2261
+ let array: Array<POINT2> = tg.get_Pixels();
2262
+ let pt0: POINT2 = new POINT2();
2263
+ let pt1: POINT2 = new POINT2();
2264
+ let pt2: POINT2 = new POINT2();
2265
+ let pt3: POINT2 = new POINT2();
2266
+ let
2267
+ pt4: POINT2 = new POINT2();
2268
+ let pt5: POINT2 = new POINT2();
2269
+ let pt6: POINT2 = new POINT2();
2270
+ let pt: POINT2;
2271
+ let pt_before: POINT2;
2272
+ let pt_after: POINT2;
2273
+ let Di: POINT2;
2274
+ let p2: POINT2;
2275
+ let p3: POINT2;
2276
+ let pt_after2: POINT2;
2277
+ let tension: double = 0.33;
2278
+ let control_scale: double = (tension / 0.5 * 0.175);
2279
+ let d: double = 0;
2280
+ let tmpArray: Array<POINT2>;
2281
+ n = array.length;
2282
+ //for (i = 0; i < array.length - 1; i++) //was length-1
2283
+ for (i = 0; i < n - 1; i++) //was length-1
2284
+ {
2285
+ pt = array[i];
2286
+ if (i === 0) {
2287
+ lineObject.moveTo(pt.x, pt.y);
2288
+ pt_before = pt;
2289
+ } else {
2290
+ pt_before = array[i - 1];
2291
+ }
2292
+
2293
+ if (i === array.length - 1) {
2294
+ pt2 = array[i];
2295
+ } else {
2296
+ pt2 = array[i + 1];
2297
+ }
2298
+
2299
+ if (i < array.length - 2) {
2300
+ pt_after = array[i + 1];
2301
+ } else {
2302
+ pt_after = array[array.length - 1];
2303
+ }
2304
+
2305
+ if (i < array.length - 2) {
2306
+ pt_after2 = array[i + 2];
2307
+ } else {
2308
+ pt_after2 = array[array.length - 1];
2309
+ }
2310
+
2311
+
2312
+ Di = new POINT2();
2313
+ p2 = new POINT2();
2314
+
2315
+ Di.x = pt_after.x - pt_before.x;
2316
+ Di.y = pt_after.y - pt_before.y;
2317
+ p2.x = pt.x + control_scale * Di.x;
2318
+ p2.y = pt.y + control_scale * Di.y;
2319
+
2320
+ p3 = new POINT2();
2321
+ let DiPlus1: POINT2 = new POINT2();
2322
+
2323
+ DiPlus1.x = pt_after2.x - pt.x;
2324
+ DiPlus1.y = pt_after2.y - pt.y;
2325
+ p3.x = pt_after.x - control_scale * DiPlus1.x;
2326
+ p3.y = pt_after.y - control_scale * DiPlus1.y;
2327
+
2328
+ tmpArray = clsMETOC.drawCubicBezier2(tg, lineObject, pt, p2, p3, pt2);
2329
+
2330
+ //ICE_OPENINGS_FROZEN needs to know which segment corresponds to each spline point
2331
+ if (tg.get_LineType() === TacticalLines.ICE_OPENINGS_FROZEN ||
2332
+ tg.get_LineType() === TacticalLines.ICE_OPENINGS_FROZEN_GE) {
2333
+ if (tmpArray.length > 0) {
2334
+
2335
+ tmpArray[tmpArray.length - 1].style = 47;
2336
+ }
2337
+ //use this to differentiate the arrays
2338
+ }
2339
+ splinePoints2.push(...tmpArray);
2340
+
2341
+ splinePoints = tmpArray;
2342
+
2343
+ switch (tg.get_LineType()) {
2344
+ case TacticalLines.EBB_TIDE: {
2345
+ if (i === array.length - 2) {
2346
+ if (splinePoints.length >= 2) {
2347
+
2348
+ clsMETOC.DrawArrow(splinePoints[splinePoints.length - 2], tg.Pixels[tg.Pixels.length - 1], arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale()), lineObject);
2349
+ }
2350
+
2351
+ }
2352
+ break;
2353
+ }
2354
+
2355
+ case TacticalLines.FLOOD_TIDE: {
2356
+ d = arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale());
2357
+ if (i === 0 && splinePoints.length > 1) {
2358
+ //finally get the feather points
2359
+ //must allocate for the feather points, requires 4 additional points
2360
+ pt0 = splinePoints[0];
2361
+ pt1 = splinePoints[1];
2362
+ pt2 = lineutility.ExtendLineDouble(pt0, pt1, d);
2363
+ pt3 = lineutility.ExtendLineDouble(pt0, pt1, d * 2);
2364
+ pt4 = lineutility.ExtendLineDouble(pt0, pt1, d * 3);
2365
+ pt5 = lineutility.ExtendDirectedLine(pt3, pt2, pt2, 3, d);
2366
+ pt6 = lineutility.ExtendDirectedLine(pt4, pt3, pt3, 3, d);
2367
+
2368
+ //first feather line
2369
+ lineObject.moveTo(pt3.x, pt3.y);
2370
+ lineObject.lineTo(pt5.x, pt5.y);
2371
+ //second feather line
2372
+ lineObject.moveTo(pt4.x, pt4.y);
2373
+ lineObject.lineTo(pt6.x, pt6.y);
2374
+ }
2375
+ if (i === array.length - 2) {
2376
+ if (splinePoints.length >= 2) {
2377
+
2378
+ clsMETOC.DrawArrow(splinePoints[splinePoints.length - 2], tg.Pixels[tg.Pixels.length - 1], d, lineObject);
2379
+ }
2380
+
2381
+ }
2382
+ break;
2383
+ }
2384
+
2385
+ case TacticalLines.STREAM:
2386
+ case TacticalLines.JET: {
2387
+ if (splinePoints.length > i + 1) {
2388
+ clsMETOC.DrawArrow(splinePoints[i + 1], splinePoints[i], arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale()), lineObject);
2389
+ }
2390
+ break;
2391
+ }
2392
+
2393
+ case TacticalLines.FLOOD_TIDE_GE: {
2394
+ d = arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale());
2395
+ if (i === 0 && splinePoints.length > 1) {
2396
+ //finally get the feather points
2397
+ //must allocate for the feather points, requires 4 additional points
2398
+ pt0 = splinePoints[0];
2399
+ pt1 = splinePoints[1];
2400
+ pt2 = lineutility.ExtendLineDouble(pt0, pt1, d);
2401
+ pt3 = lineutility.ExtendLineDouble(pt0, pt1, d * 2);
2402
+ pt4 = lineutility.ExtendLineDouble(pt0, pt1, d * 3);
2403
+ pt5 = lineutility.ExtendDirectedLine(pt3, pt2, pt2, 3, d);
2404
+ pt6 = lineutility.ExtendDirectedLine(pt4, pt3, pt3, 3, d);
2405
+
2406
+ //first feather line
2407
+ lineObject.moveTo(pt3.x, pt3.y);
2408
+ lineObject.lineTo(pt5.x, pt5.y);
2409
+ //second feather line
2410
+ lineObject.moveTo(pt4.x, pt4.y);
2411
+ lineObject.lineTo(pt6.x, pt6.y);
2412
+ }
2413
+ if (i === array.length - 2)//the last point in the array
2414
+ {
2415
+ lineObject.moveTo(splinePoints2[0].x as int, splinePoints2[0].y as int);
2416
+ t = splinePoints2.length;
2417
+ //for(j=1;j<splinePoints2.length;j++)
2418
+ for (j = 1; j < t; j++) {
2419
+
2420
+ lineObject.lineTo(splinePoints2[j].x as int, splinePoints2[j].y as int);
2421
+ }
2422
+
2423
+
2424
+ if (splinePoints.length >= 2) {
2425
+
2426
+ clsMETOC.DrawArrow(splinePoints[splinePoints.length - 2], tg.Pixels[tg.Pixels.length - 1], d, lineObject);
2427
+ }
2428
+
2429
+ }
2430
+ break;
2431
+ }
2432
+
2433
+ case TacticalLines.EBB_TIDE_GE: {
2434
+ if (i === array.length - 2)//the last point in the array
2435
+ {
2436
+ lineObject = new GeneralPath();
2437
+ lineObject.moveTo(splinePoints2[0].x as int, splinePoints2[0].y as int);
2438
+ t = splinePoints2.length;
2439
+ //for(j=1;j<splinePoints2.length;j++)
2440
+ for (j = 1; j < t; j++) {
2441
+
2442
+ lineObject.lineTo(splinePoints2[j].x as int, splinePoints2[j].y as int);
2443
+ }
2444
+
2445
+
2446
+ if (splinePoints.length >= 2) {
2447
+
2448
+ clsMETOC.DrawArrow(splinePoints[splinePoints.length - 2], tg.Pixels[tg.Pixels.length - 1], arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale()), lineObject);
2449
+ }
2450
+
2451
+ }
2452
+ break;
2453
+ }
2454
+
2455
+ case TacticalLines.JET_GE:
2456
+ case TacticalLines.STREAM_GE: {
2457
+ if (splinePoints.length > i + 1) {
2458
+ clsMETOC.DrawArrow(splinePoints[i + 1], splinePoints[i], arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale()), lineObject);
2459
+ }
2460
+ if (i === array.length - 2)//the last point in the array
2461
+ {
2462
+ lineObject.moveTo(splinePoints2[0].x as int, splinePoints2[0].y as int);
2463
+ t = splinePoints2.length;
2464
+ //for(j=1;j<splinePoints2.length;j++)
2465
+ for (j = 1; j < t; j++) {
2466
+
2467
+ lineObject.lineTo(splinePoints2[j].x as int, splinePoints2[j].y as int);
2468
+ }
2469
+
2470
+ }
2471
+ break;
2472
+ }
2473
+
2474
+ case TacticalLines.ICE_OPENINGS_FROZEN_GE:
2475
+ case TacticalLines.ICE_OPENINGS_LEAD_GE:
2476
+ case TacticalLines.SEAWALL_GE:
2477
+ case TacticalLines.JETTY_BELOW_WATER_GE:
2478
+ case TacticalLines.JETTY_ABOVE_WATER_GE:
2479
+ case TacticalLines.RAMP_ABOVE_WATER_GE:
2480
+ case TacticalLines.RAMP_BELOW_WATER_GE:
2481
+ case TacticalLines.PIER_GE:
2482
+ case TacticalLines.COASTLINE_GE:
2483
+ case TacticalLines.DEPTH_CONTOUR_GE:
2484
+ case TacticalLines.DEPTH_CURVE_GE:
2485
+ case TacticalLines.CRACKS_GE:
2486
+ case TacticalLines.ESTIMATED_ICE_EDGE_GE:
2487
+ case TacticalLines.ICE_EDGE_GE:
2488
+ case TacticalLines.ISOPLETHS_GE:
2489
+ case TacticalLines.ISODROSOTHERM_GE:
2490
+ case TacticalLines.ISOTACH_GE:
2491
+ case TacticalLines.ISOTHERM_GE:
2492
+ case TacticalLines.UPPER_AIR_GE:
2493
+ case TacticalLines.ISOBAR_GE: {
2494
+ if (splinePoints2 != null && splinePoints2.length > 0) {
2495
+ lineObject = new GeneralPath();
2496
+ if (i === array.length - 2)//the last point in the array
2497
+ {
2498
+ lineObject.moveTo(splinePoints2[0].x as int, splinePoints2[0].y as int);
2499
+ t = splinePoints2.length;
2500
+ //for(j=1;j<splinePoints2.length;j++)
2501
+ for (j = 1; j < t; j++) {
2502
+
2503
+ lineObject.lineTo(splinePoints2[j].x as int, splinePoints2[j].y as int);
2504
+ }
2505
+
2506
+ }
2507
+ }
2508
+ break;
2509
+ }
2510
+
2511
+ case TacticalLines.ICE_EDGE_RADAR: {
2512
+ t = splinePoints.length;
2513
+ d = arraysupport.getScaledSize(5, tg.get_LineThickness(), tg.get_patternScale());
2514
+ //for (j = 0; j < splinePoints.length - 1; j++)
2515
+ for (j = 0; j < t - 1; j++) {
2516
+ pt0 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2517
+ pt2 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt0, 45, d);
2518
+ pt1 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2519
+ pt3 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt1, -45, d);
2520
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2521
+ lineObject.lineTo(pt2.x, pt2.y);
2522
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2523
+ lineObject.lineTo(pt3.x, pt3.y);
2524
+
2525
+ pt0 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2526
+ pt2 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt0, 135, d);
2527
+ pt1 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2528
+ pt3 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt1, -135, d);
2529
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2530
+ lineObject.lineTo(pt2.x, pt2.y);
2531
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2532
+ lineObject.lineTo(pt3.x, pt3.y);
2533
+ }
2534
+ break;
2535
+ }
2536
+
2537
+ case TacticalLines.ICE_EDGE_RADAR_GE: {
2538
+ t = splinePoints.length;
2539
+ d = arraysupport.getScaledSize(5, tg.get_LineThickness(), tg.get_patternScale());
2540
+ //for (j = 0; j < splinePoints.length - 1; j++)
2541
+ for (j = 0; j < t - 1; j++) {
2542
+ pt0 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2543
+ pt2 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt0, 45, d);
2544
+ pt1 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2545
+ pt3 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt1, -45, d);
2546
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2547
+ lineObject.lineTo(pt2.x, pt2.y);
2548
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2549
+ lineObject.lineTo(pt3.x, pt3.y);
2550
+
2551
+ pt0 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2552
+ pt2 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt0, 135, d);
2553
+ pt1 = new POINT2(splinePoints[j].x, splinePoints[j].y);
2554
+ pt3 = lineutility.ExtendAngledLine(splinePoints[j], splinePoints[j + 1], pt1, -135, d);
2555
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2556
+ lineObject.lineTo(pt2.x, pt2.y);
2557
+ lineObject.moveTo(splinePoints[j].x, splinePoints[j].y);
2558
+ lineObject.lineTo(pt3.x, pt3.y);
2559
+ }
2560
+ if (i === array.length - 2)//the last point in the array
2561
+ {
2562
+ lineObject.moveTo(splinePoints2[0].x as int, splinePoints2[0].y as int);
2563
+ t = splinePoints2.length;
2564
+ //for(j=1;j<splinePoints2.length;j++)
2565
+ for (j = 1; j < t; j++) {
2566
+
2567
+ lineObject.lineTo(splinePoints2[j].x as int, splinePoints2[j].y as int);
2568
+ }
2569
+
2570
+ }
2571
+ break;
2572
+ }
2573
+
2574
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION: {
2575
+ t = splinePoints.length;
2576
+ d = arraysupport.getScaledSize(5, tg.get_LineThickness(), tg.get_patternScale());
2577
+ //for (j = 0; j < splinePoints.length - 1; j++)
2578
+ for (j = 0; j < t - 1; j++) {
2579
+ //get perpendicular points (point pair)
2580
+ pt0 = splinePoints[j + 1];
2581
+ pt1 = lineutility.ExtendDirectedLine(splinePoints[j], splinePoints[j + 1], pt0, 2, d);
2582
+ lineObject.moveTo(pt1.x, pt1.y);
2583
+ pt1 = lineutility.ExtendDirectedLine(splinePoints[j], splinePoints[j + 1], pt0, 3, d);
2584
+ lineObject.lineTo(pt1.x, pt1.y);
2585
+ }
2586
+ break;
2587
+ }
2588
+
2589
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION_GE: {
2590
+ t = splinePoints.length;
2591
+ d = arraysupport.getScaledSize(5, tg.get_LineThickness(), tg.get_patternScale());
2592
+ //for (j = 0; j < splinePoints.length - 1; j++)
2593
+ for (j = 0; j < t - 1; j++) {
2594
+ //get perpendicular points (point pair)
2595
+ pt0 = splinePoints[j + 1];
2596
+ pt1 = lineutility.ExtendDirectedLine(splinePoints[j], splinePoints[j + 1], pt0, 2, d);
2597
+ lineObject.moveTo(pt1.x, pt1.y);
2598
+ pt1 = lineutility.ExtendDirectedLine(splinePoints[j], splinePoints[j + 1], pt0, 3, d);
2599
+ lineObject.lineTo(pt1.x, pt1.y);
2600
+ }
2601
+ if (i === array.length - 2)//the last point in the array
2602
+ {
2603
+ lineObject.moveTo(splinePoints2[0].x as int, splinePoints2[0].y as int);
2604
+ t = splinePoints2.length;
2605
+ //for(j=1;j<splinePoints2.length;j++)
2606
+ for (j = 1; j < t; j++) {
2607
+
2608
+ lineObject.lineTo(splinePoints2[j].x as int, splinePoints2[j].y as int);
2609
+ }
2610
+
2611
+ }
2612
+ break;
2613
+ }
2614
+
2615
+ default: {
2616
+ break;
2617
+ }
2618
+
2619
+ }
2620
+ }
2621
+ } catch (exc) {
2622
+ if (exc instanceof Error) {
2623
+ ErrorLogger.LogException(clsMETOC._className, "DrawSplines",
2624
+ new RendererException("Failed inside DrawSplines", exc));
2625
+ } else {
2626
+ throw exc;
2627
+ }
2628
+ }
2629
+ return lineObject;
2630
+ }
2631
+
2632
+ /**
2633
+ * Calculates a point on a segment using a ratio of the segment length.
2634
+ * This function is used for calculating control points on Bezier curves.
2635
+ *
2636
+ * @param P0 the 1st point on the segment.
2637
+ * @param P1 the last point on the segment
2638
+ * @param ratio the fraction of the segment length
2639
+ *
2640
+ * @return calculated point on the P0-P1 segment.
2641
+ */
2642
+ private static getPointOnSegment(P0: POINT2, P1: POINT2, ratio: double): POINT2 {
2643
+ //return {x: (P0.x + ((P1.x - P0.x) * ratio)), y: (P0.y + ((P1.y - P0.y) * ratio))};
2644
+ //var pt:Point=new Point();
2645
+ let pt: POINT2 = new POINT2();
2646
+ try {
2647
+ pt.x = P0.x + (P1.x - P0.x) * ratio;
2648
+ pt.y = P0.y + (P1.y - P0.y) * ratio;
2649
+ } catch (exc) {
2650
+ if (exc instanceof Error) {
2651
+ ErrorLogger.LogException(clsMETOC._className, "getPointOnSegment",
2652
+ new RendererException("Failed inside getPointOnSegment", exc));
2653
+ } else {
2654
+ throw exc;
2655
+ }
2656
+ }
2657
+ return pt;
2658
+ }
2659
+
2660
+ /**
2661
+ * This function will trace a cubic approximation of the cubic Bezier
2662
+ * It will calculate a series of (control point/Destination point] which
2663
+ * will be used to draw quadratic Bezier starting from P0
2664
+ *
2665
+ * @param lineObject - the sprite to use for drawing
2666
+ * @param P0 - 1st client point
2667
+ * @param P1 - 1st control point for a cubic Bezier
2668
+ * @param P2 - 2nd control point
2669
+ * @param P3 - 2nd client point
2670
+ *
2671
+ * @return an array of points along the spline at linetype specific intervals
2672
+ */
2673
+ private static drawCubicBezier2(
2674
+ tg: TGLight,
2675
+ lineObject: GeneralPath,
2676
+ P0: POINT2,
2677
+ P1: POINT2,
2678
+ P2: POINT2,
2679
+ P3: POINT2): Array<POINT2> {
2680
+ let array: Array<POINT2> = new Array();
2681
+ try {
2682
+ // this stuff may be unnecessary
2683
+ // calculates the useful base points
2684
+ let PA: POINT2 = clsMETOC.getPointOnSegment(P0, P1, 0.75);
2685
+ let PB: POINT2 = clsMETOC.getPointOnSegment(P3, P2, 0.75);
2686
+
2687
+ // get 1/16 of the [P3, P0] segment
2688
+ let dx: double = (P3.x - P0.x) / 16;
2689
+ let dy: double = (P3.y - P0.y) / 16;
2690
+
2691
+ // calculates control point 1
2692
+ let Pc_1: POINT2 = clsMETOC.getPointOnSegment(P0, P1, 0.375);
2693
+
2694
+ // calculates control point 2
2695
+ let Pc_2: POINT2 = clsMETOC.getPointOnSegment(PA, PB, 0.375);
2696
+ Pc_2.x -= dx;
2697
+ Pc_2.y -= dy;
2698
+
2699
+ // calculates control point 3
2700
+ let Pc_3: POINT2 = clsMETOC.getPointOnSegment(PB, PA, 0.375);
2701
+ Pc_3.x += dx;
2702
+ Pc_3.y += dy;
2703
+
2704
+ // calculates control point 4
2705
+ let Pc_4: POINT2 = clsMETOC.getPointOnSegment(P3, P2, 0.375);
2706
+
2707
+ // calculates the 3 anchor points
2708
+ let Pa_1: POINT2 = lineutility.MidPointDouble(Pc_1, Pc_2, 0);
2709
+ let Pa_2: POINT2 = lineutility.MidPointDouble(PA, PB, 0);
2710
+ let Pa_3: POINT2 = lineutility.MidPointDouble(Pc_3, Pc_4, 0);
2711
+ switch (tg.get_LineType()) { //draw the solid curve for these
2712
+ case TacticalLines.ISOBAR:
2713
+ case TacticalLines.UPPER_AIR:
2714
+ case TacticalLines.ISODROSOTHERM:
2715
+ case TacticalLines.ICE_EDGE:
2716
+ case TacticalLines.CRACKS:
2717
+ case TacticalLines.DEPTH_CURVE:
2718
+ case TacticalLines.DEPTH_CONTOUR:
2719
+ case TacticalLines.COASTLINE:
2720
+ case TacticalLines.PIER:
2721
+ case TacticalLines.RAMP_ABOVE_WATER:
2722
+ case TacticalLines.JETTY_ABOVE_WATER:
2723
+ case TacticalLines.SEAWALL:
2724
+ case TacticalLines.ICE_OPENINGS_LEAD:
2725
+ case TacticalLines.ISOTACH:
2726
+ case TacticalLines.ISOTHERM:
2727
+ case TacticalLines.ISOPLETHS:
2728
+ case TacticalLines.ESTIMATED_ICE_EDGE:
2729
+ case TacticalLines.RAMP_BELOW_WATER:
2730
+ case TacticalLines.JETTY_BELOW_WATER: {
2731
+ lineObject.moveTo(P0.x, P0.y);
2732
+ lineObject.curveTo(P1.x, P1.y, P2.x, P2.y, P3.x, P3.y);
2733
+ return array;
2734
+ }
2735
+
2736
+ case TacticalLines.ICE_OPENINGS_LEAD_GE:
2737
+ case TacticalLines.SEAWALL_GE:
2738
+ case TacticalLines.JETTY_BELOW_WATER_GE:
2739
+ case TacticalLines.JETTY_ABOVE_WATER_GE:
2740
+ case TacticalLines.RAMP_ABOVE_WATER_GE:
2741
+ case TacticalLines.RAMP_BELOW_WATER_GE:
2742
+ case TacticalLines.PIER_GE:
2743
+ case TacticalLines.COASTLINE_GE:
2744
+ case TacticalLines.DEPTH_CONTOUR_GE:
2745
+ case TacticalLines.DEPTH_CURVE_GE:
2746
+ case TacticalLines.CRACKS_GE:
2747
+ case TacticalLines.ESTIMATED_ICE_EDGE_GE:
2748
+ case TacticalLines.ICE_EDGE_GE:
2749
+ case TacticalLines.ISOPLETHS_GE:
2750
+ case TacticalLines.ISOTACH_GE:
2751
+ case TacticalLines.ISOTHERM_GE:
2752
+ case TacticalLines.ISOBAR_GE:
2753
+ case TacticalLines.UPPER_AIR_GE:
2754
+ case TacticalLines.ISODROSOTHERM_GE:
2755
+ case TacticalLines.ICE_OPENINGS_FROZEN:
2756
+ case TacticalLines.ICE_OPENINGS_FROZEN_GE:
2757
+ case TacticalLines.ICE_EDGE_RADAR:
2758
+ case TacticalLines.ICE_EDGE_RADAR_GE:
2759
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION:
2760
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION_GE:
2761
+ case TacticalLines.EBB_TIDE:
2762
+ case TacticalLines.FLOOD_TIDE:
2763
+ case TacticalLines.EBB_TIDE_GE:
2764
+ case TacticalLines.FLOOD_TIDE_GE:
2765
+ case TacticalLines.JET:
2766
+ case TacticalLines.STREAM:
2767
+ case TacticalLines.JET_GE:
2768
+ case TacticalLines.STREAM_GE: {
2769
+ lineObject.moveTo(P0.x, P0.y);
2770
+ lineObject.curveTo(P1.x, P1.y, P2.x, P2.y, P3.x, P3.y);
2771
+ //do not return, we still need the spline points
2772
+ //to claculate other features
2773
+ break;
2774
+ }
2775
+
2776
+ default: {
2777
+ //the rest of them must use the calculated curve points
2778
+ break;
2779
+ }
2780
+
2781
+ }
2782
+ //var sprite:Sprite;
2783
+ let j: int = 0;
2784
+ let distance: double = 0;
2785
+ let n: int = 0;
2786
+ let x: double = 0;
2787
+ let y: double = 0;
2788
+ let increment: double = 0;
2789
+ let pt0: POINT2;
2790
+ let pt1: POINT2;
2791
+ let pt2: POINT2;
2792
+ let t: double = 0;
2793
+ let pt: POINT2;
2794
+ array.length = 0; // array.clear()
2795
+ //distance=clsUtility.Distance2(P0,Pa_1);
2796
+ //add the curve points to tg.Pixels
2797
+ switch (tg.get_LineType()) {
2798
+ case TacticalLines.ICE_EDGE_RADAR:
2799
+ case TacticalLines.ICE_EDGE_RADAR_GE: {
2800
+ increment = arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale());
2801
+ break;
2802
+ }
2803
+
2804
+ case TacticalLines.ICE_OPENINGS_FROZEN:
2805
+ case TacticalLines.ICE_OPENINGS_FROZEN_GE:
2806
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION:
2807
+ case TacticalLines.CRACKS_SPECIFIC_LOCATION_GE: {
2808
+ //increment = 12.0;
2809
+ increment = arraysupport.getScaledSize(7, tg.get_LineThickness(), tg.get_patternScale());
2810
+ break;
2811
+ }
2812
+
2813
+ default: {
2814
+ increment = arraysupport.getScaledSize(10, tg.get_LineThickness(), tg.get_patternScale());
2815
+ break;
2816
+ }
2817
+
2818
+ }
2819
+
2820
+ distance = lineutility.CalcDistanceDouble(P0, Pa_1);
2821
+ if (distance < increment) {
2822
+
2823
+ distance = increment;
2824
+ }
2825
+
2826
+ n = Math.trunc(distance / increment);
2827
+
2828
+ pt0 = P0;
2829
+ pt1 = Pc_1;
2830
+ pt2 = Pa_1;
2831
+ for (j = 0; j < n; j++) {
2832
+ t = j as double * (increment / distance);
2833
+ x = (1 - t) * (1 - t) * pt0.x + 2 * (1 - t) * t * pt1.x + t * t * pt2.x;
2834
+ y = (1 - t) * (1 - t) * pt0.y + 2 * (1 - t) * t * pt1.y + t * t * pt2.y;
2835
+ pt = new POINT2(x, y);
2836
+ //array.push(pt);
2837
+ array.push(pt);
2838
+ }
2839
+ //distance=clsUtility.Distance2(Pa_1,Pa_2);
2840
+ distance = lineutility.CalcDistanceDouble(Pa_1, Pa_2);
2841
+
2842
+ //add the curve points to tg.Pixels
2843
+ n = Math.trunc(distance / increment);
2844
+ pt0 = Pa_1;
2845
+ pt1 = Pc_2;
2846
+ pt2 = Pa_2;
2847
+ for (j = 0; j < n; j++) {
2848
+ t = j as double * (increment / distance);
2849
+ x = (1 - t) * (1 - t) * pt0.x + 2 * (1 - t) * t * pt1.x + t * t * pt2.x;
2850
+ y = (1 - t) * (1 - t) * pt0.y + 2 * (1 - t) * t * pt1.y + t * t * pt2.y;
2851
+ pt = new POINT2(x, y);
2852
+ array.push(pt);
2853
+ }
2854
+
2855
+ //distance=clsUtility.Distance2(Pa_2,Pa_3);
2856
+ distance = lineutility.CalcDistanceDouble(Pa_2, Pa_3);
2857
+ //add the curve points to tg.Pixels
2858
+ n = Math.trunc(distance / increment);
2859
+ pt0 = Pa_2;
2860
+ pt1 = Pc_3;
2861
+ pt2 = Pa_3;
2862
+ for (j = 0; j < n; j++) {
2863
+ t = j as double * (increment / distance);
2864
+ x = (1 - t) * (1 - t) * pt0.x + 2 * (1 - t) * t * pt1.x + t * t * pt2.x;
2865
+ y = (1 - t) * (1 - t) * pt0.y + 2 * (1 - t) * t * pt1.y + t * t * pt2.y;
2866
+ pt = new POINT2(x, y);
2867
+ array.push(pt);
2868
+ }
2869
+ //distance=clsUtility.Distance2(Pa_3,P3);
2870
+ distance = lineutility.CalcDistanceDouble(Pa_3, P3);
2871
+ //add the curve points to tg.Pixels
2872
+ n = Math.trunc(distance / increment);
2873
+ pt0 = Pa_3;
2874
+ pt1 = Pc_4;
2875
+ pt2 = P3;
2876
+ for (j = 0; j < n; j++) {
2877
+ t = j as double * (increment / distance);
2878
+ x = (1 - t) * (1 - t) * pt0.x + 2 * (1 - t) * t * pt1.x + t * t * pt2.x;
2879
+ y = (1 - t) * (1 - t) * pt0.y + 2 * (1 - t) * t * pt1.y + t * t * pt2.y;
2880
+ pt = new POINT2(x, y);
2881
+ array.push(pt);
2882
+ }
2883
+ } catch (exc) {
2884
+ if (exc instanceof Error) {
2885
+ ErrorLogger.LogException(clsMETOC._className, "drawCubicBezier2",
2886
+ new RendererException("Failed inside drawCubicBezier2", exc));
2887
+ } else {
2888
+ throw exc;
2889
+ }
2890
+ }
2891
+ return array;
2892
+ }
2893
+
2894
+ /*
2895
+ *
2896
+ * Called by Splines2TG to get straight channel lines for splines.
2897
+ *
2898
+ * @param tg - TGlight
2899
+ *
2900
+ * @return An ArrayList to use for building the parallel splines
2901
+ */
2902
+ // private static ArrayList ParallelLines(TGLight tg,int rev) {
2903
+ // ArrayList<POINT2> channelPoints2 = new ArrayList();
2904
+ // try {
2905
+ // double[] pLinePoints = new double[tg.Pixels.length * 2];
2906
+ // double[] channelPoints = new double[6 * tg.Pixels.length];
2907
+ // int j = 0;
2908
+ // int n=tg.Pixels.length;
2909
+ // //for (j = 0; j < tg.Pixels.length; j++)
2910
+ // for (j = 0; j < n; j++)
2911
+ // {
2912
+ // pLinePoints[2 * j] = tg.Pixels[j].x;
2913
+ // pLinePoints[2 * j + 1] = tg.Pixels[j].y;
2914
+ // }
2915
+ // int numPoints = tg.Pixels.length;
2916
+ // int channelWidth = 20;
2917
+ // int usePtr = 0;
2918
+ // ArrayList<Shape2> shapes = null;
2919
+ //
2920
+ // try {
2921
+ // CELineArray.CGetChannel2Double(pLinePoints, pLinePoints, channelPoints, numPoints, numPoints, (int) TacticalLines.CHANNEL, channelWidth, usePtr, shapes,rev);
2922
+ // } catch (Exception e) {
2923
+ // ErrorLogger.LogException(_className, "ParallelLines",
2924
+ // new RendererException("Failed inside ParallelLines", e));
2925
+ // }
2926
+ //
2927
+ // POINT2 pt2 = null;
2928
+ // int style = 0;
2929
+ // n=channelPoints.length;
2930
+ // //for (j = 0; j < channelPoints.length / 3; j++)
2931
+ // for (j = 0; j < n / 3; j++)
2932
+ // {
2933
+ // pt2 = new POINT2(channelPoints[3 * j], channelPoints[3 * j + 1], style);
2934
+ // channelPoints2.push(pt2);
2935
+ // }
2936
+ // } catch (Exception exc) {
2937
+ // ErrorLogger.LogException(_className, "ParallelLines",
2938
+ // new RendererException("Failed inside ParallelLines", exc));
2939
+ // }
2940
+ // return channelPoints2;
2941
+ // }
2942
+ /**
2943
+ * Call this function with segment
2944
+ * @param Pixels a segment of tg.Pixels
2945
+ * @return
2946
+ */
2947
+ private static ParallelLines2(Pixels: Array<POINT2>, channelWidth: int): Array<POINT2> {
2948
+ let channelPoints2: Array<POINT2> = new Array();
2949
+ try {
2950
+ let pLinePoints: number[] = new Array<number>(Pixels.length * 2);
2951
+ let channelPoints: number[] = new Array<number>(6 * Pixels.length);
2952
+ let j: int = 0;
2953
+ let n: int = Pixels.length;
2954
+ //for (j = 0; j < Pixels.length; j++)
2955
+ for (j = 0; j < n; j++) {
2956
+ pLinePoints[2 * j] = Pixels[j].x;
2957
+ pLinePoints[2 * j + 1] = Pixels[j].y;
2958
+ }
2959
+ let numPoints: int = Pixels.length;
2960
+ let usePtr: int = 0;
2961
+ let shapes: Array<Shape2>;
2962
+
2963
+ try {
2964
+ let tg: TGLight = new TGLight();
2965
+ tg.set_LineType(TacticalLines.CHANNEL);
2966
+ Channels.GetChannel1Double(tg, pLinePoints, pLinePoints, channelPoints, numPoints, numPoints, channelWidth, usePtr, shapes);
2967
+ } catch (e) {
2968
+ if (e instanceof Error) {
2969
+ ErrorLogger.LogException(clsMETOC._className, "ParallelLines2",
2970
+ new RendererException("Failed inside ParallelLines2", e));
2971
+ } else {
2972
+ throw e;
2973
+ }
2974
+ }
2975
+
2976
+ let pt2: POINT2;
2977
+ let style: int = 0;
2978
+ n = channelPoints.length;
2979
+ //for (j = 0; j < channelPoints.length / 3; j++)
2980
+ for (j = 0; j < n / 3; j++) {
2981
+ pt2 = new POINT2(channelPoints[3 * j], channelPoints[3 * j + 1], style);
2982
+ channelPoints2.push(pt2);
2983
+ }
2984
+ } catch (exc) {
2985
+ if (exc instanceof Error) {
2986
+ ErrorLogger.LogException(clsMETOC._className, "ParallelLines2",
2987
+ new RendererException("Failed inside ParallelLines2", exc));
2988
+ } else {
2989
+ throw exc;
2990
+ }
2991
+ }
2992
+ return channelPoints2;
2993
+ }
2994
+ }