@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const webglobe_1 = require("@pirireis/webglobe");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const fidKey = "__fid__";
|
|
6
|
+
const object = {
|
|
7
7
|
"displayName": "RangeRingAngleText",
|
|
8
8
|
"layerType": 3,
|
|
9
9
|
"wkbGeom": null,
|
|
@@ -16,15 +16,14 @@ var object = {
|
|
|
16
16
|
"MVTXYZName": "hd_seyp",
|
|
17
17
|
"rasterize": false,
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.style, style = _c === void 0 ? null : _c, _d = _b.hideAll, hideAll = _d === void 0 ? false : _d, _e = _b.opacity, opacity = _e === void 0 ? 1 : _e;
|
|
19
|
+
class RangeRingAngleText {
|
|
20
|
+
constructor(globe, id, { style = null, hideAll = false, opacity = 1 } = {}) {
|
|
22
21
|
this.globe = globe;
|
|
23
22
|
this.ObjectArray = globe.ObjectArray;
|
|
24
23
|
this.id = id;
|
|
25
24
|
this._hideAll = hideAll;
|
|
26
25
|
this._opacity = opacity;
|
|
27
|
-
|
|
26
|
+
const style_ = style !== null ? style : this.getDefaultStyle();
|
|
28
27
|
this.object = Object.assign({}, object, { style: style_, id: this.id });
|
|
29
28
|
this._centerCollection = new Map();
|
|
30
29
|
// new inner MAP params
|
|
@@ -32,11 +31,11 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
32
31
|
// textHide
|
|
33
32
|
this.ObjectArray.Add(this.object);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
getDefaultStyle() {
|
|
35
|
+
const style = this.ObjectArray.GetDefaultStyle();
|
|
37
36
|
style.fidKey = fidKey;
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const { labels } = style;
|
|
38
|
+
const label = labels[0];
|
|
40
39
|
label.offset = { x: 0, y: 0 };
|
|
41
40
|
label.fontFamily.hollowWidth = 1;
|
|
42
41
|
label.vAlignment = 2;
|
|
@@ -45,24 +44,24 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
45
44
|
// eslint-disable-next-line
|
|
46
45
|
label.text = "`${aci}`";
|
|
47
46
|
return style;
|
|
48
|
-
}
|
|
49
|
-
|
|
47
|
+
}
|
|
48
|
+
setStyle(style) {
|
|
50
49
|
if (style === null)
|
|
51
50
|
return;
|
|
52
51
|
style.opacity = this._opacity;
|
|
53
52
|
this.object.style = style;
|
|
54
53
|
this.ObjectArray.StyleChanged(this.object);
|
|
55
|
-
}
|
|
56
|
-
|
|
54
|
+
}
|
|
55
|
+
setOpacity(opacity) {
|
|
57
56
|
this._opacity = opacity;
|
|
58
|
-
|
|
57
|
+
const { style } = this.object;
|
|
59
58
|
style.opacity = opacity;
|
|
60
59
|
this.ObjectArray.StyleChanged(this.object);
|
|
61
|
-
}
|
|
62
|
-
|
|
60
|
+
}
|
|
61
|
+
free() {
|
|
63
62
|
this.flush();
|
|
64
63
|
this.ObjectArray.Delete(this.id);
|
|
65
|
-
}
|
|
64
|
+
}
|
|
66
65
|
/**
|
|
67
66
|
* @param {Array<{centerID,stepAngle, long,lat, rings>} ringDatas
|
|
68
67
|
* centerID: string | ObjectArray fidKey de kullanilir
|
|
@@ -73,29 +72,25 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
73
72
|
* eger bir centerID zaten var ise: Onceki noktalar dusurulur ve yeniden eklenir
|
|
74
73
|
*
|
|
75
74
|
* */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
insertBulk(ringDatas) {
|
|
76
|
+
const { _hideAll } = this;
|
|
77
|
+
const addBucket = {
|
|
79
78
|
coords: [],
|
|
80
79
|
coordsZ: [],
|
|
81
80
|
attribs: []
|
|
82
81
|
};
|
|
83
|
-
|
|
82
|
+
const deleteBucket = {
|
|
84
83
|
coords: [],
|
|
85
84
|
coordsZ: [],
|
|
86
85
|
attribs: []
|
|
87
86
|
};
|
|
88
|
-
for (
|
|
89
|
-
var _a = ringDatas_1[_i], centerID = _a.centerID, long = _a.long, lat = _a.lat, rings = _a.rings, stepAngle = _a.stepAngle, _b = _a.hide, hide = _b === void 0 ? enum_1.ENUM_HIDE.SHOW : _b, _c = _a.textHide, textHide = _c === void 0 ? enum_1.ENUM_TEXT_HIDE.SHOW : _c;
|
|
87
|
+
for (const { centerID, long, lat, rings, stepAngle, hide = enum_1.ENUM_HIDE.SHOW, textHide = enum_1.ENUM_TEXT_HIDE.SHOW } of ringDatas) {
|
|
90
88
|
if (this._centerCollection.has(centerID)) {
|
|
91
89
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
92
90
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}, 0);
|
|
97
|
-
var textHide_ = _hideAll ? enum_1.ENUM_TEXT_HIDE.HIDE : textHide;
|
|
98
|
-
var show = hide !== enum_1.ENUM_HIDE.HIDE && textHide_ === enum_1.ENUM_TEXT_HIDE.SHOW;
|
|
91
|
+
const maxRadius = rings.reduce((acc, { radius }) => Math.max(acc, radius), 0);
|
|
92
|
+
const textHide_ = _hideAll ? enum_1.ENUM_TEXT_HIDE.HIDE : textHide;
|
|
93
|
+
const show = hide !== enum_1.ENUM_HIDE.HIDE && textHide_ === enum_1.ENUM_TEXT_HIDE.SHOW;
|
|
99
94
|
if (show)
|
|
100
95
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
|
|
101
96
|
this._centerCollection.set(centerID, new Map([
|
|
@@ -113,30 +108,29 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
113
108
|
this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
114
109
|
if (addBucket.coords.length > 0)
|
|
115
110
|
this._updateData(addBucket, webglobe_1.CSObjectArrayUpdateTypes.ADD);
|
|
116
|
-
}
|
|
111
|
+
}
|
|
117
112
|
/**
|
|
118
113
|
* @param {Array<{centerID, x,y}>} centerDatas
|
|
119
114
|
* aci ve radiuslarin tutulmasi gereklidir.
|
|
120
115
|
* */
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
updateCentersXY(centerDatas) {
|
|
117
|
+
const updateBucket = {
|
|
123
118
|
coords: [],
|
|
124
119
|
coordsZ: [],
|
|
125
120
|
attribs: []
|
|
126
121
|
};
|
|
127
|
-
for (
|
|
128
|
-
var _a = centerDatas_1[_i], centerID = _a.centerID, long = _a.long, lat = _a.lat;
|
|
122
|
+
for (const { centerID, long, lat } of centerDatas) {
|
|
129
123
|
if (this._centerCollection.has(centerID)) {
|
|
130
|
-
|
|
124
|
+
const centerMap = this._centerCollection.get(centerID);
|
|
131
125
|
centerMap.set("long", long);
|
|
132
126
|
centerMap.set("lat", lat);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
const hide = centerMap.get("hide");
|
|
128
|
+
const textHide = centerMap.get("textHide");
|
|
129
|
+
const isHidden = hide === enum_1.ENUM_HIDE.HIDE || textHide === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
136
130
|
if (isHidden)
|
|
137
131
|
continue;
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
const maxRadius = centerMap.get("maxRadius");
|
|
133
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
140
134
|
// long, lat, radius, step, centerID, outBucket
|
|
141
135
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
|
|
142
136
|
}
|
|
@@ -147,36 +141,35 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
147
141
|
if (updateBucket.coords.length > 0) {
|
|
148
142
|
this._updateData(updateBucket, webglobe_1.CSObjectArrayUpdateTypes.UPDATE);
|
|
149
143
|
}
|
|
150
|
-
}
|
|
144
|
+
}
|
|
151
145
|
/**
|
|
152
146
|
*
|
|
153
147
|
* @param {Array<{centerID:string, hide: bool}>} centerHides
|
|
154
148
|
*/
|
|
155
|
-
|
|
149
|
+
updateCentersHide(centerHides) {
|
|
156
150
|
if (this._hideAll) {
|
|
157
151
|
console.warn("Tum mesafe halkasi yazilari gizli durum. Islem yapilamaz");
|
|
158
152
|
return;
|
|
159
153
|
}
|
|
160
154
|
;
|
|
161
|
-
|
|
155
|
+
const addBucket = {
|
|
162
156
|
coords: [],
|
|
163
157
|
coordsZ: [],
|
|
164
158
|
attribs: []
|
|
165
159
|
};
|
|
166
|
-
|
|
160
|
+
const deleteBucket = {
|
|
167
161
|
coords: [],
|
|
168
162
|
coordsZ: [],
|
|
169
163
|
attribs: []
|
|
170
164
|
};
|
|
171
|
-
for (
|
|
172
|
-
var _a = centerHides_1[_i], centerID = _a.centerID, _b = _a.textHide, textHide = _b === void 0 ? null : _b, _c = _a.hide, hide = _c === void 0 ? null : _c;
|
|
165
|
+
for (const { centerID, textHide = null, hide = null } of centerHides) {
|
|
173
166
|
if (!this._centerCollection.has(centerID))
|
|
174
167
|
continue;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
const centerMap = this._centerCollection.get(centerID);
|
|
169
|
+
const isHidden = centerMap.get("hide") === enum_1.ENUM_HIDE.HIDE || centerMap.get("textHide") === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
170
|
+
const _hide = hide !== null ? hide : centerMap.get("hide");
|
|
171
|
+
const _textHide = textHide !== null ? textHide : centerMap.get("textHide");
|
|
172
|
+
const show = (_hide !== enum_1.ENUM_HIDE.HIDE) && (_textHide === enum_1.ENUM_TEXT_HIDE.SHOW);
|
|
180
173
|
if (!isHidden && !show) {
|
|
181
174
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
182
175
|
}
|
|
@@ -192,62 +185,59 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
192
185
|
this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
193
186
|
if (addBucket.coords.length > 0)
|
|
194
187
|
this._updateData(addBucket, webglobe_1.CSObjectArrayUpdateTypes.ADD);
|
|
195
|
-
}
|
|
188
|
+
}
|
|
196
189
|
// TODO : Implement this
|
|
197
|
-
|
|
198
|
-
|
|
190
|
+
removeCenters(centerIDs) {
|
|
191
|
+
const deleteBucket = {
|
|
199
192
|
coords: [],
|
|
200
193
|
coordsZ: [],
|
|
201
194
|
attribs: []
|
|
202
195
|
};
|
|
203
|
-
for (
|
|
204
|
-
var centerID = centerIDs_1[_i];
|
|
196
|
+
for (const centerID of centerIDs) {
|
|
205
197
|
if (this._centerCollection.has(centerID)) {
|
|
206
198
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
207
199
|
this._centerCollection.delete(centerID);
|
|
208
200
|
}
|
|
209
201
|
}
|
|
210
202
|
this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
211
|
-
}
|
|
212
|
-
|
|
203
|
+
}
|
|
204
|
+
hideAll() {
|
|
213
205
|
this._hideAll = true;
|
|
214
|
-
|
|
206
|
+
const deleteBucket = {
|
|
215
207
|
coords: [],
|
|
216
208
|
coordsZ: [],
|
|
217
209
|
attribs: []
|
|
218
210
|
};
|
|
219
|
-
for (
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
var hideText = centerMap.get("textHide");
|
|
211
|
+
for (const [centerID, centerMap] of this._centerCollection) {
|
|
212
|
+
const hide = centerMap.get("hide");
|
|
213
|
+
const hideText = centerMap.get("textHide");
|
|
223
214
|
centerMap.set("textHide", enum_1.ENUM_TEXT_HIDE.HIDE);
|
|
224
215
|
if (hide === enum_1.ENUM_HIDE.HIDE)
|
|
225
216
|
continue;
|
|
226
|
-
|
|
217
|
+
const isHidden = hideText === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
227
218
|
if (!isHidden)
|
|
228
219
|
this._fillDeleteBucket(centerID, deleteBucket);
|
|
229
220
|
}
|
|
230
221
|
this._updateData(deleteBucket, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
231
|
-
}
|
|
232
|
-
|
|
222
|
+
}
|
|
223
|
+
showAll() {
|
|
233
224
|
this._hideAll = false;
|
|
234
|
-
|
|
225
|
+
const addBucket = {
|
|
235
226
|
coords: [],
|
|
236
227
|
coordsZ: [],
|
|
237
228
|
attribs: []
|
|
238
229
|
};
|
|
239
|
-
for (
|
|
240
|
-
|
|
241
|
-
var hide = centerMap.get("hide");
|
|
230
|
+
for (const [centerID, centerMap] of this._centerCollection) {
|
|
231
|
+
const hide = centerMap.get("hide");
|
|
242
232
|
if (hide === enum_1.ENUM_HIDE.HIDE)
|
|
243
233
|
continue;
|
|
244
|
-
|
|
245
|
-
|
|
234
|
+
const hideText = centerMap.get("textHide");
|
|
235
|
+
const isHidden = hideText === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
246
236
|
if (isHidden) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
237
|
+
const long = centerMap.get("long");
|
|
238
|
+
const lat = centerMap.get("lat");
|
|
239
|
+
const maxRadius = centerMap.get("maxRadius");
|
|
240
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
251
241
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, addBucket);
|
|
252
242
|
centerMap.set("hide", enum_1.ENUM_HIDE.SHOW);
|
|
253
243
|
centerMap.set("textHide", enum_1.ENUM_TEXT_HIDE.SHOW);
|
|
@@ -255,29 +245,29 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
255
245
|
}
|
|
256
246
|
if (addBucket.coords.length)
|
|
257
247
|
this._updateData(addBucket, webglobe_1.CSObjectArrayUpdateTypes.ADD);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
248
|
+
}
|
|
249
|
+
flush() {
|
|
250
|
+
const data = {
|
|
261
251
|
coords: [],
|
|
262
252
|
coordsZ: [],
|
|
263
253
|
attribs: []
|
|
264
254
|
};
|
|
265
255
|
this._idCollector = new Set();
|
|
266
256
|
this.ObjectArray.SetData(this.object, data);
|
|
267
|
-
}
|
|
257
|
+
}
|
|
268
258
|
//------------------PRIVATE METHODS------------------//
|
|
269
|
-
|
|
259
|
+
_appendCircle(long, lat, radius, step, centerID, outBucket) {
|
|
270
260
|
this.__realCoords(long, lat, radius, step, centerID, outBucket);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
for (
|
|
277
|
-
|
|
261
|
+
}
|
|
262
|
+
__realCoords(longCenter, latCenter, radius, stepAngle, centerID, outBucket) {
|
|
263
|
+
const { globe } = this;
|
|
264
|
+
const { coords, coordsZ, attribs } = outBucket;
|
|
265
|
+
let i = 1;
|
|
266
|
+
for (let aci = stepAngle; aci < 360; aci += stepAngle) {
|
|
267
|
+
const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, aci);
|
|
278
268
|
coords.push(long, lat);
|
|
279
269
|
coordsZ.push(0);
|
|
280
|
-
|
|
270
|
+
const key = this._key(centerID, i);
|
|
281
271
|
i++;
|
|
282
272
|
// fidkey is the key
|
|
283
273
|
attribs.push({
|
|
@@ -286,56 +276,54 @@ var RangeRingAngleText = /** @class */ (function () {
|
|
|
286
276
|
});
|
|
287
277
|
}
|
|
288
278
|
{ // add 0
|
|
289
|
-
|
|
279
|
+
const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, 0);
|
|
290
280
|
coords.push(long, lat);
|
|
291
281
|
coordsZ.push(0);
|
|
292
|
-
|
|
282
|
+
const key = this._key(centerID, 0);
|
|
293
283
|
// fidkey is the key
|
|
294
284
|
attribs.push({
|
|
295
285
|
"__fid__": key,
|
|
296
286
|
"aci": "K"
|
|
297
287
|
});
|
|
298
288
|
}
|
|
299
|
-
}
|
|
300
|
-
|
|
289
|
+
}
|
|
290
|
+
_updateData(bucket, mode) {
|
|
301
291
|
this.ObjectArray.UpdateData(this.object, mode, [bucket], { attribs: false, icon: false, text: false });
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
return
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
for (
|
|
312
|
-
|
|
292
|
+
}
|
|
293
|
+
_key(centerRingKey, limpIndex) {
|
|
294
|
+
return `${centerRingKey}_${limpIndex}`;
|
|
295
|
+
}
|
|
296
|
+
_fillDeleteBucket(centerID, outDeleteBucket) {
|
|
297
|
+
const centerMap = this._centerCollection.get(centerID);
|
|
298
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
299
|
+
const { coords, coordsZ, attribs } = outDeleteBucket;
|
|
300
|
+
let i = 0;
|
|
301
|
+
for (let aci = 0; aci < 360; aci += stepAngle) {
|
|
302
|
+
const key = this._key(centerID, i++);
|
|
313
303
|
coords.push(0, 0);
|
|
314
304
|
coordsZ.push(0);
|
|
315
305
|
attribs.push({
|
|
316
306
|
"__fid__": key,
|
|
317
307
|
});
|
|
318
308
|
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
309
|
+
}
|
|
310
|
+
_updateAll() {
|
|
311
|
+
const updateBucket = {
|
|
322
312
|
coords: [],
|
|
323
313
|
coordsZ: [],
|
|
324
314
|
attribs: []
|
|
325
315
|
};
|
|
326
|
-
for (
|
|
327
|
-
|
|
328
|
-
var isHidden = centerMap.get("hide") === enum_1.ENUM_HIDE.HIDE || centerMap.get("textHide") === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
316
|
+
for (const [centerID, centerMap] of this._centerCollection) {
|
|
317
|
+
const isHidden = centerMap.get("hide") === enum_1.ENUM_HIDE.HIDE || centerMap.get("textHide") === enum_1.ENUM_TEXT_HIDE.HIDE;
|
|
329
318
|
if (isHidden)
|
|
330
319
|
continue;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
320
|
+
const long = centerMap.get("long");
|
|
321
|
+
const lat = centerMap.get("lat");
|
|
322
|
+
const maxRadius = centerMap.get("maxRadius");
|
|
323
|
+
const stepAngle = centerMap.get("stepAngle");
|
|
335
324
|
this._appendCircle(long, lat, maxRadius, stepAngle, centerID, updateBucket);
|
|
336
325
|
}
|
|
337
326
|
this._updateData(updateBucket, webglobe_1.CSObjectArrayUpdateTypes.UPDATE);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
}());
|
|
327
|
+
}
|
|
328
|
+
}
|
|
341
329
|
exports.default = RangeRingAngleText;
|
|
@@ -3,58 +3,48 @@
|
|
|
3
3
|
* This account interacts with buffer orchestrations and buffers.
|
|
4
4
|
* For rings, coordinates and paddings
|
|
5
5
|
*/
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
7
|
exports.ringBigPaddingKeyMethod = exports.ringKeyMethod = exports.RingAccount = void 0;
|
|
19
|
-
|
|
8
|
+
const ringKeyMethod = (centerID, ringID) => `${centerID}_${ringID}`;
|
|
20
9
|
exports.ringKeyMethod = ringKeyMethod;
|
|
21
|
-
|
|
10
|
+
const ringBigPaddingKeyMethod = (centerID, ringID, angle) => `${centerID}_${ringID}_${angle}`;
|
|
22
11
|
exports.ringBigPaddingKeyMethod = ringBigPaddingKeyMethod;
|
|
23
12
|
/**
|
|
24
13
|
* @typedef { Array < { ringID, radius, paddingRange } >} rings
|
|
25
14
|
* @param { Array < centerID: string, x: number, y: number, stepAngle: number, rgba: [4 numbers], rings: rings } items
|
|
26
15
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
class RingAccount {
|
|
17
|
+
constructor() {
|
|
29
18
|
this._centralMap = new Map(); // key, new MAP(x,y, rings:[])
|
|
30
19
|
}
|
|
31
20
|
/**
|
|
32
21
|
* @typedef {centerID, long,lat, rings} centralItem
|
|
33
22
|
*
|
|
34
23
|
*/
|
|
35
|
-
|
|
36
|
-
centralItem.rings.forEach(
|
|
24
|
+
insertCenter(centralItem) {
|
|
25
|
+
centralItem.rings.forEach((ring) => {
|
|
37
26
|
ring.__identity__ = ringKeyMethod(centralItem.centerID, ring.ringID);
|
|
38
27
|
});
|
|
39
|
-
this._centralMap.set(centralItem.centerID,
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
this._centralMap.set(centralItem.centerID, {
|
|
29
|
+
...centralItem,
|
|
30
|
+
rgba: new Float32Array(centralItem.rgba),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
getCenter(centerID) {
|
|
42
34
|
return this._centralMap.get(centerID);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (
|
|
46
|
-
|
|
47
|
-
var center = this.getCenter(centerID);
|
|
35
|
+
}
|
|
36
|
+
updateCentersCoordinate(items) {
|
|
37
|
+
for (const { centerID, long, lat } of items) {
|
|
38
|
+
const center = this.getCenter(centerID);
|
|
48
39
|
if (center) {
|
|
49
40
|
center.long = long;
|
|
50
41
|
center.lat = lat;
|
|
51
42
|
}
|
|
52
43
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
for (
|
|
56
|
-
|
|
57
|
-
var center = this.getCenter(centerID);
|
|
44
|
+
}
|
|
45
|
+
updateCentersHide(items) {
|
|
46
|
+
for (const { centerID, hide = null, textHide = null } of items) {
|
|
47
|
+
const center = this.getCenter(centerID);
|
|
58
48
|
if (center) {
|
|
59
49
|
if (hide !== null)
|
|
60
50
|
center.hide = hide;
|
|
@@ -62,73 +52,66 @@ var RingAccount = /** @class */ (function () {
|
|
|
62
52
|
center.textHide = textHide;
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
|
-
}
|
|
55
|
+
}
|
|
66
56
|
/**
|
|
67
57
|
*
|
|
68
58
|
* @param {Array<{centerID, rgba}>} centersColor
|
|
69
59
|
*/
|
|
70
|
-
|
|
71
|
-
for (
|
|
72
|
-
|
|
73
|
-
var center = this.getCenter(centerID);
|
|
60
|
+
updateCentersColor(centersColor) {
|
|
61
|
+
for (const { centerID, rgba } of centersColor) {
|
|
62
|
+
const center = this.getCenter(centerID);
|
|
74
63
|
if (center) {
|
|
75
64
|
center.rgba = new Float32Array(rgba);
|
|
76
65
|
}
|
|
77
66
|
}
|
|
78
|
-
}
|
|
67
|
+
}
|
|
79
68
|
// to delete rings and one degree paddings from buffer
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
ringKeys(centerID) {
|
|
70
|
+
const result = [];
|
|
71
|
+
const center = this.getCenter(centerID);
|
|
83
72
|
if (center) {
|
|
84
|
-
|
|
85
|
-
for (
|
|
86
|
-
var __identity__ = rings_1[_i].__identity__;
|
|
73
|
+
const rings = center.rings;
|
|
74
|
+
for (const { __identity__ } of rings) {
|
|
87
75
|
result.push(__identity__);
|
|
88
76
|
}
|
|
89
77
|
}
|
|
90
78
|
return result;
|
|
91
|
-
}
|
|
79
|
+
}
|
|
92
80
|
// To delete big paddings from buffer
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
ringBigPaddingKeys(centerID) {
|
|
82
|
+
const result = [];
|
|
83
|
+
const center = this.getCenter(centerID);
|
|
96
84
|
if (!center)
|
|
97
85
|
return [];
|
|
98
|
-
|
|
99
|
-
for (
|
|
100
|
-
|
|
101
|
-
var angle = 0;
|
|
86
|
+
const { rings, stepAngle } = center;
|
|
87
|
+
for (const { ringID } of rings) {
|
|
88
|
+
let angle = 0;
|
|
102
89
|
while (angle < 360) {
|
|
103
90
|
result.push(ringBigPaddingKeyMethod(centerID, ringID, angle));
|
|
104
91
|
angle += stepAngle;
|
|
105
92
|
}
|
|
106
93
|
}
|
|
107
94
|
return result;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
centerIDs.forEach(
|
|
95
|
+
}
|
|
96
|
+
removeCenters(centerIDs) {
|
|
97
|
+
const centralMap = this._centralMap;
|
|
98
|
+
centerIDs.forEach((centerID) => {
|
|
112
99
|
centralMap.delete(centerID);
|
|
113
100
|
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var center = this.getCenter(centerID);
|
|
101
|
+
}
|
|
102
|
+
textUpdate(centerID, textWriterObjs, dataPreAdaptor = null) {
|
|
103
|
+
const center = this.getCenter(centerID);
|
|
118
104
|
if (!center)
|
|
119
105
|
return;
|
|
120
|
-
|
|
121
|
-
textWriterObjs.forEach(
|
|
106
|
+
const data = (dataPreAdaptor) ? dataPreAdaptor(center) : center;
|
|
107
|
+
textWriterObjs.forEach((writer) => {
|
|
122
108
|
writer.insertTextBulk(data.rings, data);
|
|
123
109
|
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this._centralMap.forEach(function (center) {
|
|
129
|
-
_this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
|
|
110
|
+
}
|
|
111
|
+
updateAllText(textWriterObjs, dataPreAdaptor = null) {
|
|
112
|
+
this._centralMap.forEach((center) => {
|
|
113
|
+
this.textUpdate(center.centerID, textWriterObjs, dataPreAdaptor);
|
|
130
114
|
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
}());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
134
117
|
exports.RingAccount = RingAccount;
|