@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.
- package/Math/angle-calculation.js +8 -8
- package/Math/arc.js +18 -18
- package/Math/bounds/line-bbox.js +78 -80
- package/Math/constants.js +3 -3
- package/Math/juction/arc-plane.js +23 -23
- package/Math/juction/line-sphere.js +11 -11
- package/Math/juction/plane-plane.js +11 -11
- package/Math/line.js +14 -16
- package/Math/methods.js +65 -70
- package/Math/plane.js +16 -18
- package/Math/quaternion.js +45 -49
- package/Math/utils.js +2 -2
- package/Math/vec3.js +42 -45
- package/algorithms/search-binary.js +4 -4
- package/altitude-locator/draw-subset-obj.js +7 -8
- package/altitude-locator/plugin.js +98 -114
- package/arrowfield/adaptor.js +3 -4
- package/arrowfield/index.js +2 -2
- package/arrowfield/plugin.js +62 -65
- package/bearing-line/index.js +1 -1
- package/bearing-line/plugin.js +200 -226
- package/circle-line-chain/chain-list-map.js +82 -88
- package/circle-line-chain/plugin.js +134 -165
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +108 -133
- package/compass-rose/compass-text-writer.js +62 -70
- package/compass-rose/index.js +2 -2
- package/compassrose/compassrose.js +46 -50
- package/compassrose/index.js +1 -1
- package/heatwave/index.js +2 -2
- package/heatwave/isobar/objectarraylabels.js +44 -48
- package/heatwave/isobar/plugin.js +104 -123
- package/heatwave/isobar/quadtreecontours.js +76 -92
- package/heatwave/plugins/heatwaveglobeshell.js +69 -87
- package/index.js +11 -11
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +32 -64
- package/partialrings/index.js +1 -1
- package/partialrings/plugin.js +48 -84
- package/partialrings/program.js +136 -47
- package/pin/pin-object-array.js +83 -86
- package/pin/pin-point-totem.js +21 -22
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
- package/point-heat-map/plugin-webworker.js +40 -45
- package/point-heat-map/point-to-heat-map-flow.js +40 -42
- package/point-tracks/key-methods.js +1 -1
- package/point-tracks/plugin.js +137 -162
- package/programs/arrowfield/index.js +1 -1
- package/programs/arrowfield/logic.js +170 -62
- package/programs/arrowfield/object.js +33 -35
- package/programs/data2legend/density-to-legend.js +45 -21
- package/programs/data2legend/point-to-density-texture.js +52 -27
- package/programs/float2legendwithratio/index.js +1 -1
- package/programs/float2legendwithratio/logic.js +88 -42
- package/programs/float2legendwithratio/object.js +43 -46
- package/programs/globe-util/is-globe-moved.js +10 -11
- package/programs/globeshell/index.js +1 -1
- package/programs/globeshell/wiggle/index.js +1 -1
- package/programs/globeshell/wiggle/logic.js +191 -98
- package/programs/globeshell/wiggle/object.js +33 -35
- package/programs/helpers/blender/program.js +36 -19
- package/programs/helpers/fadeaway/index.js +1 -1
- package/programs/helpers/fadeaway/logic.js +35 -13
- package/programs/helpers/fadeaway/object.js +9 -10
- package/programs/helpers/index.js +1 -1
- package/programs/index.js +8 -8
- package/programs/line-on-globe/angled-line.js +91 -32
- package/programs/line-on-globe/circle-accurate-3d.js +82 -32
- package/programs/line-on-globe/circle-accurate-flat.js +108 -50
- package/programs/line-on-globe/circle-accurate.js +103 -33
- package/programs/line-on-globe/circle.js +97 -32
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
- package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
- package/programs/line-on-globe/linestrip.js +111 -45
- package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
- package/programs/line-on-globe/to-the-surface.js +58 -29
- package/programs/line-on-globe/util.js +1 -1
- package/programs/picking/pickable-renderer.js +117 -33
- package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
- package/programs/point-on-globe/element-point-glow.js +103 -35
- package/programs/point-on-globe/square-pixel-point.js +76 -27
- package/programs/programcache.js +13 -13
- package/programs/rings/distancering/circleflatprogram.js +63 -21
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
- package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
- package/programs/rings/distancering/index.js +4 -4
- package/programs/rings/distancering/paddyflatprogram.js +73 -20
- package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
- package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
- package/programs/rings/partial-ring/piece-of-pie.js +137 -35
- package/programs/totems/camerauniformblock.js +64 -51
- package/programs/totems/canvas-webglobe-info.js +48 -40
- package/programs/totems/gpu-selection-uniform-block.js +44 -40
- package/programs/totems/index.js +1 -1
- package/programs/two-d/pixel-padding-for-compass.js +90 -29
- package/programs/util.js +6 -7
- package/programs/vectorfields/index.js +1 -1
- package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
- package/programs/vectorfields/logics/index.js +3 -3
- package/programs/vectorfields/logics/pixelbased.js +91 -35
- package/programs/vectorfields/logics/ubo.js +31 -25
- package/programs/vectorfields/pingpongbuffermanager.js +30 -34
- package/rangerings/index.js +4 -4
- package/rangerings/plugin.js +202 -258
- package/rangerings/rangeringangletext.js +108 -120
- package/rangerings/ring-account.js +52 -69
- package/shaders/fragment-toy/firework.js +55 -1
- package/shaders/fragment-toy/singularity.js +55 -1
- package/timetracks/adaptors-line-strip.js +26 -37
- package/timetracks/adaptors.js +47 -61
- package/timetracks/index.js +4 -4
- package/timetracks/plugin-line-strip.js +63 -71
- package/timetracks/plugin.js +69 -77
- package/timetracks/program-line-strip.js +296 -103
- package/timetracks/program.js +419 -113
- package/timetracks/programpoint-line-strip.js +97 -44
- package/timetracks/programpoint.js +90 -44
- package/util/account/bufferoffsetmanager.js +72 -95
- package/util/account/index.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
- package/util/account/single-attribute-buffer-management/index.js +3 -3
- package/util/account/single-attribute-buffer-management/object-store.js +29 -30
- package/util/account/util.js +2 -4
- package/util/algorithms/search-binary.js +4 -4
- package/util/check/get.js +5 -5
- package/util/check/typecheck.js +13 -15
- package/util/geometry/index.js +9 -11
- package/util/gl-util/buffer/attribute-loader.js +8 -20
- package/util/gl-util/buffer/index.js +1 -1
- package/util/gl-util/draw-options/methods.js +8 -9
- package/util/gl-util/uniform-block/manager.js +67 -67
- package/util/heatwavedatamanager/datamanager.js +56 -116
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
- package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
- package/util/index.js +6 -6
- package/util/interpolation/timetrack/index.js +1 -1
- package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
- package/util/interpolation/timetrack/web-worker-str.js +179 -1
- package/util/interpolation/timetrack/web-worker.js +4 -4
- package/util/jshelpers/data-filler.js +7 -7
- package/util/jshelpers/timefilters.js +7 -7
- package/util/picking/fence.js +7 -7
- package/util/picking/picker-displayer.js +46 -52
- package/util/programs/draw-texture-on-canvas.js +39 -21
- package/util/programs/shapesonglobe.js +104 -64
- package/util/programs/supersampletotextures.js +45 -39
- package/util/programs/texturetoglobe.js +98 -48
- package/util/shaderfunctions/geometrytransformations.js +322 -27
- package/util/shaderfunctions/nodata.js +7 -1
- package/util/shaderfunctions/noisefunctions.js +39 -9
- package/util/surface-line-data/arcs-to-cuts.js +20 -23
- package/util/webglobe/rasteroverlay.js +35 -37
- package/util/webglobjectbuilders.js +55 -60
- package/util/webglobjectbuilders1.js +48 -49
- package/waveparticles/adaptor.js +6 -7
- package/waveparticles/index.js +2 -2
- package/waveparticles/plugin.js +79 -84
- package/wind/imagetovectorfieldandmagnitude.js +15 -15
- package/wind/index.js +4 -4
- package/wind/plugin.js +453 -251
- package/wind/vectorfieldimage.js +5 -5
- package/write-text/attached-text-writer.js +46 -48
- package/write-text/context-text.js +51 -58
- 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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
24
|
+
insertBulk(items) {
|
|
52
25
|
if (items.length === 0)
|
|
53
26
|
return;
|
|
54
27
|
this.autoExtendBuffer(items.length);
|
|
55
|
-
|
|
28
|
+
const { gl, buffer } = this;
|
|
56
29
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
57
|
-
for (
|
|
58
|
-
|
|
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
|
-
|
|
62
|
-
long, lat, startAngle, tailAngle
|
|
63
|
-
]
|
|
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
|
-
|
|
77
|
-
|
|
46
|
+
updateCenterAndAngleBulk(items) {
|
|
47
|
+
const { gl, buffer } = this;
|
|
78
48
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
79
|
-
for (
|
|
80
|
-
|
|
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(
|
|
52
|
+
console.warn(`key ${key} not found`);
|
|
84
53
|
continue;
|
|
85
54
|
}
|
|
86
|
-
|
|
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
|
-
|
|
99
|
-
|
|
67
|
+
updatePartial(items, part) {
|
|
68
|
+
const { gl, buffer } = this;
|
|
100
69
|
this._updatePartial(items, part, gl, buffer);
|
|
101
70
|
this.globe.DrawRender();
|
|
102
|
-
}
|
|
103
|
-
|
|
71
|
+
}
|
|
72
|
+
deleteBulk(keys) {
|
|
104
73
|
this._deleteBulk(keys);
|
|
105
74
|
this.globe.DrawRender();
|
|
106
|
-
}
|
|
107
|
-
|
|
75
|
+
}
|
|
76
|
+
free() {
|
|
108
77
|
this.gl.deleteBuffer(this.buffer);
|
|
109
78
|
this.buffer = null;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}(bufferoffsetmanager_1.default));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
113
81
|
exports.default = BufferManager;
|
package/partialrings/index.js
CHANGED
|
@@ -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
|
-
|
|
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; } });
|
package/partialrings/plugin.js
CHANGED
|
@@ -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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
54
|
-
|
|
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
|
-
|
|
38
|
+
init(globe, gl) {
|
|
64
39
|
this.gl = gl;
|
|
65
40
|
this.globe = globe;
|
|
66
41
|
this.program = program_1.programCache.get(globe);
|
|
67
|
-
|
|
42
|
+
const { vao, buffer } = this.program.getVaoBuffer();
|
|
68
43
|
this.vao = vao;
|
|
69
44
|
this.buffer = buffer;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
56
|
+
setDrawMode(drawMode) {
|
|
82
57
|
this.drawMode = drawMode;
|
|
83
|
-
}
|
|
84
|
-
|
|
58
|
+
}
|
|
59
|
+
setOpacity(opacity) {
|
|
85
60
|
(0, typecheck_1.opacityCheck)(opacity);
|
|
86
61
|
this.alphaMultiplier = opacity;
|
|
87
|
-
}
|
|
88
|
-
|
|
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
|
-
|
|
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
|
|
71
|
+
this.bufferManager = new BufferManager(this.globe, this.gl, this.buffer, { initialCapacity, bufferType, });
|
|
100
72
|
}
|
|
101
73
|
return this.bufferManager;
|
|
102
|
-
}
|
|
103
|
-
|
|
74
|
+
}
|
|
75
|
+
free() {
|
|
104
76
|
program_1.programCache.free(this.globe);
|
|
105
77
|
this.bufferManager.free();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}());
|
|
78
|
+
}
|
|
79
|
+
}
|
|
109
80
|
exports.default = default_1;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
97
|
+
insertBulk(items) {
|
|
130
98
|
if (items.length === 0)
|
|
131
99
|
return;
|
|
132
100
|
this.autoExtendBuffer(items.length);
|
|
133
|
-
|
|
101
|
+
const { gl, buffer } = this;
|
|
134
102
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
135
|
-
for (
|
|
136
|
-
|
|
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
|
-
|
|
140
|
-
long, lat, startAngle, tailAngle
|
|
141
|
-
]
|
|
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
|
-
|
|
157
|
-
|
|
121
|
+
updatePartial(items, part) {
|
|
122
|
+
const { gl, buffer } = this;
|
|
158
123
|
this._updatePartial(items, part, gl, buffer);
|
|
159
124
|
this.globe.DrawRender();
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
125
|
+
}
|
|
126
|
+
delete(keys) {
|
|
127
|
+
const { gl, buffer } = this;
|
|
163
128
|
this._removefromBuffer(gl, buffer, keys, emptyBlock);
|
|
164
129
|
this.globe.DrawRender();
|
|
165
|
-
}
|
|
166
|
-
|
|
130
|
+
}
|
|
131
|
+
free() {
|
|
167
132
|
this.gl.deleteBuffer(this.buffer);
|
|
168
133
|
this.buffer = null;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
}(bufferoffsetmanager_1.default));
|
|
134
|
+
}
|
|
135
|
+
}
|