@pirireis/webglobeplugins 0.8.6 → 0.8.7
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/bearing-line/plugin.js +51 -43
- package/circle-line-chain/plugin.js +52 -44
- package/compass-rose/compass-rose-padding-flat.js +3 -0
- package/compassrose/compassrose.js +1 -8
- package/heatwave/isobar/plugin.js +4 -1
- package/heatwave/isobar/quadtreecontours.js +0 -2
- package/heatwave/plugins/heatwaveglobeshell.js +2 -0
- package/package.json +1 -1
- package/partialrings/goals.md +2 -0
- package/partialrings/plugin.js +2 -1
- package/point-glow-line-to-earth/draw-subset-obj.js +27 -0
- package/point-glow-line-to-earth/keymethod.js +0 -0
- package/point-glow-line-to-earth/plugin.js +439 -0
- package/point-glow-line-to-earth/types.js +26 -0
- package/point-heat-map/index.js +0 -3
- package/point-heat-map/plugin-webworker.js +4 -9
- package/point-heat-map/point-to-heat-map-flow.js +0 -6
- package/point-tracks/plugin.js +4 -4
- package/programs/arrowfield/logic.js +6 -4
- package/programs/arrowfield/object.js +1 -1
- package/programs/float2legendwithratio/object.js +5 -4
- package/programs/globe-util/is-globe-moved.js +27 -0
- package/programs/globeshell/wiggle/logic.js +3 -7
- package/programs/globeshell/wiggle/object.js +1 -2
- package/programs/line-on-globe/circle-accurate-3d.js +16 -23
- package/programs/line-on-globe/circle-accurate-flat.js +21 -21
- package/programs/line-on-globe/lines-color-instanced-flat.js +6 -7
- package/programs/line-on-globe/naive-accurate-flexible.js +239 -0
- package/programs/line-on-globe/to-the-surface.js +129 -0
- package/programs/picking/pickable-renderer.js +216 -0
- package/programs/point-on-globe/element-globe-surface-glow.js +168 -0
- package/programs/point-on-globe/element-point-glow.js +184 -0
- package/programs/point-on-globe/square-pixel-point.js +2 -4
- package/programs/programcache.js +9 -0
- package/programs/rings/partial-ring/piece-of-pie.js +1 -1
- package/programs/totems/camerauniformblock.js +23 -2
- package/rangerings/plugin.js +9 -6
- package/shaders/fragment-toy/firework.js +55 -0
- package/shaders/fragment-toy/singularity.js +59 -0
- package/types.js +16 -0
- package/util/account/single-attribute-buffer-management/buffer-manager.js +1 -5
- package/util/account/util.js +17 -7
- package/util/check/typecheck.js +11 -0
- package/util/gl-util/buffer/integrate-buffer.js +74 -0
- package/util/gl-util/draw-options/client.js +59 -0
- package/util/gl-util/draw-options/methods.js +46 -0
- package/util/gl-util/draw-options/types.js +18 -0
- package/util/gl-util/uniform-block/manager.js +176 -0
- package/util/gl-util/uniform-block/roadmap.md +70 -0
- package/util/gl-util/uniform-block/shader.js +0 -0
- package/util/gl-util/uniform-block/types.js +7 -0
- package/util/jshelpers/equality.js +17 -0
- package/util/picking/picker-displayer.js +1 -1
- package/util/programs/shapesonglobe.js +17 -19
- package/util/shaderfunctions/geometrytransformations.js +27 -63
- package/bearing-line/roadmap.md +0 -15
- package/point-heat-map/plugin.js +0 -132
- package/programs/line-on-globe/naive-accurate.js +0 -221
- package/programs/line-on-globe/to-the-origin.js +0 -164
- package/util/jshelpers/timemethods.js +0 -19
- /package/{programs/point-on-globe/element-draw-glow.js → point-glow-line-to-earth/adaptors.js} +0 -0
package/bearing-line/plugin.js
CHANGED
|
@@ -1,24 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LineOnGlobeCache } from '../programs/line-on-globe/naive-accurate';
|
|
1
|
+
import { PieceOfPieProgramCache } from '../programs/rings/partial-ring/piece-of-pie';
|
|
2
|
+
import { LineOnGlobeCache } from '../programs/line-on-globe/naive-accurate-flexible';
|
|
3
3
|
import { CircleCache as Circle3DCache } from '../programs/line-on-globe/circle-accurate-3d';
|
|
4
4
|
import { CircleCache, EDGE_COUNT as flatCircleEdgeCount, centerCoords2dflatDataCreator } from '../programs/line-on-globe/circle-accurate-flat';
|
|
5
5
|
import { BufferOrchestrator, BufferManager } from '../util/account';
|
|
6
6
|
import { mapGetOrThrow } from "../util/check/get";
|
|
7
7
|
import { populateFloat32Array } from "../util/jshelpers/data-filler";
|
|
8
8
|
import { ContextTextWriter3 } from '../write-text/context-text3'
|
|
9
|
+
import { constraintFloat, isBoolean } from '../util/check/typecheck';
|
|
9
10
|
|
|
11
|
+
import { createBufferAndReadInfo } from '../util/gl-util/buffer/integrate-buffer';
|
|
10
12
|
|
|
11
13
|
export const RINGPARTIAL_DRAW_MODE = Object.freeze({
|
|
12
14
|
LINE_STRIP: "LINE_STRIP",
|
|
13
15
|
TRIANGLE_FAN: "TRIANGLE_FAN",
|
|
14
16
|
});
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const textWriterGetOrThrow = mapGetOrThrow("BearingLine textContextInjection id does not exist in map")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const radian = (degree) => degree * Math.PI / 180;
|
|
24
|
+
|
|
25
|
+
const integralSec = (angle) => {
|
|
26
|
+
return Math.log(Math.tan(angle / 2 + Math.PI / 4));
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
|
|
30
|
+
const calculateStartAngle = (long, lat, endLong, endLat) => {
|
|
31
|
+
const dLat = (integralSec(endLat) - integralSec(lat)); // Because lines are strectes toward poles.
|
|
32
|
+
const dLong = endLong - long;
|
|
33
|
+
|
|
34
|
+
let angle = -Math.atan2(dLat, dLong);
|
|
35
|
+
return angle;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
22
40
|
export default class BearingLinePlugin {
|
|
23
41
|
/**
|
|
24
42
|
* @param {*} id
|
|
@@ -52,6 +70,7 @@ export default class BearingLinePlugin {
|
|
|
52
70
|
|
|
53
71
|
|
|
54
72
|
setDoDrawVRM(bool) {
|
|
73
|
+
isBoolean(bool);
|
|
55
74
|
if (bool === this.drawVRM) return;
|
|
56
75
|
this.drawVRM = bool;
|
|
57
76
|
this.globe.DrawRender();
|
|
@@ -59,6 +78,7 @@ export default class BearingLinePlugin {
|
|
|
59
78
|
|
|
60
79
|
|
|
61
80
|
setDoDrawText(bool) {
|
|
81
|
+
isBoolean(bool);
|
|
62
82
|
if (bool === this.drawText) return;
|
|
63
83
|
this.drawText = bool;
|
|
64
84
|
this.globe.DrawRender();
|
|
@@ -66,6 +86,7 @@ export default class BearingLinePlugin {
|
|
|
66
86
|
|
|
67
87
|
|
|
68
88
|
setDoDrawText(bool) {
|
|
89
|
+
isBoolean(bool);
|
|
69
90
|
if (bool === this.drawText) return;
|
|
70
91
|
this.drawText = bool;
|
|
71
92
|
this.globe.DrawRender();
|
|
@@ -73,6 +94,7 @@ export default class BearingLinePlugin {
|
|
|
73
94
|
|
|
74
95
|
|
|
75
96
|
setDoDrawAngleRing(bool) {
|
|
97
|
+
isBoolean(bool);
|
|
76
98
|
if (bool === this.drawAngleRing) return;
|
|
77
99
|
this.drawAngleRing = bool;
|
|
78
100
|
this.globe.DrawRender();
|
|
@@ -295,7 +317,7 @@ export default class BearingLinePlugin {
|
|
|
295
317
|
this.gl = gl;
|
|
296
318
|
this.globe = globe;
|
|
297
319
|
this.lineProgram = LineOnGlobeCache.get(globe);
|
|
298
|
-
this.
|
|
320
|
+
this.pieceOfPieProgram = PieceOfPieProgramCache.get(globe);
|
|
299
321
|
this.circleProgram = CircleCache.get(globe);
|
|
300
322
|
this.circle3DProgram = Circle3DCache.get(globe);
|
|
301
323
|
const circleFlatEdgeCount = this.circleFlatEdgeCount
|
|
@@ -398,30 +420,30 @@ export default class BearingLinePlugin {
|
|
|
398
420
|
]
|
|
399
421
|
);
|
|
400
422
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
};
|
|
423
|
+
|
|
424
|
+
const vaoOBJ = (key) => createBufferAndReadInfo(this.bufferManagersCompMap.get(key).bufferManager.buffer);
|
|
404
425
|
this.lineVao = this.lineProgram.createVAO(
|
|
405
|
-
...['centerCoords2d', 'centerCoords3d', 'targetCoords2d', 'targetCoords3d', '
|
|
406
|
-
|
|
407
|
-
|
|
426
|
+
...['centerCoords2d', 'centerCoords3d', 'targetCoords2d', 'targetCoords3d', 'dashOpacity', 'dashOpacity', 'rgba'].map(
|
|
427
|
+
key => vaoOBJ(key)));
|
|
428
|
+
this.ringVao = this.pieceOfPieProgram.createVAO(
|
|
429
|
+
...['centerCoords2d',
|
|
430
|
+
'centerCoords3d',
|
|
408
431
|
'startAngle2d',
|
|
409
432
|
'tailAngle2d',
|
|
410
433
|
'startAngle3d',
|
|
411
434
|
'tailAngle3d',
|
|
412
435
|
'rgba',
|
|
413
436
|
'radius',
|
|
414
|
-
'rgbaMode'].map(key =>
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
437
|
+
'rgbaMode'].map(key => vaoOBJ(key)));
|
|
438
|
+
this.bearingLineVAO = this.lineProgram.createVAO(
|
|
439
|
+
...['centerCoords2d', 'centerCoords3d', 'bearingTargetCoords2d', 'bearingTargetCoords3d', 'bearingDashRatio', 'dashOpacity', 'rgba'
|
|
440
|
+
].map(key => vaoOBJ(key)));
|
|
419
441
|
this.circleVao = this.circleProgram.createVAO(
|
|
420
|
-
...["centerCoords2dflat", "rgbaMercator", "circleDashAngleMercator", "dashOpacityMercator"
|
|
421
|
-
|
|
442
|
+
...["centerCoords2dflat", "rgbaMercator", "circleDashAngleMercator", "dashOpacityMercator"
|
|
443
|
+
].map(key => vaoOBJ(key)));
|
|
422
444
|
this.circle3DVao = this.circle3DProgram.createVAO(
|
|
423
|
-
...["centerCoords3d", "bigRadius", "rgba", "circleDashAngle", "dashOpacity"
|
|
424
|
-
|
|
445
|
+
...["centerCoords3d", "bigRadius", "rgba", "circleDashAngle", "dashOpacity", "startAngle2d"
|
|
446
|
+
].map(key => vaoOBJ(key)));
|
|
425
447
|
}
|
|
426
448
|
|
|
427
449
|
|
|
@@ -429,13 +451,16 @@ export default class BearingLinePlugin {
|
|
|
429
451
|
const { gl } = this;
|
|
430
452
|
gl.disable(gl.DEPTH_TEST);
|
|
431
453
|
const is3D = this.globe.api_GetCurrentGeometry() === 0;
|
|
432
|
-
|
|
454
|
+
const drawRange = { first: 0, count: this.bufferOrchestrator.length }
|
|
455
|
+
|
|
456
|
+
this.lineProgram.draw(this.lineVao, { drawRange }, this._opacity);
|
|
433
457
|
if (this.drawAngleRing) {
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
458
|
+
this.pieceOfPieProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, this._opacity * 0.8, RINGPARTIAL_DRAW_MODE.TRIANGLE_FAN);
|
|
459
|
+
this.pieceOfPieProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, this._opacity * 0.8, RINGPARTIAL_DRAW_MODE.LINE_STRIP);
|
|
436
460
|
}
|
|
437
461
|
if (this.drawBearingLine) {
|
|
438
|
-
this.lineProgram.draw(this.bearingLineVAO, this.bufferOrchestrator.length, this._opacity
|
|
462
|
+
// this.lineProgram.draw(this.bearingLineVAO, this.bufferOrchestrator.length, this._opacity );
|
|
463
|
+
this.lineProgram.draw(this.bearingLineVAO, { drawRange }, this._opacity);
|
|
439
464
|
}
|
|
440
465
|
if (this.drawVRM) {
|
|
441
466
|
if (is3D) {
|
|
@@ -463,7 +488,7 @@ export default class BearingLinePlugin {
|
|
|
463
488
|
gl.deleteVertexArray(this.circleVao);
|
|
464
489
|
gl.deleteVertexArray(this.circle3DVao);
|
|
465
490
|
LineOnGlobeCache.release(globe);
|
|
466
|
-
|
|
491
|
+
PieceOfPieProgramCache.release(globe);
|
|
467
492
|
CircleCache.release(globe);
|
|
468
493
|
Circle3DCache.release(globe)
|
|
469
494
|
this.isFreed = true;
|
|
@@ -478,20 +503,3 @@ export default class BearingLinePlugin {
|
|
|
478
503
|
}
|
|
479
504
|
|
|
480
505
|
|
|
481
|
-
|
|
482
|
-
const radian = (degree) => degree * Math.PI / 180;
|
|
483
|
-
|
|
484
|
-
const integralSec = (angle) => {
|
|
485
|
-
return Math.log(Math.tan(angle / 2 + Math.PI / 4));
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
const textWriterGetOrThrow = mapGetOrThrow("BearingLine textContextInjection id does not exist in map")
|
|
489
|
-
|
|
490
|
-
const calculateStartAngle = (long, lat, endLong, endLat) => {
|
|
491
|
-
const dLat = (integralSec(endLat) - integralSec(lat)); // Because lines are strectes toward poles.
|
|
492
|
-
const dLong = endLong - long;
|
|
493
|
-
|
|
494
|
-
let angle = -Math.atan2(dLat, dLong);
|
|
495
|
-
return angle;
|
|
496
|
-
}
|
|
497
|
-
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LineOnGlobeCache } from '../programs/line-on-globe/naive-accurate';
|
|
1
|
+
import { LineOnGlobeCache } from '../programs/line-on-globe/naive-accurate-flexible';
|
|
2
2
|
import { CircleCache, EDGE_COUNT as flatCircleEdgeCount, centerCoords2dflatDataCreator } from '../programs/line-on-globe/circle-accurate-flat';
|
|
3
3
|
import { CircleCache as Circle3DCache } from '../programs/line-on-globe/circle-accurate-3d';
|
|
4
|
-
import { LineToTheOriginCache } from "../programs/line-on-globe/to-the-origin"
|
|
5
4
|
import { BufferOrchestrator, BufferManager } from "../util/account";
|
|
6
5
|
import { ChainListMap } from "./chain-list-map";
|
|
7
6
|
import { mapGetOrThrow } from "../util/check/get";
|
|
8
7
|
import { keyMethod } from "./util";
|
|
9
8
|
import { populateFloat32Array } from "../util/jshelpers/data-filler";
|
|
10
9
|
import { ContextTextWriter3 } from '../write-text/context-text3';
|
|
11
|
-
|
|
10
|
+
import { isBoolean, constraintFloat, opacityCheck } from '../util/check/typecheck';
|
|
11
|
+
import { createBufferAndReadInfo } from '../util/gl-util/buffer/integrate-buffer';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Insert info to chain list map (nodes and properties)
|
|
@@ -27,14 +27,34 @@ import { ContextTextWriter3 } from '../write-text/context-text3';
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @typedef chain
|
|
33
|
+
* @property {string} chainKey
|
|
34
|
+
* @property {StyleProperties} chainProperties
|
|
35
|
+
*
|
|
36
|
+
* @typedef {Object} Node
|
|
37
|
+
* @property {string} key
|
|
38
|
+
* @property {number} long
|
|
39
|
+
* @property {number} lat
|
|
40
|
+
* @property {StyleProperties} circleProperties
|
|
41
|
+
*
|
|
42
|
+
* @typedef {Object} Node
|
|
43
|
+
* @property {string} key
|
|
44
|
+
* @property {number} long
|
|
45
|
+
* @property {number} lat
|
|
46
|
+
*
|
|
30
47
|
* @typedef StyleProperties
|
|
31
|
-
* @property {
|
|
32
|
-
* @property {
|
|
33
|
-
* @property { 0-1
|
|
34
|
-
* @property {
|
|
35
|
-
* @property {Array<
|
|
48
|
+
* @property {Array<number>} rgba 0-1
|
|
49
|
+
* @property { number} dashOpacity 0-1
|
|
50
|
+
* @property { number} dashRatio 0-1
|
|
51
|
+
* @property { number } circleDashAngle 0-360
|
|
52
|
+
* @property {Array<Node>} nodes
|
|
36
53
|
*/
|
|
37
54
|
|
|
55
|
+
|
|
56
|
+
const textWriterGetOrThrow = mapGetOrThrow("textWriterIDs is invalid");
|
|
57
|
+
|
|
38
58
|
export class CircleLineChainPlugin {
|
|
39
59
|
/**
|
|
40
60
|
*
|
|
@@ -73,11 +93,8 @@ export class CircleLineChainPlugin {
|
|
|
73
93
|
* @param {Array<chain>} data
|
|
74
94
|
* @typedef chain
|
|
75
95
|
* @property {string} chainKey
|
|
76
|
-
* @property {Array<
|
|
77
|
-
|
|
78
|
-
* @property {string} key
|
|
79
|
-
* @property {number} long
|
|
80
|
-
* @property {number} lat
|
|
96
|
+
* @property {Array<Node>} nodes
|
|
97
|
+
|
|
81
98
|
*/
|
|
82
99
|
updateCoordinatesBulk(data, { textWriterIDs = [] } = {}) {
|
|
83
100
|
// update implicit data structure
|
|
@@ -144,17 +161,6 @@ export class CircleLineChainPlugin {
|
|
|
144
161
|
/**
|
|
145
162
|
*
|
|
146
163
|
* @param {Array<chain>} data
|
|
147
|
-
* @typedef chain
|
|
148
|
-
* @property {string} chainKey
|
|
149
|
-
* @property {StyleProperties} chainProperties
|
|
150
|
-
|
|
151
|
-
* } chainProperties
|
|
152
|
-
*
|
|
153
|
-
* @typedef {Object} node
|
|
154
|
-
* @property {string} key
|
|
155
|
-
* @property {number} long
|
|
156
|
-
* @property {number} lat
|
|
157
|
-
* @property {StyleProperties} circleProperties
|
|
158
164
|
*/
|
|
159
165
|
insertBulk(data, { textWriterIDs = [] } = {}) {
|
|
160
166
|
// first insert everything to implicit structure,
|
|
@@ -173,7 +179,7 @@ export class CircleLineChainPlugin {
|
|
|
173
179
|
}
|
|
174
180
|
|
|
175
181
|
/**
|
|
176
|
-
* @param {
|
|
182
|
+
* @param {Node} node
|
|
177
183
|
* @param {*} chainKey
|
|
178
184
|
* @param {*} theNodeKeyFront | node key of the next node, null places to the last
|
|
179
185
|
*/
|
|
@@ -187,8 +193,7 @@ export class CircleLineChainPlugin {
|
|
|
187
193
|
|
|
188
194
|
|
|
189
195
|
setOpacity(opacity) {
|
|
190
|
-
|
|
191
|
-
if (opacity < 0 || 1 < opacity) throw new Error("opacity must be between 0-1");
|
|
196
|
+
opacityCheck(opacity);
|
|
192
197
|
this._textWritersMap.forEach((writer) => writer.setOpacity(opacity));
|
|
193
198
|
this._opacity = opacity;
|
|
194
199
|
this.globe.DrawRender();
|
|
@@ -257,7 +262,6 @@ export class CircleLineChainPlugin {
|
|
|
257
262
|
this.circleProgram2d = CircleCache.get(globe);
|
|
258
263
|
this.circle3DProgram = Circle3DCache.get(globe);
|
|
259
264
|
|
|
260
|
-
// this.lineToTheOriginProgram = LineToTheOriginCache.get(globe);
|
|
261
265
|
const _circleFlatEdgeCount = this._circleFlatEdgeCount;
|
|
262
266
|
{
|
|
263
267
|
// createBuffers
|
|
@@ -339,15 +343,19 @@ export class CircleLineChainPlugin {
|
|
|
339
343
|
}],
|
|
340
344
|
]
|
|
341
345
|
);
|
|
342
|
-
const obj =
|
|
343
|
-
|
|
344
|
-
};
|
|
346
|
+
const obj = (key) => createBufferAndReadInfo(this.bufferManagersCompMap.get(key).bufferManager.buffer);
|
|
347
|
+
|
|
345
348
|
this.lineVao = this.lineProgram.createVAO(
|
|
346
|
-
...['centerCoords2d', 'centerCoords3d', 'targetCoords2d', 'targetCoords3d', 'dashRatio', 'dashOpacity', 'rgba'
|
|
349
|
+
...['centerCoords2d', 'centerCoords3d', 'targetCoords2d', 'targetCoords3d', 'dashRatio', 'dashOpacity', 'rgba'
|
|
350
|
+
].map(key => obj(key)));
|
|
351
|
+
|
|
347
352
|
this.circleVao2d = this.circleProgram2d.createVAO(
|
|
348
|
-
...["centerCoords2dMercator", "rgbaCircleMercator", "circleDashAngleMercator", "dashOpacityMercator"
|
|
353
|
+
...["centerCoords2dMercator", "rgbaCircleMercator", "circleDashAngleMercator", "dashOpacityMercator"
|
|
354
|
+
].map(key => obj(key)));
|
|
355
|
+
|
|
349
356
|
this.circle3DVao = this.circle3DProgram.createVAO(
|
|
350
|
-
...["centerCoords3d", "bigRadius", "rgbaCircle", "circleDashAngle", "dashOpacity"
|
|
357
|
+
...["centerCoords3d", "bigRadius", "rgbaCircle", "circleDashAngle", "dashOpacity"
|
|
358
|
+
].map(key => obj(key))
|
|
351
359
|
);
|
|
352
360
|
|
|
353
361
|
}
|
|
@@ -367,15 +375,10 @@ export class CircleLineChainPlugin {
|
|
|
367
375
|
|
|
368
376
|
_reconstructChains(chainKeys) {
|
|
369
377
|
const { globe } = this;
|
|
370
|
-
// this.lineVao = this.lineProgram.createVAO(
|
|
371
|
-
// ...['centerCoords', 'targetCoords', 'dashRatio', 'dashOpacity', 'rgba'].map(key => obj(this.bufferManagersCompMap.get(key))));
|
|
372
|
-
// this.circleVao2d = this.circleProgram2d.createVAO(
|
|
373
|
-
// ...["centerCoords", "bigRadius", "rgba", "circleDashAngle", "dashOpacity"].map(key => obj(this.bufferManagersCompMap.get(key))));
|
|
374
|
-
// }
|
|
375
378
|
|
|
376
379
|
const radiusM = radiusMethod(globe);
|
|
377
380
|
const callback = (v, i, array, chainProperties) => {
|
|
378
|
-
if (i
|
|
381
|
+
if (i === array.length - 1) return null;
|
|
379
382
|
|
|
380
383
|
const centerCoords2dflat = centerCoords2dflatDataCreator(globe, v.long, v.lat, array[i + 1].long, array[i + 1].lat, { edgeCount: this._circleFlatEdgeCount });
|
|
381
384
|
|
|
@@ -417,7 +420,7 @@ export class CircleLineChainPlugin {
|
|
|
417
420
|
LineOnGlobeCache.release(this.globe);
|
|
418
421
|
CircleCache.release(this.globe);
|
|
419
422
|
Circle3DCache.release(this.globe);
|
|
420
|
-
LineToTheOriginCache.release(this.globe);
|
|
423
|
+
// LineToTheOriginCache.release(this.globe);
|
|
421
424
|
this._textWritersMap.forEach((writer) => writer.free());
|
|
422
425
|
const { gl } = this;
|
|
423
426
|
gl.deleteVertexArray(this.lineVao);
|
|
@@ -432,9 +435,15 @@ export class CircleLineChainPlugin {
|
|
|
432
435
|
draw3D() {
|
|
433
436
|
const { gl, globe } = this;
|
|
434
437
|
gl.disable(gl.DEPTH_TEST);
|
|
435
|
-
|
|
438
|
+
|
|
439
|
+
const drawOptions = {
|
|
440
|
+
drawRange: {
|
|
441
|
+
first: 0,
|
|
442
|
+
count: this.bufferOrchestrator.length
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
this.lineProgram.draw(this.lineVao, drawOptions, this._opacity);
|
|
436
446
|
this._textWritersMap.forEach((writer) => writer.draw());
|
|
437
|
-
// this.lineToTheOriginProgram.draw(this.toOriginVao, this.bufferOrchestrator.length, this._opacity);
|
|
438
447
|
const is3D = globe.api_GetCurrentGeometry() === 0;
|
|
439
448
|
if (this._drawCircleOn) {
|
|
440
449
|
if (is3D) {
|
|
@@ -453,4 +462,3 @@ const radiusMethod = (globe) => (v, i, array) => {
|
|
|
453
462
|
return globe.Math.GetDist3D(v.long, v.lat, array[i + 1].long, array[i + 1].lat)
|
|
454
463
|
}
|
|
455
464
|
|
|
456
|
-
const textWriterGetOrThrow = mapGetOrThrow("textWriterIDs is invalid")
|
|
@@ -185,6 +185,9 @@ export class PixelPaddingCompassPlugin {
|
|
|
185
185
|
|
|
186
186
|
free() {
|
|
187
187
|
this.compassMap.free();
|
|
188
|
+
const { globe, gl, paddingVao } = this;
|
|
189
|
+
gl.deleteVertexArray(paddingVao);
|
|
190
|
+
PixelPaddingForFlatCompassCache.release(globe);
|
|
188
191
|
this.bufferManagersCompMap.forEach(v => {
|
|
189
192
|
v.bufferManager.free();
|
|
190
193
|
})
|
|
@@ -4,6 +4,7 @@ import ContourMipmap, { scaleParameters } from "./quadtreecontours";
|
|
|
4
4
|
|
|
5
5
|
import ObjectArrayLabels from "./objectarraylabels";
|
|
6
6
|
|
|
7
|
+
import { isBoolean, opacityCheck } from "../../util/check/typecheck";
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
export class IsobarRasterToVector {
|
|
@@ -77,6 +78,7 @@ export class IsobarRasterToVector {
|
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
setFlip(xFlip, yFlip) {
|
|
81
|
+
isBoolean(xFlip); isBoolean(yFlip);
|
|
80
82
|
if (this.xFlip === xFlip && this.yFlip === yFlip) return;
|
|
81
83
|
this.xFlip = xFlip;
|
|
82
84
|
this.yFlip = yFlip;
|
|
@@ -97,6 +99,7 @@ export class IsobarRasterToVector {
|
|
|
97
99
|
|
|
98
100
|
|
|
99
101
|
setIsLabelsOn(isLabelsOn) {
|
|
102
|
+
isBoolean(isLabelsOn);
|
|
100
103
|
if (this._isLabelsOn === isLabelsOn) return;
|
|
101
104
|
this._isLabelsOn = isLabelsOn;
|
|
102
105
|
if (!isLabelsOn) {
|
|
@@ -135,7 +138,7 @@ export class IsobarRasterToVector {
|
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
setOpacity(opacity) {
|
|
138
|
-
|
|
141
|
+
opacityCheck(opacity);
|
|
139
142
|
this.program.setOpacity(opacity);
|
|
140
143
|
}
|
|
141
144
|
|
|
@@ -253,8 +253,6 @@ class ContourMipmap {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
if (fragmentStart.size !== fragmentEnd.size) {
|
|
256
|
-
// TODO: is there a better assert function to use?
|
|
257
|
-
// eslint-disable-next-line
|
|
258
256
|
console.error(`Contour remaining fragment size mismatch ${fragmentStart.size} ${fragmentEnd.size}`);
|
|
259
257
|
}
|
|
260
258
|
});
|
|
@@ -2,6 +2,7 @@ import { getColorRampModed, DataManager, PointCoordinatesDataCalculator } from "
|
|
|
2
2
|
|
|
3
3
|
import { GlobeShellWiggle, Float2LegendWithRatio } from "../../programs";
|
|
4
4
|
|
|
5
|
+
import { opacityCheck } from "../../util/check/typecheck";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @param id : string
|
|
@@ -177,6 +178,7 @@ export default class HeatWaveGlobeShellPlugin {
|
|
|
177
178
|
|
|
178
179
|
|
|
179
180
|
setOpacity(opacity) {
|
|
181
|
+
opacityCheck(opacity);
|
|
180
182
|
this.globeShell.setOpacity(opacity);
|
|
181
183
|
}
|
|
182
184
|
|
package/package.json
CHANGED
package/partialrings/goals.md
CHANGED
package/partialrings/plugin.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import BufferOffsetManager from '../util/account/bufferoffsetmanager';
|
|
4
4
|
import { programCache, ITEM_SIZE } from './program';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { opacityCheck } from '../util/check/typecheck';
|
|
7
7
|
|
|
8
8
|
const emptyBlock = new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
9
9
|
|
|
@@ -73,6 +73,7 @@ export default class {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
setOpacity(opacity) {
|
|
76
|
+
opacityCheck(opacity);
|
|
76
77
|
this.alphaMultiplier = opacity;
|
|
77
78
|
}
|
|
78
79
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {DrawSubsetOptions} drawSubsetOptions
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// TODO: Draw all is an optional property for the target plugin, with this approach.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DrawSubsetOptionRegistry {
|
|
11
|
+
constructor() {
|
|
12
|
+
this._drawSubsetOptions = new Map();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
register(key, drawSubsetOptions) {
|
|
16
|
+
this._drawSubsetOptions.set(key, drawSubsetOptions);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
unregister(key) {
|
|
20
|
+
this._drawSubsetOptions.delete(key);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
}
|
|
File without changes
|