@pirireis/webglobeplugins 0.9.12 → 0.9.13
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 +1 -3
- package/Math/arc.js +29 -32
- package/Math/bounds/line-bbox.js +1 -3
- package/Math/constants.js +1 -6
- package/Math/frustum/types.js +1 -2
- package/Math/juction/arc-plane.js +32 -35
- package/Math/juction/line-sphere.js +9 -12
- package/Math/juction/plane-plane.js +15 -18
- package/Math/line.js +30 -33
- package/Math/methods.js +6 -24
- package/Math/plane.js +22 -25
- package/Math/quaternion.js +6 -9
- package/Math/types.js +1 -2
- package/Math/utils.js +2 -4
- package/Math/vec3.js +5 -8
- package/algorithms/search-binary.js +1 -4
- package/altitude-locator/draw-subset-obj.js +1 -3
- package/altitude-locator/plugin.js +34 -37
- package/altitude-locator/types.js +1 -3
- package/arrowfield/adaptor.js +1 -4
- package/arrowfield/index.js +3 -10
- package/arrowfield/plugin.js +3 -6
- package/bearing-line/index.js +2 -8
- package/bearing-line/plugin.js +62 -66
- package/circle-line-chain/chain-list-map.js +1 -5
- package/circle-line-chain/plugin.js +46 -50
- package/circle-line-chain/util.js +1 -5
- package/compass-rose/compass-rose-padding-flat.js +12 -16
- package/compass-rose/compass-text-writer.js +3 -7
- package/compass-rose/index.js +3 -7
- package/compassrose/compassrose.js +6 -9
- package/compassrose/index.js +2 -8
- package/heatwave/index.js +3 -10
- package/heatwave/isobar/objectarraylabels.js +7 -9
- package/heatwave/isobar/plugin.js +14 -54
- package/heatwave/isobar/quadtreecontours.js +2 -4
- package/heatwave/plugins/heatwaveglobeshell.js +9 -12
- package/index.js +12 -58
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +2 -8
- package/partialrings/index.js +2 -41
- package/partialrings/plugin.js +13 -20
- package/partialrings/program.js +23 -30
- package/pin/pin-object-array.js +8 -13
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +3 -6
- package/point-heat-map/plugin-webworker.js +11 -14
- package/point-heat-map/point-to-heat-map-flow.js +9 -12
- package/point-tracks/key-methods.js +1 -4
- package/point-tracks/plugin.js +15 -19
- package/programs/arrowfield/index.js +2 -7
- package/programs/arrowfield/logic.js +7 -10
- package/programs/arrowfield/object.js +7 -13
- package/programs/data2legend/density-to-legend.js +6 -9
- package/programs/data2legend/point-to-density-texture.js +13 -16
- package/programs/float2legendwithratio/index.js +2 -8
- package/programs/float2legendwithratio/logic.js +3 -6
- package/programs/float2legendwithratio/object.js +5 -11
- package/programs/globe-util/is-globe-moved.js +3 -5
- package/programs/globeshell/index.js +2 -8
- package/programs/globeshell/wiggle/index.js +2 -8
- package/programs/globeshell/wiggle/logic.js +3 -6
- package/programs/globeshell/wiggle/object.js +5 -11
- package/programs/helpers/blender/program.js +3 -6
- package/programs/helpers/fadeaway/index.js +2 -7
- package/programs/helpers/fadeaway/logic.js +3 -6
- package/programs/helpers/fadeaway/object.js +5 -11
- package/programs/helpers/index.js +2 -8
- package/programs/index.js +9 -58
- package/programs/line-on-globe/angled-line.js +19 -22
- package/programs/line-on-globe/circle-accurate-3d.js +21 -24
- package/programs/line-on-globe/circle-accurate-flat.js +18 -24
- package/programs/line-on-globe/circle-accurate.js +27 -30
- package/programs/line-on-globe/circle.js +26 -29
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +23 -26
- package/programs/line-on-globe/lines-color-instanced-flat.js +20 -24
- package/programs/line-on-globe/linestrip.js +28 -31
- package/programs/line-on-globe/naive-accurate-flexible.js +29 -32
- package/programs/line-on-globe/to-the-surface.js +15 -17
- package/programs/line-on-globe/util.js +1 -4
- package/programs/picking/pickable-renderer.js +25 -28
- package/programs/point-on-globe/element-globe-surface-glow.js +22 -25
- package/programs/point-on-globe/element-point-glow.js +26 -29
- package/programs/point-on-globe/square-pixel-point.js +13 -16
- package/programs/programcache.js +1 -6
- package/programs/rings/distancering/circleflatprogram.js +20 -56
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +21 -58
- package/programs/rings/distancering/circlepaddysharedbuffer.js +1 -4
- package/programs/rings/distancering/index.js +5 -14
- package/programs/rings/distancering/paddyflatprogram.js +21 -57
- package/programs/rings/distancering/paddyflatprogram2d.js +21 -57
- package/programs/rings/distancering/paddyflatprogram3d.js +21 -57
- package/programs/rings/index.js +1 -17
- package/programs/rings/partial-ring/piece-of-pie.js +23 -25
- package/programs/totems/camerauniformblock.js +7 -11
- package/programs/totems/canvas-webglobe-info.js +6 -10
- package/programs/totems/gpu-selection-uniform-block.js +7 -11
- package/programs/totems/index.js +2 -40
- package/programs/two-d/pixel-padding-for-compass.js +10 -13
- package/programs/util.js +1 -3
- package/programs/vectorfields/index.js +3 -23
- package/programs/vectorfields/logics/drawrectangleparticles.js +9 -12
- package/programs/vectorfields/logics/index.js +4 -12
- package/programs/vectorfields/logics/pixelbased.js +10 -13
- package/programs/vectorfields/logics/ubo.js +1 -7
- package/programs/vectorfields/pingpongbuffermanager.js +1 -4
- package/rangerings/enum.js +2 -5
- package/rangerings/index.js +5 -15
- package/rangerings/plugin.js +61 -68
- package/rangerings/rangeringangletext.js +26 -29
- package/rangerings/ring-account.js +1 -6
- package/shaders/fragment-toy/firework.js +1 -4
- package/shaders/fragment-toy/singularity.js +1 -4
- package/timetracks/adaptors-line-strip.js +3 -9
- package/timetracks/adaptors.js +3 -8
- package/timetracks/index.js +5 -19
- package/timetracks/plugin-line-strip.js +6 -12
- package/timetracks/plugin.js +6 -12
- package/timetracks/program-line-strip.js +9 -12
- package/timetracks/program.js +10 -13
- package/timetracks/programpoint-line-strip.js +6 -9
- package/timetracks/programpoint.js +6 -9
- package/util/account/bufferoffsetmanager.js +1 -4
- package/util/account/index.js +3 -23
- package/util/account/single-attribute-buffer-management/buffer-manager.js +1 -5
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +1 -5
- package/util/account/single-attribute-buffer-management/index.js +4 -9
- package/util/account/single-attribute-buffer-management/object-store.js +1 -5
- package/util/account/single-attribute-buffer-management/types.js +1 -2
- package/util/account/util.js +1 -5
- package/util/algorithms/search-binary.js +1 -4
- package/util/check/get.js +1 -5
- package/util/check/typecheck.js +7 -16
- package/util/geometry/index.js +1 -7
- package/util/gl-util/buffer/attribute-loader.js +2 -6
- package/util/gl-util/buffer/index.js +2 -5
- package/util/gl-util/draw-options/methods.js +2 -6
- package/util/gl-util/uniform-block/manager.js +2 -5
- package/util/heatwavedatamanager/datamanager.js +1 -4
- package/util/heatwavedatamanager/index.js +3 -10
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +3 -9
- package/util/heatwavedatamanager/pointcoordsmeta.js +1 -4
- package/util/index.js +13 -57
- package/util/interpolation/timetrack/index.js +1 -4
- package/util/interpolation/timetrack/timetrack-interpolator.js +6 -10
- package/util/interpolation/timetrack/web-worker-str.js +1 -4
- package/util/interpolation/timetrack/web-worker.js +2 -4
- package/util/jshelpers/data-filler.js +1 -4
- package/util/jshelpers/equality.js +1 -3
- package/util/jshelpers/index.js +2 -37
- package/util/jshelpers/timefilters.js +1 -3
- package/util/picking/fence.js +1 -4
- package/util/picking/picker-displayer.js +6 -9
- package/util/programs/draw-texture-on-canvas.js +6 -9
- package/util/programs/index.js +1 -17
- package/util/programs/shapesonglobe.js +9 -13
- package/util/programs/supersampletotextures.js +3 -7
- package/util/programs/texturetoglobe.js +8 -11
- package/util/shaderfunctions/geometrytransformations.js +24 -31
- package/util/shaderfunctions/index.js +2 -18
- package/util/shaderfunctions/nodata.js +1 -4
- package/util/shaderfunctions/noisefunctions.js +1 -3
- package/util/webglobe/gldefaultstates.js +1 -4
- package/util/webglobe/index.js +2 -18
- package/util/webglobe/rasteroverlay.js +1 -4
- package/util/webglobjectbuilders.js +16 -34
- package/util/webglobjectbuilders1.js +16 -34
- package/waveparticles/adaptor.js +1 -3
- package/waveparticles/index.js +3 -10
- package/waveparticles/plugin.js +9 -12
- package/wind/imagetovectorfieldandmagnitude.js +1 -4
- package/wind/index.js +5 -14
- package/wind/plugin.js +6 -45
- package/wind/vectorfieldimage.js +1 -3
- package/write-text/attached-text-writer.js +6 -10
- package/write-text/context-text.js +4 -8
- package/write-text/context-text3.js +7 -11
- package/write-text/index.js +1 -5
package/timetracks/plugin.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Author: Toprak Nihat Deniz Ozturk
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const program_1 = __importDefault(require("./program"));
|
|
10
|
-
const programpoint_1 = __importDefault(require("./programpoint"));
|
|
4
|
+
import TrackGlowLineProgram from './program';
|
|
5
|
+
import PointProgram from './programpoint';
|
|
11
6
|
/**
|
|
12
7
|
* @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
|
|
13
8
|
* TimeTrackMultiColorData is [
|
|
@@ -33,7 +28,7 @@ const programpoint_1 = __importDefault(require("./programpoint"));
|
|
|
33
28
|
uses float32array in a * {@link TimeTrackMultiColorData} format
|
|
34
29
|
|
|
35
30
|
*/
|
|
36
|
-
class TimeTrackMultiColorPlugin {
|
|
31
|
+
export default class TimeTrackMultiColorPlugin {
|
|
37
32
|
/**
|
|
38
33
|
* @param {String} id
|
|
39
34
|
* @param {Object} options
|
|
@@ -140,7 +135,7 @@ class TimeTrackMultiColorPlugin {
|
|
|
140
135
|
// ------------------------------------------------------------
|
|
141
136
|
_createPointProgram() {
|
|
142
137
|
const { gl } = this;
|
|
143
|
-
const program = new
|
|
138
|
+
const program = new PointProgram(gl, this.globe, this._attrBuffer, this._pointOptions);
|
|
144
139
|
program.setDrawCount(this._totalSize / 2);
|
|
145
140
|
return program;
|
|
146
141
|
}
|
|
@@ -220,9 +215,9 @@ class TimeTrackMultiColorPlugin {
|
|
|
220
215
|
this.globe = globe;
|
|
221
216
|
this.gl = gl;
|
|
222
217
|
this._attrBuffer = gl.createBuffer();
|
|
223
|
-
this.program = new
|
|
218
|
+
this.program = new TrackGlowLineProgram(gl, this._attrBuffer, globe.api_ScrW(), globe.api_ScrH(), this._options);
|
|
224
219
|
if (this._pointOptions?.isOn)
|
|
225
|
-
this.pointProgram = new
|
|
220
|
+
this.pointProgram = new PointProgram(gl, globe, this._attrBuffer);
|
|
226
221
|
// this.pointProgram.setAttrBuffer(_attrBuffer);
|
|
227
222
|
this.setGeometry();
|
|
228
223
|
if (this._data) {
|
|
@@ -251,4 +246,3 @@ class TimeTrackMultiColorPlugin {
|
|
|
251
246
|
};
|
|
252
247
|
}
|
|
253
248
|
}
|
|
254
|
-
exports.default = TimeTrackMultiColorPlugin;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Author: Toprak Nihat Deniz Ozturk
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TrackGlowLineProgram {
|
|
4
|
+
import { createProgram, defaultblendfunction, shaderfunctions } from "../util";
|
|
5
|
+
export default class TrackGlowLineProgram {
|
|
8
6
|
/**
|
|
9
7
|
* @param {WebGL2RenderingContext} gl
|
|
10
8
|
* @param {number} width
|
|
@@ -190,7 +188,7 @@ void main() {
|
|
|
190
188
|
outColor.a *= u_final_alpha_ratio;
|
|
191
189
|
}
|
|
192
190
|
`;
|
|
193
|
-
const program =
|
|
191
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
194
192
|
const buffer = gl.createBuffer();
|
|
195
193
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
196
194
|
const vao = gl.createVertexArray();
|
|
@@ -252,7 +250,7 @@ void main() {
|
|
|
252
250
|
outColor = result;
|
|
253
251
|
}
|
|
254
252
|
`;
|
|
255
|
-
const program =
|
|
253
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
256
254
|
const buffer = gl.createBuffer();
|
|
257
255
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
258
256
|
const vao = gl.createVertexArray();
|
|
@@ -341,7 +339,7 @@ void main()
|
|
|
341
339
|
outColor = vec4(color, total_alpha);
|
|
342
340
|
}
|
|
343
341
|
`;
|
|
344
|
-
const program =
|
|
342
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
345
343
|
const buffer = gl.createBuffer();
|
|
346
344
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
347
345
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
@@ -400,8 +398,8 @@ out float v_time;
|
|
|
400
398
|
out vec3 v_color;
|
|
401
399
|
out float v_track_start_time;
|
|
402
400
|
out float v_track_end_time;
|
|
403
|
-
${
|
|
404
|
-
${
|
|
401
|
+
${shaderfunctions.pixelXYToCartesian3DPoint}
|
|
402
|
+
${shaderfunctions.pixelXYToCartesian2DPoint}
|
|
405
403
|
|
|
406
404
|
void main() {
|
|
407
405
|
|
|
@@ -457,7 +455,7 @@ void main() {
|
|
|
457
455
|
outColor0 = vec4(v_color , 1.0);
|
|
458
456
|
}
|
|
459
457
|
`;
|
|
460
|
-
const program =
|
|
458
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
461
459
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
462
460
|
const a_time = gl.getAttribLocation(program, "a_time");
|
|
463
461
|
const a_track_start_time = gl.getAttribLocation(program, "a_track_start_time");
|
|
@@ -588,7 +586,7 @@ void main() {
|
|
|
588
586
|
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
|
589
587
|
}
|
|
590
588
|
gl.bindVertexArray(null);
|
|
591
|
-
|
|
589
|
+
defaultblendfunction(gl);
|
|
592
590
|
}
|
|
593
591
|
free() {
|
|
594
592
|
const { gl, _lineProgram, _blurProgram, _combineProgram } = this;
|
|
@@ -608,4 +606,3 @@ void main() {
|
|
|
608
606
|
gl.deleteProgram(_combineProgram.program);
|
|
609
607
|
}
|
|
610
608
|
}
|
|
611
|
-
exports.default = TrackGlowLineProgram;
|
package/timetracks/program.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Author: Toprak Nihat Deniz Ozturk
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TrackGlowLineProgram {
|
|
4
|
+
import { createProgram, defaultblendfunction, shaderfunctions } from "../util";
|
|
5
|
+
export default class TrackGlowLineProgram {
|
|
8
6
|
/**
|
|
9
7
|
* @param {WebGL2RenderingContext} gl
|
|
10
8
|
* @param {number} width
|
|
@@ -234,7 +232,7 @@ class TrackGlowLineProgram {
|
|
|
234
232
|
outColor = vec4(result.rgb, result.a * u_final_alpha_ratio);
|
|
235
233
|
}
|
|
236
234
|
`;
|
|
237
|
-
const program =
|
|
235
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
238
236
|
const buffer = gl.createBuffer();
|
|
239
237
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
240
238
|
const vao = gl.createVertexArray();
|
|
@@ -388,7 +386,7 @@ void main()
|
|
|
388
386
|
outColor = vec4(color, total_alpha);
|
|
389
387
|
}
|
|
390
388
|
`;
|
|
391
|
-
const program =
|
|
389
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
392
390
|
const buffer = gl.createBuffer();
|
|
393
391
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
394
392
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
@@ -490,7 +488,7 @@ void main()
|
|
|
490
488
|
outColor = vec4(color, total_alpha);
|
|
491
489
|
}
|
|
492
490
|
`;
|
|
493
|
-
const program =
|
|
491
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
494
492
|
const buffer = gl.createBuffer();
|
|
495
493
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
496
494
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
@@ -551,8 +549,8 @@ out vec3 v_color;
|
|
|
551
549
|
out float v_track_start_time;
|
|
552
550
|
out float v_track_end_time;
|
|
553
551
|
|
|
554
|
-
${
|
|
555
|
-
${
|
|
552
|
+
${shaderfunctions.pixelXYToCartesian3DPoint}
|
|
553
|
+
${shaderfunctions.pixelXYToCartesian2DPoint}
|
|
556
554
|
|
|
557
555
|
void main() {
|
|
558
556
|
v_time = a_time;
|
|
@@ -611,7 +609,7 @@ void main() {
|
|
|
611
609
|
}
|
|
612
610
|
}
|
|
613
611
|
`;
|
|
614
|
-
const program =
|
|
612
|
+
const program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
615
613
|
const a_position = gl.getAttribLocation(program, "a_position");
|
|
616
614
|
const a_time = gl.getAttribLocation(program, "a_time");
|
|
617
615
|
const a_track_start_time = gl.getAttribLocation(program, "a_track_start_time");
|
|
@@ -732,7 +730,7 @@ void main() {
|
|
|
732
730
|
}
|
|
733
731
|
}
|
|
734
732
|
if (!_premultipliedAlpha) {
|
|
735
|
-
|
|
733
|
+
defaultblendfunction(gl);
|
|
736
734
|
}
|
|
737
735
|
{ // combine
|
|
738
736
|
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
@@ -748,7 +746,7 @@ void main() {
|
|
|
748
746
|
}
|
|
749
747
|
gl.bindVertexArray(null);
|
|
750
748
|
if (_premultipliedAlpha) {
|
|
751
|
-
|
|
749
|
+
defaultblendfunction(gl);
|
|
752
750
|
}
|
|
753
751
|
}
|
|
754
752
|
free() {
|
|
@@ -769,4 +767,3 @@ void main() {
|
|
|
769
767
|
gl.deleteProgram(_combineProgram.program);
|
|
770
768
|
}
|
|
771
769
|
}
|
|
772
|
-
exports.default = TrackGlowLineProgram;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const util_1 = require("../util");
|
|
4
|
-
const programs_1 = require("../programs");
|
|
1
|
+
import { createProgram, shaderfunctions } from "../util";
|
|
2
|
+
import { CameraUniformBlockTotem, globeProgramCache } from "../programs";
|
|
5
3
|
const vertexShader = `#version 300 es
|
|
6
4
|
|
|
7
5
|
layout(std140) uniform GlobeCamera {
|
|
@@ -28,7 +26,7 @@ in float end_time;
|
|
|
28
26
|
in vec3 end_color;
|
|
29
27
|
out vec4 v_color;
|
|
30
28
|
|
|
31
|
-
` +
|
|
29
|
+
` + shaderfunctions.pixelXYToCartesian3DPoint + shaderfunctions.pixelXYToCartesian2DPoint + `
|
|
32
30
|
|
|
33
31
|
void main() {
|
|
34
32
|
if (head_time < start_time || head_time > end_time) { return; }
|
|
@@ -58,12 +56,12 @@ void main() {
|
|
|
58
56
|
outColor.a = 0.0;
|
|
59
57
|
}
|
|
60
58
|
}`;
|
|
61
|
-
class
|
|
59
|
+
export default class {
|
|
62
60
|
constructor(gl, globe, attrBuffer, options) {
|
|
63
61
|
this.gl = gl;
|
|
64
62
|
this._cameraBlockBindingPoint = 0;
|
|
65
63
|
this._globalsBlockBindingPoint = 1;
|
|
66
|
-
this.cameraUniformBlockTotem =
|
|
64
|
+
this.cameraUniformBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
67
65
|
this._vao = gl.createVertexArray();
|
|
68
66
|
this._attbuffer = attrBuffer;
|
|
69
67
|
this.program = this._createProgram();
|
|
@@ -80,7 +78,7 @@ class default_1 {
|
|
|
80
78
|
}
|
|
81
79
|
_createProgram() {
|
|
82
80
|
const gl = this.gl;
|
|
83
|
-
const program =
|
|
81
|
+
const program = createProgram(gl, vertexShader, fragmentShader);
|
|
84
82
|
const ubo = this.cameraUniformBlockTotem.getUBO(); // ubo bl
|
|
85
83
|
const cameraBlockIndex = gl.getUniformBlockIndex(program, "GlobeCamera");
|
|
86
84
|
gl.uniformBlockBinding(program, cameraBlockIndex, this._cameraBlockBindingPoint);
|
|
@@ -151,4 +149,3 @@ class default_1 {
|
|
|
151
149
|
gl.deleteProgram(program);
|
|
152
150
|
}
|
|
153
151
|
}
|
|
154
|
-
exports.default = default_1;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const util_1 = require("../util");
|
|
4
|
-
const programs_1 = require("../programs");
|
|
1
|
+
import { createProgram, shaderfunctions } from "../util";
|
|
2
|
+
import { CameraUniformBlockTotem, globeProgramCache } from "../programs";
|
|
5
3
|
const vertexShader = `#version 300 es
|
|
6
4
|
|
|
7
5
|
layout(std140) uniform GlobeCamera {
|
|
@@ -28,7 +26,7 @@ in float end_time;
|
|
|
28
26
|
in vec3 end_color;
|
|
29
27
|
out vec4 v_color;
|
|
30
28
|
|
|
31
|
-
` +
|
|
29
|
+
` + shaderfunctions.pixelXYToCartesian3DPoint + shaderfunctions.pixelXYToCartesian2DPoint + `
|
|
32
30
|
|
|
33
31
|
void main() {
|
|
34
32
|
if (head_time < start_time || head_time > end_time) { return; }
|
|
@@ -51,12 +49,12 @@ out vec4 outColor;
|
|
|
51
49
|
void main() {
|
|
52
50
|
outColor = v_color;
|
|
53
51
|
}`;
|
|
54
|
-
class
|
|
52
|
+
export default class {
|
|
55
53
|
constructor(gl, globe, attrBuffer, options) {
|
|
56
54
|
this.gl = gl;
|
|
57
55
|
this._cameraBlockBindingPoint = 0;
|
|
58
56
|
this._globalsBlockBindingPoint = 1;
|
|
59
|
-
this.cameraUniformBlockTotem =
|
|
57
|
+
this.cameraUniformBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
60
58
|
this._vao = gl.createVertexArray();
|
|
61
59
|
this._attbuffer = attrBuffer;
|
|
62
60
|
this.program = this._createProgram();
|
|
@@ -73,7 +71,7 @@ class default_1 {
|
|
|
73
71
|
}
|
|
74
72
|
_createProgram() {
|
|
75
73
|
const gl = this.gl;
|
|
76
|
-
const program =
|
|
74
|
+
const program = createProgram(gl, vertexShader, fragmentShader);
|
|
77
75
|
const ubo = this.cameraUniformBlockTotem.getUBO(); // ubo bl
|
|
78
76
|
const cameraBlockIndex = gl.getUniformBlockIndex(program, "GlobeCamera");
|
|
79
77
|
gl.uniformBlockBinding(program, cameraBlockIndex, this._cameraBlockBindingPoint);
|
|
@@ -144,4 +142,3 @@ class default_1 {
|
|
|
144
142
|
gl.deleteProgram(program);
|
|
145
143
|
}
|
|
146
144
|
}
|
|
147
|
-
exports.default = default_1;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BufferOffsetManager
|
|
4
3
|
* Purpose: To manage the offset of the buffer. Plus extend and defrag the buffer.
|
|
@@ -18,8 +17,7 @@
|
|
|
18
17
|
* READ, most of the time is not needed to be read, unless for defraging.
|
|
19
18
|
* This unpredicatable behavior is not handled by this class.
|
|
20
19
|
*/
|
|
21
|
-
|
|
22
|
-
class default_1 {
|
|
20
|
+
export default class {
|
|
23
21
|
constructor(itemSize, { capacity = 10, bufferType = "STATIC_DRAW" } = {}) {
|
|
24
22
|
this.itemSize = itemSize;
|
|
25
23
|
this.bufferType = bufferType;
|
|
@@ -176,4 +174,3 @@ class default_1 {
|
|
|
176
174
|
this.gl = null;
|
|
177
175
|
}
|
|
178
176
|
}
|
|
179
|
-
exports.default = default_1;
|
package/util/account/index.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.BufferOffsetManager = void 0;
|
|
21
|
-
const bufferoffsetmanager_1 = __importDefault(require("./bufferoffsetmanager"));
|
|
22
|
-
exports.BufferOffsetManager = bufferoffsetmanager_1.default;
|
|
23
|
-
__exportStar(require("./single-attribute-buffer-management/index"), exports);
|
|
1
|
+
import BufferOffsetManager from './bufferoffsetmanager';
|
|
2
|
+
export { BufferOffsetManager };
|
|
3
|
+
export * from './single-attribute-buffer-management/index';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BufferOffsetManager
|
|
4
3
|
* Purpose: To manage the offset of the buffer. Plus extend and defrag the buffer.
|
|
@@ -17,9 +16,7 @@
|
|
|
17
16
|
* READ, most of the time is not needed to be read, unless for defraging.
|
|
18
17
|
* This unpredicatable behavior is not handled by this class.
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
exports.BufferManager = void 0;
|
|
22
|
-
class BufferManager {
|
|
19
|
+
export class BufferManager {
|
|
23
20
|
gl;
|
|
24
21
|
buffer;
|
|
25
22
|
itemSize;
|
|
@@ -109,4 +106,3 @@ class BufferManager {
|
|
|
109
106
|
this.isFreed = true;
|
|
110
107
|
}
|
|
111
108
|
}
|
|
112
|
-
exports.BufferManager = BufferManager;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BufferOrchestrator = void 0;
|
|
4
1
|
const EXTRA_SIZE = 10;
|
|
5
|
-
class BufferOrchestrator {
|
|
2
|
+
export class BufferOrchestrator {
|
|
6
3
|
_capacity;
|
|
7
4
|
offsetMap;
|
|
8
5
|
tombstoneOffsets;
|
|
@@ -151,4 +148,3 @@ class BufferOrchestrator {
|
|
|
151
148
|
return this._capacity;
|
|
152
149
|
}
|
|
153
150
|
}
|
|
154
|
-
exports.BufferOrchestrator = BufferOrchestrator;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "BufferOrchestrator", { enumerable: true, get: function () { return buffer_orchestrator_1.BufferOrchestrator; } });
|
|
6
|
-
const buffer_manager_1 = require("./buffer-manager");
|
|
7
|
-
Object.defineProperty(exports, "BufferManager", { enumerable: true, get: function () { return buffer_manager_1.BufferManager; } });
|
|
8
|
-
const object_store_1 = require("./object-store");
|
|
9
|
-
Object.defineProperty(exports, "ObjectStore", { enumerable: true, get: function () { return object_store_1.ObjectStore; } });
|
|
1
|
+
import { BufferOrchestrator } from "./buffer-orchestrator";
|
|
2
|
+
import { BufferManager } from "./buffer-manager";
|
|
3
|
+
import { ObjectStore } from "./object-store";
|
|
4
|
+
export { BufferOrchestrator, BufferManager, ObjectStore };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectStore = void 0;
|
|
4
|
-
class ObjectStore {
|
|
1
|
+
export class ObjectStore {
|
|
5
2
|
_container;
|
|
6
3
|
constructor({ initialCapcity = 10 } = {}) {
|
|
7
4
|
this._container = this._createEmptyList(initialCapcity);
|
|
@@ -49,4 +46,3 @@ class ObjectStore {
|
|
|
49
46
|
free() {
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
exports.ObjectStore = ObjectStore;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/util/account/util.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.vaoAttributeLoader = void 0;
|
|
4
|
-
const vaoAttributeLoader = (gl, buffer, index, size, stride, offset, divisor = null, type = null) => {
|
|
1
|
+
export const vaoAttributeLoader = (gl, buffer, index, size, stride, offset, divisor = null, type = null) => {
|
|
5
2
|
if (!gl || !buffer) {
|
|
6
3
|
throw new Error("Invalid WebGL context or buffer");
|
|
7
4
|
}
|
|
@@ -19,4 +16,3 @@ const vaoAttributeLoader = (gl, buffer, index, size, stride, offset, divisor = n
|
|
|
19
16
|
gl.vertexAttribDivisor(index, divisor);
|
|
20
17
|
}
|
|
21
18
|
};
|
|
22
|
-
exports.vaoAttributeLoader = vaoAttributeLoader;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @typedef {Array<number>} ListLike
|
|
4
3
|
* @typedef {number || null} Index
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.findFirstIndexInRange = void 0;
|
|
8
5
|
/**
|
|
9
6
|
* @param {ListLike} container
|
|
10
7
|
* @param {number} value
|
|
@@ -25,4 +22,4 @@ const findFirstIndexInRange = (container, value) => {
|
|
|
25
22
|
}
|
|
26
23
|
return null;
|
|
27
24
|
};
|
|
28
|
-
|
|
25
|
+
export { findFirstIndexInRange };
|
package/util/check/get.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapGetOrThrow = void 0;
|
|
4
|
-
const mapGetOrThrow = (errorNote) => {
|
|
1
|
+
export const mapGetOrThrow = (errorNote) => {
|
|
5
2
|
return (mapInstance, ids) => {
|
|
6
3
|
if (!ids)
|
|
7
4
|
throw new Error("There is no map keys to get");
|
|
@@ -15,4 +12,3 @@ const mapGetOrThrow = (errorNote) => {
|
|
|
15
12
|
return result;
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
|
-
exports.mapGetOrThrow = mapGetOrThrow;
|
package/util/check/typecheck.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Generic
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isBoolean = exports.constraintFloat = exports.isTextFont = exports.opacityCheck = exports.isHexColorWithOpacity = exports.isHexColor = void 0;
|
|
5
2
|
const doesOwnProperties = (properties, errorMessage) => {
|
|
6
3
|
return (object) => {
|
|
7
4
|
properties.forEach(element => {
|
|
@@ -10,28 +7,24 @@ const doesOwnProperties = (properties, errorMessage) => {
|
|
|
10
7
|
});
|
|
11
8
|
};
|
|
12
9
|
};
|
|
13
|
-
const isHexColor = (hexColor) => /^#[0-9A-F]{6}$/i.test(hexColor);
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
exports.isHexColorWithOpacity = isHexColorWithOpacity;
|
|
17
|
-
const opacityCheck = (opacity) => {
|
|
10
|
+
export const isHexColor = (hexColor) => /^#[0-9A-F]{6}$/i.test(hexColor);
|
|
11
|
+
export const isHexColorWithOpacity = (hexColor) => /^#[0-9A-F]{6}[0-9a-f]{0,2}$/i.test(hexColor);
|
|
12
|
+
export const opacityCheck = (opacity) => {
|
|
18
13
|
if (typeof opacity !== "number")
|
|
19
14
|
throw new TypeError("style.opacity must a number");
|
|
20
15
|
if (opacity < 0 || 1 < opacity)
|
|
21
16
|
throw new RangeError("Opacity Range Must be 0-1");
|
|
22
17
|
};
|
|
23
|
-
exports.opacityCheck = opacityCheck;
|
|
24
18
|
// Text Related
|
|
25
19
|
const fontCheckTypes = doesOwnProperties(["name", "textColor", "hollowColor", "size", "bold", "italic"], "font does not have");
|
|
26
|
-
const fontCheckColors = (textColor, hollowColor) =>
|
|
27
|
-
const isTextFont = (textFont) => {
|
|
20
|
+
const fontCheckColors = (textColor, hollowColor) => isHexColor(textColor) && isHexColor(hollowColor);
|
|
21
|
+
export const isTextFont = (textFont) => {
|
|
28
22
|
fontCheckTypes(textFont);
|
|
29
23
|
fontCheckColors(textFont.textColor, textFont.hollowColor);
|
|
30
24
|
if (typeof textFont.size !== "number")
|
|
31
25
|
throw new TypeError("textFont size is not a number");
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
const constraintFloat = (x, lowerBound = null, upperBound = null) => {
|
|
27
|
+
export const constraintFloat = (x, lowerBound = null, upperBound = null) => {
|
|
35
28
|
if (typeof x !== "number")
|
|
36
29
|
throw new Error("type must be numberic");
|
|
37
30
|
if (lowerBound === null && upperBound === null)
|
|
@@ -41,9 +34,7 @@ const constraintFloat = (x, lowerBound = null, upperBound = null) => {
|
|
|
41
34
|
if (upperBound !== null && x > upperBound)
|
|
42
35
|
throw new Error(`input must be less than ${upperBound}`);
|
|
43
36
|
};
|
|
44
|
-
|
|
45
|
-
const isBoolean = (x) => {
|
|
37
|
+
export const isBoolean = (x) => {
|
|
46
38
|
if (typeof x !== "boolean")
|
|
47
39
|
throw new TypeError("type must be boolean");
|
|
48
40
|
};
|
|
49
|
-
exports.isBoolean = isBoolean;
|
package/util/geometry/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBBoxMatrix = createBBoxMatrix;
|
|
4
|
-
exports.latLongToPixelXY = latLongToPixelXY;
|
|
5
|
-
exports.latLongBboxtoPixelXYBbox = latLongBboxtoPixelXYBbox;
|
|
6
|
-
exports.sphereCoord = sphereCoord;
|
|
7
|
-
exports.normalize = normalize;
|
|
8
1
|
function latLongToPixelXY(latitude, longitude) {
|
|
9
2
|
return {
|
|
10
3
|
x: (longitude + 180) / 360,
|
|
@@ -49,3 +42,4 @@ function normalize(array, newLength = 1) {
|
|
|
49
42
|
function sphereCoord(long, lat, globe, height = 0) {
|
|
50
43
|
return normalize(globe.api_GetCartesian3DPoint(long, lat, 0, 0), 6378.137 + height);
|
|
51
44
|
}
|
|
45
|
+
export { createBBoxMatrix, latLongToPixelXY, latLongBboxtoPixelXYBbox, sphereCoord, normalize };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBufferAndReadInfo = exports.attributeLoader = void 0;
|
|
4
|
-
require("./types");
|
|
1
|
+
import './types';
|
|
5
2
|
/**
|
|
6
3
|
* @typedef BufferAndReadInfo Buffers can be intertwined or interleaved.
|
|
7
4
|
* This object forces user to adapt generic convention of buffer and read information.
|
|
@@ -48,7 +45,6 @@ const attributeLoader = (gl, bufferAndReadInfo, index, size, { divisor = null, t
|
|
|
48
45
|
gl.vertexAttribDivisor(index, divisor);
|
|
49
46
|
}
|
|
50
47
|
};
|
|
51
|
-
exports.attributeLoader = attributeLoader;
|
|
52
48
|
/**
|
|
53
49
|
*
|
|
54
50
|
* @param {WebGLBuffer} buffer
|
|
@@ -61,9 +57,9 @@ const createBufferAndReadInfo = (buffer, stride = 0, offset = 0) => {
|
|
|
61
57
|
return null;
|
|
62
58
|
return { buffer, stride, offset };
|
|
63
59
|
};
|
|
64
|
-
exports.createBufferAndReadInfo = createBufferAndReadInfo;
|
|
65
60
|
const constantFunction = (gl, index, size, escapeValues) => {
|
|
66
61
|
const func = `vertexAttrib${size}f`;
|
|
67
62
|
// @ts-ignore
|
|
68
63
|
gl[func](index, ...escapeValues);
|
|
69
64
|
};
|
|
65
|
+
export { attributeLoader, createBufferAndReadInfo };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// import './types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const attribute_loader_1 = require("./attribute-loader");
|
|
6
|
-
Object.defineProperty(exports, "attributeLoader", { enumerable: true, get: function () { return attribute_loader_1.attributeLoader; } });
|
|
2
|
+
import { attributeLoader } from './attribute-loader';
|
|
3
|
+
export { attributeLoader };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.drawInstanced = exports.drawArrays = void 0;
|
|
4
|
-
require("./types");
|
|
1
|
+
import './types';
|
|
5
2
|
/**
|
|
6
3
|
* Draws instanced geometry using WebGL2.
|
|
7
4
|
*/
|
|
@@ -17,7 +14,6 @@ const drawInstanced = (gl, mode, drawOptions, vertexCount) => {
|
|
|
17
14
|
gl.drawArraysInstanced(mode, first, vertexCount, instanceCount);
|
|
18
15
|
}
|
|
19
16
|
};
|
|
20
|
-
exports.drawInstanced = drawInstanced;
|
|
21
17
|
/**
|
|
22
18
|
* Draws geometry using WebGL2.
|
|
23
19
|
*/
|
|
@@ -34,4 +30,4 @@ const drawArrays = (gl, defaultMode, drawOptions) => {
|
|
|
34
30
|
gl.drawArrays(mode, first, count);
|
|
35
31
|
}
|
|
36
32
|
};
|
|
37
|
-
|
|
33
|
+
export { drawArrays, drawInstanced };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniformBlockManager = void 0;
|
|
4
|
-
require("./types");
|
|
1
|
+
import "./types";
|
|
5
2
|
const typeSizes = {
|
|
6
3
|
'float': 4,
|
|
7
4
|
'vec2': 8,
|
|
@@ -165,4 +162,4 @@ class UniformBlockManager {
|
|
|
165
162
|
return lastOffset + lastItemAlignment;
|
|
166
163
|
}
|
|
167
164
|
}
|
|
168
|
-
|
|
165
|
+
export { UniformBlockManager };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* todo:
|
|
4
3
|
* data must be processed before being set to the cache
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
class DataManager {
|
|
5
|
+
export default class DataManager {
|
|
8
6
|
/**
|
|
9
7
|
*
|
|
10
8
|
* @param {Array<number>} timeEpocs | array of time epocs
|
|
@@ -149,4 +147,3 @@ class DataManager {
|
|
|
149
147
|
this._pushCallback(0, [null, null]);
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
|
-
exports.default = DataManager;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PointCoordinatesDataCalculator = exports.HeatWaveDataManager = void 0;
|
|
7
|
-
const pointcoordinatesdatacalculator_1 = __importDefault(require("./pointcoordinatesdatacalculator"));
|
|
8
|
-
exports.PointCoordinatesDataCalculator = pointcoordinatesdatacalculator_1.default;
|
|
9
|
-
const datamanager_1 = __importDefault(require("./datamanager"));
|
|
10
|
-
exports.HeatWaveDataManager = datamanager_1.default;
|
|
1
|
+
import PointCoordinatesDataCalculator from "./pointcoordinatesdatacalculator";
|
|
2
|
+
import HeatWaveDataManager from "./datamanager";
|
|
3
|
+
export { HeatWaveDataManager, PointCoordinatesDataCalculator };
|