@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,178 +0,0 @@
1
- import { type int, type double } from "../../graphics2d/BasicTypes";
2
-
3
- import { Point } from "../../graphics2d/Point"
4
- import { Point2D } from "../../graphics2d/Point2D"
5
- import { IPointConversion } from "../../renderer/utilities/IPointConversion"
6
-
7
- /**
8
- *
9
- *
10
- */
11
- export class PointConversion implements IPointConversion {
12
- protected _pixelWidth: int = 0;
13
- protected _PixelHeight: int = 0;
14
- protected _geoTop: double = 0;
15
- protected _geoLeft: double = 0;
16
- protected _geoBottom: double = 0;
17
- protected _geoRight: double = 0;
18
- protected _normalize: boolean = true;
19
- //pixels to geo
20
- //double _geoMultiplierX = 0;
21
- //double _geoMultiplierY = 0;
22
- //geo to pixels
23
- protected _pixelMultiplierX: double = 0;
24
- protected _pixelMultiplierY: double = 0;
25
- public set_normalize(value: boolean): void {
26
- this._normalize = value;
27
- }
28
-
29
- public constructor(pixelWidth: int, pixelHeight: int,
30
- geoTop: double, geoLeft: double,
31
- geoBottom: double, geoRight: double) {/*
32
- _pixelWidth = pixelWidth;
33
- _PixelHeight = pixelHeight;
34
- _geoTop = geoTop;
35
- _geoLeft = geoLeft;
36
- _geoBottom = geoBottom;
37
- _geoRight = geoRight;*/
38
-
39
- this.UpdateExtents(pixelWidth, pixelHeight, geoTop, geoLeft, geoBottom, geoRight);
40
- }
41
-
42
- public UpdateExtents(pixelWidth: int, pixelHeight: int,
43
- geoTop: double, geoLeft: double,
44
- geoBottom: double, geoRight: double): void {
45
- this._pixelWidth = pixelWidth;
46
- this._PixelHeight = pixelHeight;
47
- this._geoTop = geoTop;
48
- this._geoLeft = geoLeft;
49
- this._geoBottom = geoBottom;
50
- this._geoRight = geoRight;
51
-
52
- //_geoMultiplierX = ((double)_pixelWidth) / (_geoRight - _geoLeft) ;
53
- //_geoMultiplierY = ((double)_PixelHeight) / (_geoTop - _geoBottom) ;
54
-
55
- this._pixelMultiplierX = (this._geoRight - this._geoLeft) / (this._pixelWidth as double);
56
- this._pixelMultiplierY = (this._geoTop - this._geoBottom) / (this._PixelHeight as double);
57
-
58
- //diagnostic 12-18-12
59
- if (this._geoRight - this._geoLeft < -180) {
60
- this._pixelMultiplierX = (this._geoRight - this._geoLeft + 360) / (this._pixelWidth as double);
61
- }
62
- if (this._geoRight - this._geoLeft > 180) {
63
- this._pixelMultiplierX = (360 - (this._geoRight - this._geoLeft)) / (this._pixelWidth as double);
64
- }
65
- //end section
66
- if (this._geoTop < this._geoBottom) {
67
-
68
- this._pixelMultiplierY = -Math.abs(this._pixelMultiplierY);
69
- }
70
-
71
- else {
72
-
73
- this._pixelMultiplierY = Math.abs(this._pixelMultiplierY);
74
- }
75
-
76
-
77
- // if(_geoRight < _geoLeft)
78
- // _pixelMultiplierX = -Math.abs(_pixelMultiplierX);
79
- // else
80
- // _pixelMultiplierX = Math.abs(_pixelMultiplierX);
81
- //end section
82
- }
83
-
84
- public PixelsToGeo(pixel: Point): Point;
85
-
86
- public PixelsToGeo(pixel: Point2D): Point2D;
87
- public PixelsToGeo(...args: unknown[]): Point | Point2D {
88
- const [pixel] = args as [Point | Point2D];
89
-
90
- let coords: Point | Point2D
91
- if (pixel instanceof Point)
92
- coords = new Point()
93
- else
94
- coords = new Point2D();
95
-
96
- coords.x = pixel.getX() * this._pixelMultiplierX + this._geoLeft; //xMultiplier;
97
- coords.y = this._geoTop - (pixel.getY() * this._pixelMultiplierY);
98
-
99
- //diagnostic 12-18-12
100
- if (coords.x < -180) {
101
-
102
- coords.x += 360;
103
- }
104
-
105
- if (coords.x > 180) {
106
-
107
- coords.x -= 360;
108
- }
109
-
110
- //end section
111
-
112
- return coords;
113
- }
114
-
115
-
116
- public GeoToPixels(coord: Point): Point;
117
-
118
- public GeoToPixels(coord: Point2D): Point2D;
119
- public GeoToPixels(...args: unknown[]): Point | Point2D {
120
- const [coord] = args as [Point | Point2D];
121
-
122
- let pixel: Point | Point2D;
123
- if (coord instanceof Point)
124
- pixel = new Point();
125
- else
126
- pixel = new Point2D();
127
- //double xMultiplier = _pixelMultiplierX;//(_geoRight - _geoLeft) / ((double)_pixelWidth) ;
128
- //double yMultiplier = _pixelMultiplierY;//(_geoTop - _geoBottom) / ((double)_PixelHeight) ;
129
- let temp: double = 0;
130
- //temp = ((coord.getX() - _geoLeft) / _pixelMultiplierX);//xMultiplier);
131
- let calcValue: double = coord.getX() - this._geoLeft;
132
- if (this._normalize) {
133
- if (calcValue < -180) {
134
-
135
- calcValue += 360;
136
- }
137
-
138
- else if (calcValue > 180) {
139
-
140
- calcValue -= 360;
141
- }
142
- }
143
- temp = (calcValue / this._pixelMultiplierX);
144
-
145
- pixel.x = temp;
146
-
147
- temp = ((this._geoTop - coord.getY()) / this._pixelMultiplierY);//yMultiplier);
148
- pixel.y = temp;
149
-
150
- return pixel;
151
- }
152
-
153
-
154
- public getPixelWidth(): int {
155
- return this._pixelWidth;
156
- }
157
-
158
- public getPixelHeight(): int {
159
- return this._PixelHeight;
160
- }
161
-
162
- public getUpperLat(): double {
163
- return this._geoTop;
164
- }
165
-
166
- public getLowerLat(): double {
167
- return this._geoBottom;
168
- }
169
-
170
- public getLeftLon(): double {
171
- return this._geoLeft;
172
- }
173
-
174
- public getRightLon(): double {
175
- return this._geoRight;
176
- }
177
-
178
- }
@@ -1,45 +0,0 @@
1
- import { Point } from "../../graphics2d/Point"
2
- import { Point2D } from "../../graphics2d/Point2D"
3
- import { IPointConversion } from "../../renderer/utilities/IPointConversion"
4
-
5
- /**
6
- * Makes no change to the passed points. Useful for when the points
7
- * are already in pixels.
8
- *
9
- */
10
- export class PointConversionDummy implements IPointConversion {
11
- public constructor() {
12
- }
13
-
14
- public PixelsToGeo(pixel: Point): Point;
15
-
16
- public PixelsToGeo(pixel: Point2D): Point2D;
17
- public PixelsToGeo(...args: unknown[]): Point | Point2D {
18
- const [pixel] = args as [Point | Point2D];
19
-
20
- let coords: Point | Point2D;
21
- if (pixel instanceof Point)
22
- coords = new Point()
23
- else
24
- coords = new Point2D();
25
- coords.x = pixel.getX();
26
- coords.y = pixel.getY();
27
-
28
- return coords;
29
- }
30
-
31
-
32
- public GeoToPixels(coord: Point): Point;
33
-
34
- public GeoToPixels(coord: Point2D): Point2D;
35
- public GeoToPixels(...args: unknown[]): Point | Point2D {
36
- const [coord] = args as [Point2D];
37
- let pixel: Point | Point2D;
38
- if (coord instanceof Point)
39
- pixel = new Point(coord.getX(), coord.getY())
40
- else
41
- pixel = new Point2D(coord.getX(), coord.getY())
42
-
43
- return pixel;
44
- }
45
- }
@@ -1,126 +0,0 @@
1
- import { type double } from "../../graphics2d/BasicTypes";
2
-
3
- import { Point } from "../../graphics2d/Point"
4
- import { Point2D } from "../../graphics2d/Point2D"
5
- import { GeoPixelConversion3D } from "../../renderer/utilities/GeoPixelConversion3D"
6
- import { IPointConversion } from "../../renderer/utilities/IPointConversion"
7
- import { POINT2 } from "../../JavaLineArray/POINT2";
8
-
9
-
10
- /**
11
- *
12
- *
13
- */
14
- export class PointConverter3D implements IPointConversion {
15
- private _controlLat: double = 0;
16
- private _controlLong: double = 0;
17
- private _scale: double = 0;
18
- private _metersPerPixel: double = 0;
19
- public constructor(controlLong: double, controlLat: double, scale: double) {
20
- try {
21
- this._controlLat = controlLat;
22
- this._controlLong = controlLong;
23
- this._scale = scale;
24
- this._metersPerPixel = GeoPixelConversion3D.metersPerPixel(scale);
25
- } catch (e) {
26
- if (e instanceof Error) {
27
- throw e;
28
- } else {
29
- throw e;
30
- }
31
- }
32
- }
33
- public PixelsToGeo(pixel: Point): Point2D;
34
-
35
- public PixelsToGeo(pixel: Point2D): Point2D;
36
- public PixelsToGeo(...args: unknown[]): Point2D | Point2D {
37
- if (args[0] instanceof Point) {
38
- const [pixel] = args as [Point];
39
-
40
-
41
- let pt2dGeo: Point2D;
42
- try {
43
- let y: double = GeoPixelConversion3D.y2lat(pixel.getY(), this._scale, this._controlLat, this._metersPerPixel);
44
- let x: double = GeoPixelConversion3D.x2long(pixel.getX(), this._scale, this._controlLong, y, this._metersPerPixel);
45
- pt2dGeo = new Point2D(x, y);
46
- } catch (e) {
47
- if (e instanceof Error) {
48
- throw e;
49
- } else {
50
- throw e;
51
- }
52
- }
53
- return pt2dGeo;
54
-
55
- } else {
56
- const [pixel] = args as [Point2D];
57
-
58
-
59
- let pt2dGeo: Point2D;
60
- try {
61
- let y: double = GeoPixelConversion3D.y2lat(pixel.getY(), this._scale, this._controlLat, this._metersPerPixel);
62
- let x: double = GeoPixelConversion3D.x2long(pixel.getX(), this._scale, this._controlLong, y, this._metersPerPixel);
63
- pt2dGeo = new Point2D(x, y);
64
- } catch (e) {
65
- if (e instanceof Error) {
66
- throw e;
67
- } else {
68
- throw e;
69
- }
70
- }
71
- return pt2dGeo;
72
-
73
- }
74
- }
75
-
76
-
77
-
78
- public GeoToPixels(coord: Point2D): Point;
79
-
80
- public GeoToPixels(coord: Point2D): Point2D;
81
- public GeoToPixels(...args: unknown[]): Point | Point2D {
82
-
83
- if (args[0] instanceof Point2D) {
84
- const [coord] = args as [Point2D];
85
-
86
-
87
- let ptPixels: Point;
88
- try {
89
- let y: double = GeoPixelConversion3D.lat2y(coord.getY(), this._scale, this._controlLat, this._metersPerPixel);
90
- let x: double = GeoPixelConversion3D.long2x(coord.getX(), this._scale, this._controlLong, coord.getY(), this._metersPerPixel);
91
- ptPixels = new Point();
92
- ptPixels.setLocation(x, y);
93
- } catch (e) {
94
- if (e instanceof Error) {
95
- throw e;
96
- } else {
97
- throw e;
98
- }
99
- }
100
- return ptPixels;
101
-
102
- } else {
103
-
104
- const [coord] = args as [Point2D];
105
-
106
-
107
- let pt2DPixels: Point2D;
108
- try {
109
- let y: double = GeoPixelConversion3D.lat2y(coord.getY(), this._scale, this._controlLat, this._metersPerPixel);
110
- let x: double = GeoPixelConversion3D.long2x(coord.getX(), this._scale, this._controlLong, coord.getY(), this._metersPerPixel);
111
- pt2DPixels = new Point2D(x, y);
112
- } catch (e) {
113
- if (e instanceof Error) {
114
- throw e;
115
- } else {
116
- throw e;
117
- }
118
- }
119
- return pt2DPixels;
120
-
121
-
122
-
123
- }
124
- }
125
-
126
- }
@@ -1,118 +0,0 @@
1
- import { type int, type double } from "../../graphics2d/BasicTypes";
2
-
3
- import { Rectangle } from "../../graphics2d/Rectangle"
4
- import { Rectangle2D } from "../../graphics2d/Rectangle2D"
5
- import { Rectangle as Rect } from "../shapes/rectangle";
6
-
7
- export class RectUtilities {
8
-
9
- public static makeRectangleFromRect(x1: int, y1: int, x2: int, y2: int): Rectangle {
10
- return new Rectangle(x1, y1, x2 - x1, y2 - y1);
11
- }
12
-
13
- public static makeRectangle2DFromRect(x1: double, y1: double, x2: double, y2: double): Rectangle2D {
14
- return new Rectangle2D(x1, y1, x2 - x1, y2 - y1);
15
- }
16
-
17
-
18
-
19
- /**
20
- * Copies a Rectangle
21
- * @param rect {@link Rectangle2D}
22
- * @return {@link Rectangle2D}
23
- */
24
- public static copyRect(rect: Rectangle2D): Rectangle2D {
25
- return new Rectangle2D(rect.getX() as int, rect.getY() as int, (rect.getWidth() + 0.5) as int, (rect.getHeight() + 0.5) as int);
26
- }
27
-
28
- /**
29
- * copies and rounds the points. x,y round down &amp; width,height round up
30
- * @param rect {@link Rectangle2D}
31
- * @return {@link Rectangle2D}
32
- */
33
- public static roundRect(rect: Rectangle2D): Rectangle2D {
34
- let offsetX: double = rect.getX() - (rect.getX()) as int;
35
- let offsetY: double = rect.getY() - (rect.getY()) as int;
36
-
37
- return new Rectangle2D(rect.getX() as int, rect.getY() as int, (Math.round(rect.getWidth() + offsetX + 0.5)) as int, Math.round(rect.getHeight() + offsetY + 0.5) as int);
38
- }
39
-
40
- public static grow(rect: Rectangle2D, size: int): void {
41
- rect.setRect(rect.getX() - size, rect.getY() - size, rect.getWidth() + (size * 2), rect.getHeight() + (size * 2));
42
- //return new Rectangle2D(rect.left - size, rect.top - size, rect.right + size, rect.bottom + size);
43
- }
44
-
45
-
46
- public static shift(rect: Rectangle2D, x: int, y: int): void {
47
- rect.setRect(rect.getX() + x, rect.getY() + y, rect.getWidth(), rect.getHeight());
48
- }
49
-
50
-
51
- public static shiftBR(rect: Rectangle2D, x: int, y: int): void {
52
- rect.setRect(rect.getX(), rect.getY(), rect.getWidth() + x, rect.getHeight() + y);
53
- }
54
-
55
- public static toRectangle(b: Rectangle2D): Rectangle;
56
-
57
- public static toRectangle(x: double, y: double, w: double, h: double): Rectangle;
58
- public static toRectangle(...args: unknown[]): Rectangle | null {
59
- switch (args.length) {
60
- case 1: {
61
- const [b] = args as [Rectangle2D];
62
-
63
-
64
- if (b == null) {
65
- return null;
66
- }/*from w ww . j a va 2s . c o m*/
67
- if (b instanceof Rectangle) {
68
- return b as Rectangle;
69
- } else {
70
- return new Rectangle(b.getX() as int, b.getY() as int,
71
- b.getWidth() as int, b.getHeight() as int);
72
- }
73
-
74
- }
75
-
76
- case 4: {
77
- const [x, y, w, h] = args as [double, double, double, double];
78
-
79
- return new Rectangle(x as int, y as int,w as int, h as int);
80
- }
81
-
82
- default: {
83
- throw Error(`Invalid number of arguments`);
84
- }
85
- }
86
- }
87
-
88
- public static toRectangle2D(b: Rectangle): Rectangle2D;
89
- public static toRectangle2D(x: double, y: double, w: double, h: double): Rectangle2D;
90
- public static toRectangle2D(...args: unknown[]): Rectangle2D | null {
91
- switch (args.length) {
92
- case 1: {
93
- const [b] = args as [Rectangle];
94
-
95
-
96
- if (b == null) {
97
- return null;
98
- }/*from w ww . j a va 2s . c o m*/
99
- else
100
- {
101
- return new Rectangle2D(b.getX(), b.getY(),b.getWidth(), b.getHeight());
102
- }
103
-
104
- }
105
-
106
- case 4: {
107
- const [x, y, w, h] = args as [double, double, double, double];
108
-
109
- return new Rectangle2D(x as int, y as int,w as int, h as int);
110
- }
111
-
112
- default: {
113
- throw Error(`Invalid number of arguments`);
114
- }
115
- }
116
- }
117
-
118
- }
@@ -1,11 +0,0 @@
1
- /**
2
- *
3
- *
4
- */
5
- export class RendererException extends Error {
6
-
7
- public constructor(message: string, cause: Error | null) {
8
- super(message);
9
- }
10
-
11
- }