@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,391 +0,0 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one or more
3
- * contributor license agreements. See the NOTICE file distributed with
4
- * this work for additional information regarding copyright ownership.
5
- * The ASF licenses this file to You under the Apache License, Version 2.0
6
- * (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
18
- * @author Denis M. Kishenko
19
- * @version $Revision$
20
- */
21
- //THIS CLASS MODIFIED TO WORK ON JAVASCRIPT
22
-
23
-
24
-
25
- import { type int, type double, type float } from "../graphics2d/BasicTypes";
26
-
27
- import { AffineTransform } from "../graphics2d/AffineTransform"
28
- import { PathIterator } from "../graphics2d/PathIterator"
29
- import { Point } from "../graphics2d/Point"
30
- import { Point2D } from "../graphics2d/Point2D"
31
- import { Rectangle } from "../graphics2d/Rectangle"
32
- import { Rectangle2D } from "../graphics2d/Rectangle2D"
33
- import { Path } from "../../../android/graphics/Path";
34
- import { RectF } from "../../../android/graphics/RectF";
35
-
36
-
37
- /**
38
- *
39
- *
40
- */
41
- export class Polygon {
42
-
43
- /**
44
- * The points buffer capacity
45
- */
46
- private static BUFFER_CAPACITY:int = 4;
47
-
48
- public npoints: int = 0;
49
-
50
- public xpoints: int[];
51
-
52
- public ypoints: int[];
53
-
54
- protected bounds: Rectangle;
55
-
56
-
57
- public constructor();
58
-
59
- /**
60
- *
61
- * @param xpoints
62
- * @param ypoints
63
- * @param npoints
64
- */
65
- public constructor(xpoints: int[], ypoints: int[], npoints: int);
66
- public constructor(...args: unknown[]) {
67
- switch (args.length) {
68
- case 0: {
69
-
70
- this.xpoints = [];
71
- this.ypoints = [];
72
-
73
- break;
74
- }
75
-
76
- case 3: {
77
- const [xpoints, ypoints, npoints] = args as [int[], int[], int];
78
-
79
- // awt.111=Parameter npoints is greater than array length
80
- if (npoints > xpoints.length || npoints > ypoints.length) {
81
- throw Error("Parameter npoints is greater than array length");
82
- }
83
- // awt.112=Negative number of points
84
- if (npoints < 0) {
85
- throw Error("Negative number of points");
86
- }
87
-
88
- this.npoints = npoints;
89
- this.xpoints = this.copyOf(xpoints, npoints);
90
- this.ypoints = this.copyOf(ypoints, npoints);
91
-
92
- break;
93
- }
94
-
95
- default: {
96
- throw Error(`Invalid number of arguments`);
97
- }
98
- }
99
- }
100
-
101
- private copyOf<T>(original:Array<T>, length): Array<T>
102
- {
103
- let arr:Array<T> = [];
104
-
105
- try
106
- {
107
- for(let i:number = 0; i < length; i++)
108
- {
109
- //should just be copying integer arrays so this simple copy should be fine.
110
- arr.push(original.at(i));
111
- }
112
- }
113
- catch(e)
114
- {
115
- throw new Error("Polygon.copyOf - " + e.message);
116
- }
117
- return arr;
118
- }
119
-
120
- public reset(): void {
121
- this.npoints = 0;
122
- this.bounds = null;
123
- }
124
-
125
- public invalidate(): void {
126
- this.bounds = null;
127
- }
128
-
129
- public addPoint(px: int, py: int): void
130
- {
131
- this.xpoints.push(px);
132
- this.ypoints.push(py);
133
- this.npoints++;
134
- if (this.bounds != null)
135
- {
136
- let temp:Rectangle = new Rectangle( Math.min(this.bounds.getMinX(), px),
137
- Math.min(this.bounds.getMinY(), py),
138
- Math.max(this.bounds.getMaxX() - this.bounds.getMinX(), px - this.bounds.getMinX()),
139
- Math.max(this.bounds.getMaxY() - this.bounds.getMinY(), py - this.bounds.getMinY()));
140
-
141
- this.bounds.setRect(temp);
142
- }
143
- }
144
-
145
-
146
- public getBounds(): Rectangle {
147
- if (this.bounds != null) {
148
- return this.bounds;
149
- }
150
- if (this.npoints == 0) {
151
- return new Rectangle();
152
- }
153
-
154
- let bx1:int = this.xpoints[0];
155
- let by1:int = this.ypoints[0];
156
- let bx2:int = bx1;
157
- let by2:int = by1;
158
-
159
- for (let i:int = 1; i < this.npoints; i++) {
160
- let x:int = this.xpoints[i];
161
- let y:int = this.ypoints[i];
162
- if (x < bx1) {
163
- bx1 = x;
164
- } else if (x > bx2) {
165
- bx2 = x;
166
- }
167
- if (y < by1) {
168
- by1 = y;
169
- } else if (y > by2) {
170
- by2 = y;
171
- }
172
- }
173
-
174
- return this.bounds = new Rectangle(bx1, by1, bx2 - bx1, by2 - by1);
175
- }
176
-
177
- public getBoundingBox(): Rectangle {
178
- return this.getBounds();
179
- }
180
-
181
-
182
- public contains(p: Point | Point2D): boolean;
183
- public contains(r: Rectangle2D): boolean;
184
- public contains(x: double, y: double): boolean;
185
- public contains(x: double, y: double, w: double, h: double): boolean;
186
- public contains(...args: unknown[]): boolean {
187
- switch (args.length) {
188
- case 1: {
189
- if (args[0] instanceof Rectangle2D) {
190
- const [r] = args as [Rectangle2D];
191
- return this.contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
192
- } else if (args[0] instanceof Point || args[0] instanceof Point2D) {
193
- const [p] = args as [Point | Point2D];
194
- return this.contains(p.getX(), p.getY());
195
- } else {
196
- throw "Invalid argument type"
197
- }
198
- }
199
-
200
- case 2: {
201
- const [x, y] = args as [double, double];
202
-
203
-
204
- if (this.npoints <= 2 || !this.getBoundingBox().contains(x as int, y as int)) {
205
- return false;
206
- }
207
- let hits: int = 0;
208
-
209
- let lastx: int = this.xpoints[this.npoints - 1];
210
- let lasty: int = this.ypoints[this.npoints - 1];
211
- let curx: int = 0;
212
- let cury: int = 0;
213
-
214
- for (let i: int = 0; i < this.npoints; lastx = curx, lasty = cury, i++) {
215
- curx = this.xpoints[i];
216
- cury = this.ypoints[i];
217
-
218
- if (cury === lasty) {
219
- continue;
220
- }
221
-
222
- let leftx: int = 0;
223
- if (curx < lastx) {
224
- if (x >= lastx) {
225
- continue;
226
- }
227
- leftx = curx;
228
- } else {
229
- if (x >= curx) {
230
- continue;
231
- }
232
- leftx = lastx;
233
- }
234
-
235
- let test1: double = 0;
236
- let test2: double = 0;
237
- if (cury < lasty) {
238
- if (y < cury || y >= lasty) {
239
- continue;
240
- }
241
- if (x < leftx) {
242
- hits++;
243
- continue;
244
- }
245
- test1 = x - curx;
246
- test2 = y - cury;
247
- } else {
248
- if (y < lasty || y >= cury) {
249
- continue;
250
- }
251
- if (x < leftx) {
252
- hits++;
253
- continue;
254
- }
255
- test1 = x - lastx;
256
- test2 = y - lasty;
257
- }
258
-
259
- if (test1 < (test2 / (lasty - cury) * (lastx - curx))) {
260
- hits++;
261
- }
262
- }
263
-
264
- return ((hits & 1) !== 0);
265
- }
266
-
267
- case 4: {
268
- const [x, y, w, h] = args as [double, double, double, double];
269
-
270
-
271
- if (this.npoints <= 0 || !this.getBoundingBox().intersects(x, y, w, h)) {
272
- return false;
273
- }
274
-
275
- return false;
276
- }
277
-
278
- default: {
279
- throw Error(`Invalid number of arguments`);
280
- }
281
- }
282
- }
283
-
284
-
285
-
286
- public getBounds2D(): null {
287
- //return getBounds();
288
- return null;
289
- }
290
-
291
-
292
- public intersects(r: Rectangle2D): boolean;
293
-
294
- public intersects(x: double, y: double, w: double, h: double): boolean;
295
- public intersects(...args: unknown[]): boolean {
296
- switch (args.length) {
297
- case 1: {
298
- const [r] = args as [Rectangle2D];
299
-
300
-
301
- return this.intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
302
-
303
-
304
- break;
305
- }
306
-
307
- case 4: {
308
- const [x, y, w, h] = args as [double, double, double, double];
309
-
310
-
311
- if (this.npoints <= 0 || !this.getBoundingBox().intersects(x, y, w, h)) {
312
- return false;
313
- }
314
-
315
- if (this.bounds != null) {
316
- let fx: float = x as float;
317
- let fy: float = y as float;
318
- let fw: float = w as float;
319
- let fh: float = h as float;
320
- //not sure if math is correct here
321
- let that: Path = new Path();
322
- //start
323
- that.moveTo(fx, fy);
324
- //go right
325
- that.lineTo(fx + fw, fy);
326
- //go down
327
- that.lineTo(fx + fw, fy - fh);
328
- //go left
329
- that.lineTo(fx, fy - fh);
330
- //close
331
- that.close();
332
- //bounds holder
333
- let thatBounds: RectF = new RectF();
334
- let rectf: RectF = new RectF(this.bounds.x as float, this.bounds.y as float, this.bounds.x as float + this.bounds.width as float, this.bounds.y as float + this.bounds.height as float);
335
- return RectF.intersects(rectf, thatBounds);
336
- }
337
- else {
338
- return false;
339
- }
340
-
341
-
342
- break;
343
- }
344
-
345
- default: {
346
- throw Error(`Invalid number of arguments`);
347
- }
348
- }
349
- }
350
-
351
-
352
-
353
- public getPathIterator(at: AffineTransform | null): PathIterator;
354
- public getPathIterator(at: AffineTransform, flatness: double): PathIterator;
355
- public getPathIterator(...args: unknown[]): PathIterator {
356
- switch (args.length) {
357
- case 1: {
358
- const [at] = args as [AffineTransform];
359
-
360
-
361
- let pi: PathIterator = new PathIterator(null);
362
- let j: int = 0;
363
- if (this.npoints > 0) {
364
- pi.moveTo(this.xpoints[0], this.ypoints[0]);
365
- for (j = 1; j < this.npoints; j++) {
366
- pi.lineTo(this.xpoints[j], this.ypoints[j]);
367
- }
368
- }
369
- pi.reset();
370
- return pi;
371
-
372
-
373
- break;
374
- }
375
-
376
- case 2: {
377
- const [at, flatness] = args as [AffineTransform, double];
378
-
379
-
380
- return this.getPathIterator(at);
381
-
382
-
383
- break;
384
- }
385
-
386
- default: {
387
- throw Error(`Invalid number of arguments`);
388
- }
389
- }
390
- }
391
- }