@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.
Files changed (226) hide show
  1. package/package.json +8 -2
  2. package/Math/angle-calculation.js +0 -14
  3. package/Math/arc.ts +0 -76
  4. package/Math/bounds/line-bbox.js +0 -225
  5. package/Math/constants.ts +0 -11
  6. package/Math/frustum/camera.ts +0 -32
  7. package/Math/frustum/from-globeinfo.ts +0 -63
  8. package/Math/frustum/types.ts +0 -11
  9. package/Math/globe-util/horizon-plane.ts +0 -137
  10. package/Math/index.js +0 -0
  11. package/Math/juction/arc-plane.ts +0 -114
  12. package/Math/juction/line-sphere.ts +0 -30
  13. package/Math/juction/plane-plane.ts +0 -66
  14. package/Math/line.ts +0 -70
  15. package/Math/matrix4.ts +0 -0
  16. package/Math/methods.js +0 -237
  17. package/Math/plane.ts +0 -86
  18. package/Math/quaternion.ts +0 -120
  19. package/Math/roadmap.md +0 -10
  20. package/Math/types.ts +0 -45
  21. package/Math/utils.js +0 -3
  22. package/Math/vec3.ts +0 -155
  23. package/algorithms/search-binary.js +0 -14
  24. package/altitude-locator/adaptors.js +0 -0
  25. package/altitude-locator/draw-subset-obj.js +0 -27
  26. package/altitude-locator/keymethod.js +0 -0
  27. package/altitude-locator/plugin.js +0 -439
  28. package/altitude-locator/types.js +0 -26
  29. package/arrowfield/adaptor.js +0 -11
  30. package/arrowfield/index.js +0 -3
  31. package/arrowfield/plugin.js +0 -128
  32. package/bearing-line/index.js +0 -2
  33. package/bearing-line/plugin.js +0 -512
  34. package/circle-line-chain/chain-list-map.js +0 -221
  35. package/circle-line-chain/init.js +0 -0
  36. package/circle-line-chain/plugin.js +0 -469
  37. package/circle-line-chain/readme.md +0 -57
  38. package/circle-line-chain/util.js +0 -1
  39. package/compass-rose/compass-rose-padding-flat.js +0 -266
  40. package/compass-rose/compass-text-writer.js +0 -173
  41. package/compass-rose/index.js +0 -3
  42. package/compassrose/compassrose.js +0 -341
  43. package/compassrose/index.js +0 -2
  44. package/depth-locator/readme.md +0 -26
  45. package/globe-types.ts +0 -13
  46. package/heatwave/index.js +0 -4
  47. package/heatwave/isobar/objectarraylabels.js +0 -247
  48. package/heatwave/isobar/plugin.js +0 -340
  49. package/heatwave/isobar/quadtreecontours.js +0 -336
  50. package/heatwave/plugins/heatwaveglobeshell.js +0 -258
  51. package/jest.config.js +0 -6
  52. package/partialrings/buffer-manager.js +0 -89
  53. package/partialrings/goals.md +0 -17
  54. package/partialrings/index.js +0 -3
  55. package/partialrings/plugin.js +0 -160
  56. package/partialrings/program.js +0 -324
  57. package/pin/pin-object-array.js +0 -381
  58. package/pin/pin-point-totem.js +0 -77
  59. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -78
  60. package/point-heat-map/index.js +0 -0
  61. package/point-heat-map/plugin-webworker.js +0 -151
  62. package/point-heat-map/point-to-heat-map-flow.js +0 -150
  63. package/point-heat-map/readme.md +0 -15
  64. package/point-tracks/key-methods.js +0 -3
  65. package/point-tracks/plugin.js +0 -394
  66. package/programs/arrowfield/index.js +0 -2
  67. package/programs/arrowfield/logic.js +0 -286
  68. package/programs/arrowfield/object.js +0 -89
  69. package/programs/data2legend/density-to-legend.js +0 -115
  70. package/programs/data2legend/point-to-density-texture.js +0 -114
  71. package/programs/float2legendwithratio/index.js +0 -3
  72. package/programs/float2legendwithratio/logic.js +0 -194
  73. package/programs/float2legendwithratio/object.js +0 -141
  74. package/programs/globe-util/is-globe-moved.js +0 -27
  75. package/programs/globeshell/index.js +0 -2
  76. package/programs/globeshell/noise/noises.js +0 -0
  77. package/programs/globeshell/wiggle/index.js +0 -6
  78. package/programs/globeshell/wiggle/logic.js +0 -371
  79. package/programs/globeshell/wiggle/object.js +0 -93
  80. package/programs/helpers/blender/index.js +0 -0
  81. package/programs/helpers/blender/program.js +0 -91
  82. package/programs/helpers/fadeaway/index.js +0 -3
  83. package/programs/helpers/fadeaway/logic.js +0 -76
  84. package/programs/helpers/fadeaway/object.js +0 -20
  85. package/programs/helpers/index.js +0 -2
  86. package/programs/index.js +0 -21
  87. package/programs/interface.ts +0 -7
  88. package/programs/line-on-globe/angled-line.js +0 -206
  89. package/programs/line-on-globe/circle-accurate-3d.js +0 -167
  90. package/programs/line-on-globe/circle-accurate-flat.js +0 -262
  91. package/programs/line-on-globe/circle-accurate.js +0 -202
  92. package/programs/line-on-globe/circle.js +0 -191
  93. package/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -188
  94. package/programs/line-on-globe/index.js +0 -0
  95. package/programs/line-on-globe/lines-color-instanced-flat.js +0 -151
  96. package/programs/line-on-globe/linestrip.ts +0 -228
  97. package/programs/line-on-globe/naive-accurate-flexible.js +0 -239
  98. package/programs/line-on-globe/to-the-surface.js +0 -129
  99. package/programs/line-on-globe/util.js +0 -8
  100. package/programs/picking/pickable-renderer.js +0 -216
  101. package/programs/point-on-globe/element-globe-surface-glow.js +0 -168
  102. package/programs/point-on-globe/element-point-glow.js +0 -184
  103. package/programs/point-on-globe/square-pixel-point.js +0 -189
  104. package/programs/programcache.ts +0 -131
  105. package/programs/rings/distancering/circleflatprogram.js +0 -136
  106. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -378
  107. package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -420
  108. package/programs/rings/distancering/index.js +0 -5
  109. package/programs/rings/distancering/paddyflatprogram.js +0 -146
  110. package/programs/rings/distancering/paddyflatprogram2d.js +0 -150
  111. package/programs/rings/distancering/paddyflatprogram3d.js +0 -146
  112. package/programs/rings/distancering/shader.js +0 -0
  113. package/programs/rings/index.js +0 -1
  114. package/programs/rings/partial-ring/piece-of-pie.js +0 -315
  115. package/programs/totems/camerauniformblock.d.ts +0 -48
  116. package/programs/totems/camerauniformblock.js +0 -197
  117. package/programs/totems/canvas-webglobe-info.js +0 -136
  118. package/programs/totems/gpu-selection-uniform-block.js +0 -132
  119. package/programs/totems/index.ts +0 -2
  120. package/programs/two-d/pixel-circle.js +0 -0
  121. package/programs/two-d/pixel-padding-for-compass.js +0 -174
  122. package/programs/util.js +0 -20
  123. package/programs/vectorfields/index.js +0 -3
  124. package/programs/vectorfields/logics/drawrectangleparticles.js +0 -125
  125. package/programs/vectorfields/logics/index.js +0 -5
  126. package/programs/vectorfields/logics/pixelbased.js +0 -161
  127. package/programs/vectorfields/logics/ubo.js +0 -64
  128. package/programs/vectorfields/pingpongbuffermanager.js +0 -80
  129. package/publish.bat +0 -60
  130. package/rangerings/enum.js +0 -3
  131. package/rangerings/index.js +0 -5
  132. package/rangerings/plugin.js +0 -649
  133. package/rangerings/rangeringangletext.js +0 -368
  134. package/rangerings/ring-account.js +0 -129
  135. package/shaders/fragment-toy/firework.js +0 -55
  136. package/shaders/fragment-toy/singularity.js +0 -59
  137. package/shape-on-terrain/arc/naive/plugin.ts +0 -304
  138. package/shape-on-terrain/goal.md +0 -12
  139. package/tests/Math/junction/arc-plane.test.ts +0 -133
  140. package/tests/Math/junction/plane-plane.test.ts +0 -82
  141. package/tests/Math/plane.test.ts +0 -43
  142. package/tests/Math/vec3.test.ts +0 -14
  143. package/timetracks/adaptors-line-strip.js +0 -80
  144. package/timetracks/adaptors.js +0 -133
  145. package/timetracks/index.js +0 -6
  146. package/timetracks/plugin-line-strip.js +0 -295
  147. package/timetracks/plugin.js +0 -304
  148. package/timetracks/program-line-strip.js +0 -688
  149. package/timetracks/program.js +0 -850
  150. package/timetracks/programpoint-line-strip.js +0 -175
  151. package/timetracks/programpoint.js +0 -168
  152. package/timetracks/readme.md +0 -1
  153. package/tsconfig.json +0 -21
  154. package/types.ts +0 -17
  155. package/util/account/bufferoffsetmanager.js +0 -209
  156. package/util/account/index.js +0 -6
  157. package/util/account/single-attribute-buffer-management/buffer-manager.ts +0 -119
  158. package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +0 -173
  159. package/util/account/single-attribute-buffer-management/index.ts +0 -13
  160. package/util/account/single-attribute-buffer-management/object-store.ts +0 -65
  161. package/util/account/single-attribute-buffer-management/types.ts +0 -39
  162. package/util/account/util.js +0 -22
  163. package/util/algorithms/index.js +0 -0
  164. package/util/algorithms/search-binary.js +0 -26
  165. package/util/check/get.js +0 -13
  166. package/util/check/index.js +0 -0
  167. package/util/check/typecheck.js +0 -39
  168. package/util/geometry/index.js +0 -53
  169. package/util/gl-util/buffer/attribute-loader.ts +0 -85
  170. package/util/gl-util/buffer/index.ts +0 -6
  171. package/util/gl-util/buffer/types.ts +0 -13
  172. package/util/gl-util/draw-options/methods.ts +0 -66
  173. package/util/gl-util/draw-options/types.ts +0 -28
  174. package/util/gl-util/uniform-block/manager.ts +0 -187
  175. package/util/gl-util/uniform-block/roadmap.md +0 -70
  176. package/util/gl-util/uniform-block/shader.js +0 -0
  177. package/util/gl-util/uniform-block/types.ts +0 -27
  178. package/util/heatwavedatamanager/datamanager.js +0 -168
  179. package/util/heatwavedatamanager/index.js +0 -3
  180. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -133
  181. package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
  182. package/util/index.js +0 -13
  183. package/util/interpolation/index.js +0 -0
  184. package/util/interpolation/timetrack/index.js +0 -9
  185. package/util/interpolation/timetrack/timetrack-interpolator.js +0 -88
  186. package/util/interpolation/timetrack/web-worker-str.js +0 -180
  187. package/util/interpolation/timetrack/web-worker.js +0 -51
  188. package/util/jshelpers/data-filler.js +0 -19
  189. package/util/jshelpers/equality.js +0 -17
  190. package/util/jshelpers/index.js +0 -1
  191. package/util/jshelpers/timefilters.js +0 -32
  192. package/util/picking/fence.js +0 -46
  193. package/util/picking/picker-displayer.js +0 -177
  194. package/util/programs/draw-texture-on-canvas.js +0 -102
  195. package/util/programs/index.js +0 -1
  196. package/util/programs/shapesonglobe.js +0 -246
  197. package/util/programs/supersampletotextures.js +0 -142
  198. package/util/programs/texturetoglobe.js +0 -203
  199. package/util/shaderfunctions/geometrytransformations.ts +0 -388
  200. package/util/shaderfunctions/index.js +0 -2
  201. package/util/shaderfunctions/nodata.js +0 -10
  202. package/util/shaderfunctions/noisefunctions.js +0 -44
  203. package/util/surface-line-data/arc-bboxes.ts +0 -42
  204. package/util/surface-line-data/arcs-to-cuts.js +0 -74
  205. package/util/surface-line-data/cut-arc.js +0 -0
  206. package/util/surface-line-data/flow.ts +0 -52
  207. package/util/surface-line-data/rbush-manager.js +0 -0
  208. package/util/surface-line-data/types.ts +0 -27
  209. package/util/surface-line-data/web-worker.js +0 -0
  210. package/util/webglobe/gldefaultstates.js +0 -5
  211. package/util/webglobe/index.js +0 -2
  212. package/util/webglobe/rasteroverlay.js +0 -96
  213. package/util/webglobjectbuilders.ts +0 -456
  214. package/util/webglobjectbuilders1.js +0 -271
  215. package/waveparticles/adaptor.js +0 -16
  216. package/waveparticles/index.js +0 -3
  217. package/waveparticles/plugin.js +0 -313
  218. package/wind/imagetovectorfieldandmagnitude.js +0 -39
  219. package/wind/index.js +0 -5
  220. package/wind/plugin.js +0 -1057
  221. package/wind/vectorfieldimage.js +0 -27
  222. package/write-text/attached-text-writer.js +0 -105
  223. package/write-text/context-text.js +0 -125
  224. package/write-text/context-text3.js +0 -178
  225. package/write-text/index.js +0 -1
  226. package/write-text/writer-plugin.js +0 -7
@@ -1,133 +0,0 @@
1
- import { latLongToPixelXY } from "../util";
2
- const _latLongToPixelXY = latLongToPixelXY;
3
-
4
-
5
-
6
- class Adaptor {
7
- /**
8
- * @param {Object.<string, Color>} groupColorMap
9
- * @typedef {Array} Color | [r, g, b] | between 0-1
10
- */
11
- constructor(groupColorMap) {
12
- this._groupColorMap = groupColorMap;
13
- }
14
-
15
- /**
16
- * @param {Object} geojsonObject
17
- * @param {number} startTime
18
- * @param {string} timePropertyName
19
- * @param {string} styleGroupPropertyName
20
- * @returns {lineData} lineData for Plugin
21
- */
22
- fromGeoJson(geojsonObject, startTime, timePropertyName = "messageTime", styleGroupPropertyName = "styleGroup") {
23
- const features = geojsonObject.features.filter(feature => feature.geometry.coordinates.length > 1);
24
-
25
- const buffer = createFloat32Array(features.map(feature => feature.geometry.coordinates));
26
-
27
- let offset = 0;
28
- for (let feature of features) {
29
- const coordinates = feature.geometry.coordinates;
30
- const timestamps = feature.properties[timePropertyName].map((time) => (time - startTime) / 1000);
31
- const styleGroupNameArray = feature.properties[styleGroupPropertyName];
32
- offset = fillSliceOfFloat32Array(coordinates, timestamps, styleGroupNameArray, this._groupColorMap, buffer, offset);
33
- }
34
- return buffer;
35
- }
36
-
37
- /**
38
- * Inputs are lists of tracks. Each track is a list of coordinates, timestamps and styleGroupNames.
39
- * @param {Array.<Array.<Array.<number>>>} coordinatesList | [ [ [lon, lat, z], [lon, lat, z], ...], ...
40
- * @param {Array.<Array.<number>>} timestampsList | [ [time, time, ...], ...
41
- * @param {Array.<Array.<String>>} colorGroupList | [ [styleGroupName, styleGroupName, ...], ...
42
- * @param {number} startTime | epoch time
43
- * @returns {lineData} lineData for Plugin
44
- */
45
- fromLists(coordinatesList, timestampsList, colorGroupList, startTime) {
46
-
47
- const buffer = createFloat32Array(coordinatesList);
48
-
49
- let offset = 0;
50
- for (let i = 0; i < coordinatesList.length; i++) {
51
- const coordinates = coordinatesList[i];
52
- const timestamps = timestampsList[i].map((time) => (time - startTime) / 1000);
53
- const styleGroupNameArray = colorGroupList[i];
54
- offset = fillSliceOfFloat32Array(coordinates, timestamps, styleGroupNameArray, this._groupColorMap, buffer, offset);
55
- }
56
- return buffer;
57
- }
58
- }
59
-
60
- /**
61
- * @param {Array.<Array.<number>>} coordinates
62
- * @param {Array.<number>} timestamps
63
- * @param {Array.<String>} styleGroupNameArray
64
- * @param {Object.<string, TrackStyleGroup>} _groupColorMap
65
- * @param {Float32Array} floatArray
66
- * @param {number} offset
67
- *
68
- * create floatArray with createFloat32Array before calling this function.
69
- * start offset from 0.
70
- * feed the floatArray with a track data and offset that is returned from the previous call.
71
- */
72
- function fillSliceOfFloat32Array(coordinates, timestamps, styleGroupNameArray, _groupColorMap, floatArray, offset) {
73
-
74
- if (coordinates[0].length === 2) {
75
- const startTime = timestamps[0];
76
- const endTime = timestamps[timestamps.length - 1];
77
- let prevPointData = null;
78
- { // first point
79
- const { x, y } = _latLongToPixelXY(coordinates[0][1], coordinates[0][0]);
80
- prevPointData = [x, y, 0, timestamps[0], ..._groupColorMap[styleGroupNameArray[0]]];
81
- }
82
- { // middle points until end
83
- for (let i = 1; i < coordinates.length; i++) {
84
- const time = timestamps[i];
85
- const coord = coordinates[i];
86
- const { x, y } = _latLongToPixelXY(coord[1], coord[0]);
87
- floatArray.set([...prevPointData, startTime, endTime, x, y, 0, time, ..._groupColorMap[styleGroupNameArray[i]], startTime, endTime], offset);
88
- prevPointData = [x, y, 0, time, ..._groupColorMap[styleGroupNameArray[i]]];
89
- offset += 18;
90
- }
91
- }
92
- } else {
93
-
94
- const startTime = timestamps[0];
95
- const endTime = timestamps[timestamps.length - 1];
96
- let prevPointData = null;
97
- { // first point
98
- const { x, y } = _latLongToPixelXY(coordinates[0][1], coordinates[0][0]);
99
- prevPointData = [x, y, coordinates[0][2] / 1000.0, timestamps[0], ..._groupColorMap[styleGroupNameArray[0]]];
100
- }
101
- { // middle points until end
102
- for (let i = 1; i < coordinates.length; i++) {
103
- const time = timestamps[i];
104
- const coord = coordinates[i];
105
- const { x, y } = _latLongToPixelXY(coord[1], coord[0]);
106
- floatArray.set([...prevPointData, startTime, endTime, x, y, coord[2] / 1000.0, time, ..._groupColorMap[styleGroupNameArray[i]], startTime, endTime], offset);
107
- prevPointData = [x, y, coord[2] / 1000.0, time, ..._groupColorMap[styleGroupNameArray[i]]];
108
- offset += 18;
109
- }
110
- }
111
- }
112
- return offset;
113
- }
114
-
115
-
116
- /**
117
- *
118
- * @param {*} coordinatesArray
119
- * @returns Float32Array
120
- * Coordinates array is needed to calculate the size of the buffer.
121
- */
122
- function createFloat32Array(coordinatesArray) {
123
- let filteredSize = 0;
124
- for (let coordinates of coordinatesArray) {
125
- filteredSize += coordinates.length * 2 - 2;
126
- }
127
- const array = new Float32Array(filteredSize * 9);
128
- return array;
129
- }
130
-
131
-
132
-
133
- export { Adaptor, fillSliceOfFloat32Array, createFloat32Array };
@@ -1,6 +0,0 @@
1
- import TimeTracks from './plugin';
2
- import { Adaptor, fillSliceOfFloat32Array, createFloat32Array } from './adaptors';
3
-
4
- import TimeTracksLineStrip from './plugin-line-strip';
5
- import { addCuttingPointLineStrip, featuresToLineStringData, fillSliceOfFloat32ArrayLineStrip, latLongToPixelXY } from './adaptors-line-strip';
6
- export { Adaptor, fillSliceOfFloat32Array, createFloat32Array, TimeTracks, TimeTracksLineStrip, addCuttingPointLineStrip, featuresToLineStringData, fillSliceOfFloat32ArrayLineStrip, latLongToPixelXY };
@@ -1,295 +0,0 @@
1
- /**
2
- * Author: Toprak Nihat Deniz Ozturk
3
- */
4
-
5
-
6
-
7
- import TrackGlowLineProgram from './program-line-strip';
8
- import PointProgram from './programpoint-line-strip';
9
-
10
- /**
11
- * @typedef {Float32Array} TimeTrackMultiColorData | A linestring is representation, let A{a1, a2, a3}, B{b1, b2} be the points of the line.
12
- * TimeTrackMultiColorData is [
13
- * a1x, a1y, a1z, a1time, a1r, a1g, a1b, a1time, a3time,
14
- * a2x, a2y, a2z, a2time, a2r, a2g, a2b, a1time, a3time,
15
- * a3x, a3y, a3z, a3time, a3r, a3g, a3b, a1time, a3time,
16
- * NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
17
- * b1x, b1y, b1z, b1time, b1r, b1g, b1b, b1time, b2time,
18
- * b2x, b2y, b2z, b2time, b2r, b2g, b2b, BstartTime, BendTime
19
- * ]
20
- * there is a cutting point between A and B
21
- *
22
- * x, y is xy coordinates are in between 0, +1 for -180 to +180 longitude and -90 to +90 latitude
23
- * z is height in meters
24
- */
25
-
26
-
27
-
28
-
29
-
30
- /**
31
- * Access following methods through `plugin.program.` :
32
- * * setGamma
33
- * * setExposure
34
- * * setAlphaThreshold
35
- * * setWeights
36
- * * setHeadPercentage
37
- * * setRouteAlpha
38
- * * setFinalAlphaRatio
39
-
40
- uses float32array in a * {@link TimeTrackMultiColorData} format
41
-
42
- */
43
- export default class TimeTrackMultiColorPlugin {
44
- /**
45
- * @param {String} id
46
- * @param {Object} options
47
- * @param {TimeTrackMultiColorData} options.data {@link TimeTrackMultiColorData}
48
- * @param {number} options.headPercentage 0 ~ 1
49
- * @param {number} options.routeAlpha 0 ~ 1
50
- * @param {Array.<Number>} options.weights [w1, w2, w3, w4, w5]
51
- * @param {number} options.alphaThreshold 0 ~ 1
52
- * @param {number} options.exposure 0 ~ inf
53
- * @param {number} options.gamma 0 ~ inf
54
- * @param {number} options.finalAlphaRatio 0 ~ 1
55
- * @param {number} pointOptions.opacity 0 ~ 1
56
- * @param {number} pointOptions.pointSize 0 ~ inf
57
- * @param {boolean} pointOptions.isOn true | false
58
- */
59
- constructor(id, options = {}, { opacity = 1.0, pointSize = 1, isOn = false } = {}) {
60
- this.id = id;
61
-
62
- this.globe = null;
63
- this.gl = null;
64
- this.program = null;
65
- this._headTime = 0;
66
- this._tailTime = 0;
67
-
68
- this._data = options.data || null;
69
- this._options = options;
70
- this._pointOptions = { opacity, pointSize, isOn };
71
- this.program = null;
72
-
73
- this._transporArr = new Float32Array(3);
74
-
75
- this._ready = false;
76
-
77
- this.pointProgram = null;
78
-
79
- this._attrBuffer = null;
80
- }
81
-
82
- // ----------------------------------
83
- // --- user methods ---
84
- // ----------------------------------
85
-
86
- setHeadAndTailTime(headTime, tailTime) {
87
- this._headTime = headTime;
88
- this._tailTime = tailTime;
89
- // console.log("setHeadAndTailTime", headTime, tailTime);
90
- this.pointProgram?.setHeadTime(headTime);
91
- this.globe.DrawRender();
92
- }
93
-
94
- setBlurWeights(weights) {
95
- this.program.setBlurWeights(weights);
96
- this.globe.DrawRender();
97
- }
98
-
99
- setHeadPercentage(headPercentage) {
100
- this.program.setHeadPercentage(headPercentage);
101
- this.globe.DrawRender();
102
- }
103
-
104
- setRouteAlpha(routeAlpha) {
105
- this.program.setRouteAlpha(routeAlpha);
106
- this.globe.DrawRender();
107
- }
108
-
109
- setFinalAlphaRatio(finalAlphaRatio) {
110
- this.program.setFinalAlphaRatio(finalAlphaRatio);
111
- this.globe.DrawRender();
112
- }
113
-
114
- setGamma(gamma) {
115
- this.program.setGamma(gamma);
116
- this.globe.DrawRender();
117
- }
118
-
119
- setExposure(exposure) {
120
- this.program.setExposure(exposure);
121
- this.globe.DrawRender();
122
- }
123
-
124
- setBlurRepetition(repetition) {
125
- this.program.setBlurRepetition(repetition);
126
- this.globe.DrawRender();
127
- }
128
-
129
-
130
-
131
- // ---------------point program setters-------------------
132
-
133
- setPointOpacity(opacity) {
134
- this._pointOptions.opacity = opacity;
135
- if (this.pointProgram) {
136
- this.pointProgram.setOpacity(opacity);
137
- this.globe.DrawRender();
138
- }
139
- }
140
-
141
- setPointSize(size) {
142
- this._pointOptions.pointSize = size;
143
- if (this.pointProgram) {
144
- this.pointProgram.setPointSize(size);
145
- this.globe.DrawRender();
146
- }
147
- }
148
-
149
- pointSwitch(isOn) {
150
- if (isOn && !this.pointProgram) {
151
- this.pointProgram = this._createPointProgram();
152
- } else {
153
- this._deletePointProgram();
154
- }
155
-
156
- }
157
-
158
- // ------------------------------------------------------------
159
-
160
- _createPointProgram() {
161
- const { gl } = this;
162
- const program = new PointProgram(gl, this.globe, this._attrBuffer, this._pointOptions);
163
- program.setDrawCount(this._totalSize);
164
- return program;
165
- }
166
-
167
- _deletePointProgram() {
168
- if (this.pointProgram) this.pointProgram.free();
169
- this.pointProgram = null;
170
- }
171
-
172
- // -------------------------------------------------------------
173
-
174
- isReady() {
175
- return this._ready;
176
- }
177
-
178
- /**
179
- * @param {TimeTrackMultiColorData} data {@link TimeTrackMultiColorData}
180
- * Check Class constructor
181
- */
182
- setData(data) {
183
- if (this.gl) {
184
- this._ready = false;
185
- this.setDataAsFloat32Array(data);
186
- this._ready = true;
187
- } else {
188
- this._data = data;
189
- this._ready = false;
190
- }
191
- }
192
-
193
- /**
194
- * @param {TimeTrackMultiColorData} data {@link TimeTrackMultiColorData}
195
- * @param {number} totalSize | if not provided, it is calculated from float32Array.length / 9. Use if you want to draw first n points.
196
- */
197
- setDataAsFloat32Array(data, totalSize = null) {
198
-
199
- const { gl, _attrBuffer } = this;
200
- gl.bindBuffer(gl.ARRAY_BUFFER, _attrBuffer);
201
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
202
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
203
-
204
-
205
- // this.program.setInBuffer(data);
206
-
207
- // this.pointProgram.setData(data);
208
- if (totalSize) {
209
- this._totalSize = totalSize;
210
- } else {
211
- this._totalSize = data.length / 9;
212
- }
213
- this.program.setTotalLength(this._totalSize);
214
- this.pointProgram?.setDrawCount(this._totalSize / 2);
215
-
216
- this._ready = true;
217
- }
218
-
219
- // ------------------------------
220
- // --- globe Methods ---
221
- // ------------------------------
222
-
223
- draw3D(projMatrix, modelviewMatrix, transPos) {
224
- if (!this._ready) return;
225
- const { _headTime, _tailTime, program, _transporArr, globe } = this;
226
- this.pointProgram?.draw();
227
-
228
- _transporArr.set([transPos.x, transPos.y, transPos.z], 0);
229
- const geomType = globe.api_GetCurrentGeometry();
230
- if (geomType === 0) {
231
- program.draw(_headTime, _tailTime, projMatrix, modelviewMatrix, _transporArr);
232
- } else if (geomType === 1) {
233
- const { width, height } = globe.api_GetCurrentWorldWH();
234
- program.draw(_headTime, _tailTime, projMatrix, modelviewMatrix, _transporArr,
235
- [width, height]);
236
- } else {
237
- console.error("Unknown geometry type", geomType);
238
- }
239
- }
240
-
241
- resize(width, height) {
242
- const { program, globe } = this;
243
- width = width || globe.api_ScrW();
244
- height = height || globe.api_ScrH();
245
- program.resize(width, height);
246
- }
247
-
248
-
249
- init(globe, gl) {
250
- this.globe = globe;
251
- this.gl = gl;
252
- this._attrBuffer = gl.createBuffer();
253
- this.program = new TrackGlowLineProgram(gl, this._attrBuffer, globe.api_ScrW(), globe.api_ScrH(), this._options);
254
- if (this._pointOptions?.isOn) this.pointProgram = new PointProgram(gl, globe, this._attrBuffer);
255
-
256
- // this.pointProgram.setAttrBuffer(_attrBuffer);
257
- this.setGeometry();
258
- if (this._data) {
259
- this._ready = true;
260
- this.setDataAsFloat32Array(this._data);
261
-
262
- this._data = null;
263
- }
264
- this.resize();
265
- }
266
-
267
-
268
- free() {
269
- const { gl, _attrBuffer } = this;
270
- this.program.free();
271
- gl.deleteBuffer(_attrBuffer);
272
- }
273
-
274
-
275
- setGeometry() {
276
- const { globe, program } = this;
277
- program.setIs3D(globe.api_GetCurrentGeometry() === 0);
278
- }
279
-
280
- // ----------------------------------
281
- // --- implicit methods ---
282
- // ----------------------------------
283
-
284
-
285
- _latLongToPixelXY(latitude, longitude) {
286
- return {
287
- x: (longitude + 180) / 360,
288
- y: (90 - latitude) / 180
289
- };
290
- }
291
- }
292
-
293
-
294
-
295
-