@pirireis/webglobeplugins 0.9.12 → 0.9.14
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/partialrings/program.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.programCache = exports.Logic = exports.ITEM_SIZE = void 0;
|
|
7
|
-
const util_1 = require("../util");
|
|
8
|
-
const programs_1 = require("../programs");
|
|
9
|
-
const buffer_manager_1 = __importDefault(require("./buffer-manager"));
|
|
10
|
-
const geometrytransformations_1 = require("../util/shaderfunctions/geometrytransformations");
|
|
1
|
+
import { createProgram, shaderfunctions } from "../util";
|
|
2
|
+
import { CameraUniformBlockTotem, CameraUniformBlockString, noRegisterGlobeProgramCache, globeProgramCache } from "../programs";
|
|
3
|
+
import BufferManager from "./buffer-manager";
|
|
4
|
+
import { POLE, PI, longLatRadToMercator, mercatorXYToGLPosition, longLatRadToCartesian3D, circleLimpFromLongLatRadCenterCartesian3D, circleLimpFromLongLatRadCenterMercatorRealDistance, cartesian3DToGLPosition } from "../util/shaderfunctions/geometrytransformations";
|
|
11
5
|
/**
|
|
12
6
|
* TODO:
|
|
13
7
|
* 1. Triangle face looks at screen. if rotation angle is positive the last vertex must be the faintest.
|
|
@@ -19,14 +13,14 @@ const drawModeMap = Object.freeze({
|
|
|
19
13
|
});
|
|
20
14
|
const vertexShaderSource = `#version 300 es
|
|
21
15
|
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
16
|
+
${CameraUniformBlockString}
|
|
17
|
+
${PI}
|
|
18
|
+
${longLatRadToMercator}
|
|
19
|
+
${mercatorXYToGLPosition}
|
|
20
|
+
${longLatRadToCartesian3D}
|
|
21
|
+
${circleLimpFromLongLatRadCenterCartesian3D}
|
|
22
|
+
${circleLimpFromLongLatRadCenterMercatorRealDistance}
|
|
23
|
+
${cartesian3DToGLPosition}
|
|
30
24
|
|
|
31
25
|
uniform float edge_count;
|
|
32
26
|
uniform int draw_mode; // %2 => 0: LINE_STRIP, 1: TRIANGLE_FAN
|
|
@@ -95,7 +89,7 @@ void main() {
|
|
|
95
89
|
|
|
96
90
|
gl_PointSize = 10.0;
|
|
97
91
|
}`;
|
|
98
|
-
const fragmentShaderSource = `#version 300 es` +
|
|
92
|
+
const fragmentShaderSource = `#version 300 es` + POLE + PI + `
|
|
99
93
|
precision highp float;
|
|
100
94
|
// flat in int vid;
|
|
101
95
|
in vec4 v_color;
|
|
@@ -110,15 +104,15 @@ void main() {
|
|
|
110
104
|
if ( v_pos.x < -POLE || v_pos.x > POLE || v_pos.y < -POLE || v_pos.y > POLE ) { discard; }
|
|
111
105
|
outColor = v_color;
|
|
112
106
|
}`;
|
|
113
|
-
|
|
114
|
-
class Logic {
|
|
107
|
+
export const ITEM_SIZE = 10;
|
|
108
|
+
export class Logic {
|
|
115
109
|
constructor(globe) {
|
|
116
110
|
this.globe = globe;
|
|
117
111
|
this.gl = globe.gl;
|
|
118
112
|
this._lastMode = 0;
|
|
119
113
|
this._lastEdgeCount = 64;
|
|
120
114
|
this._lastAlphaMultiplier = 1.0;
|
|
121
|
-
this.program =
|
|
115
|
+
this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
|
|
122
116
|
const { gl, program } = this;
|
|
123
117
|
{ // set attributes locations
|
|
124
118
|
gl.bindAttribLocation(program, 0, 'center');
|
|
@@ -140,7 +134,7 @@ class Logic {
|
|
|
140
134
|
gl.uniform1f(this._edgeCountLocation, this._lastEdgeCount);
|
|
141
135
|
gl.uniform1f(this._plugin_alpha_multiplierLocation, 1.0);
|
|
142
136
|
this.cameraBlockBindingPoint = 0;
|
|
143
|
-
this.cameraBlockTotem =
|
|
137
|
+
this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
144
138
|
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
145
139
|
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
146
140
|
gl.useProgram(currentProgram);
|
|
@@ -171,7 +165,7 @@ class Logic {
|
|
|
171
165
|
// gl.enable(gl.DEPTH_TEST);
|
|
172
166
|
}
|
|
173
167
|
free() {
|
|
174
|
-
|
|
168
|
+
noRegisterGlobeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
175
169
|
this.gl.deleteProgram(this.program);
|
|
176
170
|
this.program = null;
|
|
177
171
|
}
|
|
@@ -181,7 +175,7 @@ class Logic {
|
|
|
181
175
|
const buffer = gl.createBuffer();
|
|
182
176
|
gl.bindVertexArray(vao);
|
|
183
177
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
184
|
-
const stride =
|
|
178
|
+
const stride = ITEM_SIZE * 4;
|
|
185
179
|
let offset = 0;
|
|
186
180
|
gl.enableVertexAttribArray(0);
|
|
187
181
|
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
|
|
@@ -274,13 +268,12 @@ in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
|
|
|
274
268
|
getBufferManagerAndVao({ capacity = 10, bufferType = "DYNAMIC_DRAW" } = {}) {
|
|
275
269
|
const { vao, buffer } = this.getVaoBuffer();
|
|
276
270
|
return {
|
|
277
|
-
bufferManager: new
|
|
271
|
+
bufferManager: new BufferManager(this.globe, this.gl, buffer, { capacity, bufferType }),
|
|
278
272
|
vao
|
|
279
273
|
};
|
|
280
274
|
}
|
|
281
275
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
release: (globe) => programs_1.noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
|
|
276
|
+
export const programCache = Object.freeze({
|
|
277
|
+
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
|
|
278
|
+
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
|
|
286
279
|
});
|
package/pin/pin-object-array.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* IconData;
|
|
4
3
|
* iconMap, iconCoords for objectArray
|
|
@@ -17,12 +16,8 @@
|
|
|
17
16
|
* keyboard clicks
|
|
18
17
|
* mouse curser changes ( this can be implemented inside above methods)
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
const webglobe_1 = require("@pirireis/webglobe");
|
|
25
|
-
const AlarmTimeLineFadeInFadeOutPlugin_1 = __importDefault(require("../../plugins/alarms/alarmFadeInFadeOutPlugin/AlarmTimeLineFadeInFadeOutPlugin"));
|
|
19
|
+
import { CSGlobe, CSIconTypes, CSObjectTypes, CSObjectArrayUpdateTypes, } from "@pirireis/webglobe";
|
|
20
|
+
import AlarmTimeLineFadeInFadeOut from "../../plugins/alarms/alarmFadeInFadeOutPlugin/AlarmTimeLineFadeInFadeOutPlugin";
|
|
26
21
|
/**
|
|
27
22
|
* @typedef {Object} IconPayload
|
|
28
23
|
* @property {string} app6DCode
|
|
@@ -141,7 +136,7 @@ class ObjectArrayLabels {
|
|
|
141
136
|
},
|
|
142
137
|
];
|
|
143
138
|
this.primaryKey = "id";
|
|
144
|
-
this.objectType =
|
|
139
|
+
this.objectType = CSObjectTypes.POINT;
|
|
145
140
|
this.filter = null;
|
|
146
141
|
this.bbox = null;
|
|
147
142
|
this.startLod = 2;
|
|
@@ -169,7 +164,7 @@ class ObjectArrayLabels {
|
|
|
169
164
|
}
|
|
170
165
|
this.style.labels[0].text = "${value}";
|
|
171
166
|
this.style.fidKey = this.primaryKey;
|
|
172
|
-
this.style.iconType =
|
|
167
|
+
this.style.iconType = CSIconTypes.NOICON; // milIcon ekleyebilmek için icon tipi MAP olmalı
|
|
173
168
|
}
|
|
174
169
|
/**
|
|
175
170
|
* @param {CSGlobe} [globe]
|
|
@@ -280,13 +275,13 @@ class ObjectArrayLabels {
|
|
|
280
275
|
}
|
|
281
276
|
});
|
|
282
277
|
if (paritalData.add.coords.length > 0) {
|
|
283
|
-
this.updateData(paritalData.add,
|
|
278
|
+
this.updateData(paritalData.add, CSObjectArrayUpdateTypes.ADD);
|
|
284
279
|
}
|
|
285
280
|
if (paritalData.update.coords.length > 0) {
|
|
286
|
-
this.updateData(paritalData.update,
|
|
281
|
+
this.updateData(paritalData.update, CSObjectArrayUpdateTypes.UPDATE, paritalData.canChange);
|
|
287
282
|
}
|
|
288
283
|
if (paritalData.delete.coords.length > 0) {
|
|
289
|
-
this.updateData(paritalData.delete,
|
|
284
|
+
this.updateData(paritalData.delete, CSObjectArrayUpdateTypes.DELETE);
|
|
290
285
|
}
|
|
291
286
|
}
|
|
292
287
|
setPrimarykey(key) {
|
|
@@ -302,4 +297,4 @@ class ObjectArrayLabels {
|
|
|
302
297
|
this.style.labels[0] = style;
|
|
303
298
|
}
|
|
304
299
|
}
|
|
305
|
-
|
|
300
|
+
export default ObjectArrayLabels;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
|
|
4
3
|
* TimeTrackMultiColorData is [
|
|
@@ -12,8 +11,6 @@
|
|
|
12
11
|
* there is a cutting point between A and B
|
|
13
12
|
*
|
|
14
13
|
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.timeTrackPluginDataToPointHeatInterpolatorAdapter = void 0;
|
|
17
14
|
/**
|
|
18
15
|
* ABOVE
|
|
19
16
|
* TO
|
|
@@ -32,11 +29,11 @@ exports.timeTrackPluginDataToPointHeatInterpolatorAdapter = void 0;
|
|
|
32
29
|
* @property {Array<Number>} times
|
|
33
30
|
* @param {Array<Timetrack>} timeTracks
|
|
34
31
|
*/
|
|
35
|
-
|
|
32
|
+
import { pixelXYLenghtToUnitVectorWithHeight } from "../../Math/methods";
|
|
36
33
|
const processACut = (array, offset) => {
|
|
37
34
|
// first 3 values of array
|
|
38
35
|
const v3 = array.slice(offset, offset + 3);
|
|
39
|
-
const v4 =
|
|
36
|
+
const v4 = pixelXYLenghtToUnitVectorWithHeight(v3);
|
|
40
37
|
const time = array[offset + 3];
|
|
41
38
|
return [v4, time];
|
|
42
39
|
};
|
|
@@ -63,4 +60,4 @@ const timeTrackPluginDataToPointHeatInterpolatorAdapter = (timeTrackPluginData)
|
|
|
63
60
|
}
|
|
64
61
|
return timeTracks;
|
|
65
62
|
};
|
|
66
|
-
|
|
63
|
+
export { timeTrackPluginDataToPointHeatInterpolatorAdapter };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PointHeatmapPlugin = void 0;
|
|
4
|
-
const point_to_heat_map_flow_1 = require("./point-to-heat-map-flow");
|
|
1
|
+
import { PointHeatmapFlow } from "./point-to-heat-map-flow";
|
|
5
2
|
// import { webworkerStr } from "../util/interpolation/timetrack/web-worker-str"; // TODO: Delete When this plugin is tested on production
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { createWorker } from "../util/interpolation/timetrack/index";
|
|
4
|
+
import { createTexture, getColorRampModed } from "../util";
|
|
5
|
+
import { opacityCheck, constraintFloat } from "../util/check/typecheck";
|
|
9
6
|
class PointHeatmapPlugin {
|
|
10
7
|
constructor(id, { opacity = 1.0, pointSize = 5.0, onInterpolationComplete = () => { } } = {}) {
|
|
11
8
|
this.id = id;
|
|
@@ -20,7 +17,7 @@ class PointHeatmapPlugin {
|
|
|
20
17
|
this._timeTracksAreSet = false;
|
|
21
18
|
// const blob = new Blob([webworkerStr], { type: 'application/javascript' });
|
|
22
19
|
// this.timeTrackInterpolationWorker = new Worker(URL.createObjectURL(blob), { type: 'module' });
|
|
23
|
-
this.timeTrackInterpolationWorker =
|
|
20
|
+
this.timeTrackInterpolationWorker = createWorker();
|
|
24
21
|
this.timeTrackInterpolationWorker.onmessage = (e) => {
|
|
25
22
|
if (e.data.error) {
|
|
26
23
|
throw new Error(e.data.error);
|
|
@@ -39,12 +36,12 @@ class PointHeatmapPlugin {
|
|
|
39
36
|
init(globe, gl) {
|
|
40
37
|
this.globe = globe;
|
|
41
38
|
this.gl = gl;
|
|
42
|
-
this.flow = new
|
|
39
|
+
this.flow = new PointHeatmapFlow(globe);
|
|
43
40
|
this.setGeometry();
|
|
44
41
|
this.resize();
|
|
45
42
|
}
|
|
46
43
|
setPointSize(pointSize) {
|
|
47
|
-
|
|
44
|
+
constraintFloat(pointSize, 1);
|
|
48
45
|
this._pointSize = pointSize;
|
|
49
46
|
this.globe.DrawRender();
|
|
50
47
|
}
|
|
@@ -58,8 +55,8 @@ class PointHeatmapPlugin {
|
|
|
58
55
|
throw new Error('Plugin not initialized');
|
|
59
56
|
}
|
|
60
57
|
;
|
|
61
|
-
const rampData =
|
|
62
|
-
const texture =
|
|
58
|
+
const rampData = getColorRampModed(values, thresholds, mode);
|
|
59
|
+
const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
|
|
63
60
|
if (this._legendTexture) {
|
|
64
61
|
this.gl.deleteTexture(this._legendTexture);
|
|
65
62
|
}
|
|
@@ -84,7 +81,7 @@ class PointHeatmapPlugin {
|
|
|
84
81
|
this.globe.DrawRender();
|
|
85
82
|
}
|
|
86
83
|
setOpacity(opacity) {
|
|
87
|
-
|
|
84
|
+
opacityCheck(opacity);
|
|
88
85
|
this._opacity = opacity;
|
|
89
86
|
this.globe.DrawRender();
|
|
90
87
|
}
|
|
@@ -123,4 +120,4 @@ class PointHeatmapPlugin {
|
|
|
123
120
|
this.timeTrackInterpolationWorker = null;
|
|
124
121
|
}
|
|
125
122
|
}
|
|
126
|
-
|
|
123
|
+
export { PointHeatmapPlugin };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.PointHeatmapFlow = void 0;
|
|
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");
|
|
1
|
+
import { densityToLegendProgramCache } from "../programs/data2legend/density-to-legend";
|
|
2
|
+
import { pointToDensityTextureCache } from "../programs/data2legend/point-to-density-texture";
|
|
6
3
|
// import { textureOnCanvasProgramCache } from "../util/programs/draw-texture-on-canvas";
|
|
7
|
-
|
|
4
|
+
import { defaultblendfunction } from "../util/webglobe/gldefaultstates";
|
|
8
5
|
class PointHeatmapFlow {
|
|
9
6
|
constructor(globe) {
|
|
10
7
|
this.globe = null;
|
|
@@ -13,8 +10,8 @@ class PointHeatmapFlow {
|
|
|
13
10
|
this.densityToLegendProgram = null;
|
|
14
11
|
this.globe = globe;
|
|
15
12
|
this.gl = globe.gl;
|
|
16
|
-
this.pointToDensityProgram =
|
|
17
|
-
this.densityToLegendProgram =
|
|
13
|
+
this.pointToDensityProgram = pointToDensityTextureCache.get(globe);
|
|
14
|
+
this.densityToLegendProgram = densityToLegendProgramCache.get(globe);
|
|
18
15
|
// this.testTextureProgram = textureOnCanvasProgramCache.get(globe.gl);
|
|
19
16
|
this._lookInfo = globe.api_GetCurrentLookInfo();
|
|
20
17
|
const { gl } = this;
|
|
@@ -45,7 +42,7 @@ class PointHeatmapFlow {
|
|
|
45
42
|
this._drawDensity(pointSize);
|
|
46
43
|
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
47
44
|
}
|
|
48
|
-
|
|
45
|
+
defaultblendfunction(gl);
|
|
49
46
|
this._drawLegend(legendTexture, opacity);
|
|
50
47
|
}
|
|
51
48
|
resize() {
|
|
@@ -114,8 +111,8 @@ class PointHeatmapFlow {
|
|
|
114
111
|
if (this._isFreed)
|
|
115
112
|
return;
|
|
116
113
|
this._isFreed = true;
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
densityToLegendProgramCache.release(this.globe);
|
|
115
|
+
pointToDensityTextureCache.release(this.globe);
|
|
119
116
|
// textureOnCanvasProgramCache.release(this.gl);
|
|
120
117
|
this.gl.deleteTexture(this.densityTexture);
|
|
121
118
|
this.gl.deleteFramebuffer(this.framebuffer);
|
|
@@ -124,4 +121,4 @@ class PointHeatmapFlow {
|
|
|
124
121
|
this.gl.deleteVertexArray(this.vao3D);
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
|
-
|
|
124
|
+
export { PointHeatmapFlow };
|
package/point-tracks/plugin.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const picker_displayer_1 = require("../util/picking/picker-displayer");
|
|
6
|
-
const square_pixel_point_1 = require("../programs/point-on-globe/square-pixel-point");
|
|
7
|
-
const methods_1 = require("../Math/methods");
|
|
1
|
+
import { BufferOrchestrator, BufferManager, ObjectStore } from "../util/account";
|
|
2
|
+
import { PickerDisplayer } from "../util/picking/picker-displayer";
|
|
3
|
+
import { PointOnGlobeProgramCache } from "../programs/point-on-globe/square-pixel-point";
|
|
4
|
+
import { wgs84ToCartesian3d, wgs84ToMercator } from "../Math/methods";
|
|
8
5
|
/**
|
|
9
6
|
* @typedef {number} long
|
|
10
7
|
* @typedef {number} lat
|
|
@@ -40,8 +37,8 @@ class PointTracksPlugin {
|
|
|
40
37
|
init(globe, gl) {
|
|
41
38
|
this.globe = globe;
|
|
42
39
|
this.gl = gl;
|
|
43
|
-
this._pickerDisplayer = new
|
|
44
|
-
this._pointProgram =
|
|
40
|
+
this._pickerDisplayer = new PickerDisplayer(globe);
|
|
41
|
+
this._pointProgram = PointOnGlobeProgramCache.get(globe);
|
|
45
42
|
this._focusParams.elementBuffer = gl.createBuffer();
|
|
46
43
|
this._initBufferManagers();
|
|
47
44
|
}
|
|
@@ -49,22 +46,22 @@ class PointTracksPlugin {
|
|
|
49
46
|
const { gl } = this;
|
|
50
47
|
const initialCapacity = 10;
|
|
51
48
|
const bufferType = "DYNAMIC_DRAW";
|
|
52
|
-
this._bufferOrchestrator = new
|
|
49
|
+
this._bufferOrchestrator = new BufferOrchestrator({ initialCapacity });
|
|
53
50
|
this._bufferManagersMap = new Map([
|
|
54
51
|
["pos3D", {
|
|
55
|
-
bufferManager: new
|
|
56
|
-
adaptor: (item) => new Float32Array(
|
|
52
|
+
bufferManager: new BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
53
|
+
adaptor: (item) => new Float32Array(wgs84ToCartesian3d(item.long, item.lat, item.height / 1000)) // height is in meters
|
|
57
54
|
}],
|
|
58
55
|
["pos2D", {
|
|
59
|
-
bufferManager: new
|
|
60
|
-
adaptor: (item) => new Float32Array(
|
|
56
|
+
bufferManager: new BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
57
|
+
adaptor: (item) => new Float32Array(wgs84ToMercator(item.long, item.lat))
|
|
61
58
|
}],
|
|
62
59
|
["rgba", {
|
|
63
|
-
bufferManager: new
|
|
60
|
+
bufferManager: new BufferManager(gl, 4, { bufferType, initialCapacity }),
|
|
64
61
|
adaptor: (item) => item.rgba
|
|
65
62
|
}],
|
|
66
63
|
["objectStore", {
|
|
67
|
-
bufferManager: new
|
|
64
|
+
bufferManager: new ObjectStore({ initialCapacity }),
|
|
68
65
|
adaptor: (item) => {
|
|
69
66
|
return {
|
|
70
67
|
trackID: item.trackID, pointID: item.pointID
|
|
@@ -194,7 +191,7 @@ class PointTracksPlugin {
|
|
|
194
191
|
return;
|
|
195
192
|
this._isFreed = true;
|
|
196
193
|
this._pickerDisplayer.free();
|
|
197
|
-
|
|
194
|
+
PointOnGlobeProgramCache.release(this.globe);
|
|
198
195
|
this.gl.deleteBuffer(this._focusParams.elementBuffer);
|
|
199
196
|
this._bufferManagersMap.forEach(({ bufferManager, adaptor }) => bufferManager.free());
|
|
200
197
|
}
|
|
@@ -305,7 +302,6 @@ class PointTracksPlugin {
|
|
|
305
302
|
return true;
|
|
306
303
|
}
|
|
307
304
|
}
|
|
308
|
-
exports.PointTracksPlugin = PointTracksPlugin;
|
|
309
305
|
const trackToFlatPoints = (track) => {
|
|
310
306
|
const trackID = track.trackID;
|
|
311
307
|
const points = track.points;
|
|
@@ -325,4 +321,4 @@ const trackToFlatPoints = (track) => {
|
|
|
325
321
|
return flatPoints;
|
|
326
322
|
};
|
|
327
323
|
const keyMethod = (trackID, pointID) => `${trackID}_${pointID}`;
|
|
328
|
-
|
|
324
|
+
export { PointTracksPlugin, keyMethod };
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const object_1 = __importDefault(require("./object"));
|
|
7
|
-
exports.default = object_1.default;
|
|
1
|
+
import ArrowField from './object';
|
|
2
|
+
export default ArrowField;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const programcache_1 = require("../programcache");
|
|
5
|
-
const totems_1 = require("../totems");
|
|
1
|
+
import { createProgram } from "../../util";
|
|
2
|
+
import { globeProgramCache } from "../programcache";
|
|
3
|
+
import { CameraUniformBlockTotem } from "../totems";
|
|
6
4
|
const arrowVertexShader = `#version 300 es
|
|
7
5
|
#define R 6378.137
|
|
8
6
|
#define PI 3.1415926535897932384626433832795
|
|
@@ -118,7 +116,7 @@ void main() {
|
|
|
118
116
|
outColor = v_color;
|
|
119
117
|
}
|
|
120
118
|
`;
|
|
121
|
-
class ArrowFieldLogic {
|
|
119
|
+
export default class ArrowFieldLogic {
|
|
122
120
|
constructor() {
|
|
123
121
|
this.gl = null;
|
|
124
122
|
this.globe = null;
|
|
@@ -130,12 +128,12 @@ class ArrowFieldLogic {
|
|
|
130
128
|
init(globe, gl) {
|
|
131
129
|
this.gl = gl;
|
|
132
130
|
this.globe = globe;
|
|
133
|
-
this.cameraUniformBlockTotem =
|
|
131
|
+
this.cameraUniformBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
134
132
|
this.program = this._createProgram();
|
|
135
133
|
}
|
|
136
134
|
_createProgram() {
|
|
137
135
|
const gl = this.gl;
|
|
138
|
-
const program =
|
|
136
|
+
const program = createProgram(gl, arrowVertexShader, arrowFragmentShader);
|
|
139
137
|
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraBlock");
|
|
140
138
|
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
141
139
|
const arrowBlockIndex = gl.getUniformBlockIndex(program, "ArrowBlock");
|
|
@@ -167,10 +165,9 @@ class ArrowFieldLogic {
|
|
|
167
165
|
free() {
|
|
168
166
|
const { gl, program } = this;
|
|
169
167
|
gl.deleteProgram(program);
|
|
170
|
-
|
|
168
|
+
globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
171
169
|
}
|
|
172
170
|
}
|
|
173
|
-
exports.default = ArrowFieldLogic;
|
|
174
171
|
class ArrowBlockBufferManager {
|
|
175
172
|
constructor(gl, bindingPoint) {
|
|
176
173
|
this.gl = gl;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// this contains vao, drawCount, ArrowBufferBlock, vao,
|
|
3
2
|
// how to, where to set instanced parameters
|
|
4
3
|
// the vectorfield buffer should be managed outside, since it can be static or dynamic.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const logic_1 = __importDefault(require("./logic"));
|
|
10
|
-
const programcache_1 = require("../programcache");
|
|
11
|
-
const util_1 = require("../util");
|
|
12
|
-
class ArrowField {
|
|
4
|
+
import Logic from './logic';
|
|
5
|
+
import { globeProgramCache } from '../programcache';
|
|
6
|
+
import { longlatbbox2normalbbox } from "../util";
|
|
7
|
+
export default class ArrowField {
|
|
13
8
|
constructor(gl, globe, { minLon = -180, maxLon = 180, minLat = -90, maxLat = 90, height = 0, opacity = 1, color = [0.04, 0.2, 0.8], targetWidth = 100, targetHeight = 100, dataWidth = null, dataHeight = null, tailLengthRatio = 1, wingLengthRatio = 0.5, noDataValue = null,
|
|
14
9
|
// maxMagnitude = null
|
|
15
10
|
} = {}) {
|
|
16
11
|
this.gl = gl;
|
|
17
12
|
this.globe = globe;
|
|
18
|
-
this.program =
|
|
13
|
+
this.program = globeProgramCache.getProgram(globe, Logic);
|
|
19
14
|
this.arrowBlockManager = this.program.getArrowBlockBufferManager();
|
|
20
15
|
this.instanceCount = targetWidth * targetHeight;
|
|
21
16
|
this.arrowBlockManager.update({ resolution: [targetWidth, targetHeight] });
|
|
@@ -25,7 +20,7 @@ class ArrowField {
|
|
|
25
20
|
}
|
|
26
21
|
setBBox({ minLon = -180, maxLon = 180, minLat = -90, maxLat = 90 } = {}) {
|
|
27
22
|
this.bbox = { minLon, maxLon, minLat, maxLat };
|
|
28
|
-
const { bboxSizeRad, bboxOffsetRad } =
|
|
23
|
+
const { bboxSizeRad, bboxOffsetRad } = longlatbbox2normalbbox(this.bbox);
|
|
29
24
|
this.arrowBlockManager.update({ bboxSizeRad, bboxOffsetRad });
|
|
30
25
|
this.globe.DrawRender();
|
|
31
26
|
}
|
|
@@ -60,7 +55,6 @@ class ArrowField {
|
|
|
60
55
|
free() {
|
|
61
56
|
this.arrowBlockManager.free();
|
|
62
57
|
this.textureManager.free();
|
|
63
|
-
|
|
58
|
+
globeProgramCache.releaseProgram(this.gl, Logic);
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
exports.default = ArrowField;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.densityToLegendProgramCache = void 0;
|
|
4
|
-
const util_1 = require("../../util/");
|
|
5
|
-
const programcache_1 = require("../programcache");
|
|
1
|
+
import { createProgram } from "../../util/";
|
|
2
|
+
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
6
3
|
const vs = `#version 300 es
|
|
7
4
|
precision highp float;
|
|
8
5
|
|
|
@@ -34,7 +31,7 @@ class DensityToLegendProgram {
|
|
|
34
31
|
constructor(globe) {
|
|
35
32
|
this.globe = globe;
|
|
36
33
|
this.gl = globe.gl;
|
|
37
|
-
this.program =
|
|
34
|
+
this.program = createProgram(globe.gl, vs, fs);
|
|
38
35
|
const { gl, program } = this;
|
|
39
36
|
this.uniforms = {
|
|
40
37
|
densityTexture: gl.getUniformLocation(program, "u_density_texture"),
|
|
@@ -95,7 +92,7 @@ class DensityToLegendProgram {
|
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
94
|
const densityToLegendProgramCache = {
|
|
98
|
-
get: (globe) =>
|
|
99
|
-
release: (globe) =>
|
|
95
|
+
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, DensityToLegendProgram),
|
|
96
|
+
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, DensityToLegendProgram)
|
|
100
97
|
};
|
|
101
|
-
|
|
98
|
+
export { densityToLegendProgramCache };
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const programcache_1 = require("../programcache");
|
|
6
|
-
const camerauniformblock_1 = require("../totems/camerauniformblock");
|
|
7
|
-
const geometrytransformations_1 = require("../../util/shaderfunctions/geometrytransformations");
|
|
1
|
+
import { createProgram } from "../../util/";
|
|
2
|
+
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
3
|
+
import { CameraUniformBlockTotemCache, CameraUniformBlockString } from "../totems/camerauniformblock";
|
|
4
|
+
import { mercatorXYToGLPosition, cartesian3DToGLPosition } from "../../util/shaderfunctions/geometrytransformations";
|
|
8
5
|
const vs = `#version 300 es
|
|
9
6
|
precision highp float;
|
|
10
7
|
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
8
|
+
${CameraUniformBlockString}
|
|
9
|
+
${mercatorXYToGLPosition}
|
|
10
|
+
${cartesian3DToGLPosition}
|
|
14
11
|
|
|
15
12
|
in vec3 position;
|
|
16
13
|
uniform float pointSize;
|
|
@@ -39,7 +36,7 @@ class PointHeatmapProgram {
|
|
|
39
36
|
this.globe = globe;
|
|
40
37
|
this.gl = globe.gl;
|
|
41
38
|
this._isFreed = false;
|
|
42
|
-
this.program =
|
|
39
|
+
this.program = createProgram(globe.gl, vs, fs);
|
|
43
40
|
const { gl, program } = this;
|
|
44
41
|
this.uniforms = {
|
|
45
42
|
pointSize: gl.getUniformLocation(this.program, "pointSize"),
|
|
@@ -49,7 +46,7 @@ class PointHeatmapProgram {
|
|
|
49
46
|
}
|
|
50
47
|
{ // arrange camera uniform block
|
|
51
48
|
this.cameraBlockBingingPoint = 0;
|
|
52
|
-
this.cameraBlockTotem =
|
|
49
|
+
this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
|
|
53
50
|
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
54
51
|
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBingingPoint);
|
|
55
52
|
}
|
|
@@ -88,13 +85,13 @@ class PointHeatmapProgram {
|
|
|
88
85
|
if (this._isFreed)
|
|
89
86
|
return;
|
|
90
87
|
const { gl, globe } = this;
|
|
91
|
-
|
|
88
|
+
CameraUniformBlockTotemCache.release(globe);
|
|
92
89
|
gl.deleteProgram(this.program);
|
|
93
90
|
this._isFreed = true;
|
|
94
91
|
}
|
|
95
92
|
}
|
|
96
93
|
const pointToDensityTextureCache = {
|
|
97
|
-
get: (globe) =>
|
|
98
|
-
release: (globe) =>
|
|
94
|
+
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, PointHeatmapProgram),
|
|
95
|
+
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, PointHeatmapProgram)
|
|
99
96
|
};
|
|
100
|
-
|
|
97
|
+
export { pointToDensityTextureCache };
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Float2LegendWithRatio = void 0;
|
|
7
|
-
const object_1 = __importDefault(require("./object"));
|
|
8
|
-
exports.Float2LegendWithRatio = object_1.default;
|
|
1
|
+
import Float2LegendWithRatio from './object';
|
|
2
|
+
export { Float2LegendWithRatio };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const util_1 = require("../../util");
|
|
4
|
-
class default_1 {
|
|
1
|
+
import { createProgram } from "../../util";
|
|
2
|
+
export default class {
|
|
5
3
|
constructor(gl) {
|
|
6
4
|
this.gl = gl;
|
|
7
5
|
// console.log("Float2LegendWithRatioProgram gl:", gl);
|
|
@@ -63,7 +61,7 @@ class default_1 {
|
|
|
63
61
|
}
|
|
64
62
|
`;
|
|
65
63
|
const gl = this.gl;
|
|
66
|
-
const program =
|
|
64
|
+
const program = createProgram(gl, vertexShaderSource, fragmentShaderSource);
|
|
67
65
|
const vao = gl.createVertexArray();
|
|
68
66
|
gl.bindVertexArray(vao);
|
|
69
67
|
const buffer = gl.createBuffer();
|
|
@@ -125,7 +123,6 @@ class default_1 {
|
|
|
125
123
|
gl.deleteVertexArray(this.programWrapper.vao);
|
|
126
124
|
}
|
|
127
125
|
}
|
|
128
|
-
exports.default = default_1;
|
|
129
126
|
class HeatParametersBlockManager {
|
|
130
127
|
constructor(gl) {
|
|
131
128
|
this.gl = gl;
|