@thatopen/components 2.1.1 → 2.1.3

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.
@@ -1,49 +1,4 @@
1
1
  declare namespace OBC {
2
- import * as THREE from "three";
3
- import { Components } from "../Components";
4
- import { Component } from "../Types";
5
- /**
6
- * 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).
7
- */
8
- export declare class Disposer extends Component {
9
- private _disposedComponents;
10
- /** {@link Component.enabled} */
11
- enabled: boolean;
12
- /**
13
- * A unique identifier for the component.
14
- * This UUID is used to register the component within the Components system.
15
- */
16
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
17
- constructor(components: Components);
18
- /**
19
- * Return the UUIDs of all disposed components.
20
- */
21
- get(): Set<string>;
22
- /**
23
- * Removes a mesh, its geometry and its materials from memory. If you are
24
- * using any of these in other parts of the application, make sure that you
25
- * remove them from the mesh before disposing it.
26
- *
27
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
28
- * to remove.
29
- *
30
- * @param materials - whether to dispose the materials of the mesh.
31
- *
32
- * @param recursive - whether to recursively dispose the children of the mesh.
33
- */
34
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
35
- /**
36
- * Disposes a geometry from memory.
37
- *
38
- * @param geometry - the
39
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
40
- * to remove.
41
- */
42
- disposeGeometry(geometry: THREE.BufferGeometry): void;
43
- private disposeGeometryAndMaterials;
44
- private disposeChildren;
45
- private static disposeMaterial;
46
- }
47
2
  import { Component, Disposable, Event } from "../Types";
48
3
  /**
49
4
  * 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.
@@ -52,7 +7,7 @@ export declare class Components implements Disposable {
52
7
  /**
53
8
  * The version of the @thatopen/components library.
54
9
  */
55
- static readonly release = "2.1.1";
10
+ static readonly release = "2.1.3";
56
11
  /** {@link Disposable.onDisposed} */
57
12
  readonly onDisposed: Event<void>;
58
13
  /**
@@ -120,114 +75,136 @@ export declare class Components implements Disposable {
120
75
  private update;
121
76
  private static setupBVH;
122
77
  }
123
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
78
+ import * as THREE from "three";
79
+ import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
80
+ import { SimplePlane } from "./src";
124
81
  import { Components } from "../Components";
125
- import { SimpleWorld } from "./src";
126
82
  /**
127
- * 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).
83
+ * A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
84
+ *
85
+ * @param components - the instance of {@link Components} used.
86
+ * E.g. {@link SimplePlane}.
128
87
  */
129
- export declare class Worlds extends Component implements Updateable, Disposable {
88
+ export declare class Clipper extends Component implements Createable, Disposable, Hideable {
130
89
  /**
131
90
  * A unique identifier for the component.
132
91
  * This UUID is used to register the component within the Components system.
133
92
  */
134
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
135
- /** {@link Updateable.onAfterUpdate} */
136
- readonly onAfterUpdate: Event<unknown>;
137
- /** {@link Updateable.onBeforeUpdate} */
138
- readonly onBeforeUpdate: Event<unknown>;
139
- /** {@link Disposable.onDisposed} */
140
- readonly onDisposed: Event<unknown>;
93
+ static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
94
+ /** Event that fires when the user starts dragging a clipping plane. */
95
+ readonly onBeforeDrag: Event<void>;
96
+ /** Event that fires when the user stops dragging a clipping plane. */
97
+ readonly onAfterDrag: Event<void>;
141
98
  /**
142
- * An event that is triggered when a new world is created.
143
- * The event passes the newly created world as a parameter.
99
+ * Event that fires when the user starts creating a clipping plane.
144
100
  */
145
- readonly onWorldCreated: Event<World>;
101
+ readonly onBeforeCreate: Event<unknown>;
146
102
  /**
147
- * An event that is triggered when a world is deleted.
148
- * The event passes the UUID of the deleted world as a parameter.
103
+ * Event that fires when the user cancels the creation of a clipping plane.
149
104
  */
150
- readonly onWorldDeleted: Event<string>;
105
+ readonly onBeforeCancel: Event<unknown>;
151
106
  /**
152
- * A collection of worlds managed by this component.
153
- * The key is the unique identifier (UUID) of the world, and the value is the World instance.
107
+ * Event that fires after the user cancels the creation of a clipping plane.
154
108
  */
155
- list: Map<string, World>;
156
- /** {@link Component.enabled} */
157
- enabled: boolean;
158
- constructor(components: Components);
109
+ readonly onAfterCancel: Event<unknown>;
159
110
  /**
160
- * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
161
- *
162
- * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
163
- * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
164
- * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
165
- *
166
- * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
111
+ * Event that fires when the user starts deleting a clipping plane.
167
112
  */
168
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
113
+ readonly onBeforeDelete: Event<unknown>;
169
114
  /**
170
- * Deletes a world from the list of worlds.
171
- *
172
- * @param {World} world - The world to be deleted.
173
- *
174
- * @throws {Error} - Throws an error if the provided world is not found in the list.
175
- *
176
- * @returns {void}
115
+ * Event that fires after a clipping plane has been created.
116
+ * @param plane - The newly created clipping plane.
177
117
  */
178
- delete(world: World): void;
118
+ readonly onAfterCreate: Event<SimplePlane>;
179
119
  /**
180
- * Disposes of the Worlds component and all its managed worlds.
181
- * This method sets the enabled flag to false, disposes of all worlds, clears the list,
182
- * and triggers the onDisposed event.
183
- *
184
- * @returns {void}
120
+ * Event that fires after a clipping plane has been deleted.
121
+ * @param plane - The deleted clipping plane.
185
122
  */
186
- dispose(): void;
187
- /** {@link Updateable.update} */
188
- update(delta?: number): void | Promise<void>;
189
- }
190
- import { Component, Disposable, World, Event } from "../Types";
191
- import { SimpleRaycaster } from "./src";
192
- import { Components } from "../Components";
193
- /**
194
- * 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).
195
- */
196
- export declare class Raycasters extends Component implements Disposable {
123
+ readonly onAfterDelete: Event<SimplePlane>;
124
+ /** {@link Disposable.onDisposed} */
125
+ readonly onDisposed: Event<string>;
197
126
  /**
198
- * A unique identifier for the component.
199
- * This UUID is used to register the component within the Components system.
127
+ * Whether to force the clipping plane to be orthogonal in the Y direction
128
+ * (up). This is desirable when clipping a building horizontally and a
129
+ * clipping plane is created in its roof, which might have a slight
130
+ * slope for draining purposes.
200
131
  */
201
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
202
- /** {@link Component.enabled} */
203
- enabled: boolean;
132
+ orthogonalY: boolean;
204
133
  /**
205
- * A Map that stores raycasters for each world.
206
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
134
+ * The tolerance that determines whether an almost-horizontal clipping plane
135
+ * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
136
+ * has to be 'true' for this to apply.
207
137
  */
208
- list: Map<string, SimpleRaycaster>;
209
- /** {@link Disposable.onDisposed} */
210
- onDisposed: Event<unknown>;
138
+ toleranceOrthogonalY: number;
139
+ /**
140
+ * The type of clipping plane to be created.
141
+ * Default is {@link SimplePlane}.
142
+ */
143
+ Type: new (...args: any) => SimplePlane;
144
+ /**
145
+ * A list of all the clipping planes created by this component.
146
+ */
147
+ list: SimplePlane[];
148
+ /** The material used in all the clipping planes. */
149
+ private _material;
150
+ private _size;
151
+ private _enabled;
152
+ private _visible;
153
+ /** {@link Component.enabled} */
154
+ get enabled(): boolean;
155
+ /** {@link Component.enabled} */
156
+ set enabled(state: boolean);
157
+ /** {@link Hideable.visible } */
158
+ get visible(): boolean;
159
+ /** {@link Hideable.visible } */
160
+ set visible(state: boolean);
161
+ /** The material of the clipping plane representation. */
162
+ get material(): THREE.MeshBasicMaterial;
163
+ /** The material of the clipping plane representation. */
164
+ set material(material: THREE.MeshBasicMaterial);
165
+ /** The size of the geometric representation of the clippings planes. */
166
+ get size(): number;
167
+ /** The size of the geometric representation of the clippings planes. */
168
+ set size(size: number);
211
169
  constructor(components: Components);
170
+ /** {@link Disposable.dispose} */
171
+ dispose(): void;
172
+ /** {@link Createable.create} */
173
+ create(world: World): SimplePlane | null;
212
174
  /**
213
- * Retrieves a SimpleRaycaster instance for the given world.
214
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
215
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
175
+ * Creates a plane in a certain place and with a certain orientation,
176
+ * without the need of the mouse.
216
177
  *
217
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
218
- * @returns The SimpleRaycaster instance for the given world.
178
+ * @param world - the world where this plane should be created.
179
+ * @param normal - the orientation of the clipping plane.
180
+ * @param point - the position of the clipping plane.
181
+ * navigation.
219
182
  */
220
- get(world: World): SimpleRaycaster;
183
+ createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
221
184
  /**
222
- * Deletes the SimpleRaycaster instance associated with the given world.
223
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
185
+ * {@link Createable.delete}
224
186
  *
225
- * @param world - The world for which to delete the SimpleRaycaster instance.
226
- * @returns {void}
187
+ * @param world - the world where the plane to delete is.
188
+ * @param plane - the plane to delete. If undefined, the first plane
189
+ * found under the cursor will be deleted.
227
190
  */
228
- delete(world: World): void;
229
- /** {@link Disposable.dispose} */
230
- dispose(): void;
191
+ delete(world: World, plane?: SimplePlane): void;
192
+ /**
193
+ * Deletes all the existing clipping planes.
194
+ *
195
+ * @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
196
+ */
197
+ deleteAll(types?: Set<string>): void;
198
+ private deletePlane;
199
+ private pickPlane;
200
+ private getAllPlaneMeshes;
201
+ private createPlaneFromIntersection;
202
+ private getWorldNormal;
203
+ private normalizePlaneDirectionY;
204
+ private newPlane;
205
+ private updateMaterialsAndPlanes;
206
+ private _onStartDragging;
207
+ private _onEndDragging;
231
208
  }
232
209
  import { Components } from "../Components";
233
210
  import { MeshCullerRenderer, CullerRendererSettings } from "./src";
@@ -325,195 +302,177 @@ export declare class MiniMaps extends Component implements Updateable, Disposabl
325
302
  update(): void;
326
303
  }
327
304
  import * as THREE from "three";
328
- import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
329
- import { SimplePlane } from "./src";
330
305
  import { Components } from "../Components";
306
+ import { SimpleCamera } from "..";
307
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
331
308
  /**
332
- * A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
333
- *
334
- * @param components - the instance of {@link Components} used.
335
- * E.g. {@link SimplePlane}.
309
+ * A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
336
310
  */
337
- export declare class Clipper extends Component implements Createable, Disposable, Hideable {
311
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
338
312
  /**
339
- * A unique identifier for the component.
340
- * This UUID is used to register the component within the Components system.
313
+ * A ProjectionManager instance that manages the projection modes of the camera.
341
314
  */
342
- static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
343
- /** Event that fires when the user starts dragging a clipping plane. */
344
- readonly onBeforeDrag: Event<void>;
345
- /** Event that fires when the user stops dragging a clipping plane. */
346
- readonly onAfterDrag: Event<void>;
315
+ readonly projection: ProjectionManager;
347
316
  /**
348
- * Event that fires when the user starts creating a clipping plane.
317
+ * A THREE.OrthographicCamera instance that represents the orthographic camera.
318
+ * This camera is used when the projection mode is set to orthographic.
349
319
  */
350
- readonly onBeforeCreate: Event<unknown>;
320
+ readonly threeOrtho: THREE.OrthographicCamera;
351
321
  /**
352
- * Event that fires when the user cancels the creation of a clipping plane.
322
+ * A THREE.PerspectiveCamera instance that represents the perspective camera.
323
+ * This camera is used when the projection mode is set to perspective.
353
324
  */
354
- readonly onBeforeCancel: Event<unknown>;
325
+ readonly threePersp: THREE.PerspectiveCamera;
326
+ protected readonly _userInputButtons: any;
327
+ protected readonly _frustumSize = 50;
328
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
329
+ protected _mode: NavigationMode | null;
330
+ private previousSize;
355
331
  /**
356
- * Event that fires after the user cancels the creation of a clipping plane.
357
- */
358
- readonly onAfterCancel: Event<unknown>;
332
+ * Getter for the current navigation mode.
333
+ * Throws an error if the mode is not found or the camera is not initialized.
334
+ *
335
+ * @returns {NavigationMode} The current navigation mode.
336
+ *
337
+ * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
338
+ */
339
+ get mode(): NavigationMode;
340
+ constructor(components: Components);
341
+ /** {@link Disposable.dispose} */
342
+ dispose(): void;
359
343
  /**
360
- * Event that fires when the user starts deleting a clipping plane.
344
+ * Sets a new {@link NavigationMode} and disables the previous one.
345
+ *
346
+ * @param mode - The {@link NavigationMode} to set.
361
347
  */
362
- readonly onBeforeDelete: Event<unknown>;
348
+ set(mode: NavModeID): void;
363
349
  /**
364
- * Event that fires after a clipping plane has been created.
365
- * @param plane - The newly created clipping plane.
350
+ * Make the camera view fit all the specified meshes.
351
+ *
352
+ * @param meshes the meshes to fit. If it is not defined, it will
353
+ * evaluate {@link Components.meshes}.
354
+ * @param offset the distance to the fit object
366
355
  */
367
- readonly onAfterCreate: Event<SimplePlane>;
356
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
368
357
  /**
369
- * Event that fires after a clipping plane has been deleted.
370
- * @param plane - The deleted clipping plane.
358
+ * Allows or prevents all user input.
359
+ *
360
+ * @param active - whether to enable or disable user inputs.
371
361
  */
372
- readonly onAfterDelete: Event<SimplePlane>;
373
- /** {@link Disposable.onDisposed} */
374
- readonly onDisposed: Event<string>;
362
+ setUserInput(active: boolean): void;
363
+ private disableUserInput;
364
+ private enableUserInput;
365
+ private newOrthoCamera;
366
+ private setOrthoPerspCameraAspect;
367
+ }
368
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
369
+ import { Components } from "../Components";
370
+ import { SimpleWorld } from "./src";
371
+ /**
372
+ * 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).
373
+ */
374
+ export declare class Worlds extends Component implements Updateable, Disposable {
375
375
  /**
376
- * Whether to force the clipping plane to be orthogonal in the Y direction
377
- * (up). This is desirable when clipping a building horizontally and a
378
- * clipping plane is created in its roof, which might have a slight
379
- * slope for draining purposes.
376
+ * A unique identifier for the component.
377
+ * This UUID is used to register the component within the Components system.
380
378
  */
381
- orthogonalY: boolean;
379
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
380
+ /** {@link Updateable.onAfterUpdate} */
381
+ readonly onAfterUpdate: Event<unknown>;
382
+ /** {@link Updateable.onBeforeUpdate} */
383
+ readonly onBeforeUpdate: Event<unknown>;
384
+ /** {@link Disposable.onDisposed} */
385
+ readonly onDisposed: Event<unknown>;
382
386
  /**
383
- * The tolerance that determines whether an almost-horizontal clipping plane
384
- * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
385
- * has to be 'true' for this to apply.
387
+ * An event that is triggered when a new world is created.
388
+ * The event passes the newly created world as a parameter.
386
389
  */
387
- toleranceOrthogonalY: number;
390
+ readonly onWorldCreated: Event<World>;
388
391
  /**
389
- * The type of clipping plane to be created.
390
- * Default is {@link SimplePlane}.
392
+ * An event that is triggered when a world is deleted.
393
+ * The event passes the UUID of the deleted world as a parameter.
391
394
  */
392
- Type: new (...args: any) => SimplePlane;
395
+ readonly onWorldDeleted: Event<string>;
393
396
  /**
394
- * A list of all the clipping planes created by this component.
397
+ * A collection of worlds managed by this component.
398
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
395
399
  */
396
- list: SimplePlane[];
397
- /** The material used in all the clipping planes. */
398
- private _material;
399
- private _size;
400
- private _enabled;
401
- private _visible;
402
- /** {@link Component.enabled} */
403
- get enabled(): boolean;
400
+ list: Map<string, World>;
404
401
  /** {@link Component.enabled} */
405
- set enabled(state: boolean);
406
- /** {@link Hideable.visible } */
407
- get visible(): boolean;
408
- /** {@link Hideable.visible } */
409
- set visible(state: boolean);
410
- /** The material of the clipping plane representation. */
411
- get material(): THREE.MeshBasicMaterial;
412
- /** The material of the clipping plane representation. */
413
- set material(material: THREE.MeshBasicMaterial);
414
- /** The size of the geometric representation of the clippings planes. */
415
- get size(): number;
416
- /** The size of the geometric representation of the clippings planes. */
417
- set size(size: number);
402
+ enabled: boolean;
418
403
  constructor(components: Components);
419
- /** {@link Disposable.dispose} */
420
- dispose(): void;
421
- /** {@link Createable.create} */
422
- create(world: World): void;
423
404
  /**
424
- * Creates a plane in a certain place and with a certain orientation,
425
- * without the need of the mouse.
405
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
426
406
  *
427
- * @param world - the world where this plane should be created.
428
- * @param normal - the orientation of the clipping plane.
429
- * @param point - the position of the clipping plane.
430
- * navigation.
407
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
408
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
409
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
410
+ *
411
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
431
412
  */
432
- createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
413
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
433
414
  /**
434
- * {@link Createable.delete}
415
+ * Deletes a world from the list of worlds.
435
416
  *
436
- * @param world - the world where the plane to delete is.
437
- * @param plane - the plane to delete. If undefined, the first plane
438
- * found under the cursor will be deleted.
417
+ * @param {World} world - The world to be deleted.
418
+ *
419
+ * @throws {Error} - Throws an error if the provided world is not found in the list.
420
+ *
421
+ * @returns {void}
439
422
  */
440
- delete(world: World, plane?: SimplePlane): void;
441
- /** Deletes all the existing clipping planes. */
442
- deleteAll(): void;
443
- private deletePlane;
444
- private pickPlane;
445
- private getAllPlaneMeshes;
446
- private createPlaneFromIntersection;
447
- private getWorldNormal;
448
- private normalizePlaneDirectionY;
449
- private newPlane;
450
- private updateMaterialsAndPlanes;
451
- private _onStartDragging;
452
- private _onEndDragging;
423
+ delete(world: World): void;
424
+ /**
425
+ * Disposes of the Worlds component and all its managed worlds.
426
+ * This method sets the enabled flag to false, disposes of all worlds, clears the list,
427
+ * and triggers the onDisposed event.
428
+ *
429
+ * @returns {void}
430
+ */
431
+ dispose(): void;
432
+ /** {@link Updateable.update} */
433
+ update(delta?: number): void | Promise<void>;
453
434
  }
454
- import * as THREE from "three";
435
+ import { Component, Disposable, World, Event } from "../Types";
436
+ import { SimpleRaycaster } from "./src";
455
437
  import { Components } from "../Components";
456
- import { SimpleCamera } from "..";
457
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
458
438
  /**
459
- * A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
439
+ * 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).
460
440
  */
461
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
462
- /**
463
- * A ProjectionManager instance that manages the projection modes of the camera.
464
- */
465
- readonly projection: ProjectionManager;
466
- /**
467
- * A THREE.OrthographicCamera instance that represents the orthographic camera.
468
- * This camera is used when the projection mode is set to orthographic.
469
- */
470
- readonly threeOrtho: THREE.OrthographicCamera;
441
+ export declare class Raycasters extends Component implements Disposable {
471
442
  /**
472
- * A THREE.PerspectiveCamera instance that represents the perspective camera.
473
- * This camera is used when the projection mode is set to perspective.
443
+ * A unique identifier for the component.
444
+ * This UUID is used to register the component within the Components system.
474
445
  */
475
- readonly threePersp: THREE.PerspectiveCamera;
476
- protected readonly _userInputButtons: any;
477
- protected readonly _frustumSize = 50;
478
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
479
- protected _mode: NavigationMode | null;
480
- private previousSize;
446
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
447
+ /** {@link Component.enabled} */
448
+ enabled: boolean;
481
449
  /**
482
- * Getter for the current navigation mode.
483
- * Throws an error if the mode is not found or the camera is not initialized.
484
- *
485
- * @returns {NavigationMode} The current navigation mode.
486
- *
487
- * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
450
+ * A Map that stores raycasters for each world.
451
+ * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
488
452
  */
489
- get mode(): NavigationMode;
453
+ list: Map<string, SimpleRaycaster>;
454
+ /** {@link Disposable.onDisposed} */
455
+ onDisposed: Event<unknown>;
490
456
  constructor(components: Components);
491
- /** {@link Disposable.dispose} */
492
- dispose(): void;
493
- /**
494
- * Sets a new {@link NavigationMode} and disables the previous one.
495
- *
496
- * @param mode - The {@link NavigationMode} to set.
497
- */
498
- set(mode: NavModeID): void;
499
457
  /**
500
- * Make the camera view fit all the specified meshes.
458
+ * Retrieves a SimpleRaycaster instance for the given world.
459
+ * If a SimpleRaycaster instance already exists for the world, it will be returned.
460
+ * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
501
461
  *
502
- * @param meshes the meshes to fit. If it is not defined, it will
503
- * evaluate {@link Components.meshes}.
504
- * @param offset the distance to the fit object
462
+ * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
463
+ * @returns The SimpleRaycaster instance for the given world.
505
464
  */
506
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
465
+ get(world: World): SimpleRaycaster;
507
466
  /**
508
- * Allows or prevents all user input.
467
+ * Deletes the SimpleRaycaster instance associated with the given world.
468
+ * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
509
469
  *
510
- * @param active - whether to enable or disable user inputs.
470
+ * @param world - The world for which to delete the SimpleRaycaster instance.
471
+ * @returns {void}
511
472
  */
512
- setUserInput(active: boolean): void;
513
- private disableUserInput;
514
- private enableUserInput;
515
- private newOrthoCamera;
516
- private setOrthoPerspCameraAspect;
473
+ delete(world: World): void;
474
+ /** {@link Disposable.dispose} */
475
+ dispose(): void;
517
476
  }
518
477
  import { Component, Disposable, World, Event } from "../Types";
519
478
  import { GridConfig, SimpleGrid } from "./src";
@@ -565,32 +524,248 @@ export declare class Grids extends Component implements Disposable {
565
524
  dispose(): void;
566
525
  }
567
526
  import * as THREE from "three";
568
- import * as FRAGS from "@thatopen/fragments";
569
- import { FragmentsGroup } from "@thatopen/fragments";
570
- import { Component, Components, Disposable, Event } from "../../core";
527
+ import { Components } from "../Components";
528
+ import { Component } from "../Types";
571
529
  /**
572
- * 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).
530
+ * 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).
573
531
  */
574
- export declare class BoundingBoxer extends Component implements Disposable {
575
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
532
+ export declare class Disposer extends Component {
533
+ private _disposedComponents;
576
534
  /** {@link Component.enabled} */
577
535
  enabled: boolean;
578
- /** {@link Disposable.onDisposed} */
579
- readonly onDisposed: Event<unknown>;
580
- private _absoluteMin;
581
- private _absoluteMax;
582
- private _meshes;
536
+ /**
537
+ * A unique identifier for the component.
538
+ * This UUID is used to register the component within the Components system.
539
+ */
540
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
583
541
  constructor(components: Components);
584
542
  /**
585
- * A static method to calculate the dimensions of a given bounding box.
586
- *
587
- * @param bbox - The bounding box to calculate the dimensions for.
588
- * @returns An object containing the width, height, depth, and center of the bounding box.
543
+ * Return the UUIDs of all disposed components.
589
544
  */
590
- static getDimensions(bbox: THREE.Box3): {
591
- width: number;
592
- height: number;
593
- depth: number;
545
+ get(): Set<string>;
546
+ /**
547
+ * Removes a mesh, its geometry and its materials from memory. If you are
548
+ * using any of these in other parts of the application, make sure that you
549
+ * remove them from the mesh before disposing it.
550
+ *
551
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
552
+ * to remove.
553
+ *
554
+ * @param materials - whether to dispose the materials of the mesh.
555
+ *
556
+ * @param recursive - whether to recursively dispose the children of the mesh.
557
+ */
558
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
559
+ /**
560
+ * Disposes a geometry from memory.
561
+ *
562
+ * @param geometry - the
563
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
564
+ * to remove.
565
+ */
566
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
567
+ private disposeGeometryAndMaterials;
568
+ private disposeChildren;
569
+ private static disposeMaterial;
570
+ }
571
+ import * as THREE from "three";
572
+ import * as FRAGS from "@thatopen/fragments";
573
+ import { Disposable, Component, Event, Components } from "../../core";
574
+ /**
575
+ * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
576
+ */
577
+ export interface Classification {
578
+ /**
579
+ * A system within the classification.
580
+ * The key is the system name, and the value is an object representing the classes within the system.
581
+ */
582
+ [system: string]: {
583
+ /**
584
+ * A class within the system.
585
+ * The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
586
+ */
587
+ [className: string]: {
588
+ map: FRAGS.FragmentIdMap;
589
+ name: string;
590
+ id: number | null;
591
+ };
592
+ };
593
+ }
594
+ /**
595
+ * 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).
596
+ */
597
+ export declare class Classifier extends Component implements Disposable {
598
+ /**
599
+ * A unique identifier for the component.
600
+ * This UUID is used to register the component within the Components system.
601
+ */
602
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
603
+ /** {@link Component.enabled} */
604
+ enabled: boolean;
605
+ /**
606
+ * A map representing the classification systems.
607
+ * The key is the system name, and the value is an object representing the classes within the system.
608
+ */
609
+ list: Classification;
610
+ /** {@link Disposable.onDisposed} */
611
+ readonly onDisposed: Event<unknown>;
612
+ constructor(components: Components);
613
+ private onFragmentsDisposed;
614
+ /** {@link Disposable.dispose} */
615
+ dispose(): void;
616
+ /**
617
+ * Removes a fragment from the classification based on its unique identifier (guid).
618
+ * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
619
+ *
620
+ * @param guid - The unique identifier of the fragment to be removed.
621
+ */
622
+ remove(guid: string): void;
623
+ /**
624
+ * Finds and returns fragments based on the provided filter criteria.
625
+ * If no filter is provided, it returns all fragments.
626
+ *
627
+ * @param filter - An optional object containing filter criteria.
628
+ * The keys of the object represent the classification system names,
629
+ * and the values are arrays of class names to match.
630
+ *
631
+ * @returns A map of fragment GUIDs to their respective express IDs,
632
+ * where the express IDs are filtered based on the provided filter criteria.
633
+ *
634
+ * @throws Will throw an error if the fragments map is malformed.
635
+ */
636
+ find(filter?: {
637
+ [name: string]: string[];
638
+ }): FRAGS.FragmentIdMap;
639
+ /**
640
+ * Classifies fragments based on their modelID.
641
+ *
642
+ * @param modelID - The unique identifier of the model to classify fragments by.
643
+ * @param group - The FragmentsGroup containing the fragments to be classified.
644
+ *
645
+ * @remarks
646
+ * This method iterates through the fragments in the provided group,
647
+ * and classifies them based on their modelID.
648
+ * The classification is stored in the 'list.models' property,
649
+ * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
650
+ *
651
+ */
652
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
653
+ /**
654
+ * Classifies fragments based on their PredefinedType property.
655
+ *
656
+ * @param group - The FragmentsGroup containing the fragments to be classified.
657
+ *
658
+ * @remarks
659
+ * This method iterates through the properties of the fragments in the provided group,
660
+ * and classifies them based on their PredefinedType property.
661
+ * The classification is stored in the 'list.predefinedTypes' property,
662
+ * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
663
+ *
664
+ * @throws Will throw an error if the fragment ID is not found.
665
+ */
666
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
667
+ /**
668
+ * Classifies fragments based on their entity type.
669
+ *
670
+ * @param group - The FragmentsGroup containing the fragments to be classified.
671
+ *
672
+ * @remarks
673
+ * This method iterates through the relations of the fragments in the provided group,
674
+ * and classifies them based on their entity type.
675
+ * The classification is stored in the 'list.entities' property,
676
+ * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
677
+ *
678
+ * @throws Will throw an error if the fragment ID is not found.
679
+ */
680
+ byEntity(group: FRAGS.FragmentsGroup): void;
681
+ /**
682
+ * Classifies fragments based on a specific IFC relationship.
683
+ *
684
+ * @param group - The FragmentsGroup containing the fragments to be classified.
685
+ * @param ifcRel - The IFC relationship number to classify fragments by.
686
+ * @param systemName - The name of the classification system to store the classification.
687
+ *
688
+ * @remarks
689
+ * This method iterates through the relations of the fragments in the provided group,
690
+ * and classifies them based on the specified IFC relationship.
691
+ * The classification is stored in the 'list' property under the specified system name,
692
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
693
+ *
694
+ * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
695
+ */
696
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
697
+ /**
698
+ * Classifies fragments based on their spatial structure in the IFC model.
699
+ *
700
+ * @param model - The FragmentsGroup containing the fragments to be classified.
701
+ * @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
702
+ *
703
+ * @remarks
704
+ * This method iterates through the relations of the fragments in the provided group,
705
+ * and classifies them based on their spatial structure in the IFC model.
706
+ * The classification is stored in the 'list' property under the system name "spatialStructures",
707
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
708
+ *
709
+ * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
710
+ */
711
+ bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
712
+ useProperties: boolean;
713
+ }): Promise<void>;
714
+ /**
715
+ * Sets the color of the specified fragments.
716
+ *
717
+ * @param items - A map of fragment IDs to their respective express IDs.
718
+ * @param color - The color to set for the fragments.
719
+ * @param override - A boolean indicating whether to override the existing color of the fragments.
720
+ *
721
+ * @remarks
722
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
723
+ * and sets their color using the 'setColor' method of the FragmentsGroup class.
724
+ *
725
+ * @throws Will throw an error if the fragment with the specified ID is not found.
726
+ */
727
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
728
+ /**
729
+ * Resets the color of the specified fragments to their original color.
730
+ *
731
+ * @param items - A map of fragment IDs to their respective express IDs.
732
+ *
733
+ * @remarks
734
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
735
+ * and resets their color using the 'resetColor' method of the FragmentsGroup class.
736
+ *
737
+ * @throws Will throw an error if the fragment with the specified ID is not found.
738
+ */
739
+ resetColor(items: FRAGS.FragmentIdMap): void;
740
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
741
+ }
742
+ import * as THREE from "three";
743
+ import * as FRAGS from "@thatopen/fragments";
744
+ import { FragmentsGroup } from "@thatopen/fragments";
745
+ import { Component, Components, Disposable, Event } from "../../core";
746
+ /**
747
+ * 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).
748
+ */
749
+ export declare class BoundingBoxer extends Component implements Disposable {
750
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
751
+ /** {@link Component.enabled} */
752
+ enabled: boolean;
753
+ /** {@link Disposable.onDisposed} */
754
+ readonly onDisposed: Event<unknown>;
755
+ private _absoluteMin;
756
+ private _absoluteMax;
757
+ private _meshes;
758
+ constructor(components: Components);
759
+ /**
760
+ * A static method to calculate the dimensions of a given bounding box.
761
+ *
762
+ * @param bbox - The bounding box to calculate the dimensions for.
763
+ * @returns An object containing the width, height, depth, and center of the bounding box.
764
+ */
765
+ static getDimensions(bbox: THREE.Box3): {
766
+ width: number;
767
+ height: number;
768
+ depth: number;
594
769
  center: THREE.Vector3;
595
770
  };
596
771
  /**
@@ -772,82 +947,24 @@ export declare class BoundingBoxer extends Component implements Disposable {
772
947
  addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
773
948
  private static getFragmentBounds;
774
949
  }
775
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
776
- import * as THREE from "three";
777
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
778
- center: THREE.Vector3;
779
- halfSizes: THREE.Vector3;
780
- rotation: THREE.Matrix3;
781
- transformation: THREE.Matrix4;
782
- };
783
- import { Component, Disposable, Event, Components } from "../../core";
950
+ import * as FRAGS from "@thatopen/fragments";
951
+ import { Components, Component } from "../../core";
784
952
  /**
785
- * The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
953
+ * A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
786
954
  */
787
- export declare class Exploder extends Component implements Disposable {
955
+ export declare class Hider extends Component {
788
956
  /**
789
957
  * A unique identifier for the component.
790
958
  * This UUID is used to register the component within the Components system.
791
959
  */
792
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
793
- /** {@link Disposable.onDisposed} */
794
- readonly onDisposed: Event<unknown>;
960
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
795
961
  /** {@link Component.enabled} */
796
962
  enabled: boolean;
797
- /**
798
- * The height of the explosion animation.
799
- * This property determines the vertical distance by which fragments are moved during the explosion.
800
- * Default value is 10.
801
- */
802
- height: number;
803
- /**
804
- * The group name used for the explosion animation.
805
- * This property specifies the group of fragments that will be affected by the explosion.
806
- * Default value is "storeys".
807
- */
808
- groupName: string;
809
- /**
810
- * A set of strings representing the exploded items.
811
- * This set is used to keep track of which items have been exploded.
812
- */
813
- list: Set<string>;
814
963
  constructor(components: Components);
815
- /** {@link Disposable.dispose} */
816
- dispose(): void;
817
964
  /**
818
- * Sets the explosion state of the fragments.
819
- *
820
- * @param active - A boolean indicating whether to activate or deactivate the explosion.
821
- *
822
- * @remarks
823
- * This method applies a vertical transformation to the fragments based on the 'active' parameter.
824
- * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
825
- * If 'active' is false, the fragments are moved back to their original position.
826
- *
827
- * The method also keeps track of the exploded items using the 'list' set.
828
- *
829
- * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
830
- */
831
- set(active: boolean): void;
832
- }
833
- import * as FRAGS from "@thatopen/fragments";
834
- import { Components, Component } from "../../core";
835
- /**
836
- * A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
837
- */
838
- export declare class Hider extends Component {
839
- /**
840
- * A unique identifier for the component.
841
- * This UUID is used to register the component within the Components system.
842
- */
843
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
844
- /** {@link Component.enabled} */
845
- enabled: boolean;
846
- constructor(components: Components);
847
- /**
848
- * Sets the visibility of fragments within the 3D scene.
849
- * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
850
- * If 'items' is provided, only the specified fragments will be affected.
965
+ * Sets the visibility of fragments within the 3D scene.
966
+ * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
967
+ * If 'items' is provided, only the specified fragments will be affected.
851
968
  *
852
969
  * @param visible - The visibility state to set for the fragments.
853
970
  * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
@@ -868,125 +985,6 @@ export declare class Hider extends Component {
868
985
  isolate(items: FRAGS.FragmentIdMap): void;
869
986
  private updateCulledVisibility;
870
987
  }
871
- import * as THREE from "three";
872
- export declare class MaterialsUtils {
873
- static isTransparent(material: THREE.Material): boolean;
874
- }
875
- import * as WEBIFC from "web-ifc";
876
- import * as FRAGS from "@thatopen/fragments";
877
- import { IfcFragmentSettings } from "./src";
878
- import { Component, Components, Event, Disposable } from "../../core";
879
- /**
880
- * The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
881
- */
882
- export declare class IfcLoader extends Component implements Disposable {
883
- /**
884
- * A unique identifier for the component.
885
- * This UUID is used to register the component within the Components system.
886
- */
887
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
888
- /** {@link Disposable.onDisposed} */
889
- readonly onDisposed: Event<string>;
890
- /**
891
- * An event triggered when the IFC file starts loading.
892
- */
893
- readonly onIfcStartedLoading: Event<void>;
894
- /**
895
- * An event triggered when the setup process is completed.
896
- */
897
- readonly onSetup: Event<void>;
898
- /**
899
- * The settings for the IfcLoader.
900
- * It includes options for excluding categories, setting WASM paths, and more.
901
- */
902
- settings: IfcFragmentSettings;
903
- /**
904
- * The instance of the Web-IFC library used for handling IFC data.
905
- */
906
- webIfc: WEBIFC.IfcAPI;
907
- /** {@link Component.enabled} */
908
- enabled: boolean;
909
- private _material;
910
- private _spatialTree;
911
- private _metaData;
912
- private _fragmentInstances;
913
- private _civil;
914
- private _visitedFragments;
915
- private _materialT;
916
- constructor(components: Components);
917
- /** {@link Disposable.dispose} */
918
- dispose(): void;
919
- /**
920
- * Sets up the IfcLoader component with the provided configuration.
921
- *
922
- * @param config - Optional configuration settings for the IfcLoader.
923
- * If not provided, the existing settings will be used.
924
- *
925
- * @returns A Promise that resolves when the setup process is completed.
926
- *
927
- * @remarks
928
- * If the 'autoSetWasm' option is enabled in the configuration,
929
- * the method will automatically set the WASM paths for the Web-IFC library.
930
- *
931
- * @example
932
- * '''typescript
933
- * const ifcLoader = new IfcLoader(components);
934
- * await ifcLoader.setup({ autoSetWasm: true });
935
- * '''
936
- */
937
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
938
- /**
939
- * Loads an IFC file and processes it for 3D visualization.
940
- *
941
- * @param data - The Uint8Array containing the IFC file data.
942
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
943
- *
944
- * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
945
- *
946
- * @example
947
- * '''typescript
948
- * const ifcLoader = components.get(IfcLoader);
949
- * const group = await ifcLoader.load(ifcData);
950
- * '''
951
- */
952
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
953
- /**
954
- * Reads an IFC file and initializes the Web-IFC library.
955
- *
956
- * @param data - The Uint8Array containing the IFC file data.
957
- *
958
- * @returns A Promise that resolves when the IFC file is opened and initialized.
959
- *
960
- * @remarks
961
- * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
962
- * It also opens the IFC model using the provided data and settings.
963
- *
964
- * @example
965
- * '''typescript
966
- * const ifcLoader = components.get(IfcLoader);
967
- * await ifcLoader.readIfcFile(ifcData);
968
- * '''
969
- */
970
- readIfcFile(data: Uint8Array): Promise<number>;
971
- /**
972
- * Cleans up the IfcLoader component by resetting the Web-IFC library,
973
- * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
974
- *
975
- * @remarks
976
- * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
977
- *
978
- * @example
979
- * '''typescript
980
- * const ifcLoader = components.get(IfcLoader);
981
- * ifcLoader.cleanUp();
982
- * '''
983
- */
984
- cleanUp(): void;
985
- private getAllGeometries;
986
- private getMesh;
987
- private getGeometry;
988
- private autoSetWasm;
989
- }
990
988
  import * as WEBIFC from "web-ifc";
991
989
  import { Components, Disposable, Event, Component } from "../../core";
992
990
  import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
@@ -1085,254 +1083,84 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
1085
1083
  private streamAssets;
1086
1084
  private streamGeometries;
1087
1085
  }
1086
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1088
1087
  import * as THREE from "three";
1089
1088
  import * as FRAGS from "@thatopen/fragments";
1090
- import { Component, Components } from "../../core";
1089
+ import { Component, Components, Event, Disposable } from "../../core";
1090
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1091
1091
  /**
1092
- * Represents an edge measurement result.
1092
+ * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
1093
1093
  */
1094
- export interface MeasureEdge {
1094
+ export declare class FragmentsManager extends Component implements Disposable {
1095
1095
  /**
1096
- * The distance between the two points of the edge.
1096
+ * A unique identifier for the component.
1097
+ * This UUID is used to register the component within the Components system.
1097
1098
  */
1098
- distance: number;
1099
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1100
+ /** {@link Disposable.onDisposed} */
1101
+ readonly onDisposed: Event<unknown>;
1099
1102
  /**
1100
- * The two points that define the edge.
1103
+ * Event triggered when fragments are loaded.
1101
1104
  */
1102
- points: THREE.Vector3[];
1103
- }
1104
- /**
1105
- * 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).
1106
- */
1107
- export declare class MeasurementUtils extends Component {
1105
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
1108
1106
  /**
1109
- * A unique identifier for the component.
1110
- * This UUID is used to register the component within the Components system.
1107
+ * Event triggered when fragments are disposed.
1111
1108
  */
1112
- static uuid: string;
1109
+ readonly onFragmentsDisposed: Event<{
1110
+ groupID: string;
1111
+ fragmentIDs: string[];
1112
+ }>;
1113
+ /**
1114
+ * Map containing all loaded fragments.
1115
+ * The key is the fragment's unique identifier, and the value is the fragment itself.
1116
+ */
1117
+ readonly list: Map<string, Fragment>;
1118
+ /**
1119
+ * Map containing all loaded fragment groups.
1120
+ * The key is the group's unique identifier, and the value is the group itself.
1121
+ */
1122
+ readonly groups: Map<string, FragmentsGroup>;
1123
+ baseCoordinationModel: string;
1113
1124
  /** {@link Component.enabled} */
1114
1125
  enabled: boolean;
1126
+ private _loader;
1127
+ /**
1128
+ * Getter for the meshes of all fragments in the FragmentsManager.
1129
+ * It iterates over the fragments in the list and pushes their meshes into an array.
1130
+ * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
1131
+ */
1132
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
1115
1133
  constructor(components: Components);
1134
+ /** {@link Disposable.dispose} */
1135
+ dispose(): void;
1116
1136
  /**
1117
- * Utility method to calculate the distance from a point to a line segment.
1137
+ * Dispose of a specific fragment group.
1138
+ * This method removes the group from the groups map, deletes all fragments within the group from the list,
1139
+ * disposes of the group, and triggers the onFragmentsDisposed event.
1118
1140
  *
1119
- * @param point - The point from which to calculate the distance.
1120
- * @param lineStart - The start point of the line segment.
1121
- * @param lineEnd - The end point of the line segment.
1122
- * @param clamp - If true, the distance will be clamped to the line segment's length.
1123
- * @returns The distance from the point to the line segment.
1141
+ * @param group - The fragment group to be disposed.
1124
1142
  */
1125
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
1143
+ disposeGroup(group: FragmentsGroup): void;
1126
1144
  /**
1127
- * Method to get the face of a mesh that contains a given triangle index.
1128
- * It also returns the edges of the found face and their indices.
1129
- *
1130
- * @param mesh - The mesh to get the face from. It must be indexed.
1131
- * @param triangleIndex - The index of the triangle within the mesh.
1132
- * @param instance - The instance of the mesh (optional).
1133
- * @returns An object containing the edges of the found face and their indices, or null if no face was found.
1145
+ * Loads a binary file that contain fragment geometry.
1146
+ * @param data - The binary data to load.
1147
+ * @param config - Optional configuration for loading.
1148
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
1149
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
1150
+ * @returns The loaded FragmentsGroup.
1134
1151
  */
1135
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
1136
- edges: MeasureEdge[];
1137
- indices: Set<number>;
1138
- } | null;
1152
+ load(data: Uint8Array, config?: Partial<{
1153
+ coordinate: boolean;
1154
+ name: string;
1155
+ properties: FRAGS.IfcProperties;
1156
+ relationsMap: RelationsMap;
1157
+ }>): FragmentsGroup;
1139
1158
  /**
1140
- * Method to get the vertices and normal of a mesh face at a given index.
1141
- * It also applies instance transformation if provided.
1142
- *
1143
- * @param mesh - The mesh to get the face from. It must be indexed.
1144
- * @param faceIndex - The index of the face within the mesh.
1145
- * @param instance - The instance of the mesh (optional).
1146
- * @returns An object containing the vertices and normal of the face.
1147
- * @throws Will throw an error if the geometry is not indexed.
1159
+ * Export the specified fragmentsgroup to binary data.
1160
+ * @param group - the fragments group to be exported.
1161
+ * @returns the exported data as binary buffer.
1148
1162
  */
1149
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
1150
- p1: THREE.Vector3;
1151
- p2: THREE.Vector3;
1152
- p3: THREE.Vector3;
1153
- faceNormal: THREE.Vector3;
1154
- };
1155
- /**
1156
- * Method to round the vector's components to a specified number of decimal places.
1157
- * This is used to ensure numerical precision in edge detection.
1158
- *
1159
- * @param vector - The vector to round.
1160
- * @returns The vector with rounded components.
1161
- */
1162
- round(vector: THREE.Vector3): void;
1163
- /**
1164
- * Calculates the volume of a set of fragments.
1165
- *
1166
- * @param frags - A map of fragment IDs to their corresponding item IDs.
1167
- * @returns The total volume of the fragments and the bounding sphere.
1168
- *
1169
- * @remarks
1170
- * This method creates a set of instanced meshes from the given fragments and item IDs.
1171
- * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
1172
- *
1173
- * @throws Will throw an error if the geometry of the meshes is not indexed.
1174
- * @throws Will throw an error if the fragment manager is not available.
1175
- */
1176
- getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
1177
- /**
1178
- * Calculates the total volume of a set of meshes.
1179
- *
1180
- * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
1181
- * @returns The total volume of the meshes and the bounding sphere.
1182
- *
1183
- * @remarks
1184
- * This method calculates the volume of each mesh in the provided array and returns the total volume
1185
- * and its bounding sphere.
1186
- *
1187
- */
1188
- getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
1189
- private getFaceData;
1190
- private getVolumeOfMesh;
1191
- private getSignedVolumeOfTriangle;
1192
- }
1193
- import * as WEBIFC from "web-ifc";
1194
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
1195
- import { PropertiesStreamingSettings } from "./src";
1196
- /**
1197
- * 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).
1198
- */
1199
- export declare class IfcPropertiesTiler extends Component implements Disposable {
1200
- /**
1201
- * A unique identifier for the component.
1202
- * This UUID is used to register the component within the Components system.
1203
- */
1204
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1205
- /**
1206
- * An event that is triggered when properties are streamed from the IFC file.
1207
- * The event provides the type of the IFC entity and the corresponding data.
1208
- */
1209
- readonly onPropertiesStreamed: AsyncEvent<{
1210
- type: number;
1211
- data: {
1212
- [id: number]: any;
1213
- };
1214
- }>;
1215
- /**
1216
- * An event that is triggered to indicate the progress of the streaming process.
1217
- * The event provides a number between 0 and 1 representing the progress percentage.
1218
- */
1219
- readonly onProgress: AsyncEvent<number>;
1220
- /**
1221
- * An event that is triggered when indices are streamed from the IFC file.
1222
- * The event provides a map of indices, where the key is the entity type and the value is another map of indices.
1223
- */
1224
- readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
1225
- /** {@link Disposable.onDisposed} */
1226
- readonly onDisposed: Event<string>;
1227
- /** {@link Component.enabled} */
1228
- enabled: boolean;
1229
- /**
1230
- * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
1231
- */
1232
- settings: PropertiesStreamingSettings;
1233
- /**
1234
- * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
1235
- */
1236
- webIfc: WEBIFC.IfcAPI;
1237
- /** {@link Disposable.dispose} */
1238
- dispose(): Promise<void>;
1239
- /**
1240
- * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1241
- *
1242
- * @param data - The Uint8Array containing the IFC file data.
1243
- * @returns A Promise that resolves when the streaming process is complete.
1244
- */
1245
- streamFromBuffer(data: Uint8Array): Promise<void>;
1246
- /**
1247
- * This method converts properties from an IFC file to tiles using a given callback function to read the file.
1248
- *
1249
- * @param loadCallback - A callback function that loads the IFC file data.
1250
- * @returns A Promise that resolves when the streaming process is complete.
1251
- */
1252
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1253
- private readIfcFile;
1254
- private streamIfcFile;
1255
- private streamAllProperties;
1256
- private cleanUp;
1257
- }
1258
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1259
- import * as THREE from "three";
1260
- import * as FRAGS from "@thatopen/fragments";
1261
- import { Component, Components, Event, Disposable } from "../../core";
1262
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1263
- /**
1264
- * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
1265
- */
1266
- export declare class FragmentsManager extends Component implements Disposable {
1267
- /**
1268
- * A unique identifier for the component.
1269
- * This UUID is used to register the component within the Components system.
1270
- */
1271
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1272
- /** {@link Disposable.onDisposed} */
1273
- readonly onDisposed: Event<unknown>;
1274
- /**
1275
- * Event triggered when fragments are loaded.
1276
- */
1277
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
1278
- /**
1279
- * Event triggered when fragments are disposed.
1280
- */
1281
- readonly onFragmentsDisposed: Event<{
1282
- groupID: string;
1283
- fragmentIDs: string[];
1284
- }>;
1285
- /**
1286
- * Map containing all loaded fragments.
1287
- * The key is the fragment's unique identifier, and the value is the fragment itself.
1288
- */
1289
- readonly list: Map<string, Fragment>;
1290
- /**
1291
- * Map containing all loaded fragment groups.
1292
- * The key is the group's unique identifier, and the value is the group itself.
1293
- */
1294
- readonly groups: Map<string, FragmentsGroup>;
1295
- baseCoordinationModel: string;
1296
- /** {@link Component.enabled} */
1297
- enabled: boolean;
1298
- private _loader;
1299
- /**
1300
- * Getter for the meshes of all fragments in the FragmentsManager.
1301
- * It iterates over the fragments in the list and pushes their meshes into an array.
1302
- * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
1303
- */
1304
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
1305
- constructor(components: Components);
1306
- /** {@link Disposable.dispose} */
1307
- dispose(): void;
1308
- /**
1309
- * Dispose of a specific fragment group.
1310
- * This method removes the group from the groups map, deletes all fragments within the group from the list,
1311
- * disposes of the group, and triggers the onFragmentsDisposed event.
1312
- *
1313
- * @param group - The fragment group to be disposed.
1314
- */
1315
- disposeGroup(group: FragmentsGroup): void;
1316
- /**
1317
- * Loads a binary file that contain fragment geometry.
1318
- * @param data - The binary data to load.
1319
- * @param config - Optional configuration for loading.
1320
- * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
1321
- * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
1322
- * @returns The loaded FragmentsGroup.
1323
- */
1324
- load(data: Uint8Array, config?: Partial<{
1325
- coordinate: boolean;
1326
- name: string;
1327
- properties: FRAGS.IfcProperties;
1328
- relationsMap: RelationsMap;
1329
- }>): FragmentsGroup;
1330
- /**
1331
- * Export the specified fragmentsgroup to binary data.
1332
- * @param group - the fragments group to be exported.
1333
- * @returns the exported data as binary buffer.
1334
- */
1335
- export(group: FragmentsGroup): Uint8Array;
1163
+ export(group: FragmentsGroup): Uint8Array;
1336
1164
  /**
1337
1165
  * Gets a map of model IDs to sets of express IDs for the given fragment ID map.
1338
1166
  * @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
@@ -1360,201 +1188,12 @@ export declare class FragmentsManager extends Component implements Disposable {
1360
1188
  * The first model in the list becomes the base model for coordinate transformation.
1361
1189
  * All other models are then transformed to match the base model's coordinate system.
1362
1190
  *
1363
- * @param models - The models to apply coordinate transformation to.
1364
- * If not provided, all groups are used.
1365
- *
1366
- * @returns {void}
1367
- */
1368
- coordinate(models?: FragmentsGroup[]): void;
1369
- }
1370
- import * as THREE from "three";
1371
- import * as FRAGS from "@thatopen/fragments";
1372
- import { Disposable, Component, Event, Components } from "../../core";
1373
- /**
1374
- * 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.
1375
- */
1376
- export interface Classification {
1377
- /**
1378
- * A system within the classification.
1379
- * The key is the system name, and the value is an object representing the classes within the system.
1380
- */
1381
- [system: string]: {
1382
- /**
1383
- * A class within the system.
1384
- * The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
1385
- */
1386
- [className: string]: FRAGS.FragmentIdMap;
1387
- };
1388
- }
1389
- /**
1390
- * 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).
1391
- */
1392
- export declare class Classifier extends Component implements Disposable {
1393
- /**
1394
- * A unique identifier for the component.
1395
- * This UUID is used to register the component within the Components system.
1396
- */
1397
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
1398
- /** {@link Component.enabled} */
1399
- enabled: boolean;
1400
- /**
1401
- * A map representing the classification systems.
1402
- * The key is the system name, and the value is an object representing the classes within the system.
1403
- */
1404
- list: Classification;
1405
- /** {@link Disposable.onDisposed} */
1406
- readonly onDisposed: Event<unknown>;
1407
- constructor(components: Components);
1408
- private onFragmentsDisposed;
1409
- /** {@link Disposable.dispose} */
1410
- dispose(): void;
1411
- /**
1412
- * Removes a fragment from the classification based on its unique identifier (guid).
1413
- * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
1414
- *
1415
- * @param guid - The unique identifier of the fragment to be removed.
1416
- */
1417
- remove(guid: string): void;
1418
- /**
1419
- * Finds and returns fragments based on the provided filter criteria.
1420
- * If no filter is provided, it returns all fragments.
1421
- *
1422
- * @param filter - An optional object containing filter criteria.
1423
- * The keys of the object represent the classification system names,
1424
- * and the values are arrays of class names to match.
1425
- *
1426
- * @returns A map of fragment GUIDs to their respective express IDs,
1427
- * where the express IDs are filtered based on the provided filter criteria.
1428
- *
1429
- * @throws Will throw an error if the fragments map is malformed.
1430
- */
1431
- find(filter?: {
1432
- [name: string]: string[];
1433
- }): FRAGS.FragmentIdMap;
1434
- /**
1435
- * Classifies fragments based on their modelID.
1436
- *
1437
- * @param modelID - The unique identifier of the model to classify fragments by.
1438
- * @param group - The FragmentsGroup containing the fragments to be classified.
1439
- *
1440
- * @remarks
1441
- * This method iterates through the fragments in the provided group,
1442
- * and classifies them based on their modelID.
1443
- * The classification is stored in the 'list.models' property,
1444
- * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
1445
- *
1446
- */
1447
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
1448
- /**
1449
- * Classifies fragments based on their PredefinedType property.
1450
- *
1451
- * @param group - The FragmentsGroup containing the fragments to be classified.
1452
- *
1453
- * @remarks
1454
- * This method iterates through the properties of the fragments in the provided group,
1455
- * and classifies them based on their PredefinedType property.
1456
- * The classification is stored in the 'list.predefinedTypes' property,
1457
- * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
1458
- *
1459
- * @throws Will throw an error if the fragment ID is not found.
1460
- */
1461
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
1462
- /**
1463
- * Classifies fragments based on their entity type.
1464
- *
1465
- * @param group - The FragmentsGroup containing the fragments to be classified.
1466
- *
1467
- * @remarks
1468
- * This method iterates through the relations of the fragments in the provided group,
1469
- * and classifies them based on their entity type.
1470
- * The classification is stored in the 'list.entities' property,
1471
- * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
1472
- *
1473
- * @throws Will throw an error if the fragment ID is not found.
1474
- */
1475
- byEntity(group: FRAGS.FragmentsGroup): void;
1476
- /**
1477
- * Classifies fragments based on a specific IFC relationship.
1478
- *
1479
- * @param group - The FragmentsGroup containing the fragments to be classified.
1480
- * @param ifcRel - The IFC relationship number to classify fragments by.
1481
- * @param systemName - The name of the classification system to store the classification.
1482
- *
1483
- * @remarks
1484
- * This method iterates through the relations of the fragments in the provided group,
1485
- * and classifies them based on the specified IFC relationship.
1486
- * The classification is stored in the 'list' property under the specified system name,
1487
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1488
- *
1489
- * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
1490
- */
1491
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
1492
- /**
1493
- * Classifies fragments based on their spatial structure in the IFC model.
1494
- *
1495
- * @param model - The FragmentsGroup containing the fragments to be classified.
1496
- *
1497
- * @remarks
1498
- * This method iterates through the relations of the fragments in the provided group,
1499
- * and classifies them based on their spatial structure in the IFC model.
1500
- * The classification is stored in the 'list' property under the system name "spatialStructures",
1501
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1502
- *
1503
- * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
1504
- */
1505
- bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
1506
- /**
1507
- * Sets the color of the specified fragments.
1508
- *
1509
- * @param items - A map of fragment IDs to their respective express IDs.
1510
- * @param color - The color to set for the fragments.
1511
- * @param override - A boolean indicating whether to override the existing color of the fragments.
1512
- *
1513
- * @remarks
1514
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
1515
- * and sets their color using the 'setColor' method of the FragmentsGroup class.
1516
- *
1517
- * @throws Will throw an error if the fragment with the specified ID is not found.
1518
- */
1519
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
1520
- /**
1521
- * Resets the color of the specified fragments to their original color.
1522
- *
1523
- * @param items - A map of fragment IDs to their respective express IDs.
1524
- *
1525
- * @remarks
1526
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
1527
- * and resets their color using the 'resetColor' method of the FragmentsGroup class.
1528
- *
1529
- * @throws Will throw an error if the fragment with the specified ID is not found.
1530
- */
1531
- resetColor(items: FRAGS.FragmentIdMap): void;
1532
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
1533
- }
1534
- import * as WEBIFC from "web-ifc";
1535
- import * as FRAG from "@thatopen/fragments";
1536
- import { Component, Components } from "../../core";
1537
- /**
1538
- * 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).
1539
- */
1540
- export declare class IfcJsonExporter extends Component {
1541
- /**
1542
- * A unique identifier for the component.
1543
- * This UUID is used to register the component within the Components system.
1544
- */
1545
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1546
- /** {@link Component.enabled} */
1547
- enabled: boolean;
1548
- constructor(components: Components);
1549
- /**
1550
- * Exports all the properties of an IFC into an array of JS objects.
1551
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1552
- * @param modelID ID of the IFC model whose properties to extract.
1553
- * @param indirect whether to get the indirect relationships as well.
1554
- * @param recursiveSpatial whether to get the properties of spatial items recursively
1555
- * to make the location data available (e.g. absolute position of building).
1191
+ * @param models - The models to apply coordinate transformation to.
1192
+ * If not provided, all groups are used.
1193
+ *
1194
+ * @returns {void}
1556
1195
  */
1557
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1196
+ coordinate(models?: FragmentsGroup[]): void;
1558
1197
  }
1559
1198
  import * as WEBIFC from "web-ifc";
1560
1199
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -1626,77 +1265,325 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
1626
1265
  * representation of the relations indexed by entity expressIDs and relation types.
1627
1266
  * @throws An error if the model does not have properties loaded.
1628
1267
  */
1629
- process(model: FragmentsGroup): Promise<RelationsMap>;
1268
+ process(model: FragmentsGroup): Promise<RelationsMap>;
1269
+ /**
1270
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
1271
+ *
1272
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
1273
+ * @param modelID - The unique identifier of the model within the WebIfc API.
1274
+ * @returns A promise that resolves to the relations map for the processed model.
1275
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
1276
+ */
1277
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
1278
+ /**
1279
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
1280
+ * This method searches the indexed relation maps for the specified model and entity,
1281
+ * returning the IDs of related entities if a match is found.
1282
+ *
1283
+ * @param model The 'FragmentsGroup' model containing the entity.
1284
+ * @param expressID The unique identifier of the entity within the model.
1285
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
1286
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
1287
+ * or the specified relation name is not indexed.
1288
+ */
1289
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
1290
+ /**
1291
+ * Serializes the relations of a given relation map into a JSON string.
1292
+ * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
1293
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1294
+ * The resulting object is then serialized into a JSON string.
1295
+ *
1296
+ * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
1297
+ * @returns A JSON string representing the serialized relations of the given relation map.
1298
+ */
1299
+ serializeRelations(relationMap: RelationsMap): string;
1300
+ /**
1301
+ * Serializes the relations of a specific model into a JSON string.
1302
+ * This method iterates through the relations indexed for the given model,
1303
+ * organizing them into a structured object where each key is an expressID of an entity,
1304
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1305
+ * The resulting object is then serialized into a JSON string.
1306
+ *
1307
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
1308
+ * @returns A JSON string representing the serialized relations of the specified model.
1309
+ * If the model has no indexed relations, 'null' is returned.
1310
+ */
1311
+ serializeModelRelations(model: FragmentsGroup): string | null;
1312
+ /**
1313
+ * Serializes all relations of every model processed by the indexer into a JSON string.
1314
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
1315
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
1316
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
1317
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
1318
+ *
1319
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
1320
+ * If no relations have been indexed, an empty object is returned as a JSON string.
1321
+ */
1322
+ serializeAllRelations(): string;
1323
+ /**
1324
+ * Converts a JSON string representing relations between entities into a structured map.
1325
+ * This method parses the JSON string to reconstruct the relations map that indexes
1326
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
1327
+ * and the values are maps where each key is a relation type ID and its value is an array
1328
+ * of express IDs of entities related through that relation type.
1329
+ *
1330
+ * @param json The JSON string to be parsed into the relations map.
1331
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
1332
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
1333
+ * is an array of express IDs (as numbers) of entities related through that relation type.
1334
+ */
1335
+ getRelationsMapFromJSON(json: string): RelationsMap;
1336
+ /** {@link Disposable.dispose} */
1337
+ dispose(): void;
1338
+ /**
1339
+ * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
1340
+ *
1341
+ * @param model The BIM model whose children to get.
1342
+ * @param id The expressID of the item whose children to get.
1343
+ * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
1344
+ *
1345
+ * @returns A 'Set' with the expressIDs of the found items.
1346
+ */
1347
+ getElementsChildren(model: FragmentsGroup, id: number, found?: Set<number>): Set<number>;
1348
+ }
1349
+ import * as WEBIFC from "web-ifc";
1350
+ import * as FRAGS from "@thatopen/fragments";
1351
+ import { IfcFragmentSettings } from "./src";
1352
+ import { Component, Components, Event, Disposable } from "../../core";
1353
+ /**
1354
+ * The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
1355
+ */
1356
+ export declare class IfcLoader extends Component implements Disposable {
1357
+ /**
1358
+ * A unique identifier for the component.
1359
+ * This UUID is used to register the component within the Components system.
1360
+ */
1361
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1362
+ /** {@link Disposable.onDisposed} */
1363
+ readonly onDisposed: Event<string>;
1364
+ /**
1365
+ * An event triggered when the IFC file starts loading.
1366
+ */
1367
+ readonly onIfcStartedLoading: Event<void>;
1368
+ /**
1369
+ * An event triggered when the setup process is completed.
1370
+ */
1371
+ readonly onSetup: Event<void>;
1372
+ /**
1373
+ * The settings for the IfcLoader.
1374
+ * It includes options for excluding categories, setting WASM paths, and more.
1375
+ */
1376
+ settings: IfcFragmentSettings;
1377
+ /**
1378
+ * The instance of the Web-IFC library used for handling IFC data.
1379
+ */
1380
+ webIfc: WEBIFC.IfcAPI;
1381
+ /** {@link Component.enabled} */
1382
+ enabled: boolean;
1383
+ private _material;
1384
+ private _spatialTree;
1385
+ private _metaData;
1386
+ private _fragmentInstances;
1387
+ private _civil;
1388
+ private _visitedFragments;
1389
+ private _materialT;
1390
+ constructor(components: Components);
1391
+ /** {@link Disposable.dispose} */
1392
+ dispose(): void;
1393
+ /**
1394
+ * Sets up the IfcLoader component with the provided configuration.
1395
+ *
1396
+ * @param config - Optional configuration settings for the IfcLoader.
1397
+ * If not provided, the existing settings will be used.
1398
+ *
1399
+ * @returns A Promise that resolves when the setup process is completed.
1400
+ *
1401
+ * @remarks
1402
+ * If the 'autoSetWasm' option is enabled in the configuration,
1403
+ * the method will automatically set the WASM paths for the Web-IFC library.
1404
+ *
1405
+ * @example
1406
+ * '''typescript
1407
+ * const ifcLoader = new IfcLoader(components);
1408
+ * await ifcLoader.setup({ autoSetWasm: true });
1409
+ * '''
1410
+ */
1411
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1412
+ /**
1413
+ * Loads an IFC file and processes it for 3D visualization.
1414
+ *
1415
+ * @param data - The Uint8Array containing the IFC file data.
1416
+ * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1417
+ *
1418
+ * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1419
+ *
1420
+ * @example
1421
+ * '''typescript
1422
+ * const ifcLoader = components.get(IfcLoader);
1423
+ * const group = await ifcLoader.load(ifcData);
1424
+ * '''
1425
+ */
1426
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
1427
+ /**
1428
+ * Reads an IFC file and initializes the Web-IFC library.
1429
+ *
1430
+ * @param data - The Uint8Array containing the IFC file data.
1431
+ *
1432
+ * @returns A Promise that resolves when the IFC file is opened and initialized.
1433
+ *
1434
+ * @remarks
1435
+ * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1436
+ * It also opens the IFC model using the provided data and settings.
1437
+ *
1438
+ * @example
1439
+ * '''typescript
1440
+ * const ifcLoader = components.get(IfcLoader);
1441
+ * await ifcLoader.readIfcFile(ifcData);
1442
+ * '''
1443
+ */
1444
+ readIfcFile(data: Uint8Array): Promise<number>;
1445
+ /**
1446
+ * Cleans up the IfcLoader component by resetting the Web-IFC library,
1447
+ * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1448
+ *
1449
+ * @remarks
1450
+ * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1451
+ *
1452
+ * @example
1453
+ * '''typescript
1454
+ * const ifcLoader = components.get(IfcLoader);
1455
+ * ifcLoader.cleanUp();
1456
+ * '''
1457
+ */
1458
+ cleanUp(): void;
1459
+ private getAllGeometries;
1460
+ private getMesh;
1461
+ private getGeometry;
1462
+ private autoSetWasm;
1463
+ }
1464
+ import { Component, Disposable, Event, Components } from "../../core";
1465
+ /**
1466
+ * The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
1467
+ */
1468
+ export declare class Exploder extends Component implements Disposable {
1469
+ /**
1470
+ * A unique identifier for the component.
1471
+ * This UUID is used to register the component within the Components system.
1472
+ */
1473
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
1474
+ /** {@link Disposable.onDisposed} */
1475
+ readonly onDisposed: Event<unknown>;
1476
+ /** {@link Component.enabled} */
1477
+ enabled: boolean;
1478
+ /**
1479
+ * The height of the explosion animation.
1480
+ * This property determines the vertical distance by which fragments are moved during the explosion.
1481
+ * Default value is 10.
1482
+ */
1483
+ height: number;
1484
+ /**
1485
+ * The group name used for the explosion animation.
1486
+ * This property specifies the group of fragments that will be affected by the explosion.
1487
+ * Default value is "storeys".
1488
+ */
1489
+ groupName: string;
1490
+ /**
1491
+ * A set of strings representing the exploded items.
1492
+ * This set is used to keep track of which items have been exploded.
1493
+ */
1494
+ list: Set<string>;
1495
+ constructor(components: Components);
1496
+ /** {@link Disposable.dispose} */
1497
+ dispose(): void;
1498
+ /**
1499
+ * Sets the explosion state of the fragments.
1500
+ *
1501
+ * @param active - A boolean indicating whether to activate or deactivate the explosion.
1502
+ *
1503
+ * @remarks
1504
+ * This method applies a vertical transformation to the fragments based on the 'active' parameter.
1505
+ * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
1506
+ * If 'active' is false, the fragments are moved back to their original position.
1507
+ *
1508
+ * The method also keeps track of the exploded items using the 'list' set.
1509
+ *
1510
+ * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
1511
+ */
1512
+ set(active: boolean): void;
1513
+ }
1514
+ import * as WEBIFC from "web-ifc";
1515
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
1516
+ import { PropertiesStreamingSettings } from "./src";
1517
+ /**
1518
+ * 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).
1519
+ */
1520
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
1521
+ /**
1522
+ * A unique identifier for the component.
1523
+ * This UUID is used to register the component within the Components system.
1524
+ */
1525
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1630
1526
  /**
1631
- * Processes a given model from a WebIfc API to index its IFC entities relations.
1632
- *
1633
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
1634
- * @param modelID - The unique identifier of the model within the WebIfc API.
1635
- * @returns A promise that resolves to the relations map for the processed model.
1636
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
1527
+ * An event that is triggered when properties are streamed from the IFC file.
1528
+ * The event provides the type of the IFC entity and the corresponding data.
1637
1529
  */
1638
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
1530
+ readonly onPropertiesStreamed: AsyncEvent<{
1531
+ type: number;
1532
+ data: {
1533
+ [id: number]: any;
1534
+ };
1535
+ }>;
1639
1536
  /**
1640
- * Retrieves the relations of a specific entity within a model based on the given relation name.
1641
- * This method searches the indexed relation maps for the specified model and entity,
1642
- * returning the IDs of related entities if a match is found.
1643
- *
1644
- * @param model The 'FragmentsGroup' model containing the entity.
1645
- * @param expressID The unique identifier of the entity within the model.
1646
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
1647
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
1648
- * or the specified relation name is not indexed.
1537
+ * An event that is triggered to indicate the progress of the streaming process.
1538
+ * The event provides a number between 0 and 1 representing the progress percentage.
1649
1539
  */
1650
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
1540
+ readonly onProgress: AsyncEvent<number>;
1651
1541
  /**
1652
- * Serializes the relations of a given relation map into a JSON string.
1653
- * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
1654
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1655
- * The resulting object is then serialized into a JSON string.
1656
- *
1657
- * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
1658
- * @returns A JSON string representing the serialized relations of the given relation map.
1542
+ * An event that is triggered when indices are streamed from the IFC file.
1543
+ * The event provides a map of indices, where the key is the entity type and the value is another map of indices.
1659
1544
  */
1660
- serializeRelations(relationMap: RelationsMap): string;
1545
+ readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
1546
+ /** {@link Disposable.onDisposed} */
1547
+ readonly onDisposed: Event<string>;
1548
+ /** {@link Component.enabled} */
1549
+ enabled: boolean;
1661
1550
  /**
1662
- * Serializes the relations of a specific model into a JSON string.
1663
- * This method iterates through the relations indexed for the given model,
1664
- * organizing them into a structured object where each key is an expressID of an entity,
1665
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1666
- * The resulting object is then serialized into a JSON string.
1667
- *
1668
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
1669
- * @returns A JSON string representing the serialized relations of the specified model.
1670
- * If the model has no indexed relations, 'null' is returned.
1551
+ * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
1671
1552
  */
1672
- serializeModelRelations(model: FragmentsGroup): string | null;
1553
+ settings: PropertiesStreamingSettings;
1673
1554
  /**
1674
- * Serializes all relations of every model processed by the indexer into a JSON string.
1675
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
1676
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
1677
- * and its value is another object mapping entity expressIDs to their related entities, categorized
1678
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
1555
+ * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
1556
+ */
1557
+ webIfc: WEBIFC.IfcAPI;
1558
+ /** {@link Disposable.dispose} */
1559
+ dispose(): Promise<void>;
1560
+ /**
1561
+ * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1679
1562
  *
1680
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
1681
- * If no relations have been indexed, an empty object is returned as a JSON string.
1563
+ * @param data - The Uint8Array containing the IFC file data.
1564
+ * @returns A Promise that resolves when the streaming process is complete.
1682
1565
  */
1683
- serializeAllRelations(): string;
1566
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1684
1567
  /**
1685
- * Converts a JSON string representing relations between entities into a structured map.
1686
- * This method parses the JSON string to reconstruct the relations map that indexes
1687
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
1688
- * and the values are maps where each key is a relation type ID and its value is an array
1689
- * of express IDs of entities related through that relation type.
1568
+ * This method converts properties from an IFC file to tiles using a given callback function to read the file.
1690
1569
  *
1691
- * @param json The JSON string to be parsed into the relations map.
1692
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
1693
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
1694
- * is an array of express IDs (as numbers) of entities related through that relation type.
1570
+ * @param loadCallback - A callback function that loads the IFC file data.
1571
+ * @returns A Promise that resolves when the streaming process is complete.
1695
1572
  */
1696
- getRelationsMapFromJSON(json: string): RelationsMap;
1697
- /** {@link Disposable.dispose} */
1698
- dispose(): void;
1573
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1574
+ private readIfcFile;
1575
+ private streamIfcFile;
1576
+ private streamAllProperties;
1577
+ private cleanUp;
1699
1578
  }
1579
+ import * as THREE from "three";
1580
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
1581
+ center: THREE.Vector3;
1582
+ halfSizes: THREE.Vector3;
1583
+ rotation: THREE.Matrix3;
1584
+ transformation: THREE.Matrix4;
1585
+ };
1586
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
1700
1587
  import * as WEBIFC from "web-ifc";
1701
1588
  import { FragmentsGroup } from "@thatopen/fragments";
1702
1589
  import { Component, Disposable, Event, Components } from "../../core";
@@ -1953,11 +1840,34 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
1953
1840
  private registerChange;
1954
1841
  private newSingleProperty;
1955
1842
  }
1956
- export declare class UUID {
1957
- private static _pattern;
1958
- private static _lut;
1959
- static create(): string;
1960
- static validate(uuid: string): void;
1843
+ import * as WEBIFC from "web-ifc";
1844
+ import * as FRAG from "@thatopen/fragments";
1845
+ import { Component, Components } from "../../core";
1846
+ /**
1847
+ * 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).
1848
+ */
1849
+ export declare class IfcJsonExporter extends Component {
1850
+ /**
1851
+ * A unique identifier for the component.
1852
+ * This UUID is used to register the component within the Components system.
1853
+ */
1854
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1855
+ /** {@link Component.enabled} */
1856
+ enabled: boolean;
1857
+ constructor(components: Components);
1858
+ /**
1859
+ * Exports all the properties of an IFC into an array of JS objects.
1860
+ * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1861
+ * @param modelID ID of the IFC model whose properties to extract.
1862
+ * @param indirect whether to get the indirect relationships as well.
1863
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
1864
+ * to make the location data available (e.g. absolute position of building).
1865
+ */
1866
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1867
+ }
1868
+ import * as THREE from "three";
1869
+ export declare class MaterialsUtils {
1870
+ static isTransparent(material: THREE.Material): boolean;
1961
1871
  }
1962
1872
  import * as THREE from "three";
1963
1873
  import { Component, Components, Disposable, Event, World } from "../core";
@@ -2075,6 +1985,125 @@ export declare class VertexPicker extends Component implements Disposable {
2075
1985
  private getVertices;
2076
1986
  private getVertex;
2077
1987
  }
1988
+ export declare class UUID {
1989
+ private static _pattern;
1990
+ private static _lut;
1991
+ static create(): string;
1992
+ static validate(uuid: string): void;
1993
+ }
1994
+ import * as THREE from "three";
1995
+ import * as FRAGS from "@thatopen/fragments";
1996
+ import { Component, Components } from "../../core";
1997
+ /**
1998
+ * Represents an edge measurement result.
1999
+ */
2000
+ export interface MeasureEdge {
2001
+ /**
2002
+ * The distance between the two points of the edge.
2003
+ */
2004
+ distance: number;
2005
+ /**
2006
+ * The two points that define the edge.
2007
+ */
2008
+ points: THREE.Vector3[];
2009
+ }
2010
+ /**
2011
+ * 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).
2012
+ */
2013
+ export declare class MeasurementUtils extends Component {
2014
+ /**
2015
+ * A unique identifier for the component.
2016
+ * This UUID is used to register the component within the Components system.
2017
+ */
2018
+ static uuid: string;
2019
+ /** {@link Component.enabled} */
2020
+ enabled: boolean;
2021
+ constructor(components: Components);
2022
+ /**
2023
+ * Utility method to calculate the distance from a point to a line segment.
2024
+ *
2025
+ * @param point - The point from which to calculate the distance.
2026
+ * @param lineStart - The start point of the line segment.
2027
+ * @param lineEnd - The end point of the line segment.
2028
+ * @param clamp - If true, the distance will be clamped to the line segment's length.
2029
+ * @returns The distance from the point to the line segment.
2030
+ */
2031
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
2032
+ /**
2033
+ * Method to get the face of a mesh that contains a given triangle index.
2034
+ * It also returns the edges of the found face and their indices.
2035
+ *
2036
+ * @param mesh - The mesh to get the face from. It must be indexed.
2037
+ * @param triangleIndex - The index of the triangle within the mesh.
2038
+ * @param instance - The instance of the mesh (optional).
2039
+ * @returns An object containing the edges of the found face and their indices, or null if no face was found.
2040
+ */
2041
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
2042
+ edges: MeasureEdge[];
2043
+ indices: Set<number>;
2044
+ } | null;
2045
+ /**
2046
+ * Method to get the vertices and normal of a mesh face at a given index.
2047
+ * It also applies instance transformation if provided.
2048
+ *
2049
+ * @param mesh - The mesh to get the face from. It must be indexed.
2050
+ * @param faceIndex - The index of the face within the mesh.
2051
+ * @param instance - The instance of the mesh (optional).
2052
+ * @returns An object containing the vertices and normal of the face.
2053
+ * @throws Will throw an error if the geometry is not indexed.
2054
+ */
2055
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
2056
+ p1: THREE.Vector3;
2057
+ p2: THREE.Vector3;
2058
+ p3: THREE.Vector3;
2059
+ faceNormal: THREE.Vector3;
2060
+ };
2061
+ /**
2062
+ * Method to round the vector's components to a specified number of decimal places.
2063
+ * This is used to ensure numerical precision in edge detection.
2064
+ *
2065
+ * @param vector - The vector to round.
2066
+ * @returns The vector with rounded components.
2067
+ */
2068
+ round(vector: THREE.Vector3): void;
2069
+ /**
2070
+ * Calculates the volume of a set of fragments.
2071
+ *
2072
+ * @param frags - A map of fragment IDs to their corresponding item IDs.
2073
+ * @returns The total volume of the fragments and the bounding sphere.
2074
+ *
2075
+ * @remarks
2076
+ * This method creates a set of instanced meshes from the given fragments and item IDs.
2077
+ * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
2078
+ *
2079
+ * @throws Will throw an error if the geometry of the meshes is not indexed.
2080
+ * @throws Will throw an error if the fragment manager is not available.
2081
+ */
2082
+ getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
2083
+ /**
2084
+ * Calculates the total volume of a set of meshes.
2085
+ *
2086
+ * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
2087
+ * @returns The total volume of the meshes and the bounding sphere.
2088
+ *
2089
+ * @remarks
2090
+ * This method calculates the volume of each mesh in the provided array and returns the total volume
2091
+ * and its bounding sphere.
2092
+ *
2093
+ */
2094
+ getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
2095
+ private getFaceData;
2096
+ private getVolumeOfMesh;
2097
+ private getSignedVolumeOfTriangle;
2098
+ }
2099
+ import * as WEBIFC from "web-ifc";
2100
+ import { IfcItemsCategories } from "../../../ifc";
2101
+ export declare class SpatialStructure {
2102
+ itemsByFloor: IfcItemsCategories;
2103
+ private _units;
2104
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2105
+ cleanUp(): void;
2106
+ }
2078
2107
  import * as WEBIFC from "web-ifc";
2079
2108
  /** Configuration of the IFC-fragment conversion. */
2080
2109
  export declare class IfcFragmentSettings {
@@ -2116,6 +2145,39 @@ export declare class IfcFragmentSettings {
2116
2145
  */
2117
2146
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2118
2147
  }
2148
+ /**
2149
+ * A Set of unique numbers representing different types of IFC geometries.
2150
+ */
2151
+ export declare const GeometryTypes: Set<number>;
2152
+ import * as WEBIFC from "web-ifc";
2153
+ export interface IfcItemsCategories {
2154
+ [itemID: number]: number;
2155
+ }
2156
+ export declare class IfcCategories {
2157
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2158
+ }
2159
+ /**
2160
+ * 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.
2161
+ *
2162
+ * @remarks
2163
+ * This map is used to provide a mapping between IFC entity type numbers and their names.
2164
+ * It is useful for identifying and processing different types of IFC elements in a project.
2165
+ *
2166
+ */
2167
+ export declare const IfcElements: {
2168
+ [key: number]: string;
2169
+ };
2170
+ import { InverseAttribute } from "./types";
2171
+ export declare const relToAttributesMap: Map<number, {
2172
+ forRelating: InverseAttribute;
2173
+ forRelated: InverseAttribute;
2174
+ }>;
2175
+ /**
2176
+ * 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.
2177
+ */
2178
+ export declare const IfcCategoryMap: {
2179
+ [key: number]: string;
2180
+ };
2119
2181
  import * as THREE from "three";
2120
2182
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
2121
2183
  /**
@@ -2205,42 +2267,6 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
2205
2267
  resize(size?: THREE.Vector2): void;
2206
2268
  private updatePlanes;
2207
2269
  }
2208
- /**
2209
- * A Set of unique numbers representing different types of IFC geometries.
2210
- */
2211
- export declare const GeometryTypes: Set<number>;
2212
- import * as WEBIFC from "web-ifc";
2213
- import { IfcItemsCategories } from "../../../ifc";
2214
- export declare class SpatialStructure {
2215
- itemsByFloor: IfcItemsCategories;
2216
- private _units;
2217
- setUp(webIfc: WEBIFC.IfcAPI): void;
2218
- cleanUp(): void;
2219
- }
2220
- import * as WEBIFC from "web-ifc";
2221
- export interface IfcItemsCategories {
2222
- [itemID: number]: number;
2223
- }
2224
- export declare class IfcCategories {
2225
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2226
- }
2227
- /**
2228
- * 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.
2229
- */
2230
- export declare const IfcCategoryMap: {
2231
- [key: number]: string;
2232
- };
2233
- /**
2234
- * 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.
2235
- *
2236
- * @remarks
2237
- * This map is used to provide a mapping between IFC entity type numbers and their names.
2238
- * It is useful for identifying and processing different types of IFC elements in a project.
2239
- *
2240
- */
2241
- export declare const IfcElements: {
2242
- [key: number]: string;
2243
- };
2244
2270
  import * as FRAGS from "@thatopen/fragments";
2245
2271
  export declare class IfcPropertiesUtils {
2246
2272
  static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
@@ -2266,49 +2292,64 @@ export declare class IfcPropertiesUtils {
2266
2292
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2267
2293
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2268
2294
  }
2269
- import { InverseAttribute } from "./types";
2270
- export declare const relToAttributesMap: Map<number, {
2271
- forRelating: InverseAttribute;
2272
- forRelated: InverseAttribute;
2273
- }>;
2274
2295
  import * as THREE from "three";
2275
- import { BaseScene, Configurable, Event } from "../../Types";
2296
+ import { Hideable, Event, World, Disposable } from "../../Types";
2276
2297
  import { Components } from "../../Components";
2277
2298
  /**
2278
- * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2299
+ * Configuration interface for the {@link SimpleGrid} class.
2279
2300
  */
2280
- export interface SimpleSceneConfig {
2281
- directionalLight: {
2282
- color: THREE.Color;
2283
- intensity: number;
2284
- position: THREE.Vector3;
2285
- };
2286
- ambientLight: {
2287
- color: THREE.Color;
2288
- intensity: number;
2289
- };
2301
+ export interface GridConfig {
2302
+ /**
2303
+ * The color of the grid lines.
2304
+ */
2305
+ color: THREE.Color;
2306
+ /**
2307
+ * The size of the primary grid lines.
2308
+ */
2309
+ size1: number;
2310
+ /**
2311
+ * The size of the secondary grid lines.
2312
+ */
2313
+ size2: number;
2314
+ /**
2315
+ * The distance at which the grid lines start to fade away.
2316
+ */
2317
+ distance: number;
2290
2318
  }
2291
2319
  /**
2292
- * 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.
2320
+ * An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
2293
2321
  */
2294
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2295
- /** {@link Configurable.isSetup} */
2296
- isSetup: boolean;
2322
+ export declare class SimpleGrid implements Hideable, Disposable {
2323
+ /** {@link Disposable.onDisposed} */
2324
+ readonly onDisposed: Event<unknown>;
2325
+ /** The world instance to which this Raycaster belongs. */
2326
+ world: World;
2327
+ /** The components instance to which this grid belongs. */
2328
+ components: Components;
2329
+ /** {@link Hideable.visible} */
2330
+ get visible(): boolean;
2331
+ /** {@link Hideable.visible} */
2332
+ set visible(visible: boolean);
2333
+ /** The material of the grid. */
2334
+ get material(): THREE.ShaderMaterial;
2297
2335
  /**
2298
- * The underlying Three.js scene object.
2299
- * It is used to define the 3D space containing objects, lights, and cameras.
2336
+ * Whether the grid should fade away with distance. Recommended to be true for
2337
+ * perspective cameras and false for orthographic cameras.
2300
2338
  */
2301
- three: THREE.Scene;
2302
- /** {@link Configurable.onSetup} */
2303
- readonly onSetup: Event<SimpleScene>;
2339
+ get fade(): boolean;
2304
2340
  /**
2305
- * Configuration interface for the {@link SimpleScene}.
2306
- * Defines properties for directional and ambient lights.
2341
+ * Whether the grid should fade away with distance. Recommended to be true for
2342
+ * perspective cameras and false for orthographic cameras.
2307
2343
  */
2308
- config: Required<SimpleSceneConfig>;
2309
- constructor(components: Components);
2310
- /** {@link Configurable.setup} */
2311
- setup(config?: Partial<SimpleSceneConfig>): void;
2344
+ set fade(active: boolean);
2345
+ /** The Three.js mesh that contains the infinite grid. */
2346
+ readonly three: THREE.Mesh;
2347
+ private _fade;
2348
+ constructor(components: Components, world: World, config: GridConfig);
2349
+ /** {@link Disposable.dispose} */
2350
+ dispose(): void;
2351
+ private setupEvents;
2352
+ private updateZoom;
2312
2353
  }
2313
2354
  import * as THREE from "three";
2314
2355
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
@@ -2390,6 +2431,45 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
2390
2431
  dispose(disposeResources?: boolean): void;
2391
2432
  }
2392
2433
  import * as THREE from "three";
2434
+ import { BaseScene, Configurable, Event } from "../../Types";
2435
+ import { Components } from "../../Components";
2436
+ /**
2437
+ * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2438
+ */
2439
+ export interface SimpleSceneConfig {
2440
+ directionalLight: {
2441
+ color: THREE.Color;
2442
+ intensity: number;
2443
+ position: THREE.Vector3;
2444
+ };
2445
+ ambientLight: {
2446
+ color: THREE.Color;
2447
+ intensity: number;
2448
+ };
2449
+ }
2450
+ /**
2451
+ * 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.
2452
+ */
2453
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2454
+ /** {@link Configurable.isSetup} */
2455
+ isSetup: boolean;
2456
+ /**
2457
+ * The underlying Three.js scene object.
2458
+ * It is used to define the 3D space containing objects, lights, and cameras.
2459
+ */
2460
+ three: THREE.Scene;
2461
+ /** {@link Configurable.onSetup} */
2462
+ readonly onSetup: Event<SimpleScene>;
2463
+ /**
2464
+ * Configuration interface for the {@link SimpleScene}.
2465
+ * Defines properties for directional and ambient lights.
2466
+ */
2467
+ config: Required<SimpleSceneConfig>;
2468
+ constructor(components: Components);
2469
+ /** {@link Configurable.setup} */
2470
+ setup(config?: Partial<SimpleSceneConfig>): void;
2471
+ }
2472
+ import * as THREE from "three";
2393
2473
  import { BaseRenderer, Event } from "../../Types";
2394
2474
  import { Components } from "../../Components";
2395
2475
  /**
@@ -2461,49 +2541,124 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
2461
2541
  */
2462
2542
  readonly onAspectUpdated: Event<unknown>;
2463
2543
  /** {@link Disposable.onDisposed} */
2464
- readonly onDisposed: Event<string>;
2544
+ readonly onDisposed: Event<string>;
2545
+ /**
2546
+ * A three.js PerspectiveCamera or OrthographicCamera instance.
2547
+ * This camera is used for rendering the scene.
2548
+ */
2549
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
2550
+ private _allControls;
2551
+ /**
2552
+ * The object that controls the camera. An instance of
2553
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
2554
+ * Transforming the camera directly will have no effect: you need to use this
2555
+ * object to move, rotate, look at objects, etc.
2556
+ */
2557
+ get controls(): CameraControls;
2558
+ /**
2559
+ * Getter for the enabled state of the camera controls.
2560
+ * If the current world is null, it returns false.
2561
+ * Otherwise, it returns the enabled state of the camera controls.
2562
+ *
2563
+ * @returns {boolean} The enabled state of the camera controls.
2564
+ */
2565
+ get enabled(): boolean;
2566
+ /**
2567
+ * Setter for the enabled state of the camera controls.
2568
+ * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
2569
+ *
2570
+ * @param {boolean} enabled - The new enabled state of the camera controls.
2571
+ */
2572
+ set enabled(enabled: boolean);
2573
+ constructor(components: Components);
2574
+ /** {@link Disposable.dispose} */
2575
+ dispose(): void;
2576
+ /** {@link Updateable.update} */
2577
+ update(_delta: number): void;
2578
+ /**
2579
+ * Updates the aspect of the camera to match the size of the
2580
+ * {@link Components.renderer}.
2581
+ */
2582
+ updateAspect: () => void;
2583
+ private setupCamera;
2584
+ private newCameraControls;
2585
+ private setupEvents;
2586
+ private static getSubsetOfThree;
2587
+ }
2588
+ import * as THREE from "three";
2589
+ import { Disposable, Event } from "../../Types";
2590
+ /**
2591
+ * A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
2592
+ */
2593
+ export declare class Mouse implements Disposable {
2594
+ dom: HTMLCanvasElement;
2595
+ private _event?;
2596
+ private _position;
2597
+ /** {@link Disposable.onDisposed} */
2598
+ readonly onDisposed: Event<unknown>;
2599
+ constructor(dom: HTMLCanvasElement);
2600
+ /**
2601
+ * The real position of the mouse of the Three.js canvas.
2602
+ */
2603
+ get position(): THREE.Vector2;
2604
+ /** {@link Disposable.dispose} */
2605
+ dispose(): void;
2606
+ private getPositionY;
2607
+ private getPositionX;
2608
+ private updateMouseInfo;
2609
+ private setupEvents;
2610
+ }
2611
+ import * as THREE from "three";
2612
+ import { Components } from "../../Components";
2613
+ import { Event, World, Disposable } from "../../Types";
2614
+ import { Mouse } from "./mouse";
2615
+ /**
2616
+ * 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.
2617
+ */
2618
+ export declare class SimpleRaycaster implements Disposable {
2619
+ /** {@link Component.enabled} */
2620
+ enabled: boolean;
2621
+ /** The components instance to which this Raycaster belongs. */
2622
+ components: Components;
2623
+ /** {@link Disposable.onDisposed} */
2624
+ readonly onDisposed: Event<unknown>;
2625
+ /** The position of the mouse in the screen. */
2626
+ readonly mouse: Mouse;
2465
2627
  /**
2466
- * A three.js PerspectiveCamera or OrthographicCamera instance.
2467
- * This camera is used for rendering the scene.
2628
+ * A reference to the Three.js Raycaster instance.
2629
+ * This is used for raycasting operations.
2468
2630
  */
2469
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
2470
- private _allControls;
2631
+ readonly three: THREE.Raycaster;
2471
2632
  /**
2472
- * The object that controls the camera. An instance of
2473
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
2474
- * Transforming the camera directly will have no effect: you need to use this
2475
- * object to move, rotate, look at objects, etc.
2633
+ * A reference to the world instance to which this Raycaster belongs.
2634
+ * This is used to access the camera and meshes.
2476
2635
  */
2477
- get controls(): CameraControls;
2636
+ world: World;
2637
+ constructor(components: Components, world: World);
2638
+ /** {@link Disposable.dispose} */
2639
+ dispose(): void;
2478
2640
  /**
2479
- * Getter for the enabled state of the camera controls.
2480
- * If the current world is null, it returns false.
2481
- * Otherwise, it returns the enabled state of the camera controls.
2641
+ * Throws a ray from the camera to the mouse or touch event point and returns
2642
+ * the first item found. This also takes into account the clipping planes
2643
+ * used by the renderer.
2482
2644
  *
2483
- * @returns {boolean} The enabled state of the camera controls.
2645
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2646
+ * to query. If not provided, it will query all the meshes stored in
2647
+ * {@link Components.meshes}.
2484
2648
  */
2485
- get enabled(): boolean;
2649
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2486
2650
  /**
2487
- * Setter for the enabled state of the camera controls.
2488
- * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
2651
+ * Casts a ray from a given origin in a given direction and returns the first item found.
2652
+ * This method also takes into account the clipping planes used by the renderer.
2489
2653
  *
2490
- * @param {boolean} enabled - The new enabled state of the camera controls.
2491
- */
2492
- set enabled(enabled: boolean);
2493
- constructor(components: Components);
2494
- /** {@link Disposable.dispose} */
2495
- dispose(): void;
2496
- /** {@link Updateable.update} */
2497
- update(_delta: number): void;
2498
- /**
2499
- * Updates the aspect of the camera to match the size of the
2500
- * {@link Components.renderer}.
2654
+ * @param origin - The origin of the ray.
2655
+ * @param direction - The direction of the ray.
2656
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2657
+ * @returns The first intersection found or 'null' if no intersection was found.
2501
2658
  */
2502
- updateAspect: () => void;
2503
- private setupCamera;
2504
- private newCameraControls;
2505
- private setupEvents;
2506
- private static getSubsetOfThree;
2659
+ 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;
2660
+ private intersect;
2661
+ private filterClippingPlanes;
2507
2662
  }
2508
2663
  import * as THREE from "three";
2509
2664
  import { Components } from "../../Components";
@@ -2597,29 +2752,6 @@ export declare class CullerRenderer {
2597
2752
  private applySettings;
2598
2753
  }
2599
2754
  import * as THREE from "three";
2600
- import { Disposable, Event } from "../../Types";
2601
- /**
2602
- * A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
2603
- */
2604
- export declare class Mouse implements Disposable {
2605
- dom: HTMLCanvasElement;
2606
- private _event?;
2607
- private _position;
2608
- /** {@link Disposable.onDisposed} */
2609
- readonly onDisposed: Event<unknown>;
2610
- constructor(dom: HTMLCanvasElement);
2611
- /**
2612
- * The real position of the mouse of the Three.js canvas.
2613
- */
2614
- get position(): THREE.Vector2;
2615
- /** {@link Disposable.dispose} */
2616
- dispose(): void;
2617
- private getPositionY;
2618
- private getPositionX;
2619
- private updateMouseInfo;
2620
- private setupEvents;
2621
- }
2622
- import * as THREE from "three";
2623
2755
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
2624
2756
  import { Components } from "../../Components";
2625
2757
  import { Event, World, Disposable } from "../../Types";
@@ -2676,117 +2808,6 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
2676
2808
  private getAvailableMaterial;
2677
2809
  }
2678
2810
  export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2679
- import * as THREE from "three";
2680
- import { Components } from "../../Components";
2681
- import { Event, World, Disposable } from "../../Types";
2682
- import { Mouse } from "./mouse";
2683
- /**
2684
- * 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.
2685
- */
2686
- export declare class SimpleRaycaster implements Disposable {
2687
- /** {@link Component.enabled} */
2688
- enabled: boolean;
2689
- /** The components instance to which this Raycaster belongs. */
2690
- components: Components;
2691
- /** {@link Disposable.onDisposed} */
2692
- readonly onDisposed: Event<unknown>;
2693
- /** The position of the mouse in the screen. */
2694
- readonly mouse: Mouse;
2695
- /**
2696
- * A reference to the Three.js Raycaster instance.
2697
- * This is used for raycasting operations.
2698
- */
2699
- readonly three: THREE.Raycaster;
2700
- /**
2701
- * A reference to the world instance to which this Raycaster belongs.
2702
- * This is used to access the camera and meshes.
2703
- */
2704
- world: World;
2705
- constructor(components: Components, world: World);
2706
- /** {@link Disposable.dispose} */
2707
- dispose(): void;
2708
- /**
2709
- * Throws a ray from the camera to the mouse or touch event point and returns
2710
- * the first item found. This also takes into account the clipping planes
2711
- * used by the renderer.
2712
- *
2713
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2714
- * to query. If not provided, it will query all the meshes stored in
2715
- * {@link Components.meshes}.
2716
- */
2717
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2718
- /**
2719
- * Casts a ray from a given origin in a given direction and returns the first item found.
2720
- * This method also takes into account the clipping planes used by the renderer.
2721
- *
2722
- * @param origin - The origin of the ray.
2723
- * @param direction - The direction of the ray.
2724
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2725
- * @returns The first intersection found or 'null' if no intersection was found.
2726
- */
2727
- 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;
2728
- private intersect;
2729
- private filterClippingPlanes;
2730
- }
2731
- import * as THREE from "three";
2732
- import { Hideable, Event, World, Disposable } from "../../Types";
2733
- import { Components } from "../../Components";
2734
- /**
2735
- * Configuration interface for the {@link SimpleGrid} class.
2736
- */
2737
- export interface GridConfig {
2738
- /**
2739
- * The color of the grid lines.
2740
- */
2741
- color: THREE.Color;
2742
- /**
2743
- * The size of the primary grid lines.
2744
- */
2745
- size1: number;
2746
- /**
2747
- * The size of the secondary grid lines.
2748
- */
2749
- size2: number;
2750
- /**
2751
- * The distance at which the grid lines start to fade away.
2752
- */
2753
- distance: number;
2754
- }
2755
- /**
2756
- * An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
2757
- */
2758
- export declare class SimpleGrid implements Hideable, Disposable {
2759
- /** {@link Disposable.onDisposed} */
2760
- readonly onDisposed: Event<unknown>;
2761
- /** The world instance to which this Raycaster belongs. */
2762
- world: World;
2763
- /** The components instance to which this grid belongs. */
2764
- components: Components;
2765
- /** {@link Hideable.visible} */
2766
- get visible(): boolean;
2767
- /** {@link Hideable.visible} */
2768
- set visible(visible: boolean);
2769
- /** The material of the grid. */
2770
- get material(): THREE.ShaderMaterial;
2771
- /**
2772
- * Whether the grid should fade away with distance. Recommended to be true for
2773
- * perspective cameras and false for orthographic cameras.
2774
- */
2775
- get fade(): boolean;
2776
- /**
2777
- * Whether the grid should fade away with distance. Recommended to be true for
2778
- * perspective cameras and false for orthographic cameras.
2779
- */
2780
- set fade(active: boolean);
2781
- /** The Three.js mesh that contains the infinite grid. */
2782
- readonly three: THREE.Mesh;
2783
- private _fade;
2784
- constructor(components: Components, world: World, config: GridConfig);
2785
- /** {@link Disposable.dispose} */
2786
- dispose(): void;
2787
- private setupEvents;
2788
- private updateZoom;
2789
- }
2790
2811
  /**
2791
2812
  * 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.
2792
2813
  */
@@ -2815,6 +2836,19 @@ export declare class Event<T> {
2815
2836
  reset(): void;
2816
2837
  private handlers;
2817
2838
  }
2839
+ import { Base } from "./base";
2840
+ /**
2841
+ * 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.
2842
+ */
2843
+ export declare abstract class Component extends Base {
2844
+ /**
2845
+ * Whether this component is active or not. The behaviour can vary depending
2846
+ * on the type of component. E.g. a disabled dimension tool will stop creating
2847
+ * dimensions, while a disabled camera will stop moving. A disabled component
2848
+ * will not be updated automatically each frame.
2849
+ */
2850
+ abstract enabled: boolean;
2851
+ }
2818
2852
  /**
2819
2853
  * 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.
2820
2854
  */
@@ -2951,60 +2985,33 @@ export interface CameraControllable {
2951
2985
  */
2952
2986
  controls: CameraControls;
2953
2987
  }
2954
- import { Base } from "./base";
2955
- import { World } from "./world";
2956
- import { Event } from "./event";
2957
- import { Components } from "../../Components";
2958
- /**
2959
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
2960
- */
2961
- export declare abstract class BaseWorldItem extends Base {
2962
- readonly worlds: Map<string, World>;
2963
- /**
2964
- * Event that is triggered when a world is added or removed from the 'worlds' map.
2965
- * The event payload contains the world instance and the action ("added" or "removed").
2966
- */
2967
- readonly onWorldChanged: Event<{
2968
- world: World;
2969
- action: "added" | "removed";
2970
- }>;
2971
- /**
2972
- * The current world this item is associated with. It can be null if no world is currently active.
2973
- */
2974
- currentWorld: World | null;
2975
- protected constructor(components: Components);
2976
- }
2977
- import { Base } from "./base";
2988
+ import * as THREE from "three";
2989
+ import CameraControls from "camera-controls";
2990
+ import { BaseWorldItem } from "./base-world-item";
2991
+ import { CameraControllable } from "./interfaces";
2978
2992
  /**
2979
- * 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.
2993
+ * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
2980
2994
  */
2981
- export declare abstract class Component extends Base {
2995
+ export declare abstract class BaseCamera extends BaseWorldItem {
2982
2996
  /**
2983
- * Whether this component is active or not. The behaviour can vary depending
2984
- * on the type of component. E.g. a disabled dimension tool will stop creating
2985
- * dimensions, while a disabled camera will stop moving. A disabled component
2986
- * will not be updated automatically each frame.
2997
+ * Whether the camera is enabled or not.
2987
2998
  */
2988
2999
  abstract enabled: boolean;
2989
- }
2990
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2991
- import { Components } from "../../Components";
2992
- /**
2993
- * Base class of the library. Useful for finding out the interfaces something implements.
2994
- */
2995
- export declare abstract class Base {
2996
- components: Components;
2997
- constructor(components: Components);
2998
- /** Whether is component is {@link Disposable}. */
2999
- isDisposeable: () => this is Disposable;
3000
- /** Whether is component is {@link Resizeable}. */
3001
- isResizeable: () => this is Resizeable;
3002
- /** Whether is component is {@link Updateable}. */
3003
- isUpdateable: () => this is Updateable;
3004
- /** Whether is component is {@link Hideable}. */
3005
- isHideable: () => this is Hideable;
3006
- /** Whether is component is {@link Configurable}. */
3007
- isConfigurable: () => this is Configurable<any>;
3000
+ /**
3001
+ * The Three.js camera instance.
3002
+ */
3003
+ abstract three: THREE.Camera;
3004
+ /**
3005
+ * Optional CameraControls instance for controlling the camera.
3006
+ * This property is only available if the camera is controllable.
3007
+ */
3008
+ abstract controls?: CameraControls;
3009
+ /**
3010
+ * Checks whether the instance is {@link CameraControllable}.
3011
+ *
3012
+ * @returns True if the instance is controllable, false otherwise.
3013
+ */
3014
+ hasCameraControls: () => this is CameraControllable;
3008
3015
  }
3009
3016
  import * as THREE from "three";
3010
3017
  import { Vector2 } from "three";
@@ -3072,34 +3079,6 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
3072
3079
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
3073
3080
  }
3074
3081
  import * as THREE from "three";
3075
- import CameraControls from "camera-controls";
3076
- import { BaseWorldItem } from "./base-world-item";
3077
- import { CameraControllable } from "./interfaces";
3078
- /**
3079
- * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
3080
- */
3081
- export declare abstract class BaseCamera extends BaseWorldItem {
3082
- /**
3083
- * Whether the camera is enabled or not.
3084
- */
3085
- abstract enabled: boolean;
3086
- /**
3087
- * The Three.js camera instance.
3088
- */
3089
- abstract three: THREE.Camera;
3090
- /**
3091
- * Optional CameraControls instance for controlling the camera.
3092
- * This property is only available if the camera is controllable.
3093
- */
3094
- abstract controls?: CameraControls;
3095
- /**
3096
- * Checks whether the instance is {@link CameraControllable}.
3097
- *
3098
- * @returns True if the instance is controllable, false otherwise.
3099
- */
3100
- hasCameraControls: () => this is CameraControllable;
3101
- }
3102
- import * as THREE from "three";
3103
3082
  import { Disposable } from "./interfaces";
3104
3083
  import { Event } from "./event";
3105
3084
  import { Components } from "../../Components";
@@ -3119,6 +3098,48 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
3119
3098
  /** {@link Disposable.dispose} */
3120
3099
  dispose(): void;
3121
3100
  }
3101
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
3102
+ import { Components } from "../../Components";
3103
+ /**
3104
+ * Base class of the library. Useful for finding out the interfaces something implements.
3105
+ */
3106
+ export declare abstract class Base {
3107
+ components: Components;
3108
+ constructor(components: Components);
3109
+ /** Whether is component is {@link Disposable}. */
3110
+ isDisposeable: () => this is Disposable;
3111
+ /** Whether is component is {@link Resizeable}. */
3112
+ isResizeable: () => this is Resizeable;
3113
+ /** Whether is component is {@link Updateable}. */
3114
+ isUpdateable: () => this is Updateable;
3115
+ /** Whether is component is {@link Hideable}. */
3116
+ isHideable: () => this is Hideable;
3117
+ /** Whether is component is {@link Configurable}. */
3118
+ isConfigurable: () => this is Configurable<any>;
3119
+ }
3120
+ import { Base } from "./base";
3121
+ import { World } from "./world";
3122
+ import { Event } from "./event";
3123
+ import { Components } from "../../Components";
3124
+ /**
3125
+ * One of the elements that make a world. It can be either a scene, a camera or a renderer.
3126
+ */
3127
+ export declare abstract class BaseWorldItem extends Base {
3128
+ readonly worlds: Map<string, World>;
3129
+ /**
3130
+ * Event that is triggered when a world is added or removed from the 'worlds' map.
3131
+ * The event payload contains the world instance and the action ("added" or "removed").
3132
+ */
3133
+ readonly onWorldChanged: Event<{
3134
+ world: World;
3135
+ action: "added" | "removed";
3136
+ }>;
3137
+ /**
3138
+ * The current world this item is associated with. It can be null if no world is currently active.
3139
+ */
3140
+ currentWorld: World | null;
3141
+ protected constructor(components: Components);
3142
+ }
3122
3143
  import * as THREE from "three";
3123
3144
  import { BaseScene } from "./base-scene";
3124
3145
  import { BaseCamera } from "./base-camera";
@@ -3182,6 +3203,8 @@ export declare class SimplePlane implements Disposable, Hideable {
3182
3203
  components: Components;
3183
3204
  /** The world instance to which this plane belongs. */
3184
3205
  world: World;
3206
+ /** A custom string to identify what this plane is used for. */
3207
+ type: string;
3185
3208
  protected readonly _helper: THREE.Object3D;
3186
3209
  protected _visible: boolean;
3187
3210
  protected _enabled: boolean;
@@ -3250,6 +3273,26 @@ export declare class SimplePlane implements Disposable, Hideable {
3250
3273
  private newHelper;
3251
3274
  private static newPlaneMesh;
3252
3275
  }
3276
+ import * as WEBIFC from "web-ifc";
3277
+ export declare class IfcMetadataReader {
3278
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3279
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3280
+ }
3281
+ import * as THREE from "three";
3282
+ import * as WEBIFC from "web-ifc";
3283
+ import * as FRAGS from "@thatopen/fragments";
3284
+ export declare class CivilReader {
3285
+ defLineMat: THREE.LineBasicMaterial;
3286
+ read(webIfc: WEBIFC.IfcAPI): {
3287
+ alignments: Map<number, FRAGS.Alignment>;
3288
+ coordinationMatrix: THREE.Matrix4;
3289
+ } | undefined;
3290
+ get(civilItems: any): {
3291
+ alignments: Map<number, FRAGS.Alignment>;
3292
+ coordinationMatrix: THREE.Matrix4;
3293
+ } | undefined;
3294
+ private getCurves;
3295
+ }
3253
3296
  import { NavigationMode } from "./types";
3254
3297
  import { OrthoPerspectiveCamera } from "../index";
3255
3298
  /**
@@ -3282,37 +3325,6 @@ export declare class OrbitMode implements NavigationMode {
3282
3325
  set(active: boolean): void;
3283
3326
  private activateOrbitControls;
3284
3327
  }
3285
- import { NavigationMode } from "./types";
3286
- import { OrthoPerspectiveCamera } from "../index";
3287
- /**
3288
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3289
- */
3290
- export declare class PlanMode implements NavigationMode {
3291
- private camera;
3292
- /** {@link NavigationMode.enabled} */
3293
- enabled: boolean;
3294
- /** {@link NavigationMode.id} */
3295
- readonly id = "Plan";
3296
- private mouseAction1?;
3297
- private mouseAction2?;
3298
- private mouseInitialized;
3299
- private readonly defaultAzimuthSpeed;
3300
- private readonly defaultPolarSpeed;
3301
- constructor(camera: OrthoPerspectiveCamera);
3302
- /** {@link NavigationMode.set} */
3303
- set(active: boolean): void;
3304
- }
3305
- import { IfcFragmentSettings } from "../../IfcLoader/src";
3306
- /**
3307
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3308
- */
3309
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3310
- /**
3311
- * Amount of properties to be streamed.
3312
- * Defaults to 100 properties.
3313
- */
3314
- propertiesSize: number;
3315
- }
3316
3328
  import * as THREE from "three";
3317
3329
  import { CameraProjection } from "./types";
3318
3330
  import { Event } from "../../Types";
@@ -3358,6 +3370,26 @@ export declare class ProjectionManager {
3358
3370
  private getDistance;
3359
3371
  private setPerspectiveCamera;
3360
3372
  }
3373
+ import { NavigationMode } from "./types";
3374
+ import { OrthoPerspectiveCamera } from "../index";
3375
+ /**
3376
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3377
+ */
3378
+ export declare class PlanMode implements NavigationMode {
3379
+ private camera;
3380
+ /** {@link NavigationMode.enabled} */
3381
+ enabled: boolean;
3382
+ /** {@link NavigationMode.id} */
3383
+ readonly id = "Plan";
3384
+ private mouseAction1?;
3385
+ private mouseAction2?;
3386
+ private mouseInitialized;
3387
+ private readonly defaultAzimuthSpeed;
3388
+ private readonly defaultPolarSpeed;
3389
+ constructor(camera: OrthoPerspectiveCamera);
3390
+ /** {@link NavigationMode.set} */
3391
+ set(active: boolean): void;
3392
+ }
3361
3393
  /**
3362
3394
  * The projection system of the camera.
3363
3395
  */
@@ -3384,26 +3416,30 @@ export interface NavigationMode {
3384
3416
  /** Whether this navigation mode is active or not. */
3385
3417
  enabled: boolean;
3386
3418
  }
3387
- import * as WEBIFC from "web-ifc";
3388
- export declare class IfcMetadataReader {
3389
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3390
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3391
- }
3392
- import * as THREE from "three";
3393
- import * as WEBIFC from "web-ifc";
3394
- import * as FRAGS from "@thatopen/fragments";
3395
- export declare class CivilReader {
3396
- defLineMat: THREE.LineBasicMaterial;
3397
- read(webIfc: WEBIFC.IfcAPI): {
3398
- alignments: Map<number, FRAGS.Alignment>;
3399
- coordinationMatrix: THREE.Matrix4;
3400
- } | undefined;
3401
- get(civilItems: any): {
3402
- alignments: Map<number, FRAGS.Alignment>;
3403
- coordinationMatrix: THREE.Matrix4;
3404
- } | undefined;
3405
- private getCurves;
3419
+ export type RelationsMap = Map<number, Map<number, number[]>>;
3420
+ export interface ModelsRelationMap {
3421
+ [modelID: string]: RelationsMap;
3406
3422
  }
3423
+ /**
3424
+ * Type alias for an array of inverse attribute names.
3425
+ */
3426
+ export type InverseAttributes = [
3427
+ "IsDecomposedBy",
3428
+ "Decomposes",
3429
+ "AssociatedTo",
3430
+ "HasAssociations",
3431
+ "ClassificationForObjects",
3432
+ "IsGroupedBy",
3433
+ "HasAssignments",
3434
+ "IsDefinedBy",
3435
+ "DefinesOcurrence",
3436
+ "IsTypedBy",
3437
+ "Types",
3438
+ "Defines",
3439
+ "ContainedInStructure",
3440
+ "ContainsElements"
3441
+ ];
3442
+ export type InverseAttribute = InverseAttributes[number];
3407
3443
  import { IfcFragmentSettings } from "../../IfcLoader/src";
3408
3444
  /**
3409
3445
  * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
@@ -3420,6 +3456,11 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
3420
3456
  */
3421
3457
  minAssetsSize: number;
3422
3458
  }
3459
+ import { BufferGeometry } from "three";
3460
+ import * as THREE from "three";
3461
+ export declare class TransformHelper {
3462
+ getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
3463
+ }
3423
3464
  import * as WEBIFC from "web-ifc";
3424
3465
  import * as THREE from "three";
3425
3466
  export declare class Units {
@@ -3459,34 +3500,16 @@ export interface StreamedAsset {
3459
3500
  color: number[];
3460
3501
  }[];
3461
3502
  }
3462
- export type RelationsMap = Map<number, Map<number, number[]>>;
3463
- export interface ModelsRelationMap {
3464
- [modelID: string]: RelationsMap;
3465
- }
3503
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3466
3504
  /**
3467
- * Type alias for an array of inverse attribute names.
3505
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3468
3506
  */
3469
- export type InverseAttributes = [
3470
- "IsDecomposedBy",
3471
- "Decomposes",
3472
- "AssociatedTo",
3473
- "HasAssociations",
3474
- "ClassificationForObjects",
3475
- "IsGroupedBy",
3476
- "HasAssignments",
3477
- "IsDefinedBy",
3478
- "DefinesOcurrence",
3479
- "IsTypedBy",
3480
- "Types",
3481
- "Defines",
3482
- "ContainedInStructure",
3483
- "ContainsElements"
3484
- ];
3485
- export type InverseAttribute = InverseAttributes[number];
3486
- import { BufferGeometry } from "three";
3487
- import * as THREE from "three";
3488
- export declare class TransformHelper {
3489
- getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
3507
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3508
+ /**
3509
+ * Amount of properties to be streamed.
3510
+ * Defaults to 100 properties.
3511
+ */
3512
+ propertiesSize: number;
3490
3513
  }
3491
3514
 
3492
3515
  }