@pirireis/webglobeplugins 0.8.15-alpha → 0.8.17

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.
@@ -0,0 +1,52 @@
1
+
2
+
3
+
4
+
5
+ class FlowManager {
6
+ _populateCount: number;
7
+ _rbush: RBush<any>;
8
+ _arcToCutsManager: ArcToCutsManager;
9
+ consturctor({ populateCount = 36, dotDistanceOfArcCuts = 1 / Math.pow(2, 10 - 1) }) {
10
+ this._populateCount = populateCount;
11
+
12
+ // does the cutting and id mapping(one to many)
13
+ // cuts have their bbox ready for rbush
14
+ this._rbush = new RBush(1000);
15
+ this._arcToCutsManager = new ArcToCutsManager({ dotDistanceOfArcCuts, rbush: this._rbush }); // 10km
16
+
17
+ }
18
+
19
+
20
+
21
+
22
+
23
+ /**
24
+ * adds or updates an arc in the rbush and the cuts manager
25
+ */
26
+ insertArc(arc: Arc) {
27
+ this._arcToCutsManager.insertArc(arc);
28
+
29
+ }
30
+
31
+
32
+
33
+ deleteArc(id: Arc['id']) {
34
+ this._arcToCutsManager.deleteArc(id);
35
+ }
36
+
37
+
38
+ queryBBox(bbox: BBox) {
39
+
40
+ const arcIDSet = new Set(this._rbush.query(bbox).map(x => x.id)); // sets Of ids of arcs
41
+
42
+ // arcs U bbox => arcs
43
+
44
+
45
+ // populate points
46
+ // return typed array of points belonging to all the arcs of cuts
47
+ }
48
+
49
+
50
+
51
+
52
+ }
File without changes
@@ -0,0 +1,27 @@
1
+ type BBox = {
2
+ minX: number;
3
+ minY: number;
4
+ maxX: number;
5
+ maxY: number;
6
+ id?: string;
7
+ }
8
+
9
+ type Point = { lon: number, lat: number };
10
+ type Vector = [number, number, number]; // x y z
11
+
12
+
13
+ type Arc = {
14
+ id: string;
15
+ start: number[];
16
+ end: number[];
17
+ };
18
+
19
+
20
+ interface RBUSH {
21
+ insert: (item: BBox) => void;
22
+ remove: (item: BBox) => void;
23
+ search: (bbox: BBox) => BBox[];
24
+ clear: () => void;
25
+ all: () => BBox[];
26
+
27
+ }
File without changes
@@ -253,7 +253,7 @@ export default class Plugin {
253
253
 
254
254
  setParticleDimensions(tail, wing) {
255
255
  if (0 < tail || 0 < wing) {
256
- this.waveUbo.update({ base_limp: [tail, wing] });
256
+ this.waveUbo.update({ tail_wing_base_limp: [tail, wing] });
257
257
  } else {
258
258
  console.error("tail and wing must be greater than 0");
259
259
  }
@@ -1,10 +0,0 @@
1
- export function testWebWorker() {
2
-
3
- const worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module' });
4
- worker.onmessage = (event) => {
5
- console.log(event.data);
6
- worker.terminate();
7
- };
8
- worker.postMessage("sumBigNumber");
9
- return worker;
10
- }
@@ -1,10 +0,0 @@
1
- export function sumBigNumber() {
2
- let sum = 0n;
3
- let length = 1000000n;
4
- let i = 0n;
5
- while (i < length) {
6
- sum += i;
7
- i++;
8
- }
9
- return sum;
10
- }
@@ -1,8 +0,0 @@
1
- import { sumBigNumber } from "./module";
2
-
3
- /* eslint-disable-next-line no-restricted-globals */
4
- self.onmessage = (event) => {
5
- const result = sumBigNumber();
6
- /* eslint-disable-next-line no-restricted-globals */
7
- self.postMessage(result);
8
- }