@pirireis/webglobeplugins 0.9.5 → 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 +8 -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 -21
  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,258 +0,0 @@
1
- import { getColorRampModed, DataManager, PointCoordinatesDataCalculator } from "../../util";
2
-
3
- import { GlobeShellWiggle, Float2LegendWithRatio } from "../../programs";
4
-
5
- import { opacityCheck } from "../../util/check/typecheck";
6
-
7
- /**
8
- * @param id : string
9
- * @param dataManager : DataManager
10
- * @param colorRampData : {values: string[], thresholds: number[], mode: string}
11
- * @param dataWidthHeight : {width: number, height: number}
12
- * @param options : {bbox: number[], minMaxEdges: {min: number, max: number}, escapeValue: number, resolution: number[], meshPartition: number[]}
13
- */
14
- export default class HeatWaveGlobeShellPlugin {
15
- constructor(id, dataManager, colorRampData, dataWidthHeight,
16
- {
17
- bbox = [-180, -90, 180, 90],
18
- minMaxEdges = { min: -99999, max: 99999 },
19
- escapeValue = 99999,
20
- resolution = [2056, 2056],
21
- yFlip = true,
22
- } = {}) {
23
- this.id = id;
24
- this.dataManager = dataManager;
25
- this._dataWidthHeight = dataWidthHeight;
26
-
27
- this._isOn = true;
28
- this._bbox = bbox
29
- this._minMaxEdges = minMaxEdges;
30
- this._escapeValue = escapeValue
31
- this._resolution = resolution;
32
-
33
- this._colorRampData = colorRampData; // holds until init
34
- this._yFlip = yFlip;
35
- this._lastTexture0data = null;
36
- this._lastTexture1data = null;
37
-
38
- // output of heatProgram is written to ._coloredHeatTexture
39
- this._frameBuffer = null
40
- this._coloredHeatTexture = null;
41
- this.enabled = false;
42
- this.isAble = false;
43
- }
44
-
45
-
46
- setHeight(height) {
47
- this.globeShell.setHeight(height);
48
- }
49
-
50
-
51
- drawHeat() {
52
- const gl = this.gl;
53
- gl.bindFramebuffer(gl.FRAMEBUFFER, this._frameBuffer);
54
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this._coloredHeatTexture, 0);
55
- gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
56
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
57
- const currentWidth = gl.canvas.width;
58
- const currentHeight = gl.canvas.height;
59
- gl.viewport(0, 0, ...this._resolution);
60
- this.heatProgram.draw()
61
- gl.viewport(0, 0, currentWidth, currentHeight);
62
- gl.bindFramebuffer(gl.FRAMEBUFFER, null);
63
- gl.useProgram(currentProgram);
64
- this.globe.DrawRender();
65
- }
66
-
67
-
68
- setEscapeValue(escapeValue) {
69
- this._escapeValue = escapeValue;
70
- this.heatProgram.setEscapeValue(escapeValue);
71
- }
72
-
73
-
74
- _createPointCoordinatesDataCalculator() {
75
- this.coordinatesDataCalculator = new PointCoordinatesDataCalculator(this._bbox, this._dataWidthHeight.width, this._dataWidthHeight.height);
76
- this.dataManager.register(this._coordinatesDataCalculatorID(), this.coordinatesDataCalculator.updateData.bind(this.coordinatesDataCalculator));
77
- }
78
-
79
-
80
- _coordinatesDataCalculatorID() {
81
- return this.id + "_coordinatesDataCalculator";
82
- }
83
-
84
-
85
- updateTime(time) {
86
- this.dataManager.updateTime(time);
87
- this.globe.DrawRender();
88
- }
89
-
90
- setWiggle({ wiggleInKm = null, wiggleSpeed = null } = {}) {
91
- this.globeShell.setWiggle({ wiggleInKm, wiggleSpeed });
92
- }
93
-
94
-
95
- setMinMaxEdges(min = null, max = null) {
96
- if (min) this._minMaxEdges.min = min;
97
- if (max) this._minMaxEdges.max = max;
98
- this.heatProgram.setMinMaxEdges(this._minMaxEdges.min, this._minMaxEdges.max);
99
- this.drawHeat();
100
- }
101
-
102
-
103
- setBBox(minLon, minLat, maxLon, maxLat) {
104
- this._bbox = [minLon, minLat, maxLon, maxLat];
105
- this.globeShell.setBBox({ minLon, minLat, maxLon, maxLat });
106
- this.drawHeat();
107
- }
108
-
109
-
110
- getPointCoordinatesDataCalculator() {
111
- if (!this.coordinatesDataCalculator) this._createPointCoordinatesDataCalculator();
112
- return this.coordinatesDataCalculator;
113
- }
114
-
115
-
116
- /**
117
- * @param {*} values n + 1 number of color hex values without alpha channel. Ex: ["#ff0000", "#00ff00", "#0000ff"]
118
- * @param {*} thresholds n number of thresholds. Ex: [0, 10, 20]
119
- * @param {*} mode "discrete" or "interpolated"
120
- *
121
- * There are maximum 256 pixels in the color ramp.
122
- * The first values array is minimum edge value which is the first pixel, the second comes one pixel after the first.
123
- */
124
- setColorRamp(values, thresholds, mode = "interpolated") {
125
- const lowest = thresholds[0];
126
- const highest = thresholds[thresholds.length - 1];
127
- const range = highest - lowest;
128
- const clampedThresholds = thresholds.map((t) => (t - lowest) / range);
129
- const colors = getColorRampModed(values, clampedThresholds, mode);
130
- this.heatProgram.setColorRampTextureData(colors, 256);
131
- this.heatProgram.setColorRampRange(lowest, highest);
132
- this.drawHeat();
133
- }
134
-
135
-
136
- off() {
137
- this._isOn = false;
138
- }
139
-
140
-
141
- on() {
142
- this._isOn = true;
143
- }
144
-
145
-
146
- _updateData(ratio, textureData0 = null, textureData1 = null) {
147
- if (!textureData0 || !textureData1) {
148
- if (this._disCarded) return;
149
- this.heatProgram.discard();
150
- this.drawHeat();
151
- this._disCarded = true;
152
- return;
153
- };
154
- this.heatProgram.setBlendRatio(ratio);
155
- if (this._lastTexture0data !== textureData0 || this._lastTexture1data !== textureData1) {
156
- this._disCarded = false;
157
- this._lastTexture0data = textureData0;
158
- this._lastTexture1data = textureData1;
159
- this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height, this._yFlip);
160
- }
161
- this.drawHeat();
162
- }
163
-
164
-
165
- setDataWidthHeight(width, height) {
166
- this._dataWidthHeight = { width, height };
167
- this.heatProgram.setDataWidthHeight(width, height);
168
- this.setGeometry();
169
- }
170
-
171
-
172
- draw3D() {
173
- if (!this._isOn) return;
174
- // if (!this.isAble) return;
175
- this.gl.disable(this.gl.DEPTH_TEST);
176
- this.globeShell.draw();
177
- this.gl.enable(this.gl.DEPTH_TEST);
178
- }
179
-
180
-
181
- setOpacity(opacity) {
182
- opacityCheck(opacity);
183
- this.globeShell.setOpacity(opacity);
184
- }
185
-
186
-
187
- _setAfterInit() {
188
- const [minLon, minLat, maxLon, maxLat] = this._bbox;
189
- this.globeShell.setBBox({ minLon, minLat, maxLon, maxLat });
190
- this.setColorRamp(this._colorRampData.values, this._colorRampData.thresholds, this._colorRampData.mode);
191
- delete this._colorRampData;
192
- this.setMinMaxEdges(this._minMaxEdges.min, this._minMaxEdges.max);
193
- this.setEscapeValue(this._escapeValue);
194
- }
195
-
196
-
197
- _init(globe, gl) {
198
- this.globeShell = new GlobeShellWiggle(gl, globe, {
199
- minLon: this._bbox[0],
200
- minLat: this._bbox[1],
201
- maxLon: this._bbox[2],
202
- maxLat: this._bbox[3],
203
- color: [1.0, 0.1, 0.4, 0.2],
204
- height: 0,
205
- wiggleInKM: 2,
206
- eastWestTied: false,
207
- displayMesh: false
208
- });
209
- this.heatProgram = new Float2LegendWithRatio(gl);
210
- this._frameBuffer = gl.createFramebuffer();
211
-
212
- this.dataManager.register(this.id, (ratio, t1, t2) => this._updateData(ratio, t1, t2));
213
- this.setResolution(this._resolution[0], this._resolution[1]);
214
- }
215
-
216
-
217
-
218
- init(globe, gl) {
219
- this.globe = globe;
220
- this.gl = gl;
221
- this._init(globe, gl);
222
- this._setAfterInit();
223
- }
224
-
225
- setGeometry() {
226
- // globeShell has an implicit program, registered and sets its own geometry.
227
- return;
228
- }
229
-
230
-
231
- // sets Density of middle texture which is used with framebuffers
232
- setResolution(width, height) {
233
- const gl = this.gl;
234
- this._resolution = [width, height];
235
- this._coloredHeatTexture = gl.createTexture();
236
- gl.bindTexture(gl.TEXTURE_2D, this._coloredHeatTexture);
237
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
238
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
239
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
240
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
241
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
242
- gl.bindTexture(gl.TEXTURE_2D, null);
243
- this.globeShell.setTexture(this._coloredHeatTexture);
244
- }
245
-
246
-
247
- free() {
248
- if (this.coordinatesDataCalculator) {
249
- this.dataManager.unregister(this._coordinatesDataCalculatorID());
250
- this.coordinatesDataCalculator = null;
251
- }
252
- this.dataManager.unregister(this.id);
253
- this.globeShell.free();
254
- this.heatProgram.free();
255
- }
256
-
257
-
258
- }
package/jest.config.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- testMatch: ['**/tests/**/*.test.ts'],
5
- moduleFileExtensions: ['ts', 'js'],
6
- }
@@ -1,89 +0,0 @@
1
- import BufferOffsetManager from "../util/account/bufferoffsetmanager";
2
-
3
-
4
-
5
- const ITEM_SIZE = 10;
6
- export default class BufferManager extends BufferOffsetManager {
7
- constructor(globe, gl, buffer, { initialCapacity = 10, bufferType = "DYNAMIC_DRAW" } = {}) {
8
- super(ITEM_SIZE, { capacity: initialCapacity });
9
- this.globe = globe;
10
- this.gl = gl;
11
- this.buffer = buffer;
12
- this.bufferType = bufferType;
13
-
14
-
15
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
16
- gl.bufferData(gl.ARRAY_BUFFER, initialCapacity * ITEM_SIZE * 4, gl[bufferType]);
17
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
18
- }
19
-
20
- /**
21
- *
22
- * @param { Array<{key, long, lat, startAngle, tailAngle, radius, rgba[4], rgbaMode }>} rings
23
- * @returns
24
- */
25
- insertBulk(items) {
26
- if (items.length === 0) return;
27
- this.autoExtendBuffer(items.length);
28
- const { gl, buffer } = this;
29
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
30
- for (let { key, long, lat, startAngle, tailAngle, rgba, radius, rgbaMode } of items) {
31
- const offset = this.getOffset(key) | this.nextOffset();
32
- this.setOffset(key, offset);
33
- const block = new Float32Array([
34
- long, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode]);
35
- gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
36
- // 2 1 1 1 4 1 = 10
37
- }
38
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
39
- this.globe.DrawRender();
40
- }
41
-
42
-
43
- /**
44
- * @param {Array<{key, long, lat, startAngle, tailAngle}>} items
45
- *
46
- * */
47
- updateCenterAndAngleBulk(items) {
48
- const { gl, buffer } = this;
49
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
50
- for (let { key, long, lat, startAngle, tailAngle } of items) {
51
- const offset = this.getOffset(key);
52
- if (offset === null) {
53
- console.warn(`key ${key} not found`);
54
- continue;
55
- }
56
- const block = new Float32Array([long, lat, startAngle, tailAngle]);
57
- gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
58
- }
59
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
60
- this.globe.DrawRender();
61
- }
62
- /**
63
- *
64
- * @param {Array<{key:string, payload:Float32Array}} items
65
- * @param {PART_OFFSET_LOOPUP} part | long, lat, START_ANGLE, ROTATION_ANGLE, RADIUS, rgba, rgba_MODE
66
- * @returns
67
- */
68
- updatePartial(items, part) {
69
- const { gl, buffer } = this;
70
- this._updatePartial(items, part, gl, buffer);
71
- this.globe.DrawRender();
72
-
73
- }
74
-
75
-
76
-
77
- deleteBulk(keys) {
78
- this._deleteBulk(keys);
79
- this.globe.DrawRender();
80
- }
81
-
82
-
83
-
84
-
85
- free() {
86
- this.gl.deleteBuffer(this.buffer);
87
- this.buffer = null;
88
- }
89
- }
@@ -1,17 +0,0 @@
1
- * Pie Statistacal view
2
- A Unit is a bundle of partial rings.
3
- Multiple partial rings of different color on the same center.
4
- Update center updates a bundle
5
- Updating an the amount of a a ring updates all the rings percentage in the same bundle.
6
-
7
- An animation can be added
8
-
9
- * EBM bearing view
10
-
11
- create a plugin with line and points
12
-
13
- * Target 1 is a point
14
- * Target 2 is a point or an angle
15
-
16
- // TODO: What IS the purpose of this folder?
17
- // Clean
@@ -1,3 +0,0 @@
1
- import PartialRing, { RINGPARTIAL_ALPHA_MODE, RINGPARTIAL_DRAW_MODE, PART_OFFSET_LOOPUP } from './plugin';
2
-
3
- export { PartialRing, RINGPARTIAL_ALPHA_MODE, RINGPARTIAL_DRAW_MODE, PART_OFFSET_LOOPUP };
@@ -1,160 +0,0 @@
1
-
2
-
3
- import BufferOffsetManager from '../util/account/bufferoffsetmanager';
4
- import { programCache, ITEM_SIZE } from './program';
5
-
6
- import { opacityCheck } from '../util/check/typecheck';
7
-
8
- const emptyBlock = new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
9
-
10
- export const RINGPARTIAL_DRAW_MODE = Object.freeze({
11
- LINE_STRIP: "LINE_STRIP",
12
- TRIANGLE_FAN: "TRIANGLE_FAN",
13
- });
14
-
15
- export const RINGPARTIAL_ALPHA_MODE = Object.freeze({
16
- CONSTANT: 0,
17
- FADING: 1,
18
- HIDE: 2,
19
- });
20
-
21
-
22
- export const PART_OFFSET_LOOPUP = Object.freeze({
23
- LONG: 0,
24
- LAT: 1,
25
- START_ANGLE: 2,
26
- TAIL_ANGLE: 3,
27
- RGBA: 4,
28
- RADIUS: 8,
29
- RGBA_MODE: 9,
30
- });
31
-
32
-
33
- export default class {
34
- constructor(id, { edgeCount = 10, drawMode = RINGPARTIAL_DRAW_MODE.LINE_STRIP, startLod = 3, endLod = 13, alphaMultiplier = 1 } = {}) {
35
- this.id = id;
36
- this.edgeCount = edgeCount;
37
- this.drawMode = drawMode;
38
- this.startLod = startLod;
39
- this.endLod = endLod;
40
- this.alphaMultiplier = alphaMultiplier;
41
-
42
- }
43
-
44
- init(globe, gl) {
45
- this.gl = gl;
46
- this.globe = globe;
47
- this.program = programCache.get(globe);
48
- const { vao, buffer } = this.program.getVaoBuffer();
49
- this.vao = vao;
50
- this.buffer = buffer;
51
- }
52
-
53
-
54
- draw3D() {
55
- const LOD = this.globe.api_GetCurrentLOD();
56
-
57
- if (LOD < this.startLod || LOD > this.endLod) return;
58
- this.program.draw(
59
- this.bufferManager.length,
60
- this.vao,
61
- this.edgeCount,
62
- this.alphaMultiplier,
63
- this.drawMode,
64
- )
65
- }
66
-
67
- /**
68
- *
69
- * @param {RINGPARTIAL_DRAW_MODE} drawMode
70
- */
71
- setDrawMode(drawMode) {
72
- this.drawMode = drawMode;
73
- }
74
-
75
- setOpacity(opacity) {
76
- opacityCheck(opacity);
77
- this.alphaMultiplier = opacity;
78
- }
79
-
80
- setStartEndLOD({ startLod = null, endLod = null } = {}) {
81
- if (startLod !== null) this.startLod = startLod;
82
- if (endLod !== null) this.endLod = endLod;
83
- }
84
-
85
- createBufferMAnager(initialCapacity = 10, bufferType = 'DYNAMIC_DRAW') {
86
- if (!this.bufferManager) { this.bufferManager = new BufferManager(this.globe, this.gl, this.buffer, { initialCapacity, bufferType, }); }
87
- return this.bufferManager;
88
- }
89
-
90
- free() {
91
- programCache.free(this.globe);
92
- this.bufferManager.free();
93
- }
94
- }
95
-
96
-
97
- class BufferManager extends BufferOffsetManager {
98
-
99
- constructor(globe, gl, buffer, { initialCapacity = 10, bufferType, } = {}) {
100
- super(10, { capacity: initialCapacity, bufferType, });
101
- this.globe = globe;
102
- this.gl = gl;
103
- this.buffer = buffer;
104
- this.bufferType = bufferType;
105
-
106
-
107
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
108
- gl.bufferData(gl.ARRAY_BUFFER, initialCapacity * ITEM_SIZE * 4, gl[bufferType]);
109
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
110
- }
111
-
112
- /**
113
- *
114
- * @param { Array<{key, long, lat, startAngle, tailAngle, radius, rgba[4], rgbaMode }>} rings
115
- * @returns
116
- */
117
- insertBulk(items) {
118
- if (items.length === 0) return;
119
- this.autoExtendBuffer(items.length);
120
- const { gl, buffer } = this;
121
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
122
- for (let { key, long, lat, startAngle, tailAngle, rgba, radius, rgbaMode } of items) {
123
- const offset = this.getOffset(key) | this.nextOffset();
124
- this.setOffset(key, offset);
125
- const block = new Float32Array([
126
- long, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode]);
127
- gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
128
- // 2 1 1 1 4 1 = 10
129
- }
130
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
131
- this.globe.DrawRender();
132
- }
133
-
134
-
135
- /**
136
- *
137
- * @param {Array<{key:string, payload:Float32Array}} items
138
- * @param {PART_OFFSET_LOOPUP} part | long, lat, START_ANGLE, ROTATION_ANGLE, RADIUS, rgba, rgba_MODE
139
- * @returns
140
- */
141
- updatePartial(items, part) {
142
- const { gl, buffer } = this;
143
- this._updatePartial(items, part, gl, buffer);
144
- this.globe.DrawRender();
145
-
146
- }
147
-
148
-
149
- delete(keys) {
150
- const { gl, buffer } = this;
151
- this._removefromBuffer(gl, buffer, keys, emptyBlock);
152
- this.globe.DrawRender();
153
- }
154
-
155
-
156
- free() {
157
- this.gl.deleteBuffer(this.buffer);
158
- this.buffer = null;
159
- }
160
- }