@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
|
@@ -6,8 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var program_line_strip_1 = __importDefault(require("./program-line-strip"));
|
|
10
|
+
var programpoint_line_strip_1 = __importDefault(require("./programpoint-line-strip"));
|
|
11
11
|
/**
|
|
12
12
|
* @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
|
|
13
13
|
* TimeTrackMultiColorData is [
|
|
@@ -36,7 +36,7 @@ const programpoint_line_strip_1 = __importDefault(require("./programpoint-line-s
|
|
|
36
36
|
uses float32array in a * {@link TimeTrackMultiColorData} format
|
|
37
37
|
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
var TimeTrackMultiColorPlugin = /** @class */ (function () {
|
|
40
40
|
/**
|
|
41
41
|
* @param {String} id
|
|
42
42
|
* @param {Object} options
|
|
@@ -52,7 +52,9 @@ class TimeTrackMultiColorPlugin {
|
|
|
52
52
|
* @param {number} pointOptions.pointSize 0 ~ inf
|
|
53
53
|
* @param {boolean} pointOptions.isOn true | false
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
function TimeTrackMultiColorPlugin(id, options, _a) {
|
|
56
|
+
if (options === void 0) { options = {}; }
|
|
57
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.opacity, opacity = _c === void 0 ? 1.0 : _c, _d = _b.pointSize, pointSize = _d === void 0 ? 1 : _d, _e = _b.isOn, isOn = _e === void 0 ? false : _e;
|
|
56
58
|
this.id = id;
|
|
57
59
|
this.globe = null;
|
|
58
60
|
this.gl = null;
|
|
@@ -61,7 +63,7 @@ class TimeTrackMultiColorPlugin {
|
|
|
61
63
|
this._tailTime = 0;
|
|
62
64
|
this._data = options.data || null;
|
|
63
65
|
this._options = options;
|
|
64
|
-
this._pointOptions = { opacity, pointSize, isOn };
|
|
66
|
+
this._pointOptions = { opacity: opacity, pointSize: pointSize, isOn: isOn };
|
|
65
67
|
this.program = null;
|
|
66
68
|
this._transporArr = new Float32Array(3);
|
|
67
69
|
this._ready = false;
|
|
@@ -71,86 +73,86 @@ class TimeTrackMultiColorPlugin {
|
|
|
71
73
|
// ----------------------------------
|
|
72
74
|
// --- user methods ---
|
|
73
75
|
// ----------------------------------
|
|
74
|
-
setHeadAndTailTime(headTime, tailTime) {
|
|
76
|
+
TimeTrackMultiColorPlugin.prototype.setHeadAndTailTime = function (headTime, tailTime) {
|
|
75
77
|
var _a;
|
|
76
78
|
this._headTime = headTime;
|
|
77
79
|
this._tailTime = tailTime;
|
|
78
80
|
// console.log("setHeadAndTailTime", headTime, tailTime);
|
|
79
81
|
(_a = this.pointProgram) === null || _a === void 0 ? void 0 : _a.setHeadTime(headTime);
|
|
80
82
|
this.globe.DrawRender();
|
|
81
|
-
}
|
|
82
|
-
setBlurWeights(weights) {
|
|
83
|
+
};
|
|
84
|
+
TimeTrackMultiColorPlugin.prototype.setBlurWeights = function (weights) {
|
|
83
85
|
this.program.setBlurWeights(weights);
|
|
84
86
|
this.globe.DrawRender();
|
|
85
|
-
}
|
|
86
|
-
setHeadPercentage(headPercentage) {
|
|
87
|
+
};
|
|
88
|
+
TimeTrackMultiColorPlugin.prototype.setHeadPercentage = function (headPercentage) {
|
|
87
89
|
this.program.setHeadPercentage(headPercentage);
|
|
88
90
|
this.globe.DrawRender();
|
|
89
|
-
}
|
|
90
|
-
setRouteAlpha(routeAlpha) {
|
|
91
|
+
};
|
|
92
|
+
TimeTrackMultiColorPlugin.prototype.setRouteAlpha = function (routeAlpha) {
|
|
91
93
|
this.program.setRouteAlpha(routeAlpha);
|
|
92
94
|
this.globe.DrawRender();
|
|
93
|
-
}
|
|
94
|
-
setFinalAlphaRatio(finalAlphaRatio) {
|
|
95
|
+
};
|
|
96
|
+
TimeTrackMultiColorPlugin.prototype.setFinalAlphaRatio = function (finalAlphaRatio) {
|
|
95
97
|
this.program.setFinalAlphaRatio(finalAlphaRatio);
|
|
96
98
|
this.globe.DrawRender();
|
|
97
|
-
}
|
|
98
|
-
setGamma(gamma) {
|
|
99
|
+
};
|
|
100
|
+
TimeTrackMultiColorPlugin.prototype.setGamma = function (gamma) {
|
|
99
101
|
this.program.setGamma(gamma);
|
|
100
102
|
this.globe.DrawRender();
|
|
101
|
-
}
|
|
102
|
-
setExposure(exposure) {
|
|
103
|
+
};
|
|
104
|
+
TimeTrackMultiColorPlugin.prototype.setExposure = function (exposure) {
|
|
103
105
|
this.program.setExposure(exposure);
|
|
104
106
|
this.globe.DrawRender();
|
|
105
|
-
}
|
|
106
|
-
setBlurRepetition(repetition) {
|
|
107
|
+
};
|
|
108
|
+
TimeTrackMultiColorPlugin.prototype.setBlurRepetition = function (repetition) {
|
|
107
109
|
this.program.setBlurRepetition(repetition);
|
|
108
110
|
this.globe.DrawRender();
|
|
109
|
-
}
|
|
111
|
+
};
|
|
110
112
|
// ---------------point program setters-------------------
|
|
111
|
-
setPointOpacity(opacity) {
|
|
113
|
+
TimeTrackMultiColorPlugin.prototype.setPointOpacity = function (opacity) {
|
|
112
114
|
this._pointOptions.opacity = opacity;
|
|
113
115
|
if (this.pointProgram) {
|
|
114
116
|
this.pointProgram.setOpacity(opacity);
|
|
115
117
|
this.globe.DrawRender();
|
|
116
118
|
}
|
|
117
|
-
}
|
|
118
|
-
setPointSize(size) {
|
|
119
|
+
};
|
|
120
|
+
TimeTrackMultiColorPlugin.prototype.setPointSize = function (size) {
|
|
119
121
|
this._pointOptions.pointSize = size;
|
|
120
122
|
if (this.pointProgram) {
|
|
121
123
|
this.pointProgram.setPointSize(size);
|
|
122
124
|
this.globe.DrawRender();
|
|
123
125
|
}
|
|
124
|
-
}
|
|
125
|
-
pointSwitch(isOn) {
|
|
126
|
+
};
|
|
127
|
+
TimeTrackMultiColorPlugin.prototype.pointSwitch = function (isOn) {
|
|
126
128
|
if (isOn && !this.pointProgram) {
|
|
127
129
|
this.pointProgram = this._createPointProgram();
|
|
128
130
|
}
|
|
129
131
|
else {
|
|
130
132
|
this._deletePointProgram();
|
|
131
133
|
}
|
|
132
|
-
}
|
|
134
|
+
};
|
|
133
135
|
// ------------------------------------------------------------
|
|
134
|
-
_createPointProgram() {
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
TimeTrackMultiColorPlugin.prototype._createPointProgram = function () {
|
|
137
|
+
var gl = this.gl;
|
|
138
|
+
var program = new programpoint_line_strip_1.default(gl, this.globe, this._attrBuffer, this._pointOptions);
|
|
137
139
|
program.setDrawCount(this._totalSize);
|
|
138
140
|
return program;
|
|
139
|
-
}
|
|
140
|
-
_deletePointProgram() {
|
|
141
|
+
};
|
|
142
|
+
TimeTrackMultiColorPlugin.prototype._deletePointProgram = function () {
|
|
141
143
|
if (this.pointProgram)
|
|
142
144
|
this.pointProgram.free();
|
|
143
145
|
this.pointProgram = null;
|
|
144
|
-
}
|
|
146
|
+
};
|
|
145
147
|
// -------------------------------------------------------------
|
|
146
|
-
isReady() {
|
|
148
|
+
TimeTrackMultiColorPlugin.prototype.isReady = function () {
|
|
147
149
|
return this._ready;
|
|
148
|
-
}
|
|
150
|
+
};
|
|
149
151
|
/**
|
|
150
152
|
* @param {TimeTrackMultiColorData} data {@link TimeTrackMultiColorData}
|
|
151
153
|
* Check Class constructor
|
|
152
154
|
*/
|
|
153
|
-
setData(data) {
|
|
155
|
+
TimeTrackMultiColorPlugin.prototype.setData = function (data) {
|
|
154
156
|
if (this.gl) {
|
|
155
157
|
this._ready = false;
|
|
156
158
|
this.setDataAsFloat32Array(data);
|
|
@@ -160,14 +162,15 @@ class TimeTrackMultiColorPlugin {
|
|
|
160
162
|
this._data = data;
|
|
161
163
|
this._ready = false;
|
|
162
164
|
}
|
|
163
|
-
}
|
|
165
|
+
};
|
|
164
166
|
/**
|
|
165
167
|
* @param {TimeTrackMultiColorData} data {@link TimeTrackMultiColorData}
|
|
166
168
|
* @param {number} totalSize | if not provided, it is calculated from float32Array.length / 9. Use if you want to draw first n points.
|
|
167
169
|
*/
|
|
168
|
-
setDataAsFloat32Array(data, totalSize
|
|
170
|
+
TimeTrackMultiColorPlugin.prototype.setDataAsFloat32Array = function (data, totalSize) {
|
|
169
171
|
var _a;
|
|
170
|
-
|
|
172
|
+
if (totalSize === void 0) { totalSize = null; }
|
|
173
|
+
var _b = this, gl = _b.gl, _attrBuffer = _b._attrBuffer;
|
|
171
174
|
gl.bindBuffer(gl.ARRAY_BUFFER, _attrBuffer);
|
|
172
175
|
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
|
|
173
176
|
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
@@ -182,36 +185,36 @@ class TimeTrackMultiColorPlugin {
|
|
|
182
185
|
this.program.setTotalLength(this._totalSize);
|
|
183
186
|
(_a = this.pointProgram) === null || _a === void 0 ? void 0 : _a.setDrawCount(this._totalSize / 2);
|
|
184
187
|
this._ready = true;
|
|
185
|
-
}
|
|
188
|
+
};
|
|
186
189
|
// ------------------------------
|
|
187
190
|
// --- globe Methods ---
|
|
188
191
|
// ------------------------------
|
|
189
|
-
draw3D(projMatrix, modelviewMatrix, transPos) {
|
|
192
|
+
TimeTrackMultiColorPlugin.prototype.draw3D = function (projMatrix, modelviewMatrix, transPos) {
|
|
190
193
|
var _a;
|
|
191
194
|
if (!this._ready)
|
|
192
195
|
return;
|
|
193
|
-
|
|
196
|
+
var _b = this, _headTime = _b._headTime, _tailTime = _b._tailTime, program = _b.program, _transporArr = _b._transporArr, globe = _b.globe;
|
|
194
197
|
(_a = this.pointProgram) === null || _a === void 0 ? void 0 : _a.draw();
|
|
195
198
|
_transporArr.set([transPos.x, transPos.y, transPos.z], 0);
|
|
196
|
-
|
|
199
|
+
var geomType = globe.api_GetCurrentGeometry();
|
|
197
200
|
if (geomType === 0) {
|
|
198
201
|
program.draw(_headTime, _tailTime, projMatrix, modelviewMatrix, _transporArr);
|
|
199
202
|
}
|
|
200
203
|
else if (geomType === 1) {
|
|
201
|
-
|
|
204
|
+
var _c = globe.api_GetCurrentWorldWH(), width = _c.width, height = _c.height;
|
|
202
205
|
program.draw(_headTime, _tailTime, projMatrix, modelviewMatrix, _transporArr, [width, height]);
|
|
203
206
|
}
|
|
204
207
|
else {
|
|
205
208
|
console.error("Unknown geometry type", geomType);
|
|
206
209
|
}
|
|
207
|
-
}
|
|
208
|
-
resize(width, height) {
|
|
209
|
-
|
|
210
|
+
};
|
|
211
|
+
TimeTrackMultiColorPlugin.prototype.resize = function (width, height) {
|
|
212
|
+
var _a = this, program = _a.program, globe = _a.globe;
|
|
210
213
|
width = width || globe.api_ScrW();
|
|
211
214
|
height = height || globe.api_ScrH();
|
|
212
215
|
program.resize(width, height);
|
|
213
|
-
}
|
|
214
|
-
init(globe, gl) {
|
|
216
|
+
};
|
|
217
|
+
TimeTrackMultiColorPlugin.prototype.init = function (globe, gl) {
|
|
215
218
|
var _a;
|
|
216
219
|
this.globe = globe;
|
|
217
220
|
this.gl = gl;
|
|
@@ -227,24 +230,25 @@ class TimeTrackMultiColorPlugin {
|
|
|
227
230
|
this._data = null;
|
|
228
231
|
}
|
|
229
232
|
this.resize();
|
|
230
|
-
}
|
|
231
|
-
free() {
|
|
232
|
-
|
|
233
|
+
};
|
|
234
|
+
TimeTrackMultiColorPlugin.prototype.free = function () {
|
|
235
|
+
var _a = this, gl = _a.gl, _attrBuffer = _a._attrBuffer;
|
|
233
236
|
this.program.free();
|
|
234
237
|
gl.deleteBuffer(_attrBuffer);
|
|
235
|
-
}
|
|
236
|
-
setGeometry() {
|
|
237
|
-
|
|
238
|
+
};
|
|
239
|
+
TimeTrackMultiColorPlugin.prototype.setGeometry = function () {
|
|
240
|
+
var _a = this, globe = _a.globe, program = _a.program;
|
|
238
241
|
program.setIs3D(globe.api_GetCurrentGeometry() === 0);
|
|
239
|
-
}
|
|
242
|
+
};
|
|
240
243
|
// ----------------------------------
|
|
241
244
|
// --- implicit methods ---
|
|
242
245
|
// ----------------------------------
|
|
243
|
-
_latLongToPixelXY(latitude, longitude) {
|
|
246
|
+
TimeTrackMultiColorPlugin.prototype._latLongToPixelXY = function (latitude, longitude) {
|
|
244
247
|
return {
|
|
245
248
|
x: (longitude + 180) / 360,
|
|
246
249
|
y: (90 - latitude) / 180
|
|
247
250
|
};
|
|
248
|
-
}
|
|
249
|
-
|
|
251
|
+
};
|
|
252
|
+
return TimeTrackMultiColorPlugin;
|
|
253
|
+
}());
|
|
250
254
|
exports.default = TimeTrackMultiColorPlugin;
|
package/timetracks/plugin.js
CHANGED
|
@@ -6,8 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var program_1 = __importDefault(require("./program"));
|
|
10
|
+
var programpoint_1 = __importDefault(require("./programpoint"));
|
|
11
11
|
/**
|
|
12
12
|
* @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
|
|
13
13
|
* TimeTrackMultiColorData is [
|
|
@@ -33,7 +33,7 @@ const programpoint_1 = __importDefault(require("./programpoint"));
|
|
|
33
33
|
uses float32array in a * {@link TimeTrackMultiColorData} format
|
|
34
34
|
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
var TimeTrackMultiColorPlugin = /** @class */ (function () {
|
|
37
37
|
/**
|
|
38
38
|
* @param {String} id
|
|
39
39
|
* @param {Object} options
|
|
@@ -49,7 +49,9 @@ class TimeTrackMultiColorPlugin {
|
|
|
49
49
|
* @param {number} pointOptions.pointSize 0 ~ inf
|
|
50
50
|
* @param {boolean} pointOptions.isOn true | false
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
function TimeTrackMultiColorPlugin(id, options, _a) {
|
|
53
|
+
if (options === void 0) { options = {}; }
|
|
54
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.opacity, opacity = _c === void 0 ? 1.0 : _c, _d = _b.pointSize, pointSize = _d === void 0 ? 1 : _d, _e = _b.isOn, isOn = _e === void 0 ? false : _e;
|
|
53
55
|
this.id = id;
|
|
54
56
|
this.globe = null;
|
|
55
57
|
this.gl = null;
|
|
@@ -58,7 +60,7 @@ class TimeTrackMultiColorPlugin {
|
|
|
58
60
|
this._tailTime = 0;
|
|
59
61
|
this._data = options.data || null;
|
|
60
62
|
this._options = options;
|
|
61
|
-
this._pointOptions = { opacity, pointSize, isOn };
|
|
63
|
+
this._pointOptions = { opacity: opacity, pointSize: pointSize, isOn: isOn };
|
|
62
64
|
this.program = null;
|
|
63
65
|
this._transporArr = new Float32Array(3);
|
|
64
66
|
this._ready = false;
|
|
@@ -68,97 +70,97 @@ class TimeTrackMultiColorPlugin {
|
|
|
68
70
|
// ----------------------------------
|
|
69
71
|
// --- user methods ---
|
|
70
72
|
// ----------------------------------
|
|
71
|
-
setHeadAndTailTime(headTime, tailTime) {
|
|
73
|
+
TimeTrackMultiColorPlugin.prototype.setHeadAndTailTime = function (headTime, tailTime) {
|
|
72
74
|
var _a;
|
|
73
75
|
this._headTime = headTime;
|
|
74
76
|
this._tailTime = tailTime;
|
|
75
77
|
(_a = this.pointProgram) === null || _a === void 0 ? void 0 : _a.setHeadTime(headTime);
|
|
76
78
|
this.globe.DrawRender();
|
|
77
|
-
}
|
|
78
|
-
setGlow(isGlow) {
|
|
79
|
+
};
|
|
80
|
+
TimeTrackMultiColorPlugin.prototype.setGlow = function (isGlow) {
|
|
79
81
|
this.program.setGlow(isGlow);
|
|
80
82
|
this.globe.DrawRender();
|
|
81
|
-
}
|
|
82
|
-
setPremultipliedAlpha(isPremultiplied) {
|
|
83
|
+
};
|
|
84
|
+
TimeTrackMultiColorPlugin.prototype.setPremultipliedAlpha = function (isPremultiplied) {
|
|
83
85
|
this.program.setPremultipliedAlpha(isPremultiplied);
|
|
84
86
|
this.globe.DrawRender();
|
|
85
|
-
}
|
|
86
|
-
setBlurWeights(weights) {
|
|
87
|
+
};
|
|
88
|
+
TimeTrackMultiColorPlugin.prototype.setBlurWeights = function (weights) {
|
|
87
89
|
this.program.setBlurWeights(weights);
|
|
88
90
|
this.globe.DrawRender();
|
|
89
|
-
}
|
|
90
|
-
setHeadPercentage(headPercentage) {
|
|
91
|
+
};
|
|
92
|
+
TimeTrackMultiColorPlugin.prototype.setHeadPercentage = function (headPercentage) {
|
|
91
93
|
this.program.setHeadPercentage(headPercentage);
|
|
92
94
|
this.globe.DrawRender();
|
|
93
|
-
}
|
|
94
|
-
setRouteAlpha(routeAlpha) {
|
|
95
|
+
};
|
|
96
|
+
TimeTrackMultiColorPlugin.prototype.setRouteAlpha = function (routeAlpha) {
|
|
95
97
|
this.program.setRouteAlpha(routeAlpha);
|
|
96
98
|
this.globe.DrawRender();
|
|
97
|
-
}
|
|
98
|
-
setFinalAlphaRatio(finalAlphaRatio) {
|
|
99
|
+
};
|
|
100
|
+
TimeTrackMultiColorPlugin.prototype.setFinalAlphaRatio = function (finalAlphaRatio) {
|
|
99
101
|
this.program.setFinalAlphaRatio(finalAlphaRatio);
|
|
100
102
|
this.globe.DrawRender();
|
|
101
|
-
}
|
|
102
|
-
setGamma(gamma) {
|
|
103
|
+
};
|
|
104
|
+
TimeTrackMultiColorPlugin.prototype.setGamma = function (gamma) {
|
|
103
105
|
this.program.setGamma(gamma);
|
|
104
106
|
this.globe.DrawRender();
|
|
105
|
-
}
|
|
106
|
-
setExposure(exposure) {
|
|
107
|
+
};
|
|
108
|
+
TimeTrackMultiColorPlugin.prototype.setExposure = function (exposure) {
|
|
107
109
|
this.program.setExposure(exposure);
|
|
108
110
|
this.globe.DrawRender();
|
|
109
|
-
}
|
|
110
|
-
setBlurRepetition(repetition) {
|
|
111
|
+
};
|
|
112
|
+
TimeTrackMultiColorPlugin.prototype.setBlurRepetition = function (repetition) {
|
|
111
113
|
this.program.setBlurRepetition(repetition);
|
|
112
114
|
this.globe.DrawRender();
|
|
113
|
-
}
|
|
114
|
-
setAlphaThreshold(alphaThreshold) {
|
|
115
|
+
};
|
|
116
|
+
TimeTrackMultiColorPlugin.prototype.setAlphaThreshold = function (alphaThreshold) {
|
|
115
117
|
this.program.setAlphaThreshold(alphaThreshold);
|
|
116
118
|
this.globe.DrawRender();
|
|
117
|
-
}
|
|
119
|
+
};
|
|
118
120
|
// ---------------point program setters-------------------
|
|
119
|
-
setPointOpacity(opacity) {
|
|
121
|
+
TimeTrackMultiColorPlugin.prototype.setPointOpacity = function (opacity) {
|
|
120
122
|
this._pointOptions.opacity = opacity;
|
|
121
123
|
if (this.pointProgram) {
|
|
122
124
|
this.pointProgram.setOpacity(opacity);
|
|
123
125
|
this.globe.DrawRender();
|
|
124
126
|
}
|
|
125
|
-
}
|
|
126
|
-
setPointSize(size) {
|
|
127
|
+
};
|
|
128
|
+
TimeTrackMultiColorPlugin.prototype.setPointSize = function (size) {
|
|
127
129
|
this._pointOptions.pointSize = size;
|
|
128
130
|
if (this.pointProgram) {
|
|
129
131
|
this.pointProgram.setPointSize(size);
|
|
130
132
|
this.globe.DrawRender();
|
|
131
133
|
}
|
|
132
|
-
}
|
|
133
|
-
pointSwitch(isOn) {
|
|
134
|
+
};
|
|
135
|
+
TimeTrackMultiColorPlugin.prototype.pointSwitch = function (isOn) {
|
|
134
136
|
if (isOn && !this.pointProgram) {
|
|
135
137
|
this.pointProgram = this._createPointProgram();
|
|
136
138
|
}
|
|
137
139
|
else {
|
|
138
140
|
this._deletePointProgram();
|
|
139
141
|
}
|
|
140
|
-
}
|
|
142
|
+
};
|
|
141
143
|
// ------------------------------------------------------------
|
|
142
|
-
_createPointProgram() {
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
TimeTrackMultiColorPlugin.prototype._createPointProgram = function () {
|
|
145
|
+
var gl = this.gl;
|
|
146
|
+
var program = new programpoint_1.default(gl, this.globe, this._attrBuffer, this._pointOptions);
|
|
145
147
|
program.setDrawCount(this._totalSize / 2);
|
|
146
148
|
return program;
|
|
147
|
-
}
|
|
148
|
-
_deletePointProgram() {
|
|
149
|
+
};
|
|
150
|
+
TimeTrackMultiColorPlugin.prototype._deletePointProgram = function () {
|
|
149
151
|
if (this.pointProgram)
|
|
150
152
|
this.pointProgram.free();
|
|
151
153
|
this.pointProgram = null;
|
|
152
|
-
}
|
|
154
|
+
};
|
|
153
155
|
// -------------------------------------------------------------
|
|
154
|
-
isReady() {
|
|
156
|
+
TimeTrackMultiColorPlugin.prototype.isReady = function () {
|
|
155
157
|
return this._ready;
|
|
156
|
-
}
|
|
158
|
+
};
|
|
157
159
|
/**
|
|
158
160
|
* @param {TimeTrackMultiColorData} data {@link TimeTrackMultiColorData}
|
|
159
161
|
* Check Class constructor
|
|
160
162
|
*/
|
|
161
|
-
setData(data) {
|
|
163
|
+
TimeTrackMultiColorPlugin.prototype.setData = function (data) {
|
|
162
164
|
if (this.gl) {
|
|
163
165
|
this._ready = false;
|
|
164
166
|
this.setDataAsFloat32Array(data);
|
|
@@ -168,14 +170,15 @@ class TimeTrackMultiColorPlugin {
|
|
|
168
170
|
this._data = data;
|
|
169
171
|
this._ready = false;
|
|
170
172
|
}
|
|
171
|
-
}
|
|
173
|
+
};
|
|
172
174
|
/**
|
|
173
175
|
* @param {TimeTrackMultiColorData} data {@link TimeTrackMultiColorData}
|
|
174
176
|
* @param {number} totalSize | if not provided, it is calculated from float32Array.length / 9. Use if you want to draw first n points.
|
|
175
177
|
*/
|
|
176
|
-
setDataAsFloat32Array(data, totalSize
|
|
178
|
+
TimeTrackMultiColorPlugin.prototype.setDataAsFloat32Array = function (data, totalSize) {
|
|
177
179
|
var _a;
|
|
178
|
-
|
|
180
|
+
if (totalSize === void 0) { totalSize = null; }
|
|
181
|
+
var _b = this, gl = _b.gl, _attrBuffer = _b._attrBuffer;
|
|
179
182
|
gl.bindBuffer(gl.ARRAY_BUFFER, _attrBuffer);
|
|
180
183
|
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
|
|
181
184
|
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
@@ -190,36 +193,36 @@ class TimeTrackMultiColorPlugin {
|
|
|
190
193
|
this.program.setTotalLength(this._totalSize);
|
|
191
194
|
(_a = this.pointProgram) === null || _a === void 0 ? void 0 : _a.setDrawCount(this._totalSize / 2);
|
|
192
195
|
this._ready = true;
|
|
193
|
-
}
|
|
196
|
+
};
|
|
194
197
|
// ------------------------------
|
|
195
198
|
// --- globe Methods ---
|
|
196
199
|
// ------------------------------
|
|
197
|
-
draw3D(projMatrix, modelviewMatrix, transPos) {
|
|
200
|
+
TimeTrackMultiColorPlugin.prototype.draw3D = function (projMatrix, modelviewMatrix, transPos) {
|
|
198
201
|
var _a;
|
|
199
202
|
if (!this._ready)
|
|
200
203
|
return;
|
|
201
|
-
|
|
204
|
+
var _b = this, _headTime = _b._headTime, _tailTime = _b._tailTime, program = _b.program, _transporArr = _b._transporArr, globe = _b.globe;
|
|
202
205
|
(_a = this.pointProgram) === null || _a === void 0 ? void 0 : _a.draw();
|
|
203
206
|
_transporArr.set([transPos.x, transPos.y, transPos.z], 0);
|
|
204
|
-
|
|
207
|
+
var geomType = globe.api_GetCurrentGeometry();
|
|
205
208
|
if (geomType === 0) {
|
|
206
209
|
program.draw(_headTime, _tailTime, projMatrix, modelviewMatrix, _transporArr);
|
|
207
210
|
}
|
|
208
211
|
else if (geomType === 1) {
|
|
209
|
-
|
|
212
|
+
var _c = globe.api_GetCurrentWorldWH(), width = _c.width, height = _c.height;
|
|
210
213
|
program.draw(_headTime, _tailTime, projMatrix, modelviewMatrix, _transporArr, [width, height]);
|
|
211
214
|
}
|
|
212
215
|
else {
|
|
213
216
|
console.error("Unknown geometry type", geomType);
|
|
214
217
|
}
|
|
215
|
-
}
|
|
216
|
-
resize(width, height) {
|
|
217
|
-
|
|
218
|
+
};
|
|
219
|
+
TimeTrackMultiColorPlugin.prototype.resize = function (width, height) {
|
|
220
|
+
var _a = this, program = _a.program, globe = _a.globe;
|
|
218
221
|
width = width || globe.api_ScrW();
|
|
219
222
|
height = height || globe.api_ScrH();
|
|
220
223
|
program.resize(width, height);
|
|
221
|
-
}
|
|
222
|
-
init(globe, gl) {
|
|
224
|
+
};
|
|
225
|
+
TimeTrackMultiColorPlugin.prototype.init = function (globe, gl) {
|
|
223
226
|
var _a;
|
|
224
227
|
this.globe = globe;
|
|
225
228
|
this.gl = gl;
|
|
@@ -235,24 +238,25 @@ class TimeTrackMultiColorPlugin {
|
|
|
235
238
|
this._data = null;
|
|
236
239
|
}
|
|
237
240
|
this.resize();
|
|
238
|
-
}
|
|
239
|
-
free() {
|
|
240
|
-
|
|
241
|
+
};
|
|
242
|
+
TimeTrackMultiColorPlugin.prototype.free = function () {
|
|
243
|
+
var _a = this, gl = _a.gl, _attrBuffer = _a._attrBuffer;
|
|
241
244
|
this.program.free();
|
|
242
245
|
gl.deleteBuffer(_attrBuffer);
|
|
243
|
-
}
|
|
244
|
-
setGeometry() {
|
|
245
|
-
|
|
246
|
+
};
|
|
247
|
+
TimeTrackMultiColorPlugin.prototype.setGeometry = function () {
|
|
248
|
+
var _a = this, globe = _a.globe, program = _a.program;
|
|
246
249
|
program.setIs3D(globe.api_GetCurrentGeometry() === 0);
|
|
247
|
-
}
|
|
250
|
+
};
|
|
248
251
|
// ----------------------------------
|
|
249
252
|
// --- implicit methods ---
|
|
250
253
|
// ----------------------------------
|
|
251
|
-
_latLongToPixelXY(latitude, longitude) {
|
|
254
|
+
TimeTrackMultiColorPlugin.prototype._latLongToPixelXY = function (latitude, longitude) {
|
|
252
255
|
return {
|
|
253
256
|
x: (longitude + 180) / 360,
|
|
254
257
|
y: (90 - latitude) / 180
|
|
255
258
|
};
|
|
256
|
-
}
|
|
257
|
-
|
|
259
|
+
};
|
|
260
|
+
return TimeTrackMultiColorPlugin;
|
|
261
|
+
}());
|
|
258
262
|
exports.default = TimeTrackMultiColorPlugin;
|