@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,203 @@
1
+ import { Rectangle } from "./rectangle";
2
+
3
+ export class ShapeUtilties
4
+ {
5
+
6
+ /**
7
+ * Returns an indicator of where the specified point
8
+ * {@code (px,py)} lies with respect to the line segment from
9
+ * {@code (x1,y1)} to {@code (x2,y2)}.
10
+ * The return value can be either 1, -1, or 0 and indicates
11
+ * in which direction the specified line must pivot around its
12
+ * first end point, {@code (x1,y1)}, in order to point at the
13
+ * specified point {@code (px,py)}.
14
+ * <p>A return value of 1 indicates that the line segment must
15
+ * turn in the direction that takes the positive X axis towards
16
+ * the negative Y axis. In the default coordinate system used by
17
+ * Java 2D, this direction is counterclockwise.
18
+ * <p>A return value of -1 indicates that the line segment must
19
+ * turn in the direction that takes the positive X axis towards
20
+ * the positive Y axis. In the default coordinate system, this
21
+ * direction is clockwise.
22
+ * <p>A return value of 0 indicates that the point lies
23
+ * exactly on the line segment. Note that an indicator value
24
+ * of 0 is rare and not useful for determining colinearity
25
+ * because of floating point rounding issues.
26
+ * <p>If the point is colinear with the line segment, but
27
+ * not between the end points, then the value will be -1 if the point
28
+ * lies "beyond {@code (x1,y1)}" or 1 if the point lies
29
+ * "beyond {@code (x2,y2)}".
30
+ *
31
+ * @param x1 the X coordinate of the start point of the
32
+ * specified line segment
33
+ * @param y1 the Y coordinate of the start point of the
34
+ * specified line segment
35
+ * @param x2 the X coordinate of the end point of the
36
+ * specified line segment
37
+ * @param y2 the Y coordinate of the end point of the
38
+ * specified line segment
39
+ * @param px the X coordinate of the specified point to be
40
+ * compared with the specified line segment
41
+ * @param py the Y coordinate of the specified point to be
42
+ * compared with the specified line segment
43
+ * @return an integer that indicates the position of the third specified
44
+ * coordinates with respect to the line segment formed
45
+ * by the first two specified coordinates.
46
+ * @since 1.2
47
+ */
48
+ public static relativeCCW = function(x1, y1, x2, y2, px, py)
49
+ {
50
+ x2 -= x1;
51
+ y2 -= y1;
52
+ px -= x1;
53
+ py -= y1;
54
+ var ccw = px * y2 - py * x2;
55
+ if (ccw === 0.0) {
56
+ // The point is colinear, classify based on which side of
57
+ // the segment the point falls on. We can calculate a
58
+ // relative value using the projection of px,py onto the
59
+ // segment - a negative value indicates the point projects
60
+ // outside of the segment in the direction of the particular
61
+ // endpoint used as the origin for the projection.
62
+ ccw = px * x2 + py * y2;
63
+ if (ccw > 0.0) {
64
+ // Reverse the projection to be relative to the original x2,y2
65
+ // x2 and y2 are simply negated.
66
+ // px and py need to have (x2 - x1) or (y2 - y1) subtracted
67
+ // from them (based on the original values)
68
+ // Since we really want to get a positive answer when the
69
+ // point is "beyond (x2,y2)", then we want to calculate
70
+ // the inverse anyway - thus we leave x2 & y2 negated.
71
+ px -= x2;
72
+ py -= y2;
73
+ ccw = px * x2 + py * y2;
74
+ if (ccw < 0.0) {
75
+ ccw = 0.0;
76
+ }
77
+ }
78
+ }
79
+ return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0);
80
+ };
81
+
82
+ public static linesIntersect = function(x1,y1,x2,y2,x3,y3,x4,y4)
83
+ {
84
+ var rCCW1 = this.relativeCCW(x1,y1,
85
+ x2,y2,
86
+ x3,y3),
87
+
88
+ rCCW2 = this.relativeCCW(x1,y1,
89
+ x2,y2,
90
+ x4,y4),
91
+
92
+ rCCW3 = this.relativeCCW(x3,y3,
93
+ x4,y4,
94
+ x1,y1),
95
+
96
+ rCCW4 = this.relativeCCW(x3,y3,
97
+ x4,y4,
98
+ x2,y2);
99
+
100
+ return (((rCCW1 * rCCW2) <= 0) && ((rCCW3 * rCCW4) <= 0));
101
+ };
102
+
103
+ /**
104
+ * Intersects the pair of specified source <code>Rectangle</code>
105
+ * objects and puts the result into the specified destination
106
+ * <code>Rectangle</code> object. One of the source rectangles
107
+ * can also be the destination to avoid creating a third Rectangle2D
108
+ * object, but in this case the original points of this source
109
+ * rectangle will be overwritten by this method.
110
+ * @param src1 the first of a pair of <code>Rectangle</code>
111
+ * objects to be intersected with each other
112
+ * @param src2 the second of a pair of <code>Rectangle</code>
113
+ * objects to be intersected with each other
114
+ * @return the <code>Rectangle</code> that holds the
115
+ * results of the intersection of <code>src1</code> and
116
+ * <code>src2</code>
117
+ * @since 1.2
118
+ */
119
+ public static intersectRects = function(src1:Rectangle,src2:Rectangle):Rectangle
120
+ {
121
+ var x1 = Math.max(src1.getX(), src2.getX()),
122
+ y1 = Math.max(src1.getY(), src2.getY()),
123
+ x2 = Math.min(src1.getX() + src1.getWidth(), src2.getX() + src2.getWidth()),
124
+ y2 = Math.min(src1.getY() + src1.getHeight() , src2.getY() + src2.getHeight());
125
+
126
+ return new Rectangle(x1, y1, x2-x1, y2-y1);
127
+ };
128
+
129
+ /**
130
+ * Unions the pair of source <code>Rectangle</code> objects
131
+ * and puts the result into the specified destination
132
+ * <code>Rectangle</code> object. One of the source rectangles
133
+ * can also be the destination to avoid creating a third Rectangle
134
+ * object, but in this case the original points of this source
135
+ * rectangle will be overwritten by this method.
136
+ * @param src1 the first of a pair of <code>Rectangle</code>
137
+ * objects to be combined with each other
138
+ * @param src2 the second of a pair of <code>Rectangle</code>
139
+ * objects to be combined with each other
140
+ * @return the <code>Rectangle</code> that holds the
141
+ * results of the union of <code>src1</code> and
142
+ * <code>src2</code>
143
+ * @since 1.2
144
+ */
145
+ /*public static unionRects = function(src1:Rectangle,src2:Rectangle):Rectangle
146
+ {
147
+ var x1 = Math.min(src1.getX(), src2.getX()),
148
+ y1 = Math.min(src1.getY(), src2.getY()),
149
+ x2 = Math.max(src1.getX() + src1.getWidth(), src2.getX() + src2.getWidth()),
150
+ y2 = Math.max(src1.getY() + src1.getHeight(), src2.getY() + src2.getHeight());
151
+ return new Rectangle(x1, y1, x2, y2);
152
+ };//*/
153
+ }
154
+
155
+ /*
156
+ if(typeof CanvasRenderingContext2D !== 'undefined' && CanvasRenderingContext2D.prototype.dashedLineTo !== 'undefined')
157
+ { //public function from:
158
+ //https://davidowens.wordpress.com/2010/09/07/html-5-canvas-dashed-lines/
159
+ CanvasRenderingContext2D.prototype.dashedLineTo = function (fromX, fromY, toX, toY, pattern)
160
+ {
161
+ // Our growth rate for our line can be one of the following:
162
+ // (+,+), (+,-), (-,+), (-,-)
163
+ // Because of this, our algorithm needs to understand if the x-coord and
164
+ // y-coord should be getting smaller or larger and properly cap the values
165
+ // based on (x,y).
166
+ var lt = function (a, b) { return a <= b; };
167
+ var gt = function (a, b) { return a >= b; };
168
+ var capmin = function (a, b) { return Math.min(a, b); };
169
+ var capmax = function (a, b) { return Math.max(a, b); };
170
+
171
+ var checkX = { thereYet: gt, cap: capmin };
172
+ var checkY = { thereYet: gt, cap: capmin };
173
+
174
+ if (fromY - toY > 0) {
175
+ checkY.thereYet = lt;
176
+ checkY.cap = capmax;
177
+ }
178
+ if (fromX - toX > 0)
179
+ {
180
+ checkX.thereYet = lt;
181
+ checkX.cap = capmax;
182
+ }
183
+
184
+ this.moveTo(fromX, fromY);
185
+ var offsetX = fromX;
186
+ var offsetY = fromY;
187
+ var idx = 0, dash = true;
188
+ while (!(checkX.thereYet(offsetX, toX) && checkY.thereYet(offsetY, toY)))
189
+ {
190
+ var ang = Math.atan2(toY - fromY, toX - fromX);
191
+ var len = pattern[idx];
192
+
193
+ offsetX = checkX.cap(toX, offsetX + (Math.cos(ang) * len));
194
+ offsetY = checkY.cap(toY, offsetY + (Math.sin(ang) * len));
195
+
196
+ if (dash) this.lineTo(offsetX, offsetY);
197
+ else this.moveTo(offsetX, offsetY);
198
+
199
+ idx = (idx + 1) % pattern.length;
200
+ dash = !dash;
201
+ }
202
+ };
203
+ }*/
@@ -0,0 +1,104 @@
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+
6
+
7
+ import { Color } from "../../renderer/utilities/Color"
8
+
9
+ /**
10
+ * Default Affiliation Colors for the symbols
11
+ *
12
+ */
13
+ export class AffiliationColors {
14
+
15
+ //public static colorexists: boolean = (typeof Color === 'function');
16
+ /// <summary>
17
+ /// Friendly Unit Fill Color.
18
+ /// </summary>
19
+ public static FriendlyUnitFillColor: Color = new Color(128, 224, 255);
20
+ /// <summary>
21
+ /// Hostile Unit Fill Color.
22
+ /// </summary>
23
+ public static HostileUnitFillColor: Color = new Color(255, 128, 128);//new Color(255,130,132);//Color.RED;
24
+ /// <summary>
25
+ /// Neutral Unit Fill Color.
26
+ /// </summary>
27
+ public static NeutralUnitFillColor: Color = new Color(170, 255, 170);//new Color(144,238,144);//Color.GREEN;//new Color(0,255,0);//new Color(144,238,144);//light green//Color.GREEN;new Color(0,226,0);
28
+ /// <summary>
29
+ /// Unknown Unit Fill Color.
30
+ /// </summary>
31
+ public static UnknownUnitFillColor: Color = new Color(255, 255, 128);// new Color(255,255,128);//Color.YELLOW;
32
+
33
+ public static SuspectUnitFillColor: Color = new Color(255, 229, 153);
34
+
35
+ /// <summary>
36
+ /// Friendly Graphic Fill Color.
37
+ /// </summary>
38
+ public static FriendlyGraphicFillColor: Color = new Color(128, 224, 255);//Crystal Blue //Color.CYAN;
39
+ /// <summary>
40
+ /// Hostile Graphic Fill Color.
41
+ /// </summary>
42
+ public static HostileGraphicFillColor: Color = new Color(255, 128, 128);//salmon
43
+ /// <summary>
44
+ /// Neutral Graphic Fill Color.
45
+ /// </summary>
46
+ public static NeutralGraphicFillColor: Color = new Color(170, 255, 170);//Bamboo Green //new Color(144,238,144);//light green
47
+ /// <summary>
48
+ /// Unknown Graphic Fill Color.
49
+ /// </summary>
50
+ public static UnknownGraphicFillColor: Color = new Color(255, 255, 128);//light yellow new Color(255,255,224);//light yellow
51
+
52
+ public static SuspectGraphicFillColor: Color = new Color(255, 229, 153);
53
+
54
+ /// <summary>
55
+ /// Friendly Unit Line Color.
56
+ /// </summary>
57
+ public static FriendlyUnitLineColor: Color = Color.BLACK;
58
+ /// <summary>
59
+ /// Hostile Unit Line Color.
60
+ /// </summary>
61
+ public static HostileUnitLineColor: Color = Color.BLACK;
62
+ /// <summary>
63
+ /// Neutral Unit Line Color.
64
+ /// </summary>
65
+ public static NeutralUnitLineColor: Color = Color.BLACK;
66
+ /// <summary>
67
+ /// Unknown Unit Line Color.
68
+ /// </summary>
69
+ public static UnknownUnitLineColor: Color = Color.BLACK;
70
+
71
+ public static SuspectUnitLineColor: Color = Color.BLACK;
72
+
73
+ /// <summary>
74
+ /// Friendly Graphic Line Color.
75
+ /// </summary>
76
+ public static FriendlyGraphicLineColor: Color = Color.BLACK;
77
+ /// <summary>
78
+ /// Hostile Graphic Line Color.
79
+ /// </summary>
80
+ public static HostileGraphicLineColor: Color = Color.RED;
81
+ /// <summary>
82
+ /// Neutral Graphic Line Color.
83
+ /// </summary>
84
+ public static NeutralGraphicLineColor: Color = Color.GREEN;
85
+ /// <summary>
86
+ /// Unknown Graphic Line Color.
87
+ /// </summary>
88
+ public static UnknownGraphicLineColor: Color = Color.YELLOW;
89
+
90
+ public static SuspectGraphicLineColor: Color = new Color(255, 188, 1);
91
+
92
+ public static ObstacleGreenDark: Color = new Color(0,166,81);
93
+ public static ObstacleGreen: Color = new Color(0,255,0);
94
+
95
+ public static WeatherRed: Color = new Color(198, 16, 33);//0xC61021;// 198,16,33
96
+ public static WeatherBlue: Color = new Color(0, 0, 255);//0x0000FF;// 0,0,255
97
+
98
+ public static WeatherPurpleDark: Color = new Color(128, 0, 128);//0x800080;// 128,0,128 Plum Red
99
+ public static WeatherPurpleLight: Color = new Color(226, 159, 255);//0xE29FFF;// 226,159,255 Light Orchid
100
+
101
+ public static WeatherBrownDark: Color = new Color(128, 98, 16);//0x806210;// 128,98,16 Safari
102
+ public static WeatherBrownLight: Color = new Color(210, 176, 106);//0xD2B06A;// 210,176,106 Khaki
103
+
104
+ }