@pirireis/webglobeplugins 0.9.10 → 0.9.11

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