@pirireis/webglobeplugins 0.9.8 → 0.9.9

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 (213) hide show
  1. package/index.js +58 -15
  2. package/package.json +1 -1
  3. package/dist/Math/angle-calculation.js +0 -15
  4. package/dist/Math/arc.js +0 -65
  5. package/dist/Math/bounds/line-bbox.js +0 -188
  6. package/dist/Math/constants.js +0 -9
  7. package/dist/Math/frustum/camera.js +0 -24
  8. package/dist/Math/frustum/from-globeinfo.js +0 -48
  9. package/dist/Math/frustum/types.js +0 -2
  10. package/dist/Math/globe-util/horizon-plane.js +0 -112
  11. package/dist/Math/index.js +0 -1
  12. package/dist/Math/juction/arc-plane.js +0 -83
  13. package/dist/Math/juction/line-sphere.js +0 -25
  14. package/dist/Math/juction/plane-plane.js +0 -58
  15. package/dist/Math/line.js +0 -56
  16. package/dist/Math/matrix4.js +0 -1
  17. package/dist/Math/methods.js +0 -201
  18. package/dist/Math/plane.js +0 -60
  19. package/dist/Math/quaternion.js +0 -104
  20. package/dist/Math/types.js +0 -2
  21. package/dist/Math/utils.js +0 -4
  22. package/dist/Math/vec3.js +0 -126
  23. package/dist/algorithms/search-binary.js +0 -19
  24. package/dist/altitude-locator/adaptors.js +0 -1
  25. package/dist/altitude-locator/draw-subset-obj.js +0 -18
  26. package/dist/altitude-locator/keymethod.js +0 -1
  27. package/dist/altitude-locator/plugin.js +0 -341
  28. package/dist/altitude-locator/types.js +0 -23
  29. package/dist/arrowfield/adaptor.js +0 -14
  30. package/dist/arrowfield/index.js +0 -10
  31. package/dist/arrowfield/plugin.js +0 -86
  32. package/dist/bearing-line/index.js +0 -8
  33. package/dist/bearing-line/plugin.js +0 -449
  34. package/dist/circle-line-chain/chain-list-map.js +0 -205
  35. package/dist/circle-line-chain/init.js +0 -1
  36. package/dist/circle-line-chain/plugin.js +0 -424
  37. package/dist/circle-line-chain/util.js +0 -5
  38. package/dist/compass-rose/compass-rose-padding-flat.js +0 -225
  39. package/dist/compass-rose/compass-text-writer.js +0 -153
  40. package/dist/compass-rose/index.js +0 -7
  41. package/dist/compassrose/compassrose.js +0 -296
  42. package/dist/compassrose/index.js +0 -8
  43. package/dist/globe-types.js +0 -1
  44. package/dist/heatwave/index.js +0 -10
  45. package/dist/heatwave/isobar/objectarraylabels.js +0 -202
  46. package/dist/heatwave/isobar/plugin.js +0 -343
  47. package/dist/heatwave/isobar/quadtreecontours.js +0 -300
  48. package/dist/heatwave/plugins/heatwaveglobeshell.js +0 -206
  49. package/dist/index.js +0 -58
  50. package/dist/jest.config.js +0 -7
  51. package/dist/partialrings/buffer-manager.js +0 -81
  52. package/dist/partialrings/index.js +0 -41
  53. package/dist/partialrings/plugin.js +0 -135
  54. package/dist/partialrings/program.js +0 -286
  55. package/dist/pin/pin-object-array.js +0 -305
  56. package/dist/pin/pin-point-totem.js +0 -60
  57. package/dist/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -66
  58. package/dist/point-heat-map/index.js +0 -1
  59. package/dist/point-heat-map/plugin-webworker.js +0 -126
  60. package/dist/point-heat-map/point-to-heat-map-flow.js +0 -127
  61. package/dist/point-tracks/key-methods.js +0 -5
  62. package/dist/point-tracks/plugin.js +0 -338
  63. package/dist/programs/arrowfield/index.js +0 -7
  64. package/dist/programs/arrowfield/logic.js +0 -257
  65. package/dist/programs/arrowfield/object.js +0 -66
  66. package/dist/programs/data2legend/density-to-legend.js +0 -101
  67. package/dist/programs/data2legend/point-to-density-texture.js +0 -100
  68. package/dist/programs/float2legendwithratio/index.js +0 -8
  69. package/dist/programs/float2legendwithratio/logic.js +0 -171
  70. package/dist/programs/float2legendwithratio/object.js +0 -110
  71. package/dist/programs/globe-util/is-globe-moved.js +0 -21
  72. package/dist/programs/globeshell/index.js +0 -8
  73. package/dist/programs/globeshell/noise/noises.js +0 -1
  74. package/dist/programs/globeshell/wiggle/index.js +0 -8
  75. package/dist/programs/globeshell/wiggle/logic.js +0 -345
  76. package/dist/programs/globeshell/wiggle/object.js +0 -72
  77. package/dist/programs/helpers/blender/index.js +0 -1
  78. package/dist/programs/helpers/blender/program.js +0 -79
  79. package/dist/programs/helpers/fadeaway/index.js +0 -7
  80. package/dist/programs/helpers/fadeaway/logic.js +0 -72
  81. package/dist/programs/helpers/fadeaway/object.js +0 -20
  82. package/dist/programs/helpers/index.js +0 -8
  83. package/dist/programs/index.js +0 -58
  84. package/dist/programs/interface.js +0 -1
  85. package/dist/programs/line-on-globe/angled-line.js +0 -176
  86. package/dist/programs/line-on-globe/circle-accurate-3d.js +0 -141
  87. package/dist/programs/line-on-globe/circle-accurate-flat.js +0 -216
  88. package/dist/programs/line-on-globe/circle-accurate.js +0 -178
  89. package/dist/programs/line-on-globe/circle.js +0 -167
  90. package/dist/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -159
  91. package/dist/programs/line-on-globe/index.js +0 -1
  92. package/dist/programs/line-on-globe/lines-color-instanced-flat.js +0 -136
  93. package/dist/programs/line-on-globe/linestrip.js +0 -171
  94. package/dist/programs/line-on-globe/naive-accurate-flexible.js +0 -195
  95. package/dist/programs/line-on-globe/to-the-surface.js +0 -111
  96. package/dist/programs/line-on-globe/util.js +0 -8
  97. package/dist/programs/picking/pickable-renderer.js +0 -188
  98. package/dist/programs/point-on-globe/element-globe-surface-glow.js +0 -142
  99. package/dist/programs/point-on-globe/element-point-glow.js +0 -153
  100. package/dist/programs/point-on-globe/square-pixel-point.js +0 -174
  101. package/dist/programs/programcache.js +0 -131
  102. package/dist/programs/rings/distancering/circleflatprogram.js +0 -156
  103. package/dist/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -369
  104. package/dist/programs/rings/distancering/circlepaddysharedbuffer.js +0 -357
  105. package/dist/programs/rings/distancering/index.js +0 -14
  106. package/dist/programs/rings/distancering/paddyflatprogram.js +0 -172
  107. package/dist/programs/rings/distancering/paddyflatprogram2d.js +0 -174
  108. package/dist/programs/rings/distancering/paddyflatprogram3d.js +0 -172
  109. package/dist/programs/rings/distancering/shader.js +0 -1
  110. package/dist/programs/rings/index.js +0 -17
  111. package/dist/programs/rings/partial-ring/piece-of-pie.js +0 -275
  112. package/dist/programs/totems/camerauniformblock.js +0 -160
  113. package/dist/programs/totems/canvas-webglobe-info.js +0 -110
  114. package/dist/programs/totems/gpu-selection-uniform-block.js +0 -108
  115. package/dist/programs/totems/index.js +0 -40
  116. package/dist/programs/two-d/pixel-circle.js +0 -1
  117. package/dist/programs/two-d/pixel-padding-for-compass.js +0 -162
  118. package/dist/programs/util.js +0 -17
  119. package/dist/programs/vectorfields/index.js +0 -23
  120. package/dist/programs/vectorfields/logics/drawrectangleparticles.js +0 -107
  121. package/dist/programs/vectorfields/logics/index.js +0 -12
  122. package/dist/programs/vectorfields/logics/pixelbased.js +0 -142
  123. package/dist/programs/vectorfields/logics/ubo.js +0 -63
  124. package/dist/programs/vectorfields/pingpongbuffermanager.js +0 -76
  125. package/dist/rangerings/enum.js +0 -5
  126. package/dist/rangerings/index.js +0 -15
  127. package/dist/rangerings/plugin.js +0 -560
  128. package/dist/rangerings/rangeringangletext.js +0 -329
  129. package/dist/rangerings/ring-account.js +0 -117
  130. package/dist/shaders/fragment-toy/firework.js +0 -58
  131. package/dist/shaders/fragment-toy/singularity.js +0 -59
  132. package/dist/shape-on-terrain/arc/naive/plugin.js +0 -252
  133. package/dist/timetracks/adaptors-line-strip.js +0 -71
  134. package/dist/timetracks/adaptors.js +0 -122
  135. package/dist/timetracks/index.js +0 -19
  136. package/dist/timetracks/plugin-line-strip.js +0 -250
  137. package/dist/timetracks/plugin.js +0 -258
  138. package/dist/timetracks/program-line-strip.js +0 -611
  139. package/dist/timetracks/program.js +0 -772
  140. package/dist/timetracks/programpoint-line-strip.js +0 -154
  141. package/dist/timetracks/programpoint.js +0 -147
  142. package/dist/types.js +0 -15
  143. package/dist/util/account/bufferoffsetmanager.js +0 -179
  144. package/dist/util/account/index.js +0 -23
  145. package/dist/util/account/single-attribute-buffer-management/buffer-manager.js +0 -108
  146. package/dist/util/account/single-attribute-buffer-management/buffer-orchestrator.js +0 -150
  147. package/dist/util/account/single-attribute-buffer-management/index.js +0 -9
  148. package/dist/util/account/single-attribute-buffer-management/object-store.js +0 -51
  149. package/dist/util/account/single-attribute-buffer-management/types.js +0 -2
  150. package/dist/util/account/util.js +0 -22
  151. package/dist/util/algorithms/index.js +0 -1
  152. package/dist/util/algorithms/search-binary.js +0 -28
  153. package/dist/util/check/get.js +0 -18
  154. package/dist/util/check/index.js +0 -1
  155. package/dist/util/check/typecheck.js +0 -49
  156. package/dist/util/geometry/index.js +0 -51
  157. package/dist/util/gl-util/buffer/attribute-loader.js +0 -69
  158. package/dist/util/gl-util/buffer/index.js +0 -6
  159. package/dist/util/gl-util/buffer/types.js +0 -1
  160. package/dist/util/gl-util/draw-options/methods.js +0 -38
  161. package/dist/util/gl-util/draw-options/types.js +0 -15
  162. package/dist/util/gl-util/uniform-block/manager.js +0 -156
  163. package/dist/util/gl-util/uniform-block/shader.js +0 -1
  164. package/dist/util/gl-util/uniform-block/types.js +0 -8
  165. package/dist/util/heatwavedatamanager/datamanager.js +0 -152
  166. package/dist/util/heatwavedatamanager/index.js +0 -10
  167. package/dist/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -122
  168. package/dist/util/heatwavedatamanager/pointcoordsmeta.js +0 -20
  169. package/dist/util/index.js +0 -57
  170. package/dist/util/interpolation/index.js +0 -1
  171. package/dist/util/interpolation/timetrack/index.js +0 -5
  172. package/dist/util/interpolation/timetrack/timetrack-interpolator.js +0 -79
  173. package/dist/util/interpolation/timetrack/web-worker-str.js +0 -183
  174. package/dist/util/interpolation/timetrack/web-worker.js +0 -48
  175. package/dist/util/jshelpers/data-filler.js +0 -20
  176. package/dist/util/jshelpers/equality.js +0 -20
  177. package/dist/util/jshelpers/index.js +0 -37
  178. package/dist/util/jshelpers/timefilters.js +0 -32
  179. package/dist/util/picking/fence.js +0 -46
  180. package/dist/util/picking/picker-displayer.js +0 -139
  181. package/dist/util/programs/draw-texture-on-canvas.js +0 -89
  182. package/dist/util/programs/index.js +0 -17
  183. package/dist/util/programs/shapesonglobe.js +0 -214
  184. package/dist/util/programs/supersampletotextures.js +0 -113
  185. package/dist/util/programs/texturetoglobe.js +0 -182
  186. package/dist/util/shaderfunctions/geometrytransformations.js +0 -340
  187. package/dist/util/shaderfunctions/index.js +0 -18
  188. package/dist/util/shaderfunctions/nodata.js +0 -11
  189. package/dist/util/shaderfunctions/noisefunctions.js +0 -43
  190. package/dist/util/surface-line-data/arc-bboxes.js +0 -25
  191. package/dist/util/surface-line-data/arcs-to-cuts.js +0 -50
  192. package/dist/util/surface-line-data/cut-arc.js +0 -1
  193. package/dist/util/surface-line-data/flow.js +0 -28
  194. package/dist/util/surface-line-data/rbush-manager.js +0 -1
  195. package/dist/util/surface-line-data/types.js +0 -1
  196. package/dist/util/surface-line-data/web-worker.js +0 -1
  197. package/dist/util/webglobe/gldefaultstates.js +0 -7
  198. package/dist/util/webglobe/index.js +0 -18
  199. package/dist/util/webglobe/rasteroverlay.js +0 -78
  200. package/dist/util/webglobjectbuilders.js +0 -388
  201. package/dist/util/webglobjectbuilders1.js +0 -237
  202. package/dist/waveparticles/adaptor.js +0 -17
  203. package/dist/waveparticles/index.js +0 -10
  204. package/dist/waveparticles/plugin.js +0 -266
  205. package/dist/wind/imagetovectorfieldandmagnitude.js +0 -35
  206. package/dist/wind/index.js +0 -14
  207. package/dist/wind/plugin.js +0 -926
  208. package/dist/wind/vectorfieldimage.js +0 -25
  209. package/dist/write-text/attached-text-writer.js +0 -91
  210. package/dist/write-text/context-text.js +0 -98
  211. package/dist/write-text/context-text3.js +0 -155
  212. package/dist/write-text/index.js +0 -5
  213. package/dist/write-text/writer-plugin.js +0 -8
@@ -1,252 +0,0 @@
1
- "use strict";
2
- // import { LineStripProgramCache } from "../../../programs/line-on-globe/linestrip"
3
- // import "../../../programs/interface";
4
- // import { createBufferAndReadInfo } from '../../../util/gl-util/buffer/attribute-loader';
5
- // import { populateFloat32Array } from "../../../util/jshelpers/data-filler";
6
- // import { BufferManagement, BufferManager, BufferOrchestrator } from "../../../util/account/single-attribute-buffer-management/index";
7
- // import { globe3Dcoordinates, globe2Dcoordinates, RADIANS } from "../../../Math/methods";
8
- // import { Vector3D } from "../../../Math/vector3d";
9
- // import { Arc } from "../../../Math/arc";
10
- // import { Plane } from "../../../Math/plane";
11
- // import { arcFrustumPlanesIntersection } from "../../../Math/intersections/arc-frustum-planes";
12
- // import { CameraUniformBlockTotemCache, CameraUniformBlockTotem } from "../../../programs/totems/camerauniformblock";
13
- // import { FrustumPlanes } from "../../../Math/frustum/types";
14
- // const VERTEX_COUNT = 360;
15
- // const INITAL_CAPACITY = 10;
16
- // const _0vector = new Vector3D();
17
- // const _0arc = new Arc();
18
- // // window add properties
19
- // declare global {
20
- // interface Window {
21
- // startPoint: Vector3D;
22
- // endPoint: Vector3D;
23
- // }
24
- // }
25
- // let interval = 1;
26
- // const testVec = new Vector3D(0, 0, 1);
27
- // testVec.setFromLongLat(30 * RADIANS, 30 * RADIANS);
28
- // console.log("testVec", testVec.x, testVec.y, testVec.z);
29
- // testVec.setFromLongLat(50 * RADIANS, 50 * RADIANS);
30
- // console.log("testVec", testVec.x, testVec.y, testVec.z);
31
- // export class NaiveLineOnTerrainPlugin {
32
- // public id: string;
33
- // private program: ProgramInterface;
34
- // private _bufferManagersCompMap: BufferManagement;
35
- // private _bufferManagersCompMapTest: BufferManagement;
36
- // private _bufferOrchestrator: BufferOrchestrator = new BufferOrchestrator({ capacity: INITAL_CAPACITY });
37
- // private _testOrchestrator: BufferOrchestrator = new BufferOrchestrator({ capacity: INITAL_CAPACITY });
38
- // private _opacity: number = 1;
39
- // private _arcUBOHandler: UBOHandler;
40
- // private _vao: WebGLVertexArrayObject;
41
- // private _vaoAllTest: WebGLVertexArrayObject;
42
- // private _ubohandlerAllTest: UBOHandler;
43
- // private globe: any;
44
- // private gl: WebGL2RenderingContext;
45
- // private _arcMap: Map<string, Arc>;
46
- // private _arcMapTest: Map<string, Arc>;
47
- // private _screenPlane: Plane = new Plane();
48
- // private _doBuild: boolean = false
49
- // private _cameraUniformBlock: CameraUniformBlockTotem;
50
- // public fieldOfView = 50 * RADIANS; // 50 degrees in radians
51
- // constructor(id: string) {
52
- // this.id = id;
53
- // this._arcMap = new Map();
54
- // this._arcMapTest = new Map();
55
- // }
56
- // insertArcFromLongLat(key: string, startPoint: { long: number, lat: number }, endPoint: { long: number, lat: number }) {
57
- // if (this._arcMap.has(key)) {
58
- // this._arcMap.delete(key);
59
- // }
60
- // const start = _0vector.setFromLongLat(startPoint.long * RADIANS, startPoint.lat * RADIANS).clone();
61
- // const end = _0vector.setFromLongLat(endPoint.long * RADIANS, endPoint.lat * RADIANS).clone();
62
- // window.startPoint = start;
63
- // window.endPoint = end;
64
- // const arc = new Arc(start, end);
65
- // this._arcMap.set(key, arc);
66
- // this._arcMapTest.set(key, arc.clone());
67
- // const longLatArr = new Float32Array(2 * VERTEX_COUNT);
68
- // const _3Dpoints = arc.populatePoints3D(VERTEX_COUNT);
69
- // const longLat = {
70
- // long: 1,
71
- // lat: 1
72
- // };
73
- // for (let i = 0; i < _3Dpoints.length / 3; i++) {
74
- // _0vector.set(_3Dpoints[i * 3], _3Dpoints[i * 3 + 1], _3Dpoints[i * 3 + 2]).toLongLat(longLat);
75
- // longLatArr.set([longLat.long / RADIANS, longLat.lat / RADIANS], i * 2);
76
- // }
77
- // const result = [{
78
- // key: key,
79
- // longLatArr: longLatArr,
80
- // }
81
- // ]
82
- // this._testOrchestrator.insertBulk(result, this._bufferManagersCompMapTest);
83
- // this._doBuild = true;
84
- // }
85
- // init(globe: any, gl: WebGL2RenderingContext) {
86
- // this.globe = globe;
87
- // this.gl = gl;
88
- // this.program = LineStripProgramCache.get(globe);
89
- // const g3D = globe3Dcoordinates(globe, 30);
90
- // const g2D = globe2Dcoordinates(globe);
91
- // this._cameraUniformBlock = CameraUniformBlockTotemCache.get(globe);
92
- // this._bufferManagersCompMap = new Map(
93
- // [
94
- // ["position3d", {
95
- // bufferManager: new BufferManager(gl, 3 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
96
- // adaptor: (item: any) => {
97
- // const { longLatArr } = item;
98
- // const result = g3D(longLatArr, { paddingCount: 1 });
99
- // // console.log("result", result);
100
- // return result;
101
- // }
102
- // }],
103
- // ["position2d", {
104
- // bufferManager: new BufferManager(gl, 2 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
105
- // adaptor: (item: any) => {
106
- // const { longLatArr } = item;
107
- // return g2D(longLatArr, { paddingCount: 1 });
108
- // }
109
- // }
110
- // ],
111
- // ]
112
- // );
113
- // this._bufferManagersCompMapTest = new Map([
114
- // ["positionTest3d", {
115
- // bufferManager: new BufferManager(gl, 3 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
116
- // adaptor: (item: any) => {
117
- // const { longLatArr } = item;
118
- // const result = g3D(longLatArr, { paddingCount: 1 });
119
- // return result;
120
- // }
121
- // }],
122
- // ["positionTest2d", {
123
- // bufferManager: new BufferManager(gl, 2 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
124
- // adaptor: (item: any) => {
125
- // const { longLatArr } = item;
126
- // return g2D(longLatArr, { paddingCount: 1 });
127
- // }
128
- // }
129
- // ]
130
- // ]
131
- // );
132
- // this._bufferOrchestrator = new BufferOrchestrator(gl, this._bufferManagersCompMap);
133
- // this._arcUBOHandler = this.program.createUBO();
134
- // this._arcUBOHandler.update(new Map([
135
- // ["u_color", new Float32Array([1, 0, 0, 1])],
136
- // ]));
137
- // this._ubohandlerAllTest = this.program.createUBO();
138
- // this._ubohandlerAllTest.update(new Map([
139
- // ["u_color", new Float32Array([0, 0, 1, 1])],
140
- // ]));
141
- // this._vao = this.program.createVAO(
142
- // createBufferAndReadInfo(this._bufferManagersCompMap.get("position3d").bufferManager.buffer),
143
- // createBufferAndReadInfo(this._bufferManagersCompMap.get("position2d").bufferManager.buffer),
144
- // null,
145
- // null,
146
- // null,
147
- // );
148
- // this._vaoAllTest = this.program.createVAO(
149
- // createBufferAndReadInfo(this._bufferManagersCompMapTest.get("positionTest3d").bufferManager.buffer),
150
- // createBufferAndReadInfo(this._bufferManagersCompMapTest.get("positionTest2d").bufferManager.buffer),
151
- // null,
152
- // null,
153
- // null,
154
- // );
155
- // }
156
- // setFieldOfView(fieldOfView: number) {
157
- // this.fieldOfView = fieldOfView * RADIANS; // convert degrees to radians
158
- // this.globe.DrawRender();
159
- // }
160
- // _buildArcs() {
161
- // // updatePlane
162
- // const { globe, _arcMap } = this;
163
- // const planes = this._cameraUniformBlock.getFrustumPlanes() as FrustumPlanes;
164
- // //
165
- // const cameraPostition = new Vector3D();
166
- // cameraPostition.copy(globe.Fp as Vector3D).normalize();
167
- // // calculateHorizonPlane(globe, _screenPlane, this.fieldOfView);
168
- // const result = [];
169
- // const longLat = {
170
- // long: 1,
171
- // lat: 1
172
- // }
173
- // let counter = 0;
174
- // for (const [key, arc] of _arcMap) {
175
- // // const isArc = arc.intersectionMedium(_screenPlane, _0arc) as Arc;
176
- // _0arc.copy(arc);
177
- // const isArc = arcFrustumPlanesIntersection(_0arc, planes, _0arc);
178
- // if (!isArc) {
179
- // continue;
180
- // }
181
- // counter++;
182
- // const longLatArr = new Float32Array(2 * VERTEX_COUNT);
183
- // // const _3Dpoints = _0arc.populatePoints3DInRespectToCamera(cameraPostition, VERTEX_COUNT);
184
- // const _3Dpoints = _0arc.populatePoints3D(VERTEX_COUNT);
185
- // for (let i = 0; i < _3Dpoints.length / 3; i++) {
186
- // _0vector.set(_3Dpoints[i * 3], _3Dpoints[i * 3 + 1], _3Dpoints[i * 3 + 2]).toLongLat(longLat);
187
- // longLatArr.set([longLat.long / RADIANS, longLat.lat / RADIANS], i * 2);
188
- // }
189
- // result.push({
190
- // key: key,
191
- // longLatArr: longLatArr,
192
- // });
193
- // // if (!arc.imaginaryPlane.equals(_0arc.imaginaryPlane) || !arc.imaginaryPlane.equalsReverseOriantation(_0arc.imaginaryPlane)) {
194
- // // // console.log("Arc with key", key, "has imaginary plane equal to the original arc's imaginary plane.");
195
- // // throw new Error("The arc segment is not on the parent arc")
196
- // // }
197
- // }
198
- // interval += 1;
199
- // if (interval === 100) {
200
- // interval = 1;
201
- // console.log("Arc count on screen:", counter);
202
- // }
203
- // // update buffer
204
- // this._bufferOrchestrator.resetWithCapacity(this._bufferManagersCompMap, result.length);
205
- // this._bufferOrchestrator.insertBulk(result, this._bufferManagersCompMap);
206
- // this._doBuild = false;
207
- // this._checkIfCorrupted(); // check if any arc is corrupted
208
- // }
209
- // draw3D() {
210
- // // Drawing logic here
211
- // this._buildArcs() // can be async
212
- // const { gl, program, _bufferOrchestrator } = this;
213
- // gl.disable(gl.DEPTH_TEST);
214
- // const drawOptionTest = {
215
- // drawRange: {
216
- // first: 0,
217
- // count: this._testOrchestrator.length * (VERTEX_COUNT + 1)
218
- // },
219
- // indexes: null
220
- // }
221
- // program.draw(
222
- // this._vaoAllTest,
223
- // drawOptionTest,
224
- // this._opacity,
225
- // this._ubohandlerAllTest
226
- // );
227
- // const drawOptions = {
228
- // drawRange: {
229
- // first: 0,
230
- // count: _bufferOrchestrator.length * (VERTEX_COUNT + 1)
231
- // },
232
- // indexes: null
233
- // }
234
- // program.draw(
235
- // this._vao,
236
- // drawOptions,
237
- // this._opacity,
238
- // this._arcUBOHandler
239
- // );
240
- // gl.enable(gl.DEPTH_TEST);
241
- // }
242
- // _checkIfCorrupted() {
243
- // for (const [key, arc] of this._arcMap) {
244
- // if (!arc.p0.equals(arc.p1)) {
245
- // continue; // valid arc
246
- // }
247
- // console.warn(`Arc with key ${key} is corrupted: p0 and p1 are the same point.`);
248
- // // this._arcMap.delete(key);
249
- // // this._arcMapTest.delete(key);
250
- // }
251
- // }
252
- // }
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.latLongToPixelXY = void 0;
4
- exports.addCuttingPointLineStrip = addCuttingPointLineStrip;
5
- exports.featuresToLineStringData = featuresToLineStringData;
6
- exports.fillSliceOfFloat32ArrayLineStrip = fillSliceOfFloat32ArrayLineStrip;
7
- const util_1 = require("../util");
8
- Object.defineProperty(exports, "latLongToPixelXY", { enumerable: true, get: function () { return util_1.latLongToPixelXY; } });
9
- /**
10
- * @param {Array.<Array.<number>>} coordinates
11
- * @param {Array.<number>} timestamps
12
- * @param {Array.<String>} styleGroupNameArray
13
- * @param {Object.<string, TrackStyleGroup>} _groupColorMap
14
- * @param {Float32Array} floatArray
15
- * @param {number} offset
16
- *
17
- * create floatArray with createFloat32Array before calling this function.
18
- * start offset from 0.
19
- * feed the floatArray with a track data and offset that is returned from the previous call.
20
- */
21
- function featuresToLineStringData(data) {
22
- /**
23
- * features are the tracks
24
- * feature[i].geometry.coordinates are the points of the track
25
- * feature[i].properties.messageTime are the timestamps of the points
26
- *
27
- */
28
- const features = data.features;
29
- let size = data.features.length - 1;
30
- let startTime = features[0].properties.messageTime[0];
31
- let endTime = features[0].properties.messageTime[features[0].properties.messageTime.length - 1];
32
- for (let feature of features) {
33
- size += feature.properties.messageTime.length;
34
- startTime = Math.min(startTime, feature.properties.messageTime[0]);
35
- endTime = Math.max(endTime, feature.properties.messageTime[feature.properties.messageTime.length - 1]);
36
- }
37
- const array = new Float32Array(size * 9);
38
- let offset = 0;
39
- {
40
- const feature = features[0];
41
- const coordinates = feature.geometry.coordinates;
42
- const timestamps = feature.properties.messageTime.map((time) => (time - startTime) / 1000);
43
- offset = fillSliceOfFloat32ArrayLineStrip(array, offset, coordinates, timestamps);
44
- }
45
- for (let i = 1; i < features.length; i++) {
46
- const feature = features[i];
47
- const coordinates = feature.geometry.coordinates;
48
- const timestamps = feature.properties.messageTime.map((time) => (time - startTime) / 1000);
49
- offset = addCuttingPointLineStrip(array, offset);
50
- offset = fillSliceOfFloat32ArrayLineStrip(array, offset, coordinates, timestamps);
51
- }
52
- return { data: array, startTime, endTime };
53
- }
54
- function fillSliceOfFloat32ArrayLineStrip(floatArray, offset, coordinates, timestamps, { styleGroupNameArray = null, groupColorFunction = () => [Math.random(), Math.random(), Math.random()] } = {}) {
55
- const startTime = timestamps[0];
56
- const endTime = timestamps[timestamps.length - 1];
57
- for (let i = 0; i < coordinates.length; i++) {
58
- const time = timestamps[i];
59
- const coord = coordinates[i];
60
- const styleGroupName = styleGroupNameArray ? styleGroupNameArray[i] : "default";
61
- const { x, y } = (0, util_1.latLongToPixelXY)(coord[1], coord[0]);
62
- const z = coord[2] ? coord[2] / 1000.0 : 0;
63
- floatArray.set([x, y, z, time, ...groupColorFunction(styleGroupName), startTime, endTime], offset);
64
- offset += 9;
65
- }
66
- return offset;
67
- }
68
- function addCuttingPointLineStrip(floatArray, offset) {
69
- floatArray.set(new Float32Array(9).fill(NaN), offset);
70
- return offset + 9;
71
- }
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Adaptor = void 0;
4
- exports.fillSliceOfFloat32Array = fillSliceOfFloat32Array;
5
- exports.createFloat32Array = createFloat32Array;
6
- const util_1 = require("../util");
7
- const _latLongToPixelXY = util_1.latLongToPixelXY;
8
- class Adaptor {
9
- /**
10
- * @param {Object.<string, Color>} groupColorMap
11
- * @typedef {Array} Color | [r, g, b] | between 0-1
12
- */
13
- constructor(groupColorMap) {
14
- this._groupColorMap = groupColorMap;
15
- }
16
- /**
17
- * @param {Object} geojsonObject
18
- * @param {number} startTime
19
- * @param {string} timePropertyName
20
- * @param {string} styleGroupPropertyName
21
- * @returns {lineData} lineData for Plugin
22
- */
23
- fromGeoJson(geojsonObject, startTime, timePropertyName = "messageTime", styleGroupPropertyName = "styleGroup") {
24
- const features = geojsonObject.features.filter(feature => feature.geometry.coordinates.length > 1);
25
- const buffer = createFloat32Array(features.map(feature => feature.geometry.coordinates));
26
- let offset = 0;
27
- for (let feature of features) {
28
- const coordinates = feature.geometry.coordinates;
29
- const timestamps = feature.properties[timePropertyName].map((time) => (time - startTime) / 1000);
30
- const styleGroupNameArray = feature.properties[styleGroupPropertyName];
31
- offset = fillSliceOfFloat32Array(coordinates, timestamps, styleGroupNameArray, this._groupColorMap, buffer, offset);
32
- }
33
- return buffer;
34
- }
35
- /**
36
- * Inputs are lists of tracks. Each track is a list of coordinates, timestamps and styleGroupNames.
37
- * @param {Array.<Array.<Array.<number>>>} coordinatesList | [ [ [lon, lat, z], [lon, lat, z], ...], ...
38
- * @param {Array.<Array.<number>>} timestampsList | [ [time, time, ...], ...
39
- * @param {Array.<Array.<String>>} colorGroupList | [ [styleGroupName, styleGroupName, ...], ...
40
- * @param {number} startTime | epoch time
41
- * @returns {lineData} lineData for Plugin
42
- */
43
- fromLists(coordinatesList, timestampsList, colorGroupList, startTime) {
44
- const buffer = createFloat32Array(coordinatesList);
45
- let offset = 0;
46
- for (let i = 0; i < coordinatesList.length; i++) {
47
- const coordinates = coordinatesList[i];
48
- const timestamps = timestampsList[i].map((time) => (time - startTime) / 1000);
49
- const styleGroupNameArray = colorGroupList[i];
50
- offset = fillSliceOfFloat32Array(coordinates, timestamps, styleGroupNameArray, this._groupColorMap, buffer, offset);
51
- }
52
- return buffer;
53
- }
54
- }
55
- exports.Adaptor = Adaptor;
56
- /**
57
- * @param {Array.<Array.<number>>} coordinates
58
- * @param {Array.<number>} timestamps
59
- * @param {Array.<String>} styleGroupNameArray
60
- * @param {Object.<string, TrackStyleGroup>} _groupColorMap
61
- * @param {Float32Array} floatArray
62
- * @param {number} offset
63
- *
64
- * create floatArray with createFloat32Array before calling this function.
65
- * start offset from 0.
66
- * feed the floatArray with a track data and offset that is returned from the previous call.
67
- */
68
- function fillSliceOfFloat32Array(coordinates, timestamps, styleGroupNameArray, _groupColorMap, floatArray, offset) {
69
- if (coordinates[0].length === 2) {
70
- const startTime = timestamps[0];
71
- const endTime = timestamps[timestamps.length - 1];
72
- let prevPointData = null;
73
- { // first point
74
- const { x, y } = _latLongToPixelXY(coordinates[0][1], coordinates[0][0]);
75
- prevPointData = [x, y, 0, timestamps[0], ..._groupColorMap[styleGroupNameArray[0]]];
76
- }
77
- { // middle points until end
78
- for (let i = 1; i < coordinates.length; i++) {
79
- const time = timestamps[i];
80
- const coord = coordinates[i];
81
- const { x, y } = _latLongToPixelXY(coord[1], coord[0]);
82
- floatArray.set([...prevPointData, startTime, endTime, x, y, 0, time, ..._groupColorMap[styleGroupNameArray[i]], startTime, endTime], offset);
83
- prevPointData = [x, y, 0, time, ..._groupColorMap[styleGroupNameArray[i]]];
84
- offset += 18;
85
- }
86
- }
87
- }
88
- else {
89
- const startTime = timestamps[0];
90
- const endTime = timestamps[timestamps.length - 1];
91
- let prevPointData = null;
92
- { // first point
93
- const { x, y } = _latLongToPixelXY(coordinates[0][1], coordinates[0][0]);
94
- prevPointData = [x, y, coordinates[0][2] / 1000.0, timestamps[0], ..._groupColorMap[styleGroupNameArray[0]]];
95
- }
96
- { // middle points until end
97
- for (let i = 1; i < coordinates.length; i++) {
98
- const time = timestamps[i];
99
- const coord = coordinates[i];
100
- const { x, y } = _latLongToPixelXY(coord[1], coord[0]);
101
- floatArray.set([...prevPointData, startTime, endTime, x, y, coord[2] / 1000.0, time, ..._groupColorMap[styleGroupNameArray[i]], startTime, endTime], offset);
102
- prevPointData = [x, y, coord[2] / 1000.0, time, ..._groupColorMap[styleGroupNameArray[i]]];
103
- offset += 18;
104
- }
105
- }
106
- }
107
- return offset;
108
- }
109
- /**
110
- *
111
- * @param {*} coordinatesArray
112
- * @returns Float32Array
113
- * Coordinates array is needed to calculate the size of the buffer.
114
- */
115
- function createFloat32Array(coordinatesArray) {
116
- let filteredSize = 0;
117
- for (let coordinates of coordinatesArray) {
118
- filteredSize += coordinates.length * 2 - 2;
119
- }
120
- const array = new Float32Array(filteredSize * 9);
121
- return array;
122
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.latLongToPixelXY = exports.fillSliceOfFloat32ArrayLineStrip = exports.featuresToLineStringData = exports.addCuttingPointLineStrip = exports.TimeTracksLineStrip = exports.TimeTracks = exports.createFloat32Array = exports.fillSliceOfFloat32Array = exports.Adaptor = void 0;
7
- const plugin_1 = __importDefault(require("./plugin"));
8
- exports.TimeTracks = plugin_1.default;
9
- const adaptors_1 = require("./adaptors");
10
- Object.defineProperty(exports, "Adaptor", { enumerable: true, get: function () { return adaptors_1.Adaptor; } });
11
- Object.defineProperty(exports, "fillSliceOfFloat32Array", { enumerable: true, get: function () { return adaptors_1.fillSliceOfFloat32Array; } });
12
- Object.defineProperty(exports, "createFloat32Array", { enumerable: true, get: function () { return adaptors_1.createFloat32Array; } });
13
- const plugin_line_strip_1 = __importDefault(require("./plugin-line-strip"));
14
- exports.TimeTracksLineStrip = plugin_line_strip_1.default;
15
- const adaptors_line_strip_1 = require("./adaptors-line-strip");
16
- Object.defineProperty(exports, "addCuttingPointLineStrip", { enumerable: true, get: function () { return adaptors_line_strip_1.addCuttingPointLineStrip; } });
17
- Object.defineProperty(exports, "featuresToLineStringData", { enumerable: true, get: function () { return adaptors_line_strip_1.featuresToLineStringData; } });
18
- Object.defineProperty(exports, "fillSliceOfFloat32ArrayLineStrip", { enumerable: true, get: function () { return adaptors_line_strip_1.fillSliceOfFloat32ArrayLineStrip; } });
19
- Object.defineProperty(exports, "latLongToPixelXY", { enumerable: true, get: function () { return adaptors_line_strip_1.latLongToPixelXY; } });