@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
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CircleLineChainPlugin = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
var naive_accurate_flexible_1 = require("../programs/line-on-globe/naive-accurate-flexible");
|
|
5
|
+
var circle_accurate_flat_1 = require("../programs/line-on-globe/circle-accurate-flat");
|
|
6
|
+
var circle_accurate_3d_1 = require("../programs/line-on-globe/circle-accurate-3d");
|
|
7
|
+
var account_1 = require("../util/account");
|
|
8
|
+
var chain_list_map_1 = require("./chain-list-map");
|
|
9
|
+
var get_1 = require("../util/check/get");
|
|
10
|
+
var util_1 = require("./util");
|
|
11
|
+
var data_filler_1 = require("../util/jshelpers/data-filler");
|
|
12
|
+
var context_text3_1 = require("../write-text/context-text3");
|
|
13
|
+
var typecheck_1 = require("../util/check/typecheck");
|
|
14
|
+
var attribute_loader_1 = require("../util/gl-util/buffer/attribute-loader");
|
|
15
|
+
var index_1 = require("../util/geometry/index");
|
|
16
16
|
/**
|
|
17
17
|
* Insert info to chain list map (nodes and properties)
|
|
18
18
|
*
|
|
@@ -55,18 +55,19 @@ const index_1 = require("../util/geometry/index");
|
|
|
55
55
|
*
|
|
56
56
|
* //property {Array<Node>} nodes
|
|
57
57
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
var textWriterGetOrThrow = (0, get_1.mapGetOrThrow)("textWriterIDs is invalid");
|
|
59
|
+
var CircleLineChainPlugin = /** @class */ (function () {
|
|
60
60
|
/**
|
|
61
61
|
*
|
|
62
62
|
* @param {*} id
|
|
63
63
|
* @param {Map<[key, ContextTextWriter3]} textWritersMap //import { ContextTextWriter3 } from "@pirireis/webglobeplugins/write-text/context-text3";
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
function CircleLineChainPlugin(id, _a) {
|
|
66
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.drawCircleOn, drawCircleOn = _c === void 0 ? true : _c, _d = _b.textWritersMap, textWritersMap = _d === void 0 ? new Map() : _d, _e = _b.textDataPreAdaptor, textDataPreAdaptor = _e === void 0 ? null : _e, _f = _b.circleFlatEdgeCount, circleFlatEdgeCount = _f === void 0 ? circle_accurate_flat_1.EDGE_COUNT - 2 : _f;
|
|
66
67
|
this.id = id;
|
|
67
68
|
this._checktextWritersMap(textWritersMap);
|
|
68
69
|
this._textWritersMap = textWritersMap;
|
|
69
|
-
this._textWritersMap.forEach((writer)
|
|
70
|
+
this._textWritersMap.forEach(function (writer) { return writer.setKeyAdaptor(function (v, i, c, properties) { return v.__identity__; }); });
|
|
70
71
|
this._opacity = 1;
|
|
71
72
|
this._chainListMap = new chain_list_map_1.ChainListMap(util_1.keyMethod);
|
|
72
73
|
this.bufferOrchestrator = new account_1.BufferOrchestrator({ capacity: 10 });
|
|
@@ -76,12 +77,12 @@ class CircleLineChainPlugin {
|
|
|
76
77
|
}
|
|
77
78
|
// init
|
|
78
79
|
// API
|
|
79
|
-
setDrawCircleOn(bool) {
|
|
80
|
+
CircleLineChainPlugin.prototype.setDrawCircleOn = function (bool) {
|
|
80
81
|
if (typeof bool !== 'boolean')
|
|
81
82
|
throw new Error("setDrawCircleOn parameter must be a boolean");
|
|
82
83
|
this._drawCircleOn = bool;
|
|
83
84
|
this.globe.DrawRender();
|
|
84
|
-
}
|
|
85
|
+
};
|
|
85
86
|
// ---- updateBulk
|
|
86
87
|
/**
|
|
87
88
|
* @param {Array<chain>} data
|
|
@@ -90,48 +91,57 @@ class CircleLineChainPlugin {
|
|
|
90
91
|
* @property {Array<Node>} nodes
|
|
91
92
|
|
|
92
93
|
*/
|
|
93
|
-
updateCoordinatesBulk
|
|
94
|
+
CircleLineChainPlugin.prototype.updateCoordinatesBulk = function (data, _a) {
|
|
95
|
+
var _this = this;
|
|
96
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.textWriterIDs, textWriterIDs = _c === void 0 ? [] : _c;
|
|
94
97
|
// update implicit data structure
|
|
95
98
|
// find keys to update.. (inserted data and the radius of "from")
|
|
96
99
|
// updateBuffers
|
|
97
100
|
// update text
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
var chainKeys = [];
|
|
102
|
+
var _loop_1 = function (chain) {
|
|
100
103
|
chainKeys.push(chain.chainKey);
|
|
101
|
-
chain.nodes.forEach((node)
|
|
102
|
-
|
|
104
|
+
chain.nodes.forEach(function (node) {
|
|
105
|
+
_this._chainListMap.updateCoordsinatesOfNode(node, chain.chainKey);
|
|
103
106
|
});
|
|
107
|
+
};
|
|
108
|
+
for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
|
109
|
+
var chain = data_1[_i];
|
|
110
|
+
_loop_1(chain);
|
|
104
111
|
}
|
|
105
112
|
this._reconstructChains(chainKeys);
|
|
106
113
|
this._updateTexts(chainKeys, textWriterIDs);
|
|
107
|
-
}
|
|
114
|
+
};
|
|
108
115
|
/**
|
|
109
116
|
* @param {*} chainKey
|
|
110
117
|
* @param {Array<{nodeKey, circleProperties:Map[propertyName ,value], lineProperties:Map[propertyName ,value] }} propertyMap
|
|
111
118
|
*/
|
|
112
|
-
updateNodesProperties(chainKey, nodesAndPropertyMap,
|
|
119
|
+
CircleLineChainPlugin.prototype.updateNodesProperties = function (chainKey, nodesAndPropertyMap, _a) {
|
|
120
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.textWriterIDs, textWriterIDs = _c === void 0 ? [] : _c;
|
|
113
121
|
this._chainListMap.updateNodesProperties(chainKey, nodesAndPropertyMap);
|
|
114
122
|
this._reconstructChains([chainKey]);
|
|
115
123
|
this._updateTexts([chainKey], textWriterIDs);
|
|
116
124
|
this.globe.DrawRender();
|
|
117
|
-
}
|
|
125
|
+
};
|
|
118
126
|
/**
|
|
119
127
|
* @param {*} chainKey
|
|
120
128
|
* @param {Map<propertyName ,value} propertyMap
|
|
121
129
|
*/
|
|
122
|
-
updateChainProperties(chainKey, propertyMap,
|
|
130
|
+
CircleLineChainPlugin.prototype.updateChainProperties = function (chainKey, propertyMap, _a) {
|
|
131
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.textWriterIDs, textWriterIDs = _c === void 0 ? [] : _c;
|
|
123
132
|
this._chainListMap.updateChainProperties(chainKey, propertyMap);
|
|
124
133
|
this._reconstructChains([chainKey]);
|
|
125
134
|
if (textWriterIDs)
|
|
126
135
|
this._updateTexts([chainKey], textWriterIDs);
|
|
127
|
-
}
|
|
128
|
-
updateNodeCoordinates(node, chainKey,
|
|
136
|
+
};
|
|
137
|
+
CircleLineChainPlugin.prototype.updateNodeCoordinates = function (node, chainKey, _a) {
|
|
138
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.textWriterIDs, textWriterIDs = _c === void 0 ? [] : _c;
|
|
129
139
|
this._chainListMap.updateCoordsinatesOfNode(node, chainKey);
|
|
130
140
|
if (textWriterIDs)
|
|
131
141
|
this._updateTexts([chainKey], textWriterIDs);
|
|
132
142
|
this._reconstructChains([chainKey]);
|
|
133
143
|
this.globe.DrawRender();
|
|
134
|
-
}
|
|
144
|
+
};
|
|
135
145
|
/**
|
|
136
146
|
*
|
|
137
147
|
|
|
@@ -139,23 +149,27 @@ class CircleLineChainPlugin {
|
|
|
139
149
|
* @param {Array<string>} textWriterIDs | textWritersMap keys to be used for writing text.
|
|
140
150
|
* @param {Array<string>} chainKeys | if empty, all texts will be updated
|
|
141
151
|
*/
|
|
142
|
-
updateText
|
|
152
|
+
CircleLineChainPlugin.prototype.updateText = function (textWriterIDs, chainKeys) {
|
|
153
|
+
if (textWriterIDs === void 0) { textWriterIDs = []; }
|
|
154
|
+
if (chainKeys === void 0) { chainKeys = null; }
|
|
143
155
|
if (chainKeys === null)
|
|
144
156
|
chainKeys = this._chainListMap.getAllChainKeysIterator();
|
|
145
157
|
this._updateTexts(chainKeys, textWriterIDs);
|
|
146
158
|
this.globe.DrawRender();
|
|
147
|
-
}
|
|
159
|
+
};
|
|
148
160
|
// ---- insertBulk
|
|
149
161
|
/**
|
|
150
162
|
*
|
|
151
163
|
* @param {Array<chain>} data
|
|
152
164
|
*/
|
|
153
|
-
insertBulk
|
|
165
|
+
CircleLineChainPlugin.prototype.insertBulk = function (data, _a) {
|
|
166
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.textWriterIDs, textWriterIDs = _c === void 0 ? [] : _c;
|
|
154
167
|
// first insert everything to implicit structure,
|
|
155
168
|
// then iterate over data again to update text
|
|
156
169
|
// let _reconstractChainBufferData method interact with data and bufferOrchestrator.
|
|
157
|
-
|
|
158
|
-
for (
|
|
170
|
+
var chainKeysToConstruct = [];
|
|
171
|
+
for (var _i = 0, data_2 = data; _i < data_2.length; _i++) {
|
|
172
|
+
var _d = data_2[_i], chainKey = _d.chainKey, chainProperties = _d.chainProperties, nodes = _d.nodes;
|
|
159
173
|
this._chainListMap.setChain(chainKey, nodes);
|
|
160
174
|
this._chainListMap.setChainProperties(chainKey, chainProperties);
|
|
161
175
|
chainKeysToConstruct.push(chainKey);
|
|
@@ -164,103 +178,110 @@ class CircleLineChainPlugin {
|
|
|
164
178
|
if (textWriterIDs)
|
|
165
179
|
this._updateTexts(chainKeysToConstruct, textWriterIDs);
|
|
166
180
|
this.globe.DrawRender();
|
|
167
|
-
}
|
|
181
|
+
};
|
|
168
182
|
/**
|
|
169
183
|
* @param {Node} node
|
|
170
184
|
* @param {*} chainKey
|
|
171
185
|
* @param {*} theNodeKeyFront | node key of the next node, null places to the last
|
|
172
186
|
*/
|
|
173
|
-
addNode(node, chainKey,
|
|
187
|
+
CircleLineChainPlugin.prototype.addNode = function (node, chainKey, _a) {
|
|
188
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.theNodeKeyFront, theNodeKeyFront = _c === void 0 ? null : _c, _d = _b.textWriterIDs, textWriterIDs = _d === void 0 ? [] : _d;
|
|
174
189
|
this._chainListMap.addNode(node, chainKey, theNodeKeyFront);
|
|
175
190
|
if (textWriterIDs)
|
|
176
191
|
this._updateTexts([chainKey], textWriterIDs);
|
|
177
192
|
this._reconstructChains([chainKey]);
|
|
178
193
|
this.globe.DrawRender();
|
|
179
|
-
}
|
|
180
|
-
setOpacity(opacity) {
|
|
194
|
+
};
|
|
195
|
+
CircleLineChainPlugin.prototype.setOpacity = function (opacity) {
|
|
181
196
|
(0, typecheck_1.opacityCheck)(opacity);
|
|
182
|
-
this._textWritersMap.forEach((writer)
|
|
197
|
+
this._textWritersMap.forEach(function (writer) { return writer.setOpacity(opacity); });
|
|
183
198
|
this._opacity = opacity;
|
|
184
199
|
this.globe.DrawRender();
|
|
185
|
-
}
|
|
186
|
-
getChain(chainKey) {
|
|
200
|
+
};
|
|
201
|
+
CircleLineChainPlugin.prototype.getChain = function (chainKey) {
|
|
187
202
|
this._chainListMap.getChain(chainKey);
|
|
188
|
-
}
|
|
203
|
+
};
|
|
189
204
|
/**
|
|
190
205
|
*
|
|
191
206
|
* @param {*} chainKeys
|
|
192
207
|
*/
|
|
193
|
-
deleteChains(chainKeys) {
|
|
194
|
-
|
|
195
|
-
for (
|
|
196
|
-
|
|
208
|
+
CircleLineChainPlugin.prototype.deleteChains = function (chainKeys) {
|
|
209
|
+
var bufferKeys = [];
|
|
210
|
+
for (var _i = 0, chainKeys_1 = chainKeys; _i < chainKeys_1.length; _i++) {
|
|
211
|
+
var chainKey = chainKeys_1[_i];
|
|
212
|
+
bufferKeys.push.apply(bufferKeys, this._chainListMap.deleteChainAndReturnChainKeys(chainKey));
|
|
197
213
|
}
|
|
198
|
-
this._textWritersMap.forEach((writer)
|
|
214
|
+
this._textWritersMap.forEach(function (writer) { return writer.deleteTextBulk(bufferKeys); });
|
|
199
215
|
this._updateTexts(chainKeys, this._textWritersMap.keys());
|
|
200
216
|
this.bufferOrchestrator.deleteBulk(bufferKeys, this.bufferManagersCompMap);
|
|
201
217
|
this.globe.DrawRender();
|
|
202
|
-
}
|
|
218
|
+
};
|
|
203
219
|
/**
|
|
204
220
|
*
|
|
205
221
|
* @param {Array<{chainKey, nodeKeys:[]} keysAndNodes
|
|
206
222
|
*/
|
|
207
|
-
deleteNodes
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
223
|
+
CircleLineChainPlugin.prototype.deleteNodes = function (keysAndNodes, _a) {
|
|
224
|
+
var _this = this;
|
|
225
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.textWriterIDs, textWriterIDs = _c === void 0 ? [] : _c;
|
|
226
|
+
var bufferKeys = [];
|
|
227
|
+
var chainKeysToReconstuct = [];
|
|
228
|
+
keysAndNodes.forEach(function (_a) {
|
|
229
|
+
var chainKey = _a.chainKey, nodeKeys = _a.nodeKeys;
|
|
230
|
+
bufferKeys.push.apply(bufferKeys, _this._chainListMap.deleteNodesBelongToAChain(chainKey, nodeKeys));
|
|
212
231
|
chainKeysToReconstuct.push(chainKey);
|
|
213
232
|
});
|
|
214
|
-
this._textWritersMap.forEach((writer)
|
|
233
|
+
this._textWritersMap.forEach(function (writer) { return writer.deleteTextBulk(bufferKeys); });
|
|
215
234
|
this.bufferOrchestrator.deleteBulk(bufferKeys, this.bufferManagersCompMap);
|
|
216
235
|
this._reconstructChains(chainKeysToReconstuct);
|
|
217
236
|
this._updateTexts(chainKeysToReconstuct, textWriterIDs);
|
|
218
237
|
this.globe.DrawRender();
|
|
219
|
-
}
|
|
220
|
-
init(globe, gl) {
|
|
238
|
+
};
|
|
239
|
+
CircleLineChainPlugin.prototype.init = function (globe, gl) {
|
|
221
240
|
this.gl = gl;
|
|
222
241
|
this.globe = globe;
|
|
223
242
|
this._initOrchestrations();
|
|
224
|
-
}
|
|
243
|
+
};
|
|
225
244
|
// implicit
|
|
226
|
-
_checktextWritersMap(textWritersMap) {
|
|
245
|
+
CircleLineChainPlugin.prototype._checktextWritersMap = function (textWritersMap) {
|
|
227
246
|
if (!(textWritersMap instanceof Map))
|
|
228
247
|
throw new Error("textWritersMap is not an instance of Map");
|
|
229
|
-
textWritersMap.forEach((v)
|
|
248
|
+
textWritersMap.forEach(function (v) {
|
|
230
249
|
if (!(v instanceof context_text3_1.ContextTextWriter3))
|
|
231
250
|
throw new Error("textWritersMap element is not an instance of ContextTextWriter3");
|
|
232
251
|
});
|
|
233
|
-
}
|
|
234
|
-
_initOrchestrations() {
|
|
235
|
-
|
|
252
|
+
};
|
|
253
|
+
CircleLineChainPlugin.prototype._initOrchestrations = function () {
|
|
254
|
+
var _a, _b, _c;
|
|
255
|
+
var _this = this;
|
|
256
|
+
var _d = this, gl = _d.gl, globe = _d.globe;
|
|
236
257
|
this.lineProgram = naive_accurate_flexible_1.LineOnGlobeCache.get(globe);
|
|
237
258
|
this.circleProgram2d = circle_accurate_flat_1.CircleCache.get(globe);
|
|
238
259
|
this.circle3DProgram = circle_accurate_3d_1.CircleCache.get(globe);
|
|
239
|
-
|
|
260
|
+
var _circleFlatEdgeCount = this._circleFlatEdgeCount;
|
|
240
261
|
{
|
|
241
262
|
// createBuffers
|
|
242
|
-
|
|
243
|
-
|
|
263
|
+
var bufferType = "DYNAMIC_DRAW";
|
|
264
|
+
var initialCapacity = this.bufferOrchestrator.capacity;
|
|
244
265
|
this.bufferManagersCompMap = new Map([
|
|
245
266
|
["centerCoords2d", {
|
|
246
|
-
'bufferManager': new account_1.BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
247
|
-
'adaptor': (item)
|
|
267
|
+
'bufferManager': new account_1.BufferManager(gl, 2, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
268
|
+
'adaptor': function (item) { return new Float32Array(globe.api_GetMercator2DPoint(item.long, item.lat)); },
|
|
248
269
|
}],
|
|
249
270
|
["centerCoords3d", {
|
|
250
|
-
'bufferManager': new account_1.BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
251
|
-
'adaptor': (item)
|
|
271
|
+
'bufferManager': new account_1.BufferManager(gl, 3, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
272
|
+
'adaptor': function (item) { return (0, index_1.sphereCoord)(item.long, item.lat, globe, item.altitude); },
|
|
252
273
|
}],
|
|
253
274
|
["targetCoords2d", {
|
|
254
|
-
'bufferManager': new account_1.BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
255
|
-
'adaptor': (item)
|
|
275
|
+
'bufferManager': new account_1.BufferManager(gl, 2, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
276
|
+
'adaptor': function (item) { return new Float32Array(globe.api_GetMercator2DPoint(item.targetLong, item.targetLat)); },
|
|
256
277
|
}],
|
|
257
278
|
["targetCoords3d", {
|
|
258
|
-
'bufferManager': new account_1.BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
259
|
-
'adaptor': (item)
|
|
279
|
+
'bufferManager': new account_1.BufferManager(gl, 3, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
280
|
+
'adaptor': function (item) { return (0, index_1.sphereCoord)(item.targetLong, item.targetLat, globe, item.altitude); },
|
|
260
281
|
}],
|
|
261
282
|
["rgba", {
|
|
262
|
-
'bufferManager': new account_1.BufferManager(gl, 4, { bufferType, initialCapacity }),
|
|
263
|
-
'adaptor': (item)
|
|
283
|
+
'bufferManager': new account_1.BufferManager(gl, 4, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
284
|
+
'adaptor': function (item) {
|
|
264
285
|
var _a;
|
|
265
286
|
if ((_a = item.lineProperties) === null || _a === void 0 ? void 0 : _a.rgba)
|
|
266
287
|
return new Float32Array(item.lineProperties.rgba);
|
|
@@ -272,16 +293,16 @@ class CircleLineChainPlugin {
|
|
|
272
293
|
// 'adaptor': (item) => new Float32Array([item.bigRadius])
|
|
273
294
|
// }],
|
|
274
295
|
["dashRatio", {
|
|
275
|
-
'bufferManager': new account_1.BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
276
|
-
'adaptor': (item)
|
|
296
|
+
'bufferManager': new account_1.BufferManager(gl, 1, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
297
|
+
'adaptor': function (item) { return new Float32Array([item.chainProperties.dashRatio]); }
|
|
277
298
|
}],
|
|
278
299
|
["dashOpacity", {
|
|
279
|
-
'bufferManager': new account_1.BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
280
|
-
'adaptor': (item)
|
|
300
|
+
'bufferManager': new account_1.BufferManager(gl, 1, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
301
|
+
'adaptor': function (item) { return new Float32Array([item.chainProperties.dashOpacity]); }
|
|
281
302
|
}],
|
|
282
303
|
["circleDashAngle", {
|
|
283
|
-
'bufferManager': new account_1.BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
284
|
-
'adaptor': (item)
|
|
304
|
+
'bufferManager': new account_1.BufferManager(gl, 1, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
305
|
+
'adaptor': function (item) {
|
|
285
306
|
var _a;
|
|
286
307
|
if ((_a = item.circleProperties) === null || _a === void 0 ? void 0 : _a.circleDashAngle)
|
|
287
308
|
return new Float32Array([item.circleProperties.circleDashAngle / 360]);
|
|
@@ -289,8 +310,8 @@ class CircleLineChainPlugin {
|
|
|
289
310
|
}
|
|
290
311
|
}],
|
|
291
312
|
["rgbaCircle", {
|
|
292
|
-
"bufferManager": new account_1.BufferManager(gl, 4, { bufferType, initialCapacity }),
|
|
293
|
-
"adaptor": (item)
|
|
313
|
+
"bufferManager": new account_1.BufferManager(gl, 4, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
314
|
+
"adaptor": function (item) {
|
|
294
315
|
var _a;
|
|
295
316
|
if ((_a = item.circleProperties) === null || _a === void 0 ? void 0 : _a.rgba)
|
|
296
317
|
return new Float32Array(item.circleProperties.rgba);
|
|
@@ -299,8 +320,8 @@ class CircleLineChainPlugin {
|
|
|
299
320
|
}],
|
|
300
321
|
// Mercator buffers
|
|
301
322
|
["circleDashAngleMercator", {
|
|
302
|
-
'bufferManager': new account_1.BufferManager(gl, 1 * _circleFlatEdgeCount, { bufferType, initialCapacity }),
|
|
303
|
-
'adaptor': (item)
|
|
323
|
+
'bufferManager': new account_1.BufferManager(gl, 1 * _circleFlatEdgeCount, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
324
|
+
'adaptor': function (item) {
|
|
304
325
|
var _a;
|
|
305
326
|
if ((_a = item.circleProperties) === null || _a === void 0 ? void 0 : _a.circleDashAngle)
|
|
306
327
|
return new Float32Array([item.circleProperties.circleDashAngle / 360]);
|
|
@@ -308,8 +329,8 @@ class CircleLineChainPlugin {
|
|
|
308
329
|
}
|
|
309
330
|
}],
|
|
310
331
|
["rgbaCircleMercator", {
|
|
311
|
-
"bufferManager": new account_1.BufferManager(gl, 4 * _circleFlatEdgeCount, { bufferType, initialCapacity }),
|
|
312
|
-
"adaptor": (item)
|
|
332
|
+
"bufferManager": new account_1.BufferManager(gl, 4 * _circleFlatEdgeCount, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
333
|
+
"adaptor": function (item) {
|
|
313
334
|
var _a;
|
|
314
335
|
if ((_a = item.circleProperties) === null || _a === void 0 ? void 0 : _a.rgba)
|
|
315
336
|
return data_filler_1.populateFloat32Array.fillWithListData(_circleFlatEdgeCount, item.circleProperties.rgba);
|
|
@@ -317,40 +338,42 @@ class CircleLineChainPlugin {
|
|
|
317
338
|
}
|
|
318
339
|
}],
|
|
319
340
|
["dashOpacityMercator", {
|
|
320
|
-
'bufferManager': new account_1.BufferManager(gl, 1 * _circleFlatEdgeCount, { bufferType, initialCapacity }),
|
|
321
|
-
'adaptor': (item)
|
|
341
|
+
'bufferManager': new account_1.BufferManager(gl, 1 * _circleFlatEdgeCount, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
342
|
+
'adaptor': function (item) { return data_filler_1.populateFloat32Array.fillFloat32Array(_circleFlatEdgeCount, item.chainProperties.dashOpacity); }
|
|
322
343
|
}],
|
|
323
344
|
["centerCoords2dMercator", {
|
|
324
|
-
'bufferManager': new account_1.BufferManager(gl, 2 * _circleFlatEdgeCount, { bufferType, initialCapacity }),
|
|
325
|
-
'adaptor': (item)
|
|
345
|
+
'bufferManager': new account_1.BufferManager(gl, 2 * _circleFlatEdgeCount, { bufferType: bufferType, initialCapacity: initialCapacity }),
|
|
346
|
+
'adaptor': function (item) { return item.centerCoords2dflat; },
|
|
326
347
|
}],
|
|
327
348
|
]);
|
|
328
|
-
|
|
329
|
-
this.lineVao = this.lineProgram.createVAO(
|
|
330
|
-
].map(key
|
|
331
|
-
this.circleVao2d = this.circleProgram2d.createVAO(
|
|
332
|
-
].map(key
|
|
333
|
-
this.circle3DVao = this.circle3DProgram.createVAO(
|
|
334
|
-
].map(key
|
|
349
|
+
var obj_1 = function (key) { return (0, attribute_loader_1.createBufferAndReadInfo)(_this.bufferManagersCompMap.get(key).bufferManager.buffer); };
|
|
350
|
+
this.lineVao = (_a = this.lineProgram).createVAO.apply(_a, ['centerCoords2d', 'centerCoords3d', 'targetCoords2d', 'targetCoords3d', 'dashRatio', 'dashOpacity', 'rgba'
|
|
351
|
+
].map(function (key) { return obj_1(key); }));
|
|
352
|
+
this.circleVao2d = (_b = this.circleProgram2d).createVAO.apply(_b, ["centerCoords2dMercator", "rgbaCircleMercator", "circleDashAngleMercator", "dashOpacityMercator"
|
|
353
|
+
].map(function (key) { return obj_1(key); }));
|
|
354
|
+
this.circle3DVao = (_c = this.circle3DProgram).createVAO.apply(_c, ["centerCoords3d", "targetCoords3d", "rgbaCircle", "circleDashAngle", "dashOpacity"
|
|
355
|
+
].map(function (key) { return obj_1(key); }));
|
|
335
356
|
}
|
|
336
|
-
}
|
|
337
|
-
_updateTexts(chainKeys, textWriterIDs) {
|
|
357
|
+
};
|
|
358
|
+
CircleLineChainPlugin.prototype._updateTexts = function (chainKeys, textWriterIDs) {
|
|
359
|
+
var _this = this;
|
|
338
360
|
if (textWriterIDs.length === 0)
|
|
339
361
|
return;
|
|
340
|
-
|
|
341
|
-
chainKeys.forEach((chainKey)
|
|
342
|
-
|
|
362
|
+
var textWriters = textWriterGetOrThrow(this._textWritersMap, textWriterIDs);
|
|
363
|
+
chainKeys.forEach(function (chainKey) {
|
|
364
|
+
_this._chainListMap.textUpdate(chainKey, textWriters, _this._textDataPreAdaptor);
|
|
343
365
|
});
|
|
344
|
-
}
|
|
345
|
-
_reconstructChains(chainKeys) {
|
|
346
|
-
|
|
366
|
+
};
|
|
367
|
+
CircleLineChainPlugin.prototype._reconstructChains = function (chainKeys) {
|
|
368
|
+
var _this = this;
|
|
369
|
+
var globe = this.globe;
|
|
347
370
|
// const radiusM = radiusMethod(globe);
|
|
348
|
-
|
|
371
|
+
var callback = function (v, i, array, chainProperties) {
|
|
349
372
|
var _a, _b;
|
|
350
373
|
if (i === array.length - 1)
|
|
351
374
|
return null;
|
|
352
|
-
|
|
353
|
-
|
|
375
|
+
var centerCoords2dflat = (0, circle_accurate_flat_1.centerCoords2dflatDataCreator)(globe, v.long, v.lat, array[i + 1].long, array[i + 1].lat, { edgeCount: _this._circleFlatEdgeCount });
|
|
376
|
+
var altitude = ((_b = (_a = v.altitude) !== null && _a !== void 0 ? _a : chainProperties.altitude) !== null && _b !== void 0 ? _b : 0) / 1000;
|
|
354
377
|
return {
|
|
355
378
|
chainProperties: chainProperties,
|
|
356
379
|
// bigRadius: radiusM(v, i, array),
|
|
@@ -361,52 +384,53 @@ class CircleLineChainPlugin {
|
|
|
361
384
|
lat: v.lat,
|
|
362
385
|
lineProperties: v.lineProperties,
|
|
363
386
|
circleProperties: v.circleProperties,
|
|
364
|
-
centerCoords2dflat,
|
|
387
|
+
centerCoords2dflat: centerCoords2dflat,
|
|
365
388
|
key: v.__identity__
|
|
366
389
|
};
|
|
367
390
|
};
|
|
368
|
-
|
|
369
|
-
chainKeys.forEach((k)
|
|
370
|
-
|
|
391
|
+
var bulkData = [];
|
|
392
|
+
chainKeys.forEach(function (k) {
|
|
393
|
+
_this._chainListMap.calculateBufferPropertiesChain(k, callback, bulkData);
|
|
371
394
|
});
|
|
372
395
|
this._insertBulk(bulkData);
|
|
373
|
-
}
|
|
374
|
-
_insertBulk(bulkData) {
|
|
396
|
+
};
|
|
397
|
+
CircleLineChainPlugin.prototype._insertBulk = function (bulkData) {
|
|
375
398
|
this.bufferOrchestrator.insertBulk(bulkData, this.bufferManagersCompMap);
|
|
376
399
|
this.globe.DrawRender();
|
|
377
|
-
}
|
|
400
|
+
};
|
|
378
401
|
// GLOBE API
|
|
379
|
-
free() {
|
|
402
|
+
CircleLineChainPlugin.prototype.free = function () {
|
|
380
403
|
if (this.isFreed)
|
|
381
404
|
return;
|
|
382
|
-
this.bufferManagersCompMap.forEach((
|
|
405
|
+
this.bufferManagersCompMap.forEach(function (_a) {
|
|
406
|
+
var bufferManager = _a.bufferManager;
|
|
383
407
|
bufferManager.free();
|
|
384
408
|
});
|
|
385
409
|
naive_accurate_flexible_1.LineOnGlobeCache.release(this.globe);
|
|
386
410
|
circle_accurate_flat_1.CircleCache.release(this.globe);
|
|
387
411
|
circle_accurate_3d_1.CircleCache.release(this.globe);
|
|
388
412
|
// LineToTheOriginCache.release(this.globe);
|
|
389
|
-
this._textWritersMap.forEach((writer)
|
|
390
|
-
|
|
413
|
+
this._textWritersMap.forEach(function (writer) { return writer.free(); });
|
|
414
|
+
var gl = this.gl;
|
|
391
415
|
gl.deleteVertexArray(this.lineVao);
|
|
392
416
|
gl.deleteVertexArray(this.circleVao2d);
|
|
393
417
|
gl.deleteVertexArray(this.circle3DVao);
|
|
394
418
|
this.lineProgram = null;
|
|
395
419
|
this.circleProgram2d = null;
|
|
396
420
|
this.isFreed = true;
|
|
397
|
-
}
|
|
398
|
-
draw3D() {
|
|
399
|
-
|
|
421
|
+
};
|
|
422
|
+
CircleLineChainPlugin.prototype.draw3D = function () {
|
|
423
|
+
var _a = this, gl = _a.gl, globe = _a.globe;
|
|
400
424
|
gl.disable(gl.DEPTH_TEST);
|
|
401
|
-
|
|
425
|
+
var drawOptions = {
|
|
402
426
|
drawRange: {
|
|
403
427
|
first: 0,
|
|
404
428
|
count: this.bufferOrchestrator.length
|
|
405
429
|
}
|
|
406
430
|
};
|
|
407
431
|
this.lineProgram.draw(this.lineVao, drawOptions, this._opacity);
|
|
408
|
-
this._textWritersMap.forEach((writer)
|
|
409
|
-
|
|
432
|
+
this._textWritersMap.forEach(function (writer) { return writer.draw(); });
|
|
433
|
+
var is3D = globe.api_GetCurrentGeometry() === 0;
|
|
410
434
|
if (this._drawCircleOn) {
|
|
411
435
|
if (is3D) {
|
|
412
436
|
this.circle3DProgram.draw(this.circle3DVao, this.bufferOrchestrator.length, this._opacity);
|
|
@@ -416,8 +440,9 @@ class CircleLineChainPlugin {
|
|
|
416
440
|
}
|
|
417
441
|
}
|
|
418
442
|
gl.enable(gl.DEPTH_TEST);
|
|
419
|
-
}
|
|
420
|
-
|
|
443
|
+
};
|
|
444
|
+
return CircleLineChainPlugin;
|
|
445
|
+
}());
|
|
421
446
|
exports.CircleLineChainPlugin = CircleLineChainPlugin;
|
|
422
447
|
// const radiusMethod = (globe) => (v, i, array) => {
|
|
423
448
|
// return globe.Math.GetDist3D(v.long, v.lat, array[i + 1].long, array[i + 1].lat)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keyMethod = void 0;
|
|
4
|
-
|
|
4
|
+
var keyMethod = function (chainKey, nodeKey) { return "".concat(chainKey, "_").concat(nodeKey); };
|
|
5
5
|
exports.keyMethod = keyMethod;
|