-
Notifications
You must be signed in to change notification settings - Fork 298
/
Copy pathLASLoaderPlugin.d.ts
146 lines (133 loc) · 5.29 KB
/
LASLoaderPlugin.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import { Entity, Plugin, Viewer } from "../../viewer";
import { ModelStats } from "../index";
export declare interface ILASDefaultDataSource {
/**
* Gets the contents of the given LAS file in an arraybuffer.
*
* @param {String|Number} src Path or ID of an LAS file.
* @param {Function} ok Callback fired on success, argument is the LAS file in an arraybuffer.
* @param {Function} error Callback fired on error.
*/
getLAS(src: string | number, ok: (LAS: ArrayBuffer) => void, error: (e: Error) => void): void;
}
export declare type LASLoaderPluginConfiguration = {
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
id?: string;
/** A custom data source through which the LASLoaderPlugin can load model and metadata files. Defaults to an instance of {@link LASDefaultDataSource}, which loads over HTTP. */
dataSource?: ILASDefaultDataSource;
/** Configures LASLoaderPlugin to load every **n** points.*/
skip?: number;
/** Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit. */
fp64?: number;
/** Configures whether LASLoaderPlugin assumes that LAS colors are encoded using 8 or 16 bits. Accepted values are 8, 16 an "auto". */
colorDepth?: 8 | 16 | "auto";
};
export declare type LoadLASModel = {
/** ID to assign to the root {@link Entity.id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default. */
id?: string;
/** Path to a LAS file, as an alternative to the ````las```` parameter. */
src?: string;
/** The LAS file data, as an alternative to the ````src```` parameter. */
las?: ArrayBuffer;
/** Whether to load metadata for the LAS model. */
loadMetadata?: boolean;
/** The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates. */
origin?: number[]
/** The model single-precision 3D position, relative to the ````origin```` parameter. */
position?: number[]
/** The model's scale. */
scale?: number[]
/** The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis. */
rotation?: number[]
/** The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````. */
matrix?: number[]
/** Collects model statistics. */
stats?: ModelStats
};
/**
* {@link Viewer} plugin that loads lidar point cloud geometry from LAS files.
*/
export declare class LASLoaderPlugin extends Plugin {
/**
* @constructor
*
* @param {Viewer} viewer The Viewer.
* @param {LASLoaderPluginConfiguration} cfg Plugin configuration.
*/
constructor(viewer: Viewer, cfg?: LASLoaderPluginConfiguration);
/**
* Sets a custom data source through which the LASLoaderPlugin can load LAS files.
*
* Default value is {@link LASDefaultDataSource}, which loads via HTTP.
*
* @type {ILASDefaultDataSource}
*/
set dataSource(arg: ILASDefaultDataSource);
/**
* Gets the custom data source through which the LASLoaderPlugin can load LAS files.
*
* Default value is {@link LASDefaultDataSource}, which loads via HTTP.
*
* @type {ILASDefaultDataSource}
*/
get dataSource(): ILASDefaultDataSource;
/**
* Configures LASLoaderPlugin to load every **n** points.
*
* Default value is ````1````.
*
* @param {Number} value The **n**th point that LASLoaderPlugin will read.
*/
set skip(arg: number);
/**
* When LASLoaderPlugin is configured to load every **n** points, returns the value of **n**.
*
* Default value is ````1````.
*
* @returns {Number} The **n**th point that LASLoaderPlugin will read.
*/
get skip(): number;
/**
* Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.
*
* Default value is ````false````.
*
* @param {Boolean} value True if LASLoaderPlugin assumes that positions are stored in 64-bit floats instead of 32-bit.
*/
set fp64(arg: boolean);
/**
* Gets if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.
*
* Default value is ````false````.
*
* @returns {Boolean} True if LASLoaderPlugin assumes that positions are stored in 64-bit floats instead of 32-bit.
*/
get fp64(): boolean;
/**
* Configures whether LASLoaderPlugin assumes that LAS colors are encoded using 8 or 16 bits.
*
* Default value is ````8````.
*
* Note: LAS specification recommends 16 bits.
*
* @param {Number|String} value Valid values are 8, 16 and "auto".
*/
set colorDepth(arg: 8 | 16 | "auto");
/**
* Gets whether LASLoaderPlugin assumes that LAS colors are encoded using 8 or 16 bits.
*
* Default value is ````8````.
*
* Note: LAS specification recommends 16 bits.
*
* @returns {Number|String} Possible returned values are 8, 16 and "auto".
*/
get colorDepth(): 8 | 16 | "auto";
/**
* Loads an ````LAS```` model into this LASLoaderPlugin's {@link Viewer}.
*
* @param {LoadLASModel} params Loading parameters.
* @returns {SceneModel} SceneModel representing the model, which will have {@link Entity.isModel} set ````true```` and will be registered by {@link Entity.id} in {@link Scene.models}.
*/
load(params?: LoadLASModel): Entity;
}