@pirireis/webglobeplugins 0.9.5 → 0.9.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/package.json +8 -2
- package/Math/angle-calculation.js +0 -14
- package/Math/arc.ts +0 -76
- package/Math/bounds/line-bbox.js +0 -225
- package/Math/constants.ts +0 -11
- package/Math/frustum/camera.ts +0 -32
- package/Math/frustum/from-globeinfo.ts +0 -63
- package/Math/frustum/types.ts +0 -11
- package/Math/globe-util/horizon-plane.ts +0 -137
- package/Math/index.js +0 -0
- package/Math/juction/arc-plane.ts +0 -114
- package/Math/juction/line-sphere.ts +0 -30
- package/Math/juction/plane-plane.ts +0 -66
- package/Math/line.ts +0 -70
- package/Math/matrix4.ts +0 -0
- package/Math/methods.js +0 -237
- package/Math/plane.ts +0 -86
- package/Math/quaternion.ts +0 -120
- package/Math/roadmap.md +0 -10
- package/Math/types.ts +0 -45
- package/Math/utils.js +0 -3
- package/Math/vec3.ts +0 -155
- package/algorithms/search-binary.js +0 -14
- package/altitude-locator/adaptors.js +0 -0
- package/altitude-locator/draw-subset-obj.js +0 -27
- package/altitude-locator/keymethod.js +0 -0
- package/altitude-locator/plugin.js +0 -439
- package/altitude-locator/types.js +0 -26
- package/arrowfield/adaptor.js +0 -11
- package/arrowfield/index.js +0 -3
- package/arrowfield/plugin.js +0 -128
- package/bearing-line/index.js +0 -2
- package/bearing-line/plugin.js +0 -512
- package/circle-line-chain/chain-list-map.js +0 -221
- package/circle-line-chain/init.js +0 -0
- package/circle-line-chain/plugin.js +0 -469
- package/circle-line-chain/readme.md +0 -57
- package/circle-line-chain/util.js +0 -1
- package/compass-rose/compass-rose-padding-flat.js +0 -266
- package/compass-rose/compass-text-writer.js +0 -173
- package/compass-rose/index.js +0 -3
- package/compassrose/compassrose.js +0 -341
- package/compassrose/index.js +0 -2
- package/depth-locator/readme.md +0 -26
- package/globe-types.ts +0 -13
- package/heatwave/index.js +0 -4
- package/heatwave/isobar/objectarraylabels.js +0 -247
- package/heatwave/isobar/plugin.js +0 -340
- package/heatwave/isobar/quadtreecontours.js +0 -336
- package/heatwave/plugins/heatwaveglobeshell.js +0 -258
- package/jest.config.js +0 -6
- package/partialrings/buffer-manager.js +0 -89
- package/partialrings/goals.md +0 -17
- package/partialrings/index.js +0 -3
- package/partialrings/plugin.js +0 -160
- package/partialrings/program.js +0 -324
- package/pin/pin-object-array.js +0 -381
- package/pin/pin-point-totem.js +0 -77
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -78
- package/point-heat-map/index.js +0 -0
- package/point-heat-map/plugin-webworker.js +0 -151
- package/point-heat-map/point-to-heat-map-flow.js +0 -150
- package/point-heat-map/readme.md +0 -15
- package/point-tracks/key-methods.js +0 -3
- package/point-tracks/plugin.js +0 -394
- package/programs/arrowfield/index.js +0 -2
- package/programs/arrowfield/logic.js +0 -286
- package/programs/arrowfield/object.js +0 -89
- package/programs/data2legend/density-to-legend.js +0 -115
- package/programs/data2legend/point-to-density-texture.js +0 -114
- package/programs/float2legendwithratio/index.js +0 -3
- package/programs/float2legendwithratio/logic.js +0 -194
- package/programs/float2legendwithratio/object.js +0 -141
- package/programs/globe-util/is-globe-moved.js +0 -27
- package/programs/globeshell/index.js +0 -2
- package/programs/globeshell/noise/noises.js +0 -0
- package/programs/globeshell/wiggle/index.js +0 -6
- package/programs/globeshell/wiggle/logic.js +0 -371
- package/programs/globeshell/wiggle/object.js +0 -93
- package/programs/helpers/blender/index.js +0 -0
- package/programs/helpers/blender/program.js +0 -91
- package/programs/helpers/fadeaway/index.js +0 -3
- package/programs/helpers/fadeaway/logic.js +0 -76
- package/programs/helpers/fadeaway/object.js +0 -20
- package/programs/helpers/index.js +0 -2
- package/programs/index.js +0 -21
- package/programs/interface.ts +0 -7
- package/programs/line-on-globe/angled-line.js +0 -206
- package/programs/line-on-globe/circle-accurate-3d.js +0 -167
- package/programs/line-on-globe/circle-accurate-flat.js +0 -262
- package/programs/line-on-globe/circle-accurate.js +0 -202
- package/programs/line-on-globe/circle.js +0 -191
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -188
- package/programs/line-on-globe/index.js +0 -0
- package/programs/line-on-globe/lines-color-instanced-flat.js +0 -151
- package/programs/line-on-globe/linestrip.ts +0 -228
- package/programs/line-on-globe/naive-accurate-flexible.js +0 -239
- package/programs/line-on-globe/to-the-surface.js +0 -129
- package/programs/line-on-globe/util.js +0 -8
- package/programs/picking/pickable-renderer.js +0 -216
- package/programs/point-on-globe/element-globe-surface-glow.js +0 -168
- package/programs/point-on-globe/element-point-glow.js +0 -184
- package/programs/point-on-globe/square-pixel-point.js +0 -189
- package/programs/programcache.ts +0 -131
- package/programs/rings/distancering/circleflatprogram.js +0 -136
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -378
- package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -420
- package/programs/rings/distancering/index.js +0 -5
- package/programs/rings/distancering/paddyflatprogram.js +0 -146
- package/programs/rings/distancering/paddyflatprogram2d.js +0 -150
- package/programs/rings/distancering/paddyflatprogram3d.js +0 -146
- package/programs/rings/distancering/shader.js +0 -0
- package/programs/rings/index.js +0 -1
- package/programs/rings/partial-ring/piece-of-pie.js +0 -315
- package/programs/totems/camerauniformblock.d.ts +0 -48
- package/programs/totems/camerauniformblock.js +0 -197
- package/programs/totems/canvas-webglobe-info.js +0 -136
- package/programs/totems/gpu-selection-uniform-block.js +0 -132
- package/programs/totems/index.ts +0 -2
- package/programs/two-d/pixel-circle.js +0 -0
- package/programs/two-d/pixel-padding-for-compass.js +0 -174
- package/programs/util.js +0 -20
- package/programs/vectorfields/index.js +0 -3
- package/programs/vectorfields/logics/drawrectangleparticles.js +0 -125
- package/programs/vectorfields/logics/index.js +0 -5
- package/programs/vectorfields/logics/pixelbased.js +0 -161
- package/programs/vectorfields/logics/ubo.js +0 -64
- package/programs/vectorfields/pingpongbuffermanager.js +0 -80
- package/publish.bat +0 -60
- package/rangerings/enum.js +0 -3
- package/rangerings/index.js +0 -5
- package/rangerings/plugin.js +0 -649
- package/rangerings/rangeringangletext.js +0 -368
- package/rangerings/ring-account.js +0 -129
- package/shaders/fragment-toy/firework.js +0 -55
- package/shaders/fragment-toy/singularity.js +0 -59
- package/shape-on-terrain/arc/naive/plugin.ts +0 -304
- package/shape-on-terrain/goal.md +0 -12
- package/tests/Math/junction/arc-plane.test.ts +0 -133
- package/tests/Math/junction/plane-plane.test.ts +0 -82
- package/tests/Math/plane.test.ts +0 -43
- package/tests/Math/vec3.test.ts +0 -14
- package/timetracks/adaptors-line-strip.js +0 -80
- package/timetracks/adaptors.js +0 -133
- package/timetracks/index.js +0 -6
- package/timetracks/plugin-line-strip.js +0 -295
- package/timetracks/plugin.js +0 -304
- package/timetracks/program-line-strip.js +0 -688
- package/timetracks/program.js +0 -850
- package/timetracks/programpoint-line-strip.js +0 -175
- package/timetracks/programpoint.js +0 -168
- package/timetracks/readme.md +0 -1
- package/tsconfig.json +0 -21
- package/types.ts +0 -17
- package/util/account/bufferoffsetmanager.js +0 -209
- package/util/account/index.js +0 -6
- package/util/account/single-attribute-buffer-management/buffer-manager.ts +0 -119
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +0 -173
- package/util/account/single-attribute-buffer-management/index.ts +0 -13
- package/util/account/single-attribute-buffer-management/object-store.ts +0 -65
- package/util/account/single-attribute-buffer-management/types.ts +0 -39
- package/util/account/util.js +0 -22
- package/util/algorithms/index.js +0 -0
- package/util/algorithms/search-binary.js +0 -26
- package/util/check/get.js +0 -13
- package/util/check/index.js +0 -0
- package/util/check/typecheck.js +0 -39
- package/util/geometry/index.js +0 -53
- package/util/gl-util/buffer/attribute-loader.ts +0 -85
- package/util/gl-util/buffer/index.ts +0 -6
- package/util/gl-util/buffer/types.ts +0 -13
- package/util/gl-util/draw-options/methods.ts +0 -66
- package/util/gl-util/draw-options/types.ts +0 -28
- package/util/gl-util/uniform-block/manager.ts +0 -187
- package/util/gl-util/uniform-block/roadmap.md +0 -70
- package/util/gl-util/uniform-block/shader.js +0 -0
- package/util/gl-util/uniform-block/types.ts +0 -27
- package/util/heatwavedatamanager/datamanager.js +0 -168
- package/util/heatwavedatamanager/index.js +0 -3
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -133
- package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
- package/util/index.js +0 -13
- package/util/interpolation/index.js +0 -0
- package/util/interpolation/timetrack/index.js +0 -9
- package/util/interpolation/timetrack/timetrack-interpolator.js +0 -88
- package/util/interpolation/timetrack/web-worker-str.js +0 -180
- package/util/interpolation/timetrack/web-worker.js +0 -51
- package/util/jshelpers/data-filler.js +0 -19
- package/util/jshelpers/equality.js +0 -17
- package/util/jshelpers/index.js +0 -1
- package/util/jshelpers/timefilters.js +0 -32
- package/util/picking/fence.js +0 -46
- package/util/picking/picker-displayer.js +0 -177
- package/util/programs/draw-texture-on-canvas.js +0 -102
- package/util/programs/index.js +0 -1
- package/util/programs/shapesonglobe.js +0 -246
- package/util/programs/supersampletotextures.js +0 -142
- package/util/programs/texturetoglobe.js +0 -203
- package/util/shaderfunctions/geometrytransformations.ts +0 -388
- package/util/shaderfunctions/index.js +0 -2
- package/util/shaderfunctions/nodata.js +0 -10
- package/util/shaderfunctions/noisefunctions.js +0 -44
- package/util/surface-line-data/arc-bboxes.ts +0 -42
- package/util/surface-line-data/arcs-to-cuts.js +0 -74
- package/util/surface-line-data/cut-arc.js +0 -0
- package/util/surface-line-data/flow.ts +0 -52
- package/util/surface-line-data/rbush-manager.js +0 -0
- package/util/surface-line-data/types.ts +0 -27
- package/util/surface-line-data/web-worker.js +0 -0
- package/util/webglobe/gldefaultstates.js +0 -5
- package/util/webglobe/index.js +0 -2
- package/util/webglobe/rasteroverlay.js +0 -96
- package/util/webglobjectbuilders.ts +0 -456
- package/util/webglobjectbuilders1.js +0 -271
- package/waveparticles/adaptor.js +0 -16
- package/waveparticles/index.js +0 -3
- package/waveparticles/plugin.js +0 -313
- package/wind/imagetovectorfieldandmagnitude.js +0 -39
- package/wind/index.js +0 -5
- package/wind/plugin.js +0 -1057
- package/wind/vectorfieldimage.js +0 -27
- package/write-text/attached-text-writer.js +0 -105
- package/write-text/context-text.js +0 -125
- package/write-text/context-text3.js +0 -178
- package/write-text/index.js +0 -1
- package/write-text/writer-plugin.js +0 -7
package/pin/pin-point-totem.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This class registered as globe plugin one for each globe. to the head of plugin call stack.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
class PinPointTotem {
|
|
6
|
-
constructor(globe) {
|
|
7
|
-
|
|
8
|
-
this.objectArrayMap = new Map()
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* objectArray
|
|
14
|
-
* callbacks ={
|
|
15
|
-
* mouseDown,
|
|
16
|
-
* mouseMove,
|
|
17
|
-
* mouseUp,
|
|
18
|
-
* mouseClick,
|
|
19
|
-
* mouseDbClick,
|
|
20
|
-
* keyDown,
|
|
21
|
-
* keyUp
|
|
22
|
-
* }
|
|
23
|
-
*/
|
|
24
|
-
registerPinMap(objectArray, callbacks) {
|
|
25
|
-
this.objectArrayMap.set(objectArray, callbacks);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
unregisterPinMap(objectArray) {
|
|
29
|
-
if (this.objectArrayMap.has(objectArray)) {
|
|
30
|
-
this.objectArrayMap.delete(objectArray);
|
|
31
|
-
} else {
|
|
32
|
-
console.warn('PinPointTotem objectArrayMap does not contain the objectArray')
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// GlobeMethods
|
|
38
|
-
// haritada sol butona basıldığında çağrılır
|
|
39
|
-
mouseDown(x, y, event) {
|
|
40
|
-
|
|
41
|
-
return false
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// mouse'a basılıp hareket ettirildiğinde, mouseDown'dan true dönmüşse çağrılır
|
|
45
|
-
mouseMove(x, y, event) {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// mouse up'ın left'i mouseDown'dan true dönmüşse çağrılır, edit mode içindir
|
|
50
|
-
// right'i ise sağ tıka basılıp bırakıldığında çağrılır
|
|
51
|
-
mouseUp(x, y, event) {
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// harita üzerinde tıklandığında çağrılır
|
|
56
|
-
mouseClick(x, y, event) {
|
|
57
|
-
|
|
58
|
-
return false
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// harita üzerinde çift tıklandığında çağrılır
|
|
62
|
-
mouseDblClick(x, y, event) {
|
|
63
|
-
return false
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// klavyeden bir tuşa basıldığı anda ve tuşa basılı kalınmaya devam edildiği durumlarda çalışır
|
|
67
|
-
keyDown(event) {
|
|
68
|
-
return false
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// klavyedeki bir tuştan parmak çekildiği anda çalışır
|
|
72
|
-
keyUp(event) {
|
|
73
|
-
|
|
74
|
-
return false
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
|
|
3
|
-
* TimeTrackMultiColorData is [
|
|
4
|
-
* a1x, a1y, a1z, a1time, a1r, a1g, a1b, a1time, a3time,
|
|
5
|
-
* a2x, a2y, a2z, a2time, a2r, a2g, a2b, a1time, a3time,
|
|
6
|
-
* a3x, a3y, a3z, a3time, a3r, a3g, a3b, a1time, a3time,
|
|
7
|
-
* 0, 0, 0, 0, -1, -1, -1, 0, 0,
|
|
8
|
-
* b1x, b1y, b1z, b1time, b1r, b1g, b1b, b1time, b2time,
|
|
9
|
-
* b2x, b2y, b2z, b2time, b2r, b2g, b2b, BstartTime, BendTime
|
|
10
|
-
* ]
|
|
11
|
-
* there is a cutting point between A and B
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* ABOVE
|
|
17
|
-
* TO
|
|
18
|
-
* BELOW
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @typedef {Array<number>} vec3 [x, y, z]
|
|
22
|
-
* @typedef {Array<number>} vec2 [x, y]
|
|
23
|
-
* @typedef {Array<number>} vec4 [x, y, z, w]
|
|
24
|
-
* @typedef {number} fraction a number between 0 and 1
|
|
25
|
-
* @typedef {Array<number>} wgs84 [long, lat]
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @typedef Timetrack
|
|
31
|
-
* @property {Array<vec4>}} coordinates [x,y,z, length]
|
|
32
|
-
* @property {Array<Number>} times
|
|
33
|
-
* @param {Array<Timetrack>} timeTracks
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
import { pixelXYLenghtToUnitVectorWithHeight } from "../../Math/methods";
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const processACut = (array, offset) => {
|
|
43
|
-
// first 3 values of array
|
|
44
|
-
const v3 = array.slice(offset, offset + 3);
|
|
45
|
-
const v4 = pixelXYLenghtToUnitVectorWithHeight(v3);
|
|
46
|
-
const time = array[offset + 3];
|
|
47
|
-
return [v4, time];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const timeTrackPluginDataToPointHeatInterpolatorAdapter = (timeTrackPluginData) => {
|
|
52
|
-
const timeTracks = []
|
|
53
|
-
|
|
54
|
-
let offset = 0;
|
|
55
|
-
|
|
56
|
-
let timeTrack = {
|
|
57
|
-
coordinates: [],
|
|
58
|
-
times: []
|
|
59
|
-
}
|
|
60
|
-
while (offset < timeTrackPluginData.length) {
|
|
61
|
-
if (!timeTrackPluginData[offset]) {
|
|
62
|
-
timeTracks.push(timeTrack);
|
|
63
|
-
timeTrack = {
|
|
64
|
-
coordinates: [],
|
|
65
|
-
times: []
|
|
66
|
-
}
|
|
67
|
-
offset += 9;
|
|
68
|
-
}
|
|
69
|
-
const point = processACut(timeTrackPluginData, offset);
|
|
70
|
-
offset += 9;
|
|
71
|
-
timeTrack.coordinates.push(point[0]);
|
|
72
|
-
timeTrack.times.push(point[1]);
|
|
73
|
-
}
|
|
74
|
-
return timeTracks;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export { timeTrackPluginDataToPointHeatInterpolatorAdapter };
|
package/point-heat-map/index.js
DELETED
|
File without changes
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { PointHeatmapFlow } from "./point-to-heat-map-flow";
|
|
2
|
-
// import { webworkerStr } from "../util/interpolation/timetrack/web-worker-str"; // TODO: Delete When this plugin is tested on production
|
|
3
|
-
import { createWorker } from "../util/interpolation/timetrack/index";
|
|
4
|
-
import { createTexture, getColorRampModed } from "../util";
|
|
5
|
-
import { opacityCheck, constraintFloat } from "../util/check/typecheck";
|
|
6
|
-
|
|
7
|
-
class PointHeatmapPlugin {
|
|
8
|
-
|
|
9
|
-
constructor(id, { opacity = 1.0, pointSize = 5.0, onInterpolationComplete = () => { } } = {}) {
|
|
10
|
-
this.id = id;
|
|
11
|
-
this.globe = null;
|
|
12
|
-
this.gl = null;
|
|
13
|
-
this.densityToLegendProgram = null;
|
|
14
|
-
this._time = null;
|
|
15
|
-
|
|
16
|
-
this._opacity = opacity;
|
|
17
|
-
this._pointSize = pointSize;
|
|
18
|
-
this._legendTexture = null;
|
|
19
|
-
|
|
20
|
-
this._throttleListener = null;
|
|
21
|
-
this._timeTracksAreSet = false;
|
|
22
|
-
// const blob = new Blob([webworkerStr], { type: 'application/javascript' });
|
|
23
|
-
// this.timeTrackInterpolationWorker = new Worker(URL.createObjectURL(blob), { type: 'module' });
|
|
24
|
-
this.timeTrackInterpolationWorker = createWorker();
|
|
25
|
-
this.timeTrackInterpolationWorker.onmessage = (e) => {
|
|
26
|
-
if (e.data.error) {
|
|
27
|
-
throw new Error(e.data.error);
|
|
28
|
-
}
|
|
29
|
-
if (e.data === true) {
|
|
30
|
-
onInterpolationComplete();
|
|
31
|
-
}
|
|
32
|
-
if (e.data instanceof Float32Array) {
|
|
33
|
-
this.flow.setData(e.data);
|
|
34
|
-
this._throttleListener = null;
|
|
35
|
-
onInterpolationComplete();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// globe interaction
|
|
41
|
-
|
|
42
|
-
init(globe, gl) {
|
|
43
|
-
this.globe = globe;
|
|
44
|
-
this.gl = gl;
|
|
45
|
-
this.flow = new PointHeatmapFlow(globe);
|
|
46
|
-
this.setGeometry();
|
|
47
|
-
this.resize();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setPointSize(pointSize) {
|
|
52
|
-
constraintFloat(pointSize, 1);
|
|
53
|
-
this._pointSize = pointSize;
|
|
54
|
-
this.globe.DrawRender();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @param {Array<string>}
|
|
60
|
-
* @param {string} mode "interpolated" | "discrete"
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
setColorRamp(values, thresholds, mode = "interpolated") {
|
|
64
|
-
const gl = this.gl
|
|
65
|
-
if (this.gl === null) {
|
|
66
|
-
throw new Error('Plugin not initialized');
|
|
67
|
-
};
|
|
68
|
-
const rampData = getColorRampModed(values, thresholds, mode);
|
|
69
|
-
const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
|
|
70
|
-
if (this._legendTexture) {
|
|
71
|
-
this.gl.deleteTexture(this._legendTexture);
|
|
72
|
-
}
|
|
73
|
-
this._legendTexture = texture;
|
|
74
|
-
this.globe.DrawRender();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
setTime(time) {
|
|
79
|
-
// TODO: WORK ON THIS
|
|
80
|
-
this._time = time;
|
|
81
|
-
if (this.isReady() && this._throttleListener === null) {
|
|
82
|
-
this._throttleListener = setTimeout(() => {
|
|
83
|
-
this.timeTrackInterpolationWorker.postMessage({ time: this._time });
|
|
84
|
-
}, 0);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
setTimetracks(timeTracks) {
|
|
90
|
-
this._timeTracksAreSet = true;
|
|
91
|
-
this.timeTrackInterpolationWorker.postMessage({ timeTracks });
|
|
92
|
-
if (this._time !== null) {
|
|
93
|
-
this.setTime(this._time);
|
|
94
|
-
}
|
|
95
|
-
this.globe.DrawRender();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
setOpacity(opacity) {
|
|
100
|
-
opacityCheck(opacity);
|
|
101
|
-
this._opacity = opacity;
|
|
102
|
-
this.globe.DrawRender();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
setGeometry() {
|
|
108
|
-
const geometry = this.globe.api_GetCurrentGeometry();
|
|
109
|
-
this.timeTrackInterpolationWorker.postMessage({ geometry });
|
|
110
|
-
if (this._time !== null) {
|
|
111
|
-
this.setTime(this._time);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
draw3D() {
|
|
117
|
-
if (this.isReady()) {
|
|
118
|
-
this.flow.draw(this._legendTexture, this._pointSize, this._opacity);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
resize() {
|
|
124
|
-
this.flow.resize();
|
|
125
|
-
if (this._time !== null) {
|
|
126
|
-
this.setTime(this._time);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
isReady() {
|
|
132
|
-
return (this.gl !== null && this._legendTexture !== null && this._timeTracksAreSet);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
free() {
|
|
136
|
-
if (this._isFreed) return;
|
|
137
|
-
this.gl.deleteTexture(this._legendTexture);
|
|
138
|
-
this.flow.free();
|
|
139
|
-
this.flow = null;
|
|
140
|
-
this.gl = null;
|
|
141
|
-
this._isFreed = true;
|
|
142
|
-
this.timeTrackInterpolator = null;
|
|
143
|
-
this._legendTexture = null;
|
|
144
|
-
this.timeTrackInterpolationWorker.terminate();
|
|
145
|
-
this.timeTrackInterpolationWorker = null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
export { PointHeatmapPlugin };
|
|
151
|
-
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { densityToLegendProgramCache } from "../programs/data2legend/density-to-legend";
|
|
2
|
-
import { pointToDensityTextureCache } from "../programs/data2legend/point-to-density-texture";
|
|
3
|
-
// import { textureOnCanvasProgramCache } from "../util/programs/draw-texture-on-canvas";
|
|
4
|
-
import { defaultblendfunction } from "../util/webglobe/gldefaultstates";
|
|
5
|
-
class PointHeatmapFlow {
|
|
6
|
-
|
|
7
|
-
constructor(globe) {
|
|
8
|
-
this.globe = null;
|
|
9
|
-
this.gl = null;
|
|
10
|
-
this.program = null;
|
|
11
|
-
this.densityToLegendProgram = null;
|
|
12
|
-
this.globe = globe;
|
|
13
|
-
this.gl = globe.gl;
|
|
14
|
-
this.pointToDensityProgram = pointToDensityTextureCache.get(globe);
|
|
15
|
-
this.densityToLegendProgram = densityToLegendProgramCache.get(globe);
|
|
16
|
-
// this.testTextureProgram = textureOnCanvasProgramCache.get(globe.gl);
|
|
17
|
-
this._lookInfo = globe.api_GetCurrentLookInfo();
|
|
18
|
-
const { gl } = this;
|
|
19
|
-
{
|
|
20
|
-
this.buffer = gl.createBuffer();
|
|
21
|
-
this.vao2D = this.pointToDensityProgram.createVAO(this.buffer, 2);
|
|
22
|
-
this.vao3D = this.pointToDensityProgram.createVAO(this.buffer, 3);
|
|
23
|
-
}
|
|
24
|
-
{ // framebuffer and texture
|
|
25
|
-
this.framebuffer = gl.createFramebuffer();
|
|
26
|
-
this.densityTexture = this._createDensityTexture();
|
|
27
|
-
this._bindTextureToFramebuffer();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
_bindTextureToFramebuffer() {
|
|
32
|
-
const { gl, densityTexture, framebuffer } = this;
|
|
33
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
|
34
|
-
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, densityTexture, 0);
|
|
35
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
draw(legendTexture, pointSize, opacity = 1.0) {
|
|
40
|
-
const { gl, globe, framebuffer } = this;
|
|
41
|
-
if (this._drawDensityRequired || this._isVisionChanged()) {
|
|
42
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
|
43
|
-
gl.clearColor(0, 0, 0, 0);
|
|
44
|
-
gl.viewport(
|
|
45
|
-
0, 0,
|
|
46
|
-
Math.floor(globe.api_ScrW()), Math.floor(globe.api_ScrH())
|
|
47
|
-
);
|
|
48
|
-
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
49
|
-
this._drawDensity(pointSize);
|
|
50
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
51
|
-
}
|
|
52
|
-
defaultblendfunction(gl);
|
|
53
|
-
this._drawLegend(legendTexture, opacity);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
resize() {
|
|
58
|
-
const { gl, densityTexture } = this;
|
|
59
|
-
gl.deleteTexture(densityTexture);
|
|
60
|
-
this.densityTexture = this._createDensityTexture();
|
|
61
|
-
this._bindTextureToFramebuffer();
|
|
62
|
-
this._drawDensityRequired = true;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// USER API
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @param {Float32Array} data
|
|
70
|
-
* @format [x, y, z, height] x,y,z is normalized 3d cartesian coordinates. Height in kilometers. Set 6378.137 for ground level.
|
|
71
|
-
*/
|
|
72
|
-
setData(data) {
|
|
73
|
-
const { gl, buffer } = this;
|
|
74
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
75
|
-
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
|
|
76
|
-
// use program
|
|
77
|
-
this.dataLength = data.length;
|
|
78
|
-
this._drawDensityRequired = true;
|
|
79
|
-
this.globe.DrawRender();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// implicit Methods
|
|
83
|
-
|
|
84
|
-
_createDensityTexture() {
|
|
85
|
-
const { gl, globe } = this;
|
|
86
|
-
const width = Math.floor(globe.api_ScrW())
|
|
87
|
-
const height = Math.floor(globe.api_ScrH());
|
|
88
|
-
const texture = gl.createTexture();
|
|
89
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
90
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
|
91
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
92
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
93
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
94
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
95
|
-
return texture;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
_drawDensity(pointSize) {
|
|
100
|
-
const { gl, globe, pointToDensityProgram, vao2D, vao3D, dataLength } = this;
|
|
101
|
-
const is3D = globe.api_GetCurrentGeometry() === 0;
|
|
102
|
-
const vao = is3D ? vao3D : vao2D;
|
|
103
|
-
const length = dataLength / (is3D ? 3 : 2);
|
|
104
|
-
gl.blendEquation(gl.FUNC_ADD);
|
|
105
|
-
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE, gl.SRC_ALPHA, gl.ONE);
|
|
106
|
-
pointToDensityProgram.draw(vao, length, pointSize);
|
|
107
|
-
|
|
108
|
-
this._drawDensityRequired = false;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
_drawLegend(legendTexture, opacity) {
|
|
113
|
-
const { densityToLegendProgram, densityTexture } = this;
|
|
114
|
-
densityToLegendProgram.draw(densityTexture, legendTexture, opacity);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
_isVisionChanged() {
|
|
119
|
-
const currentLookInfo = this.globe.api_GetCurrentLookInfo();
|
|
120
|
-
const _lookInfo = this._lookInfo;
|
|
121
|
-
if (
|
|
122
|
-
currentLookInfo.CenterLong !== _lookInfo.CenterLong ||
|
|
123
|
-
currentLookInfo.CenterLat !== _lookInfo.CenterLat ||
|
|
124
|
-
currentLookInfo.Distance !== _lookInfo.Distance ||
|
|
125
|
-
currentLookInfo.Tilt !== _lookInfo.Tilt ||
|
|
126
|
-
currentLookInfo.NorthAng !== _lookInfo.NorthAng
|
|
127
|
-
) {
|
|
128
|
-
this._lookInfo = currentLookInfo;
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
free() {
|
|
136
|
-
if (this._isFreed) return;
|
|
137
|
-
this._isFreed = true;
|
|
138
|
-
densityToLegendProgramCache.release(this.globe);
|
|
139
|
-
pointToDensityTextureCache.release(this.globe);
|
|
140
|
-
// textureOnCanvasProgramCache.release(this.gl);
|
|
141
|
-
this.gl.deleteTexture(this.densityTexture);
|
|
142
|
-
this.gl.deleteFramebuffer(this.framebuffer);
|
|
143
|
-
this.gl.deleteBuffer(this.buffer);
|
|
144
|
-
this.gl.deleteVertexArray(this.vao2D);
|
|
145
|
-
this.gl.deleteVertexArray(this.vao3D);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
export { PointHeatmapFlow };
|
package/point-heat-map/readme.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Content
|
|
2
|
-
|
|
3
|
-
point-heat-map/
|
|
4
|
-
├── plugin.js
|
|
5
|
-
└── point-to-heat-flow.js
|
|
6
|
-
|
|
7
|
-
## plugin.js
|
|
8
|
-
|
|
9
|
-
Contains plugin plugin that calculates data on main thread.
|
|
10
|
-
|
|
11
|
-
## point-to-heat-flow.js
|
|
12
|
-
|
|
13
|
-
Contains a wrapper around point-to-density and density-to-color-ramp programs.
|
|
14
|
-
|
|
15
|
-
The reason behind seperation of program flow and plugin is to explore web-worker version of interpolation and compare it with main thread version.
|