@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
|
@@ -32,18 +32,18 @@ exports.timeTrackPluginDataToPointHeatInterpolatorAdapter = void 0;
|
|
|
32
32
|
* @property {Array<Number>} times
|
|
33
33
|
* @param {Array<Timetrack>} timeTracks
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const methods_1 = require("../../Math/methods");
|
|
36
|
+
const processACut = (array, offset) => {
|
|
37
37
|
// first 3 values of array
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const v3 = array.slice(offset, offset + 3);
|
|
39
|
+
const v4 = (0, methods_1.pixelXYLenghtToUnitVectorWithHeight)(v3);
|
|
40
|
+
const time = array[offset + 3];
|
|
41
41
|
return [v4, time];
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const timeTrackPluginDataToPointHeatInterpolatorAdapter = (timeTrackPluginData) => {
|
|
44
|
+
const timeTracks = [];
|
|
45
|
+
let offset = 0;
|
|
46
|
+
let timeTrack = {
|
|
47
47
|
coordinates: [],
|
|
48
48
|
times: []
|
|
49
49
|
};
|
|
@@ -56,7 +56,7 @@ var timeTrackPluginDataToPointHeatInterpolatorAdapter = function (timeTrackPlugi
|
|
|
56
56
|
};
|
|
57
57
|
offset += 9;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
const point = processACut(timeTrackPluginData, offset);
|
|
60
60
|
offset += 9;
|
|
61
61
|
timeTrack.coordinates.push(point[0]);
|
|
62
62
|
timeTrack.times.push(point[1]);
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PointHeatmapPlugin = void 0;
|
|
4
|
-
|
|
4
|
+
const point_to_heat_map_flow_1 = require("./point-to-heat-map-flow");
|
|
5
5
|
// import { webworkerStr } from "../util/interpolation/timetrack/web-worker-str"; // TODO: Delete When this plugin is tested on production
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.opacity, opacity = _c === void 0 ? 1.0 : _c, _d = _b.pointSize, pointSize = _d === void 0 ? 5.0 : _d, _e = _b.onInterpolationComplete, onInterpolationComplete = _e === void 0 ? function () { } : _e;
|
|
12
|
-
var _this = this;
|
|
6
|
+
const index_1 = require("../util/interpolation/timetrack/index");
|
|
7
|
+
const util_1 = require("../util");
|
|
8
|
+
const typecheck_1 = require("../util/check/typecheck");
|
|
9
|
+
class PointHeatmapPlugin {
|
|
10
|
+
constructor(id, { opacity = 1.0, pointSize = 5.0, onInterpolationComplete = () => { } } = {}) {
|
|
13
11
|
this.id = id;
|
|
14
12
|
this.globe = null;
|
|
15
13
|
this.gl = null;
|
|
@@ -23,7 +21,7 @@ var PointHeatmapPlugin = /** @class */ (function () {
|
|
|
23
21
|
// const blob = new Blob([webworkerStr], { type: 'application/javascript' });
|
|
24
22
|
// this.timeTrackInterpolationWorker = new Worker(URL.createObjectURL(blob), { type: 'module' });
|
|
25
23
|
this.timeTrackInterpolationWorker = (0, index_1.createWorker)();
|
|
26
|
-
this.timeTrackInterpolationWorker.onmessage =
|
|
24
|
+
this.timeTrackInterpolationWorker.onmessage = (e) => {
|
|
27
25
|
if (e.data.error) {
|
|
28
26
|
throw new Error(e.data.error);
|
|
29
27
|
}
|
|
@@ -31,89 +29,87 @@ var PointHeatmapPlugin = /** @class */ (function () {
|
|
|
31
29
|
onInterpolationComplete();
|
|
32
30
|
}
|
|
33
31
|
if (e.data instanceof Float32Array) {
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
this.flow.setData(e.data);
|
|
33
|
+
this._throttleListener = null;
|
|
36
34
|
onInterpolationComplete();
|
|
37
35
|
}
|
|
38
36
|
};
|
|
39
37
|
}
|
|
40
38
|
// globe interaction
|
|
41
|
-
|
|
39
|
+
init(globe, gl) {
|
|
42
40
|
this.globe = globe;
|
|
43
41
|
this.gl = gl;
|
|
44
42
|
this.flow = new point_to_heat_map_flow_1.PointHeatmapFlow(globe);
|
|
45
43
|
this.setGeometry();
|
|
46
44
|
this.resize();
|
|
47
|
-
}
|
|
48
|
-
|
|
45
|
+
}
|
|
46
|
+
setPointSize(pointSize) {
|
|
49
47
|
(0, typecheck_1.constraintFloat)(pointSize, 1);
|
|
50
48
|
this._pointSize = pointSize;
|
|
51
49
|
this.globe.DrawRender();
|
|
52
|
-
}
|
|
50
|
+
}
|
|
53
51
|
/**
|
|
54
52
|
* @param {Array<string>}
|
|
55
53
|
* @param {string} mode "interpolated" | "discrete"
|
|
56
54
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var gl = this.gl;
|
|
55
|
+
setColorRamp(values, thresholds, mode = "interpolated") {
|
|
56
|
+
const gl = this.gl;
|
|
60
57
|
if (this.gl === null) {
|
|
61
58
|
throw new Error('Plugin not initialized');
|
|
62
59
|
}
|
|
63
60
|
;
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
const rampData = (0, util_1.getColorRampModed)(values, thresholds, mode);
|
|
62
|
+
const texture = (0, util_1.createTexture)(gl, gl.LINEAR, rampData, 256, 1);
|
|
66
63
|
if (this._legendTexture) {
|
|
67
64
|
this.gl.deleteTexture(this._legendTexture);
|
|
68
65
|
}
|
|
69
66
|
this._legendTexture = texture;
|
|
70
67
|
this.globe.DrawRender();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var _this = this;
|
|
68
|
+
}
|
|
69
|
+
setTime(time) {
|
|
74
70
|
// TODO: WORK ON THIS
|
|
75
71
|
this._time = time;
|
|
76
72
|
if (this.isReady() && this._throttleListener === null) {
|
|
77
|
-
this._throttleListener = setTimeout(
|
|
78
|
-
|
|
73
|
+
this._throttleListener = setTimeout(() => {
|
|
74
|
+
this.timeTrackInterpolationWorker.postMessage({ time: this._time });
|
|
79
75
|
}, 0);
|
|
80
76
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
77
|
+
}
|
|
78
|
+
setTimetracks(timeTracks) {
|
|
83
79
|
this._timeTracksAreSet = true;
|
|
84
|
-
this.timeTrackInterpolationWorker.postMessage({ timeTracks
|
|
80
|
+
this.timeTrackInterpolationWorker.postMessage({ timeTracks });
|
|
85
81
|
if (this._time !== null) {
|
|
86
82
|
this.setTime(this._time);
|
|
87
83
|
}
|
|
88
84
|
this.globe.DrawRender();
|
|
89
|
-
}
|
|
90
|
-
|
|
85
|
+
}
|
|
86
|
+
setOpacity(opacity) {
|
|
91
87
|
(0, typecheck_1.opacityCheck)(opacity);
|
|
92
88
|
this._opacity = opacity;
|
|
93
89
|
this.globe.DrawRender();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.timeTrackInterpolationWorker.postMessage({ geometry
|
|
90
|
+
}
|
|
91
|
+
setGeometry() {
|
|
92
|
+
const geometry = this.globe.api_GetCurrentGeometry();
|
|
93
|
+
this.timeTrackInterpolationWorker.postMessage({ geometry });
|
|
98
94
|
if (this._time !== null) {
|
|
99
95
|
this.setTime(this._time);
|
|
100
96
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
97
|
+
}
|
|
98
|
+
draw3D() {
|
|
103
99
|
if (this.isReady()) {
|
|
104
100
|
this.flow.draw(this._legendTexture, this._pointSize, this._opacity);
|
|
105
101
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
102
|
+
}
|
|
103
|
+
resize() {
|
|
108
104
|
this.flow.resize();
|
|
109
105
|
if (this._time !== null) {
|
|
110
106
|
this.setTime(this._time);
|
|
111
107
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
108
|
+
}
|
|
109
|
+
isReady() {
|
|
114
110
|
return (this.gl !== null && this._legendTexture !== null && this._timeTracksAreSet);
|
|
115
|
-
}
|
|
116
|
-
|
|
111
|
+
}
|
|
112
|
+
free() {
|
|
117
113
|
if (this._isFreed)
|
|
118
114
|
return;
|
|
119
115
|
this.gl.deleteTexture(this._legendTexture);
|
|
@@ -125,7 +121,6 @@ var PointHeatmapPlugin = /** @class */ (function () {
|
|
|
125
121
|
this._legendTexture = null;
|
|
126
122
|
this.timeTrackInterpolationWorker.terminate();
|
|
127
123
|
this.timeTrackInterpolationWorker = null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
}());
|
|
124
|
+
}
|
|
125
|
+
}
|
|
131
126
|
exports.PointHeatmapPlugin = PointHeatmapPlugin;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PointHeatmapFlow = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const density_to_legend_1 = require("../programs/data2legend/density-to-legend");
|
|
5
|
+
const point_to_density_texture_1 = require("../programs/data2legend/point-to-density-texture");
|
|
6
6
|
// import { textureOnCanvasProgramCache } from "../util/programs/draw-texture-on-canvas";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const gldefaultstates_1 = require("../util/webglobe/gldefaultstates");
|
|
8
|
+
class PointHeatmapFlow {
|
|
9
|
+
constructor(globe) {
|
|
10
10
|
this.globe = null;
|
|
11
11
|
this.gl = null;
|
|
12
12
|
this.program = null;
|
|
@@ -17,7 +17,7 @@ var PointHeatmapFlow = /** @class */ (function () {
|
|
|
17
17
|
this.densityToLegendProgram = density_to_legend_1.densityToLegendProgramCache.get(globe);
|
|
18
18
|
// this.testTextureProgram = textureOnCanvasProgramCache.get(globe.gl);
|
|
19
19
|
this._lookInfo = globe.api_GetCurrentLookInfo();
|
|
20
|
-
|
|
20
|
+
const { gl } = this;
|
|
21
21
|
{
|
|
22
22
|
this.buffer = gl.createBuffer();
|
|
23
23
|
this.vao2D = this.pointToDensityProgram.createVAO(this.buffer, 2);
|
|
@@ -29,15 +29,14 @@ var PointHeatmapFlow = /** @class */ (function () {
|
|
|
29
29
|
this._bindTextureToFramebuffer();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
_bindTextureToFramebuffer() {
|
|
33
|
+
const { gl, densityTexture, framebuffer } = this;
|
|
34
34
|
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
|
35
35
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, densityTexture, 0);
|
|
36
36
|
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _a = this, gl = _a.gl, globe = _a.globe, framebuffer = _a.framebuffer;
|
|
37
|
+
}
|
|
38
|
+
draw(legendTexture, pointSize, opacity = 1.0) {
|
|
39
|
+
const { gl, globe, framebuffer } = this;
|
|
41
40
|
if (this._drawDensityRequired || this._isVisionChanged()) {
|
|
42
41
|
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
|
43
42
|
gl.clearColor(0, 0, 0, 0);
|
|
@@ -48,34 +47,34 @@ var PointHeatmapFlow = /** @class */ (function () {
|
|
|
48
47
|
}
|
|
49
48
|
(0, gldefaultstates_1.defaultblendfunction)(gl);
|
|
50
49
|
this._drawLegend(legendTexture, opacity);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
}
|
|
51
|
+
resize() {
|
|
52
|
+
const { gl, densityTexture } = this;
|
|
54
53
|
gl.deleteTexture(densityTexture);
|
|
55
54
|
this.densityTexture = this._createDensityTexture();
|
|
56
55
|
this._bindTextureToFramebuffer();
|
|
57
56
|
this._drawDensityRequired = true;
|
|
58
|
-
}
|
|
57
|
+
}
|
|
59
58
|
// USER API
|
|
60
59
|
/**
|
|
61
60
|
* @param {Float32Array} data
|
|
62
61
|
* @format [x, y, z, height] x,y,z is normalized 3d cartesian coordinates. Height in kilometers. Set 6378.137 for ground level.
|
|
63
62
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
setData(data) {
|
|
64
|
+
const { gl, buffer } = this;
|
|
66
65
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
67
66
|
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
|
|
68
67
|
// use program
|
|
69
68
|
this.dataLength = data.length;
|
|
70
69
|
this._drawDensityRequired = true;
|
|
71
70
|
this.globe.DrawRender();
|
|
72
|
-
}
|
|
71
|
+
}
|
|
73
72
|
// implicit Methods
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
_createDensityTexture() {
|
|
74
|
+
const { gl, globe } = this;
|
|
75
|
+
const width = Math.floor(globe.api_ScrW());
|
|
76
|
+
const height = Math.floor(globe.api_ScrH());
|
|
77
|
+
const texture = gl.createTexture();
|
|
79
78
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
80
79
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
|
81
80
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
@@ -83,24 +82,24 @@ var PointHeatmapFlow = /** @class */ (function () {
|
|
|
83
82
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
84
83
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
85
84
|
return texture;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
}
|
|
86
|
+
_drawDensity(pointSize) {
|
|
87
|
+
const { gl, globe, pointToDensityProgram, vao2D, vao3D, dataLength } = this;
|
|
88
|
+
const is3D = globe.api_GetCurrentGeometry() === 0;
|
|
89
|
+
const vao = is3D ? vao3D : vao2D;
|
|
90
|
+
const length = dataLength / (is3D ? 3 : 2);
|
|
92
91
|
gl.blendEquation(gl.FUNC_ADD);
|
|
93
92
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE, gl.SRC_ALPHA, gl.ONE);
|
|
94
93
|
pointToDensityProgram.draw(vao, length, pointSize);
|
|
95
94
|
this._drawDensityRequired = false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
}
|
|
96
|
+
_drawLegend(legendTexture, opacity) {
|
|
97
|
+
const { densityToLegendProgram, densityTexture } = this;
|
|
99
98
|
densityToLegendProgram.draw(densityTexture, legendTexture, opacity);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
}
|
|
100
|
+
_isVisionChanged() {
|
|
101
|
+
const currentLookInfo = this.globe.api_GetCurrentLookInfo();
|
|
102
|
+
const _lookInfo = this._lookInfo;
|
|
104
103
|
if (currentLookInfo.CenterLong !== _lookInfo.CenterLong ||
|
|
105
104
|
currentLookInfo.CenterLat !== _lookInfo.CenterLat ||
|
|
106
105
|
currentLookInfo.Distance !== _lookInfo.Distance ||
|
|
@@ -110,8 +109,8 @@ var PointHeatmapFlow = /** @class */ (function () {
|
|
|
110
109
|
return true;
|
|
111
110
|
}
|
|
112
111
|
return false;
|
|
113
|
-
}
|
|
114
|
-
|
|
112
|
+
}
|
|
113
|
+
free() {
|
|
115
114
|
if (this._isFreed)
|
|
116
115
|
return;
|
|
117
116
|
this._isFreed = true;
|
|
@@ -123,7 +122,6 @@ var PointHeatmapFlow = /** @class */ (function () {
|
|
|
123
122
|
this.gl.deleteBuffer(this.buffer);
|
|
124
123
|
this.gl.deleteVertexArray(this.vao2D);
|
|
125
124
|
this.gl.deleteVertexArray(this.vao3D);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
}());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
129
127
|
exports.PointHeatmapFlow = PointHeatmapFlow;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pointKeyMeyhod = void 0;
|
|
4
|
-
|
|
4
|
+
const pointKeyMeyhod = (trackId, pointID) => `${trackId}-${pointID}`;
|
|
5
5
|
exports.pointKeyMeyhod = pointKeyMeyhod;
|