@pirireis/webglobeplugins 0.9.8 → 0.9.9

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 (213) hide show
  1. package/index.js +58 -15
  2. package/package.json +1 -1
  3. package/dist/Math/angle-calculation.js +0 -15
  4. package/dist/Math/arc.js +0 -65
  5. package/dist/Math/bounds/line-bbox.js +0 -188
  6. package/dist/Math/constants.js +0 -9
  7. package/dist/Math/frustum/camera.js +0 -24
  8. package/dist/Math/frustum/from-globeinfo.js +0 -48
  9. package/dist/Math/frustum/types.js +0 -2
  10. package/dist/Math/globe-util/horizon-plane.js +0 -112
  11. package/dist/Math/index.js +0 -1
  12. package/dist/Math/juction/arc-plane.js +0 -83
  13. package/dist/Math/juction/line-sphere.js +0 -25
  14. package/dist/Math/juction/plane-plane.js +0 -58
  15. package/dist/Math/line.js +0 -56
  16. package/dist/Math/matrix4.js +0 -1
  17. package/dist/Math/methods.js +0 -201
  18. package/dist/Math/plane.js +0 -60
  19. package/dist/Math/quaternion.js +0 -104
  20. package/dist/Math/types.js +0 -2
  21. package/dist/Math/utils.js +0 -4
  22. package/dist/Math/vec3.js +0 -126
  23. package/dist/algorithms/search-binary.js +0 -19
  24. package/dist/altitude-locator/adaptors.js +0 -1
  25. package/dist/altitude-locator/draw-subset-obj.js +0 -18
  26. package/dist/altitude-locator/keymethod.js +0 -1
  27. package/dist/altitude-locator/plugin.js +0 -341
  28. package/dist/altitude-locator/types.js +0 -23
  29. package/dist/arrowfield/adaptor.js +0 -14
  30. package/dist/arrowfield/index.js +0 -10
  31. package/dist/arrowfield/plugin.js +0 -86
  32. package/dist/bearing-line/index.js +0 -8
  33. package/dist/bearing-line/plugin.js +0 -449
  34. package/dist/circle-line-chain/chain-list-map.js +0 -205
  35. package/dist/circle-line-chain/init.js +0 -1
  36. package/dist/circle-line-chain/plugin.js +0 -424
  37. package/dist/circle-line-chain/util.js +0 -5
  38. package/dist/compass-rose/compass-rose-padding-flat.js +0 -225
  39. package/dist/compass-rose/compass-text-writer.js +0 -153
  40. package/dist/compass-rose/index.js +0 -7
  41. package/dist/compassrose/compassrose.js +0 -296
  42. package/dist/compassrose/index.js +0 -8
  43. package/dist/globe-types.js +0 -1
  44. package/dist/heatwave/index.js +0 -10
  45. package/dist/heatwave/isobar/objectarraylabels.js +0 -202
  46. package/dist/heatwave/isobar/plugin.js +0 -343
  47. package/dist/heatwave/isobar/quadtreecontours.js +0 -300
  48. package/dist/heatwave/plugins/heatwaveglobeshell.js +0 -206
  49. package/dist/index.js +0 -58
  50. package/dist/jest.config.js +0 -7
  51. package/dist/partialrings/buffer-manager.js +0 -81
  52. package/dist/partialrings/index.js +0 -41
  53. package/dist/partialrings/plugin.js +0 -135
  54. package/dist/partialrings/program.js +0 -286
  55. package/dist/pin/pin-object-array.js +0 -305
  56. package/dist/pin/pin-point-totem.js +0 -60
  57. package/dist/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -66
  58. package/dist/point-heat-map/index.js +0 -1
  59. package/dist/point-heat-map/plugin-webworker.js +0 -126
  60. package/dist/point-heat-map/point-to-heat-map-flow.js +0 -127
  61. package/dist/point-tracks/key-methods.js +0 -5
  62. package/dist/point-tracks/plugin.js +0 -338
  63. package/dist/programs/arrowfield/index.js +0 -7
  64. package/dist/programs/arrowfield/logic.js +0 -257
  65. package/dist/programs/arrowfield/object.js +0 -66
  66. package/dist/programs/data2legend/density-to-legend.js +0 -101
  67. package/dist/programs/data2legend/point-to-density-texture.js +0 -100
  68. package/dist/programs/float2legendwithratio/index.js +0 -8
  69. package/dist/programs/float2legendwithratio/logic.js +0 -171
  70. package/dist/programs/float2legendwithratio/object.js +0 -110
  71. package/dist/programs/globe-util/is-globe-moved.js +0 -21
  72. package/dist/programs/globeshell/index.js +0 -8
  73. package/dist/programs/globeshell/noise/noises.js +0 -1
  74. package/dist/programs/globeshell/wiggle/index.js +0 -8
  75. package/dist/programs/globeshell/wiggle/logic.js +0 -345
  76. package/dist/programs/globeshell/wiggle/object.js +0 -72
  77. package/dist/programs/helpers/blender/index.js +0 -1
  78. package/dist/programs/helpers/blender/program.js +0 -79
  79. package/dist/programs/helpers/fadeaway/index.js +0 -7
  80. package/dist/programs/helpers/fadeaway/logic.js +0 -72
  81. package/dist/programs/helpers/fadeaway/object.js +0 -20
  82. package/dist/programs/helpers/index.js +0 -8
  83. package/dist/programs/index.js +0 -58
  84. package/dist/programs/interface.js +0 -1
  85. package/dist/programs/line-on-globe/angled-line.js +0 -176
  86. package/dist/programs/line-on-globe/circle-accurate-3d.js +0 -141
  87. package/dist/programs/line-on-globe/circle-accurate-flat.js +0 -216
  88. package/dist/programs/line-on-globe/circle-accurate.js +0 -178
  89. package/dist/programs/line-on-globe/circle.js +0 -167
  90. package/dist/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -159
  91. package/dist/programs/line-on-globe/index.js +0 -1
  92. package/dist/programs/line-on-globe/lines-color-instanced-flat.js +0 -136
  93. package/dist/programs/line-on-globe/linestrip.js +0 -171
  94. package/dist/programs/line-on-globe/naive-accurate-flexible.js +0 -195
  95. package/dist/programs/line-on-globe/to-the-surface.js +0 -111
  96. package/dist/programs/line-on-globe/util.js +0 -8
  97. package/dist/programs/picking/pickable-renderer.js +0 -188
  98. package/dist/programs/point-on-globe/element-globe-surface-glow.js +0 -142
  99. package/dist/programs/point-on-globe/element-point-glow.js +0 -153
  100. package/dist/programs/point-on-globe/square-pixel-point.js +0 -174
  101. package/dist/programs/programcache.js +0 -131
  102. package/dist/programs/rings/distancering/circleflatprogram.js +0 -156
  103. package/dist/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -369
  104. package/dist/programs/rings/distancering/circlepaddysharedbuffer.js +0 -357
  105. package/dist/programs/rings/distancering/index.js +0 -14
  106. package/dist/programs/rings/distancering/paddyflatprogram.js +0 -172
  107. package/dist/programs/rings/distancering/paddyflatprogram2d.js +0 -174
  108. package/dist/programs/rings/distancering/paddyflatprogram3d.js +0 -172
  109. package/dist/programs/rings/distancering/shader.js +0 -1
  110. package/dist/programs/rings/index.js +0 -17
  111. package/dist/programs/rings/partial-ring/piece-of-pie.js +0 -275
  112. package/dist/programs/totems/camerauniformblock.js +0 -160
  113. package/dist/programs/totems/canvas-webglobe-info.js +0 -110
  114. package/dist/programs/totems/gpu-selection-uniform-block.js +0 -108
  115. package/dist/programs/totems/index.js +0 -40
  116. package/dist/programs/two-d/pixel-circle.js +0 -1
  117. package/dist/programs/two-d/pixel-padding-for-compass.js +0 -162
  118. package/dist/programs/util.js +0 -17
  119. package/dist/programs/vectorfields/index.js +0 -23
  120. package/dist/programs/vectorfields/logics/drawrectangleparticles.js +0 -107
  121. package/dist/programs/vectorfields/logics/index.js +0 -12
  122. package/dist/programs/vectorfields/logics/pixelbased.js +0 -142
  123. package/dist/programs/vectorfields/logics/ubo.js +0 -63
  124. package/dist/programs/vectorfields/pingpongbuffermanager.js +0 -76
  125. package/dist/rangerings/enum.js +0 -5
  126. package/dist/rangerings/index.js +0 -15
  127. package/dist/rangerings/plugin.js +0 -560
  128. package/dist/rangerings/rangeringangletext.js +0 -329
  129. package/dist/rangerings/ring-account.js +0 -117
  130. package/dist/shaders/fragment-toy/firework.js +0 -58
  131. package/dist/shaders/fragment-toy/singularity.js +0 -59
  132. package/dist/shape-on-terrain/arc/naive/plugin.js +0 -252
  133. package/dist/timetracks/adaptors-line-strip.js +0 -71
  134. package/dist/timetracks/adaptors.js +0 -122
  135. package/dist/timetracks/index.js +0 -19
  136. package/dist/timetracks/plugin-line-strip.js +0 -250
  137. package/dist/timetracks/plugin.js +0 -258
  138. package/dist/timetracks/program-line-strip.js +0 -611
  139. package/dist/timetracks/program.js +0 -772
  140. package/dist/timetracks/programpoint-line-strip.js +0 -154
  141. package/dist/timetracks/programpoint.js +0 -147
  142. package/dist/types.js +0 -15
  143. package/dist/util/account/bufferoffsetmanager.js +0 -179
  144. package/dist/util/account/index.js +0 -23
  145. package/dist/util/account/single-attribute-buffer-management/buffer-manager.js +0 -108
  146. package/dist/util/account/single-attribute-buffer-management/buffer-orchestrator.js +0 -150
  147. package/dist/util/account/single-attribute-buffer-management/index.js +0 -9
  148. package/dist/util/account/single-attribute-buffer-management/object-store.js +0 -51
  149. package/dist/util/account/single-attribute-buffer-management/types.js +0 -2
  150. package/dist/util/account/util.js +0 -22
  151. package/dist/util/algorithms/index.js +0 -1
  152. package/dist/util/algorithms/search-binary.js +0 -28
  153. package/dist/util/check/get.js +0 -18
  154. package/dist/util/check/index.js +0 -1
  155. package/dist/util/check/typecheck.js +0 -49
  156. package/dist/util/geometry/index.js +0 -51
  157. package/dist/util/gl-util/buffer/attribute-loader.js +0 -69
  158. package/dist/util/gl-util/buffer/index.js +0 -6
  159. package/dist/util/gl-util/buffer/types.js +0 -1
  160. package/dist/util/gl-util/draw-options/methods.js +0 -38
  161. package/dist/util/gl-util/draw-options/types.js +0 -15
  162. package/dist/util/gl-util/uniform-block/manager.js +0 -156
  163. package/dist/util/gl-util/uniform-block/shader.js +0 -1
  164. package/dist/util/gl-util/uniform-block/types.js +0 -8
  165. package/dist/util/heatwavedatamanager/datamanager.js +0 -152
  166. package/dist/util/heatwavedatamanager/index.js +0 -10
  167. package/dist/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -122
  168. package/dist/util/heatwavedatamanager/pointcoordsmeta.js +0 -20
  169. package/dist/util/index.js +0 -57
  170. package/dist/util/interpolation/index.js +0 -1
  171. package/dist/util/interpolation/timetrack/index.js +0 -5
  172. package/dist/util/interpolation/timetrack/timetrack-interpolator.js +0 -79
  173. package/dist/util/interpolation/timetrack/web-worker-str.js +0 -183
  174. package/dist/util/interpolation/timetrack/web-worker.js +0 -48
  175. package/dist/util/jshelpers/data-filler.js +0 -20
  176. package/dist/util/jshelpers/equality.js +0 -20
  177. package/dist/util/jshelpers/index.js +0 -37
  178. package/dist/util/jshelpers/timefilters.js +0 -32
  179. package/dist/util/picking/fence.js +0 -46
  180. package/dist/util/picking/picker-displayer.js +0 -139
  181. package/dist/util/programs/draw-texture-on-canvas.js +0 -89
  182. package/dist/util/programs/index.js +0 -17
  183. package/dist/util/programs/shapesonglobe.js +0 -214
  184. package/dist/util/programs/supersampletotextures.js +0 -113
  185. package/dist/util/programs/texturetoglobe.js +0 -182
  186. package/dist/util/shaderfunctions/geometrytransformations.js +0 -340
  187. package/dist/util/shaderfunctions/index.js +0 -18
  188. package/dist/util/shaderfunctions/nodata.js +0 -11
  189. package/dist/util/shaderfunctions/noisefunctions.js +0 -43
  190. package/dist/util/surface-line-data/arc-bboxes.js +0 -25
  191. package/dist/util/surface-line-data/arcs-to-cuts.js +0 -50
  192. package/dist/util/surface-line-data/cut-arc.js +0 -1
  193. package/dist/util/surface-line-data/flow.js +0 -28
  194. package/dist/util/surface-line-data/rbush-manager.js +0 -1
  195. package/dist/util/surface-line-data/types.js +0 -1
  196. package/dist/util/surface-line-data/web-worker.js +0 -1
  197. package/dist/util/webglobe/gldefaultstates.js +0 -7
  198. package/dist/util/webglobe/index.js +0 -18
  199. package/dist/util/webglobe/rasteroverlay.js +0 -78
  200. package/dist/util/webglobjectbuilders.js +0 -388
  201. package/dist/util/webglobjectbuilders1.js +0 -237
  202. package/dist/waveparticles/adaptor.js +0 -17
  203. package/dist/waveparticles/index.js +0 -10
  204. package/dist/waveparticles/plugin.js +0 -266
  205. package/dist/wind/imagetovectorfieldandmagnitude.js +0 -35
  206. package/dist/wind/index.js +0 -14
  207. package/dist/wind/plugin.js +0 -926
  208. package/dist/wind/vectorfieldimage.js +0 -25
  209. package/dist/write-text/attached-text-writer.js +0 -91
  210. package/dist/write-text/context-text.js +0 -98
  211. package/dist/write-text/context-text3.js +0 -155
  212. package/dist/write-text/index.js +0 -5
  213. package/dist/write-text/writer-plugin.js +0 -8
@@ -1,329 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const webglobe_1 = require("@pirireis/webglobe");
4
- const enum_1 = require("./enum");
5
- const fidKey = "__fid__";
6
- const object = {
7
- "displayName": "RangeRingAngleText",
8
- "layerType": 3,
9
- "wkbGeom": null,
10
- "wfsLayerName": null,
11
- "objectType": "point",
12
- "bbox": null,
13
- "startLod": 2,
14
- "endLod": 30,
15
- "continuousLOD": true,
16
- "MVTXYZName": "hd_seyp",
17
- "rasterize": false,
18
- };
19
- class RangeRingAngleText {
20
- constructor(globe, id, { style = null, hideAll = false, opacity = 1 } = {}) {
21
- this.globe = globe;
22
- this.ObjectArray = globe.ObjectArray;
23
- this.id = id;
24
- this._hideAll = hideAll;
25
- this._opacity = opacity;
26
- const style_ = style !== null ? style : this.getDefaultStyle();
27
- this.object = Object.assign({}, object, { style: style_, id: this.id });
28
- this._centerCollection = new Map();
29
- // new inner MAP params
30
- // hide
31
- // textHide
32
- this.ObjectArray.Add(this.object);
33
- }
34
- getDefaultStyle() {
35
- const style = this.ObjectArray.GetDefaultStyle();
36
- style.fidKey = fidKey;
37
- const { labels } = style;
38
- const label = labels[0];
39
- label.offset = { x: 0, y: 0 };
40
- label.fontFamily.hollowWidth = 1;
41
- label.vAlignment = 2;
42
- label.hAlignment = 2;
43
- label.size = 17;
44
- // eslint-disable-next-line
45
- label.text = "`${aci}`";
46
- return style;
47
- }
48
- setStyle(style) {
49
- if (style === null)
50
- return;
51
- style.opacity = this._opacity;
52
- this.object.style = style;
53
- this.ObjectArray.StyleChanged(this.object);
54
- }
55
- setOpacity(opacity) {
56
- this._opacity = opacity;
57
- const { style } = this.object;
58
- style.opacity = opacity;
59
- this.ObjectArray.StyleChanged(this.object);
60
- }
61
- free() {
62
- this.flush();
63
- this.ObjectArray.Delete(this.id);
64
- }
65
- /**
66
- * @param {Array<{centerID,stepAngle, long,lat, rings>} ringDatas
67
- * centerID: string | ObjectArray fidKey de kullanilir
68
- * stepAngle: number | 0-360 arasinda
69
- * long,lat: number | merkez koordinatlari lat long radian. Globe icin dereceye iceride cevrilir
70
- * rings: Array<{radius: number}> | En buyuk halkaya centik acilari yazilir, Sonraki adim yaricaplarin uzunlugunu yazdirmak
71
- *
72
- * eger bir centerID zaten var ise: Onceki noktalar dusurulur ve yeniden eklenir
73
- *
74
- * */
75
- insertBulk(ringDatas) {
76
- const { _hideAll } = this;
77
- const addBucket = {
78
- coords: [],
79
- coordsZ: [],
80
- attribs: []
81
- };
82
- const deleteBucket = {
83
- coords: [],
84
- coordsZ: [],
85
- attribs: []
86
- };
87
- for (const { centerID, long, lat, rings, stepAngle, hide = enum_1.ENUM_HIDE.SHOW, textHide = enum_1.ENUM_TEXT_HIDE.SHOW } of ringDatas) {
88
- if (this._centerCollection.has(centerID)) {
89
- this._fillDeleteBucket(centerID, deleteBucket);
90
- }
91
- const maxRadius = rings.reduce((acc, { radius }) => Math.max(acc, radius), 0);
92
- const textHide_ = _hideAll ? enum_1.ENUM_TEXT_HIDE.HIDE : textHide;
93
- const show = hide !== enum_1.ENUM_HIDE.HIDE && textHide_ === enum_1.ENUM_TEXT_HIDE.SHOW;
94
- if (show)
95
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
96
- this._centerCollection.set(centerID, new Map([
97
- ["stepAngle", stepAngle],
98
- ["maxRadius", maxRadius],
99
- ["long", long],
100
- ["lat", lat],
101
- ["hide", hide],
102
- ["textHide", textHide_]
103
- ]));
104
- }
105
- if (this._hideAll)
106
- return;
107
- if (deleteBucket.coords.length > 0)
108
- this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
109
- if (addBucket.coords.length > 0)
110
- this._updateData(addBucket, webglobe_1.CSObjectArrayUpdateTypes.ADD);
111
- }
112
- /**
113
- * @param {Array<{centerID, x,y}>} centerDatas
114
- * aci ve radiuslarin tutulmasi gereklidir.
115
- * */
116
- updateCentersXY(centerDatas) {
117
- const updateBucket = {
118
- coords: [],
119
- coordsZ: [],
120
- attribs: []
121
- };
122
- for (const { centerID, long, lat } of centerDatas) {
123
- if (this._centerCollection.has(centerID)) {
124
- const centerMap = this._centerCollection.get(centerID);
125
- centerMap.set("long", long);
126
- centerMap.set("lat", lat);
127
- const hide = centerMap.get("hide");
128
- const textHide = centerMap.get("textHide");
129
- const isHidden = hide === enum_1.ENUM_HIDE.HIDE || textHide === enum_1.ENUM_TEXT_HIDE.HIDE;
130
- if (isHidden)
131
- continue;
132
- const maxRadius = centerMap.get("maxRadius");
133
- const stepAngle = centerMap.get("stepAngle");
134
- // long, lat, radius, step, centerID, outBucket
135
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
136
- }
137
- }
138
- // for (const attribs of updateBucket.attribs) {
139
- // delete attribs["aci"];
140
- // }
141
- if (updateBucket.coords.length > 0) {
142
- this._updateData(updateBucket, webglobe_1.CSObjectArrayUpdateTypes.UPDATE);
143
- }
144
- }
145
- /**
146
- *
147
- * @param {Array<{centerID:string, hide: bool}>} centerHides
148
- */
149
- updateCentersHide(centerHides) {
150
- if (this._hideAll) {
151
- console.warn("Tum mesafe halkasi yazilari gizli durum. Islem yapilamaz");
152
- return;
153
- }
154
- ;
155
- const addBucket = {
156
- coords: [],
157
- coordsZ: [],
158
- attribs: []
159
- };
160
- const deleteBucket = {
161
- coords: [],
162
- coordsZ: [],
163
- attribs: []
164
- };
165
- for (const { centerID, textHide = null, hide = null } of centerHides) {
166
- if (!this._centerCollection.has(centerID))
167
- continue;
168
- const centerMap = this._centerCollection.get(centerID);
169
- const isHidden = centerMap.get("hide") === enum_1.ENUM_HIDE.HIDE || centerMap.get("textHide") === enum_1.ENUM_TEXT_HIDE.HIDE;
170
- const _hide = hide !== null ? hide : centerMap.get("hide");
171
- const _textHide = textHide !== null ? textHide : centerMap.get("textHide");
172
- const show = (_hide !== enum_1.ENUM_HIDE.HIDE) && (_textHide === enum_1.ENUM_TEXT_HIDE.SHOW);
173
- if (!isHidden && !show) {
174
- this._fillDeleteBucket(centerID, deleteBucket);
175
- }
176
- else if (isHidden && show) {
177
- this._appendCircle(centerMap.get("long"), centerMap.get("lat"), centerMap.get("maxRadius"), centerMap.get("stepAngle"), centerID, addBucket);
178
- }
179
- if (hide !== null)
180
- centerMap.set("hide", hide);
181
- if (textHide !== null)
182
- centerMap.set("textHide", textHide);
183
- }
184
- if (deleteBucket.coords.length > 0)
185
- this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
186
- if (addBucket.coords.length > 0)
187
- this._updateData(addBucket, webglobe_1.CSObjectArrayUpdateTypes.ADD);
188
- }
189
- // TODO : Implement this
190
- removeCenters(centerIDs) {
191
- const deleteBucket = {
192
- coords: [],
193
- coordsZ: [],
194
- attribs: []
195
- };
196
- for (const centerID of centerIDs) {
197
- if (this._centerCollection.has(centerID)) {
198
- this._fillDeleteBucket(centerID, deleteBucket);
199
- this._centerCollection.delete(centerID);
200
- }
201
- }
202
- this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
203
- }
204
- hideAll() {
205
- this._hideAll = true;
206
- const deleteBucket = {
207
- coords: [],
208
- coordsZ: [],
209
- attribs: []
210
- };
211
- for (const [centerID, centerMap] of this._centerCollection) {
212
- const hide = centerMap.get("hide");
213
- const hideText = centerMap.get("textHide");
214
- centerMap.set("textHide", enum_1.ENUM_TEXT_HIDE.HIDE);
215
- if (hide === enum_1.ENUM_HIDE.HIDE)
216
- continue;
217
- const isHidden = hideText === enum_1.ENUM_TEXT_HIDE.HIDE;
218
- if (!isHidden)
219
- this._fillDeleteBucket(centerID, deleteBucket);
220
- }
221
- this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
222
- }
223
- showAll() {
224
- this._hideAll = false;
225
- const addBucket = {
226
- coords: [],
227
- coordsZ: [],
228
- attribs: []
229
- };
230
- for (const [centerID, centerMap] of this._centerCollection) {
231
- const hide = centerMap.get("hide");
232
- if (hide === enum_1.ENUM_HIDE.HIDE)
233
- continue;
234
- const hideText = centerMap.get("textHide");
235
- const isHidden = hideText === enum_1.ENUM_TEXT_HIDE.HIDE;
236
- if (isHidden) {
237
- const long = centerMap.get("long");
238
- const lat = centerMap.get("lat");
239
- const maxRadius = centerMap.get("maxRadius");
240
- const stepAngle = centerMap.get("stepAngle");
241
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
242
- centerMap.set("hide", enum_1.ENUM_HIDE.SHOW);
243
- centerMap.set("textHide", enum_1.ENUM_TEXT_HIDE.SHOW);
244
- }
245
- }
246
- if (addBucket.coords.length)
247
- this._updateData(addBucket, webglobe_1.CSObjectArrayUpdateTypes.ADD);
248
- }
249
- flush() {
250
- const data = {
251
- coords: [],
252
- coordsZ: [],
253
- attribs: []
254
- };
255
- this._idCollector = new Set();
256
- this.ObjectArray.SetData(this.object, data);
257
- }
258
- //------------------PRIVATE METHODS------------------//
259
- _appendCircle(long, lat, radius, step, centerID, outBucket) {
260
- this.__realCoords(long, lat, radius, step, centerID, outBucket);
261
- }
262
- __realCoords(longCenter, latCenter, radius, stepAngle, centerID, outBucket) {
263
- const { globe } = this;
264
- const { coords, coordsZ, attribs } = outBucket;
265
- let i = 1;
266
- for (let aci = stepAngle; aci < 360; aci += stepAngle) {
267
- const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, aci);
268
- coords.push(long, lat);
269
- coordsZ.push(0);
270
- const key = this._key(centerID, i);
271
- i++;
272
- // fidkey is the key
273
- attribs.push({
274
- "__fid__": key,
275
- "aci": (aci).toFixed(0).toString().padStart(3, '0')
276
- });
277
- }
278
- { // add 0
279
- const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, 0);
280
- coords.push(long, lat);
281
- coordsZ.push(0);
282
- const key = this._key(centerID, 0);
283
- // fidkey is the key
284
- attribs.push({
285
- "__fid__": key,
286
- "aci": "K"
287
- });
288
- }
289
- }
290
- _updateData(bucket, mode) {
291
- this.ObjectArray.UpdateData(this.object, mode, [bucket], { attribs: false, icon: false, text: false });
292
- }
293
- _key(centerRingKey, limpIndex) {
294
- return `${centerRingKey}_${limpIndex}`;
295
- }
296
- _fillDeleteBucket(centerID, outDeleteBucket) {
297
- const centerMap = this._centerCollection.get(centerID);
298
- const stepAngle = centerMap.get("stepAngle");
299
- const { coords, coordsZ, attribs } = outDeleteBucket;
300
- let i = 0;
301
- for (let aci = 0; aci < 360; aci += stepAngle) {
302
- const key = this._key(centerID, i++);
303
- coords.push(0, 0);
304
- coordsZ.push(0);
305
- attribs.push({
306
- "__fid__": key,
307
- });
308
- }
309
- }
310
- _updateAll() {
311
- const updateBucket = {
312
- coords: [],
313
- coordsZ: [],
314
- attribs: []
315
- };
316
- for (const [centerID, centerMap] of this._centerCollection) {
317
- const isHidden = centerMap.get("hide") === enum_1.ENUM_HIDE.HIDE || centerMap.get("textHide") === enum_1.ENUM_TEXT_HIDE.HIDE;
318
- if (isHidden)
319
- continue;
320
- const long = centerMap.get("long");
321
- const lat = centerMap.get("lat");
322
- const maxRadius = centerMap.get("maxRadius");
323
- const stepAngle = centerMap.get("stepAngle");
324
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
325
- }
326
- this._updateData(updateBucket, webglobe_1.CSObjectArrayUpdateTypes.UPDATE);
327
- }
328
- }
329
- exports.default = RangeRingAngleText;
@@ -1,117 +0,0 @@
1
- "use strict";
2
- /**
3
- * This account interacts with buffer orchestrations and buffers.
4
- * For rings, coordinates and paddings
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ringBigPaddingKeyMethod = exports.ringKeyMethod = exports.RingAccount = void 0;
8
- const ringKeyMethod = (centerID, ringID) => `${centerID}_${ringID}`;
9
- exports.ringKeyMethod = ringKeyMethod;
10
- const ringBigPaddingKeyMethod = (centerID, ringID, angle) => `${centerID}_${ringID}_${angle}`;
11
- exports.ringBigPaddingKeyMethod = ringBigPaddingKeyMethod;
12
- /**
13
- * @typedef { Array < { ringID, radius, paddingRange } >} rings
14
- * @param { Array < centerID: string, x: number, y: number, stepAngle: number, rgba: [4 numbers], rings: rings } items
15
- */
16
- class RingAccount {
17
- constructor() {
18
- this._centralMap = new Map(); // key, new MAP(x,y, rings:[])
19
- }
20
- /**
21
- * @typedef {centerID, long,lat, rings} centralItem
22
- *
23
- */
24
- insertCenter(centralItem) {
25
- centralItem.rings.forEach((ring) => {
26
- ring.__identity__ = ringKeyMethod(centralItem.centerID, ring.ringID);
27
- });
28
- this._centralMap.set(centralItem.centerID, {
29
- ...centralItem,
30
- rgba: new Float32Array(centralItem.rgba),
31
- });
32
- }
33
- getCenter(centerID) {
34
- return this._centralMap.get(centerID);
35
- }
36
- updateCentersCoordinate(items) {
37
- for (const { centerID, long, lat } of items) {
38
- const center = this.getCenter(centerID);
39
- if (center) {
40
- center.long = long;
41
- center.lat = lat;
42
- }
43
- }
44
- }
45
- updateCentersHide(items) {
46
- for (const { centerID, hide = null, textHide = null } of items) {
47
- const center = this.getCenter(centerID);
48
- if (center) {
49
- if (hide !== null)
50
- center.hide = hide;
51
- if (textHide !== null)
52
- center.textHide = textHide;
53
- }
54
- }
55
- }
56
- /**
57
- *
58
- * @param {Array<{centerID, rgba}>} centersColor
59
- */
60
- updateCentersColor(centersColor) {
61
- for (const { centerID, rgba } of centersColor) {
62
- const center = this.getCenter(centerID);
63
- if (center) {
64
- center.rgba = new Float32Array(rgba);
65
- }
66
- }
67
- }
68
- // to delete rings and one degree paddings from buffer
69
- ringKeys(centerID) {
70
- const result = [];
71
- const center = this.getCenter(centerID);
72
- if (center) {
73
- const rings = center.rings;
74
- for (const { __identity__ } of rings) {
75
- result.push(__identity__);
76
- }
77
- }
78
- return result;
79
- }
80
- // To delete big paddings from buffer
81
- ringBigPaddingKeys(centerID) {
82
- const result = [];
83
- const center = this.getCenter(centerID);
84
- if (!center)
85
- return [];
86
- const { rings, stepAngle } = center;
87
- for (const { ringID } of rings) {
88
- let angle = 0;
89
- while (angle < 360) {
90
- result.push(ringBigPaddingKeyMethod(centerID, ringID, angle));
91
- angle += stepAngle;
92
- }
93
- }
94
- return result;
95
- }
96
- removeCenters(centerIDs) {
97
- const centralMap = this._centralMap;
98
- centerIDs.forEach((centerID) => {
99
- centralMap.delete(centerID);
100
- });
101
- }
102
- textUpdate(centerID, textWriterObjs, dataPreAdaptor = null) {
103
- const center = this.getCenter(centerID);
104
- if (!center)
105
- return;
106
- const data = (dataPreAdaptor) ? dataPreAdaptor(center) : center;
107
- textWriterObjs.forEach((writer) => {
108
- writer.insertTextBulk(data.rings, data);
109
- });
110
- }
111
- updateAllText(textWriterObjs, dataPreAdaptor = null) {
112
- this._centralMap.forEach((center) => {
113
- this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
114
- });
115
- }
116
- }
117
- exports.RingAccount = RingAccount;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.firework = void 0;
4
- exports.firework = `
5
- float firework(vec2 point_coord, float phase) {
6
- float t = phase + 5.0;
7
- float z = 6.0;
8
- const int n = 53; // particle count
9
-
10
- vec3 startColor = vec3(0.0, 0.64, 0.2);
11
- vec3 endColor = vec3(0.06, 0.35, 0.85);
12
-
13
- float startRadius = 0.84;
14
- float endRadius = 1.6;
15
-
16
- float power = 0.51;
17
- float duration = 4.0;
18
-
19
- vec2 v = z * (2.0 * point_coord - vec2(1.0) );
20
-
21
- vec3 col = vec3(0.0);
22
- vec2 pm = v.yx * 2.8;
23
-
24
- float dMax = duration;
25
- float evo = (sin(phase * 0.01 + 400.0) * 0.5 + 0.5) * 99.0 + 1.0;
26
-
27
- float mb = 0.0;
28
- float mbRadius = 0.0;
29
- float sum = 0.0;
30
-
31
- for(int i = 0; i < n; i++) {
32
- float d = fract(t * power + 48934.4238 * sin(float(i / int(evo)) * 692.7398));
33
-
34
- float a = 6.28 * float(i) / float(n);
35
- float x = d * cos(a) * duration;
36
- float y = d * sin(a) * duration;
37
-
38
- float distRatio = d / dMax;
39
- mbRadius = mix(startRadius, endRadius, distRatio);
40
-
41
- vec2 p = v - vec2(x, y);
42
- mb = mbRadius / dot(p, p);
43
-
44
- sum += mb;
45
- col = mix(col, mix(startColor, endColor, distRatio), mb / sum);
46
- }
47
-
48
- sum /= float(n);
49
- col = normalize(col) * sum;
50
- sum = clamp(sum, 0.0, 0.4);
51
-
52
- vec3 tex = vec3(1.0);
53
- col *= smoothstep(tex, vec3(0.0), vec3(sum));
54
-
55
- float alpha = sum * 2.5;
56
- return clamp(alpha, 0.0, 1.0);
57
- }
58
- `;
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.singularity = void 0;
4
- const singularity = `
5
-
6
- vec3 palette(float d){
7
- return mix(vec3(0.2, 0.7, 0.9), vec3(1.0, 0.0, 1.0), d);
8
- }
9
-
10
- vec2 rotate(vec2 p, float a){
11
- float c = cos(a);
12
- float s = sin(a);
13
- return p * mat2(c, s, -s, c);
14
- }
15
-
16
- float map(vec3 p){
17
- for (int i = 0; i < 4; ++i){
18
- float t = u_phase * 0.2;
19
- p.xz = rotate(p.xz, t);
20
- p.xy = rotate(p.xy, t * 1.89);
21
- p.xz = abs(p.xz);
22
- p.xz -= 0.85;
23
- }
24
- return dot(sign(p), p) / 5.0;
25
- }
26
-
27
- vec4 rm(vec3 ro, vec3 rd){
28
- float t = 0.0;
29
- vec3 col = vec3(0.0);
30
- float d;
31
- for (float i = 0.0; i < 56.0; i++){
32
- vec3 p = ro + rd * t;
33
- d = map(p) * 0.5;
34
- if (d < 0.02){
35
- break;
36
- }
37
- if (d > 100.0){
38
- break;
39
- }
40
- col += palette(length(p) * 0.1) / (400.0 * d);
41
- t += d;
42
- }
43
- return vec4(col, 1.0 / d * 2.0 );
44
- }
45
-
46
- vec4 singularity(vec2 pointCoord, float u_phase) {
47
- vec2 uv = (pointCoord - 0.5); // Normalized coordinates from gl_PointCoord
48
- vec3 ro = vec3(0.0, 0.0, -50.0);
49
- ro.xz = rotate(ro.xz, u_phase);
50
- vec3 cf = normalize(-ro);
51
- vec3 cs = normalize(cross(cf, vec3(0.0, 1.0, 0.0)));
52
- vec3 cu = normalize(cross(cf, cs));
53
-
54
- vec3 uuv = ro + cf * 3.0 + uv.x * cs + uv.y * cu;
55
- vec3 rd = normalize(uuv - ro);
56
-
57
- return rm(ro, rd);
58
- }`;
59
- exports.singularity = singularity;