@pirireis/webglobeplugins 0.9.6 → 0.9.7

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