@pirireis/webglobeplugins 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Math/angle-calculation.js +8 -8
- package/Math/arc.js +18 -18
- package/Math/bounds/line-bbox.js +78 -80
- package/Math/constants.js +3 -3
- package/Math/juction/arc-plane.js +23 -23
- package/Math/juction/line-sphere.js +11 -11
- package/Math/juction/plane-plane.js +11 -11
- package/Math/line.js +14 -16
- package/Math/methods.js +65 -70
- package/Math/plane.js +16 -18
- package/Math/quaternion.js +45 -49
- package/Math/utils.js +2 -2
- package/Math/vec3.js +42 -45
- package/algorithms/search-binary.js +4 -4
- package/altitude-locator/draw-subset-obj.js +7 -8
- package/altitude-locator/plugin.js +98 -114
- package/arrowfield/adaptor.js +3 -4
- package/arrowfield/index.js +2 -2
- package/arrowfield/plugin.js +62 -65
- package/bearing-line/index.js +1 -1
- package/bearing-line/plugin.js +200 -226
- package/circle-line-chain/chain-list-map.js +82 -88
- package/circle-line-chain/plugin.js +134 -165
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +108 -133
- package/compass-rose/compass-text-writer.js +62 -70
- package/compass-rose/index.js +2 -2
- package/compassrose/compassrose.js +46 -50
- package/compassrose/index.js +1 -1
- package/heatwave/index.js +2 -2
- package/heatwave/isobar/objectarraylabels.js +44 -48
- package/heatwave/isobar/plugin.js +104 -123
- package/heatwave/isobar/quadtreecontours.js +76 -92
- package/heatwave/plugins/heatwaveglobeshell.js +69 -87
- package/index.js +11 -11
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +32 -64
- package/partialrings/index.js +1 -1
- package/partialrings/plugin.js +48 -84
- package/partialrings/program.js +136 -47
- package/pin/pin-object-array.js +83 -86
- package/pin/pin-point-totem.js +21 -22
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
- package/point-heat-map/plugin-webworker.js +40 -45
- package/point-heat-map/point-to-heat-map-flow.js +40 -42
- package/point-tracks/key-methods.js +1 -1
- package/point-tracks/plugin.js +137 -162
- package/programs/arrowfield/index.js +1 -1
- package/programs/arrowfield/logic.js +170 -62
- package/programs/arrowfield/object.js +33 -35
- package/programs/data2legend/density-to-legend.js +45 -21
- package/programs/data2legend/point-to-density-texture.js +52 -27
- package/programs/float2legendwithratio/index.js +1 -1
- package/programs/float2legendwithratio/logic.js +88 -42
- package/programs/float2legendwithratio/object.js +43 -46
- package/programs/globe-util/is-globe-moved.js +10 -11
- package/programs/globeshell/index.js +1 -1
- package/programs/globeshell/wiggle/index.js +1 -1
- package/programs/globeshell/wiggle/logic.js +191 -98
- package/programs/globeshell/wiggle/object.js +33 -35
- package/programs/helpers/blender/program.js +36 -19
- package/programs/helpers/fadeaway/index.js +1 -1
- package/programs/helpers/fadeaway/logic.js +35 -13
- package/programs/helpers/fadeaway/object.js +9 -10
- package/programs/helpers/index.js +1 -1
- package/programs/index.js +8 -8
- package/programs/line-on-globe/angled-line.js +91 -32
- package/programs/line-on-globe/circle-accurate-3d.js +82 -32
- package/programs/line-on-globe/circle-accurate-flat.js +108 -50
- package/programs/line-on-globe/circle-accurate.js +103 -33
- package/programs/line-on-globe/circle.js +97 -32
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
- package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
- package/programs/line-on-globe/linestrip.js +111 -45
- package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
- package/programs/line-on-globe/to-the-surface.js +58 -29
- package/programs/line-on-globe/util.js +1 -1
- package/programs/picking/pickable-renderer.js +117 -33
- package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
- package/programs/point-on-globe/element-point-glow.js +103 -35
- package/programs/point-on-globe/square-pixel-point.js +76 -27
- package/programs/programcache.js +13 -13
- package/programs/rings/distancering/circleflatprogram.js +63 -21
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
- package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
- package/programs/rings/distancering/index.js +4 -4
- package/programs/rings/distancering/paddyflatprogram.js +73 -20
- package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
- package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
- package/programs/rings/partial-ring/piece-of-pie.js +137 -35
- package/programs/totems/camerauniformblock.js +64 -51
- package/programs/totems/canvas-webglobe-info.js +48 -40
- package/programs/totems/gpu-selection-uniform-block.js +44 -40
- package/programs/totems/index.js +1 -1
- package/programs/two-d/pixel-padding-for-compass.js +90 -29
- package/programs/util.js +6 -7
- package/programs/vectorfields/index.js +1 -1
- package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
- package/programs/vectorfields/logics/index.js +3 -3
- package/programs/vectorfields/logics/pixelbased.js +91 -35
- package/programs/vectorfields/logics/ubo.js +31 -25
- package/programs/vectorfields/pingpongbuffermanager.js +30 -34
- package/rangerings/index.js +4 -4
- package/rangerings/plugin.js +202 -258
- package/rangerings/rangeringangletext.js +108 -120
- package/rangerings/ring-account.js +52 -69
- package/shaders/fragment-toy/firework.js +55 -1
- package/shaders/fragment-toy/singularity.js +55 -1
- package/timetracks/adaptors-line-strip.js +26 -37
- package/timetracks/adaptors.js +47 -61
- package/timetracks/index.js +4 -4
- package/timetracks/plugin-line-strip.js +63 -71
- package/timetracks/plugin.js +69 -77
- package/timetracks/program-line-strip.js +296 -103
- package/timetracks/program.js +419 -113
- package/timetracks/programpoint-line-strip.js +97 -44
- package/timetracks/programpoint.js +90 -44
- package/util/account/bufferoffsetmanager.js +72 -95
- package/util/account/index.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
- package/util/account/single-attribute-buffer-management/index.js +3 -3
- package/util/account/single-attribute-buffer-management/object-store.js +29 -30
- package/util/account/util.js +2 -4
- package/util/algorithms/search-binary.js +4 -4
- package/util/check/get.js +5 -5
- package/util/check/typecheck.js +13 -15
- package/util/geometry/index.js +9 -11
- package/util/gl-util/buffer/attribute-loader.js +8 -20
- package/util/gl-util/buffer/index.js +1 -1
- package/util/gl-util/draw-options/methods.js +8 -9
- package/util/gl-util/uniform-block/manager.js +67 -67
- package/util/heatwavedatamanager/datamanager.js +56 -116
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
- package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
- package/util/index.js +6 -6
- package/util/interpolation/timetrack/index.js +1 -1
- package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
- package/util/interpolation/timetrack/web-worker-str.js +179 -1
- package/util/interpolation/timetrack/web-worker.js +4 -4
- package/util/jshelpers/data-filler.js +7 -7
- package/util/jshelpers/timefilters.js +7 -7
- package/util/picking/fence.js +7 -7
- package/util/picking/picker-displayer.js +46 -52
- package/util/programs/draw-texture-on-canvas.js +39 -21
- package/util/programs/shapesonglobe.js +104 -64
- package/util/programs/supersampletotextures.js +45 -39
- package/util/programs/texturetoglobe.js +98 -48
- package/util/shaderfunctions/geometrytransformations.js +322 -27
- package/util/shaderfunctions/nodata.js +7 -1
- package/util/shaderfunctions/noisefunctions.js +39 -9
- package/util/surface-line-data/arcs-to-cuts.js +20 -23
- package/util/webglobe/rasteroverlay.js +35 -37
- package/util/webglobjectbuilders.js +55 -60
- package/util/webglobjectbuilders1.js +48 -49
- package/waveparticles/adaptor.js +6 -7
- package/waveparticles/index.js +2 -2
- package/waveparticles/plugin.js +79 -84
- package/wind/imagetovectorfieldandmagnitude.js +15 -15
- package/wind/index.js +4 -4
- package/wind/plugin.js +453 -251
- package/wind/vectorfieldimage.js +5 -5
- package/write-text/attached-text-writer.js +46 -48
- package/write-text/context-text.js +51 -58
- package/write-text/context-text3.js +69 -74
package/point-tracks/plugin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keyMethod = exports.PointTracksPlugin = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const account_1 = require("../util/account");
|
|
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");
|
|
8
8
|
/**
|
|
9
9
|
* @typedef {number} long
|
|
10
10
|
* @typedef {number} lat
|
|
@@ -15,9 +15,8 @@ var methods_1 = require("../Math/methods");
|
|
|
15
15
|
* @typedef { long ,lat, height, ID } Point
|
|
16
16
|
* @typedef {Array<Point>, rgba, trackID} Track
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.pointSize, pointSize = _c === void 0 ? 2 : _c, _d = _b.hoveredPointSize, hoveredPointSize = _d === void 0 ? 4 : _d, _e = _b.selectionPointFilling, selectionPointFilling = _e === void 0 ? 4 : _e, _f = _b.opacity, opacity = _f === void 0 ? 1.0 : _f;
|
|
18
|
+
class PointTracksPlugin {
|
|
19
|
+
constructor(id, { pointSize = 2, hoveredPointSize = 4, selectionPointFilling = 4, opacity = 1.0 } = {}) {
|
|
21
20
|
this.id = id;
|
|
22
21
|
this._isFreed = false;
|
|
23
22
|
this._pointProgram = null;
|
|
@@ -33,40 +32,40 @@ var PointTracksPlugin = /** @class */ (function () {
|
|
|
33
32
|
this._lastWH = { w: 0, h: 0 };
|
|
34
33
|
this._focusParams = { on: false, length: 0, elementBuffer: null, trackIDs: [] };
|
|
35
34
|
this.pointSizes = {
|
|
36
|
-
pointSize
|
|
37
|
-
selectionPointFilling
|
|
38
|
-
hoveredPointSize
|
|
35
|
+
pointSize,
|
|
36
|
+
selectionPointFilling,
|
|
37
|
+
hoveredPointSize
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
init(globe, gl) {
|
|
42
41
|
this.globe = globe;
|
|
43
42
|
this.gl = gl;
|
|
44
43
|
this._pickerDisplayer = new picker_displayer_1.PickerDisplayer(globe);
|
|
45
44
|
this._pointProgram = square_pixel_point_1.PointOnGlobeProgramCache.get(globe);
|
|
46
45
|
this._focusParams.elementBuffer = gl.createBuffer();
|
|
47
46
|
this._initBufferManagers();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this._bufferOrchestrator = new account_1.BufferOrchestrator({ initialCapacity
|
|
47
|
+
}
|
|
48
|
+
_initBufferManagers() {
|
|
49
|
+
const { gl } = this;
|
|
50
|
+
const initialCapacity = 10;
|
|
51
|
+
const bufferType = "DYNAMIC_DRAW";
|
|
52
|
+
this._bufferOrchestrator = new account_1.BufferOrchestrator({ initialCapacity });
|
|
54
53
|
this._bufferManagersMap = new Map([
|
|
55
54
|
["pos3D", {
|
|
56
|
-
bufferManager: new account_1.BufferManager(gl, 3, { bufferType
|
|
57
|
-
adaptor:
|
|
55
|
+
bufferManager: new account_1.BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
56
|
+
adaptor: (item) => new Float32Array((0, methods_1.wgs84ToCartesian3d)(item.long, item.lat, item.height / 1000)) // height is in meters
|
|
58
57
|
}],
|
|
59
58
|
["pos2D", {
|
|
60
|
-
bufferManager: new account_1.BufferManager(gl, 2, { bufferType
|
|
61
|
-
adaptor:
|
|
59
|
+
bufferManager: new account_1.BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
60
|
+
adaptor: (item) => new Float32Array((0, methods_1.wgs84ToMercator)(item.long, item.lat))
|
|
62
61
|
}],
|
|
63
62
|
["rgba", {
|
|
64
|
-
bufferManager: new account_1.BufferManager(gl, 4, { bufferType
|
|
65
|
-
adaptor:
|
|
63
|
+
bufferManager: new account_1.BufferManager(gl, 4, { bufferType, initialCapacity }),
|
|
64
|
+
adaptor: (item) => item.rgba
|
|
66
65
|
}],
|
|
67
66
|
["objectStore", {
|
|
68
|
-
bufferManager: new account_1.ObjectStore({ initialCapacity
|
|
69
|
-
adaptor:
|
|
67
|
+
bufferManager: new account_1.ObjectStore({ initialCapacity }),
|
|
68
|
+
adaptor: (item) => {
|
|
70
69
|
return {
|
|
71
70
|
trackID: item.trackID, pointID: item.pointID
|
|
72
71
|
};
|
|
@@ -74,127 +73,113 @@ var PointTracksPlugin = /** @class */ (function () {
|
|
|
74
73
|
}]
|
|
75
74
|
]);
|
|
76
75
|
this._vao = this._pointProgram.createVAO(this._bufferManagersMap.get("pos3D").bufferManager.buffer, this._bufferManagersMap.get("pos2D").bufferManager.buffer, this._bufferManagersMap.get("rgba").bufferManager.buffer);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
var _a;
|
|
76
|
+
}
|
|
77
|
+
setPointSize(size) {
|
|
80
78
|
this.pointSizes.pointSize = size;
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
var _a;
|
|
79
|
+
this.globe?.DrawRender();
|
|
80
|
+
}
|
|
81
|
+
setSelectionPointFilling(size) {
|
|
85
82
|
this.pointSizes.selectionPointFilling = size;
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
var _a;
|
|
83
|
+
this.globe?.DrawRender();
|
|
84
|
+
}
|
|
85
|
+
setHoveredPointSize(size) {
|
|
90
86
|
this.pointSizes.hoveredPointSize = size;
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var _a;
|
|
87
|
+
this.globe?.DrawRender();
|
|
88
|
+
}
|
|
89
|
+
setOpacity(opacity) {
|
|
95
90
|
if (opacity < 0 || opacity > 1)
|
|
96
91
|
return;
|
|
97
92
|
this._opacity = opacity;
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
93
|
+
this.globe?.DrawRender();
|
|
94
|
+
}
|
|
95
|
+
getCurrentSelection() {
|
|
101
96
|
return this._selectedObj;
|
|
102
|
-
}
|
|
97
|
+
}
|
|
103
98
|
/**
|
|
104
99
|
*
|
|
105
100
|
* @param {*} x screen x
|
|
106
101
|
* @param {*} y screen y
|
|
107
102
|
* @param {*} callback callback on selection
|
|
108
103
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
var selectedIDs = Array.from(selectedIDsSet);
|
|
104
|
+
screenSelection(x, y, callback) {
|
|
105
|
+
const { pointSizes, _pickerDisplayer } = this;
|
|
106
|
+
const objectStore = this._bufferManagersMap.get("objectStore").bufferManager;
|
|
107
|
+
const wrapper = (selectedIDsSet) => {
|
|
108
|
+
const selectedIDs = Array.from(selectedIDsSet);
|
|
115
109
|
if (selectedIDs.length === 0) {
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
this._selectedObj = null;
|
|
111
|
+
this._selectedID = -1;
|
|
118
112
|
callback([]);
|
|
119
113
|
return;
|
|
120
114
|
}
|
|
121
|
-
|
|
122
|
-
for (
|
|
123
|
-
|
|
115
|
+
const selectedPoints = [];
|
|
116
|
+
for (let i = 0; i < selectedIDs.length; i++) {
|
|
117
|
+
const id = selectedIDs[i];
|
|
124
118
|
if (i === 0) {
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
this._selectedID = id;
|
|
120
|
+
this._selectedObj = objectStore.get(id);
|
|
127
121
|
}
|
|
128
|
-
|
|
122
|
+
const obj = objectStore.get(id);
|
|
129
123
|
selectedPoints.push(obj);
|
|
130
124
|
}
|
|
131
125
|
callback(selectedPoints);
|
|
132
126
|
};
|
|
133
127
|
_pickerDisplayer.pickXY(x, y, pointSizes.selectionPointFilling, wrapper);
|
|
134
|
-
}
|
|
128
|
+
}
|
|
135
129
|
/**
|
|
136
130
|
* @param {Array<Track>} tracks
|
|
137
131
|
* @returns
|
|
138
132
|
*/
|
|
139
|
-
|
|
140
|
-
var _a;
|
|
133
|
+
insertBulk(tracks) {
|
|
141
134
|
this._fillTracksToPointsMap(tracks); // TODO error should be at the top
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
const flattenedPoints = tracks.map(trackToFlatPoints).flat();
|
|
136
|
+
const currentLoad = this._bufferOrchestrator.length;
|
|
144
137
|
if (currentLoad + flattenedPoints.length >= 2147483647) {
|
|
145
138
|
throw new Error("Too many points, Point count cannot exceed 2147483647");
|
|
146
139
|
}
|
|
147
|
-
|
|
140
|
+
const { _bufferManagersMap, _bufferOrchestrator } = this;
|
|
148
141
|
_bufferOrchestrator.insertBulk(flattenedPoints, _bufferManagersMap);
|
|
149
142
|
this._refillFocus();
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
(
|
|
156
|
-
this._bufferManagersMap.forEach(function (_a) {
|
|
157
|
-
var bufferManager = _a.bufferManager;
|
|
158
|
-
return bufferManager.resetWithCapacity(capacity);
|
|
159
|
-
});
|
|
143
|
+
this.globe?.DrawRender();
|
|
144
|
+
}
|
|
145
|
+
flush() {
|
|
146
|
+
const capacity = 100;
|
|
147
|
+
this._bufferOrchestrator?.flush({ capacity });
|
|
148
|
+
this._bufferManagersMap.forEach(({ bufferManager }) => bufferManager.resetWithCapacity(capacity));
|
|
160
149
|
this._turnOffFocus();
|
|
161
150
|
this._tracksToPointsMap.clear();
|
|
162
|
-
|
|
163
|
-
}
|
|
151
|
+
this.globe?.DrawRender();
|
|
152
|
+
}
|
|
164
153
|
/**
|
|
165
154
|
* @param {string} trackID
|
|
166
155
|
*/
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
_bufferOrchestrator.deleteBulk(points.map(function (pointID) { return keyMethod(trackID, pointID); }), _bufferManagersMap);
|
|
156
|
+
deleteTrack(trackID) {
|
|
157
|
+
const pointSet = this._tracksToPointsMap.get(trackID);
|
|
158
|
+
const points = Array.from(pointSet);
|
|
159
|
+
const { _bufferOrchestrator, _bufferManagersMap } = this;
|
|
160
|
+
_bufferOrchestrator.deleteBulk(points.map((pointID) => keyMethod(trackID, pointID)), _bufferManagersMap);
|
|
173
161
|
this._tracksToPointsMap.delete(trackID);
|
|
174
162
|
this._redraw = true;
|
|
175
163
|
this._refillFocus();
|
|
176
|
-
|
|
177
|
-
}
|
|
164
|
+
this.globe?.DrawRender();
|
|
165
|
+
}
|
|
178
166
|
/**
|
|
179
167
|
* @param {string} trackID
|
|
180
168
|
* @param {Array<string>} pointIDs
|
|
181
169
|
*/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
_bufferOrchestrator.deleteBulk(pointIDs.map(function (pointID) { return keyMethod(trackID, pointID); }), _bufferManagersMap);
|
|
170
|
+
deletePoints(trackID, pointIDs) {
|
|
171
|
+
const { _bufferOrchestrator, _bufferManagersMap } = this;
|
|
172
|
+
_bufferOrchestrator.deleteBulk(pointIDs.map((pointID) => keyMethod(trackID, pointID)), _bufferManagersMap);
|
|
186
173
|
this._deletePointsFromTracksMap(trackID, pointIDs);
|
|
187
174
|
this._refillFocus();
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
var _a;
|
|
192
|
-
if (trackIDs === void 0) { trackIDs = null; }
|
|
175
|
+
this.globe?.DrawRender();
|
|
176
|
+
}
|
|
177
|
+
focusTracks(trackIDs = null) {
|
|
193
178
|
if (!this.globe)
|
|
194
179
|
return;
|
|
195
180
|
if (!trackIDs) {
|
|
196
181
|
this._focusParams.on = false;
|
|
197
|
-
|
|
182
|
+
this.globe?.DrawRender();
|
|
198
183
|
return;
|
|
199
184
|
}
|
|
200
185
|
this._focusParams.on = this._fillElementBuffer(trackIDs);
|
|
@@ -202,22 +187,19 @@ var PointTracksPlugin = /** @class */ (function () {
|
|
|
202
187
|
this._turnOffFocus();
|
|
203
188
|
}
|
|
204
189
|
this.globe.DrawRender();
|
|
205
|
-
}
|
|
190
|
+
}
|
|
206
191
|
// GLOBE API METHODS
|
|
207
|
-
|
|
192
|
+
free() {
|
|
208
193
|
if (this._isFreed)
|
|
209
194
|
return;
|
|
210
195
|
this._isFreed = true;
|
|
211
196
|
this._pickerDisplayer.free();
|
|
212
197
|
square_pixel_point_1.PointOnGlobeProgramCache.release(this.globe);
|
|
213
198
|
this.gl.deleteBuffer(this._focusParams.elementBuffer);
|
|
214
|
-
this._bufferManagersMap.forEach(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
PointTracksPlugin.prototype.draw3D = function () {
|
|
220
|
-
var _a = this, gl = _a.gl, _pointProgram = _a._pointProgram, _pickerDisplayer = _a._pickerDisplayer, _bufferOrchestrator = _a._bufferOrchestrator, _vao = _a._vao;
|
|
199
|
+
this._bufferManagersMap.forEach(({ bufferManager, adaptor }) => bufferManager.free());
|
|
200
|
+
}
|
|
201
|
+
draw3D() {
|
|
202
|
+
const { gl, _pointProgram, _pickerDisplayer, _bufferOrchestrator, _vao } = this;
|
|
221
203
|
this.resize();
|
|
222
204
|
_pickerDisplayer.bindFBO();
|
|
223
205
|
_pickerDisplayer.clearTextures();
|
|
@@ -241,77 +223,72 @@ var PointTracksPlugin = /** @class */ (function () {
|
|
|
241
223
|
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
242
224
|
_pickerDisplayer.drawColorTexture();
|
|
243
225
|
this._selfSelect();
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
var h = this.globe.api_ScrH();
|
|
226
|
+
}
|
|
227
|
+
resize() {
|
|
228
|
+
const w = this.globe.api_ScrW();
|
|
229
|
+
const h = this.globe.api_ScrH();
|
|
249
230
|
if (w === this._lastWH.w && h === this._lastWH.h)
|
|
250
231
|
return;
|
|
251
232
|
this._lastWH.w = w;
|
|
252
233
|
this._lastWH.h = h;
|
|
253
234
|
this._pickerDisplayer.resize();
|
|
254
|
-
|
|
255
|
-
}
|
|
235
|
+
this.globe?.DrawRender();
|
|
236
|
+
}
|
|
256
237
|
// IMPLICIT METHODS
|
|
257
|
-
|
|
258
|
-
for (
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
var points = track.points;
|
|
238
|
+
_fillTracksToPointsMap(tracks) {
|
|
239
|
+
for (const track of tracks) {
|
|
240
|
+
const trackID = track.trackID;
|
|
241
|
+
const points = track.points;
|
|
262
242
|
if (!this._tracksToPointsMap.has(trackID)) {
|
|
263
243
|
this._tracksToPointsMap.set(trackID, new Set());
|
|
264
244
|
}
|
|
265
|
-
|
|
266
|
-
for (
|
|
267
|
-
|
|
245
|
+
const pointSet = this._tracksToPointsMap.get(trackID);
|
|
246
|
+
for (let p = 0; p < points.length; p++) {
|
|
247
|
+
const pointID = points[p].ID;
|
|
268
248
|
pointSet.add(pointID);
|
|
269
249
|
}
|
|
270
250
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
251
|
+
}
|
|
252
|
+
_refillFocus() {
|
|
273
253
|
if (this._focusParams.on) {
|
|
274
254
|
this.focusTracks(this._focusParams.trackIDs);
|
|
275
255
|
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
for (
|
|
280
|
-
var pointID = pointIDs_1[_i];
|
|
256
|
+
}
|
|
257
|
+
_deletePointsFromTracksMap(trackID, pointIDs) {
|
|
258
|
+
const trackSet = this._tracksToPointsMap.get(trackID);
|
|
259
|
+
for (const pointID of pointIDs) {
|
|
281
260
|
trackSet.delete(pointID);
|
|
282
261
|
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
this.screenSelection(x, y,
|
|
262
|
+
}
|
|
263
|
+
_selfSelect() {
|
|
264
|
+
const { globe } = this;
|
|
265
|
+
const pos = globe.api_GetMousePos();
|
|
266
|
+
const x = pos.canvasX;
|
|
267
|
+
const y = globe.api_ScrH() - pos.canvasY;
|
|
268
|
+
this.screenSelection(x, y, (selectedPoints) => {
|
|
290
269
|
});
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
270
|
+
}
|
|
271
|
+
_turnOffFocus() {
|
|
272
|
+
const { gl } = this;
|
|
294
273
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._focusParams.elementBuffer);
|
|
295
274
|
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array([]), gl.STATIC_DRAW);
|
|
296
275
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
|
|
297
276
|
this._focusParams.length = 0;
|
|
298
277
|
this._focusParams.on = false;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
for (
|
|
305
|
-
|
|
306
|
-
var pointSet = this._tracksToPointsMap.get(trackID);
|
|
278
|
+
}
|
|
279
|
+
_fillElementBuffer(trackIDs) {
|
|
280
|
+
let length = 0;
|
|
281
|
+
const indexes = [];
|
|
282
|
+
const foundTracks = [];
|
|
283
|
+
for (const trackID of trackIDs) {
|
|
284
|
+
const pointSet = this._tracksToPointsMap.get(trackID);
|
|
307
285
|
if (!pointSet)
|
|
308
286
|
continue;
|
|
309
287
|
foundTracks.push(trackID);
|
|
310
|
-
|
|
311
|
-
for (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
var index = this._bufferOrchestrator.offsetMap.get(key);
|
|
288
|
+
const points = Array.from(pointSet);
|
|
289
|
+
for (const pointID of points) {
|
|
290
|
+
const key = keyMethod(trackID, pointID);
|
|
291
|
+
const index = this._bufferOrchestrator.offsetMap.get(key);
|
|
315
292
|
indexes.push(index);
|
|
316
293
|
length++;
|
|
317
294
|
}
|
|
@@ -321,33 +298,31 @@ var PointTracksPlugin = /** @class */ (function () {
|
|
|
321
298
|
if (length === 0) {
|
|
322
299
|
return false;
|
|
323
300
|
}
|
|
324
|
-
|
|
301
|
+
const { gl } = this;
|
|
325
302
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._focusParams.elementBuffer);
|
|
326
303
|
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(indexes), gl.STATIC_DRAW);
|
|
327
304
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
|
|
328
305
|
return true;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
}());
|
|
306
|
+
}
|
|
307
|
+
}
|
|
332
308
|
exports.PointTracksPlugin = PointTracksPlugin;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
for (
|
|
339
|
-
var point = points_2[_i];
|
|
309
|
+
const trackToFlatPoints = (track) => {
|
|
310
|
+
const trackID = track.trackID;
|
|
311
|
+
const points = track.points;
|
|
312
|
+
const rgba = new Float32Array(track.rgba);
|
|
313
|
+
const flatPoints = [];
|
|
314
|
+
for (const point of points) {
|
|
340
315
|
flatPoints.push({
|
|
341
316
|
key: keyMethod(trackID, point.ID),
|
|
342
317
|
long: point.long,
|
|
343
318
|
lat: point.lat,
|
|
344
319
|
height: point.height,
|
|
345
320
|
pointID: point.ID,
|
|
346
|
-
rgba
|
|
347
|
-
trackID
|
|
321
|
+
rgba,
|
|
322
|
+
trackID
|
|
348
323
|
});
|
|
349
324
|
}
|
|
350
325
|
return flatPoints;
|
|
351
326
|
};
|
|
352
|
-
|
|
327
|
+
const keyMethod = (trackID, pointID) => `${trackID}_${pointID}`;
|
|
353
328
|
exports.keyMethod = keyMethod;
|
|
@@ -3,5 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const object_1 = __importDefault(require("./object"));
|
|
7
7
|
exports.default = object_1.default;
|