isard 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +6 -2
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +7 -6
- package/dist/decoders.d.ts +3 -2
- package/dist/decoders.js +28 -5
- package/dist/decoders.js.map +1 -1
- package/dist/engine-loader.d.ts +6 -3
- package/dist/engine-loader.js +10 -3
- package/dist/engine-loader.js.map +1 -1
- package/dist/formats.d.ts +11 -0
- package/dist/formats.js +12 -0
- package/dist/formats.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_points_bg.wasm +0 -0
- package/dist/layers.js +2 -2
- package/dist/layers.js.map +1 -1
- package/dist/loader.d.ts +9 -3
- package/dist/loader.js +22 -3
- package/dist/loader.js.map +1 -1
- package/dist/map.d.ts +8 -0
- package/dist/map.js +10 -2
- package/dist/map.js.map +1 -1
- package/dist/pointclouds.d.ts +98 -0
- package/dist/pointclouds.js +232 -0
- package/dist/pointclouds.js.map +1 -0
- package/dist/projections.d.ts +13 -0
- package/dist/projections.js +13 -0
- package/dist/projections.js.map +1 -0
- package/dist/protocol.d.ts +17 -0
- package/dist/protocol.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.js.map +1 -1
- package/dist/wasm/isard.d.ts +124 -9
- package/dist/wasm/isard.js +127 -7
- package/dist/wasm/isard_points.d.ts +43 -0
- package/dist/wasm/isard_points.js +212 -0
- package/package.json +17 -1
package/dist/wasm/isard.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface EncodedTile {
|
|
|
19
19
|
/** ECEF origin of the vertices (metres) */
|
|
20
20
|
anchor: Float64Array<ArrayBuffer>;
|
|
21
21
|
primitives: EncodedPrimitive[];
|
|
22
|
+
/** Its points (`.pnts`, glTF points), 20 bytes a vertex: x, y, z (f32) around the anchor, RGB, a normal */
|
|
23
|
+
points: Uint8Array<ArrayBuffer>[];
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/** A texture transcoded for the GPU (KTX2 / Basis Universal): a WebGL internal format and its mip levels */
|
|
@@ -41,7 +43,10 @@ export interface DecodedPrimitive {
|
|
|
41
43
|
color?: Float32Array<ArrayBuffer>;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* A Draco-compressed primitive of a tile (`KHR_draco_mesh_compression`), or its points
|
|
48
|
+
* (`3DTILES_draco_point_compression`), to decode with the Draco module
|
|
49
|
+
*/
|
|
45
50
|
export interface DracoRequest {
|
|
46
51
|
mesh: number;
|
|
47
52
|
primitive: number;
|
|
@@ -49,15 +54,21 @@ export interface DracoRequest {
|
|
|
49
54
|
/** Draco attribute ids */
|
|
50
55
|
position: number;
|
|
51
56
|
uv?: number;
|
|
57
|
+
color?: number;
|
|
58
|
+
normal?: number;
|
|
59
|
+
/** A point cloud: no triangles */
|
|
60
|
+
points?: boolean;
|
|
52
61
|
}
|
|
53
62
|
|
|
54
|
-
/** The Draco module's output for a request: positions and
|
|
63
|
+
/** The Draco module's output for a request: positions, uv, colors and normals as stored, triangles (not for points) */
|
|
55
64
|
export interface DracoGeometry {
|
|
56
65
|
mesh: number;
|
|
57
66
|
primitive: number;
|
|
58
67
|
positions: Float32Array;
|
|
59
68
|
uvs?: Float32Array;
|
|
60
|
-
indices
|
|
69
|
+
indices?: Uint32Array;
|
|
70
|
+
colors?: Float32Array;
|
|
71
|
+
normals?: Float32Array;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
/** Compressed texture formats supported by the GPU */
|
|
@@ -72,6 +83,8 @@ export interface TextureFormats {
|
|
|
72
83
|
export interface DecodedTile {
|
|
73
84
|
anchor: Float64Array<ArrayBuffer>;
|
|
74
85
|
primitives: DecodedPrimitive[];
|
|
86
|
+
/** Its points' vertices (`EncodedTile.points`) */
|
|
87
|
+
points?: Uint8Array<ArrayBuffer>[];
|
|
75
88
|
}
|
|
76
89
|
|
|
77
90
|
/** What the engine expects from a pool of decoding workers (`Engine.setTileLoader`) */
|
|
@@ -89,6 +102,22 @@ export interface TileLoaderLike {
|
|
|
89
102
|
priority?: 'high' | 'low',
|
|
90
103
|
): Promise<DecodedTile>;
|
|
91
104
|
abort(id: number): void;
|
|
105
|
+
/**
|
|
106
|
+
* The points of a COPC node: its LAZ chunk (`size` bytes at `offset` of the file at `url`, a range request), the
|
|
107
|
+
* data of the file's LAZ VLR, its layout (format, record length, scale, offset), the grid positioning its points
|
|
108
|
+
* and its point count; resolves with its vertices (20 bytes each, see `EncodedTile.points`)
|
|
109
|
+
*/
|
|
110
|
+
loadPoints?(
|
|
111
|
+
id: number,
|
|
112
|
+
url: string,
|
|
113
|
+
offset: number,
|
|
114
|
+
size: number,
|
|
115
|
+
laz: Uint8Array,
|
|
116
|
+
layout: Float64Array,
|
|
117
|
+
grid: Float64Array,
|
|
118
|
+
count: number,
|
|
119
|
+
priority?: 'high' | 'low',
|
|
120
|
+
): Promise<Uint8Array<ArrayBuffer>>;
|
|
92
121
|
}
|
|
93
122
|
|
|
94
123
|
|
|
@@ -150,6 +179,63 @@ export interface Tiles3dStats {
|
|
|
150
179
|
|
|
151
180
|
|
|
152
181
|
|
|
182
|
+
/** Counters of a point cloud layer */
|
|
183
|
+
export interface PointCloudStats {
|
|
184
|
+
/** Points drawn in the last frame */
|
|
185
|
+
points: number;
|
|
186
|
+
/** Nodes drawn in the last frame */
|
|
187
|
+
nodes: number;
|
|
188
|
+
/** Nodes held on the GPU */
|
|
189
|
+
loaded: number;
|
|
190
|
+
/** Downloads under way */
|
|
191
|
+
inFlight: number;
|
|
192
|
+
/** GPU memory of the points, MB */
|
|
193
|
+
gpuMb: number;
|
|
194
|
+
/** Nodes known in the hierarchy (its pages loaded so far) */
|
|
195
|
+
known: number;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** What a point cloud says of itself once its head is read */
|
|
199
|
+
export interface PointCloudInfo {
|
|
200
|
+
/** Points in the file */
|
|
201
|
+
points: number;
|
|
202
|
+
/** LAS point format (6 to 8: 7 and 8 with colors) */
|
|
203
|
+
format: number;
|
|
204
|
+
/** The WKT of its CRS, if the file has one */
|
|
205
|
+
wkt?: string;
|
|
206
|
+
/** The center of its cube: longitude, latitude */
|
|
207
|
+
center: [lon: number, lat: number];
|
|
208
|
+
/** Its altitudes, lowest and highest (metres) */
|
|
209
|
+
altitudes: [min: number, max: number];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** A point picked in a point cloud */
|
|
213
|
+
export interface PointCloudPoint {
|
|
214
|
+
lonLat: [lon: number, lat: number];
|
|
215
|
+
/** Metres above the ellipsoid */
|
|
216
|
+
height: number;
|
|
217
|
+
/** Its z in the file's vertical datum (metres) */
|
|
218
|
+
altitude: number;
|
|
219
|
+
classification: number;
|
|
220
|
+
intensity: number;
|
|
221
|
+
returnNumber: number;
|
|
222
|
+
numberOfReturns: number;
|
|
223
|
+
/** 8-bit color, files with colors only */
|
|
224
|
+
rgb?: [r: number, g: number, b: number];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** The CRS of a point cloud, as the page resolves it from the file's WKT (`addPointCloud`) */
|
|
228
|
+
export interface PointCloudCrs {
|
|
229
|
+
/** x, y pairs of the CRS to longitudes, latitudes (degrees) */
|
|
230
|
+
inverse(xy: Float64Array): Float64Array;
|
|
231
|
+
/** The altitudes are above the geoid (IGN69): raised by the RAF20 geoid height */
|
|
232
|
+
geoid: boolean;
|
|
233
|
+
/** Metres of a unit of z */
|
|
234
|
+
verticalScale: number;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
153
239
|
/** Pieces of a network layer: its edges cut along their lines, sorted by square; only the squares in view are drawn */
|
|
154
240
|
export interface NetworkStats {
|
|
155
241
|
pieces: number;
|
|
@@ -219,6 +305,12 @@ export class Engine {
|
|
|
219
305
|
* cost of travelling it from A to B then from B to A; without, values are interpolated along the edges.
|
|
220
306
|
*/
|
|
221
307
|
addNetwork(mercator: Float64Array, edges: Uint32Array, line_start: Uint32Array | null | undefined, line_points: Float64Array | null | undefined, costs: Float32Array | null | undefined, style: Float32Array): number;
|
|
308
|
+
/**
|
|
309
|
+
* A COPC point cloud from its URL (HTTP range requests). `resolve(wkt)` gives the CRS of the file from its WKT
|
|
310
|
+
* (undefined if it has none): its inverse projection, whether its altitudes are above the geoid, the metres of
|
|
311
|
+
* a unit of z; it may throw (an unknown CRS), the layer then stays empty
|
|
312
|
+
*/
|
|
313
|
+
addPointCloud(url: string, resolve: (wkt: string | undefined) => PointCloudCrs): number;
|
|
222
314
|
/**
|
|
223
315
|
* Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
|
|
224
316
|
* default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
|
|
@@ -282,6 +374,19 @@ export class Engine {
|
|
|
282
374
|
* Reads the pixels back at once (the GPU finishes its work first): for clicks; `requestPick` for the hover
|
|
283
375
|
*/
|
|
284
376
|
pick(x: number, y: number, radius?: number | null, only?: Uint32Array | null): PickHit | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* What a point cloud says of itself, undefined before its head is read
|
|
379
|
+
*/
|
|
380
|
+
pointCloudInfo(id: number): PointCloudInfo | undefined;
|
|
381
|
+
/**
|
|
382
|
+
* The point of a point cloud picked by `pick` or `pollPick` (its index there), read back from the GPU; undefined
|
|
383
|
+
* once it is no longer drawn
|
|
384
|
+
*/
|
|
385
|
+
pointCloudPoint(id: number, index: number): PointCloudPoint | undefined;
|
|
386
|
+
/**
|
|
387
|
+
* Counters of a point cloud layer, undefined if there is none with this id
|
|
388
|
+
*/
|
|
389
|
+
pointCloudStats(id: number): PointCloudStats | undefined;
|
|
285
390
|
/**
|
|
286
391
|
* The answer to the last `requestPick` once the GPU has delivered it (then forgotten), undefined while it is not
|
|
287
392
|
* there yet (or nothing was asked, or the context was lost)
|
|
@@ -454,6 +559,11 @@ export class Engine {
|
|
|
454
559
|
* One value per node; negative = unreached
|
|
455
560
|
*/
|
|
456
561
|
setNetworkValues(id: number, values: Float32Array): void;
|
|
562
|
+
/**
|
|
563
|
+
* The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
|
|
564
|
+
* alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
|
|
565
|
+
*/
|
|
566
|
+
setPointCloudStyle(id: number, style: Float64Array, palette: Uint8Array, ramp: Uint8Array): void;
|
|
457
567
|
setRasterStyle(id: number, opacity: number, saturation: number): void;
|
|
458
568
|
/**
|
|
459
569
|
* Space behind the globe (stars, atmosphere halo), in the globe projection
|
|
@@ -488,9 +598,9 @@ export class Engine {
|
|
|
488
598
|
*/
|
|
489
599
|
setTileLoader(loader: TileLoaderLike | null): void;
|
|
490
600
|
/**
|
|
491
|
-
* Screen-space error threshold and
|
|
601
|
+
* Screen-space error threshold, opacity and size of the points (CSS pixels, 2 if not given) of a 3D Tiles layer
|
|
492
602
|
*/
|
|
493
|
-
setTiles3dStyle(id: number, max_error: number, opacity: number): void;
|
|
603
|
+
setTiles3dStyle(id: number, max_error: number, opacity: number, point_size?: number | null): void;
|
|
494
604
|
setZoomRange(min: number, max: number): void;
|
|
495
605
|
/**
|
|
496
606
|
* Tile counters of the raster layers, for diagnostics
|
|
@@ -524,9 +634,9 @@ export class Engine {
|
|
|
524
634
|
}
|
|
525
635
|
|
|
526
636
|
/**
|
|
527
|
-
* Decodes a `.b3dm` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x,
|
|
528
|
-
* v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
|
|
529
|
-
* Float32Array (the material's base color, when not white) }] }`.
|
|
637
|
+
* Decodes a `.b3dm` / `.pnts` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x,
|
|
638
|
+
* y, z, u, v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
|
|
639
|
+
* Float32Array (the material's base color, when not white) }], points: [Uint8Array] (the points' vertices) }`.
|
|
530
640
|
* `transform`: the tile's world transform (16 numbers, column-major).
|
|
531
641
|
* `draco`: the decoded geometries of its Draco primitives (`dracoRequests`), if any.
|
|
532
642
|
*/
|
|
@@ -552,6 +662,7 @@ export interface InitOutput {
|
|
|
552
662
|
readonly engine_addLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
553
663
|
readonly engine_addModels: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
554
664
|
readonly engine_addNetwork: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => [number, number, number];
|
|
665
|
+
readonly engine_addPointCloud: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
555
666
|
readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
556
667
|
readonly engine_addSymbols: (a: number) => [number, number, number];
|
|
557
668
|
readonly engine_addTiles3d: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -566,6 +677,9 @@ export interface InitOutput {
|
|
|
566
677
|
readonly engine_new: (a: any, b: any) => [number, number, number];
|
|
567
678
|
readonly engine_pan: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
568
679
|
readonly engine_pick: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
680
|
+
readonly engine_pointCloudInfo: (a: number, b: number) => any;
|
|
681
|
+
readonly engine_pointCloudPoint: (a: number, b: number, c: number) => any;
|
|
682
|
+
readonly engine_pointCloudStats: (a: number, b: number) => any;
|
|
569
683
|
readonly engine_pollPick: (a: number) => any;
|
|
570
684
|
readonly engine_preload: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
571
685
|
readonly engine_project: (a: number, b: number, c: number) => any;
|
|
@@ -608,13 +722,14 @@ export interface InitOutput {
|
|
|
608
722
|
readonly engine_setNetworkScales: (a: number, b: number, c: number, d: number) => void;
|
|
609
723
|
readonly engine_setNetworkStyle: (a: number, b: number, c: number, d: number) => void;
|
|
610
724
|
readonly engine_setNetworkValues: (a: number, b: number, c: number, d: number) => void;
|
|
725
|
+
readonly engine_setPointCloudStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
611
726
|
readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
|
|
612
727
|
readonly engine_setSky: (a: number, b: number) => void;
|
|
613
728
|
readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
614
729
|
readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
615
730
|
readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
616
731
|
readonly engine_setTileLoader: (a: number, b: any) => void;
|
|
617
|
-
readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number) => void;
|
|
732
|
+
readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
618
733
|
readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
|
|
619
734
|
readonly engine_stats: (a: number) => any;
|
|
620
735
|
readonly engine_textureFormats: (a: number) => any;
|
package/dist/wasm/isard.js
CHANGED
|
@@ -175,6 +175,23 @@ export class Engine {
|
|
|
175
175
|
}
|
|
176
176
|
return ret[0] >>> 0;
|
|
177
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* A COPC point cloud from its URL (HTTP range requests). `resolve(wkt)` gives the CRS of the file from its WKT
|
|
180
|
+
* (undefined if it has none): its inverse projection, whether its altitudes are above the geoid, the metres of
|
|
181
|
+
* a unit of z; it may throw (an unknown CRS), the layer then stays empty
|
|
182
|
+
* @param {string} url
|
|
183
|
+
* @param {(wkt: string | undefined) => PointCloudCrs} resolve
|
|
184
|
+
* @returns {number}
|
|
185
|
+
*/
|
|
186
|
+
addPointCloud(url, resolve) {
|
|
187
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
|
+
const ret = wasm.engine_addPointCloud(this.__wbg_ptr, ptr0, len0, resolve);
|
|
190
|
+
if (ret[2]) {
|
|
191
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
192
|
+
}
|
|
193
|
+
return ret[0] >>> 0;
|
|
194
|
+
}
|
|
178
195
|
/**
|
|
179
196
|
* Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
|
|
180
197
|
* default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
|
|
@@ -344,6 +361,35 @@ export class Engine {
|
|
|
344
361
|
const ret = wasm.engine_pick(this.__wbg_ptr, x, y, !isLikeNone(radius), isLikeNone(radius) ? 0 : radius, ptr0, len0);
|
|
345
362
|
return ret;
|
|
346
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* What a point cloud says of itself, undefined before its head is read
|
|
366
|
+
* @param {number} id
|
|
367
|
+
* @returns {PointCloudInfo | undefined}
|
|
368
|
+
*/
|
|
369
|
+
pointCloudInfo(id) {
|
|
370
|
+
const ret = wasm.engine_pointCloudInfo(this.__wbg_ptr, id);
|
|
371
|
+
return ret;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* The point of a point cloud picked by `pick` or `pollPick` (its index there), read back from the GPU; undefined
|
|
375
|
+
* once it is no longer drawn
|
|
376
|
+
* @param {number} id
|
|
377
|
+
* @param {number} index
|
|
378
|
+
* @returns {PointCloudPoint | undefined}
|
|
379
|
+
*/
|
|
380
|
+
pointCloudPoint(id, index) {
|
|
381
|
+
const ret = wasm.engine_pointCloudPoint(this.__wbg_ptr, id, index);
|
|
382
|
+
return ret;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Counters of a point cloud layer, undefined if there is none with this id
|
|
386
|
+
* @param {number} id
|
|
387
|
+
* @returns {PointCloudStats | undefined}
|
|
388
|
+
*/
|
|
389
|
+
pointCloudStats(id) {
|
|
390
|
+
const ret = wasm.engine_pointCloudStats(this.__wbg_ptr, id);
|
|
391
|
+
return ret;
|
|
392
|
+
}
|
|
347
393
|
/**
|
|
348
394
|
* The answer to the last `requestPick` once the GPU has delivered it (then forgotten), undefined while it is not
|
|
349
395
|
* there yet (or nothing was asked, or the context was lost)
|
|
@@ -835,6 +881,23 @@ export class Engine {
|
|
|
835
881
|
const len0 = WASM_VECTOR_LEN;
|
|
836
882
|
wasm.engine_setNetworkValues(this.__wbg_ptr, id, ptr0, len0);
|
|
837
883
|
}
|
|
884
|
+
/**
|
|
885
|
+
* The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
|
|
886
|
+
* alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
|
|
887
|
+
* @param {number} id
|
|
888
|
+
* @param {Float64Array} style
|
|
889
|
+
* @param {Uint8Array} palette
|
|
890
|
+
* @param {Uint8Array} ramp
|
|
891
|
+
*/
|
|
892
|
+
setPointCloudStyle(id, style, palette, ramp) {
|
|
893
|
+
const ptr0 = passArrayF64ToWasm0(style, wasm.__wbindgen_malloc);
|
|
894
|
+
const len0 = WASM_VECTOR_LEN;
|
|
895
|
+
const ptr1 = passArray8ToWasm0(palette, wasm.__wbindgen_malloc);
|
|
896
|
+
const len1 = WASM_VECTOR_LEN;
|
|
897
|
+
const ptr2 = passArray8ToWasm0(ramp, wasm.__wbindgen_malloc);
|
|
898
|
+
const len2 = WASM_VECTOR_LEN;
|
|
899
|
+
wasm.engine_setPointCloudStyle(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
900
|
+
}
|
|
838
901
|
/**
|
|
839
902
|
* @param {number} id
|
|
840
903
|
* @param {number} opacity
|
|
@@ -924,13 +987,14 @@ export class Engine {
|
|
|
924
987
|
wasm.engine_setTileLoader(this.__wbg_ptr, loader);
|
|
925
988
|
}
|
|
926
989
|
/**
|
|
927
|
-
* Screen-space error threshold and
|
|
990
|
+
* Screen-space error threshold, opacity and size of the points (CSS pixels, 2 if not given) of a 3D Tiles layer
|
|
928
991
|
* @param {number} id
|
|
929
992
|
* @param {number} max_error
|
|
930
993
|
* @param {number} opacity
|
|
994
|
+
* @param {number | null} [point_size]
|
|
931
995
|
*/
|
|
932
|
-
setTiles3dStyle(id, max_error, opacity) {
|
|
933
|
-
wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity);
|
|
996
|
+
setTiles3dStyle(id, max_error, opacity, point_size) {
|
|
997
|
+
wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size);
|
|
934
998
|
}
|
|
935
999
|
/**
|
|
936
1000
|
* @param {number} min
|
|
@@ -1037,9 +1101,9 @@ export class Engine {
|
|
|
1037
1101
|
if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
|
|
1038
1102
|
|
|
1039
1103
|
/**
|
|
1040
|
-
* Decodes a `.b3dm` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x,
|
|
1041
|
-
* v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
|
|
1042
|
-
* Float32Array (the material's base color, when not white) }] }`.
|
|
1104
|
+
* Decodes a `.b3dm` / `.pnts` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x,
|
|
1105
|
+
* y, z, u, v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
|
|
1106
|
+
* Float32Array (the material's base color, when not white) }], points: [Uint8Array] (the points' vertices) }`.
|
|
1043
1107
|
* `transform`: the tile's world transform (16 numbers, column-major).
|
|
1044
1108
|
* `draco`: the decoded geometries of its Draco primitives (`dracoRequests`), if any.
|
|
1045
1109
|
* @param {Uint8Array} bytes
|
|
@@ -1089,6 +1153,10 @@ function __wbg_get_imports() {
|
|
|
1089
1153
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1090
1154
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1091
1155
|
},
|
|
1156
|
+
__wbg___wbindgen_is_falsy_16bd49b68658263e: function(arg0) {
|
|
1157
|
+
const ret = !arg0;
|
|
1158
|
+
return ret;
|
|
1159
|
+
},
|
|
1092
1160
|
__wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
|
|
1093
1161
|
const ret = typeof(arg0) === 'function';
|
|
1094
1162
|
return ret;
|
|
@@ -1251,6 +1319,12 @@ function __wbg_get_imports() {
|
|
|
1251
1319
|
__wbg_clearColor_796427e8ac60fe14: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1252
1320
|
arg0.clearColor(arg1, arg2, arg3, arg4);
|
|
1253
1321
|
},
|
|
1322
|
+
__wbg_clearDepth_4840a5497ae51286: function(arg0, arg1) {
|
|
1323
|
+
arg0.clearDepth(arg1);
|
|
1324
|
+
},
|
|
1325
|
+
__wbg_clearDepth_5a119c24c5d193bc: function(arg0, arg1) {
|
|
1326
|
+
arg0.clearDepth(arg1);
|
|
1327
|
+
},
|
|
1254
1328
|
__wbg_clearStencil_1b8b8c727f598eec: function(arg0, arg1) {
|
|
1255
1329
|
arg0.clearStencil(arg1);
|
|
1256
1330
|
},
|
|
@@ -1598,6 +1672,13 @@ function __wbg_get_imports() {
|
|
|
1598
1672
|
const ret = Reflect.get(arg0, arg1);
|
|
1599
1673
|
return ret;
|
|
1600
1674
|
}, arguments); },
|
|
1675
|
+
__wbg_get_f75619e20cb68514: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1676
|
+
const ret = arg1.get(getStringFromWasm0(arg2, arg3));
|
|
1677
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1678
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1679
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1680
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1681
|
+
}, arguments); },
|
|
1601
1682
|
__wbg_get_index_f4750150bb3083b3: function(arg0, arg1) {
|
|
1602
1683
|
const ret = arg0[arg1 >>> 0];
|
|
1603
1684
|
return ret;
|
|
@@ -1606,6 +1687,10 @@ function __wbg_get_imports() {
|
|
|
1606
1687
|
const ret = arg0[arg1 >>> 0];
|
|
1607
1688
|
return ret;
|
|
1608
1689
|
},
|
|
1690
|
+
__wbg_headers_eba93595f8944c2f: function(arg0) {
|
|
1691
|
+
const ret = arg0.headers;
|
|
1692
|
+
return ret;
|
|
1693
|
+
},
|
|
1609
1694
|
__wbg_height_9dca4d43c3e4b84b: function(arg0) {
|
|
1610
1695
|
const ret = arg0.height;
|
|
1611
1696
|
return ret;
|
|
@@ -1630,6 +1715,16 @@ function __wbg_get_imports() {
|
|
|
1630
1715
|
const ret = result;
|
|
1631
1716
|
return ret;
|
|
1632
1717
|
},
|
|
1718
|
+
__wbg_instanceof_Error_80a725f81f2e102d: function(arg0) {
|
|
1719
|
+
let result;
|
|
1720
|
+
try {
|
|
1721
|
+
result = arg0 instanceof Error;
|
|
1722
|
+
} catch (_) {
|
|
1723
|
+
result = false;
|
|
1724
|
+
}
|
|
1725
|
+
const ret = result;
|
|
1726
|
+
return ret;
|
|
1727
|
+
},
|
|
1633
1728
|
__wbg_instanceof_Float32Array_595afb0f28b828c9: function(arg0) {
|
|
1634
1729
|
let result;
|
|
1635
1730
|
try {
|
|
@@ -1758,6 +1853,10 @@ function __wbg_get_imports() {
|
|
|
1758
1853
|
__wbg_linkProgram_acdc299c43d734a0: function(arg0, arg1) {
|
|
1759
1854
|
arg0.linkProgram(arg1);
|
|
1760
1855
|
},
|
|
1856
|
+
__wbg_message_5f8387f0c32b90a7: function(arg0) {
|
|
1857
|
+
const ret = arg0.message;
|
|
1858
|
+
return ret;
|
|
1859
|
+
},
|
|
1761
1860
|
__wbg_name_91a697e9ff1634bf: function(arg0, arg1) {
|
|
1762
1861
|
const ret = arg1.name;
|
|
1763
1862
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -1795,6 +1894,10 @@ function __wbg_get_imports() {
|
|
|
1795
1894
|
const ret = new Object();
|
|
1796
1895
|
return ret;
|
|
1797
1896
|
},
|
|
1897
|
+
__wbg_new_83ca405eae412a62: function() { return handleError(function () {
|
|
1898
|
+
const ret = new Headers();
|
|
1899
|
+
return ret;
|
|
1900
|
+
}, arguments); },
|
|
1798
1901
|
__wbg_new_ee2291f50781bf1d: function() {
|
|
1799
1902
|
const ret = new Array();
|
|
1800
1903
|
return ret;
|
|
@@ -1843,6 +1946,10 @@ function __wbg_get_imports() {
|
|
|
1843
1946
|
const ret = Array.of(arg0);
|
|
1844
1947
|
return ret;
|
|
1845
1948
|
},
|
|
1949
|
+
__wbg_of_dde0b9d3265685ee: function(arg0, arg1, arg2) {
|
|
1950
|
+
const ret = Array.of(arg0, arg1, arg2);
|
|
1951
|
+
return ret;
|
|
1952
|
+
},
|
|
1846
1953
|
__wbg_of_fea2613674ee0d0f: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1847
1954
|
const ret = Array.of(arg0, arg1, arg2, arg3, arg4);
|
|
1848
1955
|
return ret;
|
|
@@ -1870,6 +1977,9 @@ function __wbg_get_imports() {
|
|
|
1870
1977
|
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
1871
1978
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1872
1979
|
},
|
|
1980
|
+
__wbg_prototypesetcall_d49a4fab5ca427bc: function(arg0, arg1, arg2) {
|
|
1981
|
+
Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
|
|
1982
|
+
},
|
|
1873
1983
|
__wbg_push_2baf45db356cf468: function(arg0, arg1) {
|
|
1874
1984
|
const ret = arg0.push(arg1);
|
|
1875
1985
|
return ret;
|
|
@@ -1914,6 +2024,9 @@ function __wbg_get_imports() {
|
|
|
1914
2024
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1915
2025
|
return ret;
|
|
1916
2026
|
}, arguments); },
|
|
2027
|
+
__wbg_set_af5932e3f78b5648: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2028
|
+
arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2029
|
+
}, arguments); },
|
|
1917
2030
|
__wbg_set_alpha_6dea851a46253adf: function(arg0, arg1) {
|
|
1918
2031
|
arg0.alpha = arg1 !== 0;
|
|
1919
2032
|
},
|
|
@@ -1929,6 +2042,9 @@ function __wbg_get_imports() {
|
|
|
1929
2042
|
__wbg_set_depth_8b49de49803d4e60: function(arg0, arg1) {
|
|
1930
2043
|
arg0.depth = arg1 !== 0;
|
|
1931
2044
|
},
|
|
2045
|
+
__wbg_set_headers_40ad33dcf016613f: function(arg0, arg1) {
|
|
2046
|
+
arg0.headers = arg1;
|
|
2047
|
+
},
|
|
1932
2048
|
__wbg_set_power_preference_6ef22d4c8baf517f: function(arg0, arg1) {
|
|
1933
2049
|
arg0.powerPreference = __wbindgen_enum_WebGlPowerPreference[arg1];
|
|
1934
2050
|
},
|
|
@@ -2008,6 +2124,10 @@ function __wbg_get_imports() {
|
|
|
2008
2124
|
__wbg_stencilOp_2697194654fee819: function(arg0, arg1, arg2, arg3) {
|
|
2009
2125
|
arg0.stencilOp(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
|
|
2010
2126
|
},
|
|
2127
|
+
__wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
|
|
2128
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2129
|
+
return ret;
|
|
2130
|
+
},
|
|
2011
2131
|
__wbg_texImage2D_1b3349107ad0faae: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
2012
2132
|
arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4 >>> 0, arg5 >>> 0, arg6);
|
|
2013
2133
|
}, arguments); },
|
|
@@ -2205,7 +2325,7 @@ function __wbg_get_imports() {
|
|
|
2205
2325
|
return ret;
|
|
2206
2326
|
},
|
|
2207
2327
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2208
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2328
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 190, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2209
2329
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
|
|
2210
2330
|
return ret;
|
|
2211
2331
|
},
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The vertices (`STRIDE` bytes each, see `points`) of a COPC chunk of `count` points. `laz`: the data of the LAZ
|
|
6
|
+
* VLR; `layout`: format, record length, scale and offset of the header; `grid`: the positions of the node's square
|
|
7
|
+
* (`Grid::numbers`)
|
|
8
|
+
*/
|
|
9
|
+
export function decodeCopc(chunk: Uint8Array, laz: Uint8Array, layout: Float64Array, grid: Float64Array, count: number): Uint8Array;
|
|
10
|
+
|
|
11
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
12
|
+
|
|
13
|
+
export interface InitOutput {
|
|
14
|
+
readonly memory: WebAssembly.Memory;
|
|
15
|
+
readonly decodeCopc: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number, number];
|
|
16
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
17
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
18
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
19
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
20
|
+
readonly __wbindgen_start: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
27
|
+
* a precompiled `WebAssembly.Module`.
|
|
28
|
+
*
|
|
29
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
30
|
+
*
|
|
31
|
+
* @returns {InitOutput}
|
|
32
|
+
*/
|
|
33
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
37
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
38
|
+
*
|
|
39
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
40
|
+
*
|
|
41
|
+
* @returns {Promise<InitOutput>}
|
|
42
|
+
*/
|
|
43
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|