@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.
- package/Math/angle-calculation.js +8 -8
- package/Math/arc.js +18 -18
- package/Math/bounds/line-bbox.js +80 -78
- 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 +16 -14
- package/Math/methods.js +72 -67
- package/Math/plane.js +18 -16
- package/Math/quaternion.js +49 -45
- package/Math/utils.js +2 -2
- package/Math/vec3.js +45 -42
- package/algorithms/search-binary.js +4 -4
- package/altitude-locator/draw-subset-obj.js +8 -7
- package/altitude-locator/plugin.js +113 -97
- package/arrowfield/adaptor.js +4 -3
- package/arrowfield/index.js +2 -2
- package/arrowfield/plugin.js +65 -62
- package/bearing-line/index.js +1 -1
- package/bearing-line/plugin.js +225 -200
- package/circle-line-chain/chain-list-map.js +88 -82
- package/circle-line-chain/plugin.js +154 -129
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +126 -104
- package/compass-rose/compass-text-writer.js +70 -62
- package/compass-rose/index.js +2 -2
- package/compassrose/compassrose.js +50 -46
- package/compassrose/index.js +1 -1
- package/heatwave/index.js +2 -2
- package/heatwave/isobar/objectarraylabels.js +48 -44
- package/heatwave/isobar/plugin.js +123 -104
- package/heatwave/isobar/quadtreecontours.js +92 -76
- package/heatwave/plugins/heatwaveglobeshell.js +87 -69
- package/index.js +11 -11
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +64 -32
- package/partialrings/index.js +1 -1
- package/partialrings/plugin.js +84 -48
- package/partialrings/program.js +47 -136
- package/pin/pin-object-array.js +86 -83
- package/pin/pin-point-totem.js +22 -21
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
- package/point-heat-map/plugin-webworker.js +45 -40
- package/point-heat-map/point-to-heat-map-flow.js +42 -40
- package/point-tracks/key-methods.js +1 -1
- package/point-tracks/plugin.js +142 -127
- package/programs/arrowfield/index.js +1 -1
- package/programs/arrowfield/logic.js +62 -170
- package/programs/arrowfield/object.js +35 -33
- package/programs/data2legend/density-to-legend.js +21 -45
- package/programs/data2legend/point-to-density-texture.js +27 -52
- package/programs/float2legendwithratio/index.js +1 -1
- package/programs/float2legendwithratio/logic.js +42 -88
- package/programs/float2legendwithratio/object.js +46 -43
- package/programs/globe-util/is-globe-moved.js +11 -10
- package/programs/globeshell/index.js +1 -1
- package/programs/globeshell/wiggle/index.js +1 -1
- package/programs/globeshell/wiggle/logic.js +98 -191
- package/programs/globeshell/wiggle/object.js +35 -33
- package/programs/helpers/blender/program.js +19 -36
- package/programs/helpers/fadeaway/index.js +1 -1
- package/programs/helpers/fadeaway/logic.js +13 -35
- package/programs/helpers/fadeaway/object.js +10 -9
- package/programs/helpers/index.js +1 -1
- package/programs/index.js +8 -8
- package/programs/line-on-globe/angled-line.js +32 -91
- package/programs/line-on-globe/circle-accurate-3d.js +32 -82
- package/programs/line-on-globe/circle-accurate-flat.js +50 -108
- package/programs/line-on-globe/circle-accurate.js +33 -103
- package/programs/line-on-globe/circle.js +32 -97
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +33 -83
- package/programs/line-on-globe/lines-color-instanced-flat.js +34 -79
- package/programs/line-on-globe/linestrip.js +39 -100
- package/programs/line-on-globe/naive-accurate-flexible.js +48 -118
- package/programs/line-on-globe/to-the-surface.js +29 -58
- package/programs/line-on-globe/util.js +1 -1
- package/programs/picking/pickable-renderer.js +33 -117
- package/programs/point-on-globe/element-globe-surface-glow.js +38 -78
- package/programs/point-on-globe/element-point-glow.js +35 -103
- package/programs/point-on-globe/square-pixel-point.js +27 -76
- package/programs/programcache.js +13 -13
- package/programs/rings/distancering/circleflatprogram.js +21 -63
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +145 -156
- package/programs/rings/distancering/circlepaddysharedbuffer.js +197 -121
- package/programs/rings/distancering/index.js +4 -4
- package/programs/rings/distancering/paddyflatprogram.js +20 -73
- package/programs/rings/distancering/paddyflatprogram2d.js +22 -75
- package/programs/rings/distancering/paddyflatprogram3d.js +20 -73
- package/programs/rings/partial-ring/piece-of-pie.js +35 -137
- package/programs/totems/camerauniformblock.js +51 -64
- package/programs/totems/canvas-webglobe-info.js +40 -48
- package/programs/totems/gpu-selection-uniform-block.js +40 -44
- package/programs/totems/index.js +1 -1
- package/programs/two-d/pixel-padding-for-compass.js +29 -90
- package/programs/util.js +7 -6
- package/programs/vectorfields/index.js +1 -1
- package/programs/vectorfields/logics/drawrectangleparticles.js +29 -70
- package/programs/vectorfields/logics/index.js +3 -3
- package/programs/vectorfields/logics/pixelbased.js +35 -91
- package/programs/vectorfields/logics/ubo.js +25 -31
- package/programs/vectorfields/pingpongbuffermanager.js +34 -30
- package/rangerings/index.js +4 -4
- package/rangerings/plugin.js +252 -202
- package/rangerings/rangeringangletext.js +120 -108
- package/rangerings/ring-account.js +69 -52
- package/shaders/fragment-toy/firework.js +1 -55
- package/shaders/fragment-toy/singularity.js +1 -55
- package/timetracks/adaptors-line-strip.js +37 -26
- package/timetracks/adaptors.js +61 -47
- package/timetracks/index.js +4 -4
- package/timetracks/plugin-line-strip.js +63 -59
- package/timetracks/plugin.js +69 -65
- package/timetracks/program-line-strip.js +103 -296
- package/timetracks/program.js +113 -419
- package/timetracks/programpoint-line-strip.js +44 -97
- package/timetracks/programpoint.js +44 -90
- package/util/account/bufferoffsetmanager.js +95 -72
- package/util/account/index.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-manager.js +43 -39
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +94 -64
- package/util/account/single-attribute-buffer-management/index.js +3 -3
- package/util/account/single-attribute-buffer-management/object-store.js +30 -28
- package/util/account/util.js +4 -2
- package/util/algorithms/search-binary.js +4 -4
- package/util/check/get.js +5 -5
- package/util/check/typecheck.js +15 -13
- package/util/geometry/index.js +11 -9
- package/util/gl-util/buffer/attribute-loader.js +20 -8
- package/util/gl-util/buffer/index.js +1 -1
- package/util/gl-util/draw-options/methods.js +7 -7
- package/util/gl-util/uniform-block/manager.js +67 -55
- package/util/heatwavedatamanager/datamanager.js +116 -56
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +40 -37
- package/util/heatwavedatamanager/pointcoordsmeta.js +10 -9
- package/util/index.js +6 -6
- package/util/interpolation/timetrack/index.js +1 -1
- package/util/interpolation/timetrack/timetrack-interpolator.js +29 -27
- package/util/interpolation/timetrack/web-worker-str.js +1 -179
- 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 +52 -46
- package/util/programs/draw-texture-on-canvas.js +21 -39
- package/util/programs/shapesonglobe.js +64 -104
- package/util/programs/supersampletotextures.js +39 -45
- package/util/programs/texturetoglobe.js +48 -98
- package/util/shaderfunctions/geometrytransformations.js +27 -322
- package/util/shaderfunctions/nodata.js +1 -7
- package/util/shaderfunctions/noisefunctions.js +9 -39
- package/util/surface-line-data/arcs-to-cuts.js +23 -20
- package/util/webglobe/rasteroverlay.js +37 -35
- package/util/webglobjectbuilders.js +60 -55
- package/util/webglobjectbuilders1.js +49 -48
- package/waveparticles/adaptor.js +7 -6
- package/waveparticles/index.js +2 -2
- package/waveparticles/plugin.js +84 -79
- package/wind/imagetovectorfieldandmagnitude.js +15 -15
- package/wind/index.js +4 -4
- package/wind/plugin.js +251 -453
- package/wind/vectorfieldimage.js +5 -5
- package/write-text/attached-text-writer.js +48 -46
- package/write-text/context-text.js +58 -51
- package/write-text/context-text3.js +74 -69
|
@@ -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
|
+
var methods_1 = require("../../Math/methods");
|
|
36
|
+
var processACut = function (array, offset) {
|
|
37
37
|
// first 3 values of array
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
var v3 = array.slice(offset, offset + 3);
|
|
39
|
+
var v4 = (0, methods_1.pixelXYLenghtToUnitVectorWithHeight)(v3);
|
|
40
|
+
var time = array[offset + 3];
|
|
41
41
|
return [v4, time];
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
var timeTrackPluginDataToPointHeatInterpolatorAdapter = function (timeTrackPluginData) {
|
|
44
|
+
var timeTracks = [];
|
|
45
|
+
var offset = 0;
|
|
46
|
+
var timeTrack = {
|
|
47
47
|
coordinates: [],
|
|
48
48
|
times: []
|
|
49
49
|
};
|
|
@@ -56,7 +56,7 @@ const timeTrackPluginDataToPointHeatInterpolatorAdapter = (timeTrackPluginData)
|
|
|
56
56
|
};
|
|
57
57
|
offset += 9;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
var point = processACut(timeTrackPluginData, offset);
|
|
60
60
|
offset += 9;
|
|
61
61
|
timeTrack.coordinates.push(point[0]);
|
|
62
62
|
timeTrack.times.push(point[1]);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PointHeatmapPlugin = void 0;
|
|
4
|
-
|
|
4
|
+
var 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
|
-
|
|
6
|
+
var index_1 = require("../util/interpolation/timetrack/index");
|
|
7
|
+
var util_1 = require("../util");
|
|
8
|
+
var typecheck_1 = require("../util/check/typecheck");
|
|
9
|
+
var PointHeatmapPlugin = /** @class */ (function () {
|
|
10
|
+
function PointHeatmapPlugin(id, _a) {
|
|
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;
|
|
11
13
|
this.id = id;
|
|
12
14
|
this.globe = null;
|
|
13
15
|
this.gl = null;
|
|
@@ -21,7 +23,7 @@ class PointHeatmapPlugin {
|
|
|
21
23
|
// const blob = new Blob([webworkerStr], { type: 'application/javascript' });
|
|
22
24
|
// this.timeTrackInterpolationWorker = new Worker(URL.createObjectURL(blob), { type: 'module' });
|
|
23
25
|
this.timeTrackInterpolationWorker = (0, index_1.createWorker)();
|
|
24
|
-
this.timeTrackInterpolationWorker.onmessage = (e)
|
|
26
|
+
this.timeTrackInterpolationWorker.onmessage = function (e) {
|
|
25
27
|
if (e.data.error) {
|
|
26
28
|
throw new Error(e.data.error);
|
|
27
29
|
}
|
|
@@ -29,87 +31,89 @@ class PointHeatmapPlugin {
|
|
|
29
31
|
onInterpolationComplete();
|
|
30
32
|
}
|
|
31
33
|
if (e.data instanceof Float32Array) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
_this.flow.setData(e.data);
|
|
35
|
+
_this._throttleListener = null;
|
|
34
36
|
onInterpolationComplete();
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
// globe interaction
|
|
39
|
-
init(globe, gl) {
|
|
41
|
+
PointHeatmapPlugin.prototype.init = function (globe, gl) {
|
|
40
42
|
this.globe = globe;
|
|
41
43
|
this.gl = gl;
|
|
42
44
|
this.flow = new point_to_heat_map_flow_1.PointHeatmapFlow(globe);
|
|
43
45
|
this.setGeometry();
|
|
44
46
|
this.resize();
|
|
45
|
-
}
|
|
46
|
-
setPointSize(pointSize) {
|
|
47
|
+
};
|
|
48
|
+
PointHeatmapPlugin.prototype.setPointSize = function (pointSize) {
|
|
47
49
|
(0, typecheck_1.constraintFloat)(pointSize, 1);
|
|
48
50
|
this._pointSize = pointSize;
|
|
49
51
|
this.globe.DrawRender();
|
|
50
|
-
}
|
|
52
|
+
};
|
|
51
53
|
/**
|
|
52
54
|
* @param {Array<string>}
|
|
53
55
|
* @param {string} mode "interpolated" | "discrete"
|
|
54
56
|
*/
|
|
55
|
-
setColorRamp(values, thresholds, mode
|
|
56
|
-
|
|
57
|
+
PointHeatmapPlugin.prototype.setColorRamp = function (values, thresholds, mode) {
|
|
58
|
+
if (mode === void 0) { mode = "interpolated"; }
|
|
59
|
+
var gl = this.gl;
|
|
57
60
|
if (this.gl === null) {
|
|
58
61
|
throw new Error('Plugin not initialized');
|
|
59
62
|
}
|
|
60
63
|
;
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
var rampData = (0, util_1.getColorRampModed)(values, thresholds, mode);
|
|
65
|
+
var texture = (0, util_1.createTexture)(gl, gl.LINEAR, rampData, 256, 1);
|
|
63
66
|
if (this._legendTexture) {
|
|
64
67
|
this.gl.deleteTexture(this._legendTexture);
|
|
65
68
|
}
|
|
66
69
|
this._legendTexture = texture;
|
|
67
70
|
this.globe.DrawRender();
|
|
68
|
-
}
|
|
69
|
-
setTime(time) {
|
|
71
|
+
};
|
|
72
|
+
PointHeatmapPlugin.prototype.setTime = function (time) {
|
|
73
|
+
var _this = this;
|
|
70
74
|
// TODO: WORK ON THIS
|
|
71
75
|
this._time = time;
|
|
72
76
|
if (this.isReady() && this._throttleListener === null) {
|
|
73
|
-
this._throttleListener = setTimeout(()
|
|
74
|
-
|
|
77
|
+
this._throttleListener = setTimeout(function () {
|
|
78
|
+
_this.timeTrackInterpolationWorker.postMessage({ time: _this._time });
|
|
75
79
|
}, 0);
|
|
76
80
|
}
|
|
77
|
-
}
|
|
78
|
-
setTimetracks(timeTracks) {
|
|
81
|
+
};
|
|
82
|
+
PointHeatmapPlugin.prototype.setTimetracks = function (timeTracks) {
|
|
79
83
|
this._timeTracksAreSet = true;
|
|
80
|
-
this.timeTrackInterpolationWorker.postMessage({ timeTracks });
|
|
84
|
+
this.timeTrackInterpolationWorker.postMessage({ timeTracks: timeTracks });
|
|
81
85
|
if (this._time !== null) {
|
|
82
86
|
this.setTime(this._time);
|
|
83
87
|
}
|
|
84
88
|
this.globe.DrawRender();
|
|
85
|
-
}
|
|
86
|
-
setOpacity(opacity) {
|
|
89
|
+
};
|
|
90
|
+
PointHeatmapPlugin.prototype.setOpacity = function (opacity) {
|
|
87
91
|
(0, typecheck_1.opacityCheck)(opacity);
|
|
88
92
|
this._opacity = opacity;
|
|
89
93
|
this.globe.DrawRender();
|
|
90
|
-
}
|
|
91
|
-
setGeometry() {
|
|
92
|
-
|
|
93
|
-
this.timeTrackInterpolationWorker.postMessage({ geometry });
|
|
94
|
+
};
|
|
95
|
+
PointHeatmapPlugin.prototype.setGeometry = function () {
|
|
96
|
+
var geometry = this.globe.api_GetCurrentGeometry();
|
|
97
|
+
this.timeTrackInterpolationWorker.postMessage({ geometry: geometry });
|
|
94
98
|
if (this._time !== null) {
|
|
95
99
|
this.setTime(this._time);
|
|
96
100
|
}
|
|
97
|
-
}
|
|
98
|
-
draw3D() {
|
|
101
|
+
};
|
|
102
|
+
PointHeatmapPlugin.prototype.draw3D = function () {
|
|
99
103
|
if (this.isReady()) {
|
|
100
104
|
this.flow.draw(this._legendTexture, this._pointSize, this._opacity);
|
|
101
105
|
}
|
|
102
|
-
}
|
|
103
|
-
resize() {
|
|
106
|
+
};
|
|
107
|
+
PointHeatmapPlugin.prototype.resize = function () {
|
|
104
108
|
this.flow.resize();
|
|
105
109
|
if (this._time !== null) {
|
|
106
110
|
this.setTime(this._time);
|
|
107
111
|
}
|
|
108
|
-
}
|
|
109
|
-
isReady() {
|
|
112
|
+
};
|
|
113
|
+
PointHeatmapPlugin.prototype.isReady = function () {
|
|
110
114
|
return (this.gl !== null && this._legendTexture !== null && this._timeTracksAreSet);
|
|
111
|
-
}
|
|
112
|
-
free() {
|
|
115
|
+
};
|
|
116
|
+
PointHeatmapPlugin.prototype.free = function () {
|
|
113
117
|
if (this._isFreed)
|
|
114
118
|
return;
|
|
115
119
|
this.gl.deleteTexture(this._legendTexture);
|
|
@@ -121,6 +125,7 @@ class PointHeatmapPlugin {
|
|
|
121
125
|
this._legendTexture = null;
|
|
122
126
|
this.timeTrackInterpolationWorker.terminate();
|
|
123
127
|
this.timeTrackInterpolationWorker = null;
|
|
124
|
-
}
|
|
125
|
-
|
|
128
|
+
};
|
|
129
|
+
return PointHeatmapPlugin;
|
|
130
|
+
}());
|
|
126
131
|
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
|
+
var density_to_legend_1 = require("../programs/data2legend/density-to-legend");
|
|
5
|
+
var 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
|
+
var gldefaultstates_1 = require("../util/webglobe/gldefaultstates");
|
|
8
|
+
var PointHeatmapFlow = /** @class */ (function () {
|
|
9
|
+
function PointHeatmapFlow(globe) {
|
|
10
10
|
this.globe = null;
|
|
11
11
|
this.gl = null;
|
|
12
12
|
this.program = null;
|
|
@@ -17,7 +17,7 @@ class PointHeatmapFlow {
|
|
|
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
|
+
var gl = this.gl;
|
|
21
21
|
{
|
|
22
22
|
this.buffer = gl.createBuffer();
|
|
23
23
|
this.vao2D = this.pointToDensityProgram.createVAO(this.buffer, 2);
|
|
@@ -29,14 +29,15 @@ class PointHeatmapFlow {
|
|
|
29
29
|
this._bindTextureToFramebuffer();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
_bindTextureToFramebuffer() {
|
|
33
|
-
|
|
32
|
+
PointHeatmapFlow.prototype._bindTextureToFramebuffer = function () {
|
|
33
|
+
var _a = this, gl = _a.gl, densityTexture = _a.densityTexture, framebuffer = _a.framebuffer;
|
|
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
|
-
draw(legendTexture, pointSize, opacity
|
|
39
|
-
|
|
37
|
+
};
|
|
38
|
+
PointHeatmapFlow.prototype.draw = function (legendTexture, pointSize, opacity) {
|
|
39
|
+
if (opacity === void 0) { opacity = 1.0; }
|
|
40
|
+
var _a = this, gl = _a.gl, globe = _a.globe, framebuffer = _a.framebuffer;
|
|
40
41
|
if (this._drawDensityRequired || this._isVisionChanged()) {
|
|
41
42
|
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
|
42
43
|
gl.clearColor(0, 0, 0, 0);
|
|
@@ -47,34 +48,34 @@ class PointHeatmapFlow {
|
|
|
47
48
|
}
|
|
48
49
|
(0, gldefaultstates_1.defaultblendfunction)(gl);
|
|
49
50
|
this._drawLegend(legendTexture, opacity);
|
|
50
|
-
}
|
|
51
|
-
resize() {
|
|
52
|
-
|
|
51
|
+
};
|
|
52
|
+
PointHeatmapFlow.prototype.resize = function () {
|
|
53
|
+
var _a = this, gl = _a.gl, densityTexture = _a.densityTexture;
|
|
53
54
|
gl.deleteTexture(densityTexture);
|
|
54
55
|
this.densityTexture = this._createDensityTexture();
|
|
55
56
|
this._bindTextureToFramebuffer();
|
|
56
57
|
this._drawDensityRequired = true;
|
|
57
|
-
}
|
|
58
|
+
};
|
|
58
59
|
// USER API
|
|
59
60
|
/**
|
|
60
61
|
* @param {Float32Array} data
|
|
61
62
|
* @format [x, y, z, height] x,y,z is normalized 3d cartesian coordinates. Height in kilometers. Set 6378.137 for ground level.
|
|
62
63
|
*/
|
|
63
|
-
setData(data) {
|
|
64
|
-
|
|
64
|
+
PointHeatmapFlow.prototype.setData = function (data) {
|
|
65
|
+
var _a = this, gl = _a.gl, buffer = _a.buffer;
|
|
65
66
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
66
67
|
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
|
|
67
68
|
// use program
|
|
68
69
|
this.dataLength = data.length;
|
|
69
70
|
this._drawDensityRequired = true;
|
|
70
71
|
this.globe.DrawRender();
|
|
71
|
-
}
|
|
72
|
+
};
|
|
72
73
|
// implicit Methods
|
|
73
|
-
_createDensityTexture() {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
PointHeatmapFlow.prototype._createDensityTexture = function () {
|
|
75
|
+
var _a = this, gl = _a.gl, globe = _a.globe;
|
|
76
|
+
var width = Math.floor(globe.api_ScrW());
|
|
77
|
+
var height = Math.floor(globe.api_ScrH());
|
|
78
|
+
var texture = gl.createTexture();
|
|
78
79
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
79
80
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
|
80
81
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
@@ -82,24 +83,24 @@ class PointHeatmapFlow {
|
|
|
82
83
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
83
84
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
84
85
|
return texture;
|
|
85
|
-
}
|
|
86
|
-
_drawDensity(pointSize) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
};
|
|
87
|
+
PointHeatmapFlow.prototype._drawDensity = function (pointSize) {
|
|
88
|
+
var _a = this, gl = _a.gl, globe = _a.globe, pointToDensityProgram = _a.pointToDensityProgram, vao2D = _a.vao2D, vao3D = _a.vao3D, dataLength = _a.dataLength;
|
|
89
|
+
var is3D = globe.api_GetCurrentGeometry() === 0;
|
|
90
|
+
var vao = is3D ? vao3D : vao2D;
|
|
91
|
+
var length = dataLength / (is3D ? 3 : 2);
|
|
91
92
|
gl.blendEquation(gl.FUNC_ADD);
|
|
92
93
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE, gl.SRC_ALPHA, gl.ONE);
|
|
93
94
|
pointToDensityProgram.draw(vao, length, pointSize);
|
|
94
95
|
this._drawDensityRequired = false;
|
|
95
|
-
}
|
|
96
|
-
_drawLegend(legendTexture, opacity) {
|
|
97
|
-
|
|
96
|
+
};
|
|
97
|
+
PointHeatmapFlow.prototype._drawLegend = function (legendTexture, opacity) {
|
|
98
|
+
var _a = this, densityToLegendProgram = _a.densityToLegendProgram, densityTexture = _a.densityTexture;
|
|
98
99
|
densityToLegendProgram.draw(densityTexture, legendTexture, opacity);
|
|
99
|
-
}
|
|
100
|
-
_isVisionChanged() {
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
};
|
|
101
|
+
PointHeatmapFlow.prototype._isVisionChanged = function () {
|
|
102
|
+
var currentLookInfo = this.globe.api_GetCurrentLookInfo();
|
|
103
|
+
var _lookInfo = this._lookInfo;
|
|
103
104
|
if (currentLookInfo.CenterLong !== _lookInfo.CenterLong ||
|
|
104
105
|
currentLookInfo.CenterLat !== _lookInfo.CenterLat ||
|
|
105
106
|
currentLookInfo.Distance !== _lookInfo.Distance ||
|
|
@@ -109,8 +110,8 @@ class PointHeatmapFlow {
|
|
|
109
110
|
return true;
|
|
110
111
|
}
|
|
111
112
|
return false;
|
|
112
|
-
}
|
|
113
|
-
free() {
|
|
113
|
+
};
|
|
114
|
+
PointHeatmapFlow.prototype.free = function () {
|
|
114
115
|
if (this._isFreed)
|
|
115
116
|
return;
|
|
116
117
|
this._isFreed = true;
|
|
@@ -122,6 +123,7 @@ class PointHeatmapFlow {
|
|
|
122
123
|
this.gl.deleteBuffer(this.buffer);
|
|
123
124
|
this.gl.deleteVertexArray(this.vao2D);
|
|
124
125
|
this.gl.deleteVertexArray(this.vao3D);
|
|
125
|
-
}
|
|
126
|
-
|
|
126
|
+
};
|
|
127
|
+
return PointHeatmapFlow;
|
|
128
|
+
}());
|
|
127
129
|
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
|
+
var pointKeyMeyhod = function (trackId, pointID) { return "".concat(trackId, "-").concat(pointID); };
|
|
5
5
|
exports.pointKeyMeyhod = pointKeyMeyhod;
|