@pirireis/webglobeplugins 0.16.7 → 0.17.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 (159) hide show
  1. package/Math/angle-calculation.js +1 -0
  2. package/Math/contour/quadtreecontours.js +300 -0
  3. package/Math/finite-line-2d.js +58 -0
  4. package/Math/methods.js +6 -0
  5. package/Math/tessellation/hybrid-triangle-tessellation-meta.js +123 -0
  6. package/Math/tessellation/tile-merger.js +298 -0
  7. package/Math/tessellation/triangle-tessellation-meta.js +195 -42
  8. package/Math/tessellation/triangle-tessellation.js +5 -1
  9. package/compass-rose/compass-text-writer.js +39 -33
  10. package/constants.js +3 -0
  11. package/{util/heatwavedatamanager → heatwave}/datamanager.js +1 -1
  12. package/heatwave/{plugins/heatwaveglobeshell.js → heatwave.js} +8 -6
  13. package/heatwave/index.js +5 -3
  14. package/heatwave/{isobar/plugin.js → isobar.js} +6 -5
  15. package/{util/heatwavedatamanager → heatwave}/texture-point-sampler.js +24 -3
  16. package/investigation-tools/draw/tiles/adapters.js +67 -0
  17. package/investigation-tools/draw/tiles/tiles.js +128 -0
  18. package/package.json +4 -2
  19. package/programs/arrowfield/{object.js → arrow-field.js} +1 -1
  20. package/programs/arrowfield/logic.js +1 -1
  21. package/programs/data2legend/density-to-legend.js +24 -29
  22. package/programs/data2legend/point-to-density-texture.js +14 -17
  23. package/programs/float2legendwithratio/logic.js +2 -2
  24. package/programs/float2legendwithratio/object.js +1 -1
  25. package/programs/helpers/{blender/program.js → blender.js} +1 -1
  26. package/programs/helpers/{fadeaway/logic.js → fadeaway.js} +11 -2
  27. package/programs/index.js +20 -9
  28. package/programs/line-on-globe/circle-accurate-3d.js +12 -14
  29. package/programs/line-on-globe/circle-accurate-flat.js +0 -1
  30. package/programs/line-on-globe/degree-padding-around-circle-3d.js +13 -15
  31. package/programs/line-on-globe/lines-color-instanced-flat.js +15 -18
  32. package/programs/line-on-globe/naive-accurate-flexible.js +0 -1
  33. package/programs/picking/pickable-polygon-renderer.js +1 -1
  34. package/programs/picking/pickable-renderer.js +2 -2
  35. package/programs/point-on-globe/element-globe-surface-glow.js +2 -2
  36. package/programs/point-on-globe/element-point-glow.js +1 -1
  37. package/programs/point-on-globe/square-pixel-point.js +1 -1
  38. package/programs/polygon-on-globe/texture-dem-triangle-test-plugin-triangle.js +180 -30
  39. package/programs/polygon-on-globe/texture-dem-triangles.js +93 -34
  40. package/programs/rings/partial-ring/piece-of-pie.js +26 -29
  41. package/programs/totems/camerauniformblock.js +31 -42
  42. package/programs/two-d/pixel-padding-for-compass.js +14 -24
  43. package/programs/vectorfields/logics/drawrectangleparticles.js +9 -8
  44. package/programs/vectorfields/logics/drawrectangleparticles1.js +112 -0
  45. package/programs/vectorfields/logics/pixelbased.js +1 -2
  46. package/programs/vectorfields/pingpongbuffermanager.js +1 -1
  47. package/range-tools-on-terrain/bearing-line/adapters.js +1 -1
  48. package/range-tools-on-terrain/circle-line-chain/adapters.js +0 -5
  49. package/range-tools-on-terrain/circle-line-chain/plugin.js +1 -1
  50. package/range-tools-on-terrain/range-ring/plugin.js +4 -6
  51. package/semiplugins/lightweight/line-plugin.js +0 -1
  52. package/semiplugins/shape-on-terrain/arc-plugin.js +9 -2
  53. package/semiplugins/shape-on-terrain/circle-plugin.js +2 -2
  54. package/semiplugins/shape-on-terrain/padding-1-degree.js +1 -1
  55. package/semiplugins/shell/bbox-renderer/index.js +2 -0
  56. package/{programs/globeshell/wiggle → semiplugins/shell/bbox-renderer}/logic.js +101 -102
  57. package/{programs/globeshell/wiggle → semiplugins/shell/bbox-renderer}/object.js +6 -7
  58. package/semiplugins/utility/container-plugin.js +94 -0
  59. package/semiplugins/utility/object-pass-container-plugin.js +80 -0
  60. package/{point-heat-map → tracks/point-heat-map}/adaptors/timetracksplugin-format-to-this.js +1 -1
  61. package/{point-heat-map → tracks/point-heat-map}/plugin-webworker.js +3 -3
  62. package/{point-heat-map → tracks/point-heat-map}/point-to-heat-map-flow.js +11 -14
  63. package/{point-tracks → tracks/point-tracks}/plugin.js +6 -5
  64. package/{timetracks → tracks/timetracks}/adaptors-line-strip.js +1 -1
  65. package/{timetracks → tracks/timetracks}/program-line-strip.js +49 -49
  66. package/{timetracks → tracks/timetracks}/programpoint-line-strip.js +16 -13
  67. package/types.js +6 -0
  68. package/util/account/bufferoffsetmanager.js +1 -1
  69. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +9 -95
  70. package/util/gl-util/uniform-block/manager.js +0 -1
  71. package/util/gl-util/uniform-block/types.js +0 -7
  72. package/util/index.js +10 -13
  73. package/util/picking/fence.js +16 -18
  74. package/util/picking/picker-displayer.js +6 -8
  75. package/util/programs/{shapesonglobe.js → draw-from-pixel-coords.js} +4 -7
  76. package/util/programs/draw-texture-on-canvas.js +1 -1
  77. package/util/programs/texturetoglobe.js +3 -3
  78. package/util/shaderfunctions/geometrytransformations.js +1 -1
  79. package/vectorfield/arrowfield/index.js +3 -0
  80. package/{arrowfield → vectorfield/arrowfield}/plugin.js +2 -2
  81. package/{waveparticles → vectorfield/waveparticles}/plugin.js +12 -12
  82. package/{wind → vectorfield/wind}/index.js +1 -1
  83. package/{wind → vectorfield/wind}/plugin.js +65 -51
  84. package/write-text/context-text3.js +0 -1
  85. package/write-text/context-text4.js +2 -1
  86. package/write-text/objectarraylabels/index.js +2 -0
  87. package/Math/tessellation/tessellation-algorithm.js +0 -67
  88. package/arrowfield/index.js +0 -3
  89. package/bearing-line/index.js +0 -2
  90. package/bearing-line/plugin.js +0 -444
  91. package/circle-line-chain/chain-list-map.js +0 -201
  92. package/circle-line-chain/init.js +0 -1
  93. package/circle-line-chain/plugin.js +0 -411
  94. package/circle-line-chain/util.js +0 -1
  95. package/compassrose/compassrose.js +0 -293
  96. package/compassrose/index.js +0 -2
  97. package/index.js +0 -12
  98. package/partialrings/buffer-manager.js +0 -75
  99. package/partialrings/index.js +0 -2
  100. package/partialrings/plugin.js +0 -128
  101. package/partialrings/program.js +0 -279
  102. package/programs/arrowfield/index.js +0 -2
  103. package/programs/globe-util/is-globe-moved.js +0 -19
  104. package/programs/globeshell/index.js +0 -2
  105. package/programs/globeshell/wiggle/index.js +0 -2
  106. package/programs/helpers/blender/index.js +0 -1
  107. package/programs/helpers/fadeaway/index.js +0 -2
  108. package/programs/helpers/fadeaway/object.js +0 -14
  109. package/programs/helpers/index.js +0 -2
  110. package/programs/polygon-on-globe/texture-dem-triangle-test-plugin.js +0 -118
  111. package/programs/rings/distancering/circleflatprogram.js +0 -116
  112. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -326
  113. package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -368
  114. package/programs/rings/distancering/index.js +0 -6
  115. package/programs/rings/distancering/paddyflatprogram.js +0 -127
  116. package/programs/rings/distancering/paddyflatprogram2d.js +0 -129
  117. package/programs/rings/distancering/paddyflatprogram3d.js +0 -128
  118. package/programs/two-d/pixel-circle.js +0 -1
  119. package/programs/vectorfields/index.js +0 -3
  120. package/rangerings/enum.js +0 -2
  121. package/rangerings/index.js +0 -5
  122. package/rangerings/plugin.js +0 -543
  123. package/rangerings/rangeringangletext.js +0 -326
  124. package/rangerings/ring-account.js +0 -112
  125. package/timetracks/index.js +0 -1
  126. package/util/build-strategy/general-strategy.js +0 -62
  127. package/util/gl-util/uniform-block/shader.js +0 -1
  128. package/util/heatwavedatamanager/index.js +0 -2
  129. package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
  130. package/util/jshelpers/data-filler.js +0 -17
  131. package/util/jshelpers/equality.js +0 -18
  132. package/util/jshelpers/index.js +0 -2
  133. package/util/jshelpers/timefilters.js +0 -30
  134. package/util/programs/index.js +0 -1
  135. package/util/surface-line-data/arc-bboxes.js +0 -25
  136. package/util/surface-line-data/arcs-to-cuts.js +0 -50
  137. package/util/surface-line-data/cut-arc.js +0 -1
  138. package/util/surface-line-data/flow.js +0 -28
  139. package/util/surface-line-data/rbush-manager.js +0 -1
  140. package/util/surface-line-data/types.js +0 -1
  141. package/util/surface-line-data/web-worker.js +0 -1
  142. package/util/webglobe/rasteroverlay.js +0 -75
  143. package/write-text/attached-text-writer.js +0 -87
  144. package/write-text/context-text3old.js +0 -152
  145. package/write-text/index.js +0 -1
  146. package/write-text/writer-plugin.js +0 -8
  147. /package/{heatwave/isobar/quadtreecontours.js → Math/contour/quadtreecontours1.js} +0 -0
  148. /package/pin/{pin-object-array.js → pin-object-array1.js} +0 -0
  149. /package/pin/{pin-point-totem.js → pin-point-totem1.js} +0 -0
  150. /package/{point-heat-map → tracks/point-heat-map}/index.js +0 -0
  151. /package/{point-tracks → tracks/point-tracks}/key-methods.js +0 -0
  152. /package/{timetracks → tracks/timetracks}/plugin-line-strip.js +0 -0
  153. /package/{arrowfield → vectorfield/arrowfield}/adaptor.js +0 -0
  154. /package/{waveparticles → vectorfield/waveparticles}/adaptor.js +0 -0
  155. /package/{waveparticles → vectorfield/waveparticles}/index.js +0 -0
  156. /package/{wind → vectorfield/wind}/imagetovectorfieldandmagnitude.js +0 -0
  157. /package/{wind → vectorfield/wind}/vectorfieldimage.js +0 -0
  158. /package/write-text/{context-text.js → context-textDELETE.js} +0 -0
  159. /package/{heatwave/isobar → write-text/objectarraylabels}/objectarraylabels.js +0 -0
@@ -1,326 +0,0 @@
1
- import { CSObjectArrayUpdateTypes, } from "@pirireis/webglobe";
2
- import { ENUM_HIDE, ENUM_TEXT_HIDE } from "./enum";
3
- const fidKey = "__fid__";
4
- const object = {
5
- "displayName": "RangeRingAngleText",
6
- "layerType": 3,
7
- "wkbGeom": null,
8
- "wfsLayerName": null,
9
- "objectType": "point",
10
- "bbox": null,
11
- "startLod": 2,
12
- "endLod": 30,
13
- "continuousLOD": true,
14
- "MVTXYZName": "hd_seyp",
15
- "rasterize": false,
16
- };
17
- export default class RangeRingAngleText {
18
- constructor(globe, id, { style = null, hideAll = false, opacity = 1 } = {}) {
19
- this.globe = globe;
20
- this.ObjectArray = globe.ObjectArray;
21
- this.id = id;
22
- this._hideAll = hideAll;
23
- this._opacity = opacity;
24
- const style_ = style !== null ? style : this.getDefaultStyle();
25
- this.object = Object.assign({}, object, { style: style_, id: this.id });
26
- this._centerCollection = new Map();
27
- // new inner MAP params
28
- // hide
29
- // textHide
30
- this.ObjectArray.Add(this.object);
31
- }
32
- getDefaultStyle() {
33
- const style = this.ObjectArray.GetDefaultStyle();
34
- style.fidKey = fidKey;
35
- const { labels } = style;
36
- const label = labels[0];
37
- label.offset = { x: 0, y: 0 };
38
- label.fontFamily.hollowWidth = 1;
39
- label.vAlignment = 2;
40
- label.hAlignment = 2;
41
- label.size = 17;
42
- // eslint-disable-next-line
43
- label.text = "`${aci}`";
44
- return style;
45
- }
46
- setStyle(style) {
47
- if (style === null)
48
- return;
49
- style.opacity = this._opacity;
50
- this.object.style = style;
51
- this.ObjectArray.StyleChanged(this.object);
52
- }
53
- setOpacity(opacity) {
54
- this._opacity = opacity;
55
- const { style } = this.object;
56
- style.opacity = opacity;
57
- this.ObjectArray.StyleChanged(this.object);
58
- }
59
- free() {
60
- this.flush();
61
- this.ObjectArray.Delete(this.id);
62
- }
63
- /**
64
- * @param {Array<{centerID,stepAngle, long,lat, rings>} ringDatas
65
- * centerID: string | ObjectArray fidKey de kullanilir
66
- * stepAngle: number | 0-360 arasinda
67
- * long,lat: number | merkez koordinatlari lat long radian. Globe icin dereceye iceride cevrilir
68
- * rings: Array<{radius: number}> | En buyuk halkaya centik acilari yazilir, Sonraki adim yaricaplarin uzunlugunu yazdirmak
69
- *
70
- * eger bir centerID zaten var ise: Onceki noktalar dusurulur ve yeniden eklenir
71
- *
72
- * */
73
- insertBulk(ringDatas) {
74
- const { _hideAll } = this;
75
- const addBucket = {
76
- coords: [],
77
- coordsZ: [],
78
- attribs: []
79
- };
80
- const deleteBucket = {
81
- coords: [],
82
- coordsZ: [],
83
- attribs: []
84
- };
85
- for (const { centerID, long, lat, rings, stepAngle, hide = ENUM_HIDE.SHOW, textHide = ENUM_TEXT_HIDE.SHOW } of ringDatas) {
86
- if (this._centerCollection.has(centerID)) {
87
- this._fillDeleteBucket(centerID, deleteBucket);
88
- }
89
- const maxRadius = rings.reduce((acc, { radius }) => Math.max(acc, radius), 0);
90
- const textHide_ = _hideAll ? ENUM_TEXT_HIDE.HIDE : textHide;
91
- const show = hide !== ENUM_HIDE.HIDE && textHide_ === ENUM_TEXT_HIDE.SHOW;
92
- if (show)
93
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
94
- this._centerCollection.set(centerID, new Map([
95
- ["stepAngle", stepAngle],
96
- ["maxRadius", maxRadius],
97
- ["long", long],
98
- ["lat", lat],
99
- ["hide", hide],
100
- ["textHide", textHide_]
101
- ]));
102
- }
103
- if (this._hideAll)
104
- return;
105
- if (deleteBucket.coords.length > 0)
106
- this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
107
- if (addBucket.coords.length > 0)
108
- this._updateData(addBucket, CSObjectArrayUpdateTypes.ADD);
109
- }
110
- /**
111
- * @param {Array<{centerID, x,y}>} centerDatas
112
- * aci ve radiuslarin tutulmasi gereklidir.
113
- * */
114
- updateCentersXY(centerDatas) {
115
- const updateBucket = {
116
- coords: [],
117
- coordsZ: [],
118
- attribs: []
119
- };
120
- for (const { centerID, long, lat } of centerDatas) {
121
- if (this._centerCollection.has(centerID)) {
122
- const centerMap = this._centerCollection.get(centerID);
123
- centerMap.set("long", long);
124
- centerMap.set("lat", lat);
125
- const hide = centerMap.get("hide");
126
- const textHide = centerMap.get("textHide");
127
- const isHidden = hide === ENUM_HIDE.HIDE || textHide === ENUM_TEXT_HIDE.HIDE;
128
- if (isHidden)
129
- continue;
130
- const maxRadius = centerMap.get("maxRadius");
131
- const stepAngle = centerMap.get("stepAngle");
132
- // long, lat, radius, step, centerID, outBucket
133
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
134
- }
135
- }
136
- // for (const attribs of updateBucket.attribs) {
137
- // delete attribs["aci"];
138
- // }
139
- if (updateBucket.coords.length > 0) {
140
- this._updateData(updateBucket, CSObjectArrayUpdateTypes.UPDATE);
141
- }
142
- }
143
- /**
144
- *
145
- * @param {Array<{centerID:string, hide: bool}>} centerHides
146
- */
147
- updateCentersHide(centerHides) {
148
- if (this._hideAll) {
149
- console.warn("Tum mesafe halkasi yazilari gizli durum. Islem yapilamaz");
150
- return;
151
- }
152
- ;
153
- const addBucket = {
154
- coords: [],
155
- coordsZ: [],
156
- attribs: []
157
- };
158
- const deleteBucket = {
159
- coords: [],
160
- coordsZ: [],
161
- attribs: []
162
- };
163
- for (const { centerID, textHide = null, hide = null } of centerHides) {
164
- if (!this._centerCollection.has(centerID))
165
- continue;
166
- const centerMap = this._centerCollection.get(centerID);
167
- const isHidden = centerMap.get("hide") === ENUM_HIDE.HIDE || centerMap.get("textHide") === ENUM_TEXT_HIDE.HIDE;
168
- const _hide = hide !== null ? hide : centerMap.get("hide");
169
- const _textHide = textHide !== null ? textHide : centerMap.get("textHide");
170
- const show = (_hide !== ENUM_HIDE.HIDE) && (_textHide === ENUM_TEXT_HIDE.SHOW);
171
- if (!isHidden && !show) {
172
- this._fillDeleteBucket(centerID, deleteBucket);
173
- }
174
- else if (isHidden && show) {
175
- this._appendCircle(centerMap.get("long"), centerMap.get("lat"), centerMap.get("maxRadius"), centerMap.get("stepAngle"), centerID, addBucket);
176
- }
177
- if (hide !== null)
178
- centerMap.set("hide", hide);
179
- if (textHide !== null)
180
- centerMap.set("textHide", textHide);
181
- }
182
- if (deleteBucket.coords.length > 0)
183
- this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
184
- if (addBucket.coords.length > 0)
185
- this._updateData(addBucket, CSObjectArrayUpdateTypes.ADD);
186
- }
187
- // TODO : Implement this
188
- removeCenters(centerIDs) {
189
- const deleteBucket = {
190
- coords: [],
191
- coordsZ: [],
192
- attribs: []
193
- };
194
- for (const centerID of centerIDs) {
195
- if (this._centerCollection.has(centerID)) {
196
- this._fillDeleteBucket(centerID, deleteBucket);
197
- this._centerCollection.delete(centerID);
198
- }
199
- }
200
- this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
201
- }
202
- hideAll() {
203
- this._hideAll = true;
204
- const deleteBucket = {
205
- coords: [],
206
- coordsZ: [],
207
- attribs: []
208
- };
209
- for (const [centerID, centerMap] of this._centerCollection) {
210
- const hide = centerMap.get("hide");
211
- const hideText = centerMap.get("textHide");
212
- centerMap.set("textHide", ENUM_TEXT_HIDE.HIDE);
213
- if (hide === ENUM_HIDE.HIDE)
214
- continue;
215
- const isHidden = hideText === ENUM_TEXT_HIDE.HIDE;
216
- if (!isHidden)
217
- this._fillDeleteBucket(centerID, deleteBucket);
218
- }
219
- this._updateData(deleteBucket, CSObjectArrayUpdateTypes.DELETE);
220
- }
221
- showAll() {
222
- this._hideAll = false;
223
- const addBucket = {
224
- coords: [],
225
- coordsZ: [],
226
- attribs: []
227
- };
228
- for (const [centerID, centerMap] of this._centerCollection) {
229
- const hide = centerMap.get("hide");
230
- if (hide === ENUM_HIDE.HIDE)
231
- continue;
232
- const hideText = centerMap.get("textHide");
233
- const isHidden = hideText === ENUM_TEXT_HIDE.HIDE;
234
- if (isHidden) {
235
- const long = centerMap.get("long");
236
- const lat = centerMap.get("lat");
237
- const maxRadius = centerMap.get("maxRadius");
238
- const stepAngle = centerMap.get("stepAngle");
239
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
240
- centerMap.set("hide", ENUM_HIDE.SHOW);
241
- centerMap.set("textHide", ENUM_TEXT_HIDE.SHOW);
242
- }
243
- }
244
- if (addBucket.coords.length)
245
- this._updateData(addBucket, CSObjectArrayUpdateTypes.ADD);
246
- }
247
- flush() {
248
- const data = {
249
- coords: [],
250
- coordsZ: [],
251
- attribs: []
252
- };
253
- this._idCollector = new Set();
254
- this.ObjectArray.SetData(this.object, data);
255
- }
256
- //------------------PRIVATE METHODS------------------//
257
- _appendCircle(long, lat, radius, step, centerID, outBucket) {
258
- this.__realCoords(long, lat, radius, step, centerID, outBucket);
259
- }
260
- __realCoords(longCenter, latCenter, radius, stepAngle, centerID, outBucket) {
261
- const { globe } = this;
262
- const { coords, coordsZ, attribs } = outBucket;
263
- let i = 1;
264
- for (let aci = stepAngle; aci < 360; aci += stepAngle) {
265
- const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, aci);
266
- coords.push(long, lat);
267
- coordsZ.push(0);
268
- const key = this._key(centerID, i);
269
- i++;
270
- // fidkey is the key
271
- attribs.push({
272
- "__fid__": key,
273
- "aci": (aci).toFixed(0).toString().padStart(3, '0')
274
- });
275
- }
276
- { // add 0
277
- const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, 0);
278
- coords.push(long, lat);
279
- coordsZ.push(0);
280
- const key = this._key(centerID, 0);
281
- // fidkey is the key
282
- attribs.push({
283
- "__fid__": key,
284
- "aci": "K"
285
- });
286
- }
287
- }
288
- _updateData(bucket, mode) {
289
- this.ObjectArray.UpdateData(this.object, mode, [bucket], { attribs: false, icon: false, text: false });
290
- }
291
- _key(centerRingKey, limpIndex) {
292
- return `${centerRingKey}_${limpIndex}`;
293
- }
294
- _fillDeleteBucket(centerID, outDeleteBucket) {
295
- const centerMap = this._centerCollection.get(centerID);
296
- const stepAngle = centerMap.get("stepAngle");
297
- const { coords, coordsZ, attribs } = outDeleteBucket;
298
- let i = 0;
299
- for (let aci = 0; aci < 360; aci += stepAngle) {
300
- const key = this._key(centerID, i++);
301
- coords.push(0, 0);
302
- coordsZ.push(0);
303
- attribs.push({
304
- "__fid__": key,
305
- });
306
- }
307
- }
308
- _updateAll() {
309
- const updateBucket = {
310
- coords: [],
311
- coordsZ: [],
312
- attribs: []
313
- };
314
- for (const [centerID, centerMap] of this._centerCollection) {
315
- const isHidden = centerMap.get("hide") === ENUM_HIDE.HIDE || centerMap.get("textHide") === ENUM_TEXT_HIDE.HIDE;
316
- if (isHidden)
317
- continue;
318
- const long = centerMap.get("long");
319
- const lat = centerMap.get("lat");
320
- const maxRadius = centerMap.get("maxRadius");
321
- const stepAngle = centerMap.get("stepAngle");
322
- this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
323
- }
324
- this._updateData(updateBucket, CSObjectArrayUpdateTypes.UPDATE);
325
- }
326
- }
@@ -1,112 +0,0 @@
1
- /**
2
- * This account interacts with buffer orchestrations and buffers.
3
- * For rings, coordinates and paddings
4
- */
5
- const ringKeyMethod = (centerID, ringID) => `${centerID}_${ringID}`;
6
- const ringBigPaddingKeyMethod = (centerID, ringID, angle) => `${centerID}_${ringID}_${angle}`;
7
- /**
8
- * @typedef { Array < { ringID, radius, paddingRange } >} rings
9
- * @param { Array < centerID: string, x: number, y: number, stepAngle: number, rgba: [4 numbers], rings: rings } items
10
- */
11
- class RingAccount {
12
- constructor() {
13
- this._centralMap = new Map(); // key, new MAP(x,y, rings:[])
14
- }
15
- /**
16
- * @typedef {centerID, long,lat, rings} centralItem
17
- *
18
- */
19
- insertCenter(centralItem) {
20
- centralItem.rings.forEach((ring) => {
21
- ring.__identity__ = ringKeyMethod(centralItem.centerID, ring.ringID);
22
- });
23
- this._centralMap.set(centralItem.centerID, {
24
- ...centralItem,
25
- rgba: new Float32Array(centralItem.rgba),
26
- });
27
- }
28
- getCenter(centerID) {
29
- return this._centralMap.get(centerID);
30
- }
31
- updateCentersCoordinate(items) {
32
- for (const { centerID, long, lat } of items) {
33
- const center = this.getCenter(centerID);
34
- if (center) {
35
- center.long = long;
36
- center.lat = lat;
37
- }
38
- }
39
- }
40
- updateCentersHide(items) {
41
- for (const { centerID, hide = null, textHide = null } of items) {
42
- const center = this.getCenter(centerID);
43
- if (center) {
44
- if (hide !== null)
45
- center.hide = hide;
46
- if (textHide !== null)
47
- center.textHide = textHide;
48
- }
49
- }
50
- }
51
- /**
52
- *
53
- * @param {Array<{centerID, rgba}>} centersColor
54
- */
55
- updateCentersColor(centersColor) {
56
- for (const { centerID, rgba } of centersColor) {
57
- const center = this.getCenter(centerID);
58
- if (center) {
59
- center.rgba = new Float32Array(rgba);
60
- }
61
- }
62
- }
63
- // to delete rings and one degree paddings from buffer
64
- ringKeys(centerID) {
65
- const result = [];
66
- const center = this.getCenter(centerID);
67
- if (center) {
68
- const rings = center.rings;
69
- for (const { __identity__ } of rings) {
70
- result.push(__identity__);
71
- }
72
- }
73
- return result;
74
- }
75
- // To delete big paddings from buffer
76
- ringBigPaddingKeys(centerID) {
77
- const result = [];
78
- const center = this.getCenter(centerID);
79
- if (!center)
80
- return [];
81
- const { rings, stepAngle } = center;
82
- for (const { ringID } of rings) {
83
- let angle = 0;
84
- while (angle < 360) {
85
- result.push(ringBigPaddingKeyMethod(centerID, ringID, angle));
86
- angle += stepAngle;
87
- }
88
- }
89
- return result;
90
- }
91
- removeCenters(centerIDs) {
92
- const centralMap = this._centralMap;
93
- centerIDs.forEach((centerID) => {
94
- centralMap.delete(centerID);
95
- });
96
- }
97
- textUpdate(centerID, textWriterObjs, dataPreAdaptor = null) {
98
- const center = this.getCenter(centerID);
99
- if (!center)
100
- return;
101
- const data = (dataPreAdaptor) ? dataPreAdaptor(center) : center;
102
- textWriterObjs.forEach((writer) => {
103
- writer.insertTextBulk(data.rings, data);
104
- });
105
- }
106
- updateAllText(textWriterObjs, dataPreAdaptor = null) {
107
- this._centralMap.forEach((center) => {
108
- this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
109
- });
110
- }
111
- }
112
- export { RingAccount, ringKeyMethod, ringBigPaddingKeyMethod };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,62 +0,0 @@
1
- /**
2
- * # Considerations ---
3
- * - RABIT LOD change should trigger build immediately
4
- * - CRUD operations should trigger build immediately
5
- * - CameraAngle Change should trigger build immediately for Plugins employ DENSITY variation mechanism
6
- *
7
- */
8
- var State;
9
- (function (State) {
10
- State["STATIC"] = "STATIC";
11
- State["DYNAMIC"] = "DYNAMIC";
12
- State["TRANSIENT"] = "TRANSIENT";
13
- })(State || (State = {}));
14
- class GeneralStrategy {
15
- globe;
16
- _state = State.DYNAMIC;
17
- _transitionLevel = 8; // Default transition level
18
- _lastLOD = 1000; // an extreme value to trigger initial build
19
- _lastCameraPosition = [0, 0, 0]; // Initial camera position
20
- _lastLookInfo = {
21
- CenterLong: 0,
22
- CenterLat: 0,
23
- Distance: 0,
24
- Tilt: 0,
25
- NorthAng: 0
26
- };
27
- _currentLOD = 1000; // an extreme value to trigger initial build
28
- _currentCameraPosition = [0, 0, 0]; // Initial camera position
29
- _currentLookInfo = {
30
- CenterLong: 0,
31
- CenterLat: 0,
32
- Distance: 0,
33
- Tilt: 0,
34
- NorthAng: 0
35
- };
36
- // private _staticBuildThreshold: number = 8; // Default static build threshold
37
- // private _triggerStaticBuild: boolean = false;
38
- // private _isMovedParams: boolean = false
39
- // private _isCameraChangedParams: boolean = false
40
- // private _elevationChangedParams: boolean = false
41
- constructor(globe, transitionLevel = 8) {
42
- // Initialization logic if needed
43
- this.globe = globe;
44
- this._transitionLevel = transitionLevel;
45
- }
46
- calculateState() {
47
- }
48
- getState() {
49
- return this._state;
50
- }
51
- // Additional methods and properties can be added here as needed
52
- // @ts-ignore
53
- _isMoved() {
54
- }
55
- // @ts-ignore
56
- _isCameraChanged() {
57
- }
58
- // @ts-ignore
59
- _elevationChanged() {
60
- }
61
- }
62
- export {};
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,2 +0,0 @@
1
- import HeatWaveDataManager from "./datamanager";
2
- export { HeatWaveDataManager };
@@ -1,22 +0,0 @@
1
- export default class PointCoordsMeta {
2
- _bbox;
3
- _width;
4
- _height;
5
- _xRatio;
6
- _yRatio;
7
- constructor(bbox, width, height) {
8
- this._bbox = bbox;
9
- this._width = width;
10
- this._height = height;
11
- this._xRatio = this._width / (this._bbox[2] - this._bbox[0]);
12
- this._yRatio = this._height / (this._bbox[3] - this._bbox[1]);
13
- }
14
- getFlooredIndex(long, lat) {
15
- let x = (long - this._bbox[0]) * this._xRatio;
16
- let y = (this._bbox[3] - lat) * this._yRatio;
17
- x = x > 0 ? x - 1 : 0;
18
- y = y > 0 ? y - 1 : 0;
19
- const index = Math.floor(y) * this._width + Math.floor(x);
20
- return index;
21
- }
22
- }
@@ -1,17 +0,0 @@
1
- const populateFloat32Array = Object.freeze({
2
- fillFloat32Array: (length, data) => {
3
- const result = new Float32Array(length);
4
- result.fill(data);
5
- return result;
6
- },
7
- fillWithListData: (length, listdata) => {
8
- const result = new Float32Array(length * listdata.length);
9
- let offset = 0;
10
- for (let i = 0; i < length; i++) {
11
- result.set(listdata, offset);
12
- offset += listdata.length;
13
- }
14
- return result;
15
- }
16
- });
17
- export { populateFloat32Array };
@@ -1,18 +0,0 @@
1
- function arraysEqual(a, b) {
2
- if (a === b)
3
- return true;
4
- if (a == null || b == null)
5
- return false;
6
- if (a.length !== b.length)
7
- return false;
8
- // If you don't care about the order of the elements inside
9
- // the array, you should sort both arrays here.
10
- // Please note that calling sort on an array will modify that array.
11
- // you might want to clone your array first.
12
- for (var i = 0; i < a.length; ++i) {
13
- if (a[i] !== b[i])
14
- return false;
15
- }
16
- return true;
17
- }
18
- export { arraysEqual };
@@ -1,2 +0,0 @@
1
- import * as timefilters_1 from './timefilters';
2
- export { timefilters_1 as timefilters };
@@ -1,30 +0,0 @@
1
- // TODO: fix logic error in instantDebounce
2
- function instantDebounce(func, delay) {
3
- let timeout = null;
4
- let lastArgs = null;
5
- let runAtEnd = false;
6
- const timeoutMethod = () => {
7
- setTimeout(() => {
8
- if (runAtEnd) {
9
- func(...lastArgs);
10
- lastArgs = null;
11
- // console.log("processed with delay")
12
- runAtEnd = false;
13
- }
14
- timeout = null;
15
- }, delay);
16
- };
17
- return function () {
18
- if (timeout) {
19
- lastArgs = arguments;
20
- runAtEnd = true;
21
- return;
22
- }
23
- else {
24
- func(...args);
25
- // console.log("processed instantly")
26
- timeout = timeoutMethod();
27
- }
28
- };
29
- }
30
- export { instantDebounce };
@@ -1 +0,0 @@
1
- export * from "./shapesonglobe";
@@ -1,25 +0,0 @@
1
- "use strict";
2
- // function naiveBBox(a: number[], b: number[]): BBox {
3
- // return {
4
- // minX: Math.min(a[0], b[0]),
5
- // minY: Math.min(a[1], b[1]),
6
- // maxX: Math.max(a[0], b[0]),
7
- // maxY: Math.max(a[1], b[1])
8
- // };
9
- // }
10
- // function slerp(a: Vector, b: Vector, t: number, theta: number, sinTheta: number): Vector {
11
- // }
12
- // function getArcBBoxes(arc: Arc, dotStep: number = 0.025): BBox[] {
13
- // const start = arc.start;
14
- // const end = arc.end;
15
- // const a = [start[0], start[1], start[2]];
16
- // const b = [end[0], end[1], end[2]];
17
- // const theta = Math.acos(a[0] * b[0] + a[1] * b[1] + a[2] * b[2]);
18
- // const step = dotStep / theta;
19
- // if (step >= 1) {
20
- // return [naiveBBox(start, end)];
21
- // }
22
- // let points = [start] as Vector[];
23
- // let currentStep =
24
- // return bbox;
25
- // }
@@ -1,50 +0,0 @@
1
- "use strict";
2
- class ArcsToCutsManager {
3
- constructor(rbush, { dotDistanceOfArcCuts = 0.01 }) {
4
- this._map = new Map();
5
- this._dotDistanceOfArcCuts = dotDistanceOfArcCuts;
6
- this._rbush = rbush;
7
- }
8
- insertArcs(arc) {
9
- if (this._map.has(arc.id)) {
10
- this._deleteCuts(arc.id);
11
- }
12
- }
13
- _deleteCuts(id) {
14
- const cuts = this._map.get(id);
15
- if (cuts) {
16
- cuts.forEach(cut => cut.remove());
17
- }
18
- }
19
- _cutArcAndAddToRBush(arc) {
20
- const cuts = this._cutArcToBBoxs(arc);
21
- cuts.forEach(cut => {
22
- this._rbush.insert(cut);
23
- });
24
- this._map.set(arc.id, cuts);
25
- }
26
- _cutArcToBBoxs(arc) {
27
- const cuts = [];
28
- // Calculate the bounding box of the arc
29
- // Create a cut object and add it to the cuts array
30
- const cut = {
31
- minX: bbox.minX,
32
- minY: bbox.minY,
33
- maxX: bbox.maxX,
34
- maxY: bbox.maxY,
35
- arcId: arc.id,
36
- };
37
- cuts.push(cut);
38
- return cuts;
39
- }
40
- }
41
- function sphericalLinearInterpolation(phi1, lambda1, phi2, lambda2, t) {
42
- // Spherical linear interpolation between two points on a sphere
43
- // Args: phi1, lambda1: starting point (in radians)
44
- // phi2, lambda2: ending point (in radians)
45
- // t: interpolation parameter (0 <= t <= 1)
46
- // Returns: [phi, lambda] in radians
47
- const phi = phi1 + t * (phi2 - phi1);
48
- const lambda = lambda1 + t * (lambda2 - lambda1);
49
- return [phi, lambda];
50
- }
@@ -1 +0,0 @@
1
- "use strict";