@pirireis/webglobeplugins 0.9.11 → 0.9.13

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.
Files changed (179) hide show
  1. package/Math/angle-calculation.js +9 -11
  2. package/Math/arc.js +38 -41
  3. package/Math/bounds/line-bbox.js +79 -83
  4. package/Math/constants.js +4 -9
  5. package/Math/frustum/types.js +1 -2
  6. package/Math/juction/arc-plane.js +33 -36
  7. package/Math/juction/line-sphere.js +15 -18
  8. package/Math/juction/plane-plane.js +20 -23
  9. package/Math/line.js +42 -47
  10. package/Math/methods.js +69 -92
  11. package/Math/plane.js +33 -38
  12. package/Math/quaternion.js +48 -55
  13. package/Math/types.js +1 -2
  14. package/Math/utils.js +2 -4
  15. package/Math/vec3.js +46 -52
  16. package/algorithms/search-binary.js +5 -8
  17. package/altitude-locator/draw-subset-obj.js +8 -11
  18. package/altitude-locator/plugin.js +114 -133
  19. package/altitude-locator/types.js +1 -3
  20. package/arrowfield/adaptor.js +3 -7
  21. package/arrowfield/index.js +3 -10
  22. package/arrowfield/plugin.js +63 -69
  23. package/bearing-line/index.js +2 -8
  24. package/bearing-line/plugin.js +218 -248
  25. package/circle-line-chain/chain-list-map.js +82 -92
  26. package/circle-line-chain/plugin.js +147 -182
  27. package/circle-line-chain/util.js +1 -5
  28. package/compass-rose/compass-rose-padding-flat.js +111 -140
  29. package/compass-rose/compass-text-writer.js +63 -75
  30. package/compass-rose/index.js +3 -7
  31. package/compassrose/compassrose.js +50 -57
  32. package/compassrose/index.js +2 -8
  33. package/heatwave/index.js +3 -10
  34. package/heatwave/isobar/objectarraylabels.js +50 -56
  35. package/heatwave/isobar/plugin.js +111 -170
  36. package/heatwave/isobar/quadtreecontours.js +78 -96
  37. package/heatwave/plugins/heatwaveglobeshell.js +73 -94
  38. package/index.js +12 -58
  39. package/package.json +1 -1
  40. package/partialrings/buffer-manager.js +32 -70
  41. package/partialrings/index.js +2 -41
  42. package/partialrings/plugin.js +55 -98
  43. package/partialrings/program.js +141 -59
  44. package/pin/pin-object-array.js +89 -97
  45. package/pin/pin-point-totem.js +21 -22
  46. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +11 -14
  47. package/point-heat-map/plugin-webworker.js +45 -53
  48. package/point-heat-map/point-to-heat-map-flow.js +46 -51
  49. package/point-tracks/key-methods.js +2 -5
  50. package/point-tracks/plugin.js +141 -170
  51. package/programs/arrowfield/index.js +2 -7
  52. package/programs/arrowfield/logic.js +172 -67
  53. package/programs/arrowfield/object.js +35 -43
  54. package/programs/data2legend/density-to-legend.js +47 -26
  55. package/programs/data2legend/point-to-density-texture.js +56 -34
  56. package/programs/float2legendwithratio/index.js +2 -8
  57. package/programs/float2legendwithratio/logic.js +88 -45
  58. package/programs/float2legendwithratio/object.js +45 -54
  59. package/programs/globe-util/is-globe-moved.js +10 -13
  60. package/programs/globeshell/index.js +2 -8
  61. package/programs/globeshell/wiggle/index.js +2 -8
  62. package/programs/globeshell/wiggle/logic.js +191 -101
  63. package/programs/globeshell/wiggle/object.js +35 -43
  64. package/programs/helpers/blender/program.js +36 -22
  65. package/programs/helpers/fadeaway/index.js +2 -7
  66. package/programs/helpers/fadeaway/logic.js +36 -17
  67. package/programs/helpers/fadeaway/object.js +11 -18
  68. package/programs/helpers/index.js +2 -8
  69. package/programs/index.js +9 -58
  70. package/programs/line-on-globe/angled-line.js +95 -39
  71. package/programs/line-on-globe/circle-accurate-3d.js +86 -39
  72. package/programs/line-on-globe/circle-accurate-flat.js +116 -64
  73. package/programs/line-on-globe/circle-accurate.js +113 -46
  74. package/programs/line-on-globe/circle.js +106 -44
  75. package/programs/line-on-globe/degree-padding-around-circle-3d.js +89 -42
  76. package/programs/line-on-globe/lines-color-instanced-flat.js +84 -43
  77. package/programs/line-on-globe/linestrip.js +126 -63
  78. package/programs/line-on-globe/naive-accurate-flexible.js +126 -59
  79. package/programs/line-on-globe/to-the-surface.js +62 -35
  80. package/programs/line-on-globe/util.js +2 -5
  81. package/programs/picking/pickable-renderer.js +127 -46
  82. package/programs/point-on-globe/element-globe-surface-glow.js +83 -46
  83. package/programs/point-on-globe/element-point-glow.js +112 -47
  84. package/programs/point-on-globe/square-pixel-point.js +80 -34
  85. package/programs/programcache.js +14 -19
  86. package/programs/rings/distancering/circleflatprogram.js +76 -70
  87. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +168 -194
  88. package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -200
  89. package/programs/rings/distancering/index.js +5 -14
  90. package/programs/rings/distancering/paddyflatprogram.js +87 -70
  91. package/programs/rings/distancering/paddyflatprogram2d.js +89 -72
  92. package/programs/rings/distancering/paddyflatprogram3d.js +87 -70
  93. package/programs/rings/index.js +1 -17
  94. package/programs/rings/partial-ring/piece-of-pie.js +144 -44
  95. package/programs/totems/camerauniformblock.js +65 -56
  96. package/programs/totems/canvas-webglobe-info.js +49 -45
  97. package/programs/totems/gpu-selection-uniform-block.js +45 -45
  98. package/programs/totems/index.js +2 -40
  99. package/programs/two-d/pixel-padding-for-compass.js +94 -36
  100. package/programs/util.js +7 -10
  101. package/programs/vectorfields/index.js +3 -23
  102. package/programs/vectorfields/logics/drawrectangleparticles.js +73 -35
  103. package/programs/vectorfields/logics/index.js +4 -12
  104. package/programs/vectorfields/logics/pixelbased.js +94 -41
  105. package/programs/vectorfields/logics/ubo.js +32 -32
  106. package/programs/vectorfields/pingpongbuffermanager.js +30 -37
  107. package/rangerings/enum.js +2 -5
  108. package/rangerings/index.js +5 -15
  109. package/rangerings/plugin.js +223 -286
  110. package/rangerings/rangeringangletext.js +122 -137
  111. package/rangerings/ring-account.js +53 -75
  112. package/shaders/fragment-toy/firework.js +55 -4
  113. package/shaders/fragment-toy/singularity.js +56 -5
  114. package/timetracks/adaptors-line-strip.js +27 -44
  115. package/timetracks/adaptors.js +48 -67
  116. package/timetracks/index.js +5 -19
  117. package/timetracks/plugin-line-strip.js +65 -79
  118. package/timetracks/plugin.js +71 -85
  119. package/timetracks/program-line-strip.js +297 -107
  120. package/timetracks/program.js +421 -118
  121. package/timetracks/programpoint-line-strip.js +98 -48
  122. package/timetracks/programpoint.js +91 -48
  123. package/util/account/bufferoffsetmanager.js +72 -98
  124. package/util/account/index.js +3 -23
  125. package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -48
  126. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -98
  127. package/util/account/single-attribute-buffer-management/index.js +4 -9
  128. package/util/account/single-attribute-buffer-management/object-store.js +29 -34
  129. package/util/account/single-attribute-buffer-management/types.js +1 -2
  130. package/util/account/util.js +2 -8
  131. package/util/algorithms/search-binary.js +5 -8
  132. package/util/check/get.js +5 -9
  133. package/util/check/typecheck.js +13 -24
  134. package/util/geometry/index.js +10 -18
  135. package/util/gl-util/buffer/attribute-loader.js +10 -26
  136. package/util/gl-util/buffer/index.js +2 -5
  137. package/util/gl-util/draw-options/methods.js +10 -15
  138. package/util/gl-util/uniform-block/manager.js +69 -72
  139. package/util/heatwavedatamanager/datamanager.js +56 -119
  140. package/util/heatwavedatamanager/index.js +3 -10
  141. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +38 -47
  142. package/util/heatwavedatamanager/pointcoordsmeta.js +9 -13
  143. package/util/index.js +13 -57
  144. package/util/interpolation/timetrack/index.js +2 -5
  145. package/util/interpolation/timetrack/timetrack-interpolator.js +30 -36
  146. package/util/interpolation/timetrack/web-worker-str.js +180 -5
  147. package/util/interpolation/timetrack/web-worker.js +4 -6
  148. package/util/jshelpers/data-filler.js +8 -11
  149. package/util/jshelpers/equality.js +1 -3
  150. package/util/jshelpers/index.js +2 -37
  151. package/util/jshelpers/timefilters.js +8 -10
  152. package/util/picking/fence.js +8 -11
  153. package/util/picking/picker-displayer.js +49 -58
  154. package/util/programs/draw-texture-on-canvas.js +41 -26
  155. package/util/programs/index.js +1 -17
  156. package/util/programs/shapesonglobe.js +104 -68
  157. package/util/programs/supersampletotextures.js +45 -43
  158. package/util/programs/texturetoglobe.js +99 -52
  159. package/util/shaderfunctions/geometrytransformations.js +323 -35
  160. package/util/shaderfunctions/index.js +2 -18
  161. package/util/shaderfunctions/nodata.js +8 -5
  162. package/util/shaderfunctions/noisefunctions.js +40 -12
  163. package/util/surface-line-data/arcs-to-cuts.js +20 -23
  164. package/util/webglobe/gldefaultstates.js +1 -4
  165. package/util/webglobe/index.js +2 -18
  166. package/util/webglobe/rasteroverlay.js +36 -41
  167. package/util/webglobjectbuilders.js +70 -93
  168. package/util/webglobjectbuilders1.js +63 -82
  169. package/waveparticles/adaptor.js +7 -10
  170. package/waveparticles/index.js +3 -10
  171. package/waveparticles/plugin.js +82 -90
  172. package/wind/imagetovectorfieldandmagnitude.js +16 -19
  173. package/wind/index.js +5 -14
  174. package/wind/plugin.js +454 -291
  175. package/wind/vectorfieldimage.js +6 -8
  176. package/write-text/attached-text-writer.js +48 -54
  177. package/write-text/context-text.js +52 -63
  178. package/write-text/context-text3.js +71 -80
  179. package/write-text/index.js +1 -5
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * This class registered as globe plugin one for each globe. to the head of plugin call stack.
4
4
  */
5
- var PinPointTotem = /** @class */ (function () {
6
- function PinPointTotem(globe) {
5
+ class PinPointTotem {
6
+ constructor(globe) {
7
7
  this.objectArrayMap = new Map();
8
8
  }
9
9
  /**
@@ -18,44 +18,43 @@ var PinPointTotem = /** @class */ (function () {
18
18
  * keyUp
19
19
  * }
20
20
  */
21
- PinPointTotem.prototype.registerPinMap = function (objectArray, callbacks) {
21
+ registerPinMap(objectArray, callbacks) {
22
22
  this.objectArrayMap.set(objectArray, callbacks);
23
- };
24
- PinPointTotem.prototype.unregisterPinMap = function (objectArray) {
23
+ }
24
+ unregisterPinMap(objectArray) {
25
25
  if (this.objectArrayMap.has(objectArray)) {
26
26
  this.objectArrayMap.delete(objectArray);
27
27
  }
28
28
  else {
29
29
  console.warn('PinPointTotem objectArrayMap does not contain the objectArray');
30
30
  }
31
- };
31
+ }
32
32
  // GlobeMethods
33
33
  // haritada sol butona basıldığında çağrılır
34
- PinPointTotem.prototype.mouseDown = function (x, y, event) {
34
+ mouseDown(x, y, event) {
35
35
  return false;
36
- };
36
+ }
37
37
  // mouse'a basılıp hareket ettirildiğinde, mouseDown'dan true dönmüşse çağrılır
38
- PinPointTotem.prototype.mouseMove = function (x, y, event) {
39
- };
38
+ mouseMove(x, y, event) {
39
+ }
40
40
  // mouse up'ın left'i mouseDown'dan true dönmüşse çağrılır, edit mode içindir
41
41
  // right'i ise sağ tıka basılıp bırakıldığında çağrılır
42
- PinPointTotem.prototype.mouseUp = function (x, y, event) {
43
- };
42
+ mouseUp(x, y, event) {
43
+ }
44
44
  // harita üzerinde tıklandığında çağrılır
45
- PinPointTotem.prototype.mouseClick = function (x, y, event) {
45
+ mouseClick(x, y, event) {
46
46
  return false;
47
- };
47
+ }
48
48
  // harita üzerinde çift tıklandığında çağrılır
49
- PinPointTotem.prototype.mouseDblClick = function (x, y, event) {
49
+ mouseDblClick(x, y, event) {
50
50
  return false;
51
- };
51
+ }
52
52
  // klavyeden bir tuşa basıldığı anda ve tuşa basılı kalınmaya devam edildiği durumlarda çalışır
53
- PinPointTotem.prototype.keyDown = function (event) {
53
+ keyDown(event) {
54
54
  return false;
55
- };
55
+ }
56
56
  // klavyedeki bir tuştan parmak çekildiği anda çalışır
57
- PinPointTotem.prototype.keyUp = function (event) {
57
+ keyUp(event) {
58
58
  return false;
59
- };
60
- return PinPointTotem;
61
- }());
59
+ }
60
+ }
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
4
3
  * TimeTrackMultiColorData is [
@@ -12,8 +11,6 @@
12
11
  * there is a cutting point between A and B
13
12
  *
14
13
  */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.timeTrackPluginDataToPointHeatInterpolatorAdapter = void 0;
17
14
  /**
18
15
  * ABOVE
19
16
  * TO
@@ -32,18 +29,18 @@ exports.timeTrackPluginDataToPointHeatInterpolatorAdapter = void 0;
32
29
  * @property {Array<Number>} times
33
30
  * @param {Array<Timetrack>} timeTracks
34
31
  */
35
- var methods_1 = require("../../Math/methods");
36
- var processACut = function (array, offset) {
32
+ import { pixelXYLenghtToUnitVectorWithHeight } from "../../Math/methods";
33
+ const processACut = (array, offset) => {
37
34
  // first 3 values of array
38
- var v3 = array.slice(offset, offset + 3);
39
- var v4 = (0, methods_1.pixelXYLenghtToUnitVectorWithHeight)(v3);
40
- var time = array[offset + 3];
35
+ const v3 = array.slice(offset, offset + 3);
36
+ const v4 = pixelXYLenghtToUnitVectorWithHeight(v3);
37
+ const time = array[offset + 3];
41
38
  return [v4, time];
42
39
  };
43
- var timeTrackPluginDataToPointHeatInterpolatorAdapter = function (timeTrackPluginData) {
44
- var timeTracks = [];
45
- var offset = 0;
46
- var timeTrack = {
40
+ const timeTrackPluginDataToPointHeatInterpolatorAdapter = (timeTrackPluginData) => {
41
+ const timeTracks = [];
42
+ let offset = 0;
43
+ let timeTrack = {
47
44
  coordinates: [],
48
45
  times: []
49
46
  };
@@ -56,11 +53,11 @@ var timeTrackPluginDataToPointHeatInterpolatorAdapter = function (timeTrackPlugi
56
53
  };
57
54
  offset += 9;
58
55
  }
59
- var point = processACut(timeTrackPluginData, offset);
56
+ const point = processACut(timeTrackPluginData, offset);
60
57
  offset += 9;
61
58
  timeTrack.coordinates.push(point[0]);
62
59
  timeTrack.times.push(point[1]);
63
60
  }
64
61
  return timeTracks;
65
62
  };
66
- exports.timeTrackPluginDataToPointHeatInterpolatorAdapter = timeTrackPluginDataToPointHeatInterpolatorAdapter;
63
+ export { timeTrackPluginDataToPointHeatInterpolatorAdapter };
@@ -1,15 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PointHeatmapPlugin = void 0;
4
- var point_to_heat_map_flow_1 = require("./point-to-heat-map-flow");
1
+ import { PointHeatmapFlow } from "./point-to-heat-map-flow";
5
2
  // import { webworkerStr } from "../util/interpolation/timetrack/web-worker-str"; // TODO: Delete When this plugin is tested on production
6
- var index_1 = require("../util/interpolation/timetrack/index");
7
- var util_1 = require("../util");
8
- var typecheck_1 = require("../util/check/typecheck");
9
- var PointHeatmapPlugin = /** @class */ (function () {
10
- function PointHeatmapPlugin(id, _a) {
11
- var _b = _a === void 0 ? {} : _a, _c = _b.opacity, opacity = _c === void 0 ? 1.0 : _c, _d = _b.pointSize, pointSize = _d === void 0 ? 5.0 : _d, _e = _b.onInterpolationComplete, onInterpolationComplete = _e === void 0 ? function () { } : _e;
12
- var _this = this;
3
+ import { createWorker } from "../util/interpolation/timetrack/index";
4
+ import { createTexture, getColorRampModed } from "../util";
5
+ import { opacityCheck, constraintFloat } from "../util/check/typecheck";
6
+ class PointHeatmapPlugin {
7
+ constructor(id, { opacity = 1.0, pointSize = 5.0, onInterpolationComplete = () => { } } = {}) {
13
8
  this.id = id;
14
9
  this.globe = null;
15
10
  this.gl = null;
@@ -22,8 +17,8 @@ var PointHeatmapPlugin = /** @class */ (function () {
22
17
  this._timeTracksAreSet = false;
23
18
  // const blob = new Blob([webworkerStr], { type: 'application/javascript' });
24
19
  // this.timeTrackInterpolationWorker = new Worker(URL.createObjectURL(blob), { type: 'module' });
25
- this.timeTrackInterpolationWorker = (0, index_1.createWorker)();
26
- this.timeTrackInterpolationWorker.onmessage = function (e) {
20
+ this.timeTrackInterpolationWorker = createWorker();
21
+ this.timeTrackInterpolationWorker.onmessage = (e) => {
27
22
  if (e.data.error) {
28
23
  throw new Error(e.data.error);
29
24
  }
@@ -31,89 +26,87 @@ var PointHeatmapPlugin = /** @class */ (function () {
31
26
  onInterpolationComplete();
32
27
  }
33
28
  if (e.data instanceof Float32Array) {
34
- _this.flow.setData(e.data);
35
- _this._throttleListener = null;
29
+ this.flow.setData(e.data);
30
+ this._throttleListener = null;
36
31
  onInterpolationComplete();
37
32
  }
38
33
  };
39
34
  }
40
35
  // globe interaction
41
- PointHeatmapPlugin.prototype.init = function (globe, gl) {
36
+ init(globe, gl) {
42
37
  this.globe = globe;
43
38
  this.gl = gl;
44
- this.flow = new point_to_heat_map_flow_1.PointHeatmapFlow(globe);
39
+ this.flow = new PointHeatmapFlow(globe);
45
40
  this.setGeometry();
46
41
  this.resize();
47
- };
48
- PointHeatmapPlugin.prototype.setPointSize = function (pointSize) {
49
- (0, typecheck_1.constraintFloat)(pointSize, 1);
42
+ }
43
+ setPointSize(pointSize) {
44
+ constraintFloat(pointSize, 1);
50
45
  this._pointSize = pointSize;
51
46
  this.globe.DrawRender();
52
- };
47
+ }
53
48
  /**
54
49
  * @param {Array<string>}
55
50
  * @param {string} mode "interpolated" | "discrete"
56
51
  */
57
- PointHeatmapPlugin.prototype.setColorRamp = function (values, thresholds, mode) {
58
- if (mode === void 0) { mode = "interpolated"; }
59
- var gl = this.gl;
52
+ setColorRamp(values, thresholds, mode = "interpolated") {
53
+ const gl = this.gl;
60
54
  if (this.gl === null) {
61
55
  throw new Error('Plugin not initialized');
62
56
  }
63
57
  ;
64
- var rampData = (0, util_1.getColorRampModed)(values, thresholds, mode);
65
- var texture = (0, util_1.createTexture)(gl, gl.LINEAR, rampData, 256, 1);
58
+ const rampData = getColorRampModed(values, thresholds, mode);
59
+ const texture = createTexture(gl, gl.LINEAR, rampData, 256, 1);
66
60
  if (this._legendTexture) {
67
61
  this.gl.deleteTexture(this._legendTexture);
68
62
  }
69
63
  this._legendTexture = texture;
70
64
  this.globe.DrawRender();
71
- };
72
- PointHeatmapPlugin.prototype.setTime = function (time) {
73
- var _this = this;
65
+ }
66
+ setTime(time) {
74
67
  // TODO: WORK ON THIS
75
68
  this._time = time;
76
69
  if (this.isReady() && this._throttleListener === null) {
77
- this._throttleListener = setTimeout(function () {
78
- _this.timeTrackInterpolationWorker.postMessage({ time: _this._time });
70
+ this._throttleListener = setTimeout(() => {
71
+ this.timeTrackInterpolationWorker.postMessage({ time: this._time });
79
72
  }, 0);
80
73
  }
81
- };
82
- PointHeatmapPlugin.prototype.setTimetracks = function (timeTracks) {
74
+ }
75
+ setTimetracks(timeTracks) {
83
76
  this._timeTracksAreSet = true;
84
- this.timeTrackInterpolationWorker.postMessage({ timeTracks: timeTracks });
77
+ this.timeTrackInterpolationWorker.postMessage({ timeTracks });
85
78
  if (this._time !== null) {
86
79
  this.setTime(this._time);
87
80
  }
88
81
  this.globe.DrawRender();
89
- };
90
- PointHeatmapPlugin.prototype.setOpacity = function (opacity) {
91
- (0, typecheck_1.opacityCheck)(opacity);
82
+ }
83
+ setOpacity(opacity) {
84
+ opacityCheck(opacity);
92
85
  this._opacity = opacity;
93
86
  this.globe.DrawRender();
94
- };
95
- PointHeatmapPlugin.prototype.setGeometry = function () {
96
- var geometry = this.globe.api_GetCurrentGeometry();
97
- this.timeTrackInterpolationWorker.postMessage({ geometry: geometry });
87
+ }
88
+ setGeometry() {
89
+ const geometry = this.globe.api_GetCurrentGeometry();
90
+ this.timeTrackInterpolationWorker.postMessage({ geometry });
98
91
  if (this._time !== null) {
99
92
  this.setTime(this._time);
100
93
  }
101
- };
102
- PointHeatmapPlugin.prototype.draw3D = function () {
94
+ }
95
+ draw3D() {
103
96
  if (this.isReady()) {
104
97
  this.flow.draw(this._legendTexture, this._pointSize, this._opacity);
105
98
  }
106
- };
107
- PointHeatmapPlugin.prototype.resize = function () {
99
+ }
100
+ resize() {
108
101
  this.flow.resize();
109
102
  if (this._time !== null) {
110
103
  this.setTime(this._time);
111
104
  }
112
- };
113
- PointHeatmapPlugin.prototype.isReady = function () {
105
+ }
106
+ isReady() {
114
107
  return (this.gl !== null && this._legendTexture !== null && this._timeTracksAreSet);
115
- };
116
- PointHeatmapPlugin.prototype.free = function () {
108
+ }
109
+ free() {
117
110
  if (this._isFreed)
118
111
  return;
119
112
  this.gl.deleteTexture(this._legendTexture);
@@ -125,7 +118,6 @@ var PointHeatmapPlugin = /** @class */ (function () {
125
118
  this._legendTexture = null;
126
119
  this.timeTrackInterpolationWorker.terminate();
127
120
  this.timeTrackInterpolationWorker = null;
128
- };
129
- return PointHeatmapPlugin;
130
- }());
131
- exports.PointHeatmapPlugin = PointHeatmapPlugin;
121
+ }
122
+ }
123
+ export { PointHeatmapPlugin };
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PointHeatmapFlow = void 0;
4
- var density_to_legend_1 = require("../programs/data2legend/density-to-legend");
5
- var point_to_density_texture_1 = require("../programs/data2legend/point-to-density-texture");
1
+ import { densityToLegendProgramCache } from "../programs/data2legend/density-to-legend";
2
+ import { pointToDensityTextureCache } from "../programs/data2legend/point-to-density-texture";
6
3
  // import { textureOnCanvasProgramCache } from "../util/programs/draw-texture-on-canvas";
7
- var gldefaultstates_1 = require("../util/webglobe/gldefaultstates");
8
- var PointHeatmapFlow = /** @class */ (function () {
9
- function PointHeatmapFlow(globe) {
4
+ import { defaultblendfunction } from "../util/webglobe/gldefaultstates";
5
+ class PointHeatmapFlow {
6
+ constructor(globe) {
10
7
  this.globe = null;
11
8
  this.gl = null;
12
9
  this.program = null;
13
10
  this.densityToLegendProgram = null;
14
11
  this.globe = globe;
15
12
  this.gl = globe.gl;
16
- this.pointToDensityProgram = point_to_density_texture_1.pointToDensityTextureCache.get(globe);
17
- this.densityToLegendProgram = density_to_legend_1.densityToLegendProgramCache.get(globe);
13
+ this.pointToDensityProgram = pointToDensityTextureCache.get(globe);
14
+ this.densityToLegendProgram = densityToLegendProgramCache.get(globe);
18
15
  // this.testTextureProgram = textureOnCanvasProgramCache.get(globe.gl);
19
16
  this._lookInfo = globe.api_GetCurrentLookInfo();
20
- var gl = this.gl;
17
+ const { gl } = this;
21
18
  {
22
19
  this.buffer = gl.createBuffer();
23
20
  this.vao2D = this.pointToDensityProgram.createVAO(this.buffer, 2);
@@ -29,15 +26,14 @@ var PointHeatmapFlow = /** @class */ (function () {
29
26
  this._bindTextureToFramebuffer();
30
27
  }
31
28
  }
32
- PointHeatmapFlow.prototype._bindTextureToFramebuffer = function () {
33
- var _a = this, gl = _a.gl, densityTexture = _a.densityTexture, framebuffer = _a.framebuffer;
29
+ _bindTextureToFramebuffer() {
30
+ const { gl, densityTexture, framebuffer } = this;
34
31
  gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
35
32
  gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, densityTexture, 0);
36
33
  gl.bindFramebuffer(gl.FRAMEBUFFER, null);
37
- };
38
- PointHeatmapFlow.prototype.draw = function (legendTexture, pointSize, opacity) {
39
- if (opacity === void 0) { opacity = 1.0; }
40
- var _a = this, gl = _a.gl, globe = _a.globe, framebuffer = _a.framebuffer;
34
+ }
35
+ draw(legendTexture, pointSize, opacity = 1.0) {
36
+ const { gl, globe, framebuffer } = this;
41
37
  if (this._drawDensityRequired || this._isVisionChanged()) {
42
38
  gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
43
39
  gl.clearColor(0, 0, 0, 0);
@@ -46,36 +42,36 @@ var PointHeatmapFlow = /** @class */ (function () {
46
42
  this._drawDensity(pointSize);
47
43
  gl.bindFramebuffer(gl.FRAMEBUFFER, null);
48
44
  }
49
- (0, gldefaultstates_1.defaultblendfunction)(gl);
45
+ defaultblendfunction(gl);
50
46
  this._drawLegend(legendTexture, opacity);
51
- };
52
- PointHeatmapFlow.prototype.resize = function () {
53
- var _a = this, gl = _a.gl, densityTexture = _a.densityTexture;
47
+ }
48
+ resize() {
49
+ const { gl, densityTexture } = this;
54
50
  gl.deleteTexture(densityTexture);
55
51
  this.densityTexture = this._createDensityTexture();
56
52
  this._bindTextureToFramebuffer();
57
53
  this._drawDensityRequired = true;
58
- };
54
+ }
59
55
  // USER API
60
56
  /**
61
57
  * @param {Float32Array} data
62
58
  * @format [x, y, z, height] x,y,z is normalized 3d cartesian coordinates. Height in kilometers. Set 6378.137 for ground level.
63
59
  */
64
- PointHeatmapFlow.prototype.setData = function (data) {
65
- var _a = this, gl = _a.gl, buffer = _a.buffer;
60
+ setData(data) {
61
+ const { gl, buffer } = this;
66
62
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
67
63
  gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
68
64
  // use program
69
65
  this.dataLength = data.length;
70
66
  this._drawDensityRequired = true;
71
67
  this.globe.DrawRender();
72
- };
68
+ }
73
69
  // implicit Methods
74
- PointHeatmapFlow.prototype._createDensityTexture = function () {
75
- var _a = this, gl = _a.gl, globe = _a.globe;
76
- var width = Math.floor(globe.api_ScrW());
77
- var height = Math.floor(globe.api_ScrH());
78
- var texture = gl.createTexture();
70
+ _createDensityTexture() {
71
+ const { gl, globe } = this;
72
+ const width = Math.floor(globe.api_ScrW());
73
+ const height = Math.floor(globe.api_ScrH());
74
+ const texture = gl.createTexture();
79
75
  gl.bindTexture(gl.TEXTURE_2D, texture);
80
76
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
81
77
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
@@ -83,24 +79,24 @@ var PointHeatmapFlow = /** @class */ (function () {
83
79
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
84
80
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
85
81
  return texture;
86
- };
87
- PointHeatmapFlow.prototype._drawDensity = function (pointSize) {
88
- var _a = this, gl = _a.gl, globe = _a.globe, pointToDensityProgram = _a.pointToDensityProgram, vao2D = _a.vao2D, vao3D = _a.vao3D, dataLength = _a.dataLength;
89
- var is3D = globe.api_GetCurrentGeometry() === 0;
90
- var vao = is3D ? vao3D : vao2D;
91
- var length = dataLength / (is3D ? 3 : 2);
82
+ }
83
+ _drawDensity(pointSize) {
84
+ const { gl, globe, pointToDensityProgram, vao2D, vao3D, dataLength } = this;
85
+ const is3D = globe.api_GetCurrentGeometry() === 0;
86
+ const vao = is3D ? vao3D : vao2D;
87
+ const length = dataLength / (is3D ? 3 : 2);
92
88
  gl.blendEquation(gl.FUNC_ADD);
93
89
  gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE, gl.SRC_ALPHA, gl.ONE);
94
90
  pointToDensityProgram.draw(vao, length, pointSize);
95
91
  this._drawDensityRequired = false;
96
- };
97
- PointHeatmapFlow.prototype._drawLegend = function (legendTexture, opacity) {
98
- var _a = this, densityToLegendProgram = _a.densityToLegendProgram, densityTexture = _a.densityTexture;
92
+ }
93
+ _drawLegend(legendTexture, opacity) {
94
+ const { densityToLegendProgram, densityTexture } = this;
99
95
  densityToLegendProgram.draw(densityTexture, legendTexture, opacity);
100
- };
101
- PointHeatmapFlow.prototype._isVisionChanged = function () {
102
- var currentLookInfo = this.globe.api_GetCurrentLookInfo();
103
- var _lookInfo = this._lookInfo;
96
+ }
97
+ _isVisionChanged() {
98
+ const currentLookInfo = this.globe.api_GetCurrentLookInfo();
99
+ const _lookInfo = this._lookInfo;
104
100
  if (currentLookInfo.CenterLong !== _lookInfo.CenterLong ||
105
101
  currentLookInfo.CenterLat !== _lookInfo.CenterLat ||
106
102
  currentLookInfo.Distance !== _lookInfo.Distance ||
@@ -110,20 +106,19 @@ var PointHeatmapFlow = /** @class */ (function () {
110
106
  return true;
111
107
  }
112
108
  return false;
113
- };
114
- PointHeatmapFlow.prototype.free = function () {
109
+ }
110
+ free() {
115
111
  if (this._isFreed)
116
112
  return;
117
113
  this._isFreed = true;
118
- density_to_legend_1.densityToLegendProgramCache.release(this.globe);
119
- point_to_density_texture_1.pointToDensityTextureCache.release(this.globe);
114
+ densityToLegendProgramCache.release(this.globe);
115
+ pointToDensityTextureCache.release(this.globe);
120
116
  // textureOnCanvasProgramCache.release(this.gl);
121
117
  this.gl.deleteTexture(this.densityTexture);
122
118
  this.gl.deleteFramebuffer(this.framebuffer);
123
119
  this.gl.deleteBuffer(this.buffer);
124
120
  this.gl.deleteVertexArray(this.vao2D);
125
121
  this.gl.deleteVertexArray(this.vao3D);
126
- };
127
- return PointHeatmapFlow;
128
- }());
129
- exports.PointHeatmapFlow = PointHeatmapFlow;
122
+ }
123
+ }
124
+ export { PointHeatmapFlow };
@@ -1,5 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pointKeyMeyhod = void 0;
4
- var pointKeyMeyhod = function (trackId, pointID) { return "".concat(trackId, "-").concat(pointID); };
5
- exports.pointKeyMeyhod = pointKeyMeyhod;
1
+ const pointKeyMeyhod = (trackId, pointID) => `${trackId}-${pointID}`;
2
+ export { pointKeyMeyhod };