@thatopen/components 2.1.6 → 2.1.8

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,91 +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
- import { Component, Disposable, World, Event } from "../Types";
48
- import { SimpleRaycaster } from "./src";
49
- import { Components } from "../Components";
50
- /**
51
- * 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).
52
- */
53
- export declare class Raycasters extends Component implements Disposable {
54
- /**
55
- * A unique identifier for the component.
56
- * This UUID is used to register the component within the Components system.
57
- */
58
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
59
- /** {@link Component.enabled} */
60
- enabled: boolean;
61
- /**
62
- * A Map that stores raycasters for each world.
63
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
64
- */
65
- list: Map<string, SimpleRaycaster>;
66
- /** {@link Disposable.onDisposed} */
67
- onDisposed: Event<unknown>;
68
- constructor(components: Components);
69
- /**
70
- * Retrieves a SimpleRaycaster instance for the given world.
71
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
72
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
73
- *
74
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
75
- * @returns The SimpleRaycaster instance for the given world.
76
- */
77
- get(world: World): SimpleRaycaster;
78
- /**
79
- * Deletes the SimpleRaycaster instance associated with the given world.
80
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
81
- *
82
- * @param world - The world for which to delete the SimpleRaycaster instance.
83
- * @returns {void}
84
- */
85
- delete(world: World): void;
86
- /** {@link Disposable.dispose} */
87
- dispose(): void;
88
- }
89
2
  import { Component, Disposable, Event } from "../Types";
90
3
  /**
91
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.
@@ -94,7 +7,7 @@ export declare class Components implements Disposable {
94
7
  /**
95
8
  * The version of the @thatopen/components library.
96
9
  */
97
- static readonly release = "2.1.6";
10
+ static readonly release = "2.1.8";
98
11
  /** {@link Disposable.onDisposed} */
99
12
  readonly onDisposed: Event<void>;
100
13
  /**
@@ -162,50 +75,88 @@ export declare class Components implements Disposable {
162
75
  private update;
163
76
  private static setupBVH;
164
77
  }
165
- import { Component, Disposable, World, Event } from "../Types";
166
- import { GridConfig, SimpleGrid } from "./src";
78
+ import * as THREE from "three";
167
79
  import { Components } from "../Components";
80
+ import { Component } from "../Types";
168
81
  /**
169
- * 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).
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).
170
83
  */
171
- export declare class Grids extends Component implements Disposable {
84
+ export declare class Disposer extends Component {
85
+ private _disposedComponents;
86
+ /** {@link Component.enabled} */
87
+ enabled: boolean;
172
88
  /**
173
89
  * A unique identifier for the component.
174
90
  * This UUID is used to register the component within the Components system.
175
91
  */
176
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
92
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
93
+ constructor(components: Components);
177
94
  /**
178
- * A map of world UUIDs to their corresponding grid instances.
95
+ * Return the UUIDs of all disposed components.
179
96
  */
180
- list: Map<string, SimpleGrid>;
97
+ get(): Set<string>;
181
98
  /**
182
- * The default configuration for grid creation.
99
+ * Removes a mesh, its geometry and its materials from memory. If you are
100
+ * using any of these in other parts of the application, make sure that you
101
+ * remove them from the mesh before disposing it.
102
+ *
103
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
104
+ * to remove.
105
+ *
106
+ * @param materials - whether to dispose the materials of the mesh.
107
+ *
108
+ * @param recursive - whether to recursively dispose the children of the mesh.
183
109
  */
184
- config: Required<GridConfig>;
185
- /** {@link Disposable.onDisposed} */
186
- readonly onDisposed: Event<unknown>;
110
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
111
+ /**
112
+ * Disposes a geometry from memory.
113
+ *
114
+ * @param geometry - the
115
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
116
+ * to remove.
117
+ */
118
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
119
+ private disposeGeometryAndMaterials;
120
+ private disposeChildren;
121
+ private static disposeMaterial;
122
+ }
123
+ import { Component, Disposable, World, Event } from "../Types";
124
+ import { SimpleRaycaster } from "./src";
125
+ import { Components } from "../Components";
126
+ /**
127
+ * A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
128
+ */
129
+ export declare class Raycasters extends Component implements Disposable {
130
+ /**
131
+ * A unique identifier for the component.
132
+ * This UUID is used to register the component within the Components system.
133
+ */
134
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
187
135
  /** {@link Component.enabled} */
188
136
  enabled: boolean;
137
+ /**
138
+ * A Map that stores raycasters for each world.
139
+ * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
140
+ */
141
+ list: Map<string, SimpleRaycaster>;
142
+ /** {@link Disposable.onDisposed} */
143
+ onDisposed: Event<unknown>;
189
144
  constructor(components: Components);
190
145
  /**
191
- * Creates a new grid for the given world.
192
- * Throws an error if a grid already exists for the world.
193
- *
194
- * @param world - The world to create the grid for.
195
- * @returns The newly created grid.
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.
196
149
  *
197
- * @throws Will throw an error if a grid already exists for the given world.
150
+ * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
151
+ * @returns The SimpleRaycaster instance for the given world.
198
152
  */
199
- create(world: World): SimpleGrid;
153
+ get(world: World): SimpleRaycaster;
200
154
  /**
201
- * Deletes the grid associated with the given world.
202
- * If a grid does not exist for the given world, this method does nothing.
203
- *
204
- * @param world - The world for which to delete the grid.
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.
205
157
  *
206
- * @remarks
207
- * This method will dispose of the grid and remove it from the internal list.
208
- * If the world is disposed before calling this method, the grid will be automatically deleted.
158
+ * @param world - The world for which to delete the SimpleRaycaster instance.
159
+ * @returns {void}
209
160
  */
210
161
  delete(world: World): void;
211
162
  /** {@link Disposable.dispose} */
@@ -278,6 +229,55 @@ export declare class Worlds extends Component implements Updateable, Disposable
278
229
  /** {@link Updateable.update} */
279
230
  update(delta?: number): void | Promise<void>;
280
231
  }
232
+ import { Component, Disposable, World, Event } from "../Types";
233
+ import { GridConfig, SimpleGrid } from "./src";
234
+ import { Components } from "../Components";
235
+ /**
236
+ * A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
237
+ */
238
+ export declare class Grids extends Component implements Disposable {
239
+ /**
240
+ * A unique identifier for the component.
241
+ * This UUID is used to register the component within the Components system.
242
+ */
243
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
244
+ /**
245
+ * A map of world UUIDs to their corresponding grid instances.
246
+ */
247
+ list: Map<string, SimpleGrid>;
248
+ /**
249
+ * The default configuration for grid creation.
250
+ */
251
+ config: Required<GridConfig>;
252
+ /** {@link Disposable.onDisposed} */
253
+ readonly onDisposed: Event<unknown>;
254
+ /** {@link Component.enabled} */
255
+ enabled: boolean;
256
+ constructor(components: Components);
257
+ /**
258
+ * Creates a new grid for the given world.
259
+ * Throws an error if a grid already exists for the world.
260
+ *
261
+ * @param world - The world to create the grid for.
262
+ * @returns The newly created grid.
263
+ *
264
+ * @throws Will throw an error if a grid already exists for the given world.
265
+ */
266
+ create(world: World): SimpleGrid;
267
+ /**
268
+ * Deletes the grid associated with the given world.
269
+ * If a grid does not exist for the given world, this method does nothing.
270
+ *
271
+ * @param world - The world for which to delete the grid.
272
+ *
273
+ * @remarks
274
+ * This method will dispose of the grid and remove it from the internal list.
275
+ * If the world is disposed before calling this method, the grid will be automatically deleted.
276
+ */
277
+ delete(world: World): void;
278
+ /** {@link Disposable.dispose} */
279
+ dispose(): void;
280
+ }
281
281
  import * as THREE from "three";
282
282
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
283
283
  import { SimplePlane } from "./src";
@@ -409,100 +409,100 @@ export declare class Clipper extends Component implements Createable, Disposable
409
409
  private _onStartDragging;
410
410
  private _onEndDragging;
411
411
  }
412
- import { MiniMap } from "./src";
413
- import { Component, Updateable, World, Event, Disposable } from "../Types";
414
412
  import { Components } from "../Components";
413
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
414
+ import { Component, Event, Disposable, World } from "../Types";
415
415
  /**
416
- * A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
416
+ * 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).
417
417
  */
418
- export declare class MiniMaps extends Component implements Updateable, Disposable {
418
+ export declare class Cullers extends Component implements Disposable {
419
419
  /**
420
420
  * A unique identifier for the component.
421
421
  * This UUID is used to register the component within the Components system.
422
422
  */
423
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
424
- /** {@link Updateable.onAfterUpdate} */
425
- readonly onAfterUpdate: Event<unknown>;
426
- /** {@link Updateable.onBeforeUpdate} */
427
- readonly onBeforeUpdate: Event<unknown>;
428
- /** {@link Disposable.onDisposed} */
423
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
424
+ /**
425
+ * An event that is triggered when the Cullers component is disposed.
426
+ */
429
427
  readonly onDisposed: Event<unknown>;
430
- /** {@link Component.enabled} */
431
- enabled: boolean;
428
+ private _enabled;
432
429
  /**
433
- * A collection of {@link MiniMap} instances, each associated with a unique world ID.
430
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
434
431
  */
435
- list: Map<string, MiniMap>;
432
+ list: Map<string, MeshCullerRenderer>;
433
+ /** {@link Component.enabled} */
434
+ get enabled(): boolean;
435
+ /** {@link Component.enabled} */
436
+ set enabled(value: boolean);
436
437
  constructor(components: Components);
437
438
  /**
438
- * Creates a new {@link MiniMap} instance associated with the given world.
439
- * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
440
- *
441
- * @param world - The {@link World} for which to create a {@link MiniMap} instance.
442
- * @returns The newly created {@link MiniMap} instance.
443
- * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
439
+ * Creates a new MeshCullerRenderer for the given world.
440
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
441
+ *
442
+ * @param world - The world for which to create the MeshCullerRenderer.
443
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
444
+ *
445
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
444
446
  */
445
- create(world: World): MiniMap;
447
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
446
448
  /**
447
- * Deletes a {@link MiniMap} instance associated with the given world ID.
448
- * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
449
+ * Deletes the MeshCullerRenderer associated with the given world.
450
+ * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
451
+ *
452
+ * @param world - The world for which to delete the MeshCullerRenderer.
449
453
  *
450
- * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
451
454
  * @returns {void}
452
455
  */
453
- delete(id: string): void;
456
+ delete(world: World): void;
454
457
  /** {@link Disposable.dispose} */
455
458
  dispose(): void;
456
- /** {@link Updateable.update} */
457
- update(): void;
458
459
  }
460
+ import { MiniMap } from "./src";
461
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
459
462
  import { Components } from "../Components";
460
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
461
- import { Component, Event, Disposable, World } from "../Types";
462
463
  /**
463
- * A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
464
+ * A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
464
465
  */
465
- export declare class Cullers extends Component implements Disposable {
466
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
466
467
  /**
467
468
  * A unique identifier for the component.
468
469
  * This UUID is used to register the component within the Components system.
469
470
  */
470
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
471
- /**
472
- * An event that is triggered when the Cullers component is disposed.
473
- */
471
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
472
+ /** {@link Updateable.onAfterUpdate} */
473
+ readonly onAfterUpdate: Event<unknown>;
474
+ /** {@link Updateable.onBeforeUpdate} */
475
+ readonly onBeforeUpdate: Event<unknown>;
476
+ /** {@link Disposable.onDisposed} */
474
477
  readonly onDisposed: Event<unknown>;
475
- private _enabled;
478
+ /** {@link Component.enabled} */
479
+ enabled: boolean;
476
480
  /**
477
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
481
+ * A collection of {@link MiniMap} instances, each associated with a unique world ID.
478
482
  */
479
- list: Map<string, MeshCullerRenderer>;
480
- /** {@link Component.enabled} */
481
- get enabled(): boolean;
482
- /** {@link Component.enabled} */
483
- set enabled(value: boolean);
483
+ list: Map<string, MiniMap>;
484
484
  constructor(components: Components);
485
485
  /**
486
- * Creates a new MeshCullerRenderer for the given world.
487
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
488
- *
489
- * @param world - The world for which to create the MeshCullerRenderer.
490
- * @param config - Optional configuration settings for the MeshCullerRenderer.
486
+ * Creates a new {@link MiniMap} instance associated with the given world.
487
+ * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
491
488
  *
492
- * @returns The newly created or existing MeshCullerRenderer for the given world.
489
+ * @param world - The {@link World} for which to create a {@link MiniMap} instance.
490
+ * @returns The newly created {@link MiniMap} instance.
491
+ * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
493
492
  */
494
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
493
+ create(world: World): MiniMap;
495
494
  /**
496
- * Deletes the MeshCullerRenderer associated with the given world.
497
- * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
498
- *
499
- * @param world - The world for which to delete the MeshCullerRenderer.
495
+ * Deletes a {@link MiniMap} instance associated with the given world ID.
496
+ * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
500
497
  *
498
+ * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
501
499
  * @returns {void}
502
500
  */
503
- delete(world: World): void;
501
+ delete(id: string): void;
504
502
  /** {@link Disposable.dispose} */
505
503
  dispose(): void;
504
+ /** {@link Updateable.update} */
505
+ update(): void;
506
506
  }
507
507
  import * as THREE from "three";
508
508
  import { Components } from "../Components";
@@ -568,308 +568,120 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
568
568
  private newOrthoCamera;
569
569
  private setOrthoPerspCameraAspect;
570
570
  }
571
- import * as WEBIFC from "web-ifc";
572
- import * as FRAG from "@thatopen/fragments";
573
- import { Component, Components } from "../../core";
571
+ import * as THREE from "three";
572
+ import * as FRAGS from "@thatopen/fragments";
573
+ import { FragmentsGroup } from "@thatopen/fragments";
574
+ import { Component, Components, Disposable, Event } from "../../core";
574
575
  /**
575
- * 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).
576
+ * 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).
576
577
  */
577
- export declare class IfcJsonExporter extends Component {
578
- /**
579
- * A unique identifier for the component.
580
- * This UUID is used to register the component within the Components system.
581
- */
582
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
578
+ export declare class BoundingBoxer extends Component implements Disposable {
579
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
583
580
  /** {@link Component.enabled} */
584
581
  enabled: boolean;
585
- constructor(components: Components);
586
- /**
587
- * Exports all the properties of an IFC into an array of JS objects.
588
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
589
- * @param modelID ID of the IFC model whose properties to extract.
590
- * @param indirect whether to get the indirect relationships as well.
591
- * @param recursiveSpatial whether to get the properties of spatial items recursively
592
- * to make the location data available (e.g. absolute position of building).
593
- */
594
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
595
- }
596
- import * as WEBIFC from "web-ifc";
597
- import { FragmentsGroup } from "@thatopen/fragments";
598
- import { Disposable, Event, Component, Components } from "../../core";
599
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
600
- export type { InverseAttribute, RelationsMap } from "./src/types";
601
- /**
602
- * 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).
603
- */
604
- export declare class IfcRelationsIndexer extends Component implements Disposable {
605
- /**
606
- * A unique identifier for the component.
607
- * This UUID is used to register the component within the Components system.
608
- */
609
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
610
582
  /** {@link Disposable.onDisposed} */
611
- readonly onDisposed: Event<string>;
583
+ readonly onDisposed: Event<unknown>;
584
+ private _absoluteMin;
585
+ private _absoluteMax;
586
+ private _meshes;
587
+ constructor(components: Components);
612
588
  /**
613
- * Event triggered when relations for a model have been indexed.
614
- * This event provides the model's UUID and the relations map generated for that model.
589
+ * A static method to calculate the dimensions of a given bounding box.
615
590
  *
616
- * @property {string} modelID - The UUID of the model for which relations have been indexed.
617
- * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
618
- * 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.
591
+ * @param bbox - The bounding box to calculate the dimensions for.
592
+ * @returns An object containing the width, height, depth, and center of the bounding box.
619
593
  */
620
- readonly onRelationsIndexed: Event<{
621
- modelID: string;
622
- relationsMap: RelationsMap;
623
- }>;
594
+ static getDimensions(bbox: THREE.Box3): {
595
+ width: number;
596
+ height: number;
597
+ depth: number;
598
+ center: THREE.Vector3;
599
+ };
624
600
  /**
625
- * Holds the relationship mappings for each model processed by the indexer.
626
- * The structure is a map where each key is a model's UUID, and the value is another map.
627
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
628
- * representing a specific relation type, and the value is an array of expressIDs of entities
629
- * that are related through that relation type. This structure allows for efficient querying
630
- * of entity relationships within a model.
601
+ * A static method to create a new bounding box boundary.
602
+ *
603
+ * @param positive - A boolean indicating whether to create a boundary for positive or negative values.
604
+ * @returns A new THREE.Vector3 representing the boundary.
605
+ *
606
+ * @remarks
607
+ * This method is used to create a new boundary for calculating bounding boxes.
608
+ * It sets the x, y, and z components of the returned vector to positive or negative infinity,
609
+ * depending on the value of the 'positive' parameter.
610
+ *
611
+ * @example
612
+ * '''typescript
613
+ * const positiveBound = BoundingBoxer.newBound(true);
614
+ * console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
615
+ *
616
+ * const negativeBound = BoundingBoxer.newBound(false);
617
+ * console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
618
+ * '''
631
619
  */
632
- readonly relationMaps: ModelsRelationMap;
633
- /** {@link Component.enabled} */
634
- enabled: boolean;
635
- private _relToAttributesMap;
636
- private _inverseAttributes;
637
- private _ifcRels;
638
- constructor(components: Components);
639
- private onFragmentsDisposed;
640
- private indexRelations;
641
- private getAttributeIndex;
620
+ static newBound(positive: boolean): THREE.Vector3;
642
621
  /**
643
- * Adds a relation map to the model's relations map.
622
+ * A static method to calculate the bounding box of a set of points.
644
623
  *
645
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
646
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
624
+ * @param points - An array of THREE.Vector3 representing the points.
625
+ * @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
626
+ * @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
627
+ * @returns A THREE.Box3 representing the bounding box of the given points.
647
628
  *
648
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
629
+ * @remarks
630
+ * This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
631
+ * If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
632
+ *
633
+ * @example
634
+ * '''typescript
635
+ * const points = [
636
+ * new THREE.Vector3(1, 2, 3),
637
+ * new THREE.Vector3(4, 5, 6),
638
+ * new THREE.Vector3(7, 8, 9),
639
+ * ];
640
+ *
641
+ * const bbox = BoundingBoxer.getBounds(points);
642
+ * console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
643
+ * '''
649
644
  */
650
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
645
+ static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
646
+ /** {@link Disposable.dispose} */
647
+ dispose(): void;
651
648
  /**
652
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
653
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
654
- * and maps them in a structured way to facilitate quick access to related entities.
649
+ * Returns the bounding box of the calculated fragments.
655
650
  *
656
- * The process involves querying the model for each relation type associated with the inverse attributes
657
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
658
- * and contains a nested map where each key is an entity's expressID and its value is another map.
659
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
660
- * of entities that are related through that attribute.
651
+ * @returns A new THREE.Box3 instance representing the bounding box.
661
652
  *
662
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
663
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
664
- * representation of the relations indexed by entity expressIDs and relation types.
665
- * @throws An error if the model does not have properties loaded.
653
+ * @remarks
654
+ * This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
655
+ * The returned box represents the bounding box of the calculated fragments.
656
+ *
657
+ * @example
658
+ * '''typescript
659
+ * const boundingBox = boundingBoxer.get();
660
+ * console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
661
+ * '''
666
662
  */
667
- process(model: FragmentsGroup): Promise<RelationsMap>;
663
+ get(): THREE.Box3;
668
664
  /**
669
- * Processes a given model from a WebIfc API to index its IFC entities relations.
665
+ * Calculates and returns a sphere that encompasses the entire bounding box.
670
666
  *
671
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
672
- * @param modelID - The unique identifier of the model within the WebIfc API.
673
- * @returns A promise that resolves to the relations map for the processed model.
674
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
667
+ * @returns A new THREE.Sphere instance representing the calculated sphere.
668
+ *
669
+ * @remarks
670
+ * This method calculates the center and radius of a sphere that encompasses the entire bounding box.
671
+ * The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
672
+ * The radius is calculated as the distance from the center to the minimum bound.
673
+ *
674
+ * @example
675
+ * '''typescript
676
+ * const boundingBoxer = components.get(BoundingBoxer);
677
+ * boundingBoxer.add(fragmentsGroup);
678
+ * const boundingSphere = boundingBoxer.getSphere();
679
+ * console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
680
+ * '''
675
681
  */
676
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
682
+ getSphere(): THREE.Sphere;
677
683
  /**
678
- * Retrieves the relations of a specific entity within a model based on the given relation name.
679
- * This method searches the indexed relation maps for the specified model and entity,
680
- * returning the IDs of related entities if a match is found.
681
- *
682
- * @param model The 'FragmentsGroup' model containing the entity.
683
- * @param expressID The unique identifier of the entity within the model.
684
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
685
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
686
- * or the specified relation name is not indexed.
687
- */
688
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
689
- /**
690
- * Serializes the relations of a given relation map into a JSON string.
691
- * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
692
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
693
- * The resulting object is then serialized into a JSON string.
694
- *
695
- * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
696
- * @returns A JSON string representing the serialized relations of the given relation map.
697
- */
698
- serializeRelations(relationMap: RelationsMap): string;
699
- /**
700
- * Serializes the relations of a specific model into a JSON string.
701
- * This method iterates through the relations indexed for the given model,
702
- * organizing them into a structured object where each key is an expressID of an entity,
703
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
704
- * The resulting object is then serialized into a JSON string.
705
- *
706
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
707
- * @returns A JSON string representing the serialized relations of the specified model.
708
- * If the model has no indexed relations, 'null' is returned.
709
- */
710
- serializeModelRelations(model: FragmentsGroup): string | null;
711
- /**
712
- * Serializes all relations of every model processed by the indexer into a JSON string.
713
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
714
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
715
- * and its value is another object mapping entity expressIDs to their related entities, categorized
716
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
717
- *
718
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
719
- * If no relations have been indexed, an empty object is returned as a JSON string.
720
- */
721
- serializeAllRelations(): string;
722
- /**
723
- * Converts a JSON string representing relations between entities into a structured map.
724
- * This method parses the JSON string to reconstruct the relations map that indexes
725
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
726
- * and the values are maps where each key is a relation type ID and its value is an array
727
- * of express IDs of entities related through that relation type.
728
- *
729
- * @param json The JSON string to be parsed into the relations map.
730
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
731
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
732
- * is an array of express IDs (as numbers) of entities related through that relation type.
733
- */
734
- getRelationsMapFromJSON(json: string): RelationsMap;
735
- /** {@link Disposable.dispose} */
736
- dispose(): void;
737
- /**
738
- * Adds relations between an entity and other entities in a BIM model.
739
- *
740
- * @param model - The BIM model to which the relations will be added.
741
- * @param expressID - The expressID of the entity within the model.
742
- * @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
743
- * @param relIDs - The expressIDs of the related entities within the model.
744
- *
745
- * @throws An error if the relation name is not a valid relation name.
746
- */
747
- addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
748
- /**
749
- * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
750
- *
751
- * @param model The BIM model whose children to get.
752
- * @param expressID The expressID of the item whose children to get.
753
- * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
754
- *
755
- * @returns A 'Set' with the expressIDs of the found items.
756
- */
757
- getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
758
- }
759
- import * as THREE from "three";
760
- import * as FRAGS from "@thatopen/fragments";
761
- import { FragmentsGroup } from "@thatopen/fragments";
762
- import { Component, Components, Disposable, Event } from "../../core";
763
- /**
764
- * 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).
765
- */
766
- export declare class BoundingBoxer extends Component implements Disposable {
767
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
768
- /** {@link Component.enabled} */
769
- enabled: boolean;
770
- /** {@link Disposable.onDisposed} */
771
- readonly onDisposed: Event<unknown>;
772
- private _absoluteMin;
773
- private _absoluteMax;
774
- private _meshes;
775
- constructor(components: Components);
776
- /**
777
- * A static method to calculate the dimensions of a given bounding box.
778
- *
779
- * @param bbox - The bounding box to calculate the dimensions for.
780
- * @returns An object containing the width, height, depth, and center of the bounding box.
781
- */
782
- static getDimensions(bbox: THREE.Box3): {
783
- width: number;
784
- height: number;
785
- depth: number;
786
- center: THREE.Vector3;
787
- };
788
- /**
789
- * A static method to create a new bounding box boundary.
790
- *
791
- * @param positive - A boolean indicating whether to create a boundary for positive or negative values.
792
- * @returns A new THREE.Vector3 representing the boundary.
793
- *
794
- * @remarks
795
- * This method is used to create a new boundary for calculating bounding boxes.
796
- * It sets the x, y, and z components of the returned vector to positive or negative infinity,
797
- * depending on the value of the 'positive' parameter.
798
- *
799
- * @example
800
- * '''typescript
801
- * const positiveBound = BoundingBoxer.newBound(true);
802
- * console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
803
- *
804
- * const negativeBound = BoundingBoxer.newBound(false);
805
- * console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
806
- * '''
807
- */
808
- static newBound(positive: boolean): THREE.Vector3;
809
- /**
810
- * A static method to calculate the bounding box of a set of points.
811
- *
812
- * @param points - An array of THREE.Vector3 representing the points.
813
- * @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
814
- * @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
815
- * @returns A THREE.Box3 representing the bounding box of the given points.
816
- *
817
- * @remarks
818
- * This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
819
- * If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
820
- *
821
- * @example
822
- * '''typescript
823
- * const points = [
824
- * new THREE.Vector3(1, 2, 3),
825
- * new THREE.Vector3(4, 5, 6),
826
- * new THREE.Vector3(7, 8, 9),
827
- * ];
828
- *
829
- * const bbox = BoundingBoxer.getBounds(points);
830
- * console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
831
- * '''
832
- */
833
- static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
834
- /** {@link Disposable.dispose} */
835
- dispose(): void;
836
- /**
837
- * Returns the bounding box of the calculated fragments.
838
- *
839
- * @returns A new THREE.Box3 instance representing the bounding box.
840
- *
841
- * @remarks
842
- * This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
843
- * The returned box represents the bounding box of the calculated fragments.
844
- *
845
- * @example
846
- * '''typescript
847
- * const boundingBox = boundingBoxer.get();
848
- * console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
849
- * '''
850
- */
851
- get(): THREE.Box3;
852
- /**
853
- * Calculates and returns a sphere that encompasses the entire bounding box.
854
- *
855
- * @returns A new THREE.Sphere instance representing the calculated sphere.
856
- *
857
- * @remarks
858
- * This method calculates the center and radius of a sphere that encompasses the entire bounding box.
859
- * The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
860
- * The radius is calculated as the distance from the center to the minimum bound.
861
- *
862
- * @example
863
- * '''typescript
864
- * const boundingBoxer = components.get(BoundingBoxer);
865
- * boundingBoxer.add(fragmentsGroup);
866
- * const boundingSphere = boundingBoxer.getSphere();
867
- * console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
868
- * '''
869
- */
870
- getSphere(): THREE.Sphere;
871
- /**
872
- * Returns a THREE.Mesh instance representing the bounding box.
684
+ * Returns a THREE.Mesh instance representing the bounding box.
873
685
  *
874
686
  * @returns A new THREE.Mesh instance representing the bounding box.
875
687
  *
@@ -964,261 +776,176 @@ export declare class BoundingBoxer extends Component implements Disposable {
964
776
  addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
965
777
  private static getFragmentBounds;
966
778
  }
967
- import * as WEBIFC from "web-ifc";
968
- import { FragmentsGroup } from "@thatopen/fragments";
969
- import { Component, Disposable, Event, Components } from "../../core";
970
- /**
971
- * Types for boolean properties in IFC schema.
972
- */
973
- export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
974
- /**
975
- * Types for string properties in IFC schema.
976
- */
977
- export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
978
- /**
979
- * Types for numeric properties in IFC schema.
980
- */
981
- export type NumericPropTypes = "IfcInteger" | "IfcReal";
982
- /**
983
- * Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
984
- */
985
- export interface ChangeMap {
986
- [modelID: string]: Set<number>;
987
- }
779
+ import * as THREE from "three";
780
+ import * as FRAGS from "@thatopen/fragments";
781
+ import { Disposable, Component, Event, Components } from "../../core";
988
782
  /**
989
- * Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
783
+ * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
990
784
  */
991
- export interface AttributeListener {
992
- [modelID: string]: {
993
- [expressID: number]: {
994
- [attributeName: string]: Event<String | Boolean | Number>;
785
+ export interface Classification {
786
+ /**
787
+ * A system within the classification.
788
+ * The key is the system name, and the value is an object representing the classes within the system.
789
+ */
790
+ [system: string]: {
791
+ /**
792
+ * A class within the system.
793
+ * The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
794
+ */
795
+ [className: string]: {
796
+ map: FRAGS.FragmentIdMap;
797
+ name: string;
798
+ id: number | null;
995
799
  };
996
800
  };
997
801
  }
998
802
  /**
999
- * Component to manage and edit properties and Psets in IFC files.
803
+ * The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
1000
804
  */
1001
- export declare class IfcPropertiesManager extends Component implements Disposable {
805
+ export declare class Classifier extends Component implements Disposable {
1002
806
  /**
1003
807
  * A unique identifier for the component.
1004
808
  * This UUID is used to register the component within the Components system.
1005
809
  */
1006
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
1007
- /** {@link Disposable.onDisposed} */
1008
- readonly onDisposed: Event<string>;
1009
- /**
1010
- * Event triggered when a file is requested for export.
1011
- */
1012
- readonly onRequestFile: Event<unknown>;
810
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
811
+ /** {@link Component.enabled} */
812
+ enabled: boolean;
1013
813
  /**
1014
- * ArrayBuffer containing the IFC data to be exported.
814
+ * A map representing the classification systems.
815
+ * The key is the system name, and the value is an object representing the classes within the system.
1015
816
  */
1016
- ifcToExport: ArrayBuffer | null;
1017
- /**
1018
- * Event triggered when an element is added to a Pset.
1019
- */
1020
- readonly onElementToPset: Event<{
1021
- model: FragmentsGroup;
1022
- psetID: number;
1023
- elementID: number;
1024
- }>;
1025
- /**
1026
- * Event triggered when a property is added to a Pset.
1027
- */
1028
- readonly onPropToPset: Event<{
1029
- model: FragmentsGroup;
1030
- psetID: number;
1031
- propID: number;
1032
- }>;
1033
- /**
1034
- * Event triggered when a Pset is removed.
1035
- */
1036
- readonly onPsetRemoved: Event<{
1037
- model: FragmentsGroup;
1038
- psetID: number;
1039
- }>;
1040
- /**
1041
- * Event triggered when data in the model changes.
1042
- */
1043
- readonly onDataChanged: Event<{
1044
- model: FragmentsGroup;
1045
- expressID: number;
1046
- }>;
1047
- /**
1048
- * Configuration for the WebAssembly module.
1049
- */
1050
- wasm: {
1051
- path: string;
1052
- absolute: boolean;
1053
- };
1054
- /** {@link Component.enabled} */
1055
- enabled: boolean;
1056
- /**
1057
- * Map of attribute listeners.
1058
- */
1059
- attributeListeners: AttributeListener;
1060
- /**
1061
- * The currently selected model.
1062
- */
1063
- selectedModel?: FragmentsGroup;
1064
- /**
1065
- * Map of changed entities in the model.
1066
- */
1067
- changeMap: ChangeMap;
817
+ list: Classification;
818
+ /** {@link Disposable.onDisposed} */
819
+ readonly onDisposed: Event<unknown>;
1068
820
  constructor(components: Components);
821
+ private onFragmentsDisposed;
1069
822
  /** {@link Disposable.dispose} */
1070
823
  dispose(): void;
1071
824
  /**
1072
- * Static method to retrieve the IFC schema from a given model.
1073
- *
1074
- * @param model - The FragmentsGroup model from which to retrieve the IFC schema.
1075
- * @throws Will throw an error if the IFC schema is not found in the model.
1076
- * @returns The IFC schema associated with the given model.
1077
- */
1078
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
1079
- /**
1080
- * Method to set properties data in the model.
1081
- *
1082
- * @param model - The FragmentsGroup model in which to set the properties.
1083
- * @param dataToSave - An array of objects representing the properties to be saved.
1084
- * Each object must have an 'expressID' property, which is the express ID of the entity in the model.
1085
- * The rest of the properties will be set as the properties of the entity.
1086
- *
1087
- * @returns A promise that resolves when all the properties have been set.
1088
- *
1089
- * @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
1090
- */
1091
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
1092
- /**
1093
- * Creates a new Property Set (Pset) in the given model.
1094
- *
1095
- * @param model - The FragmentsGroup model in which to create the Pset.
1096
- * @param name - The name of the Pset.
1097
- * @param description - (Optional) The description of the Pset.
1098
- *
1099
- * @returns A promise that resolves with an object containing the newly created Pset and its relation.
825
+ * Removes a fragment from the classification based on its unique identifier (guid).
826
+ * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
1100
827
  *
1101
- * @throws Will throw an error if the IFC schema is not found in the model.
1102
- * @throws Will throw an error if no OwnerHistory is found in the model.
828
+ * @param guid - The unique identifier of the fragment to be removed.
1103
829
  */
1104
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
1105
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
1106
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
1107
- }>;
830
+ remove(guid: string): void;
1108
831
  /**
1109
- * Removes a Property Set (Pset) from the given model.
832
+ * Finds and returns fragments based on the provided filter criteria.
833
+ * If no filter is provided, it returns all fragments.
1110
834
  *
1111
- * @param model - The FragmentsGroup model from which to remove the Pset.
1112
- * @param psetID - The express IDs of the Psets to be removed.
835
+ * @param filter - An optional object containing filter criteria.
836
+ * The keys of the object represent the classification system names,
837
+ * and the values are arrays of class names to match.
1113
838
  *
1114
- * @returns A promise that resolves when all the Psets have been removed.
839
+ * @returns A map of fragment GUIDs to their respective express IDs,
840
+ * where the express IDs are filtered based on the provided filter criteria.
1115
841
  *
1116
- * @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
1117
- * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1118
- * @throws Will throw an error if no relation is found between the Pset and the model.
842
+ * @throws Will throw an error if the fragments map is malformed.
1119
843
  */
1120
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
844
+ find(filter?: {
845
+ [name: string]: string[];
846
+ }): FRAGS.FragmentIdMap;
1121
847
  /**
1122
- * Creates a new single-value property of type string in the given model.
848
+ * Classifies fragments based on their modelID.
1123
849
  *
1124
- * @param model - The FragmentsGroup model in which to create the property.
1125
- * @param type - The type of the property value. Must be a string property type.
1126
- * @param name - The name of the property.
1127
- * @param value - The value of the property. Must be a string.
850
+ * @param modelID - The unique identifier of the model to classify fragments by.
851
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1128
852
  *
1129
- * @returns The newly created single-value property.
853
+ * @remarks
854
+ * This method iterates through the fragments in the provided group,
855
+ * and classifies them based on their modelID.
856
+ * The classification is stored in the 'list.models' property,
857
+ * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
1130
858
  *
1131
- * @throws Will throw an error if the IFC schema is not found in the model.
1132
- * @throws Will throw an error if no OwnerHistory is found in the model.
1133
859
  */
1134
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
860
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
1135
861
  /**
1136
- * Creates a new single-value property of type numeric in the given model.
862
+ * Classifies fragments based on their PredefinedType property.
1137
863
  *
1138
- * @param model - The FragmentsGroup model in which to create the property.
1139
- * @param type - The type of the property value. Must be a numeric property type.
1140
- * @param name - The name of the property.
1141
- * @param value - The value of the property. Must be a number.
864
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1142
865
  *
1143
- * @returns The newly created single-value property.
866
+ * @remarks
867
+ * This method iterates through the properties of the fragments in the provided group,
868
+ * and classifies them based on their PredefinedType property.
869
+ * The classification is stored in the 'list.predefinedTypes' property,
870
+ * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
1144
871
  *
1145
- * @throws Will throw an error if the IFC schema is not found in the model.
1146
- * @throws Will throw an error if no OwnerHistory is found in the model.
872
+ * @throws Will throw an error if the fragment ID is not found.
1147
873
  */
1148
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
874
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
1149
875
  /**
1150
- * Creates a new single-value property of type boolean in the given model.
876
+ * Classifies fragments based on their entity type.
1151
877
  *
1152
- * @param model - The FragmentsGroup model in which to create the property.
1153
- * @param type - The type of the property value. Must be a boolean property type.
1154
- * @param name - The name of the property.
1155
- * @param value - The value of the property. Must be a boolean.
878
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1156
879
  *
1157
- * @returns The newly created single-value property.
880
+ * @remarks
881
+ * This method iterates through the relations of the fragments in the provided group,
882
+ * and classifies them based on their entity type.
883
+ * The classification is stored in the 'list.entities' property,
884
+ * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
1158
885
  *
1159
- * @throws Will throw an error if the IFC schema is not found in the model.
1160
- * @throws Will throw an error if no OwnerHistory is found in the model.
886
+ * @throws Will throw an error if the fragment ID is not found.
1161
887
  */
1162
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
888
+ byEntity(group: FRAGS.FragmentsGroup): void;
1163
889
  /**
1164
- * Removes a property from a Property Set (Pset) in the given model.
890
+ * Classifies fragments based on a specific IFC relationship.
1165
891
  *
1166
- * @param model - The FragmentsGroup model from which to remove the property.
1167
- * @param psetID - The express ID of the Pset from which to remove the property.
1168
- * @param propID - The express ID of the property to be removed.
892
+ * @param group - The FragmentsGroup containing the fragments to be classified.
893
+ * @param ifcRel - The IFC relationship number to classify fragments by.
894
+ * @param systemName - The name of the classification system to store the classification.
1169
895
  *
1170
- * @returns A promise that resolves when the property has been removed.
896
+ * @remarks
897
+ * This method iterates through the relations of the fragments in the provided group,
898
+ * and classifies them based on the specified IFC relationship.
899
+ * The classification is stored in the 'list' property under the specified system name,
900
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1171
901
  *
1172
- * @throws Will throw an error if the Pset or the property to be removed are not found in the model.
1173
- * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
902
+ * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
1174
903
  */
1175
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
1176
- addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
904
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
1177
905
  /**
1178
- * Adds elements to a Property Set (Pset) in the given model.
906
+ * Classifies fragments based on their spatial structure in the IFC model.
1179
907
  *
1180
- * @param model - The FragmentsGroup model in which to add the elements.
1181
- * @param psetID - The express ID of the Pset to which to add the elements.
1182
- * @param elementID - The express IDs of the elements to be added.
908
+ * @param model - The FragmentsGroup containing the fragments to be classified.
909
+ * @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
1183
910
  *
1184
- * @returns A promise that resolves when all the elements have been added.
911
+ * @remarks
912
+ * This method iterates through the relations of the fragments in the provided group,
913
+ * and classifies them based on their spatial structure in the IFC model.
914
+ * The classification is stored in the 'list' property under the system name "spatialStructures",
915
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1185
916
  *
1186
- * @throws Will throw an error if the Pset or the elements to be added are not found in the model.
1187
- * @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
1188
- * @throws Will throw an error if no relation is found between the Pset and the model.
917
+ * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
1189
918
  */
1190
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
919
+ bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
920
+ useProperties: boolean;
921
+ }): Promise<void>;
1191
922
  /**
1192
- * Saves the changes made to the model to a new IFC file.
923
+ * Sets the color of the specified fragments.
1193
924
  *
1194
- * @param model - The FragmentsGroup model from which to save the changes.
1195
- * @param ifcToSaveOn - The Uint8Array representing the original IFC file.
925
+ * @param items - A map of fragment IDs to their respective express IDs.
926
+ * @param color - The color to set for the fragments.
927
+ * @param override - A boolean indicating whether to override the existing color of the fragments.
1196
928
  *
1197
- * @returns A promise that resolves with the modified IFC data as a Uint8Array.
929
+ * @remarks
930
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
931
+ * and sets their color using the 'setColor' method of the FragmentsGroup class.
1198
932
  *
1199
- * @throws Will throw an error if any issues occur during the saving process.
933
+ * @throws Will throw an error if the fragment with the specified ID is not found.
1200
934
  */
1201
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
935
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
1202
936
  /**
1203
- * Sets an attribute listener for a specific attribute of an entity in the model.
1204
- * The listener will trigger an event whenever the attribute's value changes.
937
+ * Resets the color of the specified fragments to their original color.
1205
938
  *
1206
- * @param model - The FragmentsGroup model in which to set the attribute listener.
1207
- * @param expressID - The express ID of the entity for which to set the listener.
1208
- * @param attributeName - The name of the attribute for which to set the listener.
939
+ * @param items - A map of fragment IDs to their respective express IDs.
1209
940
  *
1210
- * @returns The event that will be triggered when the attribute's value changes.
941
+ * @remarks
942
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
943
+ * and resets their color using the 'resetColor' method of the FragmentsGroup class.
1211
944
  *
1212
- * @throws Will throw an error if the entity with the given expressID doesn't exist.
1213
- * @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
1214
- * @throws Will throw an error if the attribute has a badly defined handle.
945
+ * @throws Will throw an error if the fragment with the specified ID is not found.
1215
946
  */
1216
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
1217
- private increaseMaxID;
1218
- private newGUID;
1219
- private getOwnerHistory;
1220
- private registerChange;
1221
- private newSingleProperty;
947
+ resetColor(items: FRAGS.FragmentIdMap): void;
948
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
1222
949
  }
1223
950
  import { Component, Disposable, Event, Components } from "../../core";
1224
951
  /**
@@ -1270,186 +997,15 @@ export declare class Exploder extends Component implements Disposable {
1270
997
  */
1271
998
  set(active: boolean): void;
1272
999
  }
1273
- import * as THREE from "three";
1274
1000
  import * as FRAGS from "@thatopen/fragments";
1275
- import { Disposable, Component, Event, Components } from "../../core";
1001
+ import { Components, Component } from "../../core";
1276
1002
  /**
1277
- * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
1003
+ * A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
1278
1004
  */
1279
- export interface Classification {
1005
+ export declare class Hider extends Component {
1280
1006
  /**
1281
- * A system within the classification.
1282
- * The key is the system name, and the value is an object representing the classes within the system.
1283
- */
1284
- [system: string]: {
1285
- /**
1286
- * A class within the system.
1287
- * The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
1288
- */
1289
- [className: string]: {
1290
- map: FRAGS.FragmentIdMap;
1291
- name: string;
1292
- id: number | null;
1293
- };
1294
- };
1295
- }
1296
- /**
1297
- * The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
1298
- */
1299
- export declare class Classifier extends Component implements Disposable {
1300
- /**
1301
- * A unique identifier for the component.
1302
- * This UUID is used to register the component within the Components system.
1303
- */
1304
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
1305
- /** {@link Component.enabled} */
1306
- enabled: boolean;
1307
- /**
1308
- * A map representing the classification systems.
1309
- * The key is the system name, and the value is an object representing the classes within the system.
1310
- */
1311
- list: Classification;
1312
- /** {@link Disposable.onDisposed} */
1313
- readonly onDisposed: Event<unknown>;
1314
- constructor(components: Components);
1315
- private onFragmentsDisposed;
1316
- /** {@link Disposable.dispose} */
1317
- dispose(): void;
1318
- /**
1319
- * Removes a fragment from the classification based on its unique identifier (guid).
1320
- * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
1321
- *
1322
- * @param guid - The unique identifier of the fragment to be removed.
1323
- */
1324
- remove(guid: string): void;
1325
- /**
1326
- * Finds and returns fragments based on the provided filter criteria.
1327
- * If no filter is provided, it returns all fragments.
1328
- *
1329
- * @param filter - An optional object containing filter criteria.
1330
- * The keys of the object represent the classification system names,
1331
- * and the values are arrays of class names to match.
1332
- *
1333
- * @returns A map of fragment GUIDs to their respective express IDs,
1334
- * where the express IDs are filtered based on the provided filter criteria.
1335
- *
1336
- * @throws Will throw an error if the fragments map is malformed.
1337
- */
1338
- find(filter?: {
1339
- [name: string]: string[];
1340
- }): FRAGS.FragmentIdMap;
1341
- /**
1342
- * Classifies fragments based on their modelID.
1343
- *
1344
- * @param modelID - The unique identifier of the model to classify fragments by.
1345
- * @param group - The FragmentsGroup containing the fragments to be classified.
1346
- *
1347
- * @remarks
1348
- * This method iterates through the fragments in the provided group,
1349
- * and classifies them based on their modelID.
1350
- * The classification is stored in the 'list.models' property,
1351
- * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
1352
- *
1353
- */
1354
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
1355
- /**
1356
- * Classifies fragments based on their PredefinedType property.
1357
- *
1358
- * @param group - The FragmentsGroup containing the fragments to be classified.
1359
- *
1360
- * @remarks
1361
- * This method iterates through the properties of the fragments in the provided group,
1362
- * and classifies them based on their PredefinedType property.
1363
- * The classification is stored in the 'list.predefinedTypes' property,
1364
- * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
1365
- *
1366
- * @throws Will throw an error if the fragment ID is not found.
1367
- */
1368
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
1369
- /**
1370
- * Classifies fragments based on their entity type.
1371
- *
1372
- * @param group - The FragmentsGroup containing the fragments to be classified.
1373
- *
1374
- * @remarks
1375
- * This method iterates through the relations of the fragments in the provided group,
1376
- * and classifies them based on their entity type.
1377
- * The classification is stored in the 'list.entities' property,
1378
- * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
1379
- *
1380
- * @throws Will throw an error if the fragment ID is not found.
1381
- */
1382
- byEntity(group: FRAGS.FragmentsGroup): void;
1383
- /**
1384
- * Classifies fragments based on a specific IFC relationship.
1385
- *
1386
- * @param group - The FragmentsGroup containing the fragments to be classified.
1387
- * @param ifcRel - The IFC relationship number to classify fragments by.
1388
- * @param systemName - The name of the classification system to store the classification.
1389
- *
1390
- * @remarks
1391
- * This method iterates through the relations of the fragments in the provided group,
1392
- * and classifies them based on the specified IFC relationship.
1393
- * The classification is stored in the 'list' property under the specified system name,
1394
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1395
- *
1396
- * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
1397
- */
1398
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
1399
- /**
1400
- * Classifies fragments based on their spatial structure in the IFC model.
1401
- *
1402
- * @param model - The FragmentsGroup containing the fragments to be classified.
1403
- * @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
1404
- *
1405
- * @remarks
1406
- * This method iterates through the relations of the fragments in the provided group,
1407
- * and classifies them based on their spatial structure in the IFC model.
1408
- * The classification is stored in the 'list' property under the system name "spatialStructures",
1409
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1410
- *
1411
- * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
1412
- */
1413
- bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
1414
- useProperties: boolean;
1415
- }): Promise<void>;
1416
- /**
1417
- * Sets the color of the specified fragments.
1418
- *
1419
- * @param items - A map of fragment IDs to their respective express IDs.
1420
- * @param color - The color to set for the fragments.
1421
- * @param override - A boolean indicating whether to override the existing color of the fragments.
1422
- *
1423
- * @remarks
1424
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
1425
- * and sets their color using the 'setColor' method of the FragmentsGroup class.
1426
- *
1427
- * @throws Will throw an error if the fragment with the specified ID is not found.
1428
- */
1429
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
1430
- /**
1431
- * Resets the color of the specified fragments to their original color.
1432
- *
1433
- * @param items - A map of fragment IDs to their respective express IDs.
1434
- *
1435
- * @remarks
1436
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
1437
- * and resets their color using the 'resetColor' method of the FragmentsGroup class.
1438
- *
1439
- * @throws Will throw an error if the fragment with the specified ID is not found.
1440
- */
1441
- resetColor(items: FRAGS.FragmentIdMap): void;
1442
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
1443
- }
1444
- import * as FRAGS from "@thatopen/fragments";
1445
- import { Components, Component } from "../../core";
1446
- /**
1447
- * A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
1448
- */
1449
- export declare class Hider extends Component {
1450
- /**
1451
- * A unique identifier for the component.
1452
- * This UUID is used to register the component within the Components system.
1007
+ * A unique identifier for the component.
1008
+ * This UUID is used to register the component within the Components system.
1453
1009
  */
1454
1010
  static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
1455
1011
  /** {@link Component.enabled} */
@@ -1479,13 +1035,6 @@ export declare class Hider extends Component {
1479
1035
  isolate(items: FRAGS.FragmentIdMap): void;
1480
1036
  private updateCulledVisibility;
1481
1037
  }
1482
- import * as THREE from "three";
1483
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
1484
- center: THREE.Vector3;
1485
- halfSizes: THREE.Vector3;
1486
- rotation: THREE.Matrix3;
1487
- transformation: THREE.Matrix4;
1488
- };
1489
1038
  import * as WEBIFC from "web-ifc";
1490
1039
  import * as FRAGS from "@thatopen/fragments";
1491
1040
  import { IfcFragmentSettings } from "./src";
@@ -1601,184 +1150,57 @@ export declare class IfcLoader extends Component implements Disposable {
1601
1150
  private getGeometry;
1602
1151
  private autoSetWasm;
1603
1152
  }
1604
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
1605
- import * as THREE from "three";
1606
- export declare class MaterialsUtils {
1607
- static isTransparent(material: THREE.Material): boolean;
1608
- }
1609
- export declare class UUID {
1610
- private static _pattern;
1611
- private static _lut;
1612
- static create(): string;
1613
- static validate(uuid: string): void;
1614
- }
1153
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1615
1154
  import * as THREE from "three";
1616
- import { Component, Components, Disposable, Event, World } from "../core";
1155
+ import * as FRAGS from "@thatopen/fragments";
1156
+ import { Component, Components, Event, Disposable } from "../../core";
1157
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1617
1158
  /**
1618
- * Configuration interface for the VertexPicker component.
1159
+ * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
1619
1160
  */
1620
- export interface VertexPickerConfig {
1621
- /**
1622
- * If true, only vertices will be picked, not the closest point on the face.
1623
- */
1624
- showOnlyVertex: boolean;
1625
- /**
1626
- * The maximum distance for snapping to a vertex.
1627
- */
1628
- snapDistance: number;
1161
+ export declare class FragmentsManager extends Component implements Disposable {
1629
1162
  /**
1630
- * The HTML element to use for previewing the picked vertex.
1163
+ * A unique identifier for the component.
1164
+ * This UUID is used to register the component within the Components system.
1631
1165
  */
1632
- previewElement: HTMLElement;
1633
- }
1634
- /**
1635
- * A class that provides functionality for picking vertices in a 3D scene.
1636
- */
1637
- export declare class VertexPicker extends Component implements Disposable {
1166
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1638
1167
  /** {@link Disposable.onDisposed} */
1639
1168
  readonly onDisposed: Event<unknown>;
1640
1169
  /**
1641
- * An event that is triggered when a vertex is found.
1642
- * The event passes a THREE.Vector3 representing the position of the found vertex.
1170
+ * Event triggered when fragments are loaded.
1643
1171
  */
1644
- readonly onVertexFound: Event<THREE.Vector3>;
1172
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
1645
1173
  /**
1646
- * An event that is triggered when a vertex is lost.
1647
- * The event passes a THREE.Vector3 representing the position of the lost vertex.
1174
+ * Event triggered when fragments are disposed.
1648
1175
  */
1649
- readonly onVertexLost: Event<THREE.Vector3>;
1176
+ readonly onFragmentsDisposed: Event<{
1177
+ groupID: string;
1178
+ fragmentIDs: string[];
1179
+ }>;
1650
1180
  /**
1651
- * An event that is triggered when the picker is enabled or disabled
1181
+ * Map containing all loaded fragments.
1182
+ * The key is the fragment's unique identifier, and the value is the fragment itself.
1652
1183
  */
1653
- readonly onEnabled: Event<boolean>;
1184
+ readonly list: Map<string, Fragment>;
1654
1185
  /**
1655
- * A reference to the Components instance associated with this VertexPicker.
1186
+ * Map containing all loaded fragment groups.
1187
+ * The key is the group's unique identifier, and the value is the group itself.
1656
1188
  */
1657
- components: Components;
1189
+ readonly groups: Map<string, FragmentsGroup>;
1190
+ baseCoordinationModel: string;
1191
+ baseCoordinationMatrix: THREE.Matrix4;
1192
+ /** {@link Component.enabled} */
1193
+ enabled: boolean;
1194
+ private _loader;
1658
1195
  /**
1659
- * A reference to the working plane used for vertex picking.
1660
- * This plane is used to determine which vertices are considered valid for picking.
1661
- * If this value is null, all vertices are considered valid.
1196
+ * Getter for the meshes of all fragments in the FragmentsManager.
1197
+ * It iterates over the fragments in the list and pushes their meshes into an array.
1198
+ * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
1662
1199
  */
1663
- workingPlane: THREE.Plane | null;
1664
- private _pickedPoint;
1665
- private _config;
1666
- private _enabled;
1667
- /**
1668
- * Sets the enabled state of the VertexPicker.
1669
- * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1670
- * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1671
- *
1672
- * @param value - The new enabled state.
1673
- */
1674
- set enabled(value: boolean);
1675
- /**
1676
- * Gets the current enabled state of the VertexPicker.
1677
- *
1678
- * @returns The current enabled state.
1679
- */
1680
- get enabled(): boolean;
1681
- /**
1682
- * Sets the configuration for the VertexPicker component.
1683
- *
1684
- * @param value - A Partial object containing the configuration properties to update.
1685
- * The properties not provided in the value object will retain their current values.
1686
- *
1687
- * @example
1688
- * '''typescript
1689
- * vertexPicker.config = {
1690
- * snapDistance: 0.5,
1691
- * showOnlyVertex: true,
1692
- * };
1693
- * '''
1694
- */
1695
- set config(value: Partial<VertexPickerConfig>);
1696
- /**
1697
- * Gets the current configuration for the VertexPicker component.
1698
- *
1699
- * @returns A copy of the current VertexPickerConfig object.
1700
- *
1701
- * @example
1702
- * '''typescript
1703
- * const currentConfig = vertexPicker.config;
1704
- * console.log(currentConfig.snapDistance); // Output: 0.25
1705
- * '''
1706
- */
1707
- get config(): Partial<VertexPickerConfig>;
1708
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
1709
- /** {@link Disposable.dispose} */
1710
- dispose(): void;
1711
- /**
1712
- * Performs the vertex picking operation based on the current state of the VertexPicker.
1713
- *
1714
- * @param world - The World instance to use for raycasting.
1715
- *
1716
- * @returns The current picked point, or null if no point is picked.
1717
- *
1718
- * @remarks
1719
- * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
1720
- * If enabled, it performs raycasting to find the closest intersecting object.
1721
- * It then determines the closest vertex or point on the face, based on the configuration settings.
1722
- * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
1723
- * If the picked point is not on the working plane, it resets the 'pickedPoint'.
1724
- * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
1725
- */
1726
- get(world: World): THREE.Vector3 | null;
1727
- private getClosestVertex;
1728
- private getVertices;
1729
- private getVertex;
1730
- }
1731
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1732
- import * as THREE from "three";
1733
- import * as FRAGS from "@thatopen/fragments";
1734
- import { Component, Components, Event, Disposable } from "../../core";
1735
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1736
- /**
1737
- * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
1738
- */
1739
- export declare class FragmentsManager extends Component implements Disposable {
1740
- /**
1741
- * A unique identifier for the component.
1742
- * This UUID is used to register the component within the Components system.
1743
- */
1744
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1745
- /** {@link Disposable.onDisposed} */
1746
- readonly onDisposed: Event<unknown>;
1747
- /**
1748
- * Event triggered when fragments are loaded.
1749
- */
1750
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
1751
- /**
1752
- * Event triggered when fragments are disposed.
1753
- */
1754
- readonly onFragmentsDisposed: Event<{
1755
- groupID: string;
1756
- fragmentIDs: string[];
1757
- }>;
1758
- /**
1759
- * Map containing all loaded fragments.
1760
- * The key is the fragment's unique identifier, and the value is the fragment itself.
1761
- */
1762
- readonly list: Map<string, Fragment>;
1763
- /**
1764
- * Map containing all loaded fragment groups.
1765
- * The key is the group's unique identifier, and the value is the group itself.
1766
- */
1767
- readonly groups: Map<string, FragmentsGroup>;
1768
- baseCoordinationModel: string;
1769
- baseCoordinationMatrix: THREE.Matrix4;
1770
- /** {@link Component.enabled} */
1771
- enabled: boolean;
1772
- private _loader;
1773
- /**
1774
- * Getter for the meshes of all fragments in the FragmentsManager.
1775
- * It iterates over the fragments in the list and pushes their meshes into an array.
1776
- * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
1777
- */
1778
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
1779
- constructor(components: Components);
1780
- /** {@link Disposable.dispose} */
1781
- dispose(): void;
1200
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
1201
+ constructor(components: Components);
1202
+ /** {@link Disposable.dispose} */
1203
+ dispose(): void;
1782
1204
  /**
1783
1205
  * Dispose of a specific fragment group.
1784
1206
  * This method removes the group from the groups map, deletes all fragments within the group from the list,
@@ -1838,6 +1260,21 @@ export declare class FragmentsManager extends Component implements Disposable {
1838
1260
  * If not provided, all models are used.
1839
1261
  */
1840
1262
  coordinate(models?: FragmentsGroup[]): void;
1263
+ /**
1264
+ * Applies the base coordinate system to the provided object.
1265
+ *
1266
+ * This function takes an object and its original coordinate system as input.
1267
+ * It then inverts the original coordinate system and applies the base coordinate system
1268
+ * to the object. This ensures that the object's position, rotation, and scale are
1269
+ * transformed to match the base coordinate system (which is taken from the first model loaded).
1270
+ *
1271
+ * @param object - The object to which the base coordinate system will be applied.
1272
+ * This should be an instance of THREE.Object3D.
1273
+ *
1274
+ * @param originalCoordinateSystem - The original coordinate system of the object.
1275
+ * This should be a THREE.Matrix4 representing the object's transformation matrix.
1276
+ */
1277
+ applyBaseCoordinateSystem(object: THREE.Object3D | THREE.Vector3, originalCoordinateSystem: THREE.Matrix4): void;
1841
1278
  }
1842
1279
  import * as WEBIFC from "web-ifc";
1843
1280
  import { Components, Disposable, Event, Component } from "../../core";
@@ -1980,27 +1417,605 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
1980
1417
  /**
1981
1418
  * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
1982
1419
  */
1983
- webIfc: WEBIFC.IfcAPI;
1984
- /** {@link Disposable.dispose} */
1985
- dispose(): Promise<void>;
1420
+ webIfc: WEBIFC.IfcAPI;
1421
+ /** {@link Disposable.dispose} */
1422
+ dispose(): Promise<void>;
1423
+ /**
1424
+ * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1425
+ *
1426
+ * @param data - The Uint8Array containing the IFC file data.
1427
+ * @returns A Promise that resolves when the streaming process is complete.
1428
+ */
1429
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1430
+ /**
1431
+ * This method converts properties from an IFC file to tiles using a given callback function to read the file.
1432
+ *
1433
+ * @param loadCallback - A callback function that loads the IFC file data.
1434
+ * @returns A Promise that resolves when the streaming process is complete.
1435
+ */
1436
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1437
+ private readIfcFile;
1438
+ private streamIfcFile;
1439
+ private streamAllProperties;
1440
+ private cleanUp;
1441
+ }
1442
+ import * as THREE from "three";
1443
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
1444
+ center: THREE.Vector3;
1445
+ halfSizes: THREE.Vector3;
1446
+ rotation: THREE.Matrix3;
1447
+ transformation: THREE.Matrix4;
1448
+ };
1449
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
1450
+ import * as THREE from "three";
1451
+ export declare class MaterialsUtils {
1452
+ static isTransparent(material: THREE.Material): boolean;
1453
+ }
1454
+ export declare class UUID {
1455
+ private static _pattern;
1456
+ private static _lut;
1457
+ static create(): string;
1458
+ static validate(uuid: string): void;
1459
+ }
1460
+ import * as WEBIFC from "web-ifc";
1461
+ import * as FRAG from "@thatopen/fragments";
1462
+ import { Component, Components } from "../../core";
1463
+ /**
1464
+ * 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).
1465
+ */
1466
+ export declare class IfcJsonExporter extends Component {
1467
+ /**
1468
+ * A unique identifier for the component.
1469
+ * This UUID is used to register the component within the Components system.
1470
+ */
1471
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1472
+ /** {@link Component.enabled} */
1473
+ enabled: boolean;
1474
+ constructor(components: Components);
1475
+ /**
1476
+ * Exports all the properties of an IFC into an array of JS objects.
1477
+ * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1478
+ * @param modelID ID of the IFC model whose properties to extract.
1479
+ * @param indirect whether to get the indirect relationships as well.
1480
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
1481
+ * to make the location data available (e.g. absolute position of building).
1482
+ */
1483
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1484
+ }
1485
+ import * as THREE from "three";
1486
+ import { Component, Components, Disposable, Event, World } from "../core";
1487
+ /**
1488
+ * Configuration interface for the VertexPicker component.
1489
+ */
1490
+ export interface VertexPickerConfig {
1491
+ /**
1492
+ * If true, only vertices will be picked, not the closest point on the face.
1493
+ */
1494
+ showOnlyVertex: boolean;
1495
+ /**
1496
+ * The maximum distance for snapping to a vertex.
1497
+ */
1498
+ snapDistance: number;
1499
+ /**
1500
+ * The HTML element to use for previewing the picked vertex.
1501
+ */
1502
+ previewElement: HTMLElement;
1503
+ }
1504
+ /**
1505
+ * A class that provides functionality for picking vertices in a 3D scene.
1506
+ */
1507
+ export declare class VertexPicker extends Component implements Disposable {
1508
+ /** {@link Disposable.onDisposed} */
1509
+ readonly onDisposed: Event<unknown>;
1510
+ /**
1511
+ * An event that is triggered when a vertex is found.
1512
+ * The event passes a THREE.Vector3 representing the position of the found vertex.
1513
+ */
1514
+ readonly onVertexFound: Event<THREE.Vector3>;
1515
+ /**
1516
+ * An event that is triggered when a vertex is lost.
1517
+ * The event passes a THREE.Vector3 representing the position of the lost vertex.
1518
+ */
1519
+ readonly onVertexLost: Event<THREE.Vector3>;
1520
+ /**
1521
+ * An event that is triggered when the picker is enabled or disabled
1522
+ */
1523
+ readonly onEnabled: Event<boolean>;
1524
+ /**
1525
+ * A reference to the Components instance associated with this VertexPicker.
1526
+ */
1527
+ components: Components;
1528
+ /**
1529
+ * A reference to the working plane used for vertex picking.
1530
+ * This plane is used to determine which vertices are considered valid for picking.
1531
+ * If this value is null, all vertices are considered valid.
1532
+ */
1533
+ workingPlane: THREE.Plane | null;
1534
+ private _pickedPoint;
1535
+ private _config;
1536
+ private _enabled;
1537
+ /**
1538
+ * Sets the enabled state of the VertexPicker.
1539
+ * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1540
+ * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1541
+ *
1542
+ * @param value - The new enabled state.
1543
+ */
1544
+ set enabled(value: boolean);
1545
+ /**
1546
+ * Gets the current enabled state of the VertexPicker.
1547
+ *
1548
+ * @returns The current enabled state.
1549
+ */
1550
+ get enabled(): boolean;
1551
+ /**
1552
+ * Sets the configuration for the VertexPicker component.
1553
+ *
1554
+ * @param value - A Partial object containing the configuration properties to update.
1555
+ * The properties not provided in the value object will retain their current values.
1556
+ *
1557
+ * @example
1558
+ * '''typescript
1559
+ * vertexPicker.config = {
1560
+ * snapDistance: 0.5,
1561
+ * showOnlyVertex: true,
1562
+ * };
1563
+ * '''
1564
+ */
1565
+ set config(value: Partial<VertexPickerConfig>);
1566
+ /**
1567
+ * Gets the current configuration for the VertexPicker component.
1568
+ *
1569
+ * @returns A copy of the current VertexPickerConfig object.
1570
+ *
1571
+ * @example
1572
+ * '''typescript
1573
+ * const currentConfig = vertexPicker.config;
1574
+ * console.log(currentConfig.snapDistance); // Output: 0.25
1575
+ * '''
1576
+ */
1577
+ get config(): Partial<VertexPickerConfig>;
1578
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
1579
+ /** {@link Disposable.dispose} */
1580
+ dispose(): void;
1581
+ /**
1582
+ * Performs the vertex picking operation based on the current state of the VertexPicker.
1583
+ *
1584
+ * @param world - The World instance to use for raycasting.
1585
+ *
1586
+ * @returns The current picked point, or null if no point is picked.
1587
+ *
1588
+ * @remarks
1589
+ * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
1590
+ * If enabled, it performs raycasting to find the closest intersecting object.
1591
+ * It then determines the closest vertex or point on the face, based on the configuration settings.
1592
+ * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
1593
+ * If the picked point is not on the working plane, it resets the 'pickedPoint'.
1594
+ * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
1595
+ */
1596
+ get(world: World): THREE.Vector3 | null;
1597
+ private getClosestVertex;
1598
+ private getVertices;
1599
+ private getVertex;
1600
+ }
1601
+ import * as WEBIFC from "web-ifc";
1602
+ import { FragmentsGroup } from "@thatopen/fragments";
1603
+ import { Disposable, Event, Component, Components } from "../../core";
1604
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
1605
+ export type { InverseAttribute, RelationsMap } from "./src/types";
1606
+ /**
1607
+ * 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).
1608
+ */
1609
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
1610
+ /**
1611
+ * A unique identifier for the component.
1612
+ * This UUID is used to register the component within the Components system.
1613
+ */
1614
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1615
+ /** {@link Disposable.onDisposed} */
1616
+ readonly onDisposed: Event<string>;
1617
+ /**
1618
+ * Event triggered when relations for a model have been indexed.
1619
+ * This event provides the model's UUID and the relations map generated for that model.
1620
+ *
1621
+ * @property {string} modelID - The UUID of the model for which relations have been indexed.
1622
+ * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1623
+ * 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.
1624
+ */
1625
+ readonly onRelationsIndexed: Event<{
1626
+ modelID: string;
1627
+ relationsMap: RelationsMap;
1628
+ }>;
1629
+ /**
1630
+ * Holds the relationship mappings for each model processed by the indexer.
1631
+ * The structure is a map where each key is a model's UUID, and the value is another map.
1632
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1633
+ * representing a specific relation type, and the value is an array of expressIDs of entities
1634
+ * that are related through that relation type. This structure allows for efficient querying
1635
+ * of entity relationships within a model.
1636
+ */
1637
+ readonly relationMaps: ModelsRelationMap;
1638
+ /** {@link Component.enabled} */
1639
+ enabled: boolean;
1640
+ private _relToAttributesMap;
1641
+ private _inverseAttributes;
1642
+ private _ifcRels;
1643
+ constructor(components: Components);
1644
+ private onFragmentsDisposed;
1645
+ private indexRelations;
1646
+ private getAttributeIndex;
1647
+ /**
1648
+ * Adds a relation map to the model's relations map.
1649
+ *
1650
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1651
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1652
+ *
1653
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1654
+ */
1655
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
1656
+ /**
1657
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
1658
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
1659
+ * and maps them in a structured way to facilitate quick access to related entities.
1660
+ *
1661
+ * The process involves querying the model for each relation type associated with the inverse attributes
1662
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
1663
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
1664
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
1665
+ * of entities that are related through that attribute.
1666
+ *
1667
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
1668
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
1669
+ * representation of the relations indexed by entity expressIDs and relation types.
1670
+ * @throws An error if the model does not have properties loaded.
1671
+ */
1672
+ process(model: FragmentsGroup): Promise<RelationsMap>;
1673
+ /**
1674
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
1675
+ *
1676
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
1677
+ * @param modelID - The unique identifier of the model within the WebIfc API.
1678
+ * @returns A promise that resolves to the relations map for the processed model.
1679
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
1680
+ */
1681
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
1682
+ /**
1683
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
1684
+ * This method searches the indexed relation maps for the specified model and entity,
1685
+ * returning the IDs of related entities if a match is found.
1686
+ *
1687
+ * @param model The 'FragmentsGroup' model containing the entity.
1688
+ * @param expressID The unique identifier of the entity within the model.
1689
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
1690
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
1691
+ * or the specified relation name is not indexed.
1692
+ */
1693
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
1694
+ /**
1695
+ * Serializes the relations of a given relation map into a JSON string.
1696
+ * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
1697
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1698
+ * The resulting object is then serialized into a JSON string.
1699
+ *
1700
+ * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
1701
+ * @returns A JSON string representing the serialized relations of the given relation map.
1702
+ */
1703
+ serializeRelations(relationMap: RelationsMap): string;
1704
+ /**
1705
+ * Serializes the relations of a specific model into a JSON string.
1706
+ * This method iterates through the relations indexed for the given model,
1707
+ * organizing them into a structured object where each key is an expressID of an entity,
1708
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1709
+ * The resulting object is then serialized into a JSON string.
1710
+ *
1711
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
1712
+ * @returns A JSON string representing the serialized relations of the specified model.
1713
+ * If the model has no indexed relations, 'null' is returned.
1714
+ */
1715
+ serializeModelRelations(model: FragmentsGroup): string | null;
1716
+ /**
1717
+ * Serializes all relations of every model processed by the indexer into a JSON string.
1718
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
1719
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
1720
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
1721
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
1722
+ *
1723
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
1724
+ * If no relations have been indexed, an empty object is returned as a JSON string.
1725
+ */
1726
+ serializeAllRelations(): string;
1727
+ /**
1728
+ * Converts a JSON string representing relations between entities into a structured map.
1729
+ * This method parses the JSON string to reconstruct the relations map that indexes
1730
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
1731
+ * and the values are maps where each key is a relation type ID and its value is an array
1732
+ * of express IDs of entities related through that relation type.
1733
+ *
1734
+ * @param json The JSON string to be parsed into the relations map.
1735
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
1736
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
1737
+ * is an array of express IDs (as numbers) of entities related through that relation type.
1738
+ */
1739
+ getRelationsMapFromJSON(json: string): RelationsMap;
1740
+ /** {@link Disposable.dispose} */
1741
+ dispose(): void;
1742
+ /**
1743
+ * Adds relations between an entity and other entities in a BIM model.
1744
+ *
1745
+ * @param model - The BIM model to which the relations will be added.
1746
+ * @param expressID - The expressID of the entity within the model.
1747
+ * @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
1748
+ * @param relIDs - The expressIDs of the related entities within the model.
1749
+ *
1750
+ * @throws An error if the relation name is not a valid relation name.
1751
+ */
1752
+ addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
1753
+ /**
1754
+ * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
1755
+ *
1756
+ * @param model The BIM model whose children to get.
1757
+ * @param expressID The expressID of the item whose children to get.
1758
+ * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
1759
+ *
1760
+ * @returns A 'Set' with the expressIDs of the found items.
1761
+ */
1762
+ getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
1763
+ }
1764
+ import * as WEBIFC from "web-ifc";
1765
+ import { FragmentsGroup } from "@thatopen/fragments";
1766
+ import { Component, Disposable, Event, Components } from "../../core";
1767
+ /**
1768
+ * Types for boolean properties in IFC schema.
1769
+ */
1770
+ export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
1771
+ /**
1772
+ * Types for string properties in IFC schema.
1773
+ */
1774
+ export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
1775
+ /**
1776
+ * Types for numeric properties in IFC schema.
1777
+ */
1778
+ export type NumericPropTypes = "IfcInteger" | "IfcReal";
1779
+ /**
1780
+ * Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
1781
+ */
1782
+ export interface ChangeMap {
1783
+ [modelID: string]: Set<number>;
1784
+ }
1785
+ /**
1786
+ * Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
1787
+ */
1788
+ export interface AttributeListener {
1789
+ [modelID: string]: {
1790
+ [expressID: number]: {
1791
+ [attributeName: string]: Event<String | Boolean | Number>;
1792
+ };
1793
+ };
1794
+ }
1795
+ /**
1796
+ * Component to manage and edit properties and Psets in IFC files.
1797
+ */
1798
+ export declare class IfcPropertiesManager extends Component implements Disposable {
1799
+ /**
1800
+ * A unique identifier for the component.
1801
+ * This UUID is used to register the component within the Components system.
1802
+ */
1803
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
1804
+ /** {@link Disposable.onDisposed} */
1805
+ readonly onDisposed: Event<string>;
1806
+ /**
1807
+ * Event triggered when a file is requested for export.
1808
+ */
1809
+ readonly onRequestFile: Event<unknown>;
1810
+ /**
1811
+ * ArrayBuffer containing the IFC data to be exported.
1812
+ */
1813
+ ifcToExport: ArrayBuffer | null;
1814
+ /**
1815
+ * Event triggered when an element is added to a Pset.
1816
+ */
1817
+ readonly onElementToPset: Event<{
1818
+ model: FragmentsGroup;
1819
+ psetID: number;
1820
+ elementID: number;
1821
+ }>;
1822
+ /**
1823
+ * Event triggered when a property is added to a Pset.
1824
+ */
1825
+ readonly onPropToPset: Event<{
1826
+ model: FragmentsGroup;
1827
+ psetID: number;
1828
+ propID: number;
1829
+ }>;
1830
+ /**
1831
+ * Event triggered when a Pset is removed.
1832
+ */
1833
+ readonly onPsetRemoved: Event<{
1834
+ model: FragmentsGroup;
1835
+ psetID: number;
1836
+ }>;
1837
+ /**
1838
+ * Event triggered when data in the model changes.
1839
+ */
1840
+ readonly onDataChanged: Event<{
1841
+ model: FragmentsGroup;
1842
+ expressID: number;
1843
+ }>;
1844
+ /**
1845
+ * Configuration for the WebAssembly module.
1846
+ */
1847
+ wasm: {
1848
+ path: string;
1849
+ absolute: boolean;
1850
+ };
1851
+ /** {@link Component.enabled} */
1852
+ enabled: boolean;
1853
+ /**
1854
+ * Map of attribute listeners.
1855
+ */
1856
+ attributeListeners: AttributeListener;
1857
+ /**
1858
+ * The currently selected model.
1859
+ */
1860
+ selectedModel?: FragmentsGroup;
1861
+ /**
1862
+ * Map of changed entities in the model.
1863
+ */
1864
+ changeMap: ChangeMap;
1865
+ constructor(components: Components);
1866
+ /** {@link Disposable.dispose} */
1867
+ dispose(): void;
1868
+ /**
1869
+ * Static method to retrieve the IFC schema from a given model.
1870
+ *
1871
+ * @param model - The FragmentsGroup model from which to retrieve the IFC schema.
1872
+ * @throws Will throw an error if the IFC schema is not found in the model.
1873
+ * @returns The IFC schema associated with the given model.
1874
+ */
1875
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
1876
+ /**
1877
+ * Method to set properties data in the model.
1878
+ *
1879
+ * @param model - The FragmentsGroup model in which to set the properties.
1880
+ * @param dataToSave - An array of objects representing the properties to be saved.
1881
+ * Each object must have an 'expressID' property, which is the express ID of the entity in the model.
1882
+ * The rest of the properties will be set as the properties of the entity.
1883
+ *
1884
+ * @returns A promise that resolves when all the properties have been set.
1885
+ *
1886
+ * @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
1887
+ */
1888
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
1889
+ /**
1890
+ * Creates a new Property Set (Pset) in the given model.
1891
+ *
1892
+ * @param model - The FragmentsGroup model in which to create the Pset.
1893
+ * @param name - The name of the Pset.
1894
+ * @param description - (Optional) The description of the Pset.
1895
+ *
1896
+ * @returns A promise that resolves with an object containing the newly created Pset and its relation.
1897
+ *
1898
+ * @throws Will throw an error if the IFC schema is not found in the model.
1899
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1900
+ */
1901
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
1902
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
1903
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
1904
+ }>;
1905
+ /**
1906
+ * Removes a Property Set (Pset) from the given model.
1907
+ *
1908
+ * @param model - The FragmentsGroup model from which to remove the Pset.
1909
+ * @param psetID - The express IDs of the Psets to be removed.
1910
+ *
1911
+ * @returns A promise that resolves when all the Psets have been removed.
1912
+ *
1913
+ * @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
1914
+ * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1915
+ * @throws Will throw an error if no relation is found between the Pset and the model.
1916
+ */
1917
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
1918
+ /**
1919
+ * Creates a new single-value property of type string in the given model.
1920
+ *
1921
+ * @param model - The FragmentsGroup model in which to create the property.
1922
+ * @param type - The type of the property value. Must be a string property type.
1923
+ * @param name - The name of the property.
1924
+ * @param value - The value of the property. Must be a string.
1925
+ *
1926
+ * @returns The newly created single-value property.
1927
+ *
1928
+ * @throws Will throw an error if the IFC schema is not found in the model.
1929
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1930
+ */
1931
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1932
+ /**
1933
+ * Creates a new single-value property of type numeric in the given model.
1934
+ *
1935
+ * @param model - The FragmentsGroup model in which to create the property.
1936
+ * @param type - The type of the property value. Must be a numeric property type.
1937
+ * @param name - The name of the property.
1938
+ * @param value - The value of the property. Must be a number.
1939
+ *
1940
+ * @returns The newly created single-value property.
1941
+ *
1942
+ * @throws Will throw an error if the IFC schema is not found in the model.
1943
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1944
+ */
1945
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1946
+ /**
1947
+ * Creates a new single-value property of type boolean in the given model.
1948
+ *
1949
+ * @param model - The FragmentsGroup model in which to create the property.
1950
+ * @param type - The type of the property value. Must be a boolean property type.
1951
+ * @param name - The name of the property.
1952
+ * @param value - The value of the property. Must be a boolean.
1953
+ *
1954
+ * @returns The newly created single-value property.
1955
+ *
1956
+ * @throws Will throw an error if the IFC schema is not found in the model.
1957
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1958
+ */
1959
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1960
+ /**
1961
+ * Removes a property from a Property Set (Pset) in the given model.
1962
+ *
1963
+ * @param model - The FragmentsGroup model from which to remove the property.
1964
+ * @param psetID - The express ID of the Pset from which to remove the property.
1965
+ * @param propID - The express ID of the property to be removed.
1966
+ *
1967
+ * @returns A promise that resolves when the property has been removed.
1968
+ *
1969
+ * @throws Will throw an error if the Pset or the property to be removed are not found in the model.
1970
+ * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1971
+ */
1972
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
1973
+ addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
1974
+ /**
1975
+ * Adds elements to a Property Set (Pset) in the given model.
1976
+ *
1977
+ * @param model - The FragmentsGroup model in which to add the elements.
1978
+ * @param psetID - The express ID of the Pset to which to add the elements.
1979
+ * @param elementID - The express IDs of the elements to be added.
1980
+ *
1981
+ * @returns A promise that resolves when all the elements have been added.
1982
+ *
1983
+ * @throws Will throw an error if the Pset or the elements to be added are not found in the model.
1984
+ * @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
1985
+ * @throws Will throw an error if no relation is found between the Pset and the model.
1986
+ */
1987
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
1986
1988
  /**
1987
- * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1989
+ * Saves the changes made to the model to a new IFC file.
1988
1990
  *
1989
- * @param data - The Uint8Array containing the IFC file data.
1990
- * @returns A Promise that resolves when the streaming process is complete.
1991
+ * @param model - The FragmentsGroup model from which to save the changes.
1992
+ * @param ifcToSaveOn - The Uint8Array representing the original IFC file.
1993
+ *
1994
+ * @returns A promise that resolves with the modified IFC data as a Uint8Array.
1995
+ *
1996
+ * @throws Will throw an error if any issues occur during the saving process.
1991
1997
  */
1992
- streamFromBuffer(data: Uint8Array): Promise<void>;
1998
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
1993
1999
  /**
1994
- * This method converts properties from an IFC file to tiles using a given callback function to read the file.
2000
+ * Sets an attribute listener for a specific attribute of an entity in the model.
2001
+ * The listener will trigger an event whenever the attribute's value changes.
1995
2002
  *
1996
- * @param loadCallback - A callback function that loads the IFC file data.
1997
- * @returns A Promise that resolves when the streaming process is complete.
2003
+ * @param model - The FragmentsGroup model in which to set the attribute listener.
2004
+ * @param expressID - The express ID of the entity for which to set the listener.
2005
+ * @param attributeName - The name of the attribute for which to set the listener.
2006
+ *
2007
+ * @returns The event that will be triggered when the attribute's value changes.
2008
+ *
2009
+ * @throws Will throw an error if the entity with the given expressID doesn't exist.
2010
+ * @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
2011
+ * @throws Will throw an error if the attribute has a badly defined handle.
1998
2012
  */
1999
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
2000
- private readIfcFile;
2001
- private streamIfcFile;
2002
- private streamAllProperties;
2003
- private cleanUp;
2013
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
2014
+ private increaseMaxID;
2015
+ private newGUID;
2016
+ private getOwnerHistory;
2017
+ private registerChange;
2018
+ private newSingleProperty;
2004
2019
  }
2005
2020
  import * as THREE from "three";
2006
2021
  import * as FRAGS from "@thatopen/fragments";
@@ -2107,59 +2122,6 @@ export declare class MeasurementUtils extends Component {
2107
2122
  private getVolumeOfMesh;
2108
2123
  private getSignedVolumeOfTriangle;
2109
2124
  }
2110
- import * as WEBIFC from "web-ifc";
2111
- export interface IfcItemsCategories {
2112
- [itemID: number]: number;
2113
- }
2114
- export declare class IfcCategories {
2115
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2116
- }
2117
- /**
2118
- * A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
2119
- *
2120
- * @remarks
2121
- * This map is used to provide a mapping between IFC entity type numbers and their names.
2122
- * It is useful for identifying and processing different types of IFC elements in a project.
2123
- *
2124
- */
2125
- export declare const IfcElements: {
2126
- [key: number]: string;
2127
- };
2128
- /**
2129
- * A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
2130
- */
2131
- export declare const IfcCategoryMap: {
2132
- [key: number]: string;
2133
- };
2134
- import * as FRAGS from "@thatopen/fragments";
2135
- export declare class IfcPropertiesUtils {
2136
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
2137
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
2138
- [attribute: string]: any;
2139
- } | null>;
2140
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
2141
- [relatingID: number]: number[];
2142
- }>;
2143
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
2144
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
2145
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
2146
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
2147
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
2148
- key: string | null;
2149
- name: string | null;
2150
- }>;
2151
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
2152
- key: string | null;
2153
- value: number | null;
2154
- }>;
2155
- static isRel(expressID: number): boolean;
2156
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2157
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2158
- }
2159
- /**
2160
- * A Set of unique numbers representing different types of IFC geometries.
2161
- */
2162
- export declare const GeometryTypes: Set<number>;
2163
2125
  import * as THREE from "three";
2164
2126
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
2165
2127
  /**
@@ -2249,11 +2211,10 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
2249
2211
  resize(size?: THREE.Vector2): void;
2250
2212
  private updatePlanes;
2251
2213
  }
2252
- import { InverseAttribute } from "./types";
2253
- export declare const relToAttributesMap: Map<number, {
2254
- forRelating: InverseAttribute;
2255
- forRelated: InverseAttribute;
2256
- }>;
2214
+ /**
2215
+ * A Set of unique numbers representing different types of IFC geometries.
2216
+ */
2217
+ export declare const GeometryTypes: Set<number>;
2257
2218
  import * as WEBIFC from "web-ifc";
2258
2219
  /** Configuration of the IFC-fragment conversion. */
2259
2220
  export declare class IfcFragmentSettings {
@@ -2303,6 +2264,83 @@ export declare class SpatialStructure {
2303
2264
  setUp(webIfc: WEBIFC.IfcAPI): void;
2304
2265
  cleanUp(): void;
2305
2266
  }
2267
+ import * as WEBIFC from "web-ifc";
2268
+ export interface IfcItemsCategories {
2269
+ [itemID: number]: number;
2270
+ }
2271
+ export declare class IfcCategories {
2272
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2273
+ }
2274
+ /**
2275
+ * A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
2276
+ *
2277
+ * @remarks
2278
+ * This map is used to provide a mapping between IFC entity type numbers and their names.
2279
+ * It is useful for identifying and processing different types of IFC elements in a project.
2280
+ *
2281
+ */
2282
+ export declare const IfcElements: {
2283
+ [key: number]: string;
2284
+ };
2285
+ /**
2286
+ * A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
2287
+ */
2288
+ export declare const IfcCategoryMap: {
2289
+ [key: number]: string;
2290
+ };
2291
+ import * as FRAGS from "@thatopen/fragments";
2292
+ export declare class IfcPropertiesUtils {
2293
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
2294
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
2295
+ [attribute: string]: any;
2296
+ } | null>;
2297
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
2298
+ [relatingID: number]: number[];
2299
+ }>;
2300
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
2301
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
2302
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
2303
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
2304
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
2305
+ key: string | null;
2306
+ name: string | null;
2307
+ }>;
2308
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
2309
+ key: string | null;
2310
+ value: number | null;
2311
+ }>;
2312
+ static isRel(expressID: number): boolean;
2313
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2314
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2315
+ }
2316
+ /**
2317
+ * 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.
2318
+ */
2319
+ export declare class Event<T> {
2320
+ /**
2321
+ * Add a callback to this event instance.
2322
+ * @param handler - the callback to be added to this event.
2323
+ */
2324
+ add(handler: T extends void ? {
2325
+ (): void;
2326
+ } : {
2327
+ (data: T): void;
2328
+ }): void;
2329
+ /**
2330
+ * Removes a callback from this event instance.
2331
+ * @param handler - the callback to be removed from this event.
2332
+ */
2333
+ remove(handler: T extends void ? {
2334
+ (): void;
2335
+ } : {
2336
+ (data: T): void;
2337
+ }): void;
2338
+ /** Triggers all the callbacks assigned to this event. */
2339
+ trigger: (data?: T) => void;
2340
+ /** Gets rid of all the suscribed events. */
2341
+ reset(): void;
2342
+ private handlers;
2343
+ }
2306
2344
  /**
2307
2345
  * Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
2308
2346
  */
@@ -2452,6 +2490,11 @@ export declare abstract class Component extends Base {
2452
2490
  */
2453
2491
  abstract enabled: boolean;
2454
2492
  }
2493
+ import { InverseAttribute } from "./types";
2494
+ export declare const relToAttributesMap: Map<number, {
2495
+ forRelating: InverseAttribute;
2496
+ forRelated: InverseAttribute;
2497
+ }>;
2455
2498
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2456
2499
  import { Components } from "../../Components";
2457
2500
  /**
@@ -2635,12 +2678,88 @@ export interface World extends Disposable, Updateable {
2635
2678
  /**
2636
2679
  * A unique identifier for the world.
2637
2680
  */
2638
- uuid: string;
2681
+ uuid: string;
2682
+ /**
2683
+ * Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
2684
+ */
2685
+ isDisposing: boolean;
2686
+ }
2687
+ import * as THREE from "three";
2688
+ import { Disposable, Event } from "../../Types";
2689
+ /**
2690
+ * A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
2691
+ */
2692
+ export declare class Mouse implements Disposable {
2693
+ dom: HTMLCanvasElement;
2694
+ private _event?;
2695
+ private _position;
2696
+ /** {@link Disposable.onDisposed} */
2697
+ readonly onDisposed: Event<unknown>;
2698
+ constructor(dom: HTMLCanvasElement);
2699
+ /**
2700
+ * The real position of the mouse of the Three.js canvas.
2701
+ */
2702
+ get position(): THREE.Vector2;
2703
+ /** {@link Disposable.dispose} */
2704
+ dispose(): void;
2705
+ private getPositionY;
2706
+ private getPositionX;
2707
+ private updateMouseInfo;
2708
+ private setupEvents;
2709
+ }
2710
+ import * as THREE from "three";
2711
+ import { Components } from "../../Components";
2712
+ import { Event, World, Disposable } from "../../Types";
2713
+ import { Mouse } from "./mouse";
2714
+ /**
2715
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
2716
+ */
2717
+ export declare class SimpleRaycaster implements Disposable {
2718
+ /** {@link Component.enabled} */
2719
+ enabled: boolean;
2720
+ /** The components instance to which this Raycaster belongs. */
2721
+ components: Components;
2722
+ /** {@link Disposable.onDisposed} */
2723
+ readonly onDisposed: Event<unknown>;
2724
+ /** The position of the mouse in the screen. */
2725
+ readonly mouse: Mouse;
2726
+ /**
2727
+ * A reference to the Three.js Raycaster instance.
2728
+ * This is used for raycasting operations.
2729
+ */
2730
+ readonly three: THREE.Raycaster;
2731
+ /**
2732
+ * A reference to the world instance to which this Raycaster belongs.
2733
+ * This is used to access the camera and meshes.
2734
+ */
2735
+ world: World;
2736
+ constructor(components: Components, world: World);
2737
+ /** {@link Disposable.dispose} */
2738
+ dispose(): void;
2739
+ /**
2740
+ * Throws a ray from the camera to the mouse or touch event point and returns
2741
+ * the first item found. This also takes into account the clipping planes
2742
+ * used by the renderer.
2743
+ *
2744
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2745
+ * to query. If not provided, it will query all the meshes stored in
2746
+ * {@link Components.meshes}.
2747
+ */
2748
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2639
2749
  /**
2640
- * Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
2750
+ * Casts a ray from a given origin in a given direction and returns the first item found.
2751
+ * This method also takes into account the clipping planes used by the renderer.
2752
+ *
2753
+ * @param origin - The origin of the ray.
2754
+ * @param direction - The direction of the ray.
2755
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2756
+ * @returns The first intersection found or 'null' if no intersection was found.
2641
2757
  */
2642
- isDisposing: boolean;
2758
+ castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
2759
+ private intersect;
2760
+ private filterClippingPlanes;
2643
2761
  }
2762
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2644
2763
  import * as THREE from "three";
2645
2764
  import { Components } from "../../Components";
2646
2765
  import { AsyncEvent, Event, World } from "../../Types";
@@ -2732,7 +2851,6 @@ export declare class CullerRenderer {
2732
2851
  protected decreaseColor(): void;
2733
2852
  private applySettings;
2734
2853
  }
2735
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2736
2854
  import * as THREE from "three";
2737
2855
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
2738
2856
  import { Components } from "../../Components";
@@ -2789,6 +2907,129 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
2789
2907
  private handleWorkerMessage;
2790
2908
  private getAvailableMaterial;
2791
2909
  }
2910
+ import { NavigationMode } from "./types";
2911
+ import { OrthoPerspectiveCamera } from "../index";
2912
+ /**
2913
+ * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
2914
+ */
2915
+ export declare class FirstPersonMode implements NavigationMode {
2916
+ private camera;
2917
+ /** {@link NavigationMode.enabled} */
2918
+ enabled: boolean;
2919
+ /** {@link NavigationMode.id} */
2920
+ readonly id = "FirstPerson";
2921
+ constructor(camera: OrthoPerspectiveCamera);
2922
+ /** {@link NavigationMode.set} */
2923
+ set(active: boolean): void;
2924
+ private setupFirstPersonCamera;
2925
+ }
2926
+ import { NavigationMode } from "./types";
2927
+ import { OrthoPerspectiveCamera } from "../index";
2928
+ /**
2929
+ * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
2930
+ */
2931
+ export declare class OrbitMode implements NavigationMode {
2932
+ camera: OrthoPerspectiveCamera;
2933
+ /** {@link NavigationMode.enabled} */
2934
+ enabled: boolean;
2935
+ /** {@link NavigationMode.id} */
2936
+ readonly id = "Orbit";
2937
+ constructor(camera: OrthoPerspectiveCamera);
2938
+ /** {@link NavigationMode.set} */
2939
+ set(active: boolean): void;
2940
+ private activateOrbitControls;
2941
+ }
2942
+ import { NavigationMode } from "./types";
2943
+ import { OrthoPerspectiveCamera } from "../index";
2944
+ /**
2945
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
2946
+ */
2947
+ export declare class PlanMode implements NavigationMode {
2948
+ private camera;
2949
+ /** {@link NavigationMode.enabled} */
2950
+ enabled: boolean;
2951
+ /** {@link NavigationMode.id} */
2952
+ readonly id = "Plan";
2953
+ private mouseAction1?;
2954
+ private mouseAction2?;
2955
+ private mouseInitialized;
2956
+ private readonly defaultAzimuthSpeed;
2957
+ private readonly defaultPolarSpeed;
2958
+ constructor(camera: OrthoPerspectiveCamera);
2959
+ /** {@link NavigationMode.set} */
2960
+ set(active: boolean): void;
2961
+ }
2962
+ import * as THREE from "three";
2963
+ import { CameraProjection } from "./types";
2964
+ import { Event } from "../../Types";
2965
+ import { OrthoPerspectiveCamera } from "../index";
2966
+ /**
2967
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
2968
+ */
2969
+ export declare class ProjectionManager {
2970
+ /**
2971
+ * Event that fires when the {@link CameraProjection} changes.
2972
+ */
2973
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
2974
+ /**
2975
+ * Current projection mode of the camera.
2976
+ * Default is "Perspective".
2977
+ */
2978
+ current: CameraProjection;
2979
+ /**
2980
+ * The camera controlled by this ProjectionManager.
2981
+ * It can be either a PerspectiveCamera or an OrthographicCamera.
2982
+ */
2983
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
2984
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
2985
+ matchOrthoDistanceEnabled: boolean;
2986
+ private _component;
2987
+ private _previousDistance;
2988
+ constructor(camera: OrthoPerspectiveCamera);
2989
+ /**
2990
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
2991
+ *
2992
+ * @param projection - the new projection to set. If it is the current projection,
2993
+ * it will have no effect.
2994
+ */
2995
+ set(projection: CameraProjection): Promise<void>;
2996
+ /**
2997
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
2998
+ * and vice versa.
2999
+ */
3000
+ toggle(): Promise<void>;
3001
+ private setOrthoCamera;
3002
+ private getPerspectiveDims;
3003
+ private setupOrthoCamera;
3004
+ private getDistance;
3005
+ private setPerspectiveCamera;
3006
+ }
3007
+ /**
3008
+ * The projection system of the camera.
3009
+ */
3010
+ export type CameraProjection = "Perspective" | "Orthographic";
3011
+ /**
3012
+ * The extensible list of supported navigation modes.
3013
+ */
3014
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3015
+ /**
3016
+ * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3017
+ */
3018
+ export interface NavigationMode {
3019
+ /** The unique ID of this navigation mode. */
3020
+ id: NavModeID;
3021
+ /**
3022
+ * Enable or disable this navigation mode.
3023
+ * When a new navigation mode is enabled, the previous navigation mode
3024
+ * must be disabled.
3025
+ *
3026
+ * @param active - whether to enable or disable this mode.
3027
+ * @param options - any additional data required to enable or disable it.
3028
+ * */
3029
+ set: (active: boolean, options?: any) => void;
3030
+ /** Whether this navigation mode is active or not. */
3031
+ enabled: boolean;
3032
+ }
2792
3033
  import * as THREE from "three";
2793
3034
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
2794
3035
  /**
@@ -2961,34 +3202,6 @@ export declare class SimpleRenderer extends BaseRenderer {
2961
3202
  private onContextLost;
2962
3203
  private onContextBack;
2963
3204
  }
2964
- /**
2965
- * 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.
2966
- */
2967
- export declare class Event<T> {
2968
- /**
2969
- * Add a callback to this event instance.
2970
- * @param handler - the callback to be added to this event.
2971
- */
2972
- add(handler: T extends void ? {
2973
- (): void;
2974
- } : {
2975
- (data: T): void;
2976
- }): void;
2977
- /**
2978
- * Removes a callback from this event instance.
2979
- * @param handler - the callback to be removed from this event.
2980
- */
2981
- remove(handler: T extends void ? {
2982
- (): void;
2983
- } : {
2984
- (data: T): void;
2985
- }): void;
2986
- /** Triggers all the callbacks assigned to this event. */
2987
- trigger: (data?: T) => void;
2988
- /** Gets rid of all the suscribed events. */
2989
- reset(): void;
2990
- private handlers;
2991
- }
2992
3205
  import * as THREE from "three";
2993
3206
  import CameraControls from "camera-controls";
2994
3207
  import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
@@ -3006,125 +3219,65 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
3006
3219
  * This event is useful when you need to perform actions after the aspect of the camera has been changed.
3007
3220
  */
3008
3221
  readonly onAspectUpdated: Event<unknown>;
3009
- /** {@link Disposable.onDisposed} */
3010
- readonly onDisposed: Event<string>;
3011
- /**
3012
- * A three.js PerspectiveCamera or OrthographicCamera instance.
3013
- * This camera is used for rendering the scene.
3014
- */
3015
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3016
- private _allControls;
3017
- /**
3018
- * The object that controls the camera. An instance of
3019
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
3020
- * Transforming the camera directly will have no effect: you need to use this
3021
- * object to move, rotate, look at objects, etc.
3022
- */
3023
- get controls(): CameraControls;
3024
- /**
3025
- * Getter for the enabled state of the camera controls.
3026
- * If the current world is null, it returns false.
3027
- * Otherwise, it returns the enabled state of the camera controls.
3028
- *
3029
- * @returns {boolean} The enabled state of the camera controls.
3030
- */
3031
- get enabled(): boolean;
3032
- /**
3033
- * Setter for the enabled state of the camera controls.
3034
- * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
3035
- *
3036
- * @param {boolean} enabled - The new enabled state of the camera controls.
3037
- */
3038
- set enabled(enabled: boolean);
3039
- constructor(components: Components);
3040
- /** {@link Disposable.dispose} */
3041
- dispose(): void;
3042
- /** {@link Updateable.update} */
3043
- update(_delta: number): void;
3044
- /**
3045
- * Updates the aspect of the camera to match the size of the
3046
- * {@link Components.renderer}.
3047
- */
3048
- updateAspect: () => void;
3049
- private setupCamera;
3050
- private newCameraControls;
3051
- private setupEvents;
3052
- private static getSubsetOfThree;
3053
- }
3054
- import * as THREE from "three";
3055
- import { Disposable, Event } from "../../Types";
3056
- /**
3057
- * 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.
3058
- */
3059
- export declare class Mouse implements Disposable {
3060
- dom: HTMLCanvasElement;
3061
- private _event?;
3062
- private _position;
3063
- /** {@link Disposable.onDisposed} */
3064
- readonly onDisposed: Event<unknown>;
3065
- constructor(dom: HTMLCanvasElement);
3066
- /**
3067
- * The real position of the mouse of the Three.js canvas.
3068
- */
3069
- get position(): THREE.Vector2;
3070
- /** {@link Disposable.dispose} */
3071
- dispose(): void;
3072
- private getPositionY;
3073
- private getPositionX;
3074
- private updateMouseInfo;
3075
- private setupEvents;
3076
- }
3077
- import * as THREE from "three";
3078
- import { Components } from "../../Components";
3079
- import { Event, World, Disposable } from "../../Types";
3080
- import { Mouse } from "./mouse";
3081
- /**
3082
- * 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.
3083
- */
3084
- export declare class SimpleRaycaster implements Disposable {
3085
- /** {@link Component.enabled} */
3086
- enabled: boolean;
3087
- /** The components instance to which this Raycaster belongs. */
3088
- components: Components;
3089
- /** {@link Disposable.onDisposed} */
3090
- readonly onDisposed: Event<unknown>;
3091
- /** The position of the mouse in the screen. */
3092
- readonly mouse: Mouse;
3222
+ /** {@link Disposable.onDisposed} */
3223
+ readonly onDisposed: Event<string>;
3093
3224
  /**
3094
- * A reference to the Three.js Raycaster instance.
3095
- * This is used for raycasting operations.
3225
+ * A three.js PerspectiveCamera or OrthographicCamera instance.
3226
+ * This camera is used for rendering the scene.
3096
3227
  */
3097
- readonly three: THREE.Raycaster;
3228
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3229
+ private _allControls;
3098
3230
  /**
3099
- * A reference to the world instance to which this Raycaster belongs.
3100
- * This is used to access the camera and meshes.
3231
+ * The object that controls the camera. An instance of
3232
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
3233
+ * Transforming the camera directly will have no effect: you need to use this
3234
+ * object to move, rotate, look at objects, etc.
3101
3235
  */
3102
- world: World;
3103
- constructor(components: Components, world: World);
3104
- /** {@link Disposable.dispose} */
3105
- dispose(): void;
3236
+ get controls(): CameraControls;
3106
3237
  /**
3107
- * Throws a ray from the camera to the mouse or touch event point and returns
3108
- * the first item found. This also takes into account the clipping planes
3109
- * used by the renderer.
3238
+ * Getter for the enabled state of the camera controls.
3239
+ * If the current world is null, it returns false.
3240
+ * Otherwise, it returns the enabled state of the camera controls.
3110
3241
  *
3111
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
3112
- * to query. If not provided, it will query all the meshes stored in
3113
- * {@link Components.meshes}.
3242
+ * @returns {boolean} The enabled state of the camera controls.
3114
3243
  */
3115
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
3244
+ get enabled(): boolean;
3116
3245
  /**
3117
- * Casts a ray from a given origin in a given direction and returns the first item found.
3118
- * This method also takes into account the clipping planes used by the renderer.
3246
+ * Setter for the enabled state of the camera controls.
3247
+ * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
3119
3248
  *
3120
- * @param origin - The origin of the ray.
3121
- * @param direction - The direction of the ray.
3122
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3123
- * @returns The first intersection found or 'null' if no intersection was found.
3249
+ * @param {boolean} enabled - The new enabled state of the camera controls.
3124
3250
  */
3125
- 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;
3126
- private intersect;
3127
- private filterClippingPlanes;
3251
+ set enabled(enabled: boolean);
3252
+ constructor(components: Components);
3253
+ /** {@link Disposable.dispose} */
3254
+ dispose(): void;
3255
+ /** {@link Updateable.update} */
3256
+ update(_delta: number): void;
3257
+ /**
3258
+ * Updates the aspect of the camera to match the size of the
3259
+ * {@link Components.renderer}.
3260
+ */
3261
+ updateAspect: () => void;
3262
+ private setupCamera;
3263
+ private newCameraControls;
3264
+ private setupEvents;
3265
+ private static getSubsetOfThree;
3266
+ }
3267
+ import * as THREE from "three";
3268
+ import * as WEBIFC from "web-ifc";
3269
+ import * as FRAGS from "@thatopen/fragments";
3270
+ export declare class CivilReader {
3271
+ defLineMat: THREE.LineBasicMaterial;
3272
+ read(webIfc: WEBIFC.IfcAPI): {
3273
+ alignments: Map<number, FRAGS.Alignment>;
3274
+ coordinationMatrix: THREE.Matrix4;
3275
+ } | undefined;
3276
+ get(civilItems: any): {
3277
+ alignments: Map<number, FRAGS.Alignment>;
3278
+ coordinationMatrix: THREE.Matrix4;
3279
+ } | undefined;
3280
+ private getCurves;
3128
3281
  }
3129
3282
  import * as THREE from "three";
3130
3283
  import { Hideable, Event, World, Disposable } from "../../Types";
@@ -3185,37 +3338,31 @@ export declare class SimpleGrid implements Hideable, Disposable {
3185
3338
  private setupEvents;
3186
3339
  private updateZoom;
3187
3340
  }
3188
- import { NavigationMode } from "./types";
3189
- import { OrthoPerspectiveCamera } from "../index";
3190
- /**
3191
- * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
3192
- */
3193
- export declare class OrbitMode implements NavigationMode {
3194
- camera: OrthoPerspectiveCamera;
3195
- /** {@link NavigationMode.enabled} */
3196
- enabled: boolean;
3197
- /** {@link NavigationMode.id} */
3198
- readonly id = "Orbit";
3199
- constructor(camera: OrthoPerspectiveCamera);
3200
- /** {@link NavigationMode.set} */
3201
- set(active: boolean): void;
3202
- private activateOrbitControls;
3341
+ import * as WEBIFC from "web-ifc";
3342
+ export declare class IfcMetadataReader {
3343
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3344
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3203
3345
  }
3204
- import { NavigationMode } from "./types";
3205
- import { OrthoPerspectiveCamera } from "../index";
3346
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3206
3347
  /**
3207
- * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
3348
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3208
3349
  */
3209
- export declare class FirstPersonMode implements NavigationMode {
3210
- private camera;
3211
- /** {@link NavigationMode.enabled} */
3212
- enabled: boolean;
3213
- /** {@link NavigationMode.id} */
3214
- readonly id = "FirstPerson";
3215
- constructor(camera: OrthoPerspectiveCamera);
3216
- /** {@link NavigationMode.set} */
3217
- set(active: boolean): void;
3218
- private setupFirstPersonCamera;
3350
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3351
+ /**
3352
+ * Amount of properties to be streamed.
3353
+ * Defaults to 100 properties.
3354
+ */
3355
+ propertiesSize: number;
3356
+ }
3357
+ import * as WEBIFC from "web-ifc";
3358
+ import * as THREE from "three";
3359
+ export declare class Units {
3360
+ factor: number;
3361
+ complement: number;
3362
+ apply(matrix: THREE.Matrix4): void;
3363
+ setUp(webIfc: WEBIFC.IfcAPI): void;
3364
+ private getLengthUnits;
3365
+ private getScaleMatrix;
3219
3366
  }
3220
3367
  import * as THREE from "three";
3221
3368
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -3316,138 +3463,6 @@ export declare class SimplePlane implements Disposable, Hideable {
3316
3463
  private newHelper;
3317
3464
  private static newPlaneMesh;
3318
3465
  }
3319
- import * as THREE from "three";
3320
- import { CameraProjection } from "./types";
3321
- import { Event } from "../../Types";
3322
- import { OrthoPerspectiveCamera } from "../index";
3323
- /**
3324
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3325
- */
3326
- export declare class ProjectionManager {
3327
- /**
3328
- * Event that fires when the {@link CameraProjection} changes.
3329
- */
3330
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
3331
- /**
3332
- * Current projection mode of the camera.
3333
- * Default is "Perspective".
3334
- */
3335
- current: CameraProjection;
3336
- /**
3337
- * The camera controlled by this ProjectionManager.
3338
- * It can be either a PerspectiveCamera or an OrthographicCamera.
3339
- */
3340
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3341
- /** Match Ortho zoom with Perspective distance when changing projection mode */
3342
- matchOrthoDistanceEnabled: boolean;
3343
- private _component;
3344
- private _previousDistance;
3345
- constructor(camera: OrthoPerspectiveCamera);
3346
- /**
3347
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3348
- *
3349
- * @param projection - the new projection to set. If it is the current projection,
3350
- * it will have no effect.
3351
- */
3352
- set(projection: CameraProjection): Promise<void>;
3353
- /**
3354
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
3355
- * and vice versa.
3356
- */
3357
- toggle(): Promise<void>;
3358
- private setOrthoCamera;
3359
- private getPerspectiveDims;
3360
- private setupOrthoCamera;
3361
- private getDistance;
3362
- private setPerspectiveCamera;
3363
- }
3364
- import { NavigationMode } from "./types";
3365
- import { OrthoPerspectiveCamera } from "../index";
3366
- /**
3367
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3368
- */
3369
- export declare class PlanMode implements NavigationMode {
3370
- private camera;
3371
- /** {@link NavigationMode.enabled} */
3372
- enabled: boolean;
3373
- /** {@link NavigationMode.id} */
3374
- readonly id = "Plan";
3375
- private mouseAction1?;
3376
- private mouseAction2?;
3377
- private mouseInitialized;
3378
- private readonly defaultAzimuthSpeed;
3379
- private readonly defaultPolarSpeed;
3380
- constructor(camera: OrthoPerspectiveCamera);
3381
- /** {@link NavigationMode.set} */
3382
- set(active: boolean): void;
3383
- }
3384
- /**
3385
- * The projection system of the camera.
3386
- */
3387
- export type CameraProjection = "Perspective" | "Orthographic";
3388
- /**
3389
- * The extensible list of supported navigation modes.
3390
- */
3391
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3392
- /**
3393
- * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3394
- */
3395
- export interface NavigationMode {
3396
- /** The unique ID of this navigation mode. */
3397
- id: NavModeID;
3398
- /**
3399
- * Enable or disable this navigation mode.
3400
- * When a new navigation mode is enabled, the previous navigation mode
3401
- * must be disabled.
3402
- *
3403
- * @param active - whether to enable or disable this mode.
3404
- * @param options - any additional data required to enable or disable it.
3405
- * */
3406
- set: (active: boolean, options?: any) => void;
3407
- /** Whether this navigation mode is active or not. */
3408
- enabled: boolean;
3409
- }
3410
- import * as WEBIFC from "web-ifc";
3411
- import * as THREE from "three";
3412
- export declare class Units {
3413
- factor: number;
3414
- complement: number;
3415
- apply(matrix: THREE.Matrix4): void;
3416
- setUp(webIfc: WEBIFC.IfcAPI): void;
3417
- private getLengthUnits;
3418
- private getScaleMatrix;
3419
- }
3420
- import * as THREE from "three";
3421
- import * as WEBIFC from "web-ifc";
3422
- import * as FRAGS from "@thatopen/fragments";
3423
- export declare class CivilReader {
3424
- defLineMat: THREE.LineBasicMaterial;
3425
- read(webIfc: WEBIFC.IfcAPI): {
3426
- alignments: Map<number, FRAGS.Alignment>;
3427
- coordinationMatrix: THREE.Matrix4;
3428
- } | undefined;
3429
- get(civilItems: any): {
3430
- alignments: Map<number, FRAGS.Alignment>;
3431
- coordinationMatrix: THREE.Matrix4;
3432
- } | undefined;
3433
- private getCurves;
3434
- }
3435
- import * as WEBIFC from "web-ifc";
3436
- export declare class IfcMetadataReader {
3437
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3438
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3439
- }
3440
- import { IfcFragmentSettings } from "../../IfcLoader/src";
3441
- /**
3442
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3443
- */
3444
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3445
- /**
3446
- * Amount of properties to be streamed.
3447
- * Defaults to 100 properties.
3448
- */
3449
- propertiesSize: number;
3450
- }
3451
3466
  import { IfcFragmentSettings } from "../../IfcLoader/src";
3452
3467
  /**
3453
3468
  * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.