@thatopen/components 2.0.22 → 2.0.23
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/index.cjs +5 -5
- package/dist/index.mjs +160 -160
- package/dist/namespace.d.ts +1128 -1128
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,113 +1,4 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
3
|
-
import { SimpleRaycaster } from "./src";
|
|
4
|
-
import { Components } from "../Components";
|
|
5
|
-
/**
|
|
6
|
-
* 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).
|
|
7
|
-
*/
|
|
8
|
-
export declare class Raycasters 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: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
14
|
-
/** {@link Component.enabled} */
|
|
15
|
-
enabled: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* A Map that stores raycasters for each world.
|
|
18
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
19
|
-
*/
|
|
20
|
-
list: Map<string, SimpleRaycaster>;
|
|
21
|
-
/** {@link Disposable.onDisposed} */
|
|
22
|
-
onDisposed: Event<unknown>;
|
|
23
|
-
constructor(components: Components);
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves a SimpleRaycaster instance for the given world.
|
|
26
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
27
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
28
|
-
*
|
|
29
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
30
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
31
|
-
*/
|
|
32
|
-
get(world: World): SimpleRaycaster;
|
|
33
|
-
/**
|
|
34
|
-
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
35
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
36
|
-
*
|
|
37
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
38
|
-
* @returns {void}
|
|
39
|
-
*/
|
|
40
|
-
delete(world: World): void;
|
|
41
|
-
/** {@link Disposable.dispose} */
|
|
42
|
-
dispose(): void;
|
|
43
|
-
}
|
|
44
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
45
|
-
import { Components } from "../Components";
|
|
46
|
-
import { SimpleWorld } from "./src";
|
|
47
|
-
/**
|
|
48
|
-
* 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).
|
|
49
|
-
*/
|
|
50
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
51
|
-
/**
|
|
52
|
-
* A unique identifier for the component.
|
|
53
|
-
* This UUID is used to register the component within the Components system.
|
|
54
|
-
*/
|
|
55
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
56
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
57
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
58
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
59
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
60
|
-
/** {@link Disposable.onDisposed} */
|
|
61
|
-
readonly onDisposed: Event<unknown>;
|
|
62
|
-
/**
|
|
63
|
-
* An event that is triggered when a new world is created.
|
|
64
|
-
* The event passes the newly created world as a parameter.
|
|
65
|
-
*/
|
|
66
|
-
readonly onWorldCreated: Event<World>;
|
|
67
|
-
/**
|
|
68
|
-
* An event that is triggered when a world is deleted.
|
|
69
|
-
* The event passes the UUID of the deleted world as a parameter.
|
|
70
|
-
*/
|
|
71
|
-
readonly onWorldDeleted: Event<string>;
|
|
72
|
-
/**
|
|
73
|
-
* A collection of worlds managed by this component.
|
|
74
|
-
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
75
|
-
*/
|
|
76
|
-
list: Map<string, World>;
|
|
77
|
-
/** {@link Component.enabled} */
|
|
78
|
-
enabled: boolean;
|
|
79
|
-
constructor(components: Components);
|
|
80
|
-
/**
|
|
81
|
-
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
82
|
-
*
|
|
83
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
84
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
85
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
86
|
-
*
|
|
87
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
88
|
-
*/
|
|
89
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
90
|
-
/**
|
|
91
|
-
* Deletes a world from the list of worlds.
|
|
92
|
-
*
|
|
93
|
-
* @param {World} world - The world to be deleted.
|
|
94
|
-
*
|
|
95
|
-
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
96
|
-
*
|
|
97
|
-
* @returns {void}
|
|
98
|
-
*/
|
|
99
|
-
delete(world: World): void;
|
|
100
|
-
/**
|
|
101
|
-
* Disposes of the Worlds component and all its managed worlds.
|
|
102
|
-
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
103
|
-
* and triggers the onDisposed event.
|
|
104
|
-
*
|
|
105
|
-
* @returns {void}
|
|
106
|
-
*/
|
|
107
|
-
dispose(): void;
|
|
108
|
-
/** {@link Updateable.update} */
|
|
109
|
-
update(delta?: number): void | Promise<void>;
|
|
110
|
-
}
|
|
111
2
|
import * as THREE from "three";
|
|
112
3
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
113
4
|
import { SimplePlane } from "./src";
|
|
@@ -235,6 +126,51 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
235
126
|
private _onStartDragging;
|
|
236
127
|
private _onEndDragging;
|
|
237
128
|
}
|
|
129
|
+
import * as THREE from "three";
|
|
130
|
+
import { Components } from "../Components";
|
|
131
|
+
import { Component } from "../Types";
|
|
132
|
+
/**
|
|
133
|
+
* 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).
|
|
134
|
+
*/
|
|
135
|
+
export declare class Disposer extends Component {
|
|
136
|
+
private _disposedComponents;
|
|
137
|
+
/** {@link Component.enabled} */
|
|
138
|
+
enabled: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* A unique identifier for the component.
|
|
141
|
+
* This UUID is used to register the component within the Components system.
|
|
142
|
+
*/
|
|
143
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
144
|
+
constructor(components: Components);
|
|
145
|
+
/**
|
|
146
|
+
* Return the UUIDs of all disposed components.
|
|
147
|
+
*/
|
|
148
|
+
get(): Set<string>;
|
|
149
|
+
/**
|
|
150
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
151
|
+
* using any of these in other parts of the application, make sure that you
|
|
152
|
+
* remove them from the mesh before disposing it.
|
|
153
|
+
*
|
|
154
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
155
|
+
* to remove.
|
|
156
|
+
*
|
|
157
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
158
|
+
*
|
|
159
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
160
|
+
*/
|
|
161
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
162
|
+
/**
|
|
163
|
+
* Disposes a geometry from memory.
|
|
164
|
+
*
|
|
165
|
+
* @param geometry - the
|
|
166
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
167
|
+
* to remove.
|
|
168
|
+
*/
|
|
169
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
170
|
+
private disposeGeometryAndMaterials;
|
|
171
|
+
private disposeChildren;
|
|
172
|
+
private static disposeMaterial;
|
|
173
|
+
}
|
|
238
174
|
import { Component, Disposable, Event } from "../Types";
|
|
239
175
|
/**
|
|
240
176
|
* 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.
|
|
@@ -243,7 +179,7 @@ export declare class Components implements Disposable {
|
|
|
243
179
|
/**
|
|
244
180
|
* The version of the @thatopen/components library.
|
|
245
181
|
*/
|
|
246
|
-
static readonly release = "2.0.
|
|
182
|
+
static readonly release = "2.0.23";
|
|
247
183
|
/** {@link Disposable.onDisposed} */
|
|
248
184
|
readonly onDisposed: Event<void>;
|
|
249
185
|
/**
|
|
@@ -312,49 +248,42 @@ export declare class Components implements Disposable {
|
|
|
312
248
|
private static setupBVH;
|
|
313
249
|
}
|
|
314
250
|
import { Component, Disposable, World, Event } from "../Types";
|
|
315
|
-
import {
|
|
251
|
+
import { SimpleRaycaster } from "./src";
|
|
316
252
|
import { Components } from "../Components";
|
|
317
253
|
/**
|
|
318
|
-
* A component that manages
|
|
254
|
+
* 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).
|
|
319
255
|
*/
|
|
320
|
-
export declare class
|
|
256
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
321
257
|
/**
|
|
322
258
|
* A unique identifier for the component.
|
|
323
259
|
* This UUID is used to register the component within the Components system.
|
|
324
260
|
*/
|
|
325
|
-
static readonly uuid: "
|
|
326
|
-
/**
|
|
327
|
-
|
|
328
|
-
*/
|
|
329
|
-
list: Map<string, SimpleGrid>;
|
|
261
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
262
|
+
/** {@link Component.enabled} */
|
|
263
|
+
enabled: boolean;
|
|
330
264
|
/**
|
|
331
|
-
*
|
|
265
|
+
* A Map that stores raycasters for each world.
|
|
266
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
332
267
|
*/
|
|
333
|
-
|
|
268
|
+
list: Map<string, SimpleRaycaster>;
|
|
334
269
|
/** {@link Disposable.onDisposed} */
|
|
335
|
-
|
|
336
|
-
/** {@link Component.enabled} */
|
|
337
|
-
enabled: boolean;
|
|
270
|
+
onDisposed: Event<unknown>;
|
|
338
271
|
constructor(components: Components);
|
|
339
272
|
/**
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
* @param world - The world to create the grid for.
|
|
344
|
-
* @returns The newly created grid.
|
|
273
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
274
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
275
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
345
276
|
*
|
|
346
|
-
* @
|
|
277
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
278
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
347
279
|
*/
|
|
348
|
-
|
|
280
|
+
get(world: World): SimpleRaycaster;
|
|
349
281
|
/**
|
|
350
|
-
* Deletes the
|
|
351
|
-
* If a
|
|
352
|
-
*
|
|
353
|
-
* @param world - The world for which to delete the grid.
|
|
282
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
283
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
354
284
|
*
|
|
355
|
-
* @
|
|
356
|
-
*
|
|
357
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
285
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
286
|
+
* @returns {void}
|
|
358
287
|
*/
|
|
359
288
|
delete(world: World): void;
|
|
360
289
|
/** {@link Disposable.dispose} */
|
|
@@ -408,50 +337,168 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
408
337
|
/** {@link Disposable.dispose} */
|
|
409
338
|
dispose(): void;
|
|
410
339
|
}
|
|
411
|
-
import
|
|
340
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
341
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
412
342
|
import { Components } from "../Components";
|
|
413
|
-
import { Component } from "../Types";
|
|
414
343
|
/**
|
|
415
|
-
* A
|
|
344
|
+
* 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).
|
|
416
345
|
*/
|
|
417
|
-
export declare class
|
|
418
|
-
private _disposedComponents;
|
|
419
|
-
/** {@link Component.enabled} */
|
|
420
|
-
enabled: boolean;
|
|
346
|
+
export declare class Grids extends Component implements Disposable {
|
|
421
347
|
/**
|
|
422
348
|
* A unique identifier for the component.
|
|
423
349
|
* This UUID is used to register the component within the Components system.
|
|
424
350
|
*/
|
|
425
|
-
static readonly uuid: "
|
|
426
|
-
constructor(components: Components);
|
|
351
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
427
352
|
/**
|
|
428
|
-
*
|
|
353
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
429
354
|
*/
|
|
430
|
-
|
|
355
|
+
list: Map<string, SimpleGrid>;
|
|
431
356
|
/**
|
|
432
|
-
*
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
357
|
+
* The default configuration for grid creation.
|
|
358
|
+
*/
|
|
359
|
+
config: Required<GridConfig>;
|
|
360
|
+
/** {@link Disposable.onDisposed} */
|
|
361
|
+
readonly onDisposed: Event<unknown>;
|
|
362
|
+
/** {@link Component.enabled} */
|
|
363
|
+
enabled: boolean;
|
|
364
|
+
constructor(components: Components);
|
|
365
|
+
/**
|
|
366
|
+
* Creates a new grid for the given world.
|
|
367
|
+
* Throws an error if a grid already exists for the world.
|
|
438
368
|
*
|
|
439
|
-
* @param
|
|
369
|
+
* @param world - The world to create the grid for.
|
|
370
|
+
* @returns The newly created grid.
|
|
440
371
|
*
|
|
441
|
-
* @
|
|
372
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
442
373
|
*/
|
|
443
|
-
|
|
374
|
+
create(world: World): SimpleGrid;
|
|
444
375
|
/**
|
|
445
|
-
*
|
|
376
|
+
* Deletes the grid associated with the given world.
|
|
377
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
446
378
|
*
|
|
447
|
-
* @param
|
|
448
|
-
*
|
|
449
|
-
*
|
|
379
|
+
* @param world - The world for which to delete the grid.
|
|
380
|
+
*
|
|
381
|
+
* @remarks
|
|
382
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
383
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
450
384
|
*/
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
385
|
+
delete(world: World): void;
|
|
386
|
+
/** {@link Disposable.dispose} */
|
|
387
|
+
dispose(): void;
|
|
388
|
+
}
|
|
389
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
390
|
+
import { Components } from "../Components";
|
|
391
|
+
import { SimpleWorld } from "./src";
|
|
392
|
+
/**
|
|
393
|
+
* 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).
|
|
394
|
+
*/
|
|
395
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
396
|
+
/**
|
|
397
|
+
* A unique identifier for the component.
|
|
398
|
+
* This UUID is used to register the component within the Components system.
|
|
399
|
+
*/
|
|
400
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
401
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
402
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
403
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
404
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
405
|
+
/** {@link Disposable.onDisposed} */
|
|
406
|
+
readonly onDisposed: Event<unknown>;
|
|
407
|
+
/**
|
|
408
|
+
* An event that is triggered when a new world is created.
|
|
409
|
+
* The event passes the newly created world as a parameter.
|
|
410
|
+
*/
|
|
411
|
+
readonly onWorldCreated: Event<World>;
|
|
412
|
+
/**
|
|
413
|
+
* An event that is triggered when a world is deleted.
|
|
414
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
415
|
+
*/
|
|
416
|
+
readonly onWorldDeleted: Event<string>;
|
|
417
|
+
/**
|
|
418
|
+
* A collection of worlds managed by this component.
|
|
419
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
420
|
+
*/
|
|
421
|
+
list: Map<string, World>;
|
|
422
|
+
/** {@link Component.enabled} */
|
|
423
|
+
enabled: boolean;
|
|
424
|
+
constructor(components: Components);
|
|
425
|
+
/**
|
|
426
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
427
|
+
*
|
|
428
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
429
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
430
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
431
|
+
*
|
|
432
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
433
|
+
*/
|
|
434
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
435
|
+
/**
|
|
436
|
+
* Deletes a world from the list of worlds.
|
|
437
|
+
*
|
|
438
|
+
* @param {World} world - The world to be deleted.
|
|
439
|
+
*
|
|
440
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
441
|
+
*
|
|
442
|
+
* @returns {void}
|
|
443
|
+
*/
|
|
444
|
+
delete(world: World): void;
|
|
445
|
+
/**
|
|
446
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
447
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
448
|
+
* and triggers the onDisposed event.
|
|
449
|
+
*
|
|
450
|
+
* @returns {void}
|
|
451
|
+
*/
|
|
452
|
+
dispose(): void;
|
|
453
|
+
/** {@link Updateable.update} */
|
|
454
|
+
update(delta?: number): void | Promise<void>;
|
|
455
|
+
}
|
|
456
|
+
import { MiniMap } from "./src";
|
|
457
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
458
|
+
import { Components } from "../Components";
|
|
459
|
+
/**
|
|
460
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
461
|
+
*/
|
|
462
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
463
|
+
/**
|
|
464
|
+
* A unique identifier for the component.
|
|
465
|
+
* This UUID is used to register the component within the Components system.
|
|
466
|
+
*/
|
|
467
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
468
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
469
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
470
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
471
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
472
|
+
/** {@link Disposable.onDisposed} */
|
|
473
|
+
readonly onDisposed: Event<unknown>;
|
|
474
|
+
/** {@link Component.enabled} */
|
|
475
|
+
enabled: boolean;
|
|
476
|
+
/**
|
|
477
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
478
|
+
*/
|
|
479
|
+
list: Map<string, MiniMap>;
|
|
480
|
+
constructor(components: Components);
|
|
481
|
+
/**
|
|
482
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
483
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
484
|
+
*
|
|
485
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
486
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
487
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
488
|
+
*/
|
|
489
|
+
create(world: World): MiniMap;
|
|
490
|
+
/**
|
|
491
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
492
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
493
|
+
*
|
|
494
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
495
|
+
* @returns {void}
|
|
496
|
+
*/
|
|
497
|
+
delete(id: string): void;
|
|
498
|
+
/** {@link Disposable.dispose} */
|
|
499
|
+
dispose(): void;
|
|
500
|
+
/** {@link Updateable.update} */
|
|
501
|
+
update(): void;
|
|
455
502
|
}
|
|
456
503
|
import * as THREE from "three";
|
|
457
504
|
import { Components } from "../Components";
|
|
@@ -518,58 +565,92 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
518
565
|
private setOrthoPerspCameraAspect;
|
|
519
566
|
}
|
|
520
567
|
import * as THREE from "three";
|
|
521
|
-
|
|
522
|
-
center: THREE.Vector3;
|
|
523
|
-
halfSizes: THREE.Vector3;
|
|
524
|
-
rotation: THREE.Matrix3;
|
|
525
|
-
transformation: THREE.Matrix4;
|
|
526
|
-
};
|
|
527
|
-
import { MiniMap } from "./src";
|
|
528
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
529
|
-
import { Components } from "../Components";
|
|
568
|
+
import { Component, Components } from "../../core";
|
|
530
569
|
/**
|
|
531
|
-
*
|
|
570
|
+
* Represents an edge measurement result.
|
|
532
571
|
*/
|
|
533
|
-
export
|
|
572
|
+
export interface MeasureEdge {
|
|
573
|
+
/**
|
|
574
|
+
* The distance between the two points of the edge.
|
|
575
|
+
*/
|
|
576
|
+
distance: number;
|
|
577
|
+
/**
|
|
578
|
+
* The two points that define the edge.
|
|
579
|
+
*/
|
|
580
|
+
points: THREE.Vector3[];
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* 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).
|
|
584
|
+
*/
|
|
585
|
+
export declare class MeasurementUtils extends Component {
|
|
534
586
|
/**
|
|
535
587
|
* A unique identifier for the component.
|
|
536
588
|
* This UUID is used to register the component within the Components system.
|
|
537
589
|
*/
|
|
538
|
-
static
|
|
539
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
540
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
541
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
542
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
543
|
-
/** {@link Disposable.onDisposed} */
|
|
544
|
-
readonly onDisposed: Event<unknown>;
|
|
590
|
+
static uuid: string;
|
|
545
591
|
/** {@link Component.enabled} */
|
|
546
592
|
enabled: boolean;
|
|
593
|
+
constructor(components: Components);
|
|
547
594
|
/**
|
|
548
|
-
*
|
|
595
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
596
|
+
*
|
|
597
|
+
* @param point - The point from which to calculate the distance.
|
|
598
|
+
* @param lineStart - The start point of the line segment.
|
|
599
|
+
* @param lineEnd - The end point of the line segment.
|
|
600
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
601
|
+
* @returns The distance from the point to the line segment.
|
|
549
602
|
*/
|
|
550
|
-
|
|
551
|
-
constructor(components: Components);
|
|
603
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
552
604
|
/**
|
|
553
|
-
*
|
|
554
|
-
*
|
|
605
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
606
|
+
* It also returns the edges of the found face and their indices.
|
|
555
607
|
*
|
|
556
|
-
* @param
|
|
557
|
-
* @
|
|
558
|
-
* @
|
|
608
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
609
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
610
|
+
* @param instance - The instance of the mesh (optional).
|
|
611
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
559
612
|
*/
|
|
560
|
-
|
|
613
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
614
|
+
edges: MeasureEdge[];
|
|
615
|
+
indices: Set<number>;
|
|
616
|
+
} | null;
|
|
561
617
|
/**
|
|
562
|
-
*
|
|
563
|
-
*
|
|
618
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
619
|
+
* It also applies instance transformation if provided.
|
|
564
620
|
*
|
|
565
|
-
* @param
|
|
566
|
-
* @
|
|
621
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
622
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
623
|
+
* @param instance - The instance of the mesh (optional).
|
|
624
|
+
* @returns An object containing the vertices and normal of the face.
|
|
625
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
567
626
|
*/
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
627
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
628
|
+
p1: THREE.Vector3;
|
|
629
|
+
p2: THREE.Vector3;
|
|
630
|
+
p3: THREE.Vector3;
|
|
631
|
+
faceNormal: THREE.Vector3;
|
|
632
|
+
};
|
|
633
|
+
/**
|
|
634
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
635
|
+
* This is used to ensure numerical precision in edge detection.
|
|
636
|
+
*
|
|
637
|
+
* @param vector - The vector to round.
|
|
638
|
+
* @returns The vector with rounded components.
|
|
639
|
+
*/
|
|
640
|
+
round(vector: THREE.Vector3): void;
|
|
641
|
+
private getFaceData;
|
|
642
|
+
}
|
|
643
|
+
import * as THREE from "three";
|
|
644
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
645
|
+
center: THREE.Vector3;
|
|
646
|
+
halfSizes: THREE.Vector3;
|
|
647
|
+
rotation: THREE.Matrix3;
|
|
648
|
+
transformation: THREE.Matrix4;
|
|
649
|
+
};
|
|
650
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
651
|
+
import * as THREE from "three";
|
|
652
|
+
export declare class MaterialsUtils {
|
|
653
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
573
654
|
}
|
|
574
655
|
export declare class UUID {
|
|
575
656
|
private static _pattern;
|
|
@@ -577,11 +658,6 @@ export declare class UUID {
|
|
|
577
658
|
static create(): string;
|
|
578
659
|
static validate(uuid: string): void;
|
|
579
660
|
}
|
|
580
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
581
|
-
import * as THREE from "three";
|
|
582
|
-
export declare class MaterialsUtils {
|
|
583
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
584
|
-
}
|
|
585
661
|
import * as THREE from "three";
|
|
586
662
|
import { Component, Components, Disposable, Event, World } from "../core";
|
|
587
663
|
/**
|
|
@@ -696,31 +772,195 @@ export declare class VertexPicker extends Component implements Disposable {
|
|
|
696
772
|
}
|
|
697
773
|
import * as THREE from "three";
|
|
698
774
|
import * as FRAGS from "@thatopen/fragments";
|
|
699
|
-
import {
|
|
700
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
775
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
701
776
|
/**
|
|
702
|
-
*
|
|
777
|
+
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
|
|
703
778
|
*/
|
|
704
|
-
export
|
|
705
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
706
|
-
/** {@link Component.enabled} */
|
|
707
|
-
enabled: boolean;
|
|
708
|
-
/** {@link Disposable.onDisposed} */
|
|
709
|
-
readonly onDisposed: Event<unknown>;
|
|
710
|
-
private _absoluteMin;
|
|
711
|
-
private _absoluteMax;
|
|
712
|
-
private _meshes;
|
|
713
|
-
constructor(components: Components);
|
|
779
|
+
export interface Classification {
|
|
714
780
|
/**
|
|
715
|
-
* A
|
|
716
|
-
*
|
|
717
|
-
* @param bbox - The bounding box to calculate the dimensions for.
|
|
718
|
-
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
781
|
+
* A system within the classification.
|
|
782
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
719
783
|
*/
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
784
|
+
[system: string]: {
|
|
785
|
+
/**
|
|
786
|
+
* A class within the system.
|
|
787
|
+
* The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
|
|
788
|
+
*/
|
|
789
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* 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).
|
|
794
|
+
*/
|
|
795
|
+
export declare class Classifier extends Component implements Disposable {
|
|
796
|
+
/**
|
|
797
|
+
* A unique identifier for the component.
|
|
798
|
+
* This UUID is used to register the component within the Components system.
|
|
799
|
+
*/
|
|
800
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
801
|
+
/** {@link Component.enabled} */
|
|
802
|
+
enabled: boolean;
|
|
803
|
+
/**
|
|
804
|
+
* A map representing the classification systems.
|
|
805
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
806
|
+
*/
|
|
807
|
+
list: Classification;
|
|
808
|
+
/** {@link Disposable.onDisposed} */
|
|
809
|
+
readonly onDisposed: Event<unknown>;
|
|
810
|
+
constructor(components: Components);
|
|
811
|
+
private onFragmentsDisposed;
|
|
812
|
+
/** {@link Disposable.dispose} */
|
|
813
|
+
dispose(): void;
|
|
814
|
+
/**
|
|
815
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
816
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
817
|
+
*
|
|
818
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
819
|
+
*/
|
|
820
|
+
remove(guid: string): void;
|
|
821
|
+
/**
|
|
822
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
823
|
+
* If no filter is provided, it returns all fragments.
|
|
824
|
+
*
|
|
825
|
+
* @param filter - An optional object containing filter criteria.
|
|
826
|
+
* The keys of the object represent the classification system names,
|
|
827
|
+
* and the values are arrays of class names to match.
|
|
828
|
+
*
|
|
829
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
830
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
831
|
+
*
|
|
832
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
833
|
+
*/
|
|
834
|
+
find(filter?: {
|
|
835
|
+
[name: string]: string[];
|
|
836
|
+
}): FRAGS.FragmentIdMap;
|
|
837
|
+
/**
|
|
838
|
+
* Classifies fragments based on their modelID.
|
|
839
|
+
*
|
|
840
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
841
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
842
|
+
*
|
|
843
|
+
* @remarks
|
|
844
|
+
* This method iterates through the fragments in the provided group,
|
|
845
|
+
* and classifies them based on their modelID.
|
|
846
|
+
* The classification is stored in the 'list.models' property,
|
|
847
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
848
|
+
*
|
|
849
|
+
*/
|
|
850
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
851
|
+
/**
|
|
852
|
+
* Classifies fragments based on their PredefinedType property.
|
|
853
|
+
*
|
|
854
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
855
|
+
*
|
|
856
|
+
* @remarks
|
|
857
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
858
|
+
* and classifies them based on their PredefinedType property.
|
|
859
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
860
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
861
|
+
*
|
|
862
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
863
|
+
*/
|
|
864
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
865
|
+
/**
|
|
866
|
+
* Classifies fragments based on their entity type.
|
|
867
|
+
*
|
|
868
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
869
|
+
*
|
|
870
|
+
* @remarks
|
|
871
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
872
|
+
* and classifies them based on their entity type.
|
|
873
|
+
* The classification is stored in the 'list.entities' property,
|
|
874
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
875
|
+
*
|
|
876
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
877
|
+
*/
|
|
878
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
879
|
+
/**
|
|
880
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
881
|
+
*
|
|
882
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
883
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
884
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
885
|
+
*
|
|
886
|
+
* @remarks
|
|
887
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
888
|
+
* and classifies them based on the specified IFC relationship.
|
|
889
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
890
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
891
|
+
*
|
|
892
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
893
|
+
*/
|
|
894
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
895
|
+
/**
|
|
896
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
897
|
+
*
|
|
898
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
899
|
+
*
|
|
900
|
+
* @remarks
|
|
901
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
902
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
903
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
904
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
905
|
+
*
|
|
906
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
907
|
+
*/
|
|
908
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
909
|
+
/**
|
|
910
|
+
* Sets the color of the specified fragments.
|
|
911
|
+
*
|
|
912
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
913
|
+
* @param color - The color to set for the fragments.
|
|
914
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
915
|
+
*
|
|
916
|
+
* @remarks
|
|
917
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
918
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
919
|
+
*
|
|
920
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
921
|
+
*/
|
|
922
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
923
|
+
/**
|
|
924
|
+
* Resets the color of the specified fragments to their original color.
|
|
925
|
+
*
|
|
926
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
927
|
+
*
|
|
928
|
+
* @remarks
|
|
929
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
930
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
931
|
+
*
|
|
932
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
933
|
+
*/
|
|
934
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
935
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
936
|
+
}
|
|
937
|
+
import * as THREE from "three";
|
|
938
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
939
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
940
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
941
|
+
/**
|
|
942
|
+
* 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).
|
|
943
|
+
*/
|
|
944
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
945
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
946
|
+
/** {@link Component.enabled} */
|
|
947
|
+
enabled: boolean;
|
|
948
|
+
/** {@link Disposable.onDisposed} */
|
|
949
|
+
readonly onDisposed: Event<unknown>;
|
|
950
|
+
private _absoluteMin;
|
|
951
|
+
private _absoluteMax;
|
|
952
|
+
private _meshes;
|
|
953
|
+
constructor(components: Components);
|
|
954
|
+
/**
|
|
955
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
956
|
+
*
|
|
957
|
+
* @param bbox - The bounding box to calculate the dimensions for.
|
|
958
|
+
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
959
|
+
*/
|
|
960
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
961
|
+
width: number;
|
|
962
|
+
height: number;
|
|
963
|
+
depth: number;
|
|
724
964
|
center: THREE.Vector3;
|
|
725
965
|
};
|
|
726
966
|
/**
|
|
@@ -879,82 +1119,6 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
879
1119
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
880
1120
|
private static getFragmentBounds;
|
|
881
1121
|
}
|
|
882
|
-
import * as THREE from "three";
|
|
883
|
-
import { Component, Components } from "../../core";
|
|
884
|
-
/**
|
|
885
|
-
* Represents an edge measurement result.
|
|
886
|
-
*/
|
|
887
|
-
export interface MeasureEdge {
|
|
888
|
-
/**
|
|
889
|
-
* The distance between the two points of the edge.
|
|
890
|
-
*/
|
|
891
|
-
distance: number;
|
|
892
|
-
/**
|
|
893
|
-
* The two points that define the edge.
|
|
894
|
-
*/
|
|
895
|
-
points: THREE.Vector3[];
|
|
896
|
-
}
|
|
897
|
-
/**
|
|
898
|
-
* 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).
|
|
899
|
-
*/
|
|
900
|
-
export declare class MeasurementUtils extends Component {
|
|
901
|
-
/**
|
|
902
|
-
* A unique identifier for the component.
|
|
903
|
-
* This UUID is used to register the component within the Components system.
|
|
904
|
-
*/
|
|
905
|
-
static uuid: string;
|
|
906
|
-
/** {@link Component.enabled} */
|
|
907
|
-
enabled: boolean;
|
|
908
|
-
constructor(components: Components);
|
|
909
|
-
/**
|
|
910
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
911
|
-
*
|
|
912
|
-
* @param point - The point from which to calculate the distance.
|
|
913
|
-
* @param lineStart - The start point of the line segment.
|
|
914
|
-
* @param lineEnd - The end point of the line segment.
|
|
915
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
916
|
-
* @returns The distance from the point to the line segment.
|
|
917
|
-
*/
|
|
918
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
919
|
-
/**
|
|
920
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
921
|
-
* It also returns the edges of the found face and their indices.
|
|
922
|
-
*
|
|
923
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
924
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
925
|
-
* @param instance - The instance of the mesh (optional).
|
|
926
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
927
|
-
*/
|
|
928
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
929
|
-
edges: MeasureEdge[];
|
|
930
|
-
indices: Set<number>;
|
|
931
|
-
} | null;
|
|
932
|
-
/**
|
|
933
|
-
* Method to get the vertices and normal of a mesh face at a given index.
|
|
934
|
-
* It also applies instance transformation if provided.
|
|
935
|
-
*
|
|
936
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
937
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
938
|
-
* @param instance - The instance of the mesh (optional).
|
|
939
|
-
* @returns An object containing the vertices and normal of the face.
|
|
940
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
941
|
-
*/
|
|
942
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
943
|
-
p1: THREE.Vector3;
|
|
944
|
-
p2: THREE.Vector3;
|
|
945
|
-
p3: THREE.Vector3;
|
|
946
|
-
faceNormal: THREE.Vector3;
|
|
947
|
-
};
|
|
948
|
-
/**
|
|
949
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
950
|
-
* This is used to ensure numerical precision in edge detection.
|
|
951
|
-
*
|
|
952
|
-
* @param vector - The vector to round.
|
|
953
|
-
* @returns The vector with rounded components.
|
|
954
|
-
*/
|
|
955
|
-
round(vector: THREE.Vector3): void;
|
|
956
|
-
private getFaceData;
|
|
957
|
-
}
|
|
958
1122
|
import * as FRAGS from "@thatopen/fragments";
|
|
959
1123
|
import { Components, Component } from "../../core";
|
|
960
1124
|
/**
|
|
@@ -1044,6 +1208,71 @@ export declare class Exploder extends Component implements Disposable {
|
|
|
1044
1208
|
set(active: boolean): void;
|
|
1045
1209
|
}
|
|
1046
1210
|
import * as WEBIFC from "web-ifc";
|
|
1211
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1212
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1213
|
+
/**
|
|
1214
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1215
|
+
*/
|
|
1216
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1217
|
+
/**
|
|
1218
|
+
* A unique identifier for the component.
|
|
1219
|
+
* This UUID is used to register the component within the Components system.
|
|
1220
|
+
*/
|
|
1221
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1222
|
+
/**
|
|
1223
|
+
* An event that is triggered when properties are streamed from the IFC file.
|
|
1224
|
+
* The event provides the type of the IFC entity and the corresponding data.
|
|
1225
|
+
*/
|
|
1226
|
+
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1227
|
+
type: number;
|
|
1228
|
+
data: {
|
|
1229
|
+
[id: number]: any;
|
|
1230
|
+
};
|
|
1231
|
+
}>;
|
|
1232
|
+
/**
|
|
1233
|
+
* An event that is triggered to indicate the progress of the streaming process.
|
|
1234
|
+
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1235
|
+
*/
|
|
1236
|
+
readonly onProgress: AsyncEvent<number>;
|
|
1237
|
+
/**
|
|
1238
|
+
* An event that is triggered when indices are streamed from the IFC file.
|
|
1239
|
+
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1240
|
+
*/
|
|
1241
|
+
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1242
|
+
/** {@link Disposable.onDisposed} */
|
|
1243
|
+
readonly onDisposed: Event<string>;
|
|
1244
|
+
/** {@link Component.enabled} */
|
|
1245
|
+
enabled: boolean;
|
|
1246
|
+
/**
|
|
1247
|
+
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1248
|
+
*/
|
|
1249
|
+
settings: PropertiesStreamingSettings;
|
|
1250
|
+
/**
|
|
1251
|
+
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1252
|
+
*/
|
|
1253
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1254
|
+
/** {@link Disposable.dispose} */
|
|
1255
|
+
dispose(): Promise<void>;
|
|
1256
|
+
/**
|
|
1257
|
+
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1258
|
+
*
|
|
1259
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1260
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1261
|
+
*/
|
|
1262
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1263
|
+
/**
|
|
1264
|
+
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1265
|
+
*
|
|
1266
|
+
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1267
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1268
|
+
*/
|
|
1269
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1270
|
+
private readIfcFile;
|
|
1271
|
+
private streamIfcFile;
|
|
1272
|
+
private streamAllProperties;
|
|
1273
|
+
private cleanUp;
|
|
1274
|
+
}
|
|
1275
|
+
import * as WEBIFC from "web-ifc";
|
|
1047
1276
|
import * as FRAGS from "@thatopen/fragments";
|
|
1048
1277
|
import { IfcFragmentSettings } from "./src";
|
|
1049
1278
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
@@ -1369,96 +1598,6 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
|
1369
1598
|
private streamGeometries;
|
|
1370
1599
|
}
|
|
1371
1600
|
import * as WEBIFC from "web-ifc";
|
|
1372
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1373
|
-
import { PropertiesStreamingSettings } from "./src";
|
|
1374
|
-
/**
|
|
1375
|
-
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1376
|
-
*/
|
|
1377
|
-
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1378
|
-
/**
|
|
1379
|
-
* A unique identifier for the component.
|
|
1380
|
-
* This UUID is used to register the component within the Components system.
|
|
1381
|
-
*/
|
|
1382
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1383
|
-
/**
|
|
1384
|
-
* An event that is triggered when properties are streamed from the IFC file.
|
|
1385
|
-
* The event provides the type of the IFC entity and the corresponding data.
|
|
1386
|
-
*/
|
|
1387
|
-
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1388
|
-
type: number;
|
|
1389
|
-
data: {
|
|
1390
|
-
[id: number]: any;
|
|
1391
|
-
};
|
|
1392
|
-
}>;
|
|
1393
|
-
/**
|
|
1394
|
-
* An event that is triggered to indicate the progress of the streaming process.
|
|
1395
|
-
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1396
|
-
*/
|
|
1397
|
-
readonly onProgress: AsyncEvent<number>;
|
|
1398
|
-
/**
|
|
1399
|
-
* An event that is triggered when indices are streamed from the IFC file.
|
|
1400
|
-
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1401
|
-
*/
|
|
1402
|
-
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1403
|
-
/** {@link Disposable.onDisposed} */
|
|
1404
|
-
readonly onDisposed: Event<string>;
|
|
1405
|
-
/** {@link Component.enabled} */
|
|
1406
|
-
enabled: boolean;
|
|
1407
|
-
/**
|
|
1408
|
-
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1409
|
-
*/
|
|
1410
|
-
settings: PropertiesStreamingSettings;
|
|
1411
|
-
/**
|
|
1412
|
-
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1413
|
-
*/
|
|
1414
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1415
|
-
/** {@link Disposable.dispose} */
|
|
1416
|
-
dispose(): Promise<void>;
|
|
1417
|
-
/**
|
|
1418
|
-
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1419
|
-
*
|
|
1420
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1421
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1422
|
-
*/
|
|
1423
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1424
|
-
/**
|
|
1425
|
-
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1426
|
-
*
|
|
1427
|
-
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1428
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1429
|
-
*/
|
|
1430
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1431
|
-
private readIfcFile;
|
|
1432
|
-
private streamIfcFile;
|
|
1433
|
-
private streamAllProperties;
|
|
1434
|
-
private cleanUp;
|
|
1435
|
-
}
|
|
1436
|
-
import * as WEBIFC from "web-ifc";
|
|
1437
|
-
import * as FRAG from "@thatopen/fragments";
|
|
1438
|
-
import { Component, Components } from "../../core";
|
|
1439
|
-
/**
|
|
1440
|
-
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1441
|
-
*/
|
|
1442
|
-
export declare class IfcJsonExporter extends Component {
|
|
1443
|
-
/**
|
|
1444
|
-
* A unique identifier for the component.
|
|
1445
|
-
* This UUID is used to register the component within the Components system.
|
|
1446
|
-
*/
|
|
1447
|
-
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1448
|
-
/** {@link Component.enabled} */
|
|
1449
|
-
enabled: boolean;
|
|
1450
|
-
constructor(components: Components);
|
|
1451
|
-
/**
|
|
1452
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
1453
|
-
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1454
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
1455
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
1456
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1457
|
-
* to make the location data available (e.g. absolute position of building).
|
|
1458
|
-
*/
|
|
1459
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1460
|
-
}
|
|
1461
|
-
import * as WEBIFC from "web-ifc";
|
|
1462
1601
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1463
1602
|
import { Disposable, Event, Component, Components } from "../../core";
|
|
1464
1603
|
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
@@ -1599,222 +1738,58 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
1599
1738
|
/** {@link Disposable.dispose} */
|
|
1600
1739
|
dispose(): void;
|
|
1601
1740
|
}
|
|
1602
|
-
import * as
|
|
1603
|
-
import
|
|
1604
|
-
import {
|
|
1741
|
+
import * as WEBIFC from "web-ifc";
|
|
1742
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1743
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1605
1744
|
/**
|
|
1606
|
-
*
|
|
1745
|
+
* Types for boolean properties in IFC schema.
|
|
1607
1746
|
*/
|
|
1608
|
-
export
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1747
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1748
|
+
/**
|
|
1749
|
+
* Types for string properties in IFC schema.
|
|
1750
|
+
*/
|
|
1751
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1752
|
+
/**
|
|
1753
|
+
* Types for numeric properties in IFC schema.
|
|
1754
|
+
*/
|
|
1755
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1756
|
+
/**
|
|
1757
|
+
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1758
|
+
*/
|
|
1759
|
+
export interface ChangeMap {
|
|
1760
|
+
[modelID: string]: Set<number>;
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1764
|
+
*/
|
|
1765
|
+
export interface AttributeListener {
|
|
1766
|
+
[modelID: string]: {
|
|
1767
|
+
[expressID: number]: {
|
|
1768
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1769
|
+
};
|
|
1619
1770
|
};
|
|
1620
1771
|
}
|
|
1621
1772
|
/**
|
|
1622
|
-
*
|
|
1773
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1623
1774
|
*/
|
|
1624
|
-
export declare class
|
|
1775
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1625
1776
|
/**
|
|
1626
1777
|
* A unique identifier for the component.
|
|
1627
1778
|
* This UUID is used to register the component within the Components system.
|
|
1628
1779
|
*/
|
|
1629
|
-
static readonly uuid: "
|
|
1630
|
-
/** {@link Component.enabled} */
|
|
1631
|
-
enabled: boolean;
|
|
1632
|
-
/**
|
|
1633
|
-
* A map representing the classification systems.
|
|
1634
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
1635
|
-
*/
|
|
1636
|
-
list: Classification;
|
|
1780
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1637
1781
|
/** {@link Disposable.onDisposed} */
|
|
1638
|
-
readonly onDisposed: Event<
|
|
1639
|
-
constructor(components: Components);
|
|
1640
|
-
private onFragmentsDisposed;
|
|
1641
|
-
/** {@link Disposable.dispose} */
|
|
1642
|
-
dispose(): void;
|
|
1782
|
+
readonly onDisposed: Event<string>;
|
|
1643
1783
|
/**
|
|
1644
|
-
*
|
|
1645
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
1646
|
-
*
|
|
1647
|
-
* @param guid - The unique identifier of the fragment to be removed.
|
|
1784
|
+
* Event triggered when a file is requested for export.
|
|
1648
1785
|
*/
|
|
1649
|
-
|
|
1786
|
+
readonly onRequestFile: Event<unknown>;
|
|
1650
1787
|
/**
|
|
1651
|
-
*
|
|
1652
|
-
* If no filter is provided, it returns all fragments.
|
|
1653
|
-
*
|
|
1654
|
-
* @param filter - An optional object containing filter criteria.
|
|
1655
|
-
* The keys of the object represent the classification system names,
|
|
1656
|
-
* and the values are arrays of class names to match.
|
|
1657
|
-
*
|
|
1658
|
-
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
1659
|
-
* where the express IDs are filtered based on the provided filter criteria.
|
|
1660
|
-
*
|
|
1661
|
-
* @throws Will throw an error if the fragments map is malformed.
|
|
1788
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1662
1789
|
*/
|
|
1663
|
-
|
|
1664
|
-
[name: string]: string[];
|
|
1665
|
-
}): FRAGS.FragmentIdMap;
|
|
1790
|
+
ifcToExport: ArrayBuffer | null;
|
|
1666
1791
|
/**
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
1669
|
-
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
1670
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1671
|
-
*
|
|
1672
|
-
* @remarks
|
|
1673
|
-
* This method iterates through the fragments in the provided group,
|
|
1674
|
-
* and classifies them based on their modelID.
|
|
1675
|
-
* The classification is stored in the 'list.models' property,
|
|
1676
|
-
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1677
|
-
*
|
|
1678
|
-
*/
|
|
1679
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
1680
|
-
/**
|
|
1681
|
-
* Classifies fragments based on their PredefinedType property.
|
|
1682
|
-
*
|
|
1683
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1684
|
-
*
|
|
1685
|
-
* @remarks
|
|
1686
|
-
* This method iterates through the properties of the fragments in the provided group,
|
|
1687
|
-
* and classifies them based on their PredefinedType property.
|
|
1688
|
-
* The classification is stored in the 'list.predefinedTypes' property,
|
|
1689
|
-
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1690
|
-
*
|
|
1691
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
1692
|
-
*/
|
|
1693
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
1694
|
-
/**
|
|
1695
|
-
* Classifies fragments based on their entity type.
|
|
1696
|
-
*
|
|
1697
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1698
|
-
*
|
|
1699
|
-
* @remarks
|
|
1700
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
1701
|
-
* and classifies them based on their entity type.
|
|
1702
|
-
* The classification is stored in the 'list.entities' property,
|
|
1703
|
-
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1704
|
-
*
|
|
1705
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
1706
|
-
*/
|
|
1707
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
1708
|
-
/**
|
|
1709
|
-
* Classifies fragments based on a specific IFC relationship.
|
|
1710
|
-
*
|
|
1711
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1712
|
-
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
1713
|
-
* @param systemName - The name of the classification system to store the classification.
|
|
1714
|
-
*
|
|
1715
|
-
* @remarks
|
|
1716
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
1717
|
-
* and classifies them based on the specified IFC relationship.
|
|
1718
|
-
* The classification is stored in the 'list' property under the specified system name,
|
|
1719
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1720
|
-
*
|
|
1721
|
-
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
1722
|
-
*/
|
|
1723
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
1724
|
-
/**
|
|
1725
|
-
* Classifies fragments based on their spatial structure in the IFC model.
|
|
1726
|
-
*
|
|
1727
|
-
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
1728
|
-
*
|
|
1729
|
-
* @remarks
|
|
1730
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
1731
|
-
* and classifies them based on their spatial structure in the IFC model.
|
|
1732
|
-
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
1733
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1734
|
-
*
|
|
1735
|
-
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
1736
|
-
*/
|
|
1737
|
-
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
1738
|
-
/**
|
|
1739
|
-
* Sets the color of the specified fragments.
|
|
1740
|
-
*
|
|
1741
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1742
|
-
* @param color - The color to set for the fragments.
|
|
1743
|
-
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
1744
|
-
*
|
|
1745
|
-
* @remarks
|
|
1746
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1747
|
-
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
1748
|
-
*
|
|
1749
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1750
|
-
*/
|
|
1751
|
-
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
1752
|
-
/**
|
|
1753
|
-
* Resets the color of the specified fragments to their original color.
|
|
1754
|
-
*
|
|
1755
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1756
|
-
*
|
|
1757
|
-
* @remarks
|
|
1758
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1759
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
1760
|
-
*
|
|
1761
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1762
|
-
*/
|
|
1763
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1764
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
1765
|
-
}
|
|
1766
|
-
import * as WEBIFC from "web-ifc";
|
|
1767
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1768
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1769
|
-
/**
|
|
1770
|
-
* Types for boolean properties in IFC schema.
|
|
1771
|
-
*/
|
|
1772
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1773
|
-
/**
|
|
1774
|
-
* Types for string properties in IFC schema.
|
|
1775
|
-
*/
|
|
1776
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1777
|
-
/**
|
|
1778
|
-
* Types for numeric properties in IFC schema.
|
|
1779
|
-
*/
|
|
1780
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1781
|
-
/**
|
|
1782
|
-
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1783
|
-
*/
|
|
1784
|
-
export interface ChangeMap {
|
|
1785
|
-
[modelID: string]: Set<number>;
|
|
1786
|
-
}
|
|
1787
|
-
/**
|
|
1788
|
-
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1789
|
-
*/
|
|
1790
|
-
export interface AttributeListener {
|
|
1791
|
-
[modelID: string]: {
|
|
1792
|
-
[expressID: number]: {
|
|
1793
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1794
|
-
};
|
|
1795
|
-
};
|
|
1796
|
-
}
|
|
1797
|
-
/**
|
|
1798
|
-
* Component to manage and edit properties and Psets in IFC files.
|
|
1799
|
-
*/
|
|
1800
|
-
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1801
|
-
/**
|
|
1802
|
-
* A unique identifier for the component.
|
|
1803
|
-
* This UUID is used to register the component within the Components system.
|
|
1804
|
-
*/
|
|
1805
|
-
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1806
|
-
/** {@link Disposable.onDisposed} */
|
|
1807
|
-
readonly onDisposed: Event<string>;
|
|
1808
|
-
/**
|
|
1809
|
-
* Event triggered when a file is requested for export.
|
|
1810
|
-
*/
|
|
1811
|
-
readonly onRequestFile: Event<unknown>;
|
|
1812
|
-
/**
|
|
1813
|
-
* ArrayBuffer containing the IFC data to be exported.
|
|
1814
|
-
*/
|
|
1815
|
-
ifcToExport: ArrayBuffer | null;
|
|
1816
|
-
/**
|
|
1817
|
-
* Event triggered when an element is added to a Pset.
|
|
1792
|
+
* Event triggered when an element is added to a Pset.
|
|
1818
1793
|
*/
|
|
1819
1794
|
readonly onElementToPset: Event<{
|
|
1820
1795
|
model: FragmentsGroup;
|
|
@@ -2020,52 +1995,29 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
2020
1995
|
private newSingleProperty;
|
|
2021
1996
|
}
|
|
2022
1997
|
import * as WEBIFC from "web-ifc";
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
* like IFCSPACE.
|
|
2030
|
-
*/
|
|
2031
|
-
optionalCategories: number[];
|
|
2032
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
2033
|
-
coordinate: boolean;
|
|
2034
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2035
|
-
wasm: {
|
|
2036
|
-
path: string;
|
|
2037
|
-
absolute: boolean;
|
|
2038
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2039
|
-
};
|
|
2040
|
-
/** List of categories that won't be converted to fragments. */
|
|
2041
|
-
excludedCategories: Set<number>;
|
|
2042
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
2043
|
-
saveLocations: boolean;
|
|
2044
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2045
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
1998
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1999
|
+
import { Component, Components } from "../../core";
|
|
2000
|
+
/**
|
|
2001
|
+
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
2002
|
+
*/
|
|
2003
|
+
export declare class IfcJsonExporter extends Component {
|
|
2046
2004
|
/**
|
|
2047
|
-
*
|
|
2048
|
-
*
|
|
2049
|
-
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2050
|
-
* Default value is true.
|
|
2005
|
+
* A unique identifier for the component.
|
|
2006
|
+
* This UUID is used to register the component within the Components system.
|
|
2051
2007
|
*/
|
|
2052
|
-
|
|
2008
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
2009
|
+
/** {@link Component.enabled} */
|
|
2010
|
+
enabled: boolean;
|
|
2011
|
+
constructor(components: Components);
|
|
2053
2012
|
/**
|
|
2054
|
-
*
|
|
2055
|
-
*
|
|
2056
|
-
*
|
|
2057
|
-
*
|
|
2058
|
-
* @param
|
|
2059
|
-
*
|
|
2013
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
2014
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
2015
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
2016
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
2017
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
2018
|
+
* to make the location data available (e.g. absolute position of building).
|
|
2060
2019
|
*/
|
|
2061
|
-
|
|
2062
|
-
}
|
|
2063
|
-
import * as WEBIFC from "web-ifc";
|
|
2064
|
-
export interface IfcItemsCategories {
|
|
2065
|
-
[itemID: number]: number;
|
|
2066
|
-
}
|
|
2067
|
-
export declare class IfcCategories {
|
|
2068
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2020
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
2069
2021
|
}
|
|
2070
2022
|
import * as THREE from "three";
|
|
2071
2023
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
@@ -2157,22 +2109,9 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2157
2109
|
private updatePlanes;
|
|
2158
2110
|
}
|
|
2159
2111
|
/**
|
|
2160
|
-
* A
|
|
2161
|
-
*/
|
|
2162
|
-
export declare const IfcCategoryMap: {
|
|
2163
|
-
[key: number]: string;
|
|
2164
|
-
};
|
|
2165
|
-
/**
|
|
2166
|
-
* 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.
|
|
2167
|
-
*
|
|
2168
|
-
* @remarks
|
|
2169
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2170
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2171
|
-
*
|
|
2112
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2172
2113
|
*/
|
|
2173
|
-
export declare const
|
|
2174
|
-
[key: number]: string;
|
|
2175
|
-
};
|
|
2114
|
+
export declare const GeometryTypes: Set<number>;
|
|
2176
2115
|
import * as WEBIFC from "web-ifc";
|
|
2177
2116
|
import { IfcItemsCategories } from "../../../ifc";
|
|
2178
2117
|
export declare class SpatialStructure {
|
|
@@ -2181,52 +2120,329 @@ export declare class SpatialStructure {
|
|
|
2181
2120
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2182
2121
|
cleanUp(): void;
|
|
2183
2122
|
}
|
|
2184
|
-
import * as
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
}>;
|
|
2193
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2194
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2195
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2196
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2197
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2198
|
-
key: string | null;
|
|
2199
|
-
name: string | null;
|
|
2200
|
-
}>;
|
|
2201
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2202
|
-
key: string | null;
|
|
2203
|
-
value: number | null;
|
|
2204
|
-
}>;
|
|
2205
|
-
static isRel(expressID: number): boolean;
|
|
2206
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2207
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2208
|
-
}
|
|
2209
|
-
/**
|
|
2210
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2211
|
-
*/
|
|
2212
|
-
export declare const GeometryTypes: Set<number>;
|
|
2213
|
-
import { InverseAttribute } from "./types";
|
|
2214
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2215
|
-
forRelating: InverseAttribute;
|
|
2216
|
-
forRelated: InverseAttribute;
|
|
2217
|
-
}>;
|
|
2218
|
-
import { Base } from "./base";
|
|
2219
|
-
/**
|
|
2220
|
-
* 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.
|
|
2221
|
-
*/
|
|
2222
|
-
export declare abstract class Component extends Base {
|
|
2223
|
-
/**
|
|
2224
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
2225
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2226
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2227
|
-
* will not be updated automatically each frame.
|
|
2123
|
+
import * as WEBIFC from "web-ifc";
|
|
2124
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2125
|
+
export declare class IfcFragmentSettings {
|
|
2126
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2127
|
+
includeProperties: boolean;
|
|
2128
|
+
/**
|
|
2129
|
+
* Generate the geometry for categories that are not included by default,
|
|
2130
|
+
* like IFCSPACE.
|
|
2228
2131
|
*/
|
|
2229
|
-
|
|
2132
|
+
optionalCategories: number[];
|
|
2133
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2134
|
+
coordinate: boolean;
|
|
2135
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2136
|
+
wasm: {
|
|
2137
|
+
path: string;
|
|
2138
|
+
absolute: boolean;
|
|
2139
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2140
|
+
};
|
|
2141
|
+
/** List of categories that won't be converted to fragments. */
|
|
2142
|
+
excludedCategories: Set<number>;
|
|
2143
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2144
|
+
saveLocations: boolean;
|
|
2145
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2146
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2147
|
+
/**
|
|
2148
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2149
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2150
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2151
|
+
* Default value is true.
|
|
2152
|
+
*/
|
|
2153
|
+
autoSetWasm: boolean;
|
|
2154
|
+
/**
|
|
2155
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2156
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2157
|
+
* If set to null, the default file location handler will be used.
|
|
2158
|
+
*
|
|
2159
|
+
* @param url - The URL of the file to locate.
|
|
2160
|
+
* @returns The absolute path of the file.
|
|
2161
|
+
*/
|
|
2162
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2163
|
+
}
|
|
2164
|
+
import * as WEBIFC from "web-ifc";
|
|
2165
|
+
export interface IfcItemsCategories {
|
|
2166
|
+
[itemID: number]: number;
|
|
2167
|
+
}
|
|
2168
|
+
export declare class IfcCategories {
|
|
2169
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* 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.
|
|
2173
|
+
*
|
|
2174
|
+
* @remarks
|
|
2175
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2176
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2177
|
+
*
|
|
2178
|
+
*/
|
|
2179
|
+
export declare const IfcElements: {
|
|
2180
|
+
[key: number]: string;
|
|
2181
|
+
};
|
|
2182
|
+
/**
|
|
2183
|
+
* 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.
|
|
2184
|
+
*/
|
|
2185
|
+
export declare const IfcCategoryMap: {
|
|
2186
|
+
[key: number]: string;
|
|
2187
|
+
};
|
|
2188
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2189
|
+
export declare class IfcPropertiesUtils {
|
|
2190
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2191
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2192
|
+
[attribute: string]: any;
|
|
2193
|
+
} | null>;
|
|
2194
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2195
|
+
[relatingID: number]: number[];
|
|
2196
|
+
}>;
|
|
2197
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2198
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2199
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2200
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2201
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2202
|
+
key: string | null;
|
|
2203
|
+
name: string | null;
|
|
2204
|
+
}>;
|
|
2205
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2206
|
+
key: string | null;
|
|
2207
|
+
value: number | null;
|
|
2208
|
+
}>;
|
|
2209
|
+
static isRel(expressID: number): boolean;
|
|
2210
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2211
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2212
|
+
}
|
|
2213
|
+
import * as THREE from "three";
|
|
2214
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2215
|
+
/**
|
|
2216
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
2217
|
+
*
|
|
2218
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
2219
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
2220
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2221
|
+
*/
|
|
2222
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
2223
|
+
/**
|
|
2224
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
2225
|
+
*/
|
|
2226
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2227
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2228
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
2229
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2230
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
2231
|
+
/** {@link Disposable.onDisposed} */
|
|
2232
|
+
readonly onDisposed: Event<unknown>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
2235
|
+
*/
|
|
2236
|
+
isDisposing: boolean;
|
|
2237
|
+
/**
|
|
2238
|
+
* Indicates whether the world is currently enabled.
|
|
2239
|
+
* When disabled, the world will not be updated.
|
|
2240
|
+
*/
|
|
2241
|
+
enabled: boolean;
|
|
2242
|
+
/**
|
|
2243
|
+
* A unique identifier for the world.
|
|
2244
|
+
*/
|
|
2245
|
+
uuid: string;
|
|
2246
|
+
/**
|
|
2247
|
+
* An optional name for the world.
|
|
2248
|
+
*/
|
|
2249
|
+
name?: string;
|
|
2250
|
+
private _scene?;
|
|
2251
|
+
private _camera?;
|
|
2252
|
+
private _renderer;
|
|
2253
|
+
/**
|
|
2254
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
2255
|
+
* @returns The current scene.
|
|
2256
|
+
*/
|
|
2257
|
+
get scene(): T;
|
|
2258
|
+
/**
|
|
2259
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
2260
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
2261
|
+
* @param scene - The new scene to be set.
|
|
2262
|
+
*/
|
|
2263
|
+
set scene(scene: T);
|
|
2264
|
+
/**
|
|
2265
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
2266
|
+
* @returns The current camera.
|
|
2267
|
+
*/
|
|
2268
|
+
get camera(): U;
|
|
2269
|
+
/**
|
|
2270
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
2271
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
2272
|
+
* @param camera - The new camera to be set.
|
|
2273
|
+
*/
|
|
2274
|
+
set camera(camera: U);
|
|
2275
|
+
/**
|
|
2276
|
+
* Getter for the renderer.
|
|
2277
|
+
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
2278
|
+
*/
|
|
2279
|
+
get renderer(): S | null;
|
|
2280
|
+
/**
|
|
2281
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
2282
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
2283
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
2284
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
2285
|
+
*/
|
|
2286
|
+
set renderer(renderer: S | null);
|
|
2287
|
+
/** {@link Updateable.update} */
|
|
2288
|
+
update(delta?: number): void;
|
|
2289
|
+
/** {@link Disposable.dispose} */
|
|
2290
|
+
dispose(disposeResources?: boolean): void;
|
|
2291
|
+
}
|
|
2292
|
+
import * as THREE from "three";
|
|
2293
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2294
|
+
import { Components } from "../../Components";
|
|
2295
|
+
/**
|
|
2296
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
2297
|
+
*/
|
|
2298
|
+
export interface SimpleSceneConfig {
|
|
2299
|
+
directionalLight: {
|
|
2300
|
+
color: THREE.Color;
|
|
2301
|
+
intensity: number;
|
|
2302
|
+
position: THREE.Vector3;
|
|
2303
|
+
};
|
|
2304
|
+
ambientLight: {
|
|
2305
|
+
color: THREE.Color;
|
|
2306
|
+
intensity: number;
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
2311
|
+
*/
|
|
2312
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2313
|
+
/** {@link Configurable.isSetup} */
|
|
2314
|
+
isSetup: boolean;
|
|
2315
|
+
/**
|
|
2316
|
+
* The underlying Three.js scene object.
|
|
2317
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2318
|
+
*/
|
|
2319
|
+
three: THREE.Scene;
|
|
2320
|
+
/** {@link Configurable.onSetup} */
|
|
2321
|
+
readonly onSetup: Event<SimpleScene>;
|
|
2322
|
+
/**
|
|
2323
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
2324
|
+
* Defines properties for directional and ambient lights.
|
|
2325
|
+
*/
|
|
2326
|
+
config: Required<SimpleSceneConfig>;
|
|
2327
|
+
constructor(components: Components);
|
|
2328
|
+
/** {@link Configurable.setup} */
|
|
2329
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2330
|
+
}
|
|
2331
|
+
import * as THREE from "three";
|
|
2332
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
2333
|
+
import { Components } from "../../Components";
|
|
2334
|
+
/**
|
|
2335
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2336
|
+
*/
|
|
2337
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
2338
|
+
/**
|
|
2339
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2340
|
+
* Default is 'true'.
|
|
2341
|
+
*/
|
|
2342
|
+
enabled: boolean;
|
|
2343
|
+
/**
|
|
2344
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2345
|
+
*/
|
|
2346
|
+
container: HTMLElement;
|
|
2347
|
+
/**
|
|
2348
|
+
* The THREE.js WebGLRenderer instance.
|
|
2349
|
+
*/
|
|
2350
|
+
three: THREE.WebGLRenderer;
|
|
2351
|
+
protected _canvas: HTMLCanvasElement;
|
|
2352
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2353
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
2354
|
+
protected onContainerUpdated: Event<unknown>;
|
|
2355
|
+
private _resizing;
|
|
2356
|
+
/**
|
|
2357
|
+
* Constructor for the SimpleRenderer class.
|
|
2358
|
+
*
|
|
2359
|
+
* @param components - The components instance.
|
|
2360
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2361
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2362
|
+
*/
|
|
2363
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2364
|
+
/** {@link Updateable.update} */
|
|
2365
|
+
update(): void;
|
|
2366
|
+
/** {@link Disposable.dispose} */
|
|
2367
|
+
dispose(): void;
|
|
2368
|
+
/** {@link Resizeable.getSize}. */
|
|
2369
|
+
getSize(): THREE.Vector2;
|
|
2370
|
+
/** {@link Resizeable.resize} */
|
|
2371
|
+
resize: (size?: THREE.Vector2) => void;
|
|
2372
|
+
/**
|
|
2373
|
+
* Sets up and manages the event listeners for the renderer.
|
|
2374
|
+
*
|
|
2375
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2376
|
+
*
|
|
2377
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2378
|
+
*/
|
|
2379
|
+
setupEvents(active: boolean): void;
|
|
2380
|
+
private resizeEvent;
|
|
2381
|
+
private setupRenderer;
|
|
2382
|
+
private onContextLost;
|
|
2383
|
+
private onContextBack;
|
|
2384
|
+
}
|
|
2385
|
+
import * as THREE from "three";
|
|
2386
|
+
import CameraControls from "camera-controls";
|
|
2387
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2388
|
+
import { Components } from "../../Components";
|
|
2389
|
+
/**
|
|
2390
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
2391
|
+
*/
|
|
2392
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
2393
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2394
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2395
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2396
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2397
|
+
/**
|
|
2398
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
2399
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
2400
|
+
*/
|
|
2401
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
2402
|
+
/** {@link Disposable.onDisposed} */
|
|
2403
|
+
readonly onDisposed: Event<string>;
|
|
2404
|
+
/**
|
|
2405
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
2406
|
+
* This camera is used for rendering the scene.
|
|
2407
|
+
*/
|
|
2408
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2409
|
+
private _allControls;
|
|
2410
|
+
/**
|
|
2411
|
+
* The object that controls the camera. An instance of
|
|
2412
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
2413
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
2414
|
+
* object to move, rotate, look at objects, etc.
|
|
2415
|
+
*/
|
|
2416
|
+
get controls(): CameraControls;
|
|
2417
|
+
/**
|
|
2418
|
+
* Getter for the enabled state of the camera controls.
|
|
2419
|
+
* If the current world is null, it returns false.
|
|
2420
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
2421
|
+
*
|
|
2422
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
2423
|
+
*/
|
|
2424
|
+
get enabled(): boolean;
|
|
2425
|
+
/**
|
|
2426
|
+
* Setter for the enabled state of the camera controls.
|
|
2427
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
2428
|
+
*
|
|
2429
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
2430
|
+
*/
|
|
2431
|
+
set enabled(enabled: boolean);
|
|
2432
|
+
constructor(components: Components);
|
|
2433
|
+
/** {@link Disposable.dispose} */
|
|
2434
|
+
dispose(): void;
|
|
2435
|
+
/** {@link Updateable.update} */
|
|
2436
|
+
update(_delta: number): void;
|
|
2437
|
+
/**
|
|
2438
|
+
* Updates the aspect of the camera to match the size of the
|
|
2439
|
+
* {@link Components.renderer}.
|
|
2440
|
+
*/
|
|
2441
|
+
updateAspect: () => void;
|
|
2442
|
+
private setupCamera;
|
|
2443
|
+
private newCameraControls;
|
|
2444
|
+
private setupEvents;
|
|
2445
|
+
private static getSubsetOfThree;
|
|
2230
2446
|
}
|
|
2231
2447
|
import * as THREE from "three";
|
|
2232
2448
|
import CameraControls from "camera-controls";
|
|
@@ -2364,6 +2580,24 @@ export declare class Event<T> {
|
|
|
2364
2580
|
reset(): void;
|
|
2365
2581
|
private handlers;
|
|
2366
2582
|
}
|
|
2583
|
+
import { Base } from "./base";
|
|
2584
|
+
/**
|
|
2585
|
+
* 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.
|
|
2586
|
+
*/
|
|
2587
|
+
export declare abstract class Component extends Base {
|
|
2588
|
+
/**
|
|
2589
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
2590
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2591
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2592
|
+
* will not be updated automatically each frame.
|
|
2593
|
+
*/
|
|
2594
|
+
abstract enabled: boolean;
|
|
2595
|
+
}
|
|
2596
|
+
import { InverseAttribute } from "./types";
|
|
2597
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2598
|
+
forRelating: InverseAttribute;
|
|
2599
|
+
forRelated: InverseAttribute;
|
|
2600
|
+
}>;
|
|
2367
2601
|
/**
|
|
2368
2602
|
* 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.
|
|
2369
2603
|
*/
|
|
@@ -2578,180 +2812,60 @@ export interface World extends Disposable, Updateable {
|
|
|
2578
2812
|
uuid: string;
|
|
2579
2813
|
/**
|
|
2580
2814
|
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2581
|
-
*/
|
|
2582
|
-
isDisposing: boolean;
|
|
2583
|
-
}
|
|
2584
|
-
import * as THREE from "three";
|
|
2585
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2586
|
-
/**
|
|
2587
|
-
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
2588
|
-
*
|
|
2589
|
-
* @template T - The type of the scene. Default is BaseScene.
|
|
2590
|
-
* @template U - The type of the camera. Default is BaseCamera.
|
|
2591
|
-
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2592
|
-
*/
|
|
2593
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
2594
|
-
/**
|
|
2595
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
2596
|
-
*/
|
|
2597
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2598
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2599
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2600
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2601
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2602
|
-
/** {@link Disposable.onDisposed} */
|
|
2603
|
-
readonly onDisposed: Event<unknown>;
|
|
2604
|
-
/**
|
|
2605
|
-
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
2606
|
-
*/
|
|
2607
|
-
isDisposing: boolean;
|
|
2608
|
-
/**
|
|
2609
|
-
* Indicates whether the world is currently enabled.
|
|
2610
|
-
* When disabled, the world will not be updated.
|
|
2611
|
-
*/
|
|
2612
|
-
enabled: boolean;
|
|
2613
|
-
/**
|
|
2614
|
-
* A unique identifier for the world.
|
|
2615
|
-
*/
|
|
2616
|
-
uuid: string;
|
|
2617
|
-
/**
|
|
2618
|
-
* An optional name for the world.
|
|
2619
|
-
*/
|
|
2620
|
-
name?: string;
|
|
2621
|
-
private _scene?;
|
|
2622
|
-
private _camera?;
|
|
2623
|
-
private _renderer;
|
|
2624
|
-
/**
|
|
2625
|
-
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
2626
|
-
* @returns The current scene.
|
|
2627
|
-
*/
|
|
2628
|
-
get scene(): T;
|
|
2629
|
-
/**
|
|
2630
|
-
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
2631
|
-
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
2632
|
-
* @param scene - The new scene to be set.
|
|
2633
|
-
*/
|
|
2634
|
-
set scene(scene: T);
|
|
2635
|
-
/**
|
|
2636
|
-
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
2637
|
-
* @returns The current camera.
|
|
2638
|
-
*/
|
|
2639
|
-
get camera(): U;
|
|
2640
|
-
/**
|
|
2641
|
-
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
2642
|
-
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
2643
|
-
* @param camera - The new camera to be set.
|
|
2644
|
-
*/
|
|
2645
|
-
set camera(camera: U);
|
|
2646
|
-
/**
|
|
2647
|
-
* Getter for the renderer.
|
|
2648
|
-
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
2649
|
-
*/
|
|
2650
|
-
get renderer(): S | null;
|
|
2651
|
-
/**
|
|
2652
|
-
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
2653
|
-
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
2654
|
-
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
2655
|
-
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
2656
|
-
*/
|
|
2657
|
-
set renderer(renderer: S | null);
|
|
2658
|
-
/** {@link Updateable.update} */
|
|
2659
|
-
update(delta?: number): void;
|
|
2660
|
-
/** {@link Disposable.dispose} */
|
|
2661
|
-
dispose(disposeResources?: boolean): void;
|
|
2662
|
-
}
|
|
2663
|
-
import * as THREE from "three";
|
|
2664
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2665
|
-
import { Components } from "../../Components";
|
|
2666
|
-
/**
|
|
2667
|
-
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
2668
|
-
*/
|
|
2669
|
-
export interface SimpleSceneConfig {
|
|
2670
|
-
directionalLight: {
|
|
2671
|
-
color: THREE.Color;
|
|
2672
|
-
intensity: number;
|
|
2673
|
-
position: THREE.Vector3;
|
|
2674
|
-
};
|
|
2675
|
-
ambientLight: {
|
|
2676
|
-
color: THREE.Color;
|
|
2677
|
-
intensity: number;
|
|
2678
|
-
};
|
|
2679
|
-
}
|
|
2680
|
-
/**
|
|
2681
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
2682
|
-
*/
|
|
2683
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2684
|
-
/** {@link Configurable.isSetup} */
|
|
2685
|
-
isSetup: boolean;
|
|
2686
|
-
/**
|
|
2687
|
-
* The underlying Three.js scene object.
|
|
2688
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2689
|
-
*/
|
|
2690
|
-
three: THREE.Scene;
|
|
2691
|
-
/** {@link Configurable.onSetup} */
|
|
2692
|
-
readonly onSetup: Event<SimpleScene>;
|
|
2693
|
-
/**
|
|
2694
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
2695
|
-
* Defines properties for directional and ambient lights.
|
|
2696
|
-
*/
|
|
2697
|
-
config: Required<SimpleSceneConfig>;
|
|
2698
|
-
constructor(components: Components);
|
|
2699
|
-
/** {@link Configurable.setup} */
|
|
2700
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2815
|
+
*/
|
|
2816
|
+
isDisposing: boolean;
|
|
2701
2817
|
}
|
|
2702
2818
|
import * as THREE from "three";
|
|
2703
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
2704
2819
|
import { Components } from "../../Components";
|
|
2820
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2821
|
+
import { Mouse } from "./mouse";
|
|
2705
2822
|
/**
|
|
2706
|
-
* A
|
|
2823
|
+
* 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.
|
|
2707
2824
|
*/
|
|
2708
|
-
export declare class
|
|
2709
|
-
/**
|
|
2710
|
-
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2711
|
-
* Default is 'true'.
|
|
2712
|
-
*/
|
|
2825
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2826
|
+
/** {@link Component.enabled} */
|
|
2713
2827
|
enabled: boolean;
|
|
2828
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2829
|
+
components: Components;
|
|
2830
|
+
/** {@link Disposable.onDisposed} */
|
|
2831
|
+
readonly onDisposed: Event<unknown>;
|
|
2832
|
+
/** The position of the mouse in the screen. */
|
|
2833
|
+
readonly mouse: Mouse;
|
|
2714
2834
|
/**
|
|
2715
|
-
*
|
|
2716
|
-
|
|
2717
|
-
container: HTMLElement;
|
|
2718
|
-
/**
|
|
2719
|
-
* The THREE.js WebGLRenderer instance.
|
|
2835
|
+
* A reference to the Three.js Raycaster instance.
|
|
2836
|
+
* This is used for raycasting operations.
|
|
2720
2837
|
*/
|
|
2721
|
-
three: THREE.
|
|
2722
|
-
protected _canvas: HTMLCanvasElement;
|
|
2723
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2724
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
2725
|
-
protected onContainerUpdated: Event<unknown>;
|
|
2726
|
-
private _resizing;
|
|
2838
|
+
readonly three: THREE.Raycaster;
|
|
2727
2839
|
/**
|
|
2728
|
-
*
|
|
2729
|
-
*
|
|
2730
|
-
* @param components - The components instance.
|
|
2731
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2732
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2840
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2841
|
+
* This is used to access the camera and meshes.
|
|
2733
2842
|
*/
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
update(): void;
|
|
2843
|
+
world: World;
|
|
2844
|
+
constructor(components: Components, world: World);
|
|
2737
2845
|
/** {@link Disposable.dispose} */
|
|
2738
2846
|
dispose(): void;
|
|
2739
|
-
/** {@link Resizeable.getSize}. */
|
|
2740
|
-
getSize(): THREE.Vector2;
|
|
2741
|
-
/** {@link Resizeable.resize} */
|
|
2742
|
-
resize: (size?: THREE.Vector2) => void;
|
|
2743
2847
|
/**
|
|
2744
|
-
*
|
|
2848
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2849
|
+
* the first item found. This also takes into account the clipping planes
|
|
2850
|
+
* used by the renderer.
|
|
2745
2851
|
*
|
|
2746
|
-
* @param
|
|
2852
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2853
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2854
|
+
* {@link Components.meshes}.
|
|
2855
|
+
*/
|
|
2856
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2857
|
+
/**
|
|
2858
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2859
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2747
2860
|
*
|
|
2748
|
-
* @
|
|
2861
|
+
* @param origin - The origin of the ray.
|
|
2862
|
+
* @param direction - The direction of the ray.
|
|
2863
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2864
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2749
2865
|
*/
|
|
2750
|
-
|
|
2751
|
-
private
|
|
2752
|
-
private
|
|
2753
|
-
private onContextLost;
|
|
2754
|
-
private onContextBack;
|
|
2866
|
+
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;
|
|
2867
|
+
private intersect;
|
|
2868
|
+
private filterClippingPlanes;
|
|
2755
2869
|
}
|
|
2756
2870
|
import * as THREE from "three";
|
|
2757
2871
|
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
@@ -2836,250 +2950,184 @@ export declare class Mouse implements Disposable {
|
|
|
2836
2950
|
private setupEvents;
|
|
2837
2951
|
}
|
|
2838
2952
|
import * as THREE from "three";
|
|
2953
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2839
2954
|
import { Components } from "../../Components";
|
|
2840
|
-
import {
|
|
2841
|
-
/**
|
|
2842
|
-
* Settings to configure the CullerRenderer.
|
|
2843
|
-
*/
|
|
2844
|
-
export interface CullerRendererSettings {
|
|
2845
|
-
/**
|
|
2846
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
2847
|
-
* Default value is 1000.
|
|
2848
|
-
*/
|
|
2849
|
-
updateInterval?: number;
|
|
2850
|
-
/**
|
|
2851
|
-
* Width of the render target used for visibility checks.
|
|
2852
|
-
* Default value is 512.
|
|
2853
|
-
*/
|
|
2854
|
-
width?: number;
|
|
2855
|
-
/**
|
|
2856
|
-
* Height of the render target used for visibility checks.
|
|
2857
|
-
* Default value is 512.
|
|
2858
|
-
*/
|
|
2859
|
-
height?: number;
|
|
2860
|
-
/**
|
|
2861
|
-
* Whether the visibility check should be performed automatically.
|
|
2862
|
-
* Default value is true.
|
|
2863
|
-
*/
|
|
2864
|
-
autoUpdate?: boolean;
|
|
2865
|
-
}
|
|
2955
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2866
2956
|
/**
|
|
2867
|
-
* A
|
|
2957
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2868
2958
|
*/
|
|
2869
|
-
export declare class CullerRenderer {
|
|
2870
|
-
/** {@link Disposable.onDisposed} */
|
|
2871
|
-
readonly onDisposed: Event<string>;
|
|
2959
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2872
2960
|
/**
|
|
2873
|
-
*
|
|
2874
|
-
*
|
|
2875
|
-
* just before but not anymore.
|
|
2961
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2962
|
+
* Contains two sets: seen and unseen.
|
|
2876
2963
|
*/
|
|
2877
|
-
readonly onViewUpdated: Event<
|
|
2964
|
+
readonly onViewUpdated: Event<{
|
|
2965
|
+
seen: Set<THREE.Mesh>;
|
|
2966
|
+
unseen: Set<THREE.Mesh>;
|
|
2967
|
+
}>;
|
|
2878
2968
|
/**
|
|
2879
|
-
*
|
|
2969
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2970
|
+
* Default value is 100.
|
|
2880
2971
|
*/
|
|
2881
|
-
|
|
2972
|
+
threshold: number;
|
|
2882
2973
|
/**
|
|
2883
|
-
*
|
|
2884
|
-
*
|
|
2974
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2975
|
+
* Used to keep track of color-coded meshes.
|
|
2885
2976
|
*/
|
|
2886
|
-
|
|
2977
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2887
2978
|
/**
|
|
2888
|
-
*
|
|
2889
|
-
*
|
|
2979
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2980
|
+
* Used to prevent concurrent processing.
|
|
2890
2981
|
*/
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
readonly
|
|
2898
|
-
protected autoUpdate: boolean;
|
|
2899
|
-
protected updateInterval: number;
|
|
2900
|
-
protected readonly worker: Worker;
|
|
2901
|
-
protected readonly scene: THREE.Scene;
|
|
2902
|
-
private _width;
|
|
2903
|
-
private _height;
|
|
2904
|
-
private _availableColor;
|
|
2905
|
-
private readonly renderTarget;
|
|
2906
|
-
private readonly bufferSize;
|
|
2907
|
-
private readonly _buffer;
|
|
2908
|
-
protected _isWorkerBusy: boolean;
|
|
2982
|
+
isProcessing: boolean;
|
|
2983
|
+
private _colorCodeMeshMap;
|
|
2984
|
+
private _meshIDColorCodeMap;
|
|
2985
|
+
private _currentVisibleMeshes;
|
|
2986
|
+
private _recentlyHiddenMeshes;
|
|
2987
|
+
private _intervalID;
|
|
2988
|
+
private readonly _transparentMat;
|
|
2909
2989
|
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2910
2990
|
/** {@link Disposable.dispose} */
|
|
2911
2991
|
dispose(): void;
|
|
2912
2992
|
/**
|
|
2913
|
-
*
|
|
2914
|
-
*
|
|
2915
|
-
* @
|
|
2916
|
-
* not true.
|
|
2993
|
+
* 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.
|
|
2994
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2995
|
+
* @returns {void}
|
|
2917
2996
|
*/
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
private
|
|
2997
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2998
|
+
/**
|
|
2999
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3000
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3001
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3002
|
+
* @returns {void}
|
|
3003
|
+
*/
|
|
3004
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3005
|
+
private handleWorkerMessage;
|
|
3006
|
+
private getAvailableMaterial;
|
|
2928
3007
|
}
|
|
2929
3008
|
import * as THREE from "three";
|
|
2930
|
-
import CameraControls from "camera-controls";
|
|
2931
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2932
3009
|
import { Components } from "../../Components";
|
|
3010
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
2933
3011
|
/**
|
|
2934
|
-
*
|
|
3012
|
+
* Settings to configure the CullerRenderer.
|
|
2935
3013
|
*/
|
|
2936
|
-
export
|
|
2937
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2938
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2939
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2940
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2941
|
-
/**
|
|
2942
|
-
* Event that is triggered when the aspect of the camera has been updated.
|
|
2943
|
-
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
2944
|
-
*/
|
|
2945
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
2946
|
-
/** {@link Disposable.onDisposed} */
|
|
2947
|
-
readonly onDisposed: Event<string>;
|
|
2948
|
-
/**
|
|
2949
|
-
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
2950
|
-
* This camera is used for rendering the scene.
|
|
2951
|
-
*/
|
|
2952
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2953
|
-
private _allControls;
|
|
3014
|
+
export interface CullerRendererSettings {
|
|
2954
3015
|
/**
|
|
2955
|
-
*
|
|
2956
|
-
*
|
|
2957
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
2958
|
-
* object to move, rotate, look at objects, etc.
|
|
3016
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
3017
|
+
* Default value is 1000.
|
|
2959
3018
|
*/
|
|
2960
|
-
|
|
3019
|
+
updateInterval?: number;
|
|
2961
3020
|
/**
|
|
2962
|
-
*
|
|
2963
|
-
*
|
|
2964
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
2965
|
-
*
|
|
2966
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
3021
|
+
* Width of the render target used for visibility checks.
|
|
3022
|
+
* Default value is 512.
|
|
2967
3023
|
*/
|
|
2968
|
-
|
|
3024
|
+
width?: number;
|
|
2969
3025
|
/**
|
|
2970
|
-
*
|
|
2971
|
-
*
|
|
2972
|
-
*
|
|
2973
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3026
|
+
* Height of the render target used for visibility checks.
|
|
3027
|
+
* Default value is 512.
|
|
2974
3028
|
*/
|
|
2975
|
-
|
|
2976
|
-
constructor(components: Components);
|
|
2977
|
-
/** {@link Disposable.dispose} */
|
|
2978
|
-
dispose(): void;
|
|
2979
|
-
/** {@link Updateable.update} */
|
|
2980
|
-
update(_delta: number): void;
|
|
3029
|
+
height?: number;
|
|
2981
3030
|
/**
|
|
2982
|
-
*
|
|
2983
|
-
*
|
|
2984
|
-
*/
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
private newCameraControls;
|
|
2988
|
-
private setupEvents;
|
|
2989
|
-
private static getSubsetOfThree;
|
|
2990
|
-
}
|
|
2991
|
-
import * as THREE from "three";
|
|
2992
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2993
|
-
import { Components } from "../../Components";
|
|
2994
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3031
|
+
* Whether the visibility check should be performed automatically.
|
|
3032
|
+
* Default value is true.
|
|
3033
|
+
*/
|
|
3034
|
+
autoUpdate?: boolean;
|
|
3035
|
+
}
|
|
2995
3036
|
/**
|
|
2996
|
-
* A renderer to
|
|
3037
|
+
* A base renderer to determine visibility on screen.
|
|
2997
3038
|
*/
|
|
2998
|
-
export declare class
|
|
3039
|
+
export declare class CullerRenderer {
|
|
3040
|
+
/** {@link Disposable.onDisposed} */
|
|
3041
|
+
readonly onDisposed: Event<string>;
|
|
2999
3042
|
/**
|
|
3000
|
-
*
|
|
3001
|
-
*
|
|
3043
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
3044
|
+
* meshes that are currently visible, and the ones that were visible
|
|
3045
|
+
* just before but not anymore.
|
|
3002
3046
|
*/
|
|
3003
|
-
readonly onViewUpdated: Event<
|
|
3004
|
-
seen: Set<THREE.Mesh>;
|
|
3005
|
-
unseen: Set<THREE.Mesh>;
|
|
3006
|
-
}>;
|
|
3047
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
3007
3048
|
/**
|
|
3008
|
-
*
|
|
3009
|
-
* Default value is 100.
|
|
3049
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3010
3050
|
*/
|
|
3011
|
-
|
|
3051
|
+
enabled: boolean;
|
|
3012
3052
|
/**
|
|
3013
|
-
*
|
|
3014
|
-
*
|
|
3053
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
3054
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3015
3055
|
*/
|
|
3016
|
-
|
|
3056
|
+
needsUpdate: boolean;
|
|
3017
3057
|
/**
|
|
3018
|
-
*
|
|
3019
|
-
*
|
|
3058
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
3059
|
+
* for debugging purposes.
|
|
3020
3060
|
*/
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3061
|
+
renderDebugFrame: boolean;
|
|
3062
|
+
/** The components instance to which this renderer belongs. */
|
|
3063
|
+
components: Components;
|
|
3064
|
+
/** The world instance to which this renderer belongs. */
|
|
3065
|
+
readonly world: World;
|
|
3066
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
3067
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
3068
|
+
protected autoUpdate: boolean;
|
|
3069
|
+
protected updateInterval: number;
|
|
3070
|
+
protected readonly worker: Worker;
|
|
3071
|
+
protected readonly scene: THREE.Scene;
|
|
3072
|
+
private _width;
|
|
3073
|
+
private _height;
|
|
3074
|
+
private _availableColor;
|
|
3075
|
+
private readonly renderTarget;
|
|
3076
|
+
private readonly bufferSize;
|
|
3077
|
+
private readonly _buffer;
|
|
3078
|
+
protected _isWorkerBusy: boolean;
|
|
3028
3079
|
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3029
3080
|
/** {@link Disposable.dispose} */
|
|
3030
3081
|
dispose(): void;
|
|
3031
3082
|
/**
|
|
3032
|
-
*
|
|
3033
|
-
*
|
|
3034
|
-
* @
|
|
3035
|
-
|
|
3036
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3037
|
-
/**
|
|
3038
|
-
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3039
|
-
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3040
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3041
|
-
* @returns {void}
|
|
3083
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
3084
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
3085
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3086
|
+
* not true.
|
|
3042
3087
|
*/
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3088
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
3089
|
+
protected getAvailableColor(): {
|
|
3090
|
+
r: number;
|
|
3091
|
+
g: number;
|
|
3092
|
+
b: number;
|
|
3093
|
+
code: string;
|
|
3094
|
+
};
|
|
3095
|
+
protected increaseColor(): void;
|
|
3096
|
+
protected decreaseColor(): void;
|
|
3097
|
+
private applySettings;
|
|
3046
3098
|
}
|
|
3047
3099
|
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3048
3100
|
import { NavigationMode } from "./types";
|
|
3049
3101
|
import { OrthoPerspectiveCamera } from "../index";
|
|
3050
3102
|
/**
|
|
3051
|
-
* A {@link NavigationMode} that allows
|
|
3103
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3052
3104
|
*/
|
|
3053
|
-
export declare class
|
|
3054
|
-
|
|
3105
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3106
|
+
camera: OrthoPerspectiveCamera;
|
|
3055
3107
|
/** {@link NavigationMode.enabled} */
|
|
3056
3108
|
enabled: boolean;
|
|
3057
3109
|
/** {@link NavigationMode.id} */
|
|
3058
|
-
readonly id = "
|
|
3110
|
+
readonly id = "Orbit";
|
|
3059
3111
|
constructor(camera: OrthoPerspectiveCamera);
|
|
3060
3112
|
/** {@link NavigationMode.set} */
|
|
3061
3113
|
set(active: boolean): void;
|
|
3062
|
-
private
|
|
3114
|
+
private activateOrbitControls;
|
|
3063
3115
|
}
|
|
3064
3116
|
import { NavigationMode } from "./types";
|
|
3065
3117
|
import { OrthoPerspectiveCamera } from "../index";
|
|
3066
3118
|
/**
|
|
3067
|
-
* A {@link NavigationMode} that allows
|
|
3119
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3068
3120
|
*/
|
|
3069
|
-
export declare class
|
|
3121
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3070
3122
|
private camera;
|
|
3071
3123
|
/** {@link NavigationMode.enabled} */
|
|
3072
3124
|
enabled: boolean;
|
|
3073
3125
|
/** {@link NavigationMode.id} */
|
|
3074
|
-
readonly id = "
|
|
3075
|
-
private mouseAction1?;
|
|
3076
|
-
private mouseAction2?;
|
|
3077
|
-
private mouseInitialized;
|
|
3078
|
-
private readonly defaultAzimuthSpeed;
|
|
3079
|
-
private readonly defaultPolarSpeed;
|
|
3126
|
+
readonly id = "FirstPerson";
|
|
3080
3127
|
constructor(camera: OrthoPerspectiveCamera);
|
|
3081
3128
|
/** {@link NavigationMode.set} */
|
|
3082
3129
|
set(active: boolean): void;
|
|
3130
|
+
private setupFirstPersonCamera;
|
|
3083
3131
|
}
|
|
3084
3132
|
import * as THREE from "three";
|
|
3085
3133
|
import { CameraProjection } from "./types";
|
|
@@ -3152,6 +3200,26 @@ export interface NavigationMode {
|
|
|
3152
3200
|
/** Whether this navigation mode is active or not. */
|
|
3153
3201
|
enabled: boolean;
|
|
3154
3202
|
}
|
|
3203
|
+
import { NavigationMode } from "./types";
|
|
3204
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3205
|
+
/**
|
|
3206
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3207
|
+
*/
|
|
3208
|
+
export declare class PlanMode implements NavigationMode {
|
|
3209
|
+
private camera;
|
|
3210
|
+
/** {@link NavigationMode.enabled} */
|
|
3211
|
+
enabled: boolean;
|
|
3212
|
+
/** {@link NavigationMode.id} */
|
|
3213
|
+
readonly id = "Plan";
|
|
3214
|
+
private mouseAction1?;
|
|
3215
|
+
private mouseAction2?;
|
|
3216
|
+
private mouseInitialized;
|
|
3217
|
+
private readonly defaultAzimuthSpeed;
|
|
3218
|
+
private readonly defaultPolarSpeed;
|
|
3219
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3220
|
+
/** {@link NavigationMode.set} */
|
|
3221
|
+
set(active: boolean): void;
|
|
3222
|
+
}
|
|
3155
3223
|
import * as THREE from "three";
|
|
3156
3224
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3157
3225
|
import { Components } from "../../Components";
|
|
@@ -3250,74 +3318,6 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3250
3318
|
private static newPlaneMesh;
|
|
3251
3319
|
}
|
|
3252
3320
|
import * as THREE from "three";
|
|
3253
|
-
import { Components } from "../../Components";
|
|
3254
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3255
|
-
import { Mouse } from "./mouse";
|
|
3256
|
-
/**
|
|
3257
|
-
* 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.
|
|
3258
|
-
*/
|
|
3259
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
3260
|
-
/** {@link Component.enabled} */
|
|
3261
|
-
enabled: boolean;
|
|
3262
|
-
/** The components instance to which this Raycaster belongs. */
|
|
3263
|
-
components: Components;
|
|
3264
|
-
/** {@link Disposable.onDisposed} */
|
|
3265
|
-
readonly onDisposed: Event<unknown>;
|
|
3266
|
-
/** The position of the mouse in the screen. */
|
|
3267
|
-
readonly mouse: Mouse;
|
|
3268
|
-
/**
|
|
3269
|
-
* A reference to the Three.js Raycaster instance.
|
|
3270
|
-
* This is used for raycasting operations.
|
|
3271
|
-
*/
|
|
3272
|
-
readonly three: THREE.Raycaster;
|
|
3273
|
-
/**
|
|
3274
|
-
* A reference to the world instance to which this Raycaster belongs.
|
|
3275
|
-
* This is used to access the camera and meshes.
|
|
3276
|
-
*/
|
|
3277
|
-
world: World;
|
|
3278
|
-
constructor(components: Components, world: World);
|
|
3279
|
-
/** {@link Disposable.dispose} */
|
|
3280
|
-
dispose(): void;
|
|
3281
|
-
/**
|
|
3282
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3283
|
-
* the first item found. This also takes into account the clipping planes
|
|
3284
|
-
* used by the renderer.
|
|
3285
|
-
*
|
|
3286
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3287
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
3288
|
-
* {@link Components.meshes}.
|
|
3289
|
-
*/
|
|
3290
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3291
|
-
/**
|
|
3292
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3293
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
3294
|
-
*
|
|
3295
|
-
* @param origin - The origin of the ray.
|
|
3296
|
-
* @param direction - The direction of the ray.
|
|
3297
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3298
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3299
|
-
*/
|
|
3300
|
-
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;
|
|
3301
|
-
private intersect;
|
|
3302
|
-
private filterClippingPlanes;
|
|
3303
|
-
}
|
|
3304
|
-
import { NavigationMode } from "./types";
|
|
3305
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3306
|
-
/**
|
|
3307
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3308
|
-
*/
|
|
3309
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3310
|
-
camera: OrthoPerspectiveCamera;
|
|
3311
|
-
/** {@link NavigationMode.enabled} */
|
|
3312
|
-
enabled: boolean;
|
|
3313
|
-
/** {@link NavigationMode.id} */
|
|
3314
|
-
readonly id = "Orbit";
|
|
3315
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3316
|
-
/** {@link NavigationMode.set} */
|
|
3317
|
-
set(active: boolean): void;
|
|
3318
|
-
private activateOrbitControls;
|
|
3319
|
-
}
|
|
3320
|
-
import * as THREE from "three";
|
|
3321
3321
|
import * as WEBIFC from "web-ifc";
|
|
3322
3322
|
import * as FRAGS from "@thatopen/fragments";
|
|
3323
3323
|
export declare class CivilReader {
|
|
@@ -3332,15 +3332,16 @@ export declare class CivilReader {
|
|
|
3332
3332
|
} | undefined;
|
|
3333
3333
|
private getCurves;
|
|
3334
3334
|
}
|
|
3335
|
-
import
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3335
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3336
|
+
/**
|
|
3337
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3338
|
+
*/
|
|
3339
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3340
|
+
/**
|
|
3341
|
+
* Amount of properties to be streamed.
|
|
3342
|
+
* Defaults to 100 properties.
|
|
3343
|
+
*/
|
|
3344
|
+
propertiesSize: number;
|
|
3344
3345
|
}
|
|
3345
3346
|
import * as WEBIFC from "web-ifc";
|
|
3346
3347
|
export declare class IfcMetadataReader {
|
|
@@ -3349,14 +3350,19 @@ export declare class IfcMetadataReader {
|
|
|
3349
3350
|
}
|
|
3350
3351
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3351
3352
|
/**
|
|
3352
|
-
* Settings for streaming
|
|
3353
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3353
3354
|
*/
|
|
3354
|
-
export declare class
|
|
3355
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3355
3356
|
/**
|
|
3356
|
-
*
|
|
3357
|
-
* Defaults to
|
|
3357
|
+
* Minimum number of geometries to be streamed.
|
|
3358
|
+
* Defaults to 10 geometries.
|
|
3358
3359
|
*/
|
|
3359
|
-
|
|
3360
|
+
minGeometrySize: number;
|
|
3361
|
+
/**
|
|
3362
|
+
* Minimum amount of assets to be streamed.
|
|
3363
|
+
* Defaults to 1000 assets.
|
|
3364
|
+
*/
|
|
3365
|
+
minAssetsSize: number;
|
|
3360
3366
|
}
|
|
3361
3367
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3362
3368
|
export interface ModelsRelationMap {
|
|
@@ -3382,27 +3388,21 @@ export type InverseAttributes = [
|
|
|
3382
3388
|
"ContainsElements"
|
|
3383
3389
|
];
|
|
3384
3390
|
export type InverseAttribute = InverseAttributes[number];
|
|
3385
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3386
|
-
/**
|
|
3387
|
-
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3388
|
-
*/
|
|
3389
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3390
|
-
/**
|
|
3391
|
-
* Minimum number of geometries to be streamed.
|
|
3392
|
-
* Defaults to 10 geometries.
|
|
3393
|
-
*/
|
|
3394
|
-
minGeometrySize: number;
|
|
3395
|
-
/**
|
|
3396
|
-
* Minimum amount of assets to be streamed.
|
|
3397
|
-
* Defaults to 1000 assets.
|
|
3398
|
-
*/
|
|
3399
|
-
minAssetsSize: number;
|
|
3400
|
-
}
|
|
3401
3391
|
import { BufferGeometry } from "three";
|
|
3402
3392
|
import * as THREE from "three";
|
|
3403
3393
|
export declare class TransformHelper {
|
|
3404
3394
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3405
3395
|
}
|
|
3396
|
+
import * as WEBIFC from "web-ifc";
|
|
3397
|
+
import * as THREE from "three";
|
|
3398
|
+
export declare class Units {
|
|
3399
|
+
factor: number;
|
|
3400
|
+
complement: number;
|
|
3401
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3402
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3403
|
+
private getLengthUnits;
|
|
3404
|
+
private getScaleMatrix;
|
|
3405
|
+
}
|
|
3406
3406
|
/**
|
|
3407
3407
|
* 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.
|
|
3408
3408
|
*/
|