@pirireis/webglobeplugins 0.9.11 → 0.9.12

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 (166) hide show
  1. package/Math/angle-calculation.js +8 -8
  2. package/Math/arc.js +18 -18
  3. package/Math/bounds/line-bbox.js +78 -80
  4. package/Math/constants.js +3 -3
  5. package/Math/juction/arc-plane.js +23 -23
  6. package/Math/juction/line-sphere.js +11 -11
  7. package/Math/juction/plane-plane.js +11 -11
  8. package/Math/line.js +14 -16
  9. package/Math/methods.js +65 -70
  10. package/Math/plane.js +16 -18
  11. package/Math/quaternion.js +45 -49
  12. package/Math/utils.js +2 -2
  13. package/Math/vec3.js +42 -45
  14. package/algorithms/search-binary.js +4 -4
  15. package/altitude-locator/draw-subset-obj.js +7 -8
  16. package/altitude-locator/plugin.js +98 -114
  17. package/arrowfield/adaptor.js +3 -4
  18. package/arrowfield/index.js +2 -2
  19. package/arrowfield/plugin.js +62 -65
  20. package/bearing-line/index.js +1 -1
  21. package/bearing-line/plugin.js +200 -226
  22. package/circle-line-chain/chain-list-map.js +82 -88
  23. package/circle-line-chain/plugin.js +134 -165
  24. package/circle-line-chain/util.js +1 -1
  25. package/compass-rose/compass-rose-padding-flat.js +108 -133
  26. package/compass-rose/compass-text-writer.js +62 -70
  27. package/compass-rose/index.js +2 -2
  28. package/compassrose/compassrose.js +46 -50
  29. package/compassrose/index.js +1 -1
  30. package/heatwave/index.js +2 -2
  31. package/heatwave/isobar/objectarraylabels.js +44 -48
  32. package/heatwave/isobar/plugin.js +104 -123
  33. package/heatwave/isobar/quadtreecontours.js +76 -92
  34. package/heatwave/plugins/heatwaveglobeshell.js +69 -87
  35. package/index.js +11 -11
  36. package/package.json +1 -1
  37. package/partialrings/buffer-manager.js +32 -64
  38. package/partialrings/index.js +1 -1
  39. package/partialrings/plugin.js +48 -84
  40. package/partialrings/program.js +136 -47
  41. package/pin/pin-object-array.js +83 -86
  42. package/pin/pin-point-totem.js +21 -22
  43. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
  44. package/point-heat-map/plugin-webworker.js +40 -45
  45. package/point-heat-map/point-to-heat-map-flow.js +40 -42
  46. package/point-tracks/key-methods.js +1 -1
  47. package/point-tracks/plugin.js +137 -162
  48. package/programs/arrowfield/index.js +1 -1
  49. package/programs/arrowfield/logic.js +170 -62
  50. package/programs/arrowfield/object.js +33 -35
  51. package/programs/data2legend/density-to-legend.js +45 -21
  52. package/programs/data2legend/point-to-density-texture.js +52 -27
  53. package/programs/float2legendwithratio/index.js +1 -1
  54. package/programs/float2legendwithratio/logic.js +88 -42
  55. package/programs/float2legendwithratio/object.js +43 -46
  56. package/programs/globe-util/is-globe-moved.js +10 -11
  57. package/programs/globeshell/index.js +1 -1
  58. package/programs/globeshell/wiggle/index.js +1 -1
  59. package/programs/globeshell/wiggle/logic.js +191 -98
  60. package/programs/globeshell/wiggle/object.js +33 -35
  61. package/programs/helpers/blender/program.js +36 -19
  62. package/programs/helpers/fadeaway/index.js +1 -1
  63. package/programs/helpers/fadeaway/logic.js +35 -13
  64. package/programs/helpers/fadeaway/object.js +9 -10
  65. package/programs/helpers/index.js +1 -1
  66. package/programs/index.js +8 -8
  67. package/programs/line-on-globe/angled-line.js +91 -32
  68. package/programs/line-on-globe/circle-accurate-3d.js +82 -32
  69. package/programs/line-on-globe/circle-accurate-flat.js +108 -50
  70. package/programs/line-on-globe/circle-accurate.js +103 -33
  71. package/programs/line-on-globe/circle.js +97 -32
  72. package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
  73. package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
  74. package/programs/line-on-globe/linestrip.js +111 -45
  75. package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
  76. package/programs/line-on-globe/to-the-surface.js +58 -29
  77. package/programs/line-on-globe/util.js +1 -1
  78. package/programs/picking/pickable-renderer.js +117 -33
  79. package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
  80. package/programs/point-on-globe/element-point-glow.js +103 -35
  81. package/programs/point-on-globe/square-pixel-point.js +76 -27
  82. package/programs/programcache.js +13 -13
  83. package/programs/rings/distancering/circleflatprogram.js +63 -21
  84. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
  85. package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
  86. package/programs/rings/distancering/index.js +4 -4
  87. package/programs/rings/distancering/paddyflatprogram.js +73 -20
  88. package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
  89. package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
  90. package/programs/rings/partial-ring/piece-of-pie.js +137 -35
  91. package/programs/totems/camerauniformblock.js +64 -51
  92. package/programs/totems/canvas-webglobe-info.js +48 -40
  93. package/programs/totems/gpu-selection-uniform-block.js +44 -40
  94. package/programs/totems/index.js +1 -1
  95. package/programs/two-d/pixel-padding-for-compass.js +90 -29
  96. package/programs/util.js +6 -7
  97. package/programs/vectorfields/index.js +1 -1
  98. package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
  99. package/programs/vectorfields/logics/index.js +3 -3
  100. package/programs/vectorfields/logics/pixelbased.js +91 -35
  101. package/programs/vectorfields/logics/ubo.js +31 -25
  102. package/programs/vectorfields/pingpongbuffermanager.js +30 -34
  103. package/rangerings/index.js +4 -4
  104. package/rangerings/plugin.js +202 -258
  105. package/rangerings/rangeringangletext.js +108 -120
  106. package/rangerings/ring-account.js +52 -69
  107. package/shaders/fragment-toy/firework.js +55 -1
  108. package/shaders/fragment-toy/singularity.js +55 -1
  109. package/timetracks/adaptors-line-strip.js +26 -37
  110. package/timetracks/adaptors.js +47 -61
  111. package/timetracks/index.js +4 -4
  112. package/timetracks/plugin-line-strip.js +63 -71
  113. package/timetracks/plugin.js +69 -77
  114. package/timetracks/program-line-strip.js +296 -103
  115. package/timetracks/program.js +419 -113
  116. package/timetracks/programpoint-line-strip.js +97 -44
  117. package/timetracks/programpoint.js +90 -44
  118. package/util/account/bufferoffsetmanager.js +72 -95
  119. package/util/account/index.js +1 -1
  120. package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
  121. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
  122. package/util/account/single-attribute-buffer-management/index.js +3 -3
  123. package/util/account/single-attribute-buffer-management/object-store.js +29 -30
  124. package/util/account/util.js +2 -4
  125. package/util/algorithms/search-binary.js +4 -4
  126. package/util/check/get.js +5 -5
  127. package/util/check/typecheck.js +13 -15
  128. package/util/geometry/index.js +9 -11
  129. package/util/gl-util/buffer/attribute-loader.js +8 -20
  130. package/util/gl-util/buffer/index.js +1 -1
  131. package/util/gl-util/draw-options/methods.js +8 -9
  132. package/util/gl-util/uniform-block/manager.js +67 -67
  133. package/util/heatwavedatamanager/datamanager.js +56 -116
  134. package/util/heatwavedatamanager/index.js +2 -2
  135. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
  136. package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
  137. package/util/index.js +6 -6
  138. package/util/interpolation/timetrack/index.js +1 -1
  139. package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
  140. package/util/interpolation/timetrack/web-worker-str.js +179 -1
  141. package/util/interpolation/timetrack/web-worker.js +4 -4
  142. package/util/jshelpers/data-filler.js +7 -7
  143. package/util/jshelpers/timefilters.js +7 -7
  144. package/util/picking/fence.js +7 -7
  145. package/util/picking/picker-displayer.js +46 -52
  146. package/util/programs/draw-texture-on-canvas.js +39 -21
  147. package/util/programs/shapesonglobe.js +104 -64
  148. package/util/programs/supersampletotextures.js +45 -39
  149. package/util/programs/texturetoglobe.js +98 -48
  150. package/util/shaderfunctions/geometrytransformations.js +322 -27
  151. package/util/shaderfunctions/nodata.js +7 -1
  152. package/util/shaderfunctions/noisefunctions.js +39 -9
  153. package/util/surface-line-data/arcs-to-cuts.js +20 -23
  154. package/util/webglobe/rasteroverlay.js +35 -37
  155. package/util/webglobjectbuilders.js +55 -60
  156. package/util/webglobjectbuilders1.js +48 -49
  157. package/waveparticles/adaptor.js +6 -7
  158. package/waveparticles/index.js +2 -2
  159. package/waveparticles/plugin.js +79 -84
  160. package/wind/imagetovectorfieldandmagnitude.js +15 -15
  161. package/wind/index.js +4 -4
  162. package/wind/plugin.js +453 -251
  163. package/wind/vectorfieldimage.js +5 -5
  164. package/write-text/attached-text-writer.js +46 -48
  165. package/write-text/context-text.js +51 -58
  166. package/write-text/context-text3.js +69 -74
@@ -1,113 +1,81 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
- if (ar || !(i in from)) {
20
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
- ar[i] = from[i];
22
- }
23
- }
24
- return to.concat(ar || Array.prototype.slice.call(from));
25
- };
26
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
4
  };
29
5
  Object.defineProperty(exports, "__esModule", { value: true });
30
- var bufferoffsetmanager_1 = __importDefault(require("../util/account/bufferoffsetmanager"));
31
- var ITEM_SIZE = 10;
32
- var BufferManager = /** @class */ (function (_super) {
33
- __extends(BufferManager, _super);
34
- function BufferManager(globe, gl, buffer, _a) {
35
- var _b = _a === void 0 ? {} : _a, _c = _b.initialCapacity, initialCapacity = _c === void 0 ? 10 : _c, _d = _b.bufferType, bufferType = _d === void 0 ? "DYNAMIC_DRAW" : _d;
36
- var _this = _super.call(this, ITEM_SIZE, { capacity: initialCapacity }) || this;
37
- _this.globe = globe;
38
- _this.gl = gl;
39
- _this.buffer = buffer;
40
- _this.bufferType = bufferType;
6
+ const bufferoffsetmanager_1 = __importDefault(require("../util/account/bufferoffsetmanager"));
7
+ const ITEM_SIZE = 10;
8
+ class BufferManager extends bufferoffsetmanager_1.default {
9
+ constructor(globe, gl, buffer, { initialCapacity = 10, bufferType = "DYNAMIC_DRAW" } = {}) {
10
+ super(ITEM_SIZE, { capacity: initialCapacity });
11
+ this.globe = globe;
12
+ this.gl = gl;
13
+ this.buffer = buffer;
14
+ this.bufferType = bufferType;
41
15
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
42
16
  gl.bufferData(gl.ARRAY_BUFFER, initialCapacity * ITEM_SIZE * 4, gl[bufferType]);
43
17
  gl.bindBuffer(gl.ARRAY_BUFFER, null);
44
- return _this;
45
18
  }
46
19
  /**
47
20
  *
48
21
  * @param { Array<{key, long, lat, startAngle, tailAngle, radius, rgba[4], rgbaMode }>} rings
49
22
  * @returns
50
23
  */
51
- BufferManager.prototype.insertBulk = function (items) {
24
+ insertBulk(items) {
52
25
  if (items.length === 0)
53
26
  return;
54
27
  this.autoExtendBuffer(items.length);
55
- var _a = this, gl = _a.gl, buffer = _a.buffer;
28
+ const { gl, buffer } = this;
56
29
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
57
- for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
58
- var _b = items_1[_i], key = _b.key, long = _b.long, lat = _b.lat, startAngle = _b.startAngle, tailAngle = _b.tailAngle, rgba = _b.rgba, radius = _b.radius, rgbaMode = _b.rgbaMode;
59
- var offset = this.getOffset(key) | this.nextOffset();
30
+ for (let { key, long, lat, startAngle, tailAngle, rgba, radius, rgbaMode } of items) {
31
+ const offset = this.getOffset(key) | this.nextOffset();
60
32
  this.setOffset(key, offset);
61
- var block = new Float32Array(__spreadArray(__spreadArray([
62
- long, lat, startAngle, tailAngle
63
- ], rgba, true), [
64
- radius, rgbaMode
65
- ], false));
33
+ const block = new Float32Array([
34
+ long, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode
35
+ ]);
66
36
  gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
67
37
  // 2 1 1 1 4 1 = 10
68
38
  }
69
39
  gl.bindBuffer(gl.ARRAY_BUFFER, null);
70
40
  this.globe.DrawRender();
71
- };
41
+ }
72
42
  /**
73
43
  * @param {Array<{key, long, lat, startAngle, tailAngle}>} items
74
44
  *
75
45
  * */
76
- BufferManager.prototype.updateCenterAndAngleBulk = function (items) {
77
- var _a = this, gl = _a.gl, buffer = _a.buffer;
46
+ updateCenterAndAngleBulk(items) {
47
+ const { gl, buffer } = this;
78
48
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
79
- for (var _i = 0, items_2 = items; _i < items_2.length; _i++) {
80
- var _b = items_2[_i], key = _b.key, long = _b.long, lat = _b.lat, startAngle = _b.startAngle, tailAngle = _b.tailAngle;
81
- var offset = this.getOffset(key);
49
+ for (let { key, long, lat, startAngle, tailAngle } of items) {
50
+ const offset = this.getOffset(key);
82
51
  if (offset === null) {
83
- console.warn("key ".concat(key, " not found"));
52
+ console.warn(`key ${key} not found`);
84
53
  continue;
85
54
  }
86
- var block = new Float32Array([long, lat, startAngle, tailAngle]);
55
+ const block = new Float32Array([long, lat, startAngle, tailAngle]);
87
56
  gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
88
57
  }
89
58
  gl.bindBuffer(gl.ARRAY_BUFFER, null);
90
59
  this.globe.DrawRender();
91
- };
60
+ }
92
61
  /**
93
62
  *
94
63
  * @param {Array<{key:string, payload:Float32Array}} items
95
64
  * @param {PART_OFFSET_LOOPUP} part | long, lat, START_ANGLE, ROTATION_ANGLE, RADIUS, rgba, rgba_MODE
96
65
  * @returns
97
66
  */
98
- BufferManager.prototype.updatePartial = function (items, part) {
99
- var _a = this, gl = _a.gl, buffer = _a.buffer;
67
+ updatePartial(items, part) {
68
+ const { gl, buffer } = this;
100
69
  this._updatePartial(items, part, gl, buffer);
101
70
  this.globe.DrawRender();
102
- };
103
- BufferManager.prototype.deleteBulk = function (keys) {
71
+ }
72
+ deleteBulk(keys) {
104
73
  this._deleteBulk(keys);
105
74
  this.globe.DrawRender();
106
- };
107
- BufferManager.prototype.free = function () {
75
+ }
76
+ free() {
108
77
  this.gl.deleteBuffer(this.buffer);
109
78
  this.buffer = null;
110
- };
111
- return BufferManager;
112
- }(bufferoffsetmanager_1.default));
79
+ }
80
+ }
113
81
  exports.default = BufferManager;
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.PART_OFFSET_LOOPUP = exports.RINGPARTIAL_DRAW_MODE = exports.RINGPARTIAL_ALPHA_MODE = exports.PartialRing = void 0;
37
- var plugin_1 = __importStar(require("./plugin"));
37
+ const plugin_1 = __importStar(require("./plugin"));
38
38
  exports.PartialRing = plugin_1.default;
39
39
  Object.defineProperty(exports, "RINGPARTIAL_ALPHA_MODE", { enumerable: true, get: function () { return plugin_1.RINGPARTIAL_ALPHA_MODE; } });
40
40
  Object.defineProperty(exports, "RINGPARTIAL_DRAW_MODE", { enumerable: true, get: function () { return plugin_1.RINGPARTIAL_DRAW_MODE; } });
@@ -1,37 +1,13 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
- if (ar || !(i in from)) {
20
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
- ar[i] = from[i];
22
- }
23
- }
24
- return to.concat(ar || Array.prototype.slice.call(from));
25
- };
26
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
4
  };
29
5
  Object.defineProperty(exports, "__esModule", { value: true });
30
6
  exports.PART_OFFSET_LOOPUP = exports.RINGPARTIAL_ALPHA_MODE = exports.RINGPARTIAL_DRAW_MODE = void 0;
31
- var bufferoffsetmanager_1 = __importDefault(require("../util/account/bufferoffsetmanager"));
32
- var program_1 = require("./program");
33
- var typecheck_1 = require("../util/check/typecheck");
34
- var emptyBlock = new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
7
+ const bufferoffsetmanager_1 = __importDefault(require("../util/account/bufferoffsetmanager"));
8
+ const program_1 = require("./program");
9
+ const typecheck_1 = require("../util/check/typecheck");
10
+ const emptyBlock = new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
35
11
  exports.RINGPARTIAL_DRAW_MODE = Object.freeze({
36
12
  LINE_STRIP: "LINE_STRIP",
37
13
  TRIANGLE_FAN: "TRIANGLE_FAN",
@@ -50,9 +26,8 @@ exports.PART_OFFSET_LOOPUP = Object.freeze({
50
26
  RADIUS: 8,
51
27
  RGBA_MODE: 9,
52
28
  });
53
- var default_1 = /** @class */ (function () {
54
- function default_1(id, _a) {
55
- var _b = _a === void 0 ? {} : _a, _c = _b.edgeCount, edgeCount = _c === void 0 ? 10 : _c, _d = _b.drawMode, drawMode = _d === void 0 ? exports.RINGPARTIAL_DRAW_MODE.LINE_STRIP : _d, _e = _b.startLod, startLod = _e === void 0 ? 3 : _e, _f = _b.endLod, endLod = _f === void 0 ? 13 : _f, _g = _b.alphaMultiplier, alphaMultiplier = _g === void 0 ? 1 : _g;
29
+ class default_1 {
30
+ constructor(id, { edgeCount = 10, drawMode = exports.RINGPARTIAL_DRAW_MODE.LINE_STRIP, startLod = 3, endLod = 13, alphaMultiplier = 1 } = {}) {
56
31
  this.id = id;
57
32
  this.edgeCount = edgeCount;
58
33
  this.drawMode = drawMode;
@@ -60,112 +35,101 @@ var default_1 = /** @class */ (function () {
60
35
  this.endLod = endLod;
61
36
  this.alphaMultiplier = alphaMultiplier;
62
37
  }
63
- default_1.prototype.init = function (globe, gl) {
38
+ init(globe, gl) {
64
39
  this.gl = gl;
65
40
  this.globe = globe;
66
41
  this.program = program_1.programCache.get(globe);
67
- var _a = this.program.getVaoBuffer(), vao = _a.vao, buffer = _a.buffer;
42
+ const { vao, buffer } = this.program.getVaoBuffer();
68
43
  this.vao = vao;
69
44
  this.buffer = buffer;
70
- };
71
- default_1.prototype.draw3D = function () {
72
- var LOD = this.globe.api_GetCurrentLOD();
45
+ }
46
+ draw3D() {
47
+ const LOD = this.globe.api_GetCurrentLOD();
73
48
  if (LOD < this.startLod || LOD > this.endLod)
74
49
  return;
75
50
  this.program.draw(this.bufferManager.length, this.vao, this.edgeCount, this.alphaMultiplier, this.drawMode);
76
- };
51
+ }
77
52
  /**
78
53
  *
79
54
  * @param {RINGPARTIAL_DRAW_MODE} drawMode
80
55
  */
81
- default_1.prototype.setDrawMode = function (drawMode) {
56
+ setDrawMode(drawMode) {
82
57
  this.drawMode = drawMode;
83
- };
84
- default_1.prototype.setOpacity = function (opacity) {
58
+ }
59
+ setOpacity(opacity) {
85
60
  (0, typecheck_1.opacityCheck)(opacity);
86
61
  this.alphaMultiplier = opacity;
87
- };
88
- default_1.prototype.setStartEndLOD = function (_a) {
89
- var _b = _a === void 0 ? {} : _a, _c = _b.startLod, startLod = _c === void 0 ? null : _c, _d = _b.endLod, endLod = _d === void 0 ? null : _d;
62
+ }
63
+ setStartEndLOD({ startLod = null, endLod = null } = {}) {
90
64
  if (startLod !== null)
91
65
  this.startLod = startLod;
92
66
  if (endLod !== null)
93
67
  this.endLod = endLod;
94
- };
95
- default_1.prototype.createBufferMAnager = function (initialCapacity, bufferType) {
96
- if (initialCapacity === void 0) { initialCapacity = 10; }
97
- if (bufferType === void 0) { bufferType = 'DYNAMIC_DRAW'; }
68
+ }
69
+ createBufferMAnager(initialCapacity = 10, bufferType = 'DYNAMIC_DRAW') {
98
70
  if (!this.bufferManager) {
99
- this.bufferManager = new BufferManager(this.globe, this.gl, this.buffer, { initialCapacity: initialCapacity, bufferType: bufferType, });
71
+ this.bufferManager = new BufferManager(this.globe, this.gl, this.buffer, { initialCapacity, bufferType, });
100
72
  }
101
73
  return this.bufferManager;
102
- };
103
- default_1.prototype.free = function () {
74
+ }
75
+ free() {
104
76
  program_1.programCache.free(this.globe);
105
77
  this.bufferManager.free();
106
- };
107
- return default_1;
108
- }());
78
+ }
79
+ }
109
80
  exports.default = default_1;
110
- var BufferManager = /** @class */ (function (_super) {
111
- __extends(BufferManager, _super);
112
- function BufferManager(globe, gl, buffer, _a) {
113
- var _b = _a === void 0 ? {} : _a, _c = _b.initialCapacity, initialCapacity = _c === void 0 ? 10 : _c, bufferType = _b.bufferType;
114
- var _this = _super.call(this, 10, { capacity: initialCapacity, bufferType: bufferType, }) || this;
115
- _this.globe = globe;
116
- _this.gl = gl;
117
- _this.buffer = buffer;
118
- _this.bufferType = bufferType;
81
+ class BufferManager extends bufferoffsetmanager_1.default {
82
+ constructor(globe, gl, buffer, { initialCapacity = 10, bufferType, } = {}) {
83
+ super(10, { capacity: initialCapacity, bufferType, });
84
+ this.globe = globe;
85
+ this.gl = gl;
86
+ this.buffer = buffer;
87
+ this.bufferType = bufferType;
119
88
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
120
89
  gl.bufferData(gl.ARRAY_BUFFER, initialCapacity * program_1.ITEM_SIZE * 4, gl[bufferType]);
121
90
  gl.bindBuffer(gl.ARRAY_BUFFER, null);
122
- return _this;
123
91
  }
124
92
  /**
125
93
  *
126
94
  * @param { Array<{key, long, lat, startAngle, tailAngle, radius, rgba[4], rgbaMode }>} rings
127
95
  * @returns
128
96
  */
129
- BufferManager.prototype.insertBulk = function (items) {
97
+ insertBulk(items) {
130
98
  if (items.length === 0)
131
99
  return;
132
100
  this.autoExtendBuffer(items.length);
133
- var _a = this, gl = _a.gl, buffer = _a.buffer;
101
+ const { gl, buffer } = this;
134
102
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
135
- for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
136
- var _b = items_1[_i], key = _b.key, long = _b.long, lat = _b.lat, startAngle = _b.startAngle, tailAngle = _b.tailAngle, rgba = _b.rgba, radius = _b.radius, rgbaMode = _b.rgbaMode;
137
- var offset = this.getOffset(key) | this.nextOffset();
103
+ for (let { key, long, lat, startAngle, tailAngle, rgba, radius, rgbaMode } of items) {
104
+ const offset = this.getOffset(key) | this.nextOffset();
138
105
  this.setOffset(key, offset);
139
- var block = new Float32Array(__spreadArray(__spreadArray([
140
- long, lat, startAngle, tailAngle
141
- ], rgba, true), [
142
- radius, rgbaMode
143
- ], false));
106
+ const block = new Float32Array([
107
+ long, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode
108
+ ]);
144
109
  gl.bufferSubData(gl.ARRAY_BUFFER, offset, block);
145
110
  // 2 1 1 1 4 1 = 10
146
111
  }
147
112
  gl.bindBuffer(gl.ARRAY_BUFFER, null);
148
113
  this.globe.DrawRender();
149
- };
114
+ }
150
115
  /**
151
116
  *
152
117
  * @param {Array<{key:string, payload:Float32Array}} items
153
118
  * @param {PART_OFFSET_LOOPUP} part | long, lat, START_ANGLE, ROTATION_ANGLE, RADIUS, rgba, rgba_MODE
154
119
  * @returns
155
120
  */
156
- BufferManager.prototype.updatePartial = function (items, part) {
157
- var _a = this, gl = _a.gl, buffer = _a.buffer;
121
+ updatePartial(items, part) {
122
+ const { gl, buffer } = this;
158
123
  this._updatePartial(items, part, gl, buffer);
159
124
  this.globe.DrawRender();
160
- };
161
- BufferManager.prototype.delete = function (keys) {
162
- var _a = this, gl = _a.gl, buffer = _a.buffer;
125
+ }
126
+ delete(keys) {
127
+ const { gl, buffer } = this;
163
128
  this._removefromBuffer(gl, buffer, keys, emptyBlock);
164
129
  this.globe.DrawRender();
165
- };
166
- BufferManager.prototype.free = function () {
130
+ }
131
+ free() {
167
132
  this.gl.deleteBuffer(this.buffer);
168
133
  this.buffer = null;
169
- };
170
- return BufferManager;
171
- }(bufferoffsetmanager_1.default));
134
+ }
135
+ }