@thatopen/components 2.0.20 → 2.0.21

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.0.20";
10
+ static readonly release = "2.0.21";
56
11
  /** {@link Disposable.onDisposed} */
57
12
  readonly onDisposed: Event<void>;
58
13
  /**
@@ -120,47 +75,50 @@ export declare class Components implements Disposable {
120
75
  private update;
121
76
  private static setupBVH;
122
77
  }
123
- import { Component, Disposable, World, Event } from "../Types";
124
- import { SimpleRaycaster } from "./src";
78
+ import * as THREE from "three";
125
79
  import { Components } from "../Components";
80
+ import { Component } from "../Types";
126
81
  /**
127
- * A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
82
+ * A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
128
83
  */
129
- export declare class Raycasters extends Component implements Disposable {
84
+ export declare class Disposer extends Component {
85
+ private _disposedComponents;
86
+ /** {@link Component.enabled} */
87
+ enabled: boolean;
130
88
  /**
131
89
  * A unique identifier for the component.
132
90
  * This UUID is used to register the component within the Components system.
133
91
  */
134
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
135
- /** {@link Component.enabled} */
136
- enabled: boolean;
92
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
93
+ constructor(components: Components);
137
94
  /**
138
- * A Map that stores raycasters for each world.
139
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
95
+ * Return the UUIDs of all disposed components.
140
96
  */
141
- list: Map<string, SimpleRaycaster>;
142
- /** {@link Disposable.onDisposed} */
143
- onDisposed: Event<unknown>;
144
- constructor(components: Components);
97
+ get(): Set<string>;
145
98
  /**
146
- * Retrieves a SimpleRaycaster instance for the given world.
147
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
148
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
99
+ * Removes a mesh, its geometry and its materials from memory. If you are
100
+ * using any of these in other parts of the application, make sure that you
101
+ * remove them from the mesh before disposing it.
149
102
  *
150
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
151
- * @returns The SimpleRaycaster instance for the given world.
103
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
104
+ * to remove.
105
+ *
106
+ * @param materials - whether to dispose the materials of the mesh.
107
+ *
108
+ * @param recursive - whether to recursively dispose the children of the mesh.
152
109
  */
153
- get(world: World): SimpleRaycaster;
110
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
154
111
  /**
155
- * Deletes the SimpleRaycaster instance associated with the given world.
156
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
112
+ * Disposes a geometry from memory.
157
113
  *
158
- * @param world - The world for which to delete the SimpleRaycaster instance.
159
- * @returns {void}
114
+ * @param geometry - the
115
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
116
+ * to remove.
160
117
  */
161
- delete(world: World): void;
162
- /** {@link Disposable.dispose} */
163
- dispose(): void;
118
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
119
+ private disposeGeometryAndMaterials;
120
+ private disposeChildren;
121
+ private static disposeMaterial;
164
122
  }
165
123
  import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
166
124
  import { Components } from "../Components";
@@ -229,50 +187,49 @@ export declare class Worlds extends Component implements Updateable, Disposable
229
187
  /** {@link Updateable.update} */
230
188
  update(delta?: number): void | Promise<void>;
231
189
  }
232
- import { Component, Disposable, World, Event } from "../Types";
233
- import { GridConfig, SimpleGrid } from "./src";
234
190
  import { Components } from "../Components";
191
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
192
+ import { Component, Event, Disposable, World } from "../Types";
235
193
  /**
236
- * A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
194
+ * A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
237
195
  */
238
- export declare class Grids extends Component implements Disposable {
196
+ export declare class Cullers extends Component implements Disposable {
239
197
  /**
240
198
  * A unique identifier for the component.
241
199
  * This UUID is used to register the component within the Components system.
242
200
  */
243
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
201
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
244
202
  /**
245
- * A map of world UUIDs to their corresponding grid instances.
203
+ * An event that is triggered when the Cullers component is disposed.
246
204
  */
247
- list: Map<string, SimpleGrid>;
205
+ readonly onDisposed: Event<unknown>;
206
+ private _enabled;
248
207
  /**
249
- * The default configuration for grid creation.
208
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
250
209
  */
251
- config: Required<GridConfig>;
252
- /** {@link Disposable.onDisposed} */
253
- readonly onDisposed: Event<unknown>;
210
+ list: Map<string, MeshCullerRenderer>;
254
211
  /** {@link Component.enabled} */
255
- enabled: boolean;
212
+ get enabled(): boolean;
213
+ /** {@link Component.enabled} */
214
+ set enabled(value: boolean);
256
215
  constructor(components: Components);
257
216
  /**
258
- * Creates a new grid for the given world.
259
- * Throws an error if a grid already exists for the world.
217
+ * Creates a new MeshCullerRenderer for the given world.
218
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
260
219
  *
261
- * @param world - The world to create the grid for.
262
- * @returns The newly created grid.
220
+ * @param world - The world for which to create the MeshCullerRenderer.
221
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
263
222
  *
264
- * @throws Will throw an error if a grid already exists for the given world.
223
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
265
224
  */
266
- create(world: World): SimpleGrid;
225
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
267
226
  /**
268
- * Deletes the grid associated with the given world.
269
- * If a grid does not exist for the given world, this method does nothing.
227
+ * Deletes the MeshCullerRenderer associated with the given world.
228
+ * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
270
229
  *
271
- * @param world - The world for which to delete the grid.
230
+ * @param world - The world for which to delete the MeshCullerRenderer.
272
231
  *
273
- * @remarks
274
- * This method will dispose of the grid and remove it from the internal list.
275
- * If the world is disposed before calling this method, the grid will be automatically deleted.
232
+ * @returns {void}
276
233
  */
277
234
  delete(world: World): void;
278
235
  /** {@link Disposable.dispose} */
@@ -405,54 +362,6 @@ export declare class Clipper extends Component implements Createable, Disposable
405
362
  private _onStartDragging;
406
363
  private _onEndDragging;
407
364
  }
408
- import { Components } from "../Components";
409
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
410
- import { Component, Event, Disposable, World } from "../Types";
411
- /**
412
- * A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
413
- */
414
- export declare class Cullers extends Component implements Disposable {
415
- /**
416
- * A unique identifier for the component.
417
- * This UUID is used to register the component within the Components system.
418
- */
419
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
420
- /**
421
- * An event that is triggered when the Cullers component is disposed.
422
- */
423
- readonly onDisposed: Event<unknown>;
424
- private _enabled;
425
- /**
426
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
427
- */
428
- list: Map<string, MeshCullerRenderer>;
429
- /** {@link Component.enabled} */
430
- get enabled(): boolean;
431
- /** {@link Component.enabled} */
432
- set enabled(value: boolean);
433
- constructor(components: Components);
434
- /**
435
- * Creates a new MeshCullerRenderer for the given world.
436
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
437
- *
438
- * @param world - The world for which to create the MeshCullerRenderer.
439
- * @param config - Optional configuration settings for the MeshCullerRenderer.
440
- *
441
- * @returns The newly created or existing MeshCullerRenderer for the given world.
442
- */
443
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
444
- /**
445
- * Deletes the MeshCullerRenderer associated with the given world.
446
- * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
447
- *
448
- * @param world - The world for which to delete the MeshCullerRenderer.
449
- *
450
- * @returns {void}
451
- */
452
- delete(world: World): void;
453
- /** {@link Disposable.dispose} */
454
- dispose(): void;
455
- }
456
365
  import { MiniMap } from "./src";
457
366
  import { Component, Updateable, World, Event, Disposable } from "../Types";
458
367
  import { Components } from "../Components";
@@ -500,6 +409,55 @@ export declare class MiniMaps extends Component implements Updateable, Disposabl
500
409
  /** {@link Updateable.update} */
501
410
  update(): void;
502
411
  }
412
+ import { Component, Disposable, World, Event } from "../Types";
413
+ import { GridConfig, SimpleGrid } from "./src";
414
+ import { Components } from "../Components";
415
+ /**
416
+ * A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
417
+ */
418
+ export declare class Grids extends Component implements Disposable {
419
+ /**
420
+ * A unique identifier for the component.
421
+ * This UUID is used to register the component within the Components system.
422
+ */
423
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
424
+ /**
425
+ * A map of world UUIDs to their corresponding grid instances.
426
+ */
427
+ list: Map<string, SimpleGrid>;
428
+ /**
429
+ * The default configuration for grid creation.
430
+ */
431
+ config: Required<GridConfig>;
432
+ /** {@link Disposable.onDisposed} */
433
+ readonly onDisposed: Event<unknown>;
434
+ /** {@link Component.enabled} */
435
+ enabled: boolean;
436
+ constructor(components: Components);
437
+ /**
438
+ * Creates a new grid for the given world.
439
+ * Throws an error if a grid already exists for the world.
440
+ *
441
+ * @param world - The world to create the grid for.
442
+ * @returns The newly created grid.
443
+ *
444
+ * @throws Will throw an error if a grid already exists for the given world.
445
+ */
446
+ create(world: World): SimpleGrid;
447
+ /**
448
+ * Deletes the grid associated with the given world.
449
+ * If a grid does not exist for the given world, this method does nothing.
450
+ *
451
+ * @param world - The world for which to delete the grid.
452
+ *
453
+ * @remarks
454
+ * This method will dispose of the grid and remove it from the internal list.
455
+ * If the world is disposed before calling this method, the grid will be automatically deleted.
456
+ */
457
+ delete(world: World): void;
458
+ /** {@link Disposable.dispose} */
459
+ dispose(): void;
460
+ }
503
461
  import * as THREE from "three";
504
462
  import { Components } from "../Components";
505
463
  import { SimpleCamera } from "..";
@@ -564,16 +522,58 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
564
522
  private newOrthoCamera;
565
523
  private setOrthoPerspCameraAspect;
566
524
  }
567
- 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";
525
+ import { Component, Disposable, World, Event } from "../Types";
526
+ import { SimpleRaycaster } from "./src";
527
+ import { Components } from "../Components";
571
528
  /**
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).
529
+ * 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).
573
530
  */
574
- export declare class BoundingBoxer extends Component implements Disposable {
575
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
576
- /** {@link Component.enabled} */
531
+ export declare class Raycasters extends Component implements Disposable {
532
+ /**
533
+ * A unique identifier for the component.
534
+ * This UUID is used to register the component within the Components system.
535
+ */
536
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
537
+ /** {@link Component.enabled} */
538
+ enabled: boolean;
539
+ /**
540
+ * A Map that stores raycasters for each world.
541
+ * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
542
+ */
543
+ list: Map<string, SimpleRaycaster>;
544
+ /** {@link Disposable.onDisposed} */
545
+ onDisposed: Event<unknown>;
546
+ constructor(components: Components);
547
+ /**
548
+ * Retrieves a SimpleRaycaster instance for the given world.
549
+ * If a SimpleRaycaster instance already exists for the world, it will be returned.
550
+ * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
551
+ *
552
+ * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
553
+ * @returns The SimpleRaycaster instance for the given world.
554
+ */
555
+ get(world: World): SimpleRaycaster;
556
+ /**
557
+ * Deletes the SimpleRaycaster instance associated with the given world.
558
+ * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
559
+ *
560
+ * @param world - The world for which to delete the SimpleRaycaster instance.
561
+ * @returns {void}
562
+ */
563
+ delete(world: World): void;
564
+ /** {@link Disposable.dispose} */
565
+ dispose(): void;
566
+ }
567
+ 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";
571
+ /**
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).
573
+ */
574
+ export declare class BoundingBoxer extends Component implements Disposable {
575
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
576
+ /** {@link Component.enabled} */
577
577
  enabled: boolean;
578
578
  /** {@link Disposable.onDisposed} */
579
579
  readonly onDisposed: Event<unknown>;
@@ -750,6 +750,64 @@ export declare class BoundingBoxer extends Component implements Disposable {
750
750
  private static getFragmentBounds;
751
751
  }
752
752
  import * as THREE from "three";
753
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
754
+ center: THREE.Vector3;
755
+ halfSizes: THREE.Vector3;
756
+ rotation: THREE.Matrix3;
757
+ transformation: THREE.Matrix4;
758
+ };
759
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
760
+ import { Component, Disposable, Event, Components } from "../../core";
761
+ /**
762
+ * 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).
763
+ */
764
+ export declare class Exploder extends Component implements Disposable {
765
+ /**
766
+ * A unique identifier for the component.
767
+ * This UUID is used to register the component within the Components system.
768
+ */
769
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
770
+ /** {@link Disposable.onDisposed} */
771
+ readonly onDisposed: Event<unknown>;
772
+ /** {@link Component.enabled} */
773
+ enabled: boolean;
774
+ /**
775
+ * The height of the explosion animation.
776
+ * This property determines the vertical distance by which fragments are moved during the explosion.
777
+ * Default value is 10.
778
+ */
779
+ height: number;
780
+ /**
781
+ * The group name used for the explosion animation.
782
+ * This property specifies the group of fragments that will be affected by the explosion.
783
+ * Default value is "storeys".
784
+ */
785
+ groupName: string;
786
+ /**
787
+ * A set of strings representing the exploded items.
788
+ * This set is used to keep track of which items have been exploded.
789
+ */
790
+ list: Set<string>;
791
+ constructor(components: Components);
792
+ /** {@link Disposable.dispose} */
793
+ dispose(): void;
794
+ /**
795
+ * Sets the explosion state of the fragments.
796
+ *
797
+ * @param active - A boolean indicating whether to activate or deactivate the explosion.
798
+ *
799
+ * @remarks
800
+ * This method applies a vertical transformation to the fragments based on the 'active' parameter.
801
+ * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
802
+ * If 'active' is false, the fragments are moved back to their original position.
803
+ *
804
+ * The method also keeps track of the exploded items using the 'list' set.
805
+ *
806
+ * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
807
+ */
808
+ set(active: boolean): void;
809
+ }
810
+ import * as THREE from "three";
753
811
  import * as FRAGS from "@thatopen/fragments";
754
812
  import { Disposable, Component, Event, Components } from "../../core";
755
813
  /**
@@ -913,55 +971,9 @@ export declare class Classifier extends Component implements Disposable {
913
971
  resetColor(items: FRAGS.FragmentIdMap): void;
914
972
  protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
915
973
  }
916
- import { Component, Disposable, Event, Components } from "../../core";
917
- /**
918
- * 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).
919
- */
920
- export declare class Exploder extends Component implements Disposable {
921
- /**
922
- * A unique identifier for the component.
923
- * This UUID is used to register the component within the Components system.
924
- */
925
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
926
- /** {@link Disposable.onDisposed} */
927
- readonly onDisposed: Event<unknown>;
928
- /** {@link Component.enabled} */
929
- enabled: boolean;
930
- /**
931
- * The height of the explosion animation.
932
- * This property determines the vertical distance by which fragments are moved during the explosion.
933
- * Default value is 10.
934
- */
935
- height: number;
936
- /**
937
- * The group name used for the explosion animation.
938
- * This property specifies the group of fragments that will be affected by the explosion.
939
- * Default value is "storeys".
940
- */
941
- groupName: string;
942
- /**
943
- * A set of strings representing the exploded items.
944
- * This set is used to keep track of which items have been exploded.
945
- */
946
- list: Set<string>;
947
- constructor(components: Components);
948
- /** {@link Disposable.dispose} */
949
- dispose(): void;
950
- /**
951
- * Sets the explosion state of the fragments.
952
- *
953
- * @param active - A boolean indicating whether to activate or deactivate the explosion.
954
- *
955
- * @remarks
956
- * This method applies a vertical transformation to the fragments based on the 'active' parameter.
957
- * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
958
- * If 'active' is false, the fragments are moved back to their original position.
959
- *
960
- * The method also keeps track of the exploded items using the 'list' set.
961
- *
962
- * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
963
- */
964
- set(active: boolean): void;
974
+ import * as THREE from "three";
975
+ export declare class MaterialsUtils {
976
+ static isTransparent(material: THREE.Material): boolean;
965
977
  }
966
978
  import * as FRAGS from "@thatopen/fragments";
967
979
  import { Components, Component } from "../../core";
@@ -1392,229 +1404,74 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
1392
1404
  private cleanUp;
1393
1405
  }
1394
1406
  import * as WEBIFC from "web-ifc";
1395
- import * as FRAG from "@thatopen/fragments";
1396
- import { Component, Components } from "../../core";
1407
+ import { FragmentsGroup } from "@thatopen/fragments";
1408
+ import { Disposable, Event, Component, Components } from "../../core";
1409
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
1410
+ export type { InverseAttribute, RelationsMap } from "./src/types";
1397
1411
  /**
1398
- * 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).
1412
+ * Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
1399
1413
  */
1400
- export declare class IfcJsonExporter extends Component {
1414
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
1401
1415
  /**
1402
1416
  * A unique identifier for the component.
1403
1417
  * This UUID is used to register the component within the Components system.
1404
1418
  */
1405
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1406
- /** {@link Component.enabled} */
1407
- enabled: boolean;
1408
- constructor(components: Components);
1419
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1420
+ /** {@link Disposable.onDisposed} */
1421
+ readonly onDisposed: Event<string>;
1409
1422
  /**
1410
- * Exports all the properties of an IFC into an array of JS objects.
1411
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1412
- * @param modelID ID of the IFC model whose properties to extract.
1413
- * @param indirect whether to get the indirect relationships as well.
1414
- * @param recursiveSpatial whether to get the properties of spatial items recursively
1415
- * to make the location data available (e.g. absolute position of building).
1423
+ * Event triggered when relations for a model have been indexed.
1424
+ * This event provides the model's UUID and the relations map generated for that model.
1425
+ *
1426
+ * @property {string} modelID - The UUID of the model for which relations have been indexed.
1427
+ * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1428
+ * 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.
1416
1429
  */
1417
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1418
- }
1419
- import * as THREE from "three";
1420
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
1421
- center: THREE.Vector3;
1422
- halfSizes: THREE.Vector3;
1423
- rotation: THREE.Matrix3;
1424
- transformation: THREE.Matrix4;
1425
- };
1426
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
1427
- import * as THREE from "three";
1428
- export declare class MaterialsUtils {
1429
- static isTransparent(material: THREE.Material): boolean;
1430
- }
1431
- export declare class UUID {
1432
- private static _pattern;
1433
- private static _lut;
1434
- static create(): string;
1435
- static validate(uuid: string): void;
1436
- }
1437
- import * as THREE from "three";
1438
- import { Component, Components, Disposable, Event, World } from "../core";
1439
- /**
1440
- * Configuration interface for the VertexPicker component.
1441
- */
1442
- export interface VertexPickerConfig {
1430
+ readonly onRelationsIndexed: Event<{
1431
+ modelID: string;
1432
+ relationsMap: RelationsMap;
1433
+ }>;
1443
1434
  /**
1444
- * If true, only vertices will be picked, not the closest point on the face.
1435
+ * Holds the relationship mappings for each model processed by the indexer.
1436
+ * The structure is a map where each key is a model's UUID, and the value is another map.
1437
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1438
+ * representing a specific relation type, and the value is an array of expressIDs of entities
1439
+ * that are related through that relation type. This structure allows for efficient querying
1440
+ * of entity relationships within a model.
1445
1441
  */
1446
- showOnlyVertex: boolean;
1442
+ readonly relationMaps: ModelsRelationMap;
1443
+ /** {@link Component.enabled} */
1444
+ enabled: boolean;
1445
+ private _relToAttributesMap;
1446
+ private _inverseAttributes;
1447
+ private _ifcRels;
1448
+ constructor(components: Components);
1449
+ private onFragmentsDisposed;
1450
+ private indexRelations;
1447
1451
  /**
1448
- * The maximum distance for snapping to a vertex.
1452
+ * Adds a relation map to the model's relations map.
1453
+ *
1454
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1455
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1456
+ *
1457
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1449
1458
  */
1450
- snapDistance: number;
1459
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
1451
1460
  /**
1452
- * The HTML element to use for previewing the picked vertex.
1453
- */
1454
- previewElement: HTMLElement;
1455
- }
1456
- /**
1457
- * A class that provides functionality for picking vertices in a 3D scene.
1458
- */
1459
- export declare class VertexPicker extends Component implements Disposable {
1460
- /** {@link Disposable.onDisposed} */
1461
- readonly onDisposed: Event<unknown>;
1462
- /**
1463
- * An event that is triggered when a vertex is found.
1464
- * The event passes a THREE.Vector3 representing the position of the found vertex.
1465
- */
1466
- readonly onVertexFound: Event<THREE.Vector3>;
1467
- /**
1468
- * An event that is triggered when a vertex is lost.
1469
- * The event passes a THREE.Vector3 representing the position of the lost vertex.
1470
- */
1471
- readonly onVertexLost: Event<THREE.Vector3>;
1472
- /**
1473
- * A reference to the Components instance associated with this VertexPicker.
1474
- */
1475
- components: Components;
1476
- /**
1477
- * A reference to the working plane used for vertex picking.
1478
- * This plane is used to determine which vertices are considered valid for picking.
1479
- * If this value is null, all vertices are considered valid.
1480
- */
1481
- workingPlane: THREE.Plane | null;
1482
- private _pickedPoint;
1483
- private _config;
1484
- private _enabled;
1485
- /**
1486
- * Sets the enabled state of the VertexPicker.
1487
- * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1488
- * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1489
- *
1490
- * @param value - The new enabled state.
1491
- */
1492
- set enabled(value: boolean);
1493
- /**
1494
- * Gets the current enabled state of the VertexPicker.
1495
- *
1496
- * @returns The current enabled state.
1497
- */
1498
- get enabled(): boolean;
1499
- /**
1500
- * Sets the configuration for the VertexPicker component.
1501
- *
1502
- * @param value - A Partial object containing the configuration properties to update.
1503
- * The properties not provided in the value object will retain their current values.
1504
- *
1505
- * @example
1506
- * '''typescript
1507
- * vertexPicker.config = {
1508
- * snapDistance: 0.5,
1509
- * showOnlyVertex: true,
1510
- * };
1511
- * '''
1512
- */
1513
- set config(value: Partial<VertexPickerConfig>);
1514
- /**
1515
- * Gets the current configuration for the VertexPicker component.
1516
- *
1517
- * @returns A copy of the current VertexPickerConfig object.
1518
- *
1519
- * @example
1520
- * '''typescript
1521
- * const currentConfig = vertexPicker.config;
1522
- * console.log(currentConfig.snapDistance); // Output: 0.25
1523
- * '''
1524
- */
1525
- get config(): Partial<VertexPickerConfig>;
1526
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
1527
- /** {@link Disposable.dispose} */
1528
- dispose(): void;
1529
- /**
1530
- * Performs the vertex picking operation based on the current state of the VertexPicker.
1531
- *
1532
- * @param world - The World instance to use for raycasting.
1533
- *
1534
- * @returns The current picked point, or null if no point is picked.
1535
- *
1536
- * @remarks
1537
- * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
1538
- * If enabled, it performs raycasting to find the closest intersecting object.
1539
- * It then determines the closest vertex or point on the face, based on the configuration settings.
1540
- * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
1541
- * If the picked point is not on the working plane, it resets the 'pickedPoint'.
1542
- * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
1543
- */
1544
- get(world: World): THREE.Vector3 | null;
1545
- private getClosestVertex;
1546
- private getVertices;
1547
- private getVertex;
1548
- }
1549
- import * as WEBIFC from "web-ifc";
1550
- import { FragmentsGroup } from "@thatopen/fragments";
1551
- import { Disposable, Event, Component, Components } from "../../core";
1552
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
1553
- export type { InverseAttribute, RelationsMap } from "./src/types";
1554
- /**
1555
- * Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
1556
- */
1557
- export declare class IfcRelationsIndexer extends Component implements Disposable {
1558
- /**
1559
- * A unique identifier for the component.
1560
- * This UUID is used to register the component within the Components system.
1561
- */
1562
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1563
- /** {@link Disposable.onDisposed} */
1564
- readonly onDisposed: Event<string>;
1565
- /**
1566
- * Event triggered when relations for a model have been indexed.
1567
- * This event provides the model's UUID and the relations map generated for that model.
1568
- *
1569
- * @property {string} modelID - The UUID of the model for which relations have been indexed.
1570
- * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1571
- * 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.
1572
- */
1573
- readonly onRelationsIndexed: Event<{
1574
- modelID: string;
1575
- relationsMap: RelationsMap;
1576
- }>;
1577
- /**
1578
- * Holds the relationship mappings for each model processed by the indexer.
1579
- * The structure is a map where each key is a model's UUID, and the value is another map.
1580
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1581
- * representing a specific relation type, and the value is an array of expressIDs of entities
1582
- * that are related through that relation type. This structure allows for efficient querying
1583
- * of entity relationships within a model.
1584
- */
1585
- readonly relationMaps: ModelsRelationMap;
1586
- /** {@link Component.enabled} */
1587
- enabled: boolean;
1588
- private _relToAttributesMap;
1589
- private _inverseAttributes;
1590
- private _ifcRels;
1591
- constructor(components: Components);
1592
- private onFragmentsDisposed;
1593
- private indexRelations;
1594
- /**
1595
- * Adds a relation map to the model's relations map.
1596
- *
1597
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1598
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1599
- *
1600
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1601
- */
1602
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
1603
- /**
1604
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
1605
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
1606
- * and maps them in a structured way to facilitate quick access to related entities.
1607
- *
1608
- * The process involves querying the model for each relation type associated with the inverse attributes
1609
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
1610
- * and contains a nested map where each key is an entity's expressID and its value is another map.
1611
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
1612
- * of entities that are related through that attribute.
1613
- *
1614
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
1615
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
1616
- * representation of the relations indexed by entity expressIDs and relation types.
1617
- * @throws An error if the model does not have properties loaded.
1461
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
1462
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
1463
+ * and maps them in a structured way to facilitate quick access to related entities.
1464
+ *
1465
+ * The process involves querying the model for each relation type associated with the inverse attributes
1466
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
1467
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
1468
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
1469
+ * of entities that are related through that attribute.
1470
+ *
1471
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
1472
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
1473
+ * representation of the relations indexed by entity expressIDs and relation types.
1474
+ * @throws An error if the model does not have properties loaded.
1618
1475
  */
1619
1476
  process(model: FragmentsGroup): Promise<RelationsMap>;
1620
1477
  /**
@@ -1688,6 +1545,31 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
1688
1545
  dispose(): void;
1689
1546
  }
1690
1547
  import * as WEBIFC from "web-ifc";
1548
+ import * as FRAG from "@thatopen/fragments";
1549
+ import { Component, Components } from "../../core";
1550
+ /**
1551
+ * 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).
1552
+ */
1553
+ export declare class IfcJsonExporter extends Component {
1554
+ /**
1555
+ * A unique identifier for the component.
1556
+ * This UUID is used to register the component within the Components system.
1557
+ */
1558
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1559
+ /** {@link Component.enabled} */
1560
+ enabled: boolean;
1561
+ constructor(components: Components);
1562
+ /**
1563
+ * Exports all the properties of an IFC into an array of JS objects.
1564
+ * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1565
+ * @param modelID ID of the IFC model whose properties to extract.
1566
+ * @param indirect whether to get the indirect relationships as well.
1567
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
1568
+ * to make the location data available (e.g. absolute position of building).
1569
+ */
1570
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1571
+ }
1572
+ import * as WEBIFC from "web-ifc";
1691
1573
  import { FragmentsGroup } from "@thatopen/fragments";
1692
1574
  import { Component, Disposable, Event, Components } from "../../core";
1693
1575
  /**
@@ -2019,58 +1901,176 @@ export declare class MeasurementUtils extends Component {
2019
1901
  round(vector: THREE.Vector3): void;
2020
1902
  private getFaceData;
2021
1903
  }
2022
- /**
2023
- * A Set of unique numbers representing different types of IFC geometries.
2024
- */
2025
- export declare const GeometryTypes: Set<number>;
1904
+ export declare class UUID {
1905
+ private static _pattern;
1906
+ private static _lut;
1907
+ static create(): string;
1908
+ static validate(uuid: string): void;
1909
+ }
2026
1910
  import * as THREE from "three";
2027
- import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
1911
+ import { Component, Components, Disposable, Event, World } from "../core";
2028
1912
  /**
2029
- * A class representing a 2D minimap of a 3D world.
1913
+ * Configuration interface for the VertexPicker component.
2030
1914
  */
2031
- export declare class MiniMap implements Resizeable, Updateable, Disposable {
2032
- /** {@link Disposable.onDisposed} */
2033
- readonly onDisposed: Event<unknown>;
2034
- /** {@link Updateable.onAfterUpdate} */
2035
- readonly onAfterUpdate: Event<unknown>;
2036
- /** {@link Updateable.onBeforeUpdate} */
2037
- readonly onBeforeUpdate: Event<unknown>;
2038
- /** {@link Resizeable.onResize} */
2039
- readonly onResize: Event<THREE.Vector2>;
1915
+ export interface VertexPickerConfig {
2040
1916
  /**
2041
- * The front offset of the minimap.
2042
- * It determines how much the minimap's view is offset from the camera's view.
2043
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
1917
+ * If true, only vertices will be picked, not the closest point on the face.
2044
1918
  */
2045
- frontOffset: number;
1919
+ showOnlyVertex: boolean;
2046
1920
  /**
2047
- * The override material for the minimap.
2048
- * It is used to render the depth information of the world onto the minimap.
1921
+ * The maximum distance for snapping to a vertex.
2049
1922
  */
2050
- overrideMaterial: THREE.MeshDepthMaterial;
1923
+ snapDistance: number;
2051
1924
  /**
2052
- * The background color of the minimap.
2053
- * It is used to set the background color of the minimap's renderer.
1925
+ * The HTML element to use for previewing the picked vertex.
2054
1926
  */
2055
- backgroundColor: THREE.Color;
1927
+ previewElement: HTMLElement;
1928
+ }
1929
+ /**
1930
+ * A class that provides functionality for picking vertices in a 3D scene.
1931
+ */
1932
+ export declare class VertexPicker extends Component implements Disposable {
1933
+ /** {@link Disposable.onDisposed} */
1934
+ readonly onDisposed: Event<unknown>;
2056
1935
  /**
2057
- * The WebGL renderer for the minimap.
2058
- * It is used to render the minimap onto the screen.
1936
+ * An event that is triggered when a vertex is found.
1937
+ * The event passes a THREE.Vector3 representing the position of the found vertex.
2059
1938
  */
2060
- renderer: THREE.WebGLRenderer;
1939
+ readonly onVertexFound: Event<THREE.Vector3>;
2061
1940
  /**
2062
- * A flag indicating whether the minimap is enabled.
2063
- * If disabled, the minimap will not update or render.
1941
+ * An event that is triggered when a vertex is lost.
1942
+ * The event passes a THREE.Vector3 representing the position of the lost vertex.
2064
1943
  */
2065
- enabled: boolean;
1944
+ readonly onVertexLost: Event<THREE.Vector3>;
2066
1945
  /**
2067
- * The world in which the minimap is displayed.
2068
- * It provides access to the 3D scene, camera, and other relevant world elements.
1946
+ * A reference to the Components instance associated with this VertexPicker.
2069
1947
  */
2070
- world: World;
2071
- private _lockRotation;
2072
- private _camera;
2073
- private _plane;
1948
+ components: Components;
1949
+ /**
1950
+ * A reference to the working plane used for vertex picking.
1951
+ * This plane is used to determine which vertices are considered valid for picking.
1952
+ * If this value is null, all vertices are considered valid.
1953
+ */
1954
+ workingPlane: THREE.Plane | null;
1955
+ private _pickedPoint;
1956
+ private _config;
1957
+ private _enabled;
1958
+ /**
1959
+ * Sets the enabled state of the VertexPicker.
1960
+ * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1961
+ * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1962
+ *
1963
+ * @param value - The new enabled state.
1964
+ */
1965
+ set enabled(value: boolean);
1966
+ /**
1967
+ * Gets the current enabled state of the VertexPicker.
1968
+ *
1969
+ * @returns The current enabled state.
1970
+ */
1971
+ get enabled(): boolean;
1972
+ /**
1973
+ * Sets the configuration for the VertexPicker component.
1974
+ *
1975
+ * @param value - A Partial object containing the configuration properties to update.
1976
+ * The properties not provided in the value object will retain their current values.
1977
+ *
1978
+ * @example
1979
+ * '''typescript
1980
+ * vertexPicker.config = {
1981
+ * snapDistance: 0.5,
1982
+ * showOnlyVertex: true,
1983
+ * };
1984
+ * '''
1985
+ */
1986
+ set config(value: Partial<VertexPickerConfig>);
1987
+ /**
1988
+ * Gets the current configuration for the VertexPicker component.
1989
+ *
1990
+ * @returns A copy of the current VertexPickerConfig object.
1991
+ *
1992
+ * @example
1993
+ * '''typescript
1994
+ * const currentConfig = vertexPicker.config;
1995
+ * console.log(currentConfig.snapDistance); // Output: 0.25
1996
+ * '''
1997
+ */
1998
+ get config(): Partial<VertexPickerConfig>;
1999
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
2000
+ /** {@link Disposable.dispose} */
2001
+ dispose(): void;
2002
+ /**
2003
+ * Performs the vertex picking operation based on the current state of the VertexPicker.
2004
+ *
2005
+ * @param world - The World instance to use for raycasting.
2006
+ *
2007
+ * @returns The current picked point, or null if no point is picked.
2008
+ *
2009
+ * @remarks
2010
+ * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
2011
+ * If enabled, it performs raycasting to find the closest intersecting object.
2012
+ * It then determines the closest vertex or point on the face, based on the configuration settings.
2013
+ * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
2014
+ * If the picked point is not on the working plane, it resets the 'pickedPoint'.
2015
+ * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
2016
+ */
2017
+ get(world: World): THREE.Vector3 | null;
2018
+ private getClosestVertex;
2019
+ private getVertices;
2020
+ private getVertex;
2021
+ }
2022
+ /**
2023
+ * A Set of unique numbers representing different types of IFC geometries.
2024
+ */
2025
+ export declare const GeometryTypes: Set<number>;
2026
+ import * as THREE from "three";
2027
+ import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
2028
+ /**
2029
+ * A class representing a 2D minimap of a 3D world.
2030
+ */
2031
+ export declare class MiniMap implements Resizeable, Updateable, Disposable {
2032
+ /** {@link Disposable.onDisposed} */
2033
+ readonly onDisposed: Event<unknown>;
2034
+ /** {@link Updateable.onAfterUpdate} */
2035
+ readonly onAfterUpdate: Event<unknown>;
2036
+ /** {@link Updateable.onBeforeUpdate} */
2037
+ readonly onBeforeUpdate: Event<unknown>;
2038
+ /** {@link Resizeable.onResize} */
2039
+ readonly onResize: Event<THREE.Vector2>;
2040
+ /**
2041
+ * The front offset of the minimap.
2042
+ * It determines how much the minimap's view is offset from the camera's view.
2043
+ * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
2044
+ */
2045
+ frontOffset: number;
2046
+ /**
2047
+ * The override material for the minimap.
2048
+ * It is used to render the depth information of the world onto the minimap.
2049
+ */
2050
+ overrideMaterial: THREE.MeshDepthMaterial;
2051
+ /**
2052
+ * The background color of the minimap.
2053
+ * It is used to set the background color of the minimap's renderer.
2054
+ */
2055
+ backgroundColor: THREE.Color;
2056
+ /**
2057
+ * The WebGL renderer for the minimap.
2058
+ * It is used to render the minimap onto the screen.
2059
+ */
2060
+ renderer: THREE.WebGLRenderer;
2061
+ /**
2062
+ * A flag indicating whether the minimap is enabled.
2063
+ * If disabled, the minimap will not update or render.
2064
+ */
2065
+ enabled: boolean;
2066
+ /**
2067
+ * The world in which the minimap is displayed.
2068
+ * It provides access to the 3D scene, camera, and other relevant world elements.
2069
+ */
2070
+ world: World;
2071
+ private _lockRotation;
2072
+ private _camera;
2073
+ private _plane;
2074
2074
  private _size;
2075
2075
  private _tempVector1;
2076
2076
  private _tempVector2;
@@ -2118,14 +2118,6 @@ export declare const relToAttributesMap: Map<number, {
2118
2118
  forRelated: InverseAttribute;
2119
2119
  }>;
2120
2120
  import * as WEBIFC from "web-ifc";
2121
- import { IfcItemsCategories } from "../../../ifc";
2122
- export declare class SpatialStructure {
2123
- itemsByFloor: IfcItemsCategories;
2124
- private _units;
2125
- setUp(webIfc: WEBIFC.IfcAPI): void;
2126
- cleanUp(): void;
2127
- }
2128
- import * as WEBIFC from "web-ifc";
2129
2121
  /** Configuration of the IFC-fragment conversion. */
2130
2122
  export declare class IfcFragmentSettings {
2131
2123
  /** Whether to extract the IFC properties into a JSON. */
@@ -2167,6 +2159,14 @@ export declare class IfcFragmentSettings {
2167
2159
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2168
2160
  }
2169
2161
  import * as WEBIFC from "web-ifc";
2162
+ import { IfcItemsCategories } from "../../../ifc";
2163
+ export declare class SpatialStructure {
2164
+ itemsByFloor: IfcItemsCategories;
2165
+ private _units;
2166
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2167
+ cleanUp(): void;
2168
+ }
2169
+ import * as WEBIFC from "web-ifc";
2170
2170
  export interface IfcItemsCategories {
2171
2171
  [itemID: number]: number;
2172
2172
  }
@@ -2218,27 +2218,27 @@ export declare class IfcPropertiesUtils {
2218
2218
  /**
2219
2219
  * 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.
2220
2220
  */
2221
- export declare class Event<T> {
2221
+ export declare class AsyncEvent<T> {
2222
2222
  /**
2223
2223
  * Add a callback to this event instance.
2224
2224
  * @param handler - the callback to be added to this event.
2225
2225
  */
2226
2226
  add(handler: T extends void ? {
2227
- (): void;
2227
+ (): Promise<void>;
2228
2228
  } : {
2229
- (data: T): void;
2229
+ (data: T): Promise<void>;
2230
2230
  }): void;
2231
2231
  /**
2232
2232
  * Removes a callback from this event instance.
2233
2233
  * @param handler - the callback to be removed from this event.
2234
2234
  */
2235
2235
  remove(handler: T extends void ? {
2236
- (): void;
2236
+ (): Promise<void>;
2237
2237
  } : {
2238
- (data: T): void;
2238
+ (data: T): Promise<void>;
2239
2239
  }): void;
2240
2240
  /** Triggers all the callbacks assigned to this event. */
2241
- trigger: (data?: T) => void;
2241
+ trigger: (data?: T) => Promise<void>;
2242
2242
  /** Gets rid of all the suscribed events. */
2243
2243
  reset(): void;
2244
2244
  private handlers;
@@ -2246,27 +2246,27 @@ export declare class Event<T> {
2246
2246
  /**
2247
2247
  * 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.
2248
2248
  */
2249
- export declare class AsyncEvent<T> {
2249
+ export declare class Event<T> {
2250
2250
  /**
2251
2251
  * Add a callback to this event instance.
2252
2252
  * @param handler - the callback to be added to this event.
2253
2253
  */
2254
2254
  add(handler: T extends void ? {
2255
- (): Promise<void>;
2255
+ (): void;
2256
2256
  } : {
2257
- (data: T): Promise<void>;
2257
+ (data: T): void;
2258
2258
  }): void;
2259
2259
  /**
2260
2260
  * Removes a callback from this event instance.
2261
2261
  * @param handler - the callback to be removed from this event.
2262
2262
  */
2263
2263
  remove(handler: T extends void ? {
2264
- (): Promise<void>;
2264
+ (): void;
2265
2265
  } : {
2266
- (data: T): Promise<void>;
2266
+ (data: T): void;
2267
2267
  }): void;
2268
2268
  /** Triggers all the callbacks assigned to this event. */
2269
- trigger: (data?: T) => Promise<void>;
2269
+ trigger: (data?: T) => void;
2270
2270
  /** Gets rid of all the suscribed events. */
2271
2271
  reset(): void;
2272
2272
  private handlers;
@@ -2379,19 +2379,6 @@ export interface CameraControllable {
2379
2379
  */
2380
2380
  controls: CameraControls;
2381
2381
  }
2382
- import { Base } from "./base";
2383
- /**
2384
- * 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.
2385
- */
2386
- export declare abstract class Component extends Base {
2387
- /**
2388
- * Whether this component is active or not. The behaviour can vary depending
2389
- * on the type of component. E.g. a disabled dimension tool will stop creating
2390
- * dimensions, while a disabled camera will stop moving. A disabled component
2391
- * will not be updated automatically each frame.
2392
- */
2393
- abstract enabled: boolean;
2394
- }
2395
2382
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2396
2383
  import { Components } from "../../Components";
2397
2384
  /**
@@ -2411,29 +2398,6 @@ export declare abstract class Base {
2411
2398
  /** Whether is component is {@link Configurable}. */
2412
2399
  isConfigurable: () => this is Configurable<any>;
2413
2400
  }
2414
- import { Base } from "./base";
2415
- import { World } from "./world";
2416
- import { Event } from "./event";
2417
- import { Components } from "../../Components";
2418
- /**
2419
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
2420
- */
2421
- export declare abstract class BaseWorldItem extends Base {
2422
- readonly worlds: Map<string, World>;
2423
- /**
2424
- * Event that is triggered when a world is added or removed from the 'worlds' map.
2425
- * The event payload contains the world instance and the action ("added" or "removed").
2426
- */
2427
- readonly onWorldChanged: Event<{
2428
- world: World;
2429
- action: "added" | "removed";
2430
- }>;
2431
- /**
2432
- * The current world this item is associated with. It can be null if no world is currently active.
2433
- */
2434
- currentWorld: World | null;
2435
- protected constructor(components: Components);
2436
- }
2437
2401
  import * as THREE from "three";
2438
2402
  import CameraControls from "camera-controls";
2439
2403
  import { BaseWorldItem } from "./base-world-item";
@@ -2462,6 +2426,19 @@ export declare abstract class BaseCamera extends BaseWorldItem {
2462
2426
  */
2463
2427
  hasCameraControls: () => this is CameraControllable;
2464
2428
  }
2429
+ import { Base } from "./base";
2430
+ /**
2431
+ * 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.
2432
+ */
2433
+ export declare abstract class Component extends Base {
2434
+ /**
2435
+ * Whether this component is active or not. The behaviour can vary depending
2436
+ * on the type of component. E.g. a disabled dimension tool will stop creating
2437
+ * dimensions, while a disabled camera will stop moving. A disabled component
2438
+ * will not be updated automatically each frame.
2439
+ */
2440
+ abstract enabled: boolean;
2441
+ }
2465
2442
  import * as THREE from "three";
2466
2443
  import { Vector2 } from "three";
2467
2444
  import { Event } from "./event";
@@ -2547,6 +2524,29 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
2547
2524
  /** {@link Disposable.dispose} */
2548
2525
  dispose(): void;
2549
2526
  }
2527
+ import { Base } from "./base";
2528
+ import { World } from "./world";
2529
+ import { Event } from "./event";
2530
+ import { Components } from "../../Components";
2531
+ /**
2532
+ * One of the elements that make a world. It can be either a scene, a camera or a renderer.
2533
+ */
2534
+ export declare abstract class BaseWorldItem extends Base {
2535
+ readonly worlds: Map<string, World>;
2536
+ /**
2537
+ * Event that is triggered when a world is added or removed from the 'worlds' map.
2538
+ * The event payload contains the world instance and the action ("added" or "removed").
2539
+ */
2540
+ readonly onWorldChanged: Event<{
2541
+ world: World;
2542
+ action: "added" | "removed";
2543
+ }>;
2544
+ /**
2545
+ * The current world this item is associated with. It can be null if no world is currently active.
2546
+ */
2547
+ currentWorld: World | null;
2548
+ protected constructor(components: Components);
2549
+ }
2550
2550
  import * as THREE from "three";
2551
2551
  import { BaseScene } from "./base-scene";
2552
2552
  import { BaseCamera } from "./base-camera";
@@ -2582,261 +2582,14 @@ export interface World extends Disposable, Updateable {
2582
2582
  isDisposing: boolean;
2583
2583
  }
2584
2584
  import * as THREE from "three";
2585
- import { Disposable, Event } from "../../Types";
2585
+ import { Hideable, Event, World, Disposable } from "../../Types";
2586
+ import { Components } from "../../Components";
2586
2587
  /**
2587
- * 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.
2588
+ * Configuration interface for the {@link SimpleGrid} class.
2588
2589
  */
2589
- export declare class Mouse implements Disposable {
2590
- dom: HTMLCanvasElement;
2591
- private _event?;
2592
- private _position;
2593
- /** {@link Disposable.onDisposed} */
2594
- readonly onDisposed: Event<unknown>;
2595
- constructor(dom: HTMLCanvasElement);
2590
+ export interface GridConfig {
2596
2591
  /**
2597
- * The real position of the mouse of the Three.js canvas.
2598
- */
2599
- get position(): THREE.Vector2;
2600
- /** {@link Disposable.dispose} */
2601
- dispose(): void;
2602
- private getPositionY;
2603
- private getPositionX;
2604
- private updateMouseInfo;
2605
- private setupEvents;
2606
- }
2607
- import * as THREE from "three";
2608
- import { Components } from "../../Components";
2609
- import { Event, World, Disposable } from "../../Types";
2610
- import { Mouse } from "./mouse";
2611
- /**
2612
- * 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.
2613
- */
2614
- export declare class SimpleRaycaster implements Disposable {
2615
- /** {@link Component.enabled} */
2616
- enabled: boolean;
2617
- /** The components instance to which this Raycaster belongs. */
2618
- components: Components;
2619
- /** {@link Disposable.onDisposed} */
2620
- readonly onDisposed: Event<unknown>;
2621
- /** The position of the mouse in the screen. */
2622
- readonly mouse: Mouse;
2623
- /**
2624
- * A reference to the Three.js Raycaster instance.
2625
- * This is used for raycasting operations.
2626
- */
2627
- readonly three: THREE.Raycaster;
2628
- /**
2629
- * A reference to the world instance to which this Raycaster belongs.
2630
- * This is used to access the camera and meshes.
2631
- */
2632
- world: World;
2633
- constructor(components: Components, world: World);
2634
- /** {@link Disposable.dispose} */
2635
- dispose(): void;
2636
- /**
2637
- * Throws a ray from the camera to the mouse or touch event point and returns
2638
- * the first item found. This also takes into account the clipping planes
2639
- * used by the renderer.
2640
- *
2641
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2642
- * to query. If not provided, it will query all the meshes stored in
2643
- * {@link Components.meshes}.
2644
- */
2645
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2646
- /**
2647
- * Casts a ray from a given origin in a given direction and returns the first item found.
2648
- * This method also takes into account the clipping planes used by the renderer.
2649
- *
2650
- * @param origin - The origin of the ray.
2651
- * @param direction - The direction of the ray.
2652
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2653
- * @returns The first intersection found or 'null' if no intersection was found.
2654
- */
2655
- 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;
2656
- private intersect;
2657
- private filterClippingPlanes;
2658
- }
2659
- import * as THREE from "three";
2660
- import { BaseScene, Configurable, Event } from "../../Types";
2661
- import { Components } from "../../Components";
2662
- /**
2663
- * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2664
- */
2665
- export interface SimpleSceneConfig {
2666
- directionalLight: {
2667
- color: THREE.Color;
2668
- intensity: number;
2669
- position: THREE.Vector3;
2670
- };
2671
- ambientLight: {
2672
- color: THREE.Color;
2673
- intensity: number;
2674
- };
2675
- }
2676
- /**
2677
- * 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.
2678
- */
2679
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2680
- /** {@link Configurable.isSetup} */
2681
- isSetup: boolean;
2682
- /**
2683
- * The underlying Three.js scene object.
2684
- * It is used to define the 3D space containing objects, lights, and cameras.
2685
- */
2686
- three: THREE.Scene;
2687
- /** {@link Configurable.onSetup} */
2688
- readonly onSetup: Event<SimpleScene>;
2689
- /**
2690
- * Configuration interface for the {@link SimpleScene}.
2691
- * Defines properties for directional and ambient lights.
2692
- */
2693
- config: Required<SimpleSceneConfig>;
2694
- constructor(components: Components);
2695
- /** {@link Configurable.setup} */
2696
- setup(config?: Partial<SimpleSceneConfig>): void;
2697
- }
2698
- import * as THREE from "three";
2699
- import { BaseRenderer, Event } from "../../Types";
2700
- import { Components } from "../../Components";
2701
- /**
2702
- * A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
2703
- */
2704
- export declare class SimpleRenderer extends BaseRenderer {
2705
- /**
2706
- * Indicates whether the renderer is enabled. If it's not, it won't be updated.
2707
- * Default is 'true'.
2708
- */
2709
- enabled: boolean;
2710
- /**
2711
- * The HTML container of the THREE.js canvas where the scene is rendered.
2712
- */
2713
- container: HTMLElement;
2714
- /**
2715
- * The THREE.js WebGLRenderer instance.
2716
- */
2717
- three: THREE.WebGLRenderer;
2718
- protected _canvas: HTMLCanvasElement;
2719
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
2720
- protected _resizeObserver: ResizeObserver | null;
2721
- protected onContainerUpdated: Event<unknown>;
2722
- private _resizing;
2723
- /**
2724
- * Constructor for the SimpleRenderer class.
2725
- *
2726
- * @param components - The components instance.
2727
- * @param container - The HTML container where the THREE.js canvas will be rendered.
2728
- * @param parameters - Optional parameters for the THREE.js WebGLRenderer.
2729
- */
2730
- constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
2731
- /** {@link Updateable.update} */
2732
- update(): void;
2733
- /** {@link Disposable.dispose} */
2734
- dispose(): void;
2735
- /** {@link Resizeable.getSize}. */
2736
- getSize(): THREE.Vector2;
2737
- /** {@link Resizeable.resize} */
2738
- resize: (size?: THREE.Vector2) => void;
2739
- /**
2740
- * Sets up and manages the event listeners for the renderer.
2741
- *
2742
- * @param active - A boolean indicating whether to activate or deactivate the event listeners.
2743
- *
2744
- * @throws Will throw an error if the renderer does not have an HTML container.
2745
- */
2746
- setupEvents(active: boolean): void;
2747
- private resizeEvent;
2748
- private setupRenderer;
2749
- private onContextLost;
2750
- private onContextBack;
2751
- }
2752
- import * as THREE from "three";
2753
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
2754
- /**
2755
- * A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
2756
- *
2757
- * @template T - The type of the scene. Default is BaseScene.
2758
- * @template U - The type of the camera. Default is BaseCamera.
2759
- * @template S - The type of the renderer. Default is BaseRenderer.
2760
- */
2761
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
2762
- /**
2763
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
2764
- */
2765
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
2766
- /** {@link Updateable.onAfterUpdate} */
2767
- readonly onAfterUpdate: Event<unknown>;
2768
- /** {@link Updateable.onBeforeUpdate} */
2769
- readonly onBeforeUpdate: Event<unknown>;
2770
- /** {@link Disposable.onDisposed} */
2771
- readonly onDisposed: Event<unknown>;
2772
- /**
2773
- * Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
2774
- */
2775
- isDisposing: boolean;
2776
- /**
2777
- * Indicates whether the world is currently enabled.
2778
- * When disabled, the world will not be updated.
2779
- */
2780
- enabled: boolean;
2781
- /**
2782
- * A unique identifier for the world.
2783
- */
2784
- uuid: string;
2785
- /**
2786
- * An optional name for the world.
2787
- */
2788
- name?: string;
2789
- private _scene?;
2790
- private _camera?;
2791
- private _renderer;
2792
- /**
2793
- * Getter for the scene. If no scene is initialized, it throws an error.
2794
- * @returns The current scene.
2795
- */
2796
- get scene(): T;
2797
- /**
2798
- * Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
2799
- * sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
2800
- * @param scene - The new scene to be set.
2801
- */
2802
- set scene(scene: T);
2803
- /**
2804
- * Getter for the camera. If no camera is initialized, it throws an error.
2805
- * @returns The current camera.
2806
- */
2807
- get camera(): U;
2808
- /**
2809
- * Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
2810
- * sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
2811
- * @param camera - The new camera to be set.
2812
- */
2813
- set camera(camera: U);
2814
- /**
2815
- * Getter for the renderer.
2816
- * @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
2817
- */
2818
- get renderer(): S | null;
2819
- /**
2820
- * Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
2821
- * sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
2822
- * If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
2823
- * @param renderer - The new renderer to be set or null to remove the current renderer.
2824
- */
2825
- set renderer(renderer: S | null);
2826
- /** {@link Updateable.update} */
2827
- update(delta?: number): void;
2828
- /** {@link Disposable.dispose} */
2829
- dispose(disposeResources?: boolean): void;
2830
- }
2831
- import * as THREE from "three";
2832
- import { Hideable, Event, World, Disposable } from "../../Types";
2833
- import { Components } from "../../Components";
2834
- /**
2835
- * Configuration interface for the {@link SimpleGrid} class.
2836
- */
2837
- export interface GridConfig {
2838
- /**
2839
- * The color of the grid lines.
2592
+ * The color of the grid lines.
2840
2593
  */
2841
2594
  color: THREE.Color;
2842
2595
  /**
@@ -2978,67 +2731,17 @@ export declare class CullerRenderer {
2978
2731
  protected decreaseColor(): void;
2979
2732
  private applySettings;
2980
2733
  }
2981
- import * as THREE from "three";
2982
- import CameraControls from "camera-controls";
2983
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
2984
- import { Components } from "../../Components";
2734
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2735
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
2985
2736
  /**
2986
- * A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
2737
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
2987
2738
  */
2988
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
2989
- /** {@link Updateable.onBeforeUpdate} */
2990
- readonly onBeforeUpdate: Event<SimpleCamera>;
2991
- /** {@link Updateable.onAfterUpdate} */
2992
- readonly onAfterUpdate: Event<SimpleCamera>;
2739
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
2993
2740
  /**
2994
- * Event that is triggered when the aspect of the camera has been updated.
2995
- * This event is useful when you need to perform actions after the aspect of the camera has been changed.
2996
- */
2997
- readonly onAspectUpdated: Event<unknown>;
2998
- /** {@link Disposable.onDisposed} */
2999
- readonly onDisposed: Event<string>;
3000
- /**
3001
- * A three.js PerspectiveCamera or OrthographicCamera instance.
3002
- * This camera is used for rendering the scene.
3003
- */
3004
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3005
- private _allControls;
3006
- /**
3007
- * The object that controls the camera. An instance of
3008
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
3009
- * Transforming the camera directly will have no effect: you need to use this
3010
- * object to move, rotate, look at objects, etc.
3011
- */
3012
- get controls(): CameraControls;
3013
- /**
3014
- * Getter for the enabled state of the camera controls.
3015
- * If the current world is null, it returns false.
3016
- * Otherwise, it returns the enabled state of the camera controls.
3017
- *
3018
- * @returns {boolean} The enabled state of the camera controls.
3019
- */
3020
- get enabled(): boolean;
3021
- /**
3022
- * Setter for the enabled state of the camera controls.
3023
- * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
3024
- *
3025
- * @param {boolean} enabled - The new enabled state of the camera controls.
3026
- */
3027
- set enabled(enabled: boolean);
3028
- constructor(components: Components);
3029
- /** {@link Disposable.dispose} */
3030
- dispose(): void;
3031
- /** {@link Updateable.update} */
3032
- update(_delta: number): void;
3033
- /**
3034
- * Updates the aspect of the camera to match the size of the
3035
- * {@link Components.renderer}.
2741
+ * Amount of properties to be streamed.
2742
+ * Defaults to 100 properties.
3036
2743
  */
3037
- updateAspect: () => void;
3038
- private setupCamera;
3039
- private newCameraControls;
3040
- private setupEvents;
3041
- private static getSubsetOfThree;
2744
+ propertiesSize: number;
3042
2745
  }
3043
2746
  import * as THREE from "three";
3044
2747
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
@@ -3096,7 +2799,6 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
3096
2799
  private handleWorkerMessage;
3097
2800
  private getAvailableMaterial;
3098
2801
  }
3099
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
3100
2802
  import * as THREE from "three";
3101
2803
  import { Hideable, Disposable, Event, World } from "../../Types";
3102
2804
  import { Components } from "../../Components";
@@ -3135,75 +2837,298 @@ export declare class SimplePlane implements Disposable, Hideable {
3135
2837
  private readonly _controls;
3136
2838
  private readonly _hiddenMaterial;
3137
2839
  /**
3138
- * Getter for the enabled state of the clipping plane.
3139
- * @returns {boolean} The current enabled state.
2840
+ * Getter for the enabled state of the clipping plane.
2841
+ * @returns {boolean} The current enabled state.
2842
+ */
2843
+ get enabled(): boolean;
2844
+ /**
2845
+ * Setter for the enabled state of the clipping plane.
2846
+ * Updates the clipping plane state in the renderer and throws an error if no renderer is found.
2847
+ * @param {boolean} state - The new enabled state.
2848
+ */
2849
+ set enabled(state: boolean);
2850
+ /** {@link Hideable.visible } */
2851
+ get visible(): boolean;
2852
+ /** {@link Hideable.visible } */
2853
+ set visible(state: boolean);
2854
+ /** The meshes used for raycasting */
2855
+ get meshes(): THREE.Mesh[];
2856
+ /** The material of the clipping plane representation. */
2857
+ get planeMaterial(): THREE.Material | THREE.Material[];
2858
+ /** The material of the clipping plane representation. */
2859
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
2860
+ /** The size of the clipping plane representation. */
2861
+ get size(): number;
2862
+ /** Sets the size of the clipping plane representation. */
2863
+ set size(size: number);
2864
+ /**
2865
+ * Getter for the helper object of the clipping plane.
2866
+ * The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
2867
+ * It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
2868
+ *
2869
+ * @returns {THREE.Object3D} The helper object of the clipping plane.
2870
+ */
2871
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
2872
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
2873
+ /**
2874
+ * Sets the clipping plane's normal and origin from the given normal and point.
2875
+ * This method resets the clipping plane's state, updates the normal and origin,
2876
+ * and positions the helper object accordingly.
2877
+ *
2878
+ * @param normal - The new normal vector for the clipping plane.
2879
+ * @param point - The new origin point for the clipping plane.
2880
+ *
2881
+ * @returns {void}
2882
+ */
2883
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
2884
+ /** {@link Updateable.update} */
2885
+ update: () => void;
2886
+ /** {@link Disposable.dispose} */
2887
+ dispose(): void;
2888
+ private reset;
2889
+ protected toggleControls(state: boolean): void;
2890
+ private newTransformControls;
2891
+ private initializeControls;
2892
+ private createArrowBoundingBox;
2893
+ private changeDrag;
2894
+ private notifyDraggingChanged;
2895
+ private preventCameraMovement;
2896
+ private newHelper;
2897
+ private static newPlaneMesh;
2898
+ }
2899
+ import * as THREE from "three";
2900
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
2901
+ /**
2902
+ * A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
2903
+ *
2904
+ * @template T - The type of the scene. Default is BaseScene.
2905
+ * @template U - The type of the camera. Default is BaseCamera.
2906
+ * @template S - The type of the renderer. Default is BaseRenderer.
2907
+ */
2908
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
2909
+ /**
2910
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
2911
+ */
2912
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
2913
+ /** {@link Updateable.onAfterUpdate} */
2914
+ readonly onAfterUpdate: Event<unknown>;
2915
+ /** {@link Updateable.onBeforeUpdate} */
2916
+ readonly onBeforeUpdate: Event<unknown>;
2917
+ /** {@link Disposable.onDisposed} */
2918
+ readonly onDisposed: Event<unknown>;
2919
+ /**
2920
+ * Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
2921
+ */
2922
+ isDisposing: boolean;
2923
+ /**
2924
+ * Indicates whether the world is currently enabled.
2925
+ * When disabled, the world will not be updated.
2926
+ */
2927
+ enabled: boolean;
2928
+ /**
2929
+ * A unique identifier for the world.
2930
+ */
2931
+ uuid: string;
2932
+ /**
2933
+ * An optional name for the world.
2934
+ */
2935
+ name?: string;
2936
+ private _scene?;
2937
+ private _camera?;
2938
+ private _renderer;
2939
+ /**
2940
+ * Getter for the scene. If no scene is initialized, it throws an error.
2941
+ * @returns The current scene.
2942
+ */
2943
+ get scene(): T;
2944
+ /**
2945
+ * Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
2946
+ * sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
2947
+ * @param scene - The new scene to be set.
2948
+ */
2949
+ set scene(scene: T);
2950
+ /**
2951
+ * Getter for the camera. If no camera is initialized, it throws an error.
2952
+ * @returns The current camera.
2953
+ */
2954
+ get camera(): U;
2955
+ /**
2956
+ * Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
2957
+ * sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
2958
+ * @param camera - The new camera to be set.
2959
+ */
2960
+ set camera(camera: U);
2961
+ /**
2962
+ * Getter for the renderer.
2963
+ * @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
2964
+ */
2965
+ get renderer(): S | null;
2966
+ /**
2967
+ * Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
2968
+ * sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
2969
+ * If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
2970
+ * @param renderer - The new renderer to be set or null to remove the current renderer.
2971
+ */
2972
+ set renderer(renderer: S | null);
2973
+ /** {@link Updateable.update} */
2974
+ update(delta?: number): void;
2975
+ /** {@link Disposable.dispose} */
2976
+ dispose(disposeResources?: boolean): void;
2977
+ }
2978
+ import * as THREE from "three";
2979
+ import { BaseScene, Configurable, Event } from "../../Types";
2980
+ import { Components } from "../../Components";
2981
+ /**
2982
+ * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2983
+ */
2984
+ export interface SimpleSceneConfig {
2985
+ directionalLight: {
2986
+ color: THREE.Color;
2987
+ intensity: number;
2988
+ position: THREE.Vector3;
2989
+ };
2990
+ ambientLight: {
2991
+ color: THREE.Color;
2992
+ intensity: number;
2993
+ };
2994
+ }
2995
+ /**
2996
+ * 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.
2997
+ */
2998
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2999
+ /** {@link Configurable.isSetup} */
3000
+ isSetup: boolean;
3001
+ /**
3002
+ * The underlying Three.js scene object.
3003
+ * It is used to define the 3D space containing objects, lights, and cameras.
3004
+ */
3005
+ three: THREE.Scene;
3006
+ /** {@link Configurable.onSetup} */
3007
+ readonly onSetup: Event<SimpleScene>;
3008
+ /**
3009
+ * Configuration interface for the {@link SimpleScene}.
3010
+ * Defines properties for directional and ambient lights.
3011
+ */
3012
+ config: Required<SimpleSceneConfig>;
3013
+ constructor(components: Components);
3014
+ /** {@link Configurable.setup} */
3015
+ setup(config?: Partial<SimpleSceneConfig>): void;
3016
+ }
3017
+ import * as THREE from "three";
3018
+ import { BaseRenderer, Event } from "../../Types";
3019
+ import { Components } from "../../Components";
3020
+ /**
3021
+ * A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
3022
+ */
3023
+ export declare class SimpleRenderer extends BaseRenderer {
3024
+ /**
3025
+ * Indicates whether the renderer is enabled. If it's not, it won't be updated.
3026
+ * Default is 'true'.
3027
+ */
3028
+ enabled: boolean;
3029
+ /**
3030
+ * The HTML container of the THREE.js canvas where the scene is rendered.
3031
+ */
3032
+ container: HTMLElement;
3033
+ /**
3034
+ * The THREE.js WebGLRenderer instance.
3035
+ */
3036
+ three: THREE.WebGLRenderer;
3037
+ protected _canvas: HTMLCanvasElement;
3038
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
3039
+ protected _resizeObserver: ResizeObserver | null;
3040
+ protected onContainerUpdated: Event<unknown>;
3041
+ private _resizing;
3042
+ /**
3043
+ * Constructor for the SimpleRenderer class.
3044
+ *
3045
+ * @param components - The components instance.
3046
+ * @param container - The HTML container where the THREE.js canvas will be rendered.
3047
+ * @param parameters - Optional parameters for the THREE.js WebGLRenderer.
3048
+ */
3049
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
3050
+ /** {@link Updateable.update} */
3051
+ update(): void;
3052
+ /** {@link Disposable.dispose} */
3053
+ dispose(): void;
3054
+ /** {@link Resizeable.getSize}. */
3055
+ getSize(): THREE.Vector2;
3056
+ /** {@link Resizeable.resize} */
3057
+ resize: (size?: THREE.Vector2) => void;
3058
+ /**
3059
+ * Sets up and manages the event listeners for the renderer.
3060
+ *
3061
+ * @param active - A boolean indicating whether to activate or deactivate the event listeners.
3062
+ *
3063
+ * @throws Will throw an error if the renderer does not have an HTML container.
3064
+ */
3065
+ setupEvents(active: boolean): void;
3066
+ private resizeEvent;
3067
+ private setupRenderer;
3068
+ private onContextLost;
3069
+ private onContextBack;
3070
+ }
3071
+ import * as THREE from "three";
3072
+ import CameraControls from "camera-controls";
3073
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
3074
+ import { Components } from "../../Components";
3075
+ /**
3076
+ * A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
3077
+ */
3078
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
3079
+ /** {@link Updateable.onBeforeUpdate} */
3080
+ readonly onBeforeUpdate: Event<SimpleCamera>;
3081
+ /** {@link Updateable.onAfterUpdate} */
3082
+ readonly onAfterUpdate: Event<SimpleCamera>;
3083
+ /**
3084
+ * Event that is triggered when the aspect of the camera has been updated.
3085
+ * This event is useful when you need to perform actions after the aspect of the camera has been changed.
3086
+ */
3087
+ readonly onAspectUpdated: Event<unknown>;
3088
+ /** {@link Disposable.onDisposed} */
3089
+ readonly onDisposed: Event<string>;
3090
+ /**
3091
+ * A three.js PerspectiveCamera or OrthographicCamera instance.
3092
+ * This camera is used for rendering the scene.
3140
3093
  */
3141
- get enabled(): boolean;
3094
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3095
+ private _allControls;
3142
3096
  /**
3143
- * Setter for the enabled state of the clipping plane.
3144
- * Updates the clipping plane state in the renderer and throws an error if no renderer is found.
3145
- * @param {boolean} state - The new enabled state.
3097
+ * The object that controls the camera. An instance of
3098
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
3099
+ * Transforming the camera directly will have no effect: you need to use this
3100
+ * object to move, rotate, look at objects, etc.
3146
3101
  */
3147
- set enabled(state: boolean);
3148
- /** {@link Hideable.visible } */
3149
- get visible(): boolean;
3150
- /** {@link Hideable.visible } */
3151
- set visible(state: boolean);
3152
- /** The meshes used for raycasting */
3153
- get meshes(): THREE.Mesh[];
3154
- /** The material of the clipping plane representation. */
3155
- get planeMaterial(): THREE.Material | THREE.Material[];
3156
- /** The material of the clipping plane representation. */
3157
- set planeMaterial(material: THREE.Material | THREE.Material[]);
3158
- /** The size of the clipping plane representation. */
3159
- get size(): number;
3160
- /** Sets the size of the clipping plane representation. */
3161
- set size(size: number);
3102
+ get controls(): CameraControls;
3162
3103
  /**
3163
- * Getter for the helper object of the clipping plane.
3164
- * The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
3165
- * It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
3104
+ * Getter for the enabled state of the camera controls.
3105
+ * If the current world is null, it returns false.
3106
+ * Otherwise, it returns the enabled state of the camera controls.
3166
3107
  *
3167
- * @returns {THREE.Object3D} The helper object of the clipping plane.
3108
+ * @returns {boolean} The enabled state of the camera controls.
3168
3109
  */
3169
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
3170
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
3110
+ get enabled(): boolean;
3171
3111
  /**
3172
- * Sets the clipping plane's normal and origin from the given normal and point.
3173
- * This method resets the clipping plane's state, updates the normal and origin,
3174
- * and positions the helper object accordingly.
3175
- *
3176
- * @param normal - The new normal vector for the clipping plane.
3177
- * @param point - The new origin point for the clipping plane.
3112
+ * Setter for the enabled state of the camera controls.
3113
+ * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
3178
3114
  *
3179
- * @returns {void}
3115
+ * @param {boolean} enabled - The new enabled state of the camera controls.
3180
3116
  */
3181
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
3182
- /** {@link Updateable.update} */
3183
- update: () => void;
3117
+ set enabled(enabled: boolean);
3118
+ constructor(components: Components);
3184
3119
  /** {@link Disposable.dispose} */
3185
3120
  dispose(): void;
3186
- private reset;
3187
- protected toggleControls(state: boolean): void;
3188
- private newTransformControls;
3189
- private initializeControls;
3190
- private createArrowBoundingBox;
3191
- private changeDrag;
3192
- private notifyDraggingChanged;
3193
- private preventCameraMovement;
3194
- private newHelper;
3195
- private static newPlaneMesh;
3196
- }
3197
- import { IfcFragmentSettings } from "../../IfcLoader/src";
3198
- /**
3199
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3200
- */
3201
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3121
+ /** {@link Updateable.update} */
3122
+ update(_delta: number): void;
3202
3123
  /**
3203
- * Amount of properties to be streamed.
3204
- * Defaults to 100 properties.
3124
+ * Updates the aspect of the camera to match the size of the
3125
+ * {@link Components.renderer}.
3205
3126
  */
3206
- propertiesSize: number;
3127
+ updateAspect: () => void;
3128
+ private setupCamera;
3129
+ private newCameraControls;
3130
+ private setupEvents;
3131
+ private static getSubsetOfThree;
3207
3132
  }
3208
3133
  import { NavigationMode } from "./types";
3209
3134
  import { OrthoPerspectiveCamera } from "../index";
@@ -3257,6 +3182,32 @@ export declare class PlanMode implements NavigationMode {
3257
3182
  /** {@link NavigationMode.set} */
3258
3183
  set(active: boolean): void;
3259
3184
  }
3185
+ /**
3186
+ * The projection system of the camera.
3187
+ */
3188
+ export type CameraProjection = "Perspective" | "Orthographic";
3189
+ /**
3190
+ * The extensible list of supported navigation modes.
3191
+ */
3192
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3193
+ /**
3194
+ * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3195
+ */
3196
+ export interface NavigationMode {
3197
+ /** The unique ID of this navigation mode. */
3198
+ id: NavModeID;
3199
+ /**
3200
+ * Enable or disable this navigation mode.
3201
+ * When a new navigation mode is enabled, the previous navigation mode
3202
+ * must be disabled.
3203
+ *
3204
+ * @param active - whether to enable or disable this mode.
3205
+ * @param options - any additional data required to enable or disable it.
3206
+ * */
3207
+ set: (active: boolean, options?: any) => void;
3208
+ /** Whether this navigation mode is active or not. */
3209
+ enabled: boolean;
3210
+ }
3260
3211
  import * as THREE from "three";
3261
3212
  import { CameraProjection } from "./types";
3262
3213
  import { Event } from "../../Types";
@@ -3302,36 +3253,21 @@ export declare class ProjectionManager {
3302
3253
  private getDistance;
3303
3254
  private setPerspectiveCamera;
3304
3255
  }
3256
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3305
3257
  /**
3306
- * The projection system of the camera.
3307
- */
3308
- export type CameraProjection = "Perspective" | "Orthographic";
3309
- /**
3310
- * The extensible list of supported navigation modes.
3311
- */
3312
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3313
- /**
3314
- * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3258
+ * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
3315
3259
  */
3316
- export interface NavigationMode {
3317
- /** The unique ID of this navigation mode. */
3318
- id: NavModeID;
3260
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
3319
3261
  /**
3320
- * Enable or disable this navigation mode.
3321
- * When a new navigation mode is enabled, the previous navigation mode
3322
- * must be disabled.
3323
- *
3324
- * @param active - whether to enable or disable this mode.
3325
- * @param options - any additional data required to enable or disable it.
3326
- * */
3327
- set: (active: boolean, options?: any) => void;
3328
- /** Whether this navigation mode is active or not. */
3329
- enabled: boolean;
3330
- }
3331
- import * as WEBIFC from "web-ifc";
3332
- export declare class IfcMetadataReader {
3333
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3334
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3262
+ * Minimum number of geometries to be streamed.
3263
+ * Defaults to 10 geometries.
3264
+ */
3265
+ minGeometrySize: number;
3266
+ /**
3267
+ * Minimum amount of assets to be streamed.
3268
+ * Defaults to 1000 assets.
3269
+ */
3270
+ minAssetsSize: number;
3335
3271
  }
3336
3272
  import * as THREE from "three";
3337
3273
  import * as WEBIFC from "web-ifc";
@@ -3348,6 +3284,11 @@ export declare class CivilReader {
3348
3284
  } | undefined;
3349
3285
  private getCurves;
3350
3286
  }
3287
+ import * as WEBIFC from "web-ifc";
3288
+ export declare class IfcMetadataReader {
3289
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3290
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3291
+ }
3351
3292
  /**
3352
3293
  * A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
3353
3294
  */
@@ -3377,31 +3318,80 @@ export interface StreamedAsset {
3377
3318
  color: number[];
3378
3319
  }[];
3379
3320
  }
3380
- import { IfcFragmentSettings } from "../../IfcLoader/src";
3321
+ import * as THREE from "three";
3322
+ import { Disposable, Event } from "../../Types";
3381
3323
  /**
3382
- * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
3324
+ * 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.
3383
3325
  */
3384
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
3385
- /**
3386
- * Minimum number of geometries to be streamed.
3387
- * Defaults to 10 geometries.
3388
- */
3389
- minGeometrySize: number;
3326
+ export declare class Mouse implements Disposable {
3327
+ dom: HTMLCanvasElement;
3328
+ private _event?;
3329
+ private _position;
3330
+ /** {@link Disposable.onDisposed} */
3331
+ readonly onDisposed: Event<unknown>;
3332
+ constructor(dom: HTMLCanvasElement);
3390
3333
  /**
3391
- * Minimum amount of assets to be streamed.
3392
- * Defaults to 1000 assets.
3334
+ * The real position of the mouse of the Three.js canvas.
3393
3335
  */
3394
- minAssetsSize: number;
3336
+ get position(): THREE.Vector2;
3337
+ /** {@link Disposable.dispose} */
3338
+ dispose(): void;
3339
+ private getPositionY;
3340
+ private getPositionX;
3341
+ private updateMouseInfo;
3342
+ private setupEvents;
3395
3343
  }
3396
- import * as WEBIFC from "web-ifc";
3397
3344
  import * as THREE from "three";
3398
- export declare class Units {
3399
- factor: number;
3400
- complement: number;
3401
- apply(matrix: THREE.Matrix4): void;
3402
- setUp(webIfc: WEBIFC.IfcAPI): void;
3403
- private getLengthUnits;
3404
- private getScaleMatrix;
3345
+ import { Components } from "../../Components";
3346
+ import { Event, World, Disposable } from "../../Types";
3347
+ import { Mouse } from "./mouse";
3348
+ /**
3349
+ * 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.
3350
+ */
3351
+ export declare class SimpleRaycaster implements Disposable {
3352
+ /** {@link Component.enabled} */
3353
+ enabled: boolean;
3354
+ /** The components instance to which this Raycaster belongs. */
3355
+ components: Components;
3356
+ /** {@link Disposable.onDisposed} */
3357
+ readonly onDisposed: Event<unknown>;
3358
+ /** The position of the mouse in the screen. */
3359
+ readonly mouse: Mouse;
3360
+ /**
3361
+ * A reference to the Three.js Raycaster instance.
3362
+ * This is used for raycasting operations.
3363
+ */
3364
+ readonly three: THREE.Raycaster;
3365
+ /**
3366
+ * A reference to the world instance to which this Raycaster belongs.
3367
+ * This is used to access the camera and meshes.
3368
+ */
3369
+ world: World;
3370
+ constructor(components: Components, world: World);
3371
+ /** {@link Disposable.dispose} */
3372
+ dispose(): void;
3373
+ /**
3374
+ * Throws a ray from the camera to the mouse or touch event point and returns
3375
+ * the first item found. This also takes into account the clipping planes
3376
+ * used by the renderer.
3377
+ *
3378
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
3379
+ * to query. If not provided, it will query all the meshes stored in
3380
+ * {@link Components.meshes}.
3381
+ */
3382
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
3383
+ /**
3384
+ * Casts a ray from a given origin in a given direction and returns the first item found.
3385
+ * This method also takes into account the clipping planes used by the renderer.
3386
+ *
3387
+ * @param origin - The origin of the ray.
3388
+ * @param direction - The direction of the ray.
3389
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3390
+ * @returns The first intersection found or 'null' if no intersection was found.
3391
+ */
3392
+ 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;
3393
+ private intersect;
3394
+ private filterClippingPlanes;
3405
3395
  }
3406
3396
  export type RelationsMap = Map<number, Map<number, number[]>>;
3407
3397
  export interface ModelsRelationMap {
@@ -3427,6 +3417,16 @@ export type InverseAttributes = [
3427
3417
  "ContainsElements"
3428
3418
  ];
3429
3419
  export type InverseAttribute = InverseAttributes[number];
3420
+ import * as WEBIFC from "web-ifc";
3421
+ import * as THREE from "three";
3422
+ export declare class Units {
3423
+ factor: number;
3424
+ complement: number;
3425
+ apply(matrix: THREE.Matrix4): void;
3426
+ setUp(webIfc: WEBIFC.IfcAPI): void;
3427
+ private getLengthUnits;
3428
+ private getScaleMatrix;
3429
+ }
3430
3430
  import { BufferGeometry } from "three";
3431
3431
  import * as THREE from "three";
3432
3432
  export declare class TransformHelper {