@thatopen/components 2.1.8 → 2.1.10
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/dist/core/Components/index.d.ts +1 -1
- package/dist/fragments/Classifier/index.d.ts +5 -2
- package/dist/fragments/IfcLoader/src/index.d.ts +1 -0
- package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +5 -0
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +776 -748
- package/dist/namespace.d.ts +1475 -1467
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,4 +1,53 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
3
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
4
|
+
import { Components } from "../Components";
|
|
5
|
+
/**
|
|
6
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
7
|
+
*/
|
|
8
|
+
export declare class Grids extends Component implements Disposable {
|
|
9
|
+
/**
|
|
10
|
+
* A unique identifier for the component.
|
|
11
|
+
* This UUID is used to register the component within the Components system.
|
|
12
|
+
*/
|
|
13
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
14
|
+
/**
|
|
15
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
16
|
+
*/
|
|
17
|
+
list: Map<string, SimpleGrid>;
|
|
18
|
+
/**
|
|
19
|
+
* The default configuration for grid creation.
|
|
20
|
+
*/
|
|
21
|
+
config: Required<GridConfig>;
|
|
22
|
+
/** {@link Disposable.onDisposed} */
|
|
23
|
+
readonly onDisposed: Event<unknown>;
|
|
24
|
+
/** {@link Component.enabled} */
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
constructor(components: Components);
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new grid for the given world.
|
|
29
|
+
* Throws an error if a grid already exists for the world.
|
|
30
|
+
*
|
|
31
|
+
* @param world - The world to create the grid for.
|
|
32
|
+
* @returns The newly created grid.
|
|
33
|
+
*
|
|
34
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
35
|
+
*/
|
|
36
|
+
create(world: World): SimpleGrid;
|
|
37
|
+
/**
|
|
38
|
+
* Deletes the grid associated with the given world.
|
|
39
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
40
|
+
*
|
|
41
|
+
* @param world - The world for which to delete the grid.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
45
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
46
|
+
*/
|
|
47
|
+
delete(world: World): void;
|
|
48
|
+
/** {@link Disposable.dispose} */
|
|
49
|
+
dispose(): void;
|
|
50
|
+
}
|
|
2
51
|
import { Component, Disposable, Event } from "../Types";
|
|
3
52
|
/**
|
|
4
53
|
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
@@ -7,7 +56,7 @@ export declare class Components implements Disposable {
|
|
|
7
56
|
/**
|
|
8
57
|
* The version of the @thatopen/components library.
|
|
9
58
|
*/
|
|
10
|
-
static readonly release = "2.1.
|
|
59
|
+
static readonly release = "2.1.10";
|
|
11
60
|
/** {@link Disposable.onDisposed} */
|
|
12
61
|
readonly onDisposed: Event<void>;
|
|
13
62
|
/**
|
|
@@ -76,209 +125,6 @@ export declare class Components implements Disposable {
|
|
|
76
125
|
private static setupBVH;
|
|
77
126
|
}
|
|
78
127
|
import * as THREE from "three";
|
|
79
|
-
import { Components } from "../Components";
|
|
80
|
-
import { Component } from "../Types";
|
|
81
|
-
/**
|
|
82
|
-
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
83
|
-
*/
|
|
84
|
-
export declare class Disposer extends Component {
|
|
85
|
-
private _disposedComponents;
|
|
86
|
-
/** {@link Component.enabled} */
|
|
87
|
-
enabled: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* A unique identifier for the component.
|
|
90
|
-
* This UUID is used to register the component within the Components system.
|
|
91
|
-
*/
|
|
92
|
-
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
93
|
-
constructor(components: Components);
|
|
94
|
-
/**
|
|
95
|
-
* Return the UUIDs of all disposed components.
|
|
96
|
-
*/
|
|
97
|
-
get(): Set<string>;
|
|
98
|
-
/**
|
|
99
|
-
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
100
|
-
* using any of these in other parts of the application, make sure that you
|
|
101
|
-
* remove them from the mesh before disposing it.
|
|
102
|
-
*
|
|
103
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
104
|
-
* to remove.
|
|
105
|
-
*
|
|
106
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
107
|
-
*
|
|
108
|
-
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
109
|
-
*/
|
|
110
|
-
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
111
|
-
/**
|
|
112
|
-
* Disposes a geometry from memory.
|
|
113
|
-
*
|
|
114
|
-
* @param geometry - the
|
|
115
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
116
|
-
* to remove.
|
|
117
|
-
*/
|
|
118
|
-
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
119
|
-
private disposeGeometryAndMaterials;
|
|
120
|
-
private disposeChildren;
|
|
121
|
-
private static disposeMaterial;
|
|
122
|
-
}
|
|
123
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
124
|
-
import { SimpleRaycaster } from "./src";
|
|
125
|
-
import { Components } from "../Components";
|
|
126
|
-
/**
|
|
127
|
-
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
128
|
-
*/
|
|
129
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
130
|
-
/**
|
|
131
|
-
* A unique identifier for the component.
|
|
132
|
-
* This UUID is used to register the component within the Components system.
|
|
133
|
-
*/
|
|
134
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
135
|
-
/** {@link Component.enabled} */
|
|
136
|
-
enabled: boolean;
|
|
137
|
-
/**
|
|
138
|
-
* A Map that stores raycasters for each world.
|
|
139
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
140
|
-
*/
|
|
141
|
-
list: Map<string, SimpleRaycaster>;
|
|
142
|
-
/** {@link Disposable.onDisposed} */
|
|
143
|
-
onDisposed: Event<unknown>;
|
|
144
|
-
constructor(components: Components);
|
|
145
|
-
/**
|
|
146
|
-
* Retrieves a SimpleRaycaster instance for the given world.
|
|
147
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
148
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
149
|
-
*
|
|
150
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
151
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
152
|
-
*/
|
|
153
|
-
get(world: World): SimpleRaycaster;
|
|
154
|
-
/**
|
|
155
|
-
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
156
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
157
|
-
*
|
|
158
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
159
|
-
* @returns {void}
|
|
160
|
-
*/
|
|
161
|
-
delete(world: World): void;
|
|
162
|
-
/** {@link Disposable.dispose} */
|
|
163
|
-
dispose(): void;
|
|
164
|
-
}
|
|
165
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
166
|
-
import { Components } from "../Components";
|
|
167
|
-
import { SimpleWorld } from "./src";
|
|
168
|
-
/**
|
|
169
|
-
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
170
|
-
*/
|
|
171
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
172
|
-
/**
|
|
173
|
-
* A unique identifier for the component.
|
|
174
|
-
* This UUID is used to register the component within the Components system.
|
|
175
|
-
*/
|
|
176
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
177
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
178
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
179
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
180
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
181
|
-
/** {@link Disposable.onDisposed} */
|
|
182
|
-
readonly onDisposed: Event<unknown>;
|
|
183
|
-
/**
|
|
184
|
-
* An event that is triggered when a new world is created.
|
|
185
|
-
* The event passes the newly created world as a parameter.
|
|
186
|
-
*/
|
|
187
|
-
readonly onWorldCreated: Event<World>;
|
|
188
|
-
/**
|
|
189
|
-
* An event that is triggered when a world is deleted.
|
|
190
|
-
* The event passes the UUID of the deleted world as a parameter.
|
|
191
|
-
*/
|
|
192
|
-
readonly onWorldDeleted: Event<string>;
|
|
193
|
-
/**
|
|
194
|
-
* A collection of worlds managed by this component.
|
|
195
|
-
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
196
|
-
*/
|
|
197
|
-
list: Map<string, World>;
|
|
198
|
-
/** {@link Component.enabled} */
|
|
199
|
-
enabled: boolean;
|
|
200
|
-
constructor(components: Components);
|
|
201
|
-
/**
|
|
202
|
-
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
203
|
-
*
|
|
204
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
205
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
206
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
207
|
-
*
|
|
208
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
209
|
-
*/
|
|
210
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
211
|
-
/**
|
|
212
|
-
* Deletes a world from the list of worlds.
|
|
213
|
-
*
|
|
214
|
-
* @param {World} world - The world to be deleted.
|
|
215
|
-
*
|
|
216
|
-
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
217
|
-
*
|
|
218
|
-
* @returns {void}
|
|
219
|
-
*/
|
|
220
|
-
delete(world: World): void;
|
|
221
|
-
/**
|
|
222
|
-
* Disposes of the Worlds component and all its managed worlds.
|
|
223
|
-
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
224
|
-
* and triggers the onDisposed event.
|
|
225
|
-
*
|
|
226
|
-
* @returns {void}
|
|
227
|
-
*/
|
|
228
|
-
dispose(): void;
|
|
229
|
-
/** {@link Updateable.update} */
|
|
230
|
-
update(delta?: number): void | Promise<void>;
|
|
231
|
-
}
|
|
232
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
233
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
234
|
-
import { Components } from "../Components";
|
|
235
|
-
/**
|
|
236
|
-
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
237
|
-
*/
|
|
238
|
-
export declare class Grids extends Component implements Disposable {
|
|
239
|
-
/**
|
|
240
|
-
* A unique identifier for the component.
|
|
241
|
-
* This UUID is used to register the component within the Components system.
|
|
242
|
-
*/
|
|
243
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
244
|
-
/**
|
|
245
|
-
* A map of world UUIDs to their corresponding grid instances.
|
|
246
|
-
*/
|
|
247
|
-
list: Map<string, SimpleGrid>;
|
|
248
|
-
/**
|
|
249
|
-
* The default configuration for grid creation.
|
|
250
|
-
*/
|
|
251
|
-
config: Required<GridConfig>;
|
|
252
|
-
/** {@link Disposable.onDisposed} */
|
|
253
|
-
readonly onDisposed: Event<unknown>;
|
|
254
|
-
/** {@link Component.enabled} */
|
|
255
|
-
enabled: boolean;
|
|
256
|
-
constructor(components: Components);
|
|
257
|
-
/**
|
|
258
|
-
* Creates a new grid for the given world.
|
|
259
|
-
* Throws an error if a grid already exists for the world.
|
|
260
|
-
*
|
|
261
|
-
* @param world - The world to create the grid for.
|
|
262
|
-
* @returns The newly created grid.
|
|
263
|
-
*
|
|
264
|
-
* @throws Will throw an error if a grid already exists for the given world.
|
|
265
|
-
*/
|
|
266
|
-
create(world: World): SimpleGrid;
|
|
267
|
-
/**
|
|
268
|
-
* Deletes the grid associated with the given world.
|
|
269
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
270
|
-
*
|
|
271
|
-
* @param world - The world for which to delete the grid.
|
|
272
|
-
*
|
|
273
|
-
* @remarks
|
|
274
|
-
* This method will dispose of the grid and remove it from the internal list.
|
|
275
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
276
|
-
*/
|
|
277
|
-
delete(world: World): void;
|
|
278
|
-
/** {@link Disposable.dispose} */
|
|
279
|
-
dispose(): void;
|
|
280
|
-
}
|
|
281
|
-
import * as THREE from "three";
|
|
282
128
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
283
129
|
import { SimplePlane } from "./src";
|
|
284
130
|
import { Components } from "../Components";
|
|
@@ -409,53 +255,117 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
409
255
|
private _onStartDragging;
|
|
410
256
|
private _onEndDragging;
|
|
411
257
|
}
|
|
258
|
+
import * as THREE from "three";
|
|
412
259
|
import { Components } from "../Components";
|
|
413
|
-
import {
|
|
414
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
260
|
+
import { Component } from "../Types";
|
|
415
261
|
/**
|
|
416
|
-
* A
|
|
262
|
+
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
417
263
|
*/
|
|
418
|
-
export declare class
|
|
264
|
+
export declare class Disposer extends Component {
|
|
265
|
+
private _disposedComponents;
|
|
266
|
+
/** {@link Component.enabled} */
|
|
267
|
+
enabled: boolean;
|
|
419
268
|
/**
|
|
420
269
|
* A unique identifier for the component.
|
|
421
270
|
* This UUID is used to register the component within the Components system.
|
|
422
271
|
*/
|
|
423
|
-
static readonly uuid: "
|
|
272
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
273
|
+
constructor(components: Components);
|
|
424
274
|
/**
|
|
425
|
-
*
|
|
275
|
+
* Return the UUIDs of all disposed components.
|
|
276
|
+
*/
|
|
277
|
+
get(): Set<string>;
|
|
278
|
+
/**
|
|
279
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
280
|
+
* using any of these in other parts of the application, make sure that you
|
|
281
|
+
* remove them from the mesh before disposing it.
|
|
282
|
+
*
|
|
283
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
284
|
+
* to remove.
|
|
285
|
+
*
|
|
286
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
287
|
+
*
|
|
288
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
289
|
+
*/
|
|
290
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
291
|
+
/**
|
|
292
|
+
* Disposes a geometry from memory.
|
|
293
|
+
*
|
|
294
|
+
* @param geometry - the
|
|
295
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
296
|
+
* to remove.
|
|
297
|
+
*/
|
|
298
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
299
|
+
private disposeGeometryAndMaterials;
|
|
300
|
+
private disposeChildren;
|
|
301
|
+
private static disposeMaterial;
|
|
302
|
+
}
|
|
303
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
304
|
+
import { Components } from "../Components";
|
|
305
|
+
import { SimpleWorld } from "./src";
|
|
306
|
+
/**
|
|
307
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
308
|
+
*/
|
|
309
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
310
|
+
/**
|
|
311
|
+
* A unique identifier for the component.
|
|
312
|
+
* This UUID is used to register the component within the Components system.
|
|
426
313
|
*/
|
|
314
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
315
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
316
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
317
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
318
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
319
|
+
/** {@link Disposable.onDisposed} */
|
|
427
320
|
readonly onDisposed: Event<unknown>;
|
|
428
|
-
private _enabled;
|
|
429
321
|
/**
|
|
430
|
-
*
|
|
322
|
+
* An event that is triggered when a new world is created.
|
|
323
|
+
* The event passes the newly created world as a parameter.
|
|
431
324
|
*/
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
|
|
325
|
+
readonly onWorldCreated: Event<World>;
|
|
326
|
+
/**
|
|
327
|
+
* An event that is triggered when a world is deleted.
|
|
328
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
329
|
+
*/
|
|
330
|
+
readonly onWorldDeleted: Event<string>;
|
|
331
|
+
/**
|
|
332
|
+
* A collection of worlds managed by this component.
|
|
333
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
334
|
+
*/
|
|
335
|
+
list: Map<string, World>;
|
|
435
336
|
/** {@link Component.enabled} */
|
|
436
|
-
|
|
337
|
+
enabled: boolean;
|
|
437
338
|
constructor(components: Components);
|
|
438
339
|
/**
|
|
439
|
-
* Creates a new
|
|
440
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
340
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
441
341
|
*
|
|
442
|
-
* @
|
|
443
|
-
* @
|
|
342
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
343
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
344
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
444
345
|
*
|
|
445
|
-
* @
|
|
346
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
446
347
|
*/
|
|
447
|
-
create
|
|
348
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
448
349
|
/**
|
|
449
|
-
* Deletes
|
|
450
|
-
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
350
|
+
* Deletes a world from the list of worlds.
|
|
451
351
|
*
|
|
452
|
-
* @param world - The world
|
|
352
|
+
* @param {World} world - The world to be deleted.
|
|
353
|
+
*
|
|
354
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
453
355
|
*
|
|
454
356
|
* @returns {void}
|
|
455
357
|
*/
|
|
456
358
|
delete(world: World): void;
|
|
457
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
361
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
362
|
+
* and triggers the onDisposed event.
|
|
363
|
+
*
|
|
364
|
+
* @returns {void}
|
|
365
|
+
*/
|
|
458
366
|
dispose(): void;
|
|
367
|
+
/** {@link Updateable.update} */
|
|
368
|
+
update(delta?: number): void | Promise<void>;
|
|
459
369
|
}
|
|
460
370
|
import { MiniMap } from "./src";
|
|
461
371
|
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
@@ -504,6 +414,96 @@ export declare class MiniMaps extends Component implements Updateable, Disposabl
|
|
|
504
414
|
/** {@link Updateable.update} */
|
|
505
415
|
update(): void;
|
|
506
416
|
}
|
|
417
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
418
|
+
import { SimpleRaycaster } from "./src";
|
|
419
|
+
import { Components } from "../Components";
|
|
420
|
+
/**
|
|
421
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
422
|
+
*/
|
|
423
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
424
|
+
/**
|
|
425
|
+
* A unique identifier for the component.
|
|
426
|
+
* This UUID is used to register the component within the Components system.
|
|
427
|
+
*/
|
|
428
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
429
|
+
/** {@link Component.enabled} */
|
|
430
|
+
enabled: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* A Map that stores raycasters for each world.
|
|
433
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
434
|
+
*/
|
|
435
|
+
list: Map<string, SimpleRaycaster>;
|
|
436
|
+
/** {@link Disposable.onDisposed} */
|
|
437
|
+
onDisposed: Event<unknown>;
|
|
438
|
+
constructor(components: Components);
|
|
439
|
+
/**
|
|
440
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
441
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
442
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
443
|
+
*
|
|
444
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
445
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
446
|
+
*/
|
|
447
|
+
get(world: World): SimpleRaycaster;
|
|
448
|
+
/**
|
|
449
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
450
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
451
|
+
*
|
|
452
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
453
|
+
* @returns {void}
|
|
454
|
+
*/
|
|
455
|
+
delete(world: World): void;
|
|
456
|
+
/** {@link Disposable.dispose} */
|
|
457
|
+
dispose(): void;
|
|
458
|
+
}
|
|
459
|
+
import { Components } from "../Components";
|
|
460
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
461
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
462
|
+
/**
|
|
463
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
464
|
+
*/
|
|
465
|
+
export declare class Cullers extends Component implements Disposable {
|
|
466
|
+
/**
|
|
467
|
+
* A unique identifier for the component.
|
|
468
|
+
* This UUID is used to register the component within the Components system.
|
|
469
|
+
*/
|
|
470
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
471
|
+
/**
|
|
472
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
473
|
+
*/
|
|
474
|
+
readonly onDisposed: Event<unknown>;
|
|
475
|
+
private _enabled;
|
|
476
|
+
/**
|
|
477
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
478
|
+
*/
|
|
479
|
+
list: Map<string, MeshCullerRenderer>;
|
|
480
|
+
/** {@link Component.enabled} */
|
|
481
|
+
get enabled(): boolean;
|
|
482
|
+
/** {@link Component.enabled} */
|
|
483
|
+
set enabled(value: boolean);
|
|
484
|
+
constructor(components: Components);
|
|
485
|
+
/**
|
|
486
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
487
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
488
|
+
*
|
|
489
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
490
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
491
|
+
*
|
|
492
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
493
|
+
*/
|
|
494
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
495
|
+
/**
|
|
496
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
497
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
498
|
+
*
|
|
499
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
500
|
+
*
|
|
501
|
+
* @returns {void}
|
|
502
|
+
*/
|
|
503
|
+
delete(world: World): void;
|
|
504
|
+
/** {@link Disposable.dispose} */
|
|
505
|
+
dispose(): void;
|
|
506
|
+
}
|
|
507
507
|
import * as THREE from "three";
|
|
508
508
|
import { Components } from "../Components";
|
|
509
509
|
import { SimpleCamera } from "..";
|
|
@@ -568,273 +568,304 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
568
568
|
private newOrthoCamera;
|
|
569
569
|
private setOrthoPerspCameraAspect;
|
|
570
570
|
}
|
|
571
|
+
export declare class UUID {
|
|
572
|
+
private static _pattern;
|
|
573
|
+
private static _lut;
|
|
574
|
+
static create(): string;
|
|
575
|
+
static validate(uuid: string): void;
|
|
576
|
+
}
|
|
571
577
|
import * as THREE from "three";
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
578
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
579
|
+
center: THREE.Vector3;
|
|
580
|
+
halfSizes: THREE.Vector3;
|
|
581
|
+
rotation: THREE.Matrix3;
|
|
582
|
+
transformation: THREE.Matrix4;
|
|
583
|
+
};
|
|
584
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
585
|
+
import * as THREE from "three";
|
|
586
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
575
587
|
/**
|
|
576
|
-
*
|
|
588
|
+
* Configuration interface for the VertexPicker component.
|
|
577
589
|
*/
|
|
578
|
-
export
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
590
|
+
export interface VertexPickerConfig {
|
|
591
|
+
/**
|
|
592
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
593
|
+
*/
|
|
594
|
+
showOnlyVertex: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* The maximum distance for snapping to a vertex.
|
|
597
|
+
*/
|
|
598
|
+
snapDistance: number;
|
|
599
|
+
/**
|
|
600
|
+
* The HTML element to use for previewing the picked vertex.
|
|
601
|
+
*/
|
|
602
|
+
previewElement: HTMLElement;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
606
|
+
*/
|
|
607
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
582
608
|
/** {@link Disposable.onDisposed} */
|
|
583
609
|
readonly onDisposed: Event<unknown>;
|
|
584
|
-
private _absoluteMin;
|
|
585
|
-
private _absoluteMax;
|
|
586
|
-
private _meshes;
|
|
587
|
-
constructor(components: Components);
|
|
588
610
|
/**
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
* @param bbox - The bounding box to calculate the dimensions for.
|
|
592
|
-
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
611
|
+
* An event that is triggered when a vertex is found.
|
|
612
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
593
613
|
*/
|
|
594
|
-
|
|
595
|
-
width: number;
|
|
596
|
-
height: number;
|
|
597
|
-
depth: number;
|
|
598
|
-
center: THREE.Vector3;
|
|
599
|
-
};
|
|
614
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
600
615
|
/**
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
604
|
-
* @returns A new THREE.Vector3 representing the boundary.
|
|
605
|
-
*
|
|
606
|
-
* @remarks
|
|
607
|
-
* This method is used to create a new boundary for calculating bounding boxes.
|
|
608
|
-
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
609
|
-
* depending on the value of the 'positive' parameter.
|
|
610
|
-
*
|
|
611
|
-
* @example
|
|
612
|
-
* '''typescript
|
|
613
|
-
* const positiveBound = BoundingBoxer.newBound(true);
|
|
614
|
-
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
615
|
-
*
|
|
616
|
-
* const negativeBound = BoundingBoxer.newBound(false);
|
|
617
|
-
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
618
|
-
* '''
|
|
616
|
+
* An event that is triggered when a vertex is lost.
|
|
617
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
619
618
|
*/
|
|
620
|
-
|
|
619
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
621
620
|
/**
|
|
622
|
-
*
|
|
623
|
-
*
|
|
624
|
-
* @param points - An array of THREE.Vector3 representing the points.
|
|
625
|
-
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
626
|
-
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
627
|
-
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
628
|
-
*
|
|
629
|
-
* @remarks
|
|
630
|
-
* This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
|
|
631
|
-
* If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
|
|
632
|
-
*
|
|
633
|
-
* @example
|
|
634
|
-
* '''typescript
|
|
635
|
-
* const points = [
|
|
636
|
-
* new THREE.Vector3(1, 2, 3),
|
|
637
|
-
* new THREE.Vector3(4, 5, 6),
|
|
638
|
-
* new THREE.Vector3(7, 8, 9),
|
|
639
|
-
* ];
|
|
640
|
-
*
|
|
641
|
-
* const bbox = BoundingBoxer.getBounds(points);
|
|
642
|
-
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
643
|
-
* '''
|
|
621
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
644
622
|
*/
|
|
645
|
-
|
|
646
|
-
/** {@link Disposable.dispose} */
|
|
647
|
-
dispose(): void;
|
|
623
|
+
readonly onEnabled: Event<boolean>;
|
|
648
624
|
/**
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
652
|
-
*
|
|
653
|
-
* @remarks
|
|
654
|
-
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
655
|
-
* The returned box represents the bounding box of the calculated fragments.
|
|
656
|
-
*
|
|
657
|
-
* @example
|
|
658
|
-
* '''typescript
|
|
659
|
-
* const boundingBox = boundingBoxer.get();
|
|
660
|
-
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
661
|
-
* '''
|
|
625
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
662
626
|
*/
|
|
663
|
-
|
|
627
|
+
components: Components;
|
|
664
628
|
/**
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
* @remarks
|
|
670
|
-
* This method calculates the center and radius of a sphere that encompasses the entire bounding box.
|
|
671
|
-
* The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
|
|
672
|
-
* The radius is calculated as the distance from the center to the minimum bound.
|
|
673
|
-
*
|
|
674
|
-
* @example
|
|
675
|
-
* '''typescript
|
|
676
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
677
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
678
|
-
* const boundingSphere = boundingBoxer.getSphere();
|
|
679
|
-
* console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
|
|
680
|
-
* '''
|
|
629
|
+
* A reference to the working plane used for vertex picking.
|
|
630
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
631
|
+
* If this value is null, all vertices are considered valid.
|
|
681
632
|
*/
|
|
682
|
-
|
|
633
|
+
workingPlane: THREE.Plane | null;
|
|
634
|
+
private _pickedPoint;
|
|
635
|
+
private _config;
|
|
636
|
+
private _enabled;
|
|
683
637
|
/**
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
* @remarks
|
|
689
|
-
* This method calculates the dimensions of the bounding box using the 'getDimensions' method.
|
|
690
|
-
* It then creates a new THREE.BoxGeometry with the calculated dimensions.
|
|
691
|
-
* A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
|
|
692
|
-
* The position of the mesh is set to the center of the bounding box.
|
|
638
|
+
* Sets the enabled state of the VertexPicker.
|
|
639
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
640
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
693
641
|
*
|
|
694
|
-
* @
|
|
695
|
-
* '''typescript
|
|
696
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
697
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
698
|
-
* const boundingBoxMesh = boundingBoxer.getMesh();
|
|
699
|
-
* scene.add(boundingBoxMesh);
|
|
700
|
-
* '''
|
|
642
|
+
* @param value - The new enabled state.
|
|
701
643
|
*/
|
|
702
|
-
|
|
644
|
+
set enabled(value: boolean);
|
|
703
645
|
/**
|
|
704
|
-
*
|
|
705
|
-
* This method is used to prepare the BoundingBoxer for a new set of fragments.
|
|
706
|
-
*
|
|
707
|
-
* @remarks
|
|
708
|
-
* This method is called when a new set of fragments is added to the BoundingBoxer.
|
|
709
|
-
* It ensures that the bounding box calculations are accurate and up-to-date.
|
|
646
|
+
* Gets the current enabled state of the VertexPicker.
|
|
710
647
|
*
|
|
711
|
-
* @
|
|
712
|
-
* '''typescript
|
|
713
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
714
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
715
|
-
* // ...
|
|
716
|
-
* boundingBoxer.reset();
|
|
717
|
-
* '''
|
|
648
|
+
* @returns The current enabled state.
|
|
718
649
|
*/
|
|
719
|
-
|
|
650
|
+
get enabled(): boolean;
|
|
720
651
|
/**
|
|
721
|
-
*
|
|
722
|
-
*
|
|
723
|
-
* @param group - The FragmentsGroup to add.
|
|
652
|
+
* Sets the configuration for the VertexPicker component.
|
|
724
653
|
*
|
|
725
|
-
* @
|
|
726
|
-
*
|
|
727
|
-
* and calls the 'addMesh' method for each fragment's mesh.
|
|
654
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
655
|
+
* The properties not provided in the value object will retain their current values.
|
|
728
656
|
*
|
|
729
657
|
* @example
|
|
730
658
|
* '''typescript
|
|
731
|
-
*
|
|
732
|
-
*
|
|
659
|
+
* vertexPicker.config = {
|
|
660
|
+
* snapDistance: 0.5,
|
|
661
|
+
* showOnlyVertex: true,
|
|
662
|
+
* };
|
|
733
663
|
* '''
|
|
734
664
|
*/
|
|
735
|
-
|
|
665
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
736
666
|
/**
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
* @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
|
|
740
|
-
* @param itemIDs - An optional iterable of numbers representing the item IDs.
|
|
667
|
+
* Gets the current configuration for the VertexPicker component.
|
|
741
668
|
*
|
|
742
|
-
* @
|
|
743
|
-
* This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
|
|
744
|
-
* If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
|
|
745
|
-
* If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
|
|
669
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
746
670
|
*
|
|
747
671
|
* @example
|
|
748
672
|
* '''typescript
|
|
749
|
-
* const
|
|
750
|
-
*
|
|
673
|
+
* const currentConfig = vertexPicker.config;
|
|
674
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
751
675
|
* '''
|
|
752
676
|
*/
|
|
753
|
-
|
|
677
|
+
get config(): Partial<VertexPickerConfig>;
|
|
678
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
679
|
+
/** {@link Disposable.dispose} */
|
|
680
|
+
dispose(): void;
|
|
754
681
|
/**
|
|
755
|
-
*
|
|
682
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
756
683
|
*
|
|
757
|
-
*
|
|
758
|
-
* and then calls the 'addMesh' method for each fragment's mesh, passing the expression IDs as the second parameter.
|
|
684
|
+
* @param world - The World instance to use for raycasting.
|
|
759
685
|
*
|
|
760
|
-
* @
|
|
686
|
+
* @returns The current picked point, or null if no point is picked.
|
|
761
687
|
*
|
|
762
688
|
* @remarks
|
|
763
|
-
* This method
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
*
|
|
767
|
-
* ''
|
|
768
|
-
*
|
|
769
|
-
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
770
|
-
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
771
|
-
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
772
|
-
* };
|
|
773
|
-
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
774
|
-
* '''
|
|
689
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
690
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
691
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
692
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
693
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
694
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
775
695
|
*/
|
|
776
|
-
|
|
777
|
-
private
|
|
696
|
+
get(world: World): THREE.Vector3 | null;
|
|
697
|
+
private getClosestVertex;
|
|
698
|
+
private getVertices;
|
|
699
|
+
private getVertex;
|
|
700
|
+
}
|
|
701
|
+
import * as THREE from "three";
|
|
702
|
+
export declare class MaterialsUtils {
|
|
703
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
778
704
|
}
|
|
779
705
|
import * as THREE from "three";
|
|
780
706
|
import * as FRAGS from "@thatopen/fragments";
|
|
781
|
-
import {
|
|
707
|
+
import { Component, Components } from "../../core";
|
|
782
708
|
/**
|
|
783
|
-
*
|
|
709
|
+
* Represents an edge measurement result.
|
|
784
710
|
*/
|
|
785
|
-
export interface
|
|
711
|
+
export interface MeasureEdge {
|
|
786
712
|
/**
|
|
787
|
-
*
|
|
788
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
713
|
+
* The distance between the two points of the edge.
|
|
789
714
|
*/
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
[className: string]: {
|
|
796
|
-
map: FRAGS.FragmentIdMap;
|
|
797
|
-
name: string;
|
|
798
|
-
id: number | null;
|
|
799
|
-
};
|
|
800
|
-
};
|
|
715
|
+
distance: number;
|
|
716
|
+
/**
|
|
717
|
+
* The two points that define the edge.
|
|
718
|
+
*/
|
|
719
|
+
points: THREE.Vector3[];
|
|
801
720
|
}
|
|
802
721
|
/**
|
|
803
|
-
*
|
|
722
|
+
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
804
723
|
*/
|
|
805
|
-
export declare class
|
|
724
|
+
export declare class MeasurementUtils extends Component {
|
|
806
725
|
/**
|
|
807
726
|
* A unique identifier for the component.
|
|
808
727
|
* This UUID is used to register the component within the Components system.
|
|
809
728
|
*/
|
|
810
|
-
static
|
|
729
|
+
static uuid: string;
|
|
811
730
|
/** {@link Component.enabled} */
|
|
812
731
|
enabled: boolean;
|
|
813
|
-
/**
|
|
814
|
-
* A map representing the classification systems.
|
|
815
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
816
|
-
*/
|
|
817
|
-
list: Classification;
|
|
818
|
-
/** {@link Disposable.onDisposed} */
|
|
819
|
-
readonly onDisposed: Event<unknown>;
|
|
820
732
|
constructor(components: Components);
|
|
821
|
-
private onFragmentsDisposed;
|
|
822
|
-
/** {@link Disposable.dispose} */
|
|
823
|
-
dispose(): void;
|
|
824
733
|
/**
|
|
825
|
-
*
|
|
826
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
734
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
827
735
|
*
|
|
828
|
-
* @param
|
|
736
|
+
* @param point - The point from which to calculate the distance.
|
|
737
|
+
* @param lineStart - The start point of the line segment.
|
|
738
|
+
* @param lineEnd - The end point of the line segment.
|
|
739
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
740
|
+
* @returns The distance from the point to the line segment.
|
|
829
741
|
*/
|
|
830
|
-
|
|
742
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
831
743
|
/**
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
835
|
-
* @param
|
|
836
|
-
* The
|
|
837
|
-
*
|
|
744
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
745
|
+
* It also returns the edges of the found face and their indices.
|
|
746
|
+
*
|
|
747
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
748
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
749
|
+
* @param instance - The instance of the mesh (optional).
|
|
750
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
751
|
+
*/
|
|
752
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
753
|
+
edges: MeasureEdge[];
|
|
754
|
+
indices: Set<number>;
|
|
755
|
+
} | null;
|
|
756
|
+
/**
|
|
757
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
758
|
+
* It also applies instance transformation if provided.
|
|
759
|
+
*
|
|
760
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
761
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
762
|
+
* @param instance - The instance of the mesh (optional).
|
|
763
|
+
* @returns An object containing the vertices and normal of the face.
|
|
764
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
765
|
+
*/
|
|
766
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
767
|
+
p1: THREE.Vector3;
|
|
768
|
+
p2: THREE.Vector3;
|
|
769
|
+
p3: THREE.Vector3;
|
|
770
|
+
faceNormal: THREE.Vector3;
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
774
|
+
* This is used to ensure numerical precision in edge detection.
|
|
775
|
+
*
|
|
776
|
+
* @param vector - The vector to round.
|
|
777
|
+
* @returns The vector with rounded components.
|
|
778
|
+
*/
|
|
779
|
+
round(vector: THREE.Vector3): void;
|
|
780
|
+
/**
|
|
781
|
+
* Calculates the volume of a set of fragments.
|
|
782
|
+
*
|
|
783
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
784
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
785
|
+
*
|
|
786
|
+
* @remarks
|
|
787
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
788
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
789
|
+
*
|
|
790
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
791
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
792
|
+
*/
|
|
793
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
794
|
+
/**
|
|
795
|
+
* Calculates the total volume of a set of meshes.
|
|
796
|
+
*
|
|
797
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
798
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
799
|
+
*
|
|
800
|
+
* @remarks
|
|
801
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
802
|
+
* and its bounding sphere.
|
|
803
|
+
*
|
|
804
|
+
*/
|
|
805
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
806
|
+
private getFaceData;
|
|
807
|
+
private getVolumeOfMesh;
|
|
808
|
+
private getSignedVolumeOfTriangle;
|
|
809
|
+
}
|
|
810
|
+
import * as THREE from "three";
|
|
811
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
812
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
813
|
+
/**
|
|
814
|
+
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
|
|
815
|
+
*/
|
|
816
|
+
export interface Classification {
|
|
817
|
+
/**
|
|
818
|
+
* A system within the classification.
|
|
819
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
820
|
+
*/
|
|
821
|
+
[system: string]: {
|
|
822
|
+
/**
|
|
823
|
+
* A class within the system.
|
|
824
|
+
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
825
|
+
*/
|
|
826
|
+
[className: string]: {
|
|
827
|
+
map: FRAGS.FragmentIdMap;
|
|
828
|
+
name: string;
|
|
829
|
+
id: number | null;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
835
|
+
*/
|
|
836
|
+
export declare class Classifier extends Component implements Disposable {
|
|
837
|
+
/**
|
|
838
|
+
* A unique identifier for the component.
|
|
839
|
+
* This UUID is used to register the component within the Components system.
|
|
840
|
+
*/
|
|
841
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
842
|
+
/** {@link Component.enabled} */
|
|
843
|
+
enabled: boolean;
|
|
844
|
+
/**
|
|
845
|
+
* A map representing the classification systems.
|
|
846
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
847
|
+
*/
|
|
848
|
+
list: Classification;
|
|
849
|
+
/** {@link Disposable.onDisposed} */
|
|
850
|
+
readonly onDisposed: Event<unknown>;
|
|
851
|
+
constructor(components: Components);
|
|
852
|
+
private onFragmentsDisposed;
|
|
853
|
+
/** {@link Disposable.dispose} */
|
|
854
|
+
dispose(): void;
|
|
855
|
+
/**
|
|
856
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
857
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
858
|
+
*
|
|
859
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
860
|
+
*/
|
|
861
|
+
remove(guid: string): void;
|
|
862
|
+
/**
|
|
863
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
864
|
+
* If no filter is provided, it returns all fragments.
|
|
865
|
+
*
|
|
866
|
+
* @param filter - An optional object containing filter criteria.
|
|
867
|
+
* The keys of the object represent the classification system names,
|
|
868
|
+
* and the values are arrays of class names to match.
|
|
838
869
|
*
|
|
839
870
|
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
840
871
|
* where the express IDs are filtered based on the provided filter criteria.
|
|
@@ -906,7 +937,9 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
906
937
|
* Classifies fragments based on their spatial structure in the IFC model.
|
|
907
938
|
*
|
|
908
939
|
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
909
|
-
* @param config - The configuration for the classifier. It includes "useProperties"
|
|
940
|
+
* @param config - The configuration for the classifier. It includes "useProperties", which is true by default
|
|
941
|
+
* (if false, the classification will use the expressIDs instead of the names), and "isolate", which will make
|
|
942
|
+
* the classifier just pick the WEBIFC categories provided.
|
|
910
943
|
*
|
|
911
944
|
* @remarks
|
|
912
945
|
* This method iterates through the relations of the fragments in the provided group,
|
|
@@ -917,7 +950,8 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
917
950
|
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
918
951
|
*/
|
|
919
952
|
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
920
|
-
useProperties
|
|
953
|
+
useProperties?: boolean;
|
|
954
|
+
isolate?: Set<number>;
|
|
921
955
|
}): Promise<void>;
|
|
922
956
|
/**
|
|
923
957
|
* Sets the color of the specified fragments.
|
|
@@ -947,208 +981,301 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
947
981
|
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
948
982
|
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
949
983
|
}
|
|
950
|
-
import
|
|
984
|
+
import * as THREE from "three";
|
|
985
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
986
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
987
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
951
988
|
/**
|
|
952
|
-
* The
|
|
989
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
953
990
|
*/
|
|
954
|
-
export declare class
|
|
955
|
-
|
|
956
|
-
* A unique identifier for the component.
|
|
957
|
-
* This UUID is used to register the component within the Components system.
|
|
958
|
-
*/
|
|
959
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
960
|
-
/** {@link Disposable.onDisposed} */
|
|
961
|
-
readonly onDisposed: Event<unknown>;
|
|
991
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
992
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
962
993
|
/** {@link Component.enabled} */
|
|
963
994
|
enabled: boolean;
|
|
995
|
+
/** {@link Disposable.onDisposed} */
|
|
996
|
+
readonly onDisposed: Event<unknown>;
|
|
997
|
+
private _absoluteMin;
|
|
998
|
+
private _absoluteMax;
|
|
999
|
+
private _meshes;
|
|
1000
|
+
constructor(components: Components);
|
|
964
1001
|
/**
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
1002
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
1003
|
+
*
|
|
1004
|
+
* @param bbox - The bounding box to calculate the dimensions for.
|
|
1005
|
+
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
968
1006
|
*/
|
|
969
|
-
|
|
1007
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
1008
|
+
width: number;
|
|
1009
|
+
height: number;
|
|
1010
|
+
depth: number;
|
|
1011
|
+
center: THREE.Vector3;
|
|
1012
|
+
};
|
|
970
1013
|
/**
|
|
971
|
-
*
|
|
972
|
-
*
|
|
973
|
-
*
|
|
1014
|
+
* A static method to create a new bounding box boundary.
|
|
1015
|
+
*
|
|
1016
|
+
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
1017
|
+
* @returns A new THREE.Vector3 representing the boundary.
|
|
1018
|
+
*
|
|
1019
|
+
* @remarks
|
|
1020
|
+
* This method is used to create a new boundary for calculating bounding boxes.
|
|
1021
|
+
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
1022
|
+
* depending on the value of the 'positive' parameter.
|
|
1023
|
+
*
|
|
1024
|
+
* @example
|
|
1025
|
+
* '''typescript
|
|
1026
|
+
* const positiveBound = BoundingBoxer.newBound(true);
|
|
1027
|
+
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
1028
|
+
*
|
|
1029
|
+
* const negativeBound = BoundingBoxer.newBound(false);
|
|
1030
|
+
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
1031
|
+
* '''
|
|
974
1032
|
*/
|
|
975
|
-
|
|
1033
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
976
1034
|
/**
|
|
977
|
-
* A
|
|
978
|
-
*
|
|
1035
|
+
* A static method to calculate the bounding box of a set of points.
|
|
1036
|
+
*
|
|
1037
|
+
* @param points - An array of THREE.Vector3 representing the points.
|
|
1038
|
+
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
1039
|
+
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
1040
|
+
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
1041
|
+
*
|
|
1042
|
+
* @remarks
|
|
1043
|
+
* This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
|
|
1044
|
+
* If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
|
|
1045
|
+
*
|
|
1046
|
+
* @example
|
|
1047
|
+
* '''typescript
|
|
1048
|
+
* const points = [
|
|
1049
|
+
* new THREE.Vector3(1, 2, 3),
|
|
1050
|
+
* new THREE.Vector3(4, 5, 6),
|
|
1051
|
+
* new THREE.Vector3(7, 8, 9),
|
|
1052
|
+
* ];
|
|
1053
|
+
*
|
|
1054
|
+
* const bbox = BoundingBoxer.getBounds(points);
|
|
1055
|
+
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
1056
|
+
* '''
|
|
979
1057
|
*/
|
|
980
|
-
|
|
981
|
-
constructor(components: Components);
|
|
1058
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
982
1059
|
/** {@link Disposable.dispose} */
|
|
983
1060
|
dispose(): void;
|
|
984
1061
|
/**
|
|
985
|
-
*
|
|
1062
|
+
* Returns the bounding box of the calculated fragments.
|
|
986
1063
|
*
|
|
987
|
-
* @
|
|
1064
|
+
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
988
1065
|
*
|
|
989
1066
|
* @remarks
|
|
990
|
-
* This method
|
|
991
|
-
*
|
|
992
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
993
|
-
*
|
|
994
|
-
* The method also keeps track of the exploded items using the 'list' set.
|
|
1067
|
+
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
1068
|
+
* The returned box represents the bounding box of the calculated fragments.
|
|
995
1069
|
*
|
|
996
|
-
* @
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
import { Components, Component } from "../../core";
|
|
1002
|
-
/**
|
|
1003
|
-
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1004
|
-
*/
|
|
1005
|
-
export declare class Hider extends Component {
|
|
1006
|
-
/**
|
|
1007
|
-
* A unique identifier for the component.
|
|
1008
|
-
* This UUID is used to register the component within the Components system.
|
|
1070
|
+
* @example
|
|
1071
|
+
* '''typescript
|
|
1072
|
+
* const boundingBox = boundingBoxer.get();
|
|
1073
|
+
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
1074
|
+
* '''
|
|
1009
1075
|
*/
|
|
1010
|
-
|
|
1011
|
-
/** {@link Component.enabled} */
|
|
1012
|
-
enabled: boolean;
|
|
1013
|
-
constructor(components: Components);
|
|
1076
|
+
get(): THREE.Box3;
|
|
1014
1077
|
/**
|
|
1015
|
-
*
|
|
1016
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1017
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1078
|
+
* Calculates and returns a sphere that encompasses the entire bounding box.
|
|
1018
1079
|
*
|
|
1019
|
-
* @
|
|
1020
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1021
|
-
* If not provided, all fragments will be affected.
|
|
1080
|
+
* @returns A new THREE.Sphere instance representing the calculated sphere.
|
|
1022
1081
|
*
|
|
1023
|
-
* @
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1028
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1029
|
-
*
|
|
1030
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1031
|
-
* If not provided, all fragments will be isolated.
|
|
1082
|
+
* @remarks
|
|
1083
|
+
* This method calculates the center and radius of a sphere that encompasses the entire bounding box.
|
|
1084
|
+
* The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
|
|
1085
|
+
* The radius is calculated as the distance from the center to the minimum bound.
|
|
1032
1086
|
*
|
|
1033
|
-
* @
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
import { IfcFragmentSettings } from "./src";
|
|
1041
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
1042
|
-
/**
|
|
1043
|
-
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1044
|
-
*/
|
|
1045
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
1046
|
-
/**
|
|
1047
|
-
* A unique identifier for the component.
|
|
1048
|
-
* This UUID is used to register the component within the Components system.
|
|
1049
|
-
*/
|
|
1050
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1051
|
-
/** {@link Disposable.onDisposed} */
|
|
1052
|
-
readonly onDisposed: Event<string>;
|
|
1053
|
-
/**
|
|
1054
|
-
* An event triggered when the IFC file starts loading.
|
|
1055
|
-
*/
|
|
1056
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
1057
|
-
/**
|
|
1058
|
-
* An event triggered when the setup process is completed.
|
|
1087
|
+
* @example
|
|
1088
|
+
* '''typescript
|
|
1089
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1090
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1091
|
+
* const boundingSphere = boundingBoxer.getSphere();
|
|
1092
|
+
* console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
|
|
1093
|
+
* '''
|
|
1059
1094
|
*/
|
|
1060
|
-
|
|
1095
|
+
getSphere(): THREE.Sphere;
|
|
1061
1096
|
/**
|
|
1062
|
-
*
|
|
1063
|
-
*
|
|
1097
|
+
* Returns a THREE.Mesh instance representing the bounding box.
|
|
1098
|
+
*
|
|
1099
|
+
* @returns A new THREE.Mesh instance representing the bounding box.
|
|
1100
|
+
*
|
|
1101
|
+
* @remarks
|
|
1102
|
+
* This method calculates the dimensions of the bounding box using the 'getDimensions' method.
|
|
1103
|
+
* It then creates a new THREE.BoxGeometry with the calculated dimensions.
|
|
1104
|
+
* A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
|
|
1105
|
+
* The position of the mesh is set to the center of the bounding box.
|
|
1106
|
+
*
|
|
1107
|
+
* @example
|
|
1108
|
+
* '''typescript
|
|
1109
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1110
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1111
|
+
* const boundingBoxMesh = boundingBoxer.getMesh();
|
|
1112
|
+
* scene.add(boundingBoxMesh);
|
|
1113
|
+
* '''
|
|
1064
1114
|
*/
|
|
1065
|
-
|
|
1115
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1066
1116
|
/**
|
|
1067
|
-
*
|
|
1117
|
+
* Resets the internal minimum and maximum vectors to positive and negative infinity, respectively.
|
|
1118
|
+
* This method is used to prepare the BoundingBoxer for a new set of fragments.
|
|
1119
|
+
*
|
|
1120
|
+
* @remarks
|
|
1121
|
+
* This method is called when a new set of fragments is added to the BoundingBoxer.
|
|
1122
|
+
* It ensures that the bounding box calculations are accurate and up-to-date.
|
|
1123
|
+
*
|
|
1124
|
+
* @example
|
|
1125
|
+
* '''typescript
|
|
1126
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1127
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1128
|
+
* // ...
|
|
1129
|
+
* boundingBoxer.reset();
|
|
1130
|
+
* '''
|
|
1068
1131
|
*/
|
|
1069
|
-
|
|
1070
|
-
/** {@link Component.enabled} */
|
|
1071
|
-
enabled: boolean;
|
|
1072
|
-
private _material;
|
|
1073
|
-
private _spatialTree;
|
|
1074
|
-
private _metaData;
|
|
1075
|
-
private _fragmentInstances;
|
|
1076
|
-
private _civil;
|
|
1077
|
-
private _visitedFragments;
|
|
1078
|
-
private _materialT;
|
|
1079
|
-
constructor(components: Components);
|
|
1080
|
-
/** {@link Disposable.dispose} */
|
|
1081
|
-
dispose(): void;
|
|
1132
|
+
reset(): void;
|
|
1082
1133
|
/**
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
* @param config - Optional configuration settings for the IfcLoader.
|
|
1086
|
-
* If not provided, the existing settings will be used.
|
|
1134
|
+
* Adds a FragmentsGroup to the BoundingBoxer.
|
|
1087
1135
|
*
|
|
1088
|
-
* @
|
|
1136
|
+
* @param group - The FragmentsGroup to add.
|
|
1089
1137
|
*
|
|
1090
1138
|
* @remarks
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1139
|
+
* This method iterates through each fragment in the provided FragmentsGroup,
|
|
1140
|
+
* and calls the 'addMesh' method for each fragment's mesh.
|
|
1093
1141
|
*
|
|
1094
1142
|
* @example
|
|
1095
1143
|
* '''typescript
|
|
1096
|
-
* const
|
|
1097
|
-
*
|
|
1144
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1145
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1098
1146
|
* '''
|
|
1099
1147
|
*/
|
|
1100
|
-
|
|
1148
|
+
add(group: FragmentsGroup): void;
|
|
1101
1149
|
/**
|
|
1102
|
-
*
|
|
1150
|
+
* Adds a mesh to the BoundingBoxer and calculates the bounding box.
|
|
1103
1151
|
*
|
|
1104
|
-
* @param
|
|
1105
|
-
* @param
|
|
1152
|
+
* @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
|
|
1153
|
+
* @param itemIDs - An optional iterable of numbers representing the item IDs.
|
|
1106
1154
|
*
|
|
1107
|
-
* @
|
|
1155
|
+
* @remarks
|
|
1156
|
+
* This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
|
|
1157
|
+
* If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
|
|
1158
|
+
* If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
|
|
1108
1159
|
*
|
|
1109
1160
|
* @example
|
|
1110
1161
|
* '''typescript
|
|
1111
|
-
* const
|
|
1112
|
-
*
|
|
1162
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1163
|
+
* boundingBoxer.addMesh(mesh);
|
|
1113
1164
|
* '''
|
|
1114
1165
|
*/
|
|
1115
|
-
|
|
1166
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
1116
1167
|
/**
|
|
1117
|
-
*
|
|
1168
|
+
* Uses a FragmentIdMap to add its meshes to the bb calculation.
|
|
1118
1169
|
*
|
|
1119
|
-
*
|
|
1170
|
+
* This method iterates through the provided 'fragmentIdMap', retrieves the corresponding fragment from the 'FragmentsManager',
|
|
1171
|
+
* and then calls the 'addMesh' method for each fragment's mesh, passing the expression IDs as the second parameter.
|
|
1120
1172
|
*
|
|
1121
|
-
* @
|
|
1173
|
+
* @param fragmentIdMap - A mapping of fragment IDs to their corresponding expression IDs.
|
|
1122
1174
|
*
|
|
1123
1175
|
* @remarks
|
|
1124
|
-
* This method
|
|
1125
|
-
* It
|
|
1176
|
+
* This method is used to add a mapping of fragment IDs to their corresponding expression IDs.
|
|
1177
|
+
* It ensures that the bounding box calculations are accurate and up-to-date by updating the internal minimum and maximum vectors.
|
|
1126
1178
|
*
|
|
1127
1179
|
* @example
|
|
1128
1180
|
* '''typescript
|
|
1129
|
-
* const
|
|
1130
|
-
*
|
|
1181
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1182
|
+
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
1183
|
+
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
1184
|
+
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
1185
|
+
* };
|
|
1186
|
+
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
1131
1187
|
* '''
|
|
1132
1188
|
*/
|
|
1133
|
-
|
|
1189
|
+
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
1190
|
+
private static getFragmentBounds;
|
|
1191
|
+
}
|
|
1192
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1193
|
+
import { Components, Component } from "../../core";
|
|
1194
|
+
/**
|
|
1195
|
+
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1196
|
+
*/
|
|
1197
|
+
export declare class Hider extends Component {
|
|
1134
1198
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1199
|
+
* A unique identifier for the component.
|
|
1200
|
+
* This UUID is used to register the component within the Components system.
|
|
1201
|
+
*/
|
|
1202
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1203
|
+
/** {@link Component.enabled} */
|
|
1204
|
+
enabled: boolean;
|
|
1205
|
+
constructor(components: Components);
|
|
1206
|
+
/**
|
|
1207
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1208
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1209
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1210
|
+
*
|
|
1211
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1212
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1213
|
+
* If not provided, all fragments will be affected.
|
|
1214
|
+
*
|
|
1215
|
+
* @returns {void}
|
|
1216
|
+
*/
|
|
1217
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1218
|
+
/**
|
|
1219
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1220
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1221
|
+
*
|
|
1222
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1223
|
+
* If not provided, all fragments will be isolated.
|
|
1224
|
+
*
|
|
1225
|
+
* @returns {void}
|
|
1226
|
+
*/
|
|
1227
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1228
|
+
private updateCulledVisibility;
|
|
1229
|
+
}
|
|
1230
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1231
|
+
/**
|
|
1232
|
+
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
1233
|
+
*/
|
|
1234
|
+
export declare class Exploder extends Component implements Disposable {
|
|
1235
|
+
/**
|
|
1236
|
+
* A unique identifier for the component.
|
|
1237
|
+
* This UUID is used to register the component within the Components system.
|
|
1238
|
+
*/
|
|
1239
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1240
|
+
/** {@link Disposable.onDisposed} */
|
|
1241
|
+
readonly onDisposed: Event<unknown>;
|
|
1242
|
+
/** {@link Component.enabled} */
|
|
1243
|
+
enabled: boolean;
|
|
1244
|
+
/**
|
|
1245
|
+
* The height of the explosion animation.
|
|
1246
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1247
|
+
* Default value is 10.
|
|
1248
|
+
*/
|
|
1249
|
+
height: number;
|
|
1250
|
+
/**
|
|
1251
|
+
* The group name used for the explosion animation.
|
|
1252
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1253
|
+
* Default value is "storeys".
|
|
1254
|
+
*/
|
|
1255
|
+
groupName: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* A set of strings representing the exploded items.
|
|
1258
|
+
* This set is used to keep track of which items have been exploded.
|
|
1259
|
+
*/
|
|
1260
|
+
list: Set<string>;
|
|
1261
|
+
constructor(components: Components);
|
|
1262
|
+
/** {@link Disposable.dispose} */
|
|
1263
|
+
dispose(): void;
|
|
1264
|
+
/**
|
|
1265
|
+
* Sets the explosion state of the fragments.
|
|
1266
|
+
*
|
|
1267
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1137
1268
|
*
|
|
1138
1269
|
* @remarks
|
|
1139
|
-
* This method
|
|
1270
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1271
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1272
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1140
1273
|
*
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
* ifcLoader.cleanUp();
|
|
1145
|
-
* '''
|
|
1274
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1275
|
+
*
|
|
1276
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1146
1277
|
*/
|
|
1147
|
-
|
|
1148
|
-
private getAllGeometries;
|
|
1149
|
-
private getMesh;
|
|
1150
|
-
private getGeometry;
|
|
1151
|
-
private autoSetWasm;
|
|
1278
|
+
set(active: boolean): void;
|
|
1152
1279
|
}
|
|
1153
1280
|
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1154
1281
|
import * as THREE from "three";
|
|
@@ -1277,17 +1404,132 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
1277
1404
|
applyBaseCoordinateSystem(object: THREE.Object3D | THREE.Vector3, originalCoordinateSystem: THREE.Matrix4): void;
|
|
1278
1405
|
}
|
|
1279
1406
|
import * as WEBIFC from "web-ifc";
|
|
1280
|
-
import
|
|
1281
|
-
import {
|
|
1407
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1408
|
+
import { IfcFragmentSettings } from "./src";
|
|
1409
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1282
1410
|
/**
|
|
1283
|
-
*
|
|
1411
|
+
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1284
1412
|
*/
|
|
1285
|
-
export declare class
|
|
1413
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1286
1414
|
/**
|
|
1287
1415
|
* A unique identifier for the component.
|
|
1288
1416
|
* This UUID is used to register the component within the Components system.
|
|
1289
1417
|
*/
|
|
1290
|
-
static readonly uuid: "
|
|
1418
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1419
|
+
/** {@link Disposable.onDisposed} */
|
|
1420
|
+
readonly onDisposed: Event<string>;
|
|
1421
|
+
/**
|
|
1422
|
+
* An event triggered when the IFC file starts loading.
|
|
1423
|
+
*/
|
|
1424
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1425
|
+
/**
|
|
1426
|
+
* An event triggered when the setup process is completed.
|
|
1427
|
+
*/
|
|
1428
|
+
readonly onSetup: Event<void>;
|
|
1429
|
+
/**
|
|
1430
|
+
* The settings for the IfcLoader.
|
|
1431
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1432
|
+
*/
|
|
1433
|
+
settings: IfcFragmentSettings;
|
|
1434
|
+
/**
|
|
1435
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1436
|
+
*/
|
|
1437
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1438
|
+
/** {@link Component.enabled} */
|
|
1439
|
+
enabled: boolean;
|
|
1440
|
+
private _material;
|
|
1441
|
+
private _spatialTree;
|
|
1442
|
+
private _metaData;
|
|
1443
|
+
private _fragmentInstances;
|
|
1444
|
+
private _civil;
|
|
1445
|
+
private _visitedFragments;
|
|
1446
|
+
private _materialT;
|
|
1447
|
+
constructor(components: Components);
|
|
1448
|
+
/** {@link Disposable.dispose} */
|
|
1449
|
+
dispose(): void;
|
|
1450
|
+
/**
|
|
1451
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1452
|
+
*
|
|
1453
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
1454
|
+
* If not provided, the existing settings will be used.
|
|
1455
|
+
*
|
|
1456
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
1457
|
+
*
|
|
1458
|
+
* @remarks
|
|
1459
|
+
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1460
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1461
|
+
*
|
|
1462
|
+
* @example
|
|
1463
|
+
* '''typescript
|
|
1464
|
+
* const ifcLoader = new IfcLoader(components);
|
|
1465
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1466
|
+
* '''
|
|
1467
|
+
*/
|
|
1468
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1469
|
+
/**
|
|
1470
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
1471
|
+
*
|
|
1472
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1473
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1474
|
+
*
|
|
1475
|
+
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1476
|
+
*
|
|
1477
|
+
* @example
|
|
1478
|
+
* '''typescript
|
|
1479
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1480
|
+
* const group = await ifcLoader.load(ifcData);
|
|
1481
|
+
* '''
|
|
1482
|
+
*/
|
|
1483
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
1486
|
+
*
|
|
1487
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1488
|
+
*
|
|
1489
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1490
|
+
*
|
|
1491
|
+
* @remarks
|
|
1492
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1493
|
+
* It also opens the IFC model using the provided data and settings.
|
|
1494
|
+
*
|
|
1495
|
+
* @example
|
|
1496
|
+
* '''typescript
|
|
1497
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1498
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
1499
|
+
* '''
|
|
1500
|
+
*/
|
|
1501
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1502
|
+
/**
|
|
1503
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1504
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1505
|
+
*
|
|
1506
|
+
* @remarks
|
|
1507
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1508
|
+
*
|
|
1509
|
+
* @example
|
|
1510
|
+
* '''typescript
|
|
1511
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1512
|
+
* ifcLoader.cleanUp();
|
|
1513
|
+
* '''
|
|
1514
|
+
*/
|
|
1515
|
+
cleanUp(): void;
|
|
1516
|
+
private getAllGeometries;
|
|
1517
|
+
private getMesh;
|
|
1518
|
+
private getGeometry;
|
|
1519
|
+
private autoSetWasm;
|
|
1520
|
+
}
|
|
1521
|
+
import * as WEBIFC from "web-ifc";
|
|
1522
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1523
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1524
|
+
/**
|
|
1525
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1526
|
+
*/
|
|
1527
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1528
|
+
/**
|
|
1529
|
+
* A unique identifier for the component.
|
|
1530
|
+
* This UUID is used to register the component within the Components system.
|
|
1531
|
+
*/
|
|
1532
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1291
1533
|
/**
|
|
1292
1534
|
* Event triggered when geometry is streamed.
|
|
1293
1535
|
* Contains the streamed geometry data and its buffer.
|
|
@@ -1439,24 +1681,6 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
1439
1681
|
private streamAllProperties;
|
|
1440
1682
|
private cleanUp;
|
|
1441
1683
|
}
|
|
1442
|
-
import * as THREE from "three";
|
|
1443
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1444
|
-
center: THREE.Vector3;
|
|
1445
|
-
halfSizes: THREE.Vector3;
|
|
1446
|
-
rotation: THREE.Matrix3;
|
|
1447
|
-
transformation: THREE.Matrix4;
|
|
1448
|
-
};
|
|
1449
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1450
|
-
import * as THREE from "three";
|
|
1451
|
-
export declare class MaterialsUtils {
|
|
1452
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
1453
|
-
}
|
|
1454
|
-
export declare class UUID {
|
|
1455
|
-
private static _pattern;
|
|
1456
|
-
private static _lut;
|
|
1457
|
-
static create(): string;
|
|
1458
|
-
static validate(uuid: string): void;
|
|
1459
|
-
}
|
|
1460
1684
|
import * as WEBIFC from "web-ifc";
|
|
1461
1685
|
import * as FRAG from "@thatopen/fragments";
|
|
1462
1686
|
import { Component, Components } from "../../core";
|
|
@@ -1482,122 +1706,6 @@ export declare class IfcJsonExporter extends Component {
|
|
|
1482
1706
|
*/
|
|
1483
1707
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1484
1708
|
}
|
|
1485
|
-
import * as THREE from "three";
|
|
1486
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1487
|
-
/**
|
|
1488
|
-
* Configuration interface for the VertexPicker component.
|
|
1489
|
-
*/
|
|
1490
|
-
export interface VertexPickerConfig {
|
|
1491
|
-
/**
|
|
1492
|
-
* If true, only vertices will be picked, not the closest point on the face.
|
|
1493
|
-
*/
|
|
1494
|
-
showOnlyVertex: boolean;
|
|
1495
|
-
/**
|
|
1496
|
-
* The maximum distance for snapping to a vertex.
|
|
1497
|
-
*/
|
|
1498
|
-
snapDistance: number;
|
|
1499
|
-
/**
|
|
1500
|
-
* The HTML element to use for previewing the picked vertex.
|
|
1501
|
-
*/
|
|
1502
|
-
previewElement: HTMLElement;
|
|
1503
|
-
}
|
|
1504
|
-
/**
|
|
1505
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1506
|
-
*/
|
|
1507
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
1508
|
-
/** {@link Disposable.onDisposed} */
|
|
1509
|
-
readonly onDisposed: Event<unknown>;
|
|
1510
|
-
/**
|
|
1511
|
-
* An event that is triggered when a vertex is found.
|
|
1512
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1513
|
-
*/
|
|
1514
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1515
|
-
/**
|
|
1516
|
-
* An event that is triggered when a vertex is lost.
|
|
1517
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1518
|
-
*/
|
|
1519
|
-
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1520
|
-
/**
|
|
1521
|
-
* An event that is triggered when the picker is enabled or disabled
|
|
1522
|
-
*/
|
|
1523
|
-
readonly onEnabled: Event<boolean>;
|
|
1524
|
-
/**
|
|
1525
|
-
* A reference to the Components instance associated with this VertexPicker.
|
|
1526
|
-
*/
|
|
1527
|
-
components: Components;
|
|
1528
|
-
/**
|
|
1529
|
-
* A reference to the working plane used for vertex picking.
|
|
1530
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
1531
|
-
* If this value is null, all vertices are considered valid.
|
|
1532
|
-
*/
|
|
1533
|
-
workingPlane: THREE.Plane | null;
|
|
1534
|
-
private _pickedPoint;
|
|
1535
|
-
private _config;
|
|
1536
|
-
private _enabled;
|
|
1537
|
-
/**
|
|
1538
|
-
* Sets the enabled state of the VertexPicker.
|
|
1539
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1540
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1541
|
-
*
|
|
1542
|
-
* @param value - The new enabled state.
|
|
1543
|
-
*/
|
|
1544
|
-
set enabled(value: boolean);
|
|
1545
|
-
/**
|
|
1546
|
-
* Gets the current enabled state of the VertexPicker.
|
|
1547
|
-
*
|
|
1548
|
-
* @returns The current enabled state.
|
|
1549
|
-
*/
|
|
1550
|
-
get enabled(): boolean;
|
|
1551
|
-
/**
|
|
1552
|
-
* Sets the configuration for the VertexPicker component.
|
|
1553
|
-
*
|
|
1554
|
-
* @param value - A Partial object containing the configuration properties to update.
|
|
1555
|
-
* The properties not provided in the value object will retain their current values.
|
|
1556
|
-
*
|
|
1557
|
-
* @example
|
|
1558
|
-
* '''typescript
|
|
1559
|
-
* vertexPicker.config = {
|
|
1560
|
-
* snapDistance: 0.5,
|
|
1561
|
-
* showOnlyVertex: true,
|
|
1562
|
-
* };
|
|
1563
|
-
* '''
|
|
1564
|
-
*/
|
|
1565
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
1566
|
-
/**
|
|
1567
|
-
* Gets the current configuration for the VertexPicker component.
|
|
1568
|
-
*
|
|
1569
|
-
* @returns A copy of the current VertexPickerConfig object.
|
|
1570
|
-
*
|
|
1571
|
-
* @example
|
|
1572
|
-
* '''typescript
|
|
1573
|
-
* const currentConfig = vertexPicker.config;
|
|
1574
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1575
|
-
* '''
|
|
1576
|
-
*/
|
|
1577
|
-
get config(): Partial<VertexPickerConfig>;
|
|
1578
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
1579
|
-
/** {@link Disposable.dispose} */
|
|
1580
|
-
dispose(): void;
|
|
1581
|
-
/**
|
|
1582
|
-
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
1583
|
-
*
|
|
1584
|
-
* @param world - The World instance to use for raycasting.
|
|
1585
|
-
*
|
|
1586
|
-
* @returns The current picked point, or null if no point is picked.
|
|
1587
|
-
*
|
|
1588
|
-
* @remarks
|
|
1589
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
1590
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
1591
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
1592
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
1593
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
1594
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1595
|
-
*/
|
|
1596
|
-
get(world: World): THREE.Vector3 | null;
|
|
1597
|
-
private getClosestVertex;
|
|
1598
|
-
private getVertices;
|
|
1599
|
-
private getVertex;
|
|
1600
|
-
}
|
|
1601
1709
|
import * as WEBIFC from "web-ifc";
|
|
1602
1710
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1603
1711
|
import { Disposable, Event, Component, Components } from "../../core";
|
|
@@ -2018,114 +2126,9 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
2018
2126
|
private newSingleProperty;
|
|
2019
2127
|
}
|
|
2020
2128
|
import * as THREE from "three";
|
|
2021
|
-
import
|
|
2022
|
-
import { Component, Components } from "../../core";
|
|
2129
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2023
2130
|
/**
|
|
2024
|
-
*
|
|
2025
|
-
*/
|
|
2026
|
-
export interface MeasureEdge {
|
|
2027
|
-
/**
|
|
2028
|
-
* The distance between the two points of the edge.
|
|
2029
|
-
*/
|
|
2030
|
-
distance: number;
|
|
2031
|
-
/**
|
|
2032
|
-
* The two points that define the edge.
|
|
2033
|
-
*/
|
|
2034
|
-
points: THREE.Vector3[];
|
|
2035
|
-
}
|
|
2036
|
-
/**
|
|
2037
|
-
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
2038
|
-
*/
|
|
2039
|
-
export declare class MeasurementUtils extends Component {
|
|
2040
|
-
/**
|
|
2041
|
-
* A unique identifier for the component.
|
|
2042
|
-
* This UUID is used to register the component within the Components system.
|
|
2043
|
-
*/
|
|
2044
|
-
static uuid: string;
|
|
2045
|
-
/** {@link Component.enabled} */
|
|
2046
|
-
enabled: boolean;
|
|
2047
|
-
constructor(components: Components);
|
|
2048
|
-
/**
|
|
2049
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
2050
|
-
*
|
|
2051
|
-
* @param point - The point from which to calculate the distance.
|
|
2052
|
-
* @param lineStart - The start point of the line segment.
|
|
2053
|
-
* @param lineEnd - The end point of the line segment.
|
|
2054
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
2055
|
-
* @returns The distance from the point to the line segment.
|
|
2056
|
-
*/
|
|
2057
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
2058
|
-
/**
|
|
2059
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
2060
|
-
* It also returns the edges of the found face and their indices.
|
|
2061
|
-
*
|
|
2062
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
2063
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
2064
|
-
* @param instance - The instance of the mesh (optional).
|
|
2065
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
2066
|
-
*/
|
|
2067
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
2068
|
-
edges: MeasureEdge[];
|
|
2069
|
-
indices: Set<number>;
|
|
2070
|
-
} | null;
|
|
2071
|
-
/**
|
|
2072
|
-
* Method to get the vertices and normal of a mesh face at a given index.
|
|
2073
|
-
* It also applies instance transformation if provided.
|
|
2074
|
-
*
|
|
2075
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
2076
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
2077
|
-
* @param instance - The instance of the mesh (optional).
|
|
2078
|
-
* @returns An object containing the vertices and normal of the face.
|
|
2079
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
2080
|
-
*/
|
|
2081
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
2082
|
-
p1: THREE.Vector3;
|
|
2083
|
-
p2: THREE.Vector3;
|
|
2084
|
-
p3: THREE.Vector3;
|
|
2085
|
-
faceNormal: THREE.Vector3;
|
|
2086
|
-
};
|
|
2087
|
-
/**
|
|
2088
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
2089
|
-
* This is used to ensure numerical precision in edge detection.
|
|
2090
|
-
*
|
|
2091
|
-
* @param vector - The vector to round.
|
|
2092
|
-
* @returns The vector with rounded components.
|
|
2093
|
-
*/
|
|
2094
|
-
round(vector: THREE.Vector3): void;
|
|
2095
|
-
/**
|
|
2096
|
-
* Calculates the volume of a set of fragments.
|
|
2097
|
-
*
|
|
2098
|
-
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
2099
|
-
* @returns The total volume of the fragments and the bounding sphere.
|
|
2100
|
-
*
|
|
2101
|
-
* @remarks
|
|
2102
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
2103
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
2104
|
-
*
|
|
2105
|
-
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
2106
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
2107
|
-
*/
|
|
2108
|
-
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
2109
|
-
/**
|
|
2110
|
-
* Calculates the total volume of a set of meshes.
|
|
2111
|
-
*
|
|
2112
|
-
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
2113
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
2114
|
-
*
|
|
2115
|
-
* @remarks
|
|
2116
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
2117
|
-
* and its bounding sphere.
|
|
2118
|
-
*
|
|
2119
|
-
*/
|
|
2120
|
-
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
2121
|
-
private getFaceData;
|
|
2122
|
-
private getVolumeOfMesh;
|
|
2123
|
-
private getSignedVolumeOfTriangle;
|
|
2124
|
-
}
|
|
2125
|
-
import * as THREE from "three";
|
|
2126
|
-
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2127
|
-
/**
|
|
2128
|
-
* A class representing a 2D minimap of a 3D world.
|
|
2131
|
+
* A class representing a 2D minimap of a 3D world.
|
|
2129
2132
|
*/
|
|
2130
2133
|
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
2131
2134
|
/** {@link Disposable.onDisposed} */
|
|
@@ -2211,10 +2214,32 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2211
2214
|
resize(size?: THREE.Vector2): void;
|
|
2212
2215
|
private updatePlanes;
|
|
2213
2216
|
}
|
|
2217
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2218
|
+
import * as WEBIFC from "web-ifc";
|
|
2219
|
+
export declare class SpatialIdsFinder {
|
|
2220
|
+
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2221
|
+
}
|
|
2222
|
+
import * as WEBIFC from "web-ifc";
|
|
2223
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2224
|
+
export declare class SpatialStructure {
|
|
2225
|
+
itemsByFloor: IfcItemsCategories;
|
|
2226
|
+
private _units;
|
|
2227
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2228
|
+
cleanUp(): void;
|
|
2229
|
+
}
|
|
2214
2230
|
/**
|
|
2215
|
-
* A
|
|
2231
|
+
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2216
2232
|
*/
|
|
2217
|
-
export declare const
|
|
2233
|
+
export declare const IfcCategoryMap: {
|
|
2234
|
+
[key: number]: string;
|
|
2235
|
+
};
|
|
2236
|
+
import * as WEBIFC from "web-ifc";
|
|
2237
|
+
export interface IfcItemsCategories {
|
|
2238
|
+
[itemID: number]: number;
|
|
2239
|
+
}
|
|
2240
|
+
export declare class IfcCategories {
|
|
2241
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2242
|
+
}
|
|
2218
2243
|
import * as WEBIFC from "web-ifc";
|
|
2219
2244
|
/** Configuration of the IFC-fragment conversion. */
|
|
2220
2245
|
export declare class IfcFragmentSettings {
|
|
@@ -2256,21 +2281,6 @@ export declare class IfcFragmentSettings {
|
|
|
2256
2281
|
*/
|
|
2257
2282
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2258
2283
|
}
|
|
2259
|
-
import * as WEBIFC from "web-ifc";
|
|
2260
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
2261
|
-
export declare class SpatialStructure {
|
|
2262
|
-
itemsByFloor: IfcItemsCategories;
|
|
2263
|
-
private _units;
|
|
2264
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2265
|
-
cleanUp(): void;
|
|
2266
|
-
}
|
|
2267
|
-
import * as WEBIFC from "web-ifc";
|
|
2268
|
-
export interface IfcItemsCategories {
|
|
2269
|
-
[itemID: number]: number;
|
|
2270
|
-
}
|
|
2271
|
-
export declare class IfcCategories {
|
|
2272
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2273
|
-
}
|
|
2274
2284
|
/**
|
|
2275
2285
|
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2276
2286
|
*
|
|
@@ -2282,12 +2292,6 @@ export declare class IfcCategories {
|
|
|
2282
2292
|
export declare const IfcElements: {
|
|
2283
2293
|
[key: number]: string;
|
|
2284
2294
|
};
|
|
2285
|
-
/**
|
|
2286
|
-
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2287
|
-
*/
|
|
2288
|
-
export declare const IfcCategoryMap: {
|
|
2289
|
-
[key: number]: string;
|
|
2290
|
-
};
|
|
2291
2295
|
import * as FRAGS from "@thatopen/fragments";
|
|
2292
2296
|
export declare class IfcPropertiesUtils {
|
|
2293
2297
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2313,90 +2317,239 @@ export declare class IfcPropertiesUtils {
|
|
|
2313
2317
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2314
2318
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2315
2319
|
}
|
|
2320
|
+
import * as THREE from "three";
|
|
2321
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2322
|
+
import { Components } from "../../Components";
|
|
2316
2323
|
/**
|
|
2317
|
-
*
|
|
2324
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
2318
2325
|
*/
|
|
2319
|
-
export
|
|
2326
|
+
export interface GridConfig {
|
|
2320
2327
|
/**
|
|
2321
|
-
*
|
|
2322
|
-
* @param handler - the callback to be added to this event.
|
|
2328
|
+
* The color of the grid lines.
|
|
2323
2329
|
*/
|
|
2324
|
-
|
|
2325
|
-
(): void;
|
|
2326
|
-
} : {
|
|
2327
|
-
(data: T): void;
|
|
2328
|
-
}): void;
|
|
2330
|
+
color: THREE.Color;
|
|
2329
2331
|
/**
|
|
2330
|
-
*
|
|
2331
|
-
* @param handler - the callback to be removed from this event.
|
|
2332
|
+
* The size of the primary grid lines.
|
|
2332
2333
|
*/
|
|
2333
|
-
|
|
2334
|
-
(): void;
|
|
2335
|
-
} : {
|
|
2336
|
-
(data: T): void;
|
|
2337
|
-
}): void;
|
|
2338
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2339
|
-
trigger: (data?: T) => void;
|
|
2340
|
-
/** Gets rid of all the suscribed events. */
|
|
2341
|
-
reset(): void;
|
|
2342
|
-
private handlers;
|
|
2343
|
-
}
|
|
2344
|
-
/**
|
|
2345
|
-
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2346
|
-
*/
|
|
2347
|
-
export declare class AsyncEvent<T> {
|
|
2334
|
+
size1: number;
|
|
2348
2335
|
/**
|
|
2349
|
-
*
|
|
2350
|
-
* @param handler - the callback to be added to this event.
|
|
2336
|
+
* The size of the secondary grid lines.
|
|
2351
2337
|
*/
|
|
2352
|
-
|
|
2353
|
-
(): Promise<void>;
|
|
2354
|
-
} : {
|
|
2355
|
-
(data: T): Promise<void>;
|
|
2356
|
-
}): void;
|
|
2338
|
+
size2: number;
|
|
2357
2339
|
/**
|
|
2358
|
-
*
|
|
2359
|
-
* @param handler - the callback to be removed from this event.
|
|
2340
|
+
* The distance at which the grid lines start to fade away.
|
|
2360
2341
|
*/
|
|
2361
|
-
|
|
2362
|
-
(): Promise<void>;
|
|
2363
|
-
} : {
|
|
2364
|
-
(data: T): Promise<void>;
|
|
2365
|
-
}): void;
|
|
2366
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2367
|
-
trigger: (data?: T) => Promise<void>;
|
|
2368
|
-
/** Gets rid of all the suscribed events. */
|
|
2369
|
-
reset(): void;
|
|
2370
|
-
private handlers;
|
|
2342
|
+
distance: number;
|
|
2371
2343
|
}
|
|
2372
|
-
import * as THREE from "three";
|
|
2373
|
-
import CameraControls from "camera-controls";
|
|
2374
|
-
import { Event } from "./event";
|
|
2375
2344
|
/**
|
|
2376
|
-
*
|
|
2345
|
+
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
2377
2346
|
*/
|
|
2378
|
-
export
|
|
2347
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2348
|
+
/** {@link Disposable.onDisposed} */
|
|
2349
|
+
readonly onDisposed: Event<unknown>;
|
|
2350
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2351
|
+
world: World;
|
|
2352
|
+
/** The components instance to which this grid belongs. */
|
|
2353
|
+
components: Components;
|
|
2354
|
+
/** {@link Hideable.visible} */
|
|
2355
|
+
get visible(): boolean;
|
|
2356
|
+
/** {@link Hideable.visible} */
|
|
2357
|
+
set visible(visible: boolean);
|
|
2358
|
+
/** The material of the grid. */
|
|
2359
|
+
get material(): THREE.ShaderMaterial;
|
|
2379
2360
|
/**
|
|
2380
|
-
*
|
|
2381
|
-
*
|
|
2361
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2362
|
+
* perspective cameras and false for orthographic cameras.
|
|
2382
2363
|
*/
|
|
2383
|
-
|
|
2384
|
-
/** Fired after the tool has been disposed. */
|
|
2385
|
-
readonly onDisposed: Event<any>;
|
|
2386
|
-
}
|
|
2387
|
-
/**
|
|
2388
|
-
* Whether the geometric representation of this component can be hidden or shown in the [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
2389
|
-
*/
|
|
2390
|
-
export interface Hideable {
|
|
2364
|
+
get fade(): boolean;
|
|
2391
2365
|
/**
|
|
2392
|
-
* Whether the
|
|
2393
|
-
*
|
|
2394
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
2366
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2367
|
+
* perspective cameras and false for orthographic cameras.
|
|
2395
2368
|
*/
|
|
2396
|
-
|
|
2369
|
+
set fade(active: boolean);
|
|
2370
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2371
|
+
readonly three: THREE.Mesh;
|
|
2372
|
+
private _fade;
|
|
2373
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2374
|
+
/** {@link Disposable.dispose} */
|
|
2375
|
+
dispose(): void;
|
|
2376
|
+
private setupEvents;
|
|
2377
|
+
private updateZoom;
|
|
2397
2378
|
}
|
|
2379
|
+
import { NavigationMode } from "./types";
|
|
2380
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2398
2381
|
/**
|
|
2399
|
-
*
|
|
2382
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
2383
|
+
*/
|
|
2384
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
2385
|
+
private camera;
|
|
2386
|
+
/** {@link NavigationMode.enabled} */
|
|
2387
|
+
enabled: boolean;
|
|
2388
|
+
/** {@link NavigationMode.id} */
|
|
2389
|
+
readonly id = "FirstPerson";
|
|
2390
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2391
|
+
/** {@link NavigationMode.set} */
|
|
2392
|
+
set(active: boolean): void;
|
|
2393
|
+
private setupFirstPersonCamera;
|
|
2394
|
+
}
|
|
2395
|
+
import { NavigationMode } from "./types";
|
|
2396
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2397
|
+
/**
|
|
2398
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2399
|
+
*/
|
|
2400
|
+
export declare class OrbitMode implements NavigationMode {
|
|
2401
|
+
camera: OrthoPerspectiveCamera;
|
|
2402
|
+
/** {@link NavigationMode.enabled} */
|
|
2403
|
+
enabled: boolean;
|
|
2404
|
+
/** {@link NavigationMode.id} */
|
|
2405
|
+
readonly id = "Orbit";
|
|
2406
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2407
|
+
/** {@link NavigationMode.set} */
|
|
2408
|
+
set(active: boolean): void;
|
|
2409
|
+
private activateOrbitControls;
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2413
|
+
*/
|
|
2414
|
+
export declare const GeometryTypes: Set<number>;
|
|
2415
|
+
import { NavigationMode } from "./types";
|
|
2416
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2417
|
+
/**
|
|
2418
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
2419
|
+
*/
|
|
2420
|
+
export declare class PlanMode implements NavigationMode {
|
|
2421
|
+
private camera;
|
|
2422
|
+
/** {@link NavigationMode.enabled} */
|
|
2423
|
+
enabled: boolean;
|
|
2424
|
+
/** {@link NavigationMode.id} */
|
|
2425
|
+
readonly id = "Plan";
|
|
2426
|
+
private mouseAction1?;
|
|
2427
|
+
private mouseAction2?;
|
|
2428
|
+
private mouseInitialized;
|
|
2429
|
+
private readonly defaultAzimuthSpeed;
|
|
2430
|
+
private readonly defaultPolarSpeed;
|
|
2431
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2432
|
+
/** {@link NavigationMode.set} */
|
|
2433
|
+
set(active: boolean): void;
|
|
2434
|
+
}
|
|
2435
|
+
/**
|
|
2436
|
+
* The projection system of the camera.
|
|
2437
|
+
*/
|
|
2438
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
2439
|
+
/**
|
|
2440
|
+
* The extensible list of supported navigation modes.
|
|
2441
|
+
*/
|
|
2442
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
2443
|
+
/**
|
|
2444
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
2445
|
+
*/
|
|
2446
|
+
export interface NavigationMode {
|
|
2447
|
+
/** The unique ID of this navigation mode. */
|
|
2448
|
+
id: NavModeID;
|
|
2449
|
+
/**
|
|
2450
|
+
* Enable or disable this navigation mode.
|
|
2451
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
2452
|
+
* must be disabled.
|
|
2453
|
+
*
|
|
2454
|
+
* @param active - whether to enable or disable this mode.
|
|
2455
|
+
* @param options - any additional data required to enable or disable it.
|
|
2456
|
+
* */
|
|
2457
|
+
set: (active: boolean, options?: any) => void;
|
|
2458
|
+
/** Whether this navigation mode is active or not. */
|
|
2459
|
+
enabled: boolean;
|
|
2460
|
+
}
|
|
2461
|
+
import * as THREE from "three";
|
|
2462
|
+
import { CameraProjection } from "./types";
|
|
2463
|
+
import { Event } from "../../Types";
|
|
2464
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2465
|
+
/**
|
|
2466
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2467
|
+
*/
|
|
2468
|
+
export declare class ProjectionManager {
|
|
2469
|
+
/**
|
|
2470
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
2471
|
+
*/
|
|
2472
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2473
|
+
/**
|
|
2474
|
+
* Current projection mode of the camera.
|
|
2475
|
+
* Default is "Perspective".
|
|
2476
|
+
*/
|
|
2477
|
+
current: CameraProjection;
|
|
2478
|
+
/**
|
|
2479
|
+
* The camera controlled by this ProjectionManager.
|
|
2480
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2481
|
+
*/
|
|
2482
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2483
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
2484
|
+
matchOrthoDistanceEnabled: boolean;
|
|
2485
|
+
private _component;
|
|
2486
|
+
private _previousDistance;
|
|
2487
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2488
|
+
/**
|
|
2489
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2490
|
+
*
|
|
2491
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
2492
|
+
* it will have no effect.
|
|
2493
|
+
*/
|
|
2494
|
+
set(projection: CameraProjection): Promise<void>;
|
|
2495
|
+
/**
|
|
2496
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
2497
|
+
* and vice versa.
|
|
2498
|
+
*/
|
|
2499
|
+
toggle(): Promise<void>;
|
|
2500
|
+
private setOrthoCamera;
|
|
2501
|
+
private getPerspectiveDims;
|
|
2502
|
+
private setupOrthoCamera;
|
|
2503
|
+
private getDistance;
|
|
2504
|
+
private setPerspectiveCamera;
|
|
2505
|
+
}
|
|
2506
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2507
|
+
import { Components } from "../../Components";
|
|
2508
|
+
/**
|
|
2509
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2510
|
+
*/
|
|
2511
|
+
export declare abstract class Base {
|
|
2512
|
+
components: Components;
|
|
2513
|
+
constructor(components: Components);
|
|
2514
|
+
/** Whether is component is {@link Disposable}. */
|
|
2515
|
+
isDisposeable: () => this is Disposable;
|
|
2516
|
+
/** Whether is component is {@link Resizeable}. */
|
|
2517
|
+
isResizeable: () => this is Resizeable;
|
|
2518
|
+
/** Whether is component is {@link Updateable}. */
|
|
2519
|
+
isUpdateable: () => this is Updateable;
|
|
2520
|
+
/** Whether is component is {@link Hideable}. */
|
|
2521
|
+
isHideable: () => this is Hideable;
|
|
2522
|
+
/** Whether is component is {@link Configurable}. */
|
|
2523
|
+
isConfigurable: () => this is Configurable<any>;
|
|
2524
|
+
}
|
|
2525
|
+
import * as THREE from "three";
|
|
2526
|
+
import CameraControls from "camera-controls";
|
|
2527
|
+
import { Event } from "./event";
|
|
2528
|
+
/**
|
|
2529
|
+
* Whether this component has to be manually destroyed once you are done with it to prevent [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). This also ensures that the DOM events created by that component will be cleaned up.
|
|
2530
|
+
*/
|
|
2531
|
+
export interface Disposable {
|
|
2532
|
+
/**
|
|
2533
|
+
* Destroys the object from memory to prevent a
|
|
2534
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
2535
|
+
*/
|
|
2536
|
+
dispose: () => void | Promise<void>;
|
|
2537
|
+
/** Fired after the tool has been disposed. */
|
|
2538
|
+
readonly onDisposed: Event<any>;
|
|
2539
|
+
}
|
|
2540
|
+
/**
|
|
2541
|
+
* Whether the geometric representation of this component can be hidden or shown in the [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
2542
|
+
*/
|
|
2543
|
+
export interface Hideable {
|
|
2544
|
+
/**
|
|
2545
|
+
* Whether the geometric representation of this component is
|
|
2546
|
+
* currently visible or not in the
|
|
2547
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
2548
|
+
*/
|
|
2549
|
+
visible: boolean;
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Whether this component can be resized. The meaning of this can vary depending on the component: resizing a [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) component could mean changing its resolution, whereas resizing a [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
2400
2553
|
*/
|
|
2401
2554
|
export interface Resizeable {
|
|
2402
2555
|
/**
|
|
@@ -2477,65 +2630,38 @@ export interface CameraControllable {
|
|
|
2477
2630
|
*/
|
|
2478
2631
|
controls: CameraControls;
|
|
2479
2632
|
}
|
|
2480
|
-
import { Base } from "./base";
|
|
2481
|
-
/**
|
|
2482
|
-
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
2483
|
-
*/
|
|
2484
|
-
export declare abstract class Component extends Base {
|
|
2485
|
-
/**
|
|
2486
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
2487
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2488
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2489
|
-
* will not be updated automatically each frame.
|
|
2490
|
-
*/
|
|
2491
|
-
abstract enabled: boolean;
|
|
2492
|
-
}
|
|
2493
2633
|
import { InverseAttribute } from "./types";
|
|
2494
2634
|
export declare const relToAttributesMap: Map<number, {
|
|
2495
2635
|
forRelating: InverseAttribute;
|
|
2496
2636
|
forRelated: InverseAttribute;
|
|
2497
2637
|
}>;
|
|
2498
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2499
|
-
import { Components } from "../../Components";
|
|
2500
|
-
/**
|
|
2501
|
-
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2502
|
-
*/
|
|
2503
|
-
export declare abstract class Base {
|
|
2504
|
-
components: Components;
|
|
2505
|
-
constructor(components: Components);
|
|
2506
|
-
/** Whether is component is {@link Disposable}. */
|
|
2507
|
-
isDisposeable: () => this is Disposable;
|
|
2508
|
-
/** Whether is component is {@link Resizeable}. */
|
|
2509
|
-
isResizeable: () => this is Resizeable;
|
|
2510
|
-
/** Whether is component is {@link Updateable}. */
|
|
2511
|
-
isUpdateable: () => this is Updateable;
|
|
2512
|
-
/** Whether is component is {@link Hideable}. */
|
|
2513
|
-
isHideable: () => this is Hideable;
|
|
2514
|
-
/** Whether is component is {@link Configurable}. */
|
|
2515
|
-
isConfigurable: () => this is Configurable<any>;
|
|
2516
|
-
}
|
|
2517
|
-
import { Base } from "./base";
|
|
2518
|
-
import { World } from "./world";
|
|
2519
|
-
import { Event } from "./event";
|
|
2520
|
-
import { Components } from "../../Components";
|
|
2521
2638
|
/**
|
|
2522
|
-
*
|
|
2639
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2523
2640
|
*/
|
|
2524
|
-
export declare
|
|
2525
|
-
readonly worlds: Map<string, World>;
|
|
2641
|
+
export declare class Event<T> {
|
|
2526
2642
|
/**
|
|
2527
|
-
*
|
|
2528
|
-
*
|
|
2643
|
+
* Add a callback to this event instance.
|
|
2644
|
+
* @param handler - the callback to be added to this event.
|
|
2529
2645
|
*/
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2646
|
+
add(handler: T extends void ? {
|
|
2647
|
+
(): void;
|
|
2648
|
+
} : {
|
|
2649
|
+
(data: T): void;
|
|
2650
|
+
}): void;
|
|
2534
2651
|
/**
|
|
2535
|
-
*
|
|
2652
|
+
* Removes a callback from this event instance.
|
|
2653
|
+
* @param handler - the callback to be removed from this event.
|
|
2536
2654
|
*/
|
|
2537
|
-
|
|
2538
|
-
|
|
2655
|
+
remove(handler: T extends void ? {
|
|
2656
|
+
(): void;
|
|
2657
|
+
} : {
|
|
2658
|
+
(data: T): void;
|
|
2659
|
+
}): void;
|
|
2660
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2661
|
+
trigger: (data?: T) => void;
|
|
2662
|
+
/** Gets rid of all the suscribed events. */
|
|
2663
|
+
reset(): void;
|
|
2664
|
+
private handlers;
|
|
2539
2665
|
}
|
|
2540
2666
|
import * as THREE from "three";
|
|
2541
2667
|
import CameraControls from "camera-controls";
|
|
@@ -2565,470 +2691,229 @@ export declare abstract class BaseCamera extends BaseWorldItem {
|
|
|
2565
2691
|
*/
|
|
2566
2692
|
hasCameraControls: () => this is CameraControllable;
|
|
2567
2693
|
}
|
|
2568
|
-
import
|
|
2569
|
-
import { Vector2 } from "three";
|
|
2570
|
-
import { Event } from "./event";
|
|
2571
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2572
|
-
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
2694
|
+
import { Base } from "./base";
|
|
2573
2695
|
/**
|
|
2574
|
-
*
|
|
2696
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
2575
2697
|
*/
|
|
2576
|
-
export declare abstract class
|
|
2698
|
+
export declare abstract class Component extends Base {
|
|
2577
2699
|
/**
|
|
2578
|
-
*
|
|
2579
|
-
*
|
|
2580
|
-
*
|
|
2581
|
-
*
|
|
2582
|
-
*/
|
|
2583
|
-
abstract three: THREE.WebGLRenderer;
|
|
2584
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2585
|
-
onAfterUpdate: Event<unknown>;
|
|
2586
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2587
|
-
onBeforeUpdate: Event<unknown>;
|
|
2588
|
-
/** {@link Disposable.onDisposed} */
|
|
2589
|
-
readonly onDisposed: Event<undefined>;
|
|
2590
|
-
/** {@link Resizeable.onResize} */
|
|
2591
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
2592
|
-
/**
|
|
2593
|
-
* Event that fires when there has been a change to the list of clipping
|
|
2594
|
-
* planes used by the active renderer.
|
|
2595
|
-
*/
|
|
2596
|
-
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
2597
|
-
/** {@link Updateable.update} */
|
|
2598
|
-
abstract update(delta?: number): void | Promise<void>;
|
|
2599
|
-
/** {@link Disposable.dispose} */
|
|
2600
|
-
abstract dispose(): void;
|
|
2601
|
-
/** {@link Resizeable.getSize} */
|
|
2602
|
-
abstract getSize(): Vector2;
|
|
2603
|
-
/** {@link Resizeable.resize} */
|
|
2604
|
-
abstract resize(size: Vector2 | undefined): void;
|
|
2605
|
-
/**
|
|
2606
|
-
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
|
|
2607
|
-
*/
|
|
2608
|
-
clippingPlanes: THREE.Plane[];
|
|
2609
|
-
/**
|
|
2610
|
-
* Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
|
|
2611
|
-
*
|
|
2612
|
-
* @remarks
|
|
2613
|
-
* This method is typically called when there is a change to the list of clipping planes
|
|
2614
|
-
* used by the active renderer.
|
|
2615
|
-
*/
|
|
2616
|
-
updateClippingPlanes(): void;
|
|
2617
|
-
/**
|
|
2618
|
-
* Sets or removes a clipping plane from the renderer.
|
|
2619
|
-
*
|
|
2620
|
-
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
2621
|
-
* @param plane - The clipping plane to be added or removed.
|
|
2622
|
-
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
|
|
2623
|
-
*
|
|
2624
|
-
* @remarks
|
|
2625
|
-
* This method adds or removes a clipping plane from the 'clippingPlanes' array.
|
|
2626
|
-
* If 'active' is 'true' and the plane is not already in the array, it is added.
|
|
2627
|
-
* If 'active' is 'false' and the plane is in the array, it is removed.
|
|
2628
|
-
* The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
|
|
2629
|
-
* excluding any planes marked as local.
|
|
2630
|
-
*/
|
|
2631
|
-
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2632
|
-
}
|
|
2633
|
-
import * as THREE from "three";
|
|
2634
|
-
import { Disposable } from "./interfaces";
|
|
2635
|
-
import { Event } from "./event";
|
|
2636
|
-
import { Components } from "../../Components";
|
|
2637
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2638
|
-
/**
|
|
2639
|
-
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
2640
|
-
*/
|
|
2641
|
-
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2642
|
-
/** {@link Disposable.onDisposed} */
|
|
2643
|
-
readonly onDisposed: Event<unknown>;
|
|
2644
|
-
/**
|
|
2645
|
-
* Abstract property representing the three.js object associated with this scene.
|
|
2646
|
-
* It should be implemented by subclasses.
|
|
2647
|
-
*/
|
|
2648
|
-
abstract three: THREE.Object3D;
|
|
2649
|
-
protected constructor(components: Components);
|
|
2650
|
-
/** {@link Disposable.dispose} */
|
|
2651
|
-
dispose(): void;
|
|
2652
|
-
}
|
|
2653
|
-
import * as THREE from "three";
|
|
2654
|
-
import { BaseScene } from "./base-scene";
|
|
2655
|
-
import { BaseCamera } from "./base-camera";
|
|
2656
|
-
import { BaseRenderer } from "./base-renderer";
|
|
2657
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
2658
|
-
/**
|
|
2659
|
-
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2660
|
-
*/
|
|
2661
|
-
export interface World extends Disposable, Updateable {
|
|
2662
|
-
/**
|
|
2663
|
-
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2664
|
-
*/
|
|
2665
|
-
meshes: Set<THREE.Mesh>;
|
|
2666
|
-
/**
|
|
2667
|
-
* The base scene of the world.
|
|
2668
|
-
*/
|
|
2669
|
-
scene: BaseScene;
|
|
2670
|
-
/**
|
|
2671
|
-
* The base camera of the world.
|
|
2672
|
-
*/
|
|
2673
|
-
camera: BaseCamera;
|
|
2674
|
-
/**
|
|
2675
|
-
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2676
|
-
*/
|
|
2677
|
-
renderer: BaseRenderer | null;
|
|
2678
|
-
/**
|
|
2679
|
-
* A unique identifier for the world.
|
|
2680
|
-
*/
|
|
2681
|
-
uuid: string;
|
|
2682
|
-
/**
|
|
2683
|
-
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2684
|
-
*/
|
|
2685
|
-
isDisposing: boolean;
|
|
2686
|
-
}
|
|
2687
|
-
import * as THREE from "three";
|
|
2688
|
-
import { Disposable, Event } from "../../Types";
|
|
2689
|
-
/**
|
|
2690
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
2691
|
-
*/
|
|
2692
|
-
export declare class Mouse implements Disposable {
|
|
2693
|
-
dom: HTMLCanvasElement;
|
|
2694
|
-
private _event?;
|
|
2695
|
-
private _position;
|
|
2696
|
-
/** {@link Disposable.onDisposed} */
|
|
2697
|
-
readonly onDisposed: Event<unknown>;
|
|
2698
|
-
constructor(dom: HTMLCanvasElement);
|
|
2699
|
-
/**
|
|
2700
|
-
* The real position of the mouse of the Three.js canvas.
|
|
2701
|
-
*/
|
|
2702
|
-
get position(): THREE.Vector2;
|
|
2703
|
-
/** {@link Disposable.dispose} */
|
|
2704
|
-
dispose(): void;
|
|
2705
|
-
private getPositionY;
|
|
2706
|
-
private getPositionX;
|
|
2707
|
-
private updateMouseInfo;
|
|
2708
|
-
private setupEvents;
|
|
2709
|
-
}
|
|
2710
|
-
import * as THREE from "three";
|
|
2711
|
-
import { Components } from "../../Components";
|
|
2712
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2713
|
-
import { Mouse } from "./mouse";
|
|
2714
|
-
/**
|
|
2715
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
2716
|
-
*/
|
|
2717
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
2718
|
-
/** {@link Component.enabled} */
|
|
2719
|
-
enabled: boolean;
|
|
2720
|
-
/** The components instance to which this Raycaster belongs. */
|
|
2721
|
-
components: Components;
|
|
2722
|
-
/** {@link Disposable.onDisposed} */
|
|
2723
|
-
readonly onDisposed: Event<unknown>;
|
|
2724
|
-
/** The position of the mouse in the screen. */
|
|
2725
|
-
readonly mouse: Mouse;
|
|
2726
|
-
/**
|
|
2727
|
-
* A reference to the Three.js Raycaster instance.
|
|
2728
|
-
* This is used for raycasting operations.
|
|
2729
|
-
*/
|
|
2730
|
-
readonly three: THREE.Raycaster;
|
|
2731
|
-
/**
|
|
2732
|
-
* A reference to the world instance to which this Raycaster belongs.
|
|
2733
|
-
* This is used to access the camera and meshes.
|
|
2734
|
-
*/
|
|
2735
|
-
world: World;
|
|
2736
|
-
constructor(components: Components, world: World);
|
|
2737
|
-
/** {@link Disposable.dispose} */
|
|
2738
|
-
dispose(): void;
|
|
2739
|
-
/**
|
|
2740
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2741
|
-
* the first item found. This also takes into account the clipping planes
|
|
2742
|
-
* used by the renderer.
|
|
2743
|
-
*
|
|
2744
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2745
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
2746
|
-
* {@link Components.meshes}.
|
|
2747
|
-
*/
|
|
2748
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2749
|
-
/**
|
|
2750
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2751
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
2752
|
-
*
|
|
2753
|
-
* @param origin - The origin of the ray.
|
|
2754
|
-
* @param direction - The direction of the ray.
|
|
2755
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2756
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2757
|
-
*/
|
|
2758
|
-
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
2759
|
-
private intersect;
|
|
2760
|
-
private filterClippingPlanes;
|
|
2761
|
-
}
|
|
2762
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2763
|
-
import * as THREE from "three";
|
|
2764
|
-
import { Components } from "../../Components";
|
|
2765
|
-
import { AsyncEvent, Event, World } from "../../Types";
|
|
2766
|
-
/**
|
|
2767
|
-
* Settings to configure the CullerRenderer.
|
|
2768
|
-
*/
|
|
2769
|
-
export interface CullerRendererSettings {
|
|
2770
|
-
/**
|
|
2771
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
2772
|
-
* Default value is 1000.
|
|
2773
|
-
*/
|
|
2774
|
-
updateInterval?: number;
|
|
2775
|
-
/**
|
|
2776
|
-
* Width of the render target used for visibility checks.
|
|
2777
|
-
* Default value is 512.
|
|
2778
|
-
*/
|
|
2779
|
-
width?: number;
|
|
2780
|
-
/**
|
|
2781
|
-
* Height of the render target used for visibility checks.
|
|
2782
|
-
* Default value is 512.
|
|
2783
|
-
*/
|
|
2784
|
-
height?: number;
|
|
2785
|
-
/**
|
|
2786
|
-
* Whether the visibility check should be performed automatically.
|
|
2787
|
-
* Default value is true.
|
|
2788
|
-
*/
|
|
2789
|
-
autoUpdate?: boolean;
|
|
2790
|
-
}
|
|
2791
|
-
/**
|
|
2792
|
-
* A base renderer to determine visibility on screen.
|
|
2793
|
-
*/
|
|
2794
|
-
export declare class CullerRenderer {
|
|
2795
|
-
/** {@link Disposable.onDisposed} */
|
|
2796
|
-
readonly onDisposed: Event<string>;
|
|
2797
|
-
/**
|
|
2798
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
2799
|
-
* meshes that are currently visible, and the ones that were visible
|
|
2800
|
-
* just before but not anymore.
|
|
2801
|
-
*/
|
|
2802
|
-
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
2803
|
-
/**
|
|
2804
|
-
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2805
|
-
*/
|
|
2806
|
-
enabled: boolean;
|
|
2807
|
-
/**
|
|
2808
|
-
* Needs to check whether there are objects that need to be hidden or shown.
|
|
2809
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
2810
|
-
*/
|
|
2811
|
-
needsUpdate: boolean;
|
|
2812
|
-
/**
|
|
2813
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
2814
|
-
* for debugging purposes.
|
|
2815
|
-
*/
|
|
2816
|
-
renderDebugFrame: boolean;
|
|
2817
|
-
/** The components instance to which this renderer belongs. */
|
|
2818
|
-
components: Components;
|
|
2819
|
-
/** The world instance to which this renderer belongs. */
|
|
2820
|
-
readonly world: World;
|
|
2821
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
2822
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
2823
|
-
protected autoUpdate: boolean;
|
|
2824
|
-
protected updateInterval: number;
|
|
2825
|
-
protected readonly worker: Worker;
|
|
2826
|
-
protected readonly scene: THREE.Scene;
|
|
2827
|
-
private _width;
|
|
2828
|
-
private _height;
|
|
2829
|
-
private _availableColor;
|
|
2830
|
-
private readonly renderTarget;
|
|
2831
|
-
private readonly bufferSize;
|
|
2832
|
-
private readonly _buffer;
|
|
2833
|
-
protected _isWorkerBusy: boolean;
|
|
2834
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2835
|
-
/** {@link Disposable.dispose} */
|
|
2836
|
-
dispose(): void;
|
|
2837
|
-
/**
|
|
2838
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2839
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
2840
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2841
|
-
* not true.
|
|
2700
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
2701
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2702
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2703
|
+
* will not be updated automatically each frame.
|
|
2842
2704
|
*/
|
|
2843
|
-
|
|
2844
|
-
protected getAvailableColor(): {
|
|
2845
|
-
r: number;
|
|
2846
|
-
g: number;
|
|
2847
|
-
b: number;
|
|
2848
|
-
code: string;
|
|
2849
|
-
};
|
|
2850
|
-
protected increaseColor(): void;
|
|
2851
|
-
protected decreaseColor(): void;
|
|
2852
|
-
private applySettings;
|
|
2705
|
+
abstract enabled: boolean;
|
|
2853
2706
|
}
|
|
2854
|
-
import * as THREE from "three";
|
|
2855
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2856
|
-
import { Components } from "../../Components";
|
|
2857
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2858
2707
|
/**
|
|
2859
|
-
*
|
|
2708
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2860
2709
|
*/
|
|
2861
|
-
export declare class
|
|
2862
|
-
/**
|
|
2863
|
-
* Event triggered when the visibility of meshes is updated.
|
|
2864
|
-
* Contains two sets: seen and unseen.
|
|
2865
|
-
*/
|
|
2866
|
-
readonly onViewUpdated: Event<{
|
|
2867
|
-
seen: Set<THREE.Mesh>;
|
|
2868
|
-
unseen: Set<THREE.Mesh>;
|
|
2869
|
-
}>;
|
|
2870
|
-
/**
|
|
2871
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2872
|
-
* Default value is 100.
|
|
2873
|
-
*/
|
|
2874
|
-
threshold: number;
|
|
2875
|
-
/**
|
|
2876
|
-
* Map of color code to THREE.InstancedMesh.
|
|
2877
|
-
* Used to keep track of color-coded meshes.
|
|
2878
|
-
*/
|
|
2879
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2880
|
-
/**
|
|
2881
|
-
* Flag to indicate if the renderer is currently processing.
|
|
2882
|
-
* Used to prevent concurrent processing.
|
|
2883
|
-
*/
|
|
2884
|
-
isProcessing: boolean;
|
|
2885
|
-
private _colorCodeMeshMap;
|
|
2886
|
-
private _meshIDColorCodeMap;
|
|
2887
|
-
private _currentVisibleMeshes;
|
|
2888
|
-
private _recentlyHiddenMeshes;
|
|
2889
|
-
private _intervalID;
|
|
2890
|
-
private readonly _transparentMat;
|
|
2891
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2892
|
-
/** {@link Disposable.dispose} */
|
|
2893
|
-
dispose(): void;
|
|
2710
|
+
export declare class AsyncEvent<T> {
|
|
2894
2711
|
/**
|
|
2895
|
-
*
|
|
2896
|
-
* @param
|
|
2897
|
-
* @returns {void}
|
|
2712
|
+
* Add a callback to this event instance.
|
|
2713
|
+
* @param handler - the callback to be added to this event.
|
|
2898
2714
|
*/
|
|
2899
|
-
add(
|
|
2715
|
+
add(handler: T extends void ? {
|
|
2716
|
+
(): Promise<void>;
|
|
2717
|
+
} : {
|
|
2718
|
+
(data: T): Promise<void>;
|
|
2719
|
+
}): void;
|
|
2900
2720
|
/**
|
|
2901
|
-
* Removes a
|
|
2902
|
-
*
|
|
2903
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2904
|
-
* @returns {void}
|
|
2721
|
+
* Removes a callback from this event instance.
|
|
2722
|
+
* @param handler - the callback to be removed from this event.
|
|
2905
2723
|
*/
|
|
2906
|
-
remove(
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
private camera;
|
|
2917
|
-
/** {@link NavigationMode.enabled} */
|
|
2918
|
-
enabled: boolean;
|
|
2919
|
-
/** {@link NavigationMode.id} */
|
|
2920
|
-
readonly id = "FirstPerson";
|
|
2921
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2922
|
-
/** {@link NavigationMode.set} */
|
|
2923
|
-
set(active: boolean): void;
|
|
2924
|
-
private setupFirstPersonCamera;
|
|
2925
|
-
}
|
|
2926
|
-
import { NavigationMode } from "./types";
|
|
2927
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2928
|
-
/**
|
|
2929
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2930
|
-
*/
|
|
2931
|
-
export declare class OrbitMode implements NavigationMode {
|
|
2932
|
-
camera: OrthoPerspectiveCamera;
|
|
2933
|
-
/** {@link NavigationMode.enabled} */
|
|
2934
|
-
enabled: boolean;
|
|
2935
|
-
/** {@link NavigationMode.id} */
|
|
2936
|
-
readonly id = "Orbit";
|
|
2937
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2938
|
-
/** {@link NavigationMode.set} */
|
|
2939
|
-
set(active: boolean): void;
|
|
2940
|
-
private activateOrbitControls;
|
|
2724
|
+
remove(handler: T extends void ? {
|
|
2725
|
+
(): Promise<void>;
|
|
2726
|
+
} : {
|
|
2727
|
+
(data: T): Promise<void>;
|
|
2728
|
+
}): void;
|
|
2729
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2730
|
+
trigger: (data?: T) => Promise<void>;
|
|
2731
|
+
/** Gets rid of all the suscribed events. */
|
|
2732
|
+
reset(): void;
|
|
2733
|
+
private handlers;
|
|
2941
2734
|
}
|
|
2942
|
-
import {
|
|
2943
|
-
import {
|
|
2735
|
+
import { Base } from "./base";
|
|
2736
|
+
import { World } from "./world";
|
|
2737
|
+
import { Event } from "./event";
|
|
2738
|
+
import { Components } from "../../Components";
|
|
2944
2739
|
/**
|
|
2945
|
-
*
|
|
2740
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2946
2741
|
*/
|
|
2947
|
-
export declare class
|
|
2948
|
-
|
|
2949
|
-
/**
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2742
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
2743
|
+
readonly worlds: Map<string, World>;
|
|
2744
|
+
/**
|
|
2745
|
+
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2746
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2747
|
+
*/
|
|
2748
|
+
readonly onWorldChanged: Event<{
|
|
2749
|
+
world: World;
|
|
2750
|
+
action: "added" | "removed";
|
|
2751
|
+
}>;
|
|
2752
|
+
/**
|
|
2753
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2754
|
+
*/
|
|
2755
|
+
currentWorld: World | null;
|
|
2756
|
+
protected constructor(components: Components);
|
|
2961
2757
|
}
|
|
2962
2758
|
import * as THREE from "three";
|
|
2963
|
-
import {
|
|
2964
|
-
import { Event } from "
|
|
2965
|
-
import {
|
|
2759
|
+
import { Vector2 } from "three";
|
|
2760
|
+
import { Event } from "./event";
|
|
2761
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2762
|
+
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
2966
2763
|
/**
|
|
2967
|
-
*
|
|
2764
|
+
* Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
|
|
2968
2765
|
*/
|
|
2969
|
-
export declare class
|
|
2766
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
2970
2767
|
/**
|
|
2971
|
-
*
|
|
2768
|
+
* The three.js WebGLRenderer instance associated with this renderer.
|
|
2769
|
+
*
|
|
2770
|
+
* @abstract
|
|
2771
|
+
* @type {THREE.WebGLRenderer}
|
|
2972
2772
|
*/
|
|
2973
|
-
|
|
2773
|
+
abstract three: THREE.WebGLRenderer;
|
|
2774
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2775
|
+
onAfterUpdate: Event<unknown>;
|
|
2776
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2777
|
+
onBeforeUpdate: Event<unknown>;
|
|
2778
|
+
/** {@link Disposable.onDisposed} */
|
|
2779
|
+
readonly onDisposed: Event<undefined>;
|
|
2780
|
+
/** {@link Resizeable.onResize} */
|
|
2781
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
2974
2782
|
/**
|
|
2975
|
-
*
|
|
2976
|
-
*
|
|
2783
|
+
* Event that fires when there has been a change to the list of clipping
|
|
2784
|
+
* planes used by the active renderer.
|
|
2977
2785
|
*/
|
|
2978
|
-
|
|
2786
|
+
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
2787
|
+
/** {@link Updateable.update} */
|
|
2788
|
+
abstract update(delta?: number): void | Promise<void>;
|
|
2789
|
+
/** {@link Disposable.dispose} */
|
|
2790
|
+
abstract dispose(): void;
|
|
2791
|
+
/** {@link Resizeable.getSize} */
|
|
2792
|
+
abstract getSize(): Vector2;
|
|
2793
|
+
/** {@link Resizeable.resize} */
|
|
2794
|
+
abstract resize(size: Vector2 | undefined): void;
|
|
2979
2795
|
/**
|
|
2980
|
-
* The
|
|
2981
|
-
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2796
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
|
|
2982
2797
|
*/
|
|
2983
|
-
|
|
2984
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
2985
|
-
matchOrthoDistanceEnabled: boolean;
|
|
2986
|
-
private _component;
|
|
2987
|
-
private _previousDistance;
|
|
2988
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2798
|
+
clippingPlanes: THREE.Plane[];
|
|
2989
2799
|
/**
|
|
2990
|
-
*
|
|
2800
|
+
* Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
|
|
2991
2801
|
*
|
|
2992
|
-
* @
|
|
2993
|
-
*
|
|
2802
|
+
* @remarks
|
|
2803
|
+
* This method is typically called when there is a change to the list of clipping planes
|
|
2804
|
+
* used by the active renderer.
|
|
2994
2805
|
*/
|
|
2995
|
-
|
|
2806
|
+
updateClippingPlanes(): void;
|
|
2996
2807
|
/**
|
|
2997
|
-
*
|
|
2998
|
-
*
|
|
2808
|
+
* Sets or removes a clipping plane from the renderer.
|
|
2809
|
+
*
|
|
2810
|
+
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
2811
|
+
* @param plane - The clipping plane to be added or removed.
|
|
2812
|
+
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
|
|
2813
|
+
*
|
|
2814
|
+
* @remarks
|
|
2815
|
+
* This method adds or removes a clipping plane from the 'clippingPlanes' array.
|
|
2816
|
+
* If 'active' is 'true' and the plane is not already in the array, it is added.
|
|
2817
|
+
* If 'active' is 'false' and the plane is in the array, it is removed.
|
|
2818
|
+
* The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
|
|
2819
|
+
* excluding any planes marked as local.
|
|
2999
2820
|
*/
|
|
3000
|
-
|
|
3001
|
-
private setOrthoCamera;
|
|
3002
|
-
private getPerspectiveDims;
|
|
3003
|
-
private setupOrthoCamera;
|
|
3004
|
-
private getDistance;
|
|
3005
|
-
private setPerspectiveCamera;
|
|
2821
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
3006
2822
|
}
|
|
2823
|
+
import * as THREE from "three";
|
|
2824
|
+
import { Disposable } from "./interfaces";
|
|
2825
|
+
import { Event } from "./event";
|
|
2826
|
+
import { Components } from "../../Components";
|
|
2827
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
3007
2828
|
/**
|
|
3008
|
-
*
|
|
2829
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
3009
2830
|
*/
|
|
3010
|
-
export
|
|
2831
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2832
|
+
/** {@link Disposable.onDisposed} */
|
|
2833
|
+
readonly onDisposed: Event<unknown>;
|
|
2834
|
+
/**
|
|
2835
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
2836
|
+
* It should be implemented by subclasses.
|
|
2837
|
+
*/
|
|
2838
|
+
abstract three: THREE.Object3D;
|
|
2839
|
+
protected constructor(components: Components);
|
|
2840
|
+
/** {@link Disposable.dispose} */
|
|
2841
|
+
dispose(): void;
|
|
2842
|
+
}
|
|
2843
|
+
import * as THREE from "three";
|
|
2844
|
+
import { Disposable, Event } from "../../Types";
|
|
3011
2845
|
/**
|
|
3012
|
-
*
|
|
2846
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
3013
2847
|
*/
|
|
3014
|
-
export
|
|
2848
|
+
export declare class Mouse implements Disposable {
|
|
2849
|
+
dom: HTMLCanvasElement;
|
|
2850
|
+
private _event?;
|
|
2851
|
+
private _position;
|
|
2852
|
+
/** {@link Disposable.onDisposed} */
|
|
2853
|
+
readonly onDisposed: Event<unknown>;
|
|
2854
|
+
constructor(dom: HTMLCanvasElement);
|
|
2855
|
+
/**
|
|
2856
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2857
|
+
*/
|
|
2858
|
+
get position(): THREE.Vector2;
|
|
2859
|
+
/** {@link Disposable.dispose} */
|
|
2860
|
+
dispose(): void;
|
|
2861
|
+
private getPositionY;
|
|
2862
|
+
private getPositionX;
|
|
2863
|
+
private updateMouseInfo;
|
|
2864
|
+
private setupEvents;
|
|
2865
|
+
}
|
|
2866
|
+
import * as THREE from "three";
|
|
2867
|
+
import { Components } from "../../Components";
|
|
2868
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2869
|
+
import { Mouse } from "./mouse";
|
|
3015
2870
|
/**
|
|
3016
|
-
*
|
|
2871
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3017
2872
|
*/
|
|
3018
|
-
export
|
|
3019
|
-
/**
|
|
3020
|
-
|
|
2873
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2874
|
+
/** {@link Component.enabled} */
|
|
2875
|
+
enabled: boolean;
|
|
2876
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2877
|
+
components: Components;
|
|
2878
|
+
/** {@link Disposable.onDisposed} */
|
|
2879
|
+
readonly onDisposed: Event<unknown>;
|
|
2880
|
+
/** The position of the mouse in the screen. */
|
|
2881
|
+
readonly mouse: Mouse;
|
|
3021
2882
|
/**
|
|
3022
|
-
*
|
|
3023
|
-
*
|
|
3024
|
-
|
|
2883
|
+
* A reference to the Three.js Raycaster instance.
|
|
2884
|
+
* This is used for raycasting operations.
|
|
2885
|
+
*/
|
|
2886
|
+
readonly three: THREE.Raycaster;
|
|
2887
|
+
/**
|
|
2888
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2889
|
+
* This is used to access the camera and meshes.
|
|
2890
|
+
*/
|
|
2891
|
+
world: World;
|
|
2892
|
+
constructor(components: Components, world: World);
|
|
2893
|
+
/** {@link Disposable.dispose} */
|
|
2894
|
+
dispose(): void;
|
|
2895
|
+
/**
|
|
2896
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2897
|
+
* the first item found. This also takes into account the clipping planes
|
|
2898
|
+
* used by the renderer.
|
|
3025
2899
|
*
|
|
3026
|
-
* @param
|
|
3027
|
-
*
|
|
3028
|
-
*
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
2900
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2901
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2902
|
+
* {@link Components.meshes}.
|
|
2903
|
+
*/
|
|
2904
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2905
|
+
/**
|
|
2906
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2907
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2908
|
+
*
|
|
2909
|
+
* @param origin - The origin of the ray.
|
|
2910
|
+
* @param direction - The direction of the ray.
|
|
2911
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2912
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2913
|
+
*/
|
|
2914
|
+
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
2915
|
+
private intersect;
|
|
2916
|
+
private filterClippingPlanes;
|
|
3032
2917
|
}
|
|
3033
2918
|
import * as THREE from "three";
|
|
3034
2919
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
@@ -3110,6 +2995,40 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
3110
2995
|
dispose(disposeResources?: boolean): void;
|
|
3111
2996
|
}
|
|
3112
2997
|
import * as THREE from "three";
|
|
2998
|
+
import { BaseScene } from "./base-scene";
|
|
2999
|
+
import { BaseCamera } from "./base-camera";
|
|
3000
|
+
import { BaseRenderer } from "./base-renderer";
|
|
3001
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
3002
|
+
/**
|
|
3003
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
3004
|
+
*/
|
|
3005
|
+
export interface World extends Disposable, Updateable {
|
|
3006
|
+
/**
|
|
3007
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
3008
|
+
*/
|
|
3009
|
+
meshes: Set<THREE.Mesh>;
|
|
3010
|
+
/**
|
|
3011
|
+
* The base scene of the world.
|
|
3012
|
+
*/
|
|
3013
|
+
scene: BaseScene;
|
|
3014
|
+
/**
|
|
3015
|
+
* The base camera of the world.
|
|
3016
|
+
*/
|
|
3017
|
+
camera: BaseCamera;
|
|
3018
|
+
/**
|
|
3019
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
3020
|
+
*/
|
|
3021
|
+
renderer: BaseRenderer | null;
|
|
3022
|
+
/**
|
|
3023
|
+
* A unique identifier for the world.
|
|
3024
|
+
*/
|
|
3025
|
+
uuid: string;
|
|
3026
|
+
/**
|
|
3027
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
3028
|
+
*/
|
|
3029
|
+
isDisposing: boolean;
|
|
3030
|
+
}
|
|
3031
|
+
import * as THREE from "three";
|
|
3113
3032
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3114
3033
|
import { Components } from "../../Components";
|
|
3115
3034
|
/**
|
|
@@ -3203,6 +3122,97 @@ export declare class SimpleRenderer extends BaseRenderer {
|
|
|
3203
3122
|
private onContextBack;
|
|
3204
3123
|
}
|
|
3205
3124
|
import * as THREE from "three";
|
|
3125
|
+
import { Components } from "../../Components";
|
|
3126
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
3127
|
+
/**
|
|
3128
|
+
* Settings to configure the CullerRenderer.
|
|
3129
|
+
*/
|
|
3130
|
+
export interface CullerRendererSettings {
|
|
3131
|
+
/**
|
|
3132
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
3133
|
+
* Default value is 1000.
|
|
3134
|
+
*/
|
|
3135
|
+
updateInterval?: number;
|
|
3136
|
+
/**
|
|
3137
|
+
* Width of the render target used for visibility checks.
|
|
3138
|
+
* Default value is 512.
|
|
3139
|
+
*/
|
|
3140
|
+
width?: number;
|
|
3141
|
+
/**
|
|
3142
|
+
* Height of the render target used for visibility checks.
|
|
3143
|
+
* Default value is 512.
|
|
3144
|
+
*/
|
|
3145
|
+
height?: number;
|
|
3146
|
+
/**
|
|
3147
|
+
* Whether the visibility check should be performed automatically.
|
|
3148
|
+
* Default value is true.
|
|
3149
|
+
*/
|
|
3150
|
+
autoUpdate?: boolean;
|
|
3151
|
+
}
|
|
3152
|
+
/**
|
|
3153
|
+
* A base renderer to determine visibility on screen.
|
|
3154
|
+
*/
|
|
3155
|
+
export declare class CullerRenderer {
|
|
3156
|
+
/** {@link Disposable.onDisposed} */
|
|
3157
|
+
readonly onDisposed: Event<string>;
|
|
3158
|
+
/**
|
|
3159
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
3160
|
+
* meshes that are currently visible, and the ones that were visible
|
|
3161
|
+
* just before but not anymore.
|
|
3162
|
+
*/
|
|
3163
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
3164
|
+
/**
|
|
3165
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3166
|
+
*/
|
|
3167
|
+
enabled: boolean;
|
|
3168
|
+
/**
|
|
3169
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
3170
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3171
|
+
*/
|
|
3172
|
+
needsUpdate: boolean;
|
|
3173
|
+
/**
|
|
3174
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
3175
|
+
* for debugging purposes.
|
|
3176
|
+
*/
|
|
3177
|
+
renderDebugFrame: boolean;
|
|
3178
|
+
/** The components instance to which this renderer belongs. */
|
|
3179
|
+
components: Components;
|
|
3180
|
+
/** The world instance to which this renderer belongs. */
|
|
3181
|
+
readonly world: World;
|
|
3182
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
3183
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
3184
|
+
protected autoUpdate: boolean;
|
|
3185
|
+
protected updateInterval: number;
|
|
3186
|
+
protected readonly worker: Worker;
|
|
3187
|
+
protected readonly scene: THREE.Scene;
|
|
3188
|
+
private _width;
|
|
3189
|
+
private _height;
|
|
3190
|
+
private _availableColor;
|
|
3191
|
+
private readonly renderTarget;
|
|
3192
|
+
private readonly bufferSize;
|
|
3193
|
+
private readonly _buffer;
|
|
3194
|
+
protected _isWorkerBusy: boolean;
|
|
3195
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3196
|
+
/** {@link Disposable.dispose} */
|
|
3197
|
+
dispose(): void;
|
|
3198
|
+
/**
|
|
3199
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
3200
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
3201
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3202
|
+
* not true.
|
|
3203
|
+
*/
|
|
3204
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
3205
|
+
protected getAvailableColor(): {
|
|
3206
|
+
r: number;
|
|
3207
|
+
g: number;
|
|
3208
|
+
b: number;
|
|
3209
|
+
code: string;
|
|
3210
|
+
};
|
|
3211
|
+
protected increaseColor(): void;
|
|
3212
|
+
protected decreaseColor(): void;
|
|
3213
|
+
private applySettings;
|
|
3214
|
+
}
|
|
3215
|
+
import * as THREE from "three";
|
|
3206
3216
|
import CameraControls from "camera-controls";
|
|
3207
3217
|
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3208
3218
|
import { Components } from "../../Components";
|
|
@@ -3265,104 +3275,60 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
3265
3275
|
private static getSubsetOfThree;
|
|
3266
3276
|
}
|
|
3267
3277
|
import * as THREE from "three";
|
|
3268
|
-
import
|
|
3269
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
3270
|
-
export declare class CivilReader {
|
|
3271
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
3272
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
3273
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
3274
|
-
coordinationMatrix: THREE.Matrix4;
|
|
3275
|
-
} | undefined;
|
|
3276
|
-
get(civilItems: any): {
|
|
3277
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
3278
|
-
coordinationMatrix: THREE.Matrix4;
|
|
3279
|
-
} | undefined;
|
|
3280
|
-
private getCurves;
|
|
3281
|
-
}
|
|
3282
|
-
import * as THREE from "three";
|
|
3283
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3278
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
3284
3279
|
import { Components } from "../../Components";
|
|
3280
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3285
3281
|
/**
|
|
3286
|
-
*
|
|
3282
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
3287
3283
|
*/
|
|
3288
|
-
export
|
|
3289
|
-
/**
|
|
3290
|
-
* The color of the grid lines.
|
|
3291
|
-
*/
|
|
3292
|
-
color: THREE.Color;
|
|
3293
|
-
/**
|
|
3294
|
-
* The size of the primary grid lines.
|
|
3295
|
-
*/
|
|
3296
|
-
size1: number;
|
|
3284
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3297
3285
|
/**
|
|
3298
|
-
*
|
|
3286
|
+
* Event triggered when the visibility of meshes is updated.
|
|
3287
|
+
* Contains two sets: seen and unseen.
|
|
3299
3288
|
*/
|
|
3300
|
-
|
|
3289
|
+
readonly onViewUpdated: Event<{
|
|
3290
|
+
seen: Set<THREE.Mesh>;
|
|
3291
|
+
unseen: Set<THREE.Mesh>;
|
|
3292
|
+
}>;
|
|
3301
3293
|
/**
|
|
3302
|
-
*
|
|
3294
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
3295
|
+
* Default value is 100.
|
|
3303
3296
|
*/
|
|
3304
|
-
|
|
3305
|
-
}
|
|
3306
|
-
/**
|
|
3307
|
-
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
3308
|
-
*/
|
|
3309
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3310
|
-
/** {@link Disposable.onDisposed} */
|
|
3311
|
-
readonly onDisposed: Event<unknown>;
|
|
3312
|
-
/** The world instance to which this Raycaster belongs. */
|
|
3313
|
-
world: World;
|
|
3314
|
-
/** The components instance to which this grid belongs. */
|
|
3315
|
-
components: Components;
|
|
3316
|
-
/** {@link Hideable.visible} */
|
|
3317
|
-
get visible(): boolean;
|
|
3318
|
-
/** {@link Hideable.visible} */
|
|
3319
|
-
set visible(visible: boolean);
|
|
3320
|
-
/** The material of the grid. */
|
|
3321
|
-
get material(): THREE.ShaderMaterial;
|
|
3297
|
+
threshold: number;
|
|
3322
3298
|
/**
|
|
3323
|
-
*
|
|
3324
|
-
*
|
|
3299
|
+
* Map of color code to THREE.InstancedMesh.
|
|
3300
|
+
* Used to keep track of color-coded meshes.
|
|
3325
3301
|
*/
|
|
3326
|
-
|
|
3302
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3327
3303
|
/**
|
|
3328
|
-
*
|
|
3329
|
-
*
|
|
3304
|
+
* Flag to indicate if the renderer is currently processing.
|
|
3305
|
+
* Used to prevent concurrent processing.
|
|
3330
3306
|
*/
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
private
|
|
3335
|
-
|
|
3307
|
+
isProcessing: boolean;
|
|
3308
|
+
private _colorCodeMeshMap;
|
|
3309
|
+
private _meshIDColorCodeMap;
|
|
3310
|
+
private _currentVisibleMeshes;
|
|
3311
|
+
private _recentlyHiddenMeshes;
|
|
3312
|
+
private _intervalID;
|
|
3313
|
+
private readonly _transparentMat;
|
|
3314
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3336
3315
|
/** {@link Disposable.dispose} */
|
|
3337
3316
|
dispose(): void;
|
|
3338
|
-
private setupEvents;
|
|
3339
|
-
private updateZoom;
|
|
3340
|
-
}
|
|
3341
|
-
import * as WEBIFC from "web-ifc";
|
|
3342
|
-
export declare class IfcMetadataReader {
|
|
3343
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3344
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3345
|
-
}
|
|
3346
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3347
|
-
/**
|
|
3348
|
-
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3349
|
-
*/
|
|
3350
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3351
3317
|
/**
|
|
3352
|
-
*
|
|
3353
|
-
*
|
|
3318
|
+
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
3319
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3320
|
+
* @returns {void}
|
|
3354
3321
|
*/
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
private
|
|
3365
|
-
private getScaleMatrix;
|
|
3322
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3323
|
+
/**
|
|
3324
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3325
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3326
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3327
|
+
* @returns {void}
|
|
3328
|
+
*/
|
|
3329
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3330
|
+
private handleWorkerMessage;
|
|
3331
|
+
private getAvailableMaterial;
|
|
3366
3332
|
}
|
|
3367
3333
|
import * as THREE from "three";
|
|
3368
3334
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3463,6 +3429,12 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3463
3429
|
private newHelper;
|
|
3464
3430
|
private static newPlaneMesh;
|
|
3465
3431
|
}
|
|
3432
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3433
|
+
import * as WEBIFC from "web-ifc";
|
|
3434
|
+
export declare class IfcMetadataReader {
|
|
3435
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3436
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3437
|
+
}
|
|
3466
3438
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3467
3439
|
/**
|
|
3468
3440
|
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
@@ -3479,6 +3451,17 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
|
3479
3451
|
*/
|
|
3480
3452
|
minAssetsSize: number;
|
|
3481
3453
|
}
|
|
3454
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3455
|
+
/**
|
|
3456
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3457
|
+
*/
|
|
3458
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3459
|
+
/**
|
|
3460
|
+
* Amount of properties to be streamed.
|
|
3461
|
+
* Defaults to 100 properties.
|
|
3462
|
+
*/
|
|
3463
|
+
propertiesSize: number;
|
|
3464
|
+
}
|
|
3482
3465
|
/**
|
|
3483
3466
|
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3484
3467
|
*/
|
|
@@ -3508,6 +3491,31 @@ export interface StreamedAsset {
|
|
|
3508
3491
|
color: number[];
|
|
3509
3492
|
}[];
|
|
3510
3493
|
}
|
|
3494
|
+
import * as THREE from "three";
|
|
3495
|
+
import * as WEBIFC from "web-ifc";
|
|
3496
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3497
|
+
export declare class CivilReader {
|
|
3498
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3499
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3500
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3501
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3502
|
+
} | undefined;
|
|
3503
|
+
get(civilItems: any): {
|
|
3504
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3505
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3506
|
+
} | undefined;
|
|
3507
|
+
private getCurves;
|
|
3508
|
+
}
|
|
3509
|
+
import * as WEBIFC from "web-ifc";
|
|
3510
|
+
import * as THREE from "three";
|
|
3511
|
+
export declare class Units {
|
|
3512
|
+
factor: number;
|
|
3513
|
+
complement: number;
|
|
3514
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3515
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3516
|
+
private getLengthUnits;
|
|
3517
|
+
private getScaleMatrix;
|
|
3518
|
+
}
|
|
3511
3519
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3512
3520
|
export interface ModelsRelationMap {
|
|
3513
3521
|
[modelID: string]: RelationsMap;
|