@armyc2.c5isr.renderer/mil-sym-ts-web 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/{dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz → armyc2.c5isr.renderer-mil-sym-ts-web-2.2.1.tgz} +0 -0
  2. package/package.json +15 -39
  3. package/buildNode.bat +0 -2
  4. package/buildWeb.bat +0 -2
  5. package/dist/LICENSE +0 -201
  6. package/dist/README.md +0 -57
  7. package/dist/package.json +0 -16
  8. package/index.ts +0 -169
  9. package/package.bak +0 -50
  10. package/package.node.json +0 -43
  11. package/package.pack.json +0 -19
  12. package/package.packWeb.json +0 -16
  13. package/package.web.json +0 -40
  14. package/src/main/ts/android/graphics/Bitmap.ts +0 -7
  15. package/src/main/ts/android/graphics/Paint.ts +0 -26
  16. package/src/main/ts/android/graphics/Path.ts +0 -78
  17. package/src/main/ts/android/graphics/PointF.ts +0 -14
  18. package/src/main/ts/android/graphics/Rect.ts +0 -18
  19. package/src/main/ts/android/graphics/RectF.ts +0 -50
  20. package/src/main/ts/android/graphics/Region.ts +0 -36
  21. package/src/main/ts/android/graphics/Typeface.ts +0 -11
  22. package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +0 -99
  23. package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +0 -34
  24. package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +0 -193
  25. package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +0 -2971
  26. package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +0 -4008
  27. package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +0 -93
  28. package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +0 -89
  29. package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +0 -515
  30. package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +0 -5403
  31. package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +0 -1084
  32. package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +0 -2173
  33. package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +0 -4934
  34. package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +0 -7
  35. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +0 -5601
  36. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +0 -14
  37. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +0 -648
  38. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +0 -647
  39. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +0 -2994
  40. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +0 -2663
  41. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +0 -669
  42. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +0 -971
  43. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +0 -871
  44. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +0 -3507
  45. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +0 -500
  46. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +0 -1089
  47. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +0 -2656
  48. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +0 -1419
  49. package/src/main/ts/armyc2/c5isr/data/genc.json +0 -1407
  50. package/src/main/ts/armyc2/c5isr/data/msd.json +0 -17311
  51. package/src/main/ts/armyc2/c5isr/data/mse.json +0 -18500
  52. package/src/main/ts/armyc2/c5isr/data/svgd.json +0 -31214
  53. package/src/main/ts/armyc2/c5isr/data/svge.json +0 -30558
  54. package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +0 -10
  55. package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +0 -437
  56. package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +0 -429
  57. package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +0 -7
  58. package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +0 -35
  59. package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +0 -111
  60. package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +0 -29
  61. package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +0 -18
  62. package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +0 -211
  63. package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +0 -80
  64. package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +0 -33
  65. package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +0 -16
  66. package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +0 -726
  67. package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +0 -141
  68. package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +0 -112
  69. package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +0 -261
  70. package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +0 -391
  71. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +0 -567
  72. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +0 -445
  73. package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +0 -31
  74. package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +0 -18
  75. package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +0 -45
  76. package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +0 -25
  77. package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +0 -15
  78. package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +0 -22
  79. package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +0 -269
  80. package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +0 -9882
  81. package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +0 -146
  82. package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +0 -1265
  83. package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +0 -64
  84. package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +0 -95
  85. package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +0 -93
  86. package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +0 -114
  87. package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +0 -555
  88. package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +0 -62
  89. package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +0 -120
  90. package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +0 -431
  91. package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +0 -99
  92. package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +0 -25
  93. package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +0 -203
  94. package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +0 -104
  95. package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +0 -481
  96. package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +0 -40
  97. package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +0 -1323
  98. package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +0 -51
  99. package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +0 -736
  100. package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +0 -106
  101. package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +0 -84
  102. package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +0 -87
  103. package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +0 -34
  104. package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +0 -324
  105. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +0 -127
  106. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +0 -18
  107. package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +0 -111
  108. package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +0 -219
  109. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +0 -1008
  110. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +0 -882
  111. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +0 -380
  112. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +0 -797
  113. package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +0 -1699
  114. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +0 -178
  115. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +0 -45
  116. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +0 -126
  117. package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +0 -118
  118. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +0 -11
  119. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +0 -1201
  120. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +0 -591
  121. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +0 -29
  122. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +0 -753
  123. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +0 -137
  124. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +0 -438
  125. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +0 -19
  126. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +0 -10
  127. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +0 -5
  128. package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +0 -404
  129. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +0 -525
  130. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +0 -55
  131. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +0 -36
  132. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +0 -1055
  133. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +0 -2085
  134. package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +0 -157
  135. package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +0 -86
  136. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +0 -3798
  137. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +0 -412
  138. package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +0 -124
  139. package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +0 -26
  140. package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +0 -677
  141. package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +0 -484
  142. package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +0 -62
  143. package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +0 -46
  144. package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +0 -51
  145. package/src/main/ts/org/gavaghan/geodesy/Angle.ts +0 -31
  146. package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +0 -71
  147. package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +0 -200
  148. package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +0 -55
  149. package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +0 -68
  150. package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +0 -103
  151. package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +0 -90
  152. package/test/ExportSPImages.js +0 -692
  153. package/test/MPWW.html +0 -556
  154. package/test/MPWorker.js +0 -318
  155. package/test/SPWorker.js +0 -233
  156. package/test/SVGWW.html +0 -363
  157. package/test/singlePointTester3.html +0 -751
  158. package/tsconfig.json +0 -54
  159. package/typedoc.json +0 -30
  160. package/updateVersion.js +0 -21
  161. package/webpack.config.js +0 -34
  162. package/webpackn.config.js +0 -28
  163. package/webpackr.config.js +0 -47
  164. package/webpackw.config.js +0 -23
  165. /package/{dist/C5Ren.d.ts → C5Ren.d.ts} +0 -0
  166. /package/{dist/C5Ren.js → C5Ren.js} +0 -0
  167. /package/{dist/C5Ren.js.map → C5Ren.js.map} +0 -0
  168. /package/{dist/manifest.json → manifest.json} +0 -0
@@ -1,647 +0,0 @@
1
- import { type int, type double } from "../graphics2d/BasicTypes";
2
-
3
- import { BasicStroke } from "../graphics2d/BasicStroke"
4
- import { Rectangle2D } from "../graphics2d/Rectangle2D"
5
- import { arraysupport } from "../JavaLineArray/arraysupport"
6
- import { CELineArray } from "../JavaLineArray/CELineArray"
7
- import { Channels } from "../JavaLineArray/Channels"
8
- import { lineutility } from "../JavaLineArray/lineutility"
9
- import { POINT2 } from "../JavaLineArray/POINT2"
10
- import { ref } from "../JavaLineArray/ref"
11
- import { Shape2 } from "../JavaLineArray/Shape2"
12
- import { TacticalLines } from "../JavaLineArray/TacticalLines"
13
- import { P1 } from "../JavaTacticalRenderer/P1"
14
- import { TGLight } from "../JavaTacticalRenderer/TGLight"
15
- import { Color } from "../renderer/utilities/Color"
16
- import { EntityCode } from "../renderer/utilities/EntityCode"
17
- import { ErrorLogger } from "../renderer/utilities/ErrorLogger"
18
- import { IPointConversion } from "../renderer/utilities/IPointConversion"
19
- import { RendererException } from "../renderer/utilities/RendererException"
20
- import { SymbolID } from "../renderer/utilities/SymbolID"
21
- import { clsRenderer2 } from "../RenderMultipoints/clsRenderer2"
22
- import { clsUtility } from "./clsUtility";
23
-
24
- /**
25
- * A class to process channel types.
26
- *
27
- *
28
- */
29
- export class clsChannelUtility {
30
-
31
- private static readonly _className: string = "clsChannelUtility";
32
-
33
- /**
34
- * Gets partitions from the client points based on the segments generated by
35
- * GetSegments. Partitions are used handle double-backed segments. Each
36
- * partition is a continuous sequence of points for a channel.
37
- *
38
- * @param segments
39
- * @param partitions OUT the partitions
40
- * @return
41
- */
42
- private static GetPartitions(segments: boolean[],
43
- partitions: Array<P1>): int {
44
- try {
45
- let j: int = 0;
46
- let nextSegment: boolean = false;
47
- //worst case is every segment is a separate partition
48
- //caller must deallocate partitions
49
- let p1: P1 = new P1();
50
- //first segment will always be true,
51
- //there are no bad one-segment channels
52
- if (segments[0] === false) {
53
- return 0;
54
- }
55
-
56
- if (partitions != null) {
57
- partitions.length = 0; // partitions.clear()
58
- } else {
59
- return 0;
60
- }
61
-
62
- p1.start = 0;
63
- //only add the partitions after p1.end has been set
64
- let n: int = segments.length;
65
- //for (j = 0; j < segments.length - 1; j++)
66
- for (j = 0; j < n - 1; j++) {
67
- nextSegment = segments[j + 1];
68
- if (nextSegment === false) {
69
- //the end of the current partition is the last good segment
70
- p1.end_Renamed = j;
71
- partitions.push(p1);
72
- //beginning of the next partition
73
- p1 = new P1();
74
- p1.start = j + 1;
75
- }
76
- }
77
- p1.end_Renamed = j;
78
- partitions.push(p1);
79
- } catch (exc) {
80
- if (exc instanceof Error) {
81
- //console.log(e.message);
82
- //clsUtility.WriteFile("error in clsChanneUtility.GetPartitions");
83
- ErrorLogger.LogException(clsChannelUtility._className, "GetPartitions",
84
- new RendererException("Failed inside GetPartitions", exc));
85
- } else {
86
- throw exc;
87
- }
88
- }
89
- return partitions.length;
90
- }
91
-
92
- /**
93
- * Draws a partition to the shapes array and stores the calculated channel
94
- * points
95
- *
96
- * @param fromSegment
97
- * @param toSegment
98
- * @param pixels
99
- * @param channelWidth
100
- * @param bolLastSegment
101
- * @param shapes
102
- * @param channelPoints
103
- * @param distanceToChannelPoint
104
- * @return
105
- */
106
- private static DrawGoodChannel2(tg: TGLight,
107
- fromSegment: int,
108
- toSegment: int,
109
- pixels: number[],
110
- channelWidth: int,
111
- bolLastSegment: boolean,
112
- shapes: Array<Shape2>,
113
- channelPoints: Array<POINT2>,
114
- distanceToChannelPoint: double): int {
115
- let returnValue: int = 0; // Had to initialize to something
116
- try {
117
- let lineType: int = tg.get_LineType();
118
- let lineType2: int = 0;
119
- let channelPixels: number[];
120
- switch (lineType) {
121
- case TacticalLines.LC:
122
- case TacticalLines.UNSP:
123
- case TacticalLines.DFENCE:
124
- case TacticalLines.SFENCE:
125
- case TacticalLines.DOUBLEA:
126
- case TacticalLines.LWFENCE:
127
- case TacticalLines.HWFENCE:
128
- case TacticalLines.BBS_LINE:
129
- case TacticalLines.SINGLEC:
130
- case TacticalLines.DOUBLEC:
131
- case TacticalLines.TRIPLE: {
132
- lineType2 = lineType;
133
- break;
134
- }
135
-
136
- case TacticalLines.SPT: {
137
- if (fromSegment === 0) {
138
- lineType2 = TacticalLines.CHANNEL_FLARED;
139
- } else {
140
- lineType2 = TacticalLines.CHANNEL;
141
- }
142
- break;
143
- }
144
-
145
- case TacticalLines.MAIN: {
146
- if (fromSegment === 0) {
147
- lineType2 = TacticalLines.CHANNEL_FLARED;
148
- } else {
149
- lineType2 = TacticalLines.CHANNEL;
150
- }
151
- break;
152
- }
153
-
154
- case TacticalLines.CATK: {
155
- lineType2 = TacticalLines.CHANNEL_DASHED;
156
- break;
157
- }
158
-
159
- case TacticalLines.CATKBYFIRE: {
160
- lineType2 = TacticalLines.CHANNEL_DASHED;
161
- break;
162
- }
163
-
164
- default: {
165
- lineType2 = TacticalLines.CHANNEL;
166
- break;
167
- }
168
-
169
- }
170
- if (bolLastSegment === true) {
171
- if (fromSegment !== 0) {
172
- switch (lineType) {
173
- case TacticalLines.SPT: {
174
- lineType2 = TacticalLines.SPT_STRAIGHT;
175
- break;
176
- }
177
-
178
- case TacticalLines.MAIN: {
179
- lineType2 = TacticalLines.MAIN_STRAIGHT;
180
- break;
181
- }
182
-
183
- default: {
184
- lineType2 = lineType as int;
185
- break;
186
- }
187
-
188
- }
189
- } else {
190
- lineType2 = lineType as int;
191
- }
192
- }
193
-
194
- if (fromSegment < 0) {
195
- return returnValue;
196
- }
197
- if (toSegment < 0) {
198
- return returnValue;
199
- }
200
- if (toSegment < fromSegment) {
201
- return returnValue;
202
- }
203
- let j: int = 0;
204
- let lineCount: int = 0;
205
- let numPoints: int = 0;
206
- let counter: int = 0;
207
- let goodUpperPixels: number[];
208
- let goodLowerPixels: number[];
209
- numPoints = toSegment - fromSegment + 2;
210
- goodUpperPixels = new Array<number>(2 * numPoints);
211
- goodLowerPixels = new Array<number>(2 * numPoints);
212
-
213
- counter = 0;
214
- for (j = fromSegment; j < toSegment + 2; j++) {
215
- goodUpperPixels[counter] = pixels[2 * j];
216
- goodUpperPixels[counter + 1] = pixels[2 * j + 1];
217
- goodLowerPixels[counter] = pixels[2 * j];
218
- goodLowerPixels[counter + 1] = pixels[2 * j + 1];
219
- counter = counter + 2;
220
- }
221
-
222
- tg.set_LineType(lineType2);
223
- lineCount = CELineArray.CGetLineCountDouble(tg, goodUpperPixels, numPoints, channelWidth);
224
- channelPixels = new Array<number>(3 * lineCount);
225
- let pt: POINT2;
226
- lineCount = Channels.GetChannel1Double(tg, goodUpperPixels, goodLowerPixels, channelPixels, numPoints, numPoints, channelWidth / 2, distanceToChannelPoint as int, shapes);
227
- tg.set_LineType(lineType);
228
-
229
- //if shapes is null then it is not a CPOF client
230
- if (shapes == null && channelPixels != null) {
231
- //do not clear channelPoints first because the function gets successive calls
232
- let n: int = channelPixels.length;
233
- //for (j = 0; j < channelPixels.length / 3; j++)
234
- for (j = 0; j < n / 3; j++) {
235
- pt = new POINT2(channelPixels[3 * j], channelPixels[3 * j + 1], channelPixels[3 * j + 2] as int);
236
- if (j === channelPixels.length / 3 - 1) {
237
- pt.style = 5;
238
- }
239
- channelPoints.push(pt);
240
- }
241
- }
242
-
243
- if (lineCount > 0) {
244
- //DrawChannelPixels2(lineCount, channelPixels, (int)lineType);
245
- returnValue = channelPixels.length;
246
- } else {
247
- returnValue = 0;
248
- }
249
- //channelPixels[channelPixels.length - 1] = 5;
250
- if (lineCount > 0) {
251
- channelPixels[lineCount - 1] = 5;
252
- }
253
- //clean up
254
- goodUpperPixels = null;
255
- goodLowerPixels = null;
256
- } catch (exc) {
257
- if (exc instanceof Error) {
258
- //clsUtility.WriteFile("error in clsChanneUtility.DrawGoodChannel2");
259
- ErrorLogger.LogException(clsChannelUtility._className, "DrawGoodChannel2",
260
- new RendererException("Failed inside DrawGoodChannel2", exc));
261
- } else {
262
- throw exc;
263
- }
264
- }
265
- return returnValue;
266
- }
267
-
268
- /**
269
- * Draws the channel partitions to the shapes array
270
- *
271
- * @param pixels
272
- * @param partitions
273
- * @param channelWidth channel width in pixels
274
- * @param shapes
275
- * @param channelPoints
276
- * @param distanceToChannelPoint distance in pixels from the tip to the back
277
- * of the arrow
278
- */
279
- private static DrawSegments(tg: TGLight,
280
- pixels: number[],
281
- partitions: Array<P1>,
282
- channelWidth: int,
283
- shapes: Array<Shape2>,
284
- channelPoints: Array<POINT2>,
285
- distanceToChannelPoint: double): void {
286
- try {
287
- let j: int = 0;
288
- let n: int = 0;
289
- let t: int = partitions.length;
290
- //for (j = 0; j < partitions.length - 1; j++)
291
- for (j = 0; j < t - 1; j++) {
292
- n = clsChannelUtility.DrawGoodChannel2(tg, partitions[j].start, partitions[j].end_Renamed, pixels, channelWidth, false, shapes, channelPoints, distanceToChannelPoint);
293
-
294
- }
295
- //draw the last partition using linetype
296
- n = clsChannelUtility.DrawGoodChannel2(tg, partitions[j].start, partitions[j].end_Renamed, pixels, channelWidth, true, shapes, channelPoints, distanceToChannelPoint);
297
- } catch (exc) {
298
- if (exc instanceof Error) {
299
- //clsUtility.WriteFile("error in clsChanneUtility.DrawSegments");
300
- ErrorLogger.LogException(clsChannelUtility._className, "DrawSegments",
301
- new RendererException("Failed inside DrawSegments", exc));
302
- } else {
303
- throw exc;
304
- }
305
- }
306
- }
307
-
308
- private static DrawLCSingleLineSegments(tg: TGLight,
309
- pixels2: number[],
310
- singleLinePartitions: Array<P1>,
311
- shapes: Array<Shape2>,
312
- clipBounds: Rectangle2D,
313
- converter: IPointConversion): void {
314
- try {
315
- for (let flotPartition of singleLinePartitions) {
316
- let vblSaveCounter: int = flotPartition.end_Renamed - flotPartition.start + 1;
317
- let flotPixels: Array<POINT2> = new Array();
318
- for (let i: int = 0; i < vblSaveCounter; i++) {
319
-
320
- flotPixels.push(new POINT2(pixels2[2 * (i + flotPartition.start)], pixels2[2 * (i + flotPartition.start) + 1]));
321
- }
322
-
323
-
324
- let flotID: string = tg.get_SymbolId();
325
- flotID = SymbolID.setAffiliation(flotID, SymbolID.StandardIdentity_Affiliation_Hostile_Faker);
326
- flotID = SymbolID.setEntityCode(flotID, EntityCode.EntityCode_FLOT);
327
- let flotTG: TGLight = new TGLight();
328
- flotTG.set_LineType(TacticalLines.FLOT);
329
- flotTG.set_Pixels(flotPixels);
330
- flotTG.set_SymbolId(flotID);
331
- flotTG.set_LineThickness(tg.get_LineThickness());
332
-
333
- let flotShapes: Array<Shape2> | null = clsRenderer2.GetLineArray(flotTG, converter, false, clipBounds);
334
-
335
- if (flotShapes != null) {
336
- for (let shape of flotShapes) {
337
-
338
- shape.setLineColor(Color.RED);
339
- }
340
-
341
- shapes.push(...flotShapes);
342
- }
343
- }
344
- } catch (exc) {
345
- if (exc instanceof Error) {
346
- ErrorLogger.LogException(clsChannelUtility._className, "DrawLCFlotSegments",
347
- new RendererException("Failed inside DrawLCFlotSegments", exc));
348
- } else {
349
- throw exc;
350
- }
351
- }
352
- }
353
-
354
- /**
355
- * Handle symbol too small for line of contact
356
- * @param tg
357
- * @param pixels
358
- * @return
359
- */
360
- private static getLCPixels(tg: TGLight, pixels: Array<POINT2>): Array<POINT2> {
361
- let pixels2: Array<POINT2>;
362
- try {
363
- if (tg.get_LineType() !== TacticalLines.LC) {
364
-
365
- return pixels;
366
- }
367
-
368
- let pts: POINT2[] = tg.Pixels;
369
- let ul: POINT2 = new POINT2();
370
- let lr: POINT2 = new POINT2();
371
- lineutility.CalcMBRPoints(pts as POINT2[], pts.length, ul, lr);
372
- let flotDiameter: double = arraysupport.getScaledSize(21, tg.get_LineThickness(), tg.get_patternScale());
373
- if (lr.x - ul.x >= flotDiameter) {
374
-
375
- return pixels;
376
- }
377
-
378
- else {
379
- if (lr.y - ul.y >= flotDiameter) {
380
-
381
- return pixels;
382
- }
383
-
384
- }
385
-
386
- //at this point the mbr is too small for a meaningful LC symbol
387
- let x0: double = pts[0].x;
388
- let y0: double = pts[0].y;
389
- let x1: double = pts[1].x;
390
- let y1: double = pts[1].y;
391
- if (x0 <= x1) {
392
-
393
- x1 = x0 + flotDiameter;
394
- }
395
-
396
- else {
397
-
398
- x1 = x0 - flotDiameter;
399
- }
400
-
401
- y1 = y0;
402
- let pt0: POINT2 = new POINT2(x0, y0);
403
- let pt1: POINT2 = new POINT2(x1, y1);
404
- pixels2 = new Array();
405
- pixels2.push(pt0);
406
- pixels2.push(pt1);
407
- } catch (exc) {
408
- if (exc instanceof Error) {
409
- //clsUtility.WriteFile("error in clsChanneUtility.DrawSegments");
410
- ErrorLogger.LogException(clsChannelUtility._className, "getLCPixels",
411
- new RendererException("Failed inside getLCPixels", exc));
412
- } else {
413
- throw exc;
414
- }
415
- }
416
- return pixels2;
417
- }
418
-
419
- /**
420
- * The main interface to clsChannelUtility calls DrawChannel2 after stuffing
421
- * the points into an array of 2-tuples x,y
422
- *
423
- * @param pixels the client points
424
- * @param linetype the line type
425
- * @param tg the tactical graphic
426
- * @param shapes
427
- * @param channelPoints
428
- */
429
- public static DrawChannel(pixels: Array<POINT2>,
430
- linetype: int,
431
- tg: TGLight,
432
- shapes: Array<Shape2>,
433
- channelPoints: Array<POINT2> | null,
434
- clipBounds: Rectangle2D,
435
- converter: IPointConversion): void {
436
- try {
437
- pixels = clsChannelUtility.getLCPixels(tg, pixels);
438
- //we must do this because the rotary arrow tip now has to match the
439
- //anchor point, i.e. the rotary feature can no longer stick out past the anchor point
440
- //45 pixels shift here matches the 45 pixels shift for catkbyfire found in Channels.GetAXADDouble
441
- lineutility.adjustCATKBYFIREControlPoint(linetype, pixels, 45);
442
-
443
- let j: int = 0;
444
- let pixels2: number[] = new Array<number>(pixels.length * 2);
445
- let n: int = pixels.length;
446
- //for (j = 0; j < pixels.length; j++)
447
- for (j = 0; j < n; j++) {
448
- pixels2[2 * j] = pixels[j].x;
449
- pixels2[2 * j + 1] = pixels[j].y;
450
- }
451
- clsChannelUtility.DrawChannel2(pixels2, linetype, tg, shapes, channelPoints, clipBounds, converter);
452
- } catch (exc) {
453
- if (exc instanceof Error) {
454
- //clsUtility.WriteFile("error in clsChanneUtility.DrawSegments");
455
- ErrorLogger.LogException(clsChannelUtility._className, "DrawChannel",
456
- new RendererException("Failed inside DrawChannel", exc));
457
- } else {
458
- throw exc;
459
- }
460
- }
461
- }
462
-
463
- /**
464
- * utility for clsMETOC to handle double-backed segments
465
- *
466
- * @param tg the tactical graphic object
467
- */
468
- public static GetPartitions2(tg: TGLight): Array<P1> | null {
469
- let partitions: Array<P1>;
470
- try {
471
- let pixels: number[] = new Array<number>(tg.Pixels.length * 2);
472
- let n: int = tg.Pixels.length;
473
- //for(int j=0;j<tg.Pixels.length;j++)
474
- for (let j: int = 0; j < n; j++) {
475
- pixels[2 * j] = tg.Pixels[j].x;
476
- pixels[2 * j + 1] = tg.Pixels[j].y;
477
- }
478
-
479
- let segments: boolean[] = new Array<boolean>(pixels.length / 2 - 1);
480
- if (segments.length === 0) {
481
- return null;
482
- }
483
-
484
- let factor: double = arraysupport.getScaledSize(3, tg.get_LineThickness(), tg.get_patternScale());
485
-
486
- clsUtility.GetSegments(pixels, segments, factor);
487
- partitions = new Array<P1>();
488
- clsChannelUtility.GetPartitions(segments, partitions);
489
- } catch (exc) {
490
- if (exc instanceof Error) {
491
- ErrorLogger.LogException(clsChannelUtility._className, "GetPartitions2",
492
- new RendererException("Failed inside GetPartitions2", exc));
493
- } else {
494
- throw exc;
495
- }
496
- }
497
- return partitions;
498
- }
499
-
500
- /**
501
- * The main function for processing channel types. Gets segments, then gets
502
- * partitions from the segments and then draws the partitions.
503
- *
504
- * @param pixels the client points as an array of 2-tuples x,y
505
- * @param linetype the line type
506
- * @param tg the tactical graphic object
507
- * @param shapes
508
- * @param channelPoints
509
- */
510
- private static DrawChannel2(pixels: number[],
511
- linetype: int,
512
- tg: TGLight,
513
- shapes: Array<Shape2>,
514
- channelPoints: Array<POINT2> | null,
515
- clipBounds: Rectangle2D,
516
- converter: IPointConversion): void {
517
- try {
518
- let distanceToChannelPoint: ref<number[]> = new ref();
519
- let j: int = 0;
520
- let pixels2: number[];
521
- let channelWidth: int = 0;
522
- let partitions: Array<P1>;
523
- let n: int = pixels.length;
524
- let numPoints: int = 0;
525
- //LC and others do not call clsUtility.ChannelWidth, but the
526
- //value array still needs to be allocated or there is a
527
- //null pointer exception in DrawGoodChannel2
528
- distanceToChannelPoint.value = new Array<number>(1);
529
- distanceToChannelPoint.value[0] = arraysupport.getScaledSize(20, tg.get_LineThickness(), tg.get_patternScale());
530
-
531
- switch (linetype) {
532
- case TacticalLines.MAIN:
533
- case TacticalLines.CATK:
534
- case TacticalLines.CATKBYFIRE:
535
- case TacticalLines.AIRAOA:
536
- case TacticalLines.AAAAA:
537
- case TacticalLines.SPT: {
538
- clsUtility.ReorderPixels(pixels);
539
- numPoints = pixels.length / 2;
540
-
541
- if (numPoints < 3) {
542
- return;
543
- }
544
- //moved this to be prior to stuffing pixels2
545
- channelWidth = clsUtility.ChannelWidth(pixels, distanceToChannelPoint) / 2;
546
- //ValidateChannelPixels2(ref pixels, ref channelWidth, ref distanceToChannelPoint);
547
-
548
- numPoints = pixels.length / 2;
549
- pixels2 = new Array<number>(pixels.length - 2);
550
-
551
- for (j = 0; j < numPoints; j++) {
552
- if (j < numPoints - 1) {
553
- pixels2[2 * j] = pixels[2 * j];
554
- pixels2[2 * j + 1] = pixels[2 * j + 1];
555
- }
556
- }
557
- break;
558
- }
559
-
560
- case TacticalLines.LC: {
561
- channelWidth = arraysupport.getScaledSize(40, tg.get_LineThickness(), tg.get_patternScale()) as int;// was 20;
562
- pixels2 = new Array<number>(pixels.length);
563
- n = pixels.length;
564
- //for (j = 0; j < pixels.length; j++)
565
- for (j = 0; j < n; j++) {
566
- pixels2[j] = pixels[j];
567
- }
568
- break;
569
- }
570
-
571
- case TacticalLines.UNSP:
572
- case TacticalLines.DFENCE:
573
- case TacticalLines.SFENCE:
574
- case TacticalLines.DOUBLEA:
575
- case TacticalLines.LWFENCE:
576
- case TacticalLines.HWFENCE:
577
- case TacticalLines.SINGLEC:
578
- case TacticalLines.DOUBLEC:
579
- case TacticalLines.TRIPLE: {
580
- tg.set_lineCap(BasicStroke.CAP_BUTT);
581
- channelWidth = arraysupport.getScaledSize(30, tg.get_LineThickness(), tg.get_patternScale()) as int;
582
- if (Channels.getShiftLines()) {
583
- channelWidth = arraysupport.getScaledSize(60, tg.get_LineThickness(), tg.get_patternScale()) as int;
584
- }
585
- pixels2 = new Array<number>(pixels.length);
586
- n = pixels.length;
587
- //for (j = 0; j < pixels.length; j++)
588
- for (j = 0; j < n; j++) {
589
- pixels2[j] = pixels[j];
590
- }
591
- break;
592
- }
593
-
594
- case TacticalLines.BBS_LINE: {
595
- channelWidth = 8 * tg.Pixels[0].style; //was 20 1-10-13
596
- let pixels2: double[] = [];
597
- n = pixels.length;
598
- //for (j = 0; j < pixels.length; j++)
599
- for (j = 0; j < n; j++) {
600
- pixels2[j] = pixels[j];
601
- }
602
- break;
603
- }
604
-
605
- default: {
606
-
607
- break;
608
- }
609
-
610
- }
611
-
612
- //we require new partitions because pixels are dirty
613
- let segments: boolean[] = new Array<boolean>(Math.trunc(pixels2.length / 2) - 1);
614
- if (segments.length === 0) {
615
- return;
616
- }
617
-
618
- // Line of contact looks bad with small channel corners extending out
619
- if (linetype === TacticalLines.LC) {
620
- partitions = new Array();
621
- let singleLinePartitions: Array<P1> = new Array();
622
- clsUtility.GetLCPartitions(pixels2, arraysupport.getScaledSize(40, tg.get_LineThickness(), tg.get_patternScale()), partitions, singleLinePartitions);
623
- clsChannelUtility.DrawSegments(tg, pixels2, partitions, channelWidth, shapes, channelPoints, distanceToChannelPoint.value[0]);
624
-
625
- if (singleLinePartitions.length > 0) {
626
- // Render any small angles that only have side (not channel) as FLOT
627
- clsChannelUtility.DrawLCSingleLineSegments(tg, pixels2, singleLinePartitions, shapes, clipBounds, converter);
628
- }
629
- } else {
630
- let factor: double = 3;
631
-
632
- clsUtility.GetSegments(pixels2, segments, factor);
633
- partitions = new Array();
634
- clsChannelUtility.GetPartitions(segments, partitions);
635
-
636
- clsChannelUtility.DrawSegments(tg, pixels2, partitions, channelWidth, shapes, channelPoints, distanceToChannelPoint.value[0]);
637
- }
638
- } catch (exc) {
639
- if (exc instanceof Error) {
640
- ErrorLogger.LogException(clsChannelUtility._className, "DrawChannel2",
641
- new RendererException("Failed inside DrawChannel2", exc));
642
- } else {
643
- throw exc;
644
- }
645
- }
646
- }
647
- }