@thatopen/components 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,592 +1,743 @@
1
1
  declare namespace OBC {
2
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
3
- import * as THREE from "three";
4
- export declare class MaterialsUtils {
5
- static isTransparent(material: THREE.Material): boolean;
6
- }
7
- import * as FRAGS from "@thatopen/fragments";
8
- import { Components, Component } from "../../core";
2
+ import { Component, Disposable, Event } from "../Types";
9
3
  /**
10
- * 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).
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.
11
5
  */
12
- export declare class Hider extends Component {
6
+ export declare class Components implements Disposable {
13
7
  /**
14
- * A unique identifier for the component.
15
- * This UUID is used to register the component within the Components system.
8
+ * The version of the @thatopen/components library.
9
+ */
10
+ static readonly release = "2.1.3";
11
+ /** {@link Disposable.onDisposed} */
12
+ readonly onDisposed: Event<void>;
13
+ /**
14
+ * The list of components created in this app.
15
+ * The keys are UUIDs and the values are instances of the components.
16
+ */
17
+ readonly list: Map<string, Component>;
18
+ /**
19
+ * If disabled, the animation loop will be stopped.
20
+ * Default value is false.
16
21
  */
17
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
18
- /** {@link Component.enabled} */
19
22
  enabled: boolean;
20
- constructor(components: Components);
23
+ private _clock;
21
24
  /**
22
- * Sets the visibility of fragments within the 3D scene.
23
- * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
24
- * If 'items' is provided, only the specified fragments will be affected.
25
+ * Adds a component to the list of components.
26
+ * Throws an error if a component with the same UUID already exists.
25
27
  *
26
- * @param visible - The visibility state to set for the fragments.
27
- * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
28
- * If not provided, all fragments will be affected.
28
+ * @param uuid - The unique identifier of the component.
29
+ * @param instance - The instance of the component to be added.
29
30
  *
30
- * @returns {void}
31
+ * @throws Will throw an error if a component with the same UUID already exists.
32
+ *
33
+ * @internal
31
34
  */
32
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
35
+ add(uuid: string, instance: Component): void;
33
36
  /**
34
- * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
35
- * It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
37
+ * Retrieves a component instance by its constructor function.
38
+ * If the component does not exist in the list, it will be created and added.
36
39
  *
37
- * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
38
- * If not provided, all fragments will be isolated.
40
+ * @template U - The type of the component to retrieve.
41
+ * @param Component - The constructor function of the component to retrieve.
42
+ *
43
+ * @returns The instance of the requested component.
44
+ *
45
+ * @throws Will throw an error if a component with the same UUID already exists.
46
+ *
47
+ * @internal
48
+ */
49
+ get<U extends Component>(Component: new (components: Components) => U): U;
50
+ constructor();
51
+ /**
52
+ * Initializes the Components instance.
53
+ * This method starts the animation loop, sets the enabled flag to true,
54
+ * and calls the update method.
39
55
  *
40
56
  * @returns {void}
41
57
  */
42
- isolate(items: FRAGS.FragmentIdMap): void;
43
- private updateCulledVisibility;
58
+ init(): void;
59
+ /**
60
+ * Disposes the memory of all the components and tools of this instance of
61
+ * the library. A memory leak will be created if:
62
+ *
63
+ * - An instance of the library ends up out of scope and this function isn't
64
+ * called. This is especially relevant in Single Page Applications (React,
65
+ * Angular, Vue, etc).
66
+ *
67
+ * - Any of the objects of this instance (meshes, geometries,materials, etc) is
68
+ * referenced by a reference type (object or array).
69
+ *
70
+ * You can learn more about how Three.js handles memory leaks
71
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
72
+ *
73
+ */
74
+ dispose(): void;
75
+ private update;
76
+ private static setupBVH;
44
77
  }
45
- import { Component, Disposable, Event, Components } from "../../core";
78
+ import * as THREE from "three";
79
+ import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
80
+ import { SimplePlane } from "./src";
81
+ import { Components } from "../Components";
46
82
  /**
47
- * The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
83
+ * A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
84
+ *
85
+ * @param components - the instance of {@link Components} used.
86
+ * E.g. {@link SimplePlane}.
48
87
  */
49
- export declare class Exploder extends Component implements Disposable {
88
+ export declare class Clipper extends Component implements Createable, Disposable, Hideable {
50
89
  /**
51
90
  * A unique identifier for the component.
52
91
  * This UUID is used to register the component within the Components system.
53
92
  */
54
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
55
- /** {@link Disposable.onDisposed} */
56
- readonly onDisposed: Event<unknown>;
57
- /** {@link Component.enabled} */
58
- enabled: boolean;
93
+ static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
94
+ /** Event that fires when the user starts dragging a clipping plane. */
95
+ readonly onBeforeDrag: Event<void>;
96
+ /** Event that fires when the user stops dragging a clipping plane. */
97
+ readonly onAfterDrag: Event<void>;
59
98
  /**
60
- * The height of the explosion animation.
61
- * This property determines the vertical distance by which fragments are moved during the explosion.
62
- * Default value is 10.
99
+ * Event that fires when the user starts creating a clipping plane.
63
100
  */
64
- height: number;
101
+ readonly onBeforeCreate: Event<unknown>;
65
102
  /**
66
- * The group name used for the explosion animation.
67
- * This property specifies the group of fragments that will be affected by the explosion.
68
- * Default value is "storeys".
103
+ * Event that fires when the user cancels the creation of a clipping plane.
69
104
  */
70
- groupName: string;
105
+ readonly onBeforeCancel: Event<unknown>;
71
106
  /**
72
- * A set of strings representing the exploded items.
73
- * This set is used to keep track of which items have been exploded.
107
+ * Event that fires after the user cancels the creation of a clipping plane.
74
108
  */
75
- list: Set<string>;
76
- constructor(components: Components);
77
- /** {@link Disposable.dispose} */
78
- dispose(): void;
109
+ readonly onAfterCancel: Event<unknown>;
79
110
  /**
80
- * Sets the explosion state of the fragments.
81
- *
82
- * @param active - A boolean indicating whether to activate or deactivate the explosion.
83
- *
84
- * @remarks
85
- * This method applies a vertical transformation to the fragments based on the 'active' parameter.
86
- * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
87
- * If 'active' is false, the fragments are moved back to their original position.
88
- *
89
- * The method also keeps track of the exploded items using the 'list' set.
90
- *
91
- * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
111
+ * Event that fires when the user starts deleting a clipping plane.
92
112
  */
93
- set(active: boolean): void;
94
- }
95
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
96
- import * as THREE from "three";
97
- import * as FRAGS from "@thatopen/fragments";
98
- import { Component, Components, Event, Disposable } from "../../core";
99
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
100
- /**
101
- * 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).
102
- */
103
- export declare class FragmentsManager extends Component implements Disposable {
113
+ readonly onBeforeDelete: Event<unknown>;
104
114
  /**
105
- * A unique identifier for the component.
106
- * This UUID is used to register the component within the Components system.
115
+ * Event that fires after a clipping plane has been created.
116
+ * @param plane - The newly created clipping plane.
107
117
  */
108
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
109
- /** {@link Disposable.onDisposed} */
110
- readonly onDisposed: Event<unknown>;
118
+ readonly onAfterCreate: Event<SimplePlane>;
111
119
  /**
112
- * Event triggered when fragments are loaded.
120
+ * Event that fires after a clipping plane has been deleted.
121
+ * @param plane - The deleted clipping plane.
113
122
  */
114
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
123
+ readonly onAfterDelete: Event<SimplePlane>;
124
+ /** {@link Disposable.onDisposed} */
125
+ readonly onDisposed: Event<string>;
115
126
  /**
116
- * Event triggered when fragments are disposed.
127
+ * Whether to force the clipping plane to be orthogonal in the Y direction
128
+ * (up). This is desirable when clipping a building horizontally and a
129
+ * clipping plane is created in its roof, which might have a slight
130
+ * slope for draining purposes.
117
131
  */
118
- readonly onFragmentsDisposed: Event<{
119
- groupID: string;
120
- fragmentIDs: string[];
121
- }>;
132
+ orthogonalY: boolean;
122
133
  /**
123
- * Map containing all loaded fragments.
124
- * The key is the fragment's unique identifier, and the value is the fragment itself.
134
+ * The tolerance that determines whether an almost-horizontal clipping plane
135
+ * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
136
+ * has to be 'true' for this to apply.
125
137
  */
126
- readonly list: Map<string, Fragment>;
138
+ toleranceOrthogonalY: number;
127
139
  /**
128
- * Map containing all loaded fragment groups.
129
- * The key is the group's unique identifier, and the value is the group itself.
140
+ * The type of clipping plane to be created.
141
+ * Default is {@link SimplePlane}.
130
142
  */
131
- readonly groups: Map<string, FragmentsGroup>;
132
- baseCoordinationModel: string;
133
- /** {@link Component.enabled} */
134
- enabled: boolean;
135
- private _loader;
143
+ Type: new (...args: any) => SimplePlane;
136
144
  /**
137
- * Getter for the meshes of all fragments in the FragmentsManager.
138
- * It iterates over the fragments in the list and pushes their meshes into an array.
139
- * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
145
+ * A list of all the clipping planes created by this component.
140
146
  */
141
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
147
+ list: SimplePlane[];
148
+ /** The material used in all the clipping planes. */
149
+ private _material;
150
+ private _size;
151
+ private _enabled;
152
+ private _visible;
153
+ /** {@link Component.enabled} */
154
+ get enabled(): boolean;
155
+ /** {@link Component.enabled} */
156
+ set enabled(state: boolean);
157
+ /** {@link Hideable.visible } */
158
+ get visible(): boolean;
159
+ /** {@link Hideable.visible } */
160
+ set visible(state: boolean);
161
+ /** The material of the clipping plane representation. */
162
+ get material(): THREE.MeshBasicMaterial;
163
+ /** The material of the clipping plane representation. */
164
+ set material(material: THREE.MeshBasicMaterial);
165
+ /** The size of the geometric representation of the clippings planes. */
166
+ get size(): number;
167
+ /** The size of the geometric representation of the clippings planes. */
168
+ set size(size: number);
142
169
  constructor(components: Components);
143
170
  /** {@link Disposable.dispose} */
144
171
  dispose(): void;
172
+ /** {@link Createable.create} */
173
+ create(world: World): SimplePlane | null;
145
174
  /**
146
- * Dispose of a specific fragment group.
147
- * This method removes the group from the groups map, deletes all fragments within the group from the list,
148
- * disposes of the group, and triggers the onFragmentsDisposed event.
175
+ * Creates a plane in a certain place and with a certain orientation,
176
+ * without the need of the mouse.
149
177
  *
150
- * @param group - The fragment group to be disposed.
178
+ * @param world - the world where this plane should be created.
179
+ * @param normal - the orientation of the clipping plane.
180
+ * @param point - the position of the clipping plane.
181
+ * navigation.
151
182
  */
152
- disposeGroup(group: FragmentsGroup): void;
183
+ createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
153
184
  /**
154
- * Loads a binary file that contain fragment geometry.
155
- * @param data - The binary data to load.
156
- * @param config - Optional configuration for loading.
157
- * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
158
- * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
159
- * @returns The loaded FragmentsGroup.
185
+ * {@link Createable.delete}
186
+ *
187
+ * @param world - the world where the plane to delete is.
188
+ * @param plane - the plane to delete. If undefined, the first plane
189
+ * found under the cursor will be deleted.
160
190
  */
161
- load(data: Uint8Array, config?: Partial<{
162
- coordinate: boolean;
163
- name: string;
164
- properties: FRAGS.IfcProperties;
165
- relationsMap: RelationsMap;
166
- }>): FragmentsGroup;
191
+ delete(world: World, plane?: SimplePlane): void;
167
192
  /**
168
- * Export the specified fragmentsgroup to binary data.
169
- * @param group - the fragments group to be exported.
170
- * @returns the exported data as binary buffer.
193
+ * Deletes all the existing clipping planes.
194
+ *
195
+ * @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
171
196
  */
172
- export(group: FragmentsGroup): Uint8Array;
197
+ deleteAll(types?: Set<string>): void;
198
+ private deletePlane;
199
+ private pickPlane;
200
+ private getAllPlaneMeshes;
201
+ private createPlaneFromIntersection;
202
+ private getWorldNormal;
203
+ private normalizePlaneDirectionY;
204
+ private newPlane;
205
+ private updateMaterialsAndPlanes;
206
+ private _onStartDragging;
207
+ private _onEndDragging;
208
+ }
209
+ import { Components } from "../Components";
210
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
211
+ import { Component, Event, Disposable, World } from "../Types";
212
+ /**
213
+ * 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).
214
+ */
215
+ export declare class Cullers extends Component implements Disposable {
173
216
  /**
174
- * Gets a map of model IDs to sets of express IDs for the given fragment ID map.
175
- * @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
176
- * @returns A map of model IDs to sets of express IDs.
217
+ * A unique identifier for the component.
218
+ * This UUID is used to register the component within the Components system.
177
219
  */
178
- getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
179
- [modelID: string]: Set<number>;
180
- };
220
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
181
221
  /**
182
- * Converts a map of model IDs to sets of express IDs to a fragment ID map.
183
- * @param modelIdMap - A map of model IDs to their corresponding express IDs.
184
- * @returns A fragment ID map.
185
- * @remarks
186
- * This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
187
- * and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
188
- * The fragment ID maps are then merged into a single map and returned.
189
- * If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
222
+ * An event that is triggered when the Cullers component is disposed.
190
223
  */
191
- modelIdToFragmentIdMap(modelIdMap: {
192
- [modelID: string]: Set<number>;
193
- }): FRAGS.FragmentIdMap;
224
+ readonly onDisposed: Event<unknown>;
225
+ private _enabled;
194
226
  /**
195
- * Applies coordinate transformation to the provided models.
196
- * If no models are provided, all groups are used.
197
- * The first model in the list becomes the base model for coordinate transformation.
198
- * All other models are then transformed to match the base model's coordinate system.
227
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
228
+ */
229
+ list: Map<string, MeshCullerRenderer>;
230
+ /** {@link Component.enabled} */
231
+ get enabled(): boolean;
232
+ /** {@link Component.enabled} */
233
+ set enabled(value: boolean);
234
+ constructor(components: Components);
235
+ /**
236
+ * Creates a new MeshCullerRenderer for the given world.
237
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
199
238
  *
200
- * @param models - The models to apply coordinate transformation to.
201
- * If not provided, all groups are used.
239
+ * @param world - The world for which to create the MeshCullerRenderer.
240
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
202
241
  *
203
- * @returns {void}
242
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
204
243
  */
205
- coordinate(models?: FragmentsGroup[]): void;
206
- }
207
- import * as THREE from "three";
208
- import * as FRAGS from "@thatopen/fragments";
209
- import { Disposable, Component, Event, Components } from "../../core";
210
- /**
211
- * 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.
212
- */
213
- export interface Classification {
244
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
214
245
  /**
215
- * A system within the classification.
216
- * The key is the system name, and the value is an object representing the classes within the system.
246
+ * Deletes the MeshCullerRenderer associated with the given world.
247
+ * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
248
+ *
249
+ * @param world - The world for which to delete the MeshCullerRenderer.
250
+ *
251
+ * @returns {void}
217
252
  */
218
- [system: string]: {
219
- /**
220
- * A class within the system.
221
- * The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
222
- */
223
- [className: string]: {
224
- map: FRAGS.FragmentIdMap;
225
- name: string;
226
- id: number | null;
227
- };
228
- };
253
+ delete(world: World): void;
254
+ /** {@link Disposable.dispose} */
255
+ dispose(): void;
229
256
  }
257
+ import { MiniMap } from "./src";
258
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
259
+ import { Components } from "../Components";
230
260
  /**
231
- * 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).
261
+ * 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).
232
262
  */
233
- export declare class Classifier extends Component implements Disposable {
263
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
234
264
  /**
235
265
  * A unique identifier for the component.
236
266
  * This UUID is used to register the component within the Components system.
237
267
  */
238
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
268
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
269
+ /** {@link Updateable.onAfterUpdate} */
270
+ readonly onAfterUpdate: Event<unknown>;
271
+ /** {@link Updateable.onBeforeUpdate} */
272
+ readonly onBeforeUpdate: Event<unknown>;
273
+ /** {@link Disposable.onDisposed} */
274
+ readonly onDisposed: Event<unknown>;
239
275
  /** {@link Component.enabled} */
240
276
  enabled: boolean;
241
277
  /**
242
- * A map representing the classification systems.
243
- * The key is the system name, and the value is an object representing the classes within the system.
278
+ * A collection of {@link MiniMap} instances, each associated with a unique world ID.
244
279
  */
245
- list: Classification;
246
- /** {@link Disposable.onDisposed} */
247
- readonly onDisposed: Event<unknown>;
280
+ list: Map<string, MiniMap>;
248
281
  constructor(components: Components);
249
- private onFragmentsDisposed;
250
- /** {@link Disposable.dispose} */
251
- dispose(): void;
252
282
  /**
253
- * Removes a fragment from the classification based on its unique identifier (guid).
254
- * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
283
+ * Creates a new {@link MiniMap} instance associated with the given world.
284
+ * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
255
285
  *
256
- * @param guid - The unique identifier of the fragment to be removed.
286
+ * @param world - The {@link World} for which to create a {@link MiniMap} instance.
287
+ * @returns The newly created {@link MiniMap} instance.
288
+ * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
257
289
  */
258
- remove(guid: string): void;
290
+ create(world: World): MiniMap;
259
291
  /**
260
- * Finds and returns fragments based on the provided filter criteria.
261
- * If no filter is provided, it returns all fragments.
262
- *
263
- * @param filter - An optional object containing filter criteria.
264
- * The keys of the object represent the classification system names,
265
- * and the values are arrays of class names to match.
266
- *
267
- * @returns A map of fragment GUIDs to their respective express IDs,
268
- * where the express IDs are filtered based on the provided filter criteria.
292
+ * Deletes a {@link MiniMap} instance associated with the given world ID.
293
+ * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
269
294
  *
270
- * @throws Will throw an error if the fragments map is malformed.
295
+ * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
296
+ * @returns {void}
271
297
  */
272
- find(filter?: {
273
- [name: string]: string[];
274
- }): FRAGS.FragmentIdMap;
298
+ delete(id: string): void;
299
+ /** {@link Disposable.dispose} */
300
+ dispose(): void;
301
+ /** {@link Updateable.update} */
302
+ update(): void;
303
+ }
304
+ import * as THREE from "three";
305
+ import { Components } from "../Components";
306
+ import { SimpleCamera } from "..";
307
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
308
+ /**
309
+ * A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
310
+ */
311
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
275
312
  /**
276
- * Classifies fragments based on their modelID.
277
- *
278
- * @param modelID - The unique identifier of the model to classify fragments by.
279
- * @param group - The FragmentsGroup containing the fragments to be classified.
280
- *
281
- * @remarks
282
- * This method iterates through the fragments in the provided group,
283
- * and classifies them based on their modelID.
284
- * The classification is stored in the 'list.models' property,
285
- * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
286
- *
313
+ * A ProjectionManager instance that manages the projection modes of the camera.
287
314
  */
288
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
315
+ readonly projection: ProjectionManager;
289
316
  /**
290
- * Classifies fragments based on their PredefinedType property.
291
- *
292
- * @param group - The FragmentsGroup containing the fragments to be classified.
293
- *
294
- * @remarks
295
- * This method iterates through the properties of the fragments in the provided group,
296
- * and classifies them based on their PredefinedType property.
297
- * The classification is stored in the 'list.predefinedTypes' property,
298
- * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
299
- *
300
- * @throws Will throw an error if the fragment ID is not found.
317
+ * A THREE.OrthographicCamera instance that represents the orthographic camera.
318
+ * This camera is used when the projection mode is set to orthographic.
301
319
  */
302
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
320
+ readonly threeOrtho: THREE.OrthographicCamera;
303
321
  /**
304
- * Classifies fragments based on their entity type.
305
- *
306
- * @param group - The FragmentsGroup containing the fragments to be classified.
307
- *
308
- * @remarks
309
- * This method iterates through the relations of the fragments in the provided group,
310
- * and classifies them based on their entity type.
311
- * The classification is stored in the 'list.entities' property,
312
- * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
313
- *
314
- * @throws Will throw an error if the fragment ID is not found.
322
+ * A THREE.PerspectiveCamera instance that represents the perspective camera.
323
+ * This camera is used when the projection mode is set to perspective.
315
324
  */
316
- byEntity(group: FRAGS.FragmentsGroup): void;
325
+ readonly threePersp: THREE.PerspectiveCamera;
326
+ protected readonly _userInputButtons: any;
327
+ protected readonly _frustumSize = 50;
328
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
329
+ protected _mode: NavigationMode | null;
330
+ private previousSize;
317
331
  /**
318
- * Classifies fragments based on a specific IFC relationship.
319
- *
320
- * @param group - The FragmentsGroup containing the fragments to be classified.
321
- * @param ifcRel - The IFC relationship number to classify fragments by.
322
- * @param systemName - The name of the classification system to store the classification.
332
+ * Getter for the current navigation mode.
333
+ * Throws an error if the mode is not found or the camera is not initialized.
323
334
  *
324
- * @remarks
325
- * This method iterates through the relations of the fragments in the provided group,
326
- * and classifies them based on the specified IFC relationship.
327
- * The classification is stored in the 'list' property under the specified system name,
328
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
335
+ * @returns {NavigationMode} The current navigation mode.
329
336
  *
330
- * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
337
+ * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
331
338
  */
332
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
339
+ get mode(): NavigationMode;
340
+ constructor(components: Components);
341
+ /** {@link Disposable.dispose} */
342
+ dispose(): void;
333
343
  /**
334
- * Classifies fragments based on their spatial structure in the IFC model.
335
- *
336
- * @param model - The FragmentsGroup containing the fragments to be classified.
337
- * @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
338
- *
339
- * @remarks
340
- * This method iterates through the relations of the fragments in the provided group,
341
- * and classifies them based on their spatial structure in the IFC model.
342
- * The classification is stored in the 'list' property under the system name "spatialStructures",
343
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
344
+ * Sets a new {@link NavigationMode} and disables the previous one.
344
345
  *
345
- * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
346
+ * @param mode - The {@link NavigationMode} to set.
346
347
  */
347
- bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
348
- useProperties: boolean;
349
- }): Promise<void>;
348
+ set(mode: NavModeID): void;
350
349
  /**
351
- * Sets the color of the specified fragments.
352
- *
353
- * @param items - A map of fragment IDs to their respective express IDs.
354
- * @param color - The color to set for the fragments.
355
- * @param override - A boolean indicating whether to override the existing color of the fragments.
350
+ * Make the camera view fit all the specified meshes.
356
351
  *
357
- * @remarks
358
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
359
- * and sets their color using the 'setColor' method of the FragmentsGroup class.
360
- *
361
- * @throws Will throw an error if the fragment with the specified ID is not found.
352
+ * @param meshes the meshes to fit. If it is not defined, it will
353
+ * evaluate {@link Components.meshes}.
354
+ * @param offset the distance to the fit object
362
355
  */
363
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
356
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
364
357
  /**
365
- * Resets the color of the specified fragments to their original color.
366
- *
367
- * @param items - A map of fragment IDs to their respective express IDs.
368
- *
369
- * @remarks
370
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
371
- * and resets their color using the 'resetColor' method of the FragmentsGroup class.
358
+ * Allows or prevents all user input.
372
359
  *
373
- * @throws Will throw an error if the fragment with the specified ID is not found.
360
+ * @param active - whether to enable or disable user inputs.
374
361
  */
375
- resetColor(items: FRAGS.FragmentIdMap): void;
376
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
362
+ setUserInput(active: boolean): void;
363
+ private disableUserInput;
364
+ private enableUserInput;
365
+ private newOrthoCamera;
366
+ private setOrthoPerspCameraAspect;
377
367
  }
378
- import * as WEBIFC from "web-ifc";
379
- import * as FRAGS from "@thatopen/fragments";
380
- import { IfcFragmentSettings } from "./src";
381
- import { Component, Components, Event, Disposable } from "../../core";
368
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
369
+ import { Components } from "../Components";
370
+ import { SimpleWorld } from "./src";
382
371
  /**
383
- * The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
372
+ * A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
384
373
  */
385
- export declare class IfcLoader extends Component implements Disposable {
374
+ export declare class Worlds extends Component implements Updateable, Disposable {
386
375
  /**
387
376
  * A unique identifier for the component.
388
377
  * This UUID is used to register the component within the Components system.
389
378
  */
390
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
379
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
380
+ /** {@link Updateable.onAfterUpdate} */
381
+ readonly onAfterUpdate: Event<unknown>;
382
+ /** {@link Updateable.onBeforeUpdate} */
383
+ readonly onBeforeUpdate: Event<unknown>;
391
384
  /** {@link Disposable.onDisposed} */
392
- readonly onDisposed: Event<string>;
393
- /**
394
- * An event triggered when the IFC file starts loading.
395
- */
396
- readonly onIfcStartedLoading: Event<void>;
385
+ readonly onDisposed: Event<unknown>;
397
386
  /**
398
- * An event triggered when the setup process is completed.
387
+ * An event that is triggered when a new world is created.
388
+ * The event passes the newly created world as a parameter.
399
389
  */
400
- readonly onSetup: Event<void>;
390
+ readonly onWorldCreated: Event<World>;
401
391
  /**
402
- * The settings for the IfcLoader.
403
- * It includes options for excluding categories, setting WASM paths, and more.
392
+ * An event that is triggered when a world is deleted.
393
+ * The event passes the UUID of the deleted world as a parameter.
404
394
  */
405
- settings: IfcFragmentSettings;
395
+ readonly onWorldDeleted: Event<string>;
406
396
  /**
407
- * The instance of the Web-IFC library used for handling IFC data.
397
+ * A collection of worlds managed by this component.
398
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
408
399
  */
409
- webIfc: WEBIFC.IfcAPI;
400
+ list: Map<string, World>;
410
401
  /** {@link Component.enabled} */
411
402
  enabled: boolean;
412
- private _material;
413
- private _spatialTree;
414
- private _metaData;
415
- private _fragmentInstances;
416
- private _civil;
417
- private _visitedFragments;
418
- private _materialT;
419
403
  constructor(components: Components);
420
- /** {@link Disposable.dispose} */
421
- dispose(): void;
422
- /**
423
- * Sets up the IfcLoader component with the provided configuration.
424
- *
425
- * @param config - Optional configuration settings for the IfcLoader.
426
- * If not provided, the existing settings will be used.
427
- *
428
- * @returns A Promise that resolves when the setup process is completed.
429
- *
430
- * @remarks
431
- * If the 'autoSetWasm' option is enabled in the configuration,
432
- * the method will automatically set the WASM paths for the Web-IFC library.
433
- *
434
- * @example
435
- * '''typescript
436
- * const ifcLoader = new IfcLoader(components);
437
- * await ifcLoader.setup({ autoSetWasm: true });
438
- * '''
439
- */
440
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
441
404
  /**
442
- * Loads an IFC file and processes it for 3D visualization.
443
- *
444
- * @param data - The Uint8Array containing the IFC file data.
445
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
405
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
446
406
  *
447
- * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
407
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
408
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
409
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
448
410
  *
449
- * @example
450
- * '''typescript
451
- * const ifcLoader = components.get(IfcLoader);
452
- * const group = await ifcLoader.load(ifcData);
453
- * '''
411
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
454
412
  */
455
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
413
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
456
414
  /**
457
- * Reads an IFC file and initializes the Web-IFC library.
458
- *
459
- * @param data - The Uint8Array containing the IFC file data.
415
+ * Deletes a world from the list of worlds.
460
416
  *
461
- * @returns A Promise that resolves when the IFC file is opened and initialized.
417
+ * @param {World} world - The world to be deleted.
462
418
  *
463
- * @remarks
464
- * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
465
- * It also opens the IFC model using the provided data and settings.
419
+ * @throws {Error} - Throws an error if the provided world is not found in the list.
466
420
  *
467
- * @example
468
- * '''typescript
469
- * const ifcLoader = components.get(IfcLoader);
470
- * await ifcLoader.readIfcFile(ifcData);
471
- * '''
421
+ * @returns {void}
472
422
  */
473
- readIfcFile(data: Uint8Array): Promise<number>;
423
+ delete(world: World): void;
474
424
  /**
475
- * Cleans up the IfcLoader component by resetting the Web-IFC library,
476
- * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
477
- *
478
- * @remarks
479
- * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
425
+ * Disposes of the Worlds component and all its managed worlds.
426
+ * This method sets the enabled flag to false, disposes of all worlds, clears the list,
427
+ * and triggers the onDisposed event.
480
428
  *
481
- * @example
482
- * '''typescript
483
- * const ifcLoader = components.get(IfcLoader);
484
- * ifcLoader.cleanUp();
485
- * '''
429
+ * @returns {void}
486
430
  */
487
- cleanUp(): void;
488
- private getAllGeometries;
489
- private getMesh;
490
- private getGeometry;
491
- private autoSetWasm;
431
+ dispose(): void;
432
+ /** {@link Updateable.update} */
433
+ update(delta?: number): void | Promise<void>;
492
434
  }
493
- import * as WEBIFC from "web-ifc";
494
- import { Components, Disposable, Event, Component } from "../../core";
495
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
435
+ import { Component, Disposable, World, Event } from "../Types";
436
+ import { SimpleRaycaster } from "./src";
437
+ import { Components } from "../Components";
496
438
  /**
497
- * A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
439
+ * A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
498
440
  */
499
- export declare class IfcGeometryTiler extends Component implements Disposable {
441
+ export declare class Raycasters extends Component implements Disposable {
500
442
  /**
501
443
  * A unique identifier for the component.
502
444
  * This UUID is used to register the component within the Components system.
503
445
  */
504
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
446
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
447
+ /** {@link Component.enabled} */
448
+ enabled: boolean;
505
449
  /**
506
- * Event triggered when geometry is streamed.
507
- * Contains the streamed geometry data and its buffer.
450
+ * A Map that stores raycasters for each world.
451
+ * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
508
452
  */
509
- readonly onGeometryStreamed: Event<{
510
- buffer: Uint8Array;
511
- data: StreamedGeometries;
512
- }>;
453
+ list: Map<string, SimpleRaycaster>;
454
+ /** {@link Disposable.onDisposed} */
455
+ onDisposed: Event<unknown>;
456
+ constructor(components: Components);
513
457
  /**
514
- * Event triggered when assets are streamed.
515
- * Contains the streamed assets.
458
+ * Retrieves a SimpleRaycaster instance for the given world.
459
+ * If a SimpleRaycaster instance already exists for the world, it will be returned.
460
+ * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
461
+ *
462
+ * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
463
+ * @returns The SimpleRaycaster instance for the given world.
516
464
  */
517
- readonly onAssetStreamed: Event<StreamedAsset[]>;
465
+ get(world: World): SimpleRaycaster;
518
466
  /**
519
- * Event triggered to indicate the progress of the streaming process.
520
- * Contains the progress percentage.
467
+ * Deletes the SimpleRaycaster instance associated with the given world.
468
+ * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
469
+ *
470
+ * @param world - The world for which to delete the SimpleRaycaster instance.
471
+ * @returns {void}
521
472
  */
522
- readonly onProgress: Event<number>;
473
+ delete(world: World): void;
474
+ /** {@link Disposable.dispose} */
475
+ dispose(): void;
476
+ }
477
+ import { Component, Disposable, World, Event } from "../Types";
478
+ import { GridConfig, SimpleGrid } from "./src";
479
+ import { Components } from "../Components";
480
+ /**
481
+ * 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).
482
+ */
483
+ export declare class Grids extends Component implements Disposable {
523
484
  /**
524
- * Event triggered when the IFC file is loaded.
525
- * Contains the loaded IFC file data.
485
+ * A unique identifier for the component.
486
+ * This UUID is used to register the component within the Components system.
526
487
  */
527
- readonly onIfcLoaded: Event<Uint8Array>;
528
- /** {@link Disposable.onDisposed} */
529
- readonly onDisposed: Event<unknown>;
488
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
530
489
  /**
531
- * Settings for the IfcGeometryTiler.
490
+ * A map of world UUIDs to their corresponding grid instances.
532
491
  */
533
- settings: IfcStreamingSettings;
492
+ list: Map<string, SimpleGrid>;
493
+ /**
494
+ * The default configuration for grid creation.
495
+ */
496
+ config: Required<GridConfig>;
497
+ /** {@link Disposable.onDisposed} */
498
+ readonly onDisposed: Event<unknown>;
534
499
  /** {@link Component.enabled} */
535
500
  enabled: boolean;
501
+ constructor(components: Components);
536
502
  /**
537
- * The WebIFC API instance used for IFC file processing.
503
+ * Creates a new grid for the given world.
504
+ * Throws an error if a grid already exists for the world.
505
+ *
506
+ * @param world - The world to create the grid for.
507
+ * @returns The newly created grid.
508
+ *
509
+ * @throws Will throw an error if a grid already exists for the given world.
538
510
  */
539
- webIfc: WEBIFC.IfcAPI;
540
- private _spatialTree;
541
- private _metaData;
542
- private _visitedGeometries;
543
- private _streamSerializer;
544
- private _geometries;
545
- private _geometryCount;
546
- private _civil;
547
- private _groupSerializer;
548
- private _assets;
549
- private _meshesWithHoles;
550
- constructor(components: Components);
551
- /** {@link Disposable.dispose} */
552
- dispose(): void;
511
+ create(world: World): SimpleGrid;
553
512
  /**
554
- * This method streams the IFC file from a given buffer.
513
+ * Deletes the grid associated with the given world.
514
+ * If a grid does not exist for the given world, this method does nothing.
555
515
  *
556
- * @param data - The Uint8Array containing the IFC file data.
557
- * @returns A Promise that resolves when the streaming process is complete.
516
+ * @param world - The world for which to delete the grid.
558
517
  *
559
518
  * @remarks
560
- * This method cleans up any resources after the streaming process is complete.
561
- *
562
- * @example
563
- * '''typescript
564
- * const ifcData = await fetch('path/to/ifc/file.ifc');
565
- * const rawBuffer = await response.arrayBuffer();
566
- * const ifcBuffer = new Uint8Array(rawBuffer);
567
- * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
568
- * '''
519
+ * This method will dispose of the grid and remove it from the internal list.
520
+ * If the world is disposed before calling this method, the grid will be automatically deleted.
569
521
  */
570
- streamFromBuffer(data: Uint8Array): Promise<void>;
522
+ delete(world: World): void;
523
+ /** {@link Disposable.dispose} */
524
+ dispose(): void;
525
+ }
526
+ import * as THREE from "three";
527
+ import { Components } from "../Components";
528
+ import { Component } from "../Types";
529
+ /**
530
+ * A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
531
+ */
532
+ export declare class Disposer extends Component {
533
+ private _disposedComponents;
534
+ /** {@link Component.enabled} */
535
+ enabled: boolean;
571
536
  /**
572
- * This method streams the IFC file from a given callback.
537
+ * A unique identifier for the component.
538
+ * This UUID is used to register the component within the Components system.
539
+ */
540
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
541
+ constructor(components: Components);
542
+ /**
543
+ * Return the UUIDs of all disposed components.
544
+ */
545
+ get(): Set<string>;
546
+ /**
547
+ * Removes a mesh, its geometry and its materials from memory. If you are
548
+ * using any of these in other parts of the application, make sure that you
549
+ * remove them from the mesh before disposing it.
573
550
  *
574
- * @param loadCallback - The callback function that will be used to load the IFC file.
575
- * @returns A Promise that resolves when the streaming process is complete.
551
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
552
+ * to remove.
553
+ *
554
+ * @param materials - whether to dispose the materials of the mesh.
555
+ *
556
+ * @param recursive - whether to recursively dispose the children of the mesh.
557
+ */
558
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
559
+ /**
560
+ * Disposes a geometry from memory.
561
+ *
562
+ * @param geometry - the
563
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
564
+ * to remove.
565
+ */
566
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
567
+ private disposeGeometryAndMaterials;
568
+ private disposeChildren;
569
+ private static disposeMaterial;
570
+ }
571
+ import * as THREE from "three";
572
+ import * as FRAGS from "@thatopen/fragments";
573
+ import { Disposable, Component, Event, Components } from "../../core";
574
+ /**
575
+ * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
576
+ */
577
+ export interface Classification {
578
+ /**
579
+ * A system within the classification.
580
+ * The key is the system name, and the value is an object representing the classes within the system.
581
+ */
582
+ [system: string]: {
583
+ /**
584
+ * A class within the system.
585
+ * The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
586
+ */
587
+ [className: string]: {
588
+ map: FRAGS.FragmentIdMap;
589
+ name: string;
590
+ id: number | null;
591
+ };
592
+ };
593
+ }
594
+ /**
595
+ * The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
596
+ */
597
+ export declare class Classifier extends Component implements Disposable {
598
+ /**
599
+ * A unique identifier for the component.
600
+ * This UUID is used to register the component within the Components system.
601
+ */
602
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
603
+ /** {@link Component.enabled} */
604
+ enabled: boolean;
605
+ /**
606
+ * A map representing the classification systems.
607
+ * The key is the system name, and the value is an object representing the classes within the system.
608
+ */
609
+ list: Classification;
610
+ /** {@link Disposable.onDisposed} */
611
+ readonly onDisposed: Event<unknown>;
612
+ constructor(components: Components);
613
+ private onFragmentsDisposed;
614
+ /** {@link Disposable.dispose} */
615
+ dispose(): void;
616
+ /**
617
+ * Removes a fragment from the classification based on its unique identifier (guid).
618
+ * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
619
+ *
620
+ * @param guid - The unique identifier of the fragment to be removed.
621
+ */
622
+ remove(guid: string): void;
623
+ /**
624
+ * Finds and returns fragments based on the provided filter criteria.
625
+ * If no filter is provided, it returns all fragments.
626
+ *
627
+ * @param filter - An optional object containing filter criteria.
628
+ * The keys of the object represent the classification system names,
629
+ * and the values are arrays of class names to match.
630
+ *
631
+ * @returns A map of fragment GUIDs to their respective express IDs,
632
+ * where the express IDs are filtered based on the provided filter criteria.
633
+ *
634
+ * @throws Will throw an error if the fragments map is malformed.
635
+ */
636
+ find(filter?: {
637
+ [name: string]: string[];
638
+ }): FRAGS.FragmentIdMap;
639
+ /**
640
+ * Classifies fragments based on their modelID.
641
+ *
642
+ * @param modelID - The unique identifier of the model to classify fragments by.
643
+ * @param group - The FragmentsGroup containing the fragments to be classified.
576
644
  *
577
645
  * @remarks
578
- * This method cleans up any resources after the streaming process is complete.
646
+ * This method iterates through the fragments in the provided group,
647
+ * and classifies them based on their modelID.
648
+ * The classification is stored in the 'list.models' property,
649
+ * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
579
650
  *
580
651
  */
581
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
582
- private readIfcFile;
583
- private streamIfcFile;
584
- private streamAllGeometries;
585
- private cleanUp;
586
- private getMesh;
587
- private getGeometry;
588
- private streamAssets;
589
- private streamGeometries;
652
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
653
+ /**
654
+ * Classifies fragments based on their PredefinedType property.
655
+ *
656
+ * @param group - The FragmentsGroup containing the fragments to be classified.
657
+ *
658
+ * @remarks
659
+ * This method iterates through the properties of the fragments in the provided group,
660
+ * and classifies them based on their PredefinedType property.
661
+ * The classification is stored in the 'list.predefinedTypes' property,
662
+ * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
663
+ *
664
+ * @throws Will throw an error if the fragment ID is not found.
665
+ */
666
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
667
+ /**
668
+ * Classifies fragments based on their entity type.
669
+ *
670
+ * @param group - The FragmentsGroup containing the fragments to be classified.
671
+ *
672
+ * @remarks
673
+ * This method iterates through the relations of the fragments in the provided group,
674
+ * and classifies them based on their entity type.
675
+ * The classification is stored in the 'list.entities' property,
676
+ * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
677
+ *
678
+ * @throws Will throw an error if the fragment ID is not found.
679
+ */
680
+ byEntity(group: FRAGS.FragmentsGroup): void;
681
+ /**
682
+ * Classifies fragments based on a specific IFC relationship.
683
+ *
684
+ * @param group - The FragmentsGroup containing the fragments to be classified.
685
+ * @param ifcRel - The IFC relationship number to classify fragments by.
686
+ * @param systemName - The name of the classification system to store the classification.
687
+ *
688
+ * @remarks
689
+ * This method iterates through the relations of the fragments in the provided group,
690
+ * and classifies them based on the specified IFC relationship.
691
+ * The classification is stored in the 'list' property under the specified system name,
692
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
693
+ *
694
+ * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
695
+ */
696
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
697
+ /**
698
+ * Classifies fragments based on their spatial structure in the IFC model.
699
+ *
700
+ * @param model - The FragmentsGroup containing the fragments to be classified.
701
+ * @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
702
+ *
703
+ * @remarks
704
+ * This method iterates through the relations of the fragments in the provided group,
705
+ * and classifies them based on their spatial structure in the IFC model.
706
+ * The classification is stored in the 'list' property under the system name "spatialStructures",
707
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
708
+ *
709
+ * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
710
+ */
711
+ bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
712
+ useProperties: boolean;
713
+ }): Promise<void>;
714
+ /**
715
+ * Sets the color of the specified fragments.
716
+ *
717
+ * @param items - A map of fragment IDs to their respective express IDs.
718
+ * @param color - The color to set for the fragments.
719
+ * @param override - A boolean indicating whether to override the existing color of the fragments.
720
+ *
721
+ * @remarks
722
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
723
+ * and sets their color using the 'setColor' method of the FragmentsGroup class.
724
+ *
725
+ * @throws Will throw an error if the fragment with the specified ID is not found.
726
+ */
727
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
728
+ /**
729
+ * Resets the color of the specified fragments to their original color.
730
+ *
731
+ * @param items - A map of fragment IDs to their respective express IDs.
732
+ *
733
+ * @remarks
734
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
735
+ * and resets their color using the 'resetColor' method of the FragmentsGroup class.
736
+ *
737
+ * @throws Will throw an error if the fragment with the specified ID is not found.
738
+ */
739
+ resetColor(items: FRAGS.FragmentIdMap): void;
740
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
590
741
  }
591
742
  import * as THREE from "three";
592
743
  import * as FRAGS from "@thatopen/fragments";
@@ -796,832 +947,898 @@ export declare class BoundingBoxer extends Component implements Disposable {
796
947
  addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
797
948
  private static getFragmentBounds;
798
949
  }
799
- import * as WEBIFC from "web-ifc";
800
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
801
- import { PropertiesStreamingSettings } from "./src";
950
+ import * as FRAGS from "@thatopen/fragments";
951
+ import { Components, Component } from "../../core";
802
952
  /**
803
- * A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
953
+ * A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
804
954
  */
805
- export declare class IfcPropertiesTiler extends Component implements Disposable {
955
+ export declare class Hider extends Component {
806
956
  /**
807
957
  * A unique identifier for the component.
808
958
  * This UUID is used to register the component within the Components system.
809
959
  */
810
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
960
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
961
+ /** {@link Component.enabled} */
962
+ enabled: boolean;
963
+ constructor(components: Components);
811
964
  /**
812
- * An event that is triggered when properties are streamed from the IFC file.
813
- * The event provides the type of the IFC entity and the corresponding data.
814
- */
815
- readonly onPropertiesStreamed: AsyncEvent<{
816
- type: number;
817
- data: {
818
- [id: number]: any;
819
- };
965
+ * Sets the visibility of fragments within the 3D scene.
966
+ * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
967
+ * If 'items' is provided, only the specified fragments will be affected.
968
+ *
969
+ * @param visible - The visibility state to set for the fragments.
970
+ * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
971
+ * If not provided, all fragments will be affected.
972
+ *
973
+ * @returns {void}
974
+ */
975
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
976
+ /**
977
+ * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
978
+ * It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
979
+ *
980
+ * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
981
+ * If not provided, all fragments will be isolated.
982
+ *
983
+ * @returns {void}
984
+ */
985
+ isolate(items: FRAGS.FragmentIdMap): void;
986
+ private updateCulledVisibility;
987
+ }
988
+ import * as WEBIFC from "web-ifc";
989
+ import { Components, Disposable, Event, Component } from "../../core";
990
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
991
+ /**
992
+ * A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
993
+ */
994
+ export declare class IfcGeometryTiler extends Component implements Disposable {
995
+ /**
996
+ * A unique identifier for the component.
997
+ * This UUID is used to register the component within the Components system.
998
+ */
999
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1000
+ /**
1001
+ * Event triggered when geometry is streamed.
1002
+ * Contains the streamed geometry data and its buffer.
1003
+ */
1004
+ readonly onGeometryStreamed: Event<{
1005
+ buffer: Uint8Array;
1006
+ data: StreamedGeometries;
820
1007
  }>;
821
1008
  /**
822
- * An event that is triggered to indicate the progress of the streaming process.
823
- * The event provides a number between 0 and 1 representing the progress percentage.
1009
+ * Event triggered when assets are streamed.
1010
+ * Contains the streamed assets.
824
1011
  */
825
- readonly onProgress: AsyncEvent<number>;
1012
+ readonly onAssetStreamed: Event<StreamedAsset[]>;
826
1013
  /**
827
- * An event that is triggered when indices are streamed from the IFC file.
828
- * The event provides a map of indices, where the key is the entity type and the value is another map of indices.
1014
+ * Event triggered to indicate the progress of the streaming process.
1015
+ * Contains the progress percentage.
829
1016
  */
830
- readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
1017
+ readonly onProgress: Event<number>;
1018
+ /**
1019
+ * Event triggered when the IFC file is loaded.
1020
+ * Contains the loaded IFC file data.
1021
+ */
1022
+ readonly onIfcLoaded: Event<Uint8Array>;
831
1023
  /** {@link Disposable.onDisposed} */
832
- readonly onDisposed: Event<string>;
833
- /** {@link Component.enabled} */
834
- enabled: boolean;
1024
+ readonly onDisposed: Event<unknown>;
835
1025
  /**
836
- * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
1026
+ * Settings for the IfcGeometryTiler.
837
1027
  */
838
- settings: PropertiesStreamingSettings;
1028
+ settings: IfcStreamingSettings;
1029
+ /** {@link Component.enabled} */
1030
+ enabled: boolean;
839
1031
  /**
840
- * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
1032
+ * The WebIFC API instance used for IFC file processing.
841
1033
  */
842
1034
  webIfc: WEBIFC.IfcAPI;
1035
+ private _spatialTree;
1036
+ private _metaData;
1037
+ private _visitedGeometries;
1038
+ private _streamSerializer;
1039
+ private _geometries;
1040
+ private _geometryCount;
1041
+ private _civil;
1042
+ private _groupSerializer;
1043
+ private _assets;
1044
+ private _meshesWithHoles;
1045
+ constructor(components: Components);
843
1046
  /** {@link Disposable.dispose} */
844
- dispose(): Promise<void>;
1047
+ dispose(): void;
845
1048
  /**
846
- * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1049
+ * This method streams the IFC file from a given buffer.
847
1050
  *
848
1051
  * @param data - The Uint8Array containing the IFC file data.
849
1052
  * @returns A Promise that resolves when the streaming process is complete.
1053
+ *
1054
+ * @remarks
1055
+ * This method cleans up any resources after the streaming process is complete.
1056
+ *
1057
+ * @example
1058
+ * '''typescript
1059
+ * const ifcData = await fetch('path/to/ifc/file.ifc');
1060
+ * const rawBuffer = await response.arrayBuffer();
1061
+ * const ifcBuffer = new Uint8Array(rawBuffer);
1062
+ * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
1063
+ * '''
850
1064
  */
851
1065
  streamFromBuffer(data: Uint8Array): Promise<void>;
852
1066
  /**
853
- * This method converts properties from an IFC file to tiles using a given callback function to read the file.
1067
+ * This method streams the IFC file from a given callback.
854
1068
  *
855
- * @param loadCallback - A callback function that loads the IFC file data.
1069
+ * @param loadCallback - The callback function that will be used to load the IFC file.
856
1070
  * @returns A Promise that resolves when the streaming process is complete.
1071
+ *
1072
+ * @remarks
1073
+ * This method cleans up any resources after the streaming process is complete.
1074
+ *
857
1075
  */
858
1076
  streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
859
1077
  private readIfcFile;
860
1078
  private streamIfcFile;
861
- private streamAllProperties;
1079
+ private streamAllGeometries;
862
1080
  private cleanUp;
1081
+ private getMesh;
1082
+ private getGeometry;
1083
+ private streamAssets;
1084
+ private streamGeometries;
863
1085
  }
864
- export declare class UUID {
865
- private static _pattern;
866
- private static _lut;
867
- static create(): string;
868
- static validate(uuid: string): void;
869
- }
1086
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
870
1087
  import * as THREE from "three";
871
- import { Component, Components, Disposable, Event, World } from "../core";
1088
+ import * as FRAGS from "@thatopen/fragments";
1089
+ import { Component, Components, Event, Disposable } from "../../core";
1090
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
872
1091
  /**
873
- * Configuration interface for the VertexPicker component.
1092
+ * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
874
1093
  */
875
- export interface VertexPickerConfig {
876
- /**
877
- * If true, only vertices will be picked, not the closest point on the face.
878
- */
879
- showOnlyVertex: boolean;
880
- /**
881
- * The maximum distance for snapping to a vertex.
882
- */
883
- snapDistance: number;
1094
+ export declare class FragmentsManager extends Component implements Disposable {
884
1095
  /**
885
- * The HTML element to use for previewing the picked vertex.
1096
+ * A unique identifier for the component.
1097
+ * This UUID is used to register the component within the Components system.
886
1098
  */
887
- previewElement: HTMLElement;
888
- }
889
- /**
890
- * A class that provides functionality for picking vertices in a 3D scene.
891
- */
892
- export declare class VertexPicker extends Component implements Disposable {
1099
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
893
1100
  /** {@link Disposable.onDisposed} */
894
1101
  readonly onDisposed: Event<unknown>;
895
1102
  /**
896
- * An event that is triggered when a vertex is found.
897
- * The event passes a THREE.Vector3 representing the position of the found vertex.
1103
+ * Event triggered when fragments are loaded.
898
1104
  */
899
- readonly onVertexFound: Event<THREE.Vector3>;
1105
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
900
1106
  /**
901
- * An event that is triggered when a vertex is lost.
902
- * The event passes a THREE.Vector3 representing the position of the lost vertex.
1107
+ * Event triggered when fragments are disposed.
903
1108
  */
904
- readonly onVertexLost: Event<THREE.Vector3>;
1109
+ readonly onFragmentsDisposed: Event<{
1110
+ groupID: string;
1111
+ fragmentIDs: string[];
1112
+ }>;
905
1113
  /**
906
- * An event that is triggered when the picker is enabled or disabled
1114
+ * Map containing all loaded fragments.
1115
+ * The key is the fragment's unique identifier, and the value is the fragment itself.
907
1116
  */
908
- readonly onEnabled: Event<boolean>;
1117
+ readonly list: Map<string, Fragment>;
909
1118
  /**
910
- * A reference to the Components instance associated with this VertexPicker.
1119
+ * Map containing all loaded fragment groups.
1120
+ * The key is the group's unique identifier, and the value is the group itself.
911
1121
  */
912
- components: Components;
1122
+ readonly groups: Map<string, FragmentsGroup>;
1123
+ baseCoordinationModel: string;
1124
+ /** {@link Component.enabled} */
1125
+ enabled: boolean;
1126
+ private _loader;
913
1127
  /**
914
- * A reference to the working plane used for vertex picking.
915
- * This plane is used to determine which vertices are considered valid for picking.
916
- * If this value is null, all vertices are considered valid.
1128
+ * Getter for the meshes of all fragments in the FragmentsManager.
1129
+ * It iterates over the fragments in the list and pushes their meshes into an array.
1130
+ * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
917
1131
  */
918
- workingPlane: THREE.Plane | null;
919
- private _pickedPoint;
920
- private _config;
921
- private _enabled;
1132
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
1133
+ constructor(components: Components);
1134
+ /** {@link Disposable.dispose} */
1135
+ dispose(): void;
922
1136
  /**
923
- * Sets the enabled state of the VertexPicker.
924
- * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
925
- * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1137
+ * Dispose of a specific fragment group.
1138
+ * This method removes the group from the groups map, deletes all fragments within the group from the list,
1139
+ * disposes of the group, and triggers the onFragmentsDisposed event.
926
1140
  *
927
- * @param value - The new enabled state.
1141
+ * @param group - The fragment group to be disposed.
928
1142
  */
929
- set enabled(value: boolean);
1143
+ disposeGroup(group: FragmentsGroup): void;
930
1144
  /**
931
- * Gets the current enabled state of the VertexPicker.
932
- *
933
- * @returns The current enabled state.
1145
+ * Loads a binary file that contain fragment geometry.
1146
+ * @param data - The binary data to load.
1147
+ * @param config - Optional configuration for loading.
1148
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
1149
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
1150
+ * @returns The loaded FragmentsGroup.
934
1151
  */
935
- get enabled(): boolean;
1152
+ load(data: Uint8Array, config?: Partial<{
1153
+ coordinate: boolean;
1154
+ name: string;
1155
+ properties: FRAGS.IfcProperties;
1156
+ relationsMap: RelationsMap;
1157
+ }>): FragmentsGroup;
936
1158
  /**
937
- * Sets the configuration for the VertexPicker component.
938
- *
939
- * @param value - A Partial object containing the configuration properties to update.
940
- * The properties not provided in the value object will retain their current values.
941
- *
942
- * @example
943
- * '''typescript
944
- * vertexPicker.config = {
945
- * snapDistance: 0.5,
946
- * showOnlyVertex: true,
947
- * };
948
- * '''
1159
+ * Export the specified fragmentsgroup to binary data.
1160
+ * @param group - the fragments group to be exported.
1161
+ * @returns the exported data as binary buffer.
949
1162
  */
950
- set config(value: Partial<VertexPickerConfig>);
1163
+ export(group: FragmentsGroup): Uint8Array;
951
1164
  /**
952
- * Gets the current configuration for the VertexPicker component.
953
- *
954
- * @returns A copy of the current VertexPickerConfig object.
955
- *
956
- * @example
957
- * '''typescript
958
- * const currentConfig = vertexPicker.config;
959
- * console.log(currentConfig.snapDistance); // Output: 0.25
960
- * '''
1165
+ * Gets a map of model IDs to sets of express IDs for the given fragment ID map.
1166
+ * @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
1167
+ * @returns A map of model IDs to sets of express IDs.
961
1168
  */
962
- get config(): Partial<VertexPickerConfig>;
963
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
964
- /** {@link Disposable.dispose} */
965
- dispose(): void;
1169
+ getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
1170
+ [modelID: string]: Set<number>;
1171
+ };
966
1172
  /**
967
- * Performs the vertex picking operation based on the current state of the VertexPicker.
968
- *
969
- * @param world - The World instance to use for raycasting.
970
- *
971
- * @returns The current picked point, or null if no point is picked.
972
- *
973
- * @remarks
974
- * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
975
- * If enabled, it performs raycasting to find the closest intersecting object.
976
- * It then determines the closest vertex or point on the face, based on the configuration settings.
977
- * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
978
- * If the picked point is not on the working plane, it resets the 'pickedPoint'.
979
- * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
1173
+ * Converts a map of model IDs to sets of express IDs to a fragment ID map.
1174
+ * @param modelIdMap - A map of model IDs to their corresponding express IDs.
1175
+ * @returns A fragment ID map.
1176
+ * @remarks
1177
+ * This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
1178
+ * and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
1179
+ * The fragment ID maps are then merged into a single map and returned.
1180
+ * If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
980
1181
  */
981
- get(world: World): THREE.Vector3 | null;
982
- private getClosestVertex;
983
- private getVertices;
984
- private getVertex;
1182
+ modelIdToFragmentIdMap(modelIdMap: {
1183
+ [modelID: string]: Set<number>;
1184
+ }): FRAGS.FragmentIdMap;
1185
+ /**
1186
+ * Applies coordinate transformation to the provided models.
1187
+ * If no models are provided, all groups are used.
1188
+ * The first model in the list becomes the base model for coordinate transformation.
1189
+ * All other models are then transformed to match the base model's coordinate system.
1190
+ *
1191
+ * @param models - The models to apply coordinate transformation to.
1192
+ * If not provided, all groups are used.
1193
+ *
1194
+ * @returns {void}
1195
+ */
1196
+ coordinate(models?: FragmentsGroup[]): void;
985
1197
  }
986
- import * as THREE from "three";
987
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
988
- center: THREE.Vector3;
989
- halfSizes: THREE.Vector3;
990
- rotation: THREE.Matrix3;
991
- transformation: THREE.Matrix4;
992
- };
993
1198
  import * as WEBIFC from "web-ifc";
994
1199
  import { FragmentsGroup } from "@thatopen/fragments";
995
- import { Component, Disposable, Event, Components } from "../../core";
996
- /**
997
- * Types for boolean properties in IFC schema.
998
- */
999
- export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
1000
- /**
1001
- * Types for string properties in IFC schema.
1002
- */
1003
- export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
1004
- /**
1005
- * Types for numeric properties in IFC schema.
1006
- */
1007
- export type NumericPropTypes = "IfcInteger" | "IfcReal";
1008
- /**
1009
- * 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.
1010
- */
1011
- export interface ChangeMap {
1012
- [modelID: string]: Set<number>;
1013
- }
1014
- /**
1015
- * 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.
1016
- */
1017
- export interface AttributeListener {
1018
- [modelID: string]: {
1019
- [expressID: number]: {
1020
- [attributeName: string]: Event<String | Boolean | Number>;
1021
- };
1022
- };
1023
- }
1200
+ import { Disposable, Event, Component, Components } from "../../core";
1201
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
1202
+ export type { InverseAttribute, RelationsMap } from "./src/types";
1024
1203
  /**
1025
- * Component to manage and edit properties and Psets in IFC files.
1204
+ * 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).
1026
1205
  */
1027
- export declare class IfcPropertiesManager extends Component implements Disposable {
1206
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
1028
1207
  /**
1029
1208
  * A unique identifier for the component.
1030
1209
  * This UUID is used to register the component within the Components system.
1031
1210
  */
1032
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
1211
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1033
1212
  /** {@link Disposable.onDisposed} */
1034
1213
  readonly onDisposed: Event<string>;
1035
1214
  /**
1036
- * Event triggered when a file is requested for export.
1037
- */
1038
- readonly onRequestFile: Event<unknown>;
1039
- /**
1040
- * ArrayBuffer containing the IFC data to be exported.
1041
- */
1042
- ifcToExport: ArrayBuffer | null;
1043
- /**
1044
- * Event triggered when an element is added to a Pset.
1045
- */
1046
- readonly onElementToPset: Event<{
1047
- model: FragmentsGroup;
1048
- psetID: number;
1049
- elementID: number;
1050
- }>;
1051
- /**
1052
- * Event triggered when a property is added to a Pset.
1053
- */
1054
- readonly onPropToPset: Event<{
1055
- model: FragmentsGroup;
1056
- psetID: number;
1057
- propID: number;
1058
- }>;
1059
- /**
1060
- * Event triggered when a Pset is removed.
1061
- */
1062
- readonly onPsetRemoved: Event<{
1063
- model: FragmentsGroup;
1064
- psetID: number;
1065
- }>;
1066
- /**
1067
- * Event triggered when data in the model changes.
1215
+ * Event triggered when relations for a model have been indexed.
1216
+ * This event provides the model's UUID and the relations map generated for that model.
1217
+ *
1218
+ * @property {string} modelID - The UUID of the model for which relations have been indexed.
1219
+ * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1220
+ * 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.
1068
1221
  */
1069
- readonly onDataChanged: Event<{
1070
- model: FragmentsGroup;
1071
- expressID: number;
1222
+ readonly onRelationsIndexed: Event<{
1223
+ modelID: string;
1224
+ relationsMap: RelationsMap;
1072
1225
  }>;
1073
1226
  /**
1074
- * Configuration for the WebAssembly module.
1227
+ * Holds the relationship mappings for each model processed by the indexer.
1228
+ * The structure is a map where each key is a model's UUID, and the value is another map.
1229
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1230
+ * representing a specific relation type, and the value is an array of expressIDs of entities
1231
+ * that are related through that relation type. This structure allows for efficient querying
1232
+ * of entity relationships within a model.
1075
1233
  */
1076
- wasm: {
1077
- path: string;
1078
- absolute: boolean;
1079
- };
1234
+ readonly relationMaps: ModelsRelationMap;
1080
1235
  /** {@link Component.enabled} */
1081
1236
  enabled: boolean;
1237
+ private _relToAttributesMap;
1238
+ private _inverseAttributes;
1239
+ private _ifcRels;
1240
+ constructor(components: Components);
1241
+ private onFragmentsDisposed;
1242
+ private indexRelations;
1082
1243
  /**
1083
- * Map of attribute listeners.
1244
+ * Adds a relation map to the model's relations map.
1245
+ *
1246
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1247
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1248
+ *
1249
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1084
1250
  */
1085
- attributeListeners: AttributeListener;
1251
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
1086
1252
  /**
1087
- * The currently selected model.
1253
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
1254
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
1255
+ * and maps them in a structured way to facilitate quick access to related entities.
1256
+ *
1257
+ * The process involves querying the model for each relation type associated with the inverse attributes
1258
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
1259
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
1260
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
1261
+ * of entities that are related through that attribute.
1262
+ *
1263
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
1264
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
1265
+ * representation of the relations indexed by entity expressIDs and relation types.
1266
+ * @throws An error if the model does not have properties loaded.
1088
1267
  */
1089
- selectedModel?: FragmentsGroup;
1268
+ process(model: FragmentsGroup): Promise<RelationsMap>;
1090
1269
  /**
1091
- * Map of changed entities in the model.
1270
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
1271
+ *
1272
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
1273
+ * @param modelID - The unique identifier of the model within the WebIfc API.
1274
+ * @returns A promise that resolves to the relations map for the processed model.
1275
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
1092
1276
  */
1093
- changeMap: ChangeMap;
1094
- constructor(components: Components);
1095
- /** {@link Disposable.dispose} */
1096
- dispose(): void;
1277
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
1097
1278
  /**
1098
- * Static method to retrieve the IFC schema from a given model.
1279
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
1280
+ * This method searches the indexed relation maps for the specified model and entity,
1281
+ * returning the IDs of related entities if a match is found.
1099
1282
  *
1100
- * @param model - The FragmentsGroup model from which to retrieve the IFC schema.
1101
- * @throws Will throw an error if the IFC schema is not found in the model.
1102
- * @returns The IFC schema associated with the given model.
1283
+ * @param model The 'FragmentsGroup' model containing the entity.
1284
+ * @param expressID The unique identifier of the entity within the model.
1285
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
1286
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
1287
+ * or the specified relation name is not indexed.
1103
1288
  */
1104
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
1289
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
1105
1290
  /**
1106
- * Method to set properties data in the model.
1107
- *
1108
- * @param model - The FragmentsGroup model in which to set the properties.
1109
- * @param dataToSave - An array of objects representing the properties to be saved.
1110
- * Each object must have an 'expressID' property, which is the express ID of the entity in the model.
1111
- * The rest of the properties will be set as the properties of the entity.
1112
- *
1113
- * @returns {Promise<void>} A promise that resolves when all the properties have been set.
1291
+ * Serializes the relations of a given relation map into a JSON string.
1292
+ * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
1293
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1294
+ * The resulting object is then serialized into a JSON string.
1114
1295
  *
1115
- * @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
1296
+ * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
1297
+ * @returns A JSON string representing the serialized relations of the given relation map.
1116
1298
  */
1117
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
1299
+ serializeRelations(relationMap: RelationsMap): string;
1118
1300
  /**
1119
- * Creates a new Property Set (Pset) in the given model.
1120
- *
1121
- * @param model - The FragmentsGroup model in which to create the Pset.
1122
- * @param name - The name of the Pset.
1123
- * @param description - (Optional) The description of the Pset.
1124
- *
1125
- * @returns A promise that resolves with an object containing the newly created Pset and its relation.
1301
+ * Serializes the relations of a specific model into a JSON string.
1302
+ * This method iterates through the relations indexed for the given model,
1303
+ * organizing them into a structured object where each key is an expressID of an entity,
1304
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1305
+ * The resulting object is then serialized into a JSON string.
1126
1306
  *
1127
- * @throws Will throw an error if the IFC schema is not found in the model.
1128
- * @throws Will throw an error if no OwnerHistory is found in the model.
1307
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
1308
+ * @returns A JSON string representing the serialized relations of the specified model.
1309
+ * If the model has no indexed relations, 'null' is returned.
1129
1310
  */
1130
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
1131
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
1132
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
1133
- }>;
1311
+ serializeModelRelations(model: FragmentsGroup): string | null;
1134
1312
  /**
1135
- * Removes a Property Set (Pset) from the given model.
1136
- *
1137
- * @param model - The FragmentsGroup model from which to remove the Pset.
1138
- * @param psetID - The express IDs of the Psets to be removed.
1139
- *
1140
- * @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
1313
+ * Serializes all relations of every model processed by the indexer into a JSON string.
1314
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
1315
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
1316
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
1317
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
1141
1318
  *
1142
- * @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
1143
- * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1144
- * @throws Will throw an error if no relation is found between the Pset and the model.
1319
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
1320
+ * If no relations have been indexed, an empty object is returned as a JSON string.
1145
1321
  */
1146
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
1322
+ serializeAllRelations(): string;
1147
1323
  /**
1148
- * Creates a new single-value property of type string in the given model.
1324
+ * Converts a JSON string representing relations between entities into a structured map.
1325
+ * This method parses the JSON string to reconstruct the relations map that indexes
1326
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
1327
+ * and the values are maps where each key is a relation type ID and its value is an array
1328
+ * of express IDs of entities related through that relation type.
1149
1329
  *
1150
- * @param model - The FragmentsGroup model in which to create the property.
1151
- * @param type - The type of the property value. Must be a string property type.
1152
- * @param name - The name of the property.
1153
- * @param value - The value of the property. Must be a string.
1154
- *
1155
- * @returns The newly created single-value property.
1156
- *
1157
- * @throws Will throw an error if the IFC schema is not found in the model.
1158
- * @throws Will throw an error if no OwnerHistory is found in the model.
1330
+ * @param json The JSON string to be parsed into the relations map.
1331
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
1332
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
1333
+ * is an array of express IDs (as numbers) of entities related through that relation type.
1159
1334
  */
1160
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1335
+ getRelationsMapFromJSON(json: string): RelationsMap;
1336
+ /** {@link Disposable.dispose} */
1337
+ dispose(): void;
1161
1338
  /**
1162
- * Creates a new single-value property of type numeric in the given model.
1163
- *
1164
- * @param model - The FragmentsGroup model in which to create the property.
1165
- * @param type - The type of the property value. Must be a numeric property type.
1166
- * @param name - The name of the property.
1167
- * @param value - The value of the property. Must be a number.
1339
+ * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
1168
1340
  *
1169
- * @returns The newly created single-value property.
1341
+ * @param model The BIM model whose children to get.
1342
+ * @param id The expressID of the item whose children to get.
1343
+ * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
1170
1344
  *
1171
- * @throws Will throw an error if the IFC schema is not found in the model.
1172
- * @throws Will throw an error if no OwnerHistory is found in the model.
1345
+ * @returns A 'Set' with the expressIDs of the found items.
1173
1346
  */
1174
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1347
+ getElementsChildren(model: FragmentsGroup, id: number, found?: Set<number>): Set<number>;
1348
+ }
1349
+ import * as WEBIFC from "web-ifc";
1350
+ import * as FRAGS from "@thatopen/fragments";
1351
+ import { IfcFragmentSettings } from "./src";
1352
+ import { Component, Components, Event, Disposable } from "../../core";
1353
+ /**
1354
+ * The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
1355
+ */
1356
+ export declare class IfcLoader extends Component implements Disposable {
1175
1357
  /**
1176
- * Creates a new single-value property of type boolean in the given model.
1177
- *
1178
- * @param model - The FragmentsGroup model in which to create the property.
1179
- * @param type - The type of the property value. Must be a boolean property type.
1180
- * @param name - The name of the property.
1181
- * @param value - The value of the property. Must be a boolean.
1182
- *
1183
- * @returns The newly created single-value property.
1184
- *
1185
- * @throws Will throw an error if the IFC schema is not found in the model.
1186
- * @throws Will throw an error if no OwnerHistory is found in the model.
1358
+ * A unique identifier for the component.
1359
+ * This UUID is used to register the component within the Components system.
1187
1360
  */
1188
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1361
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1362
+ /** {@link Disposable.onDisposed} */
1363
+ readonly onDisposed: Event<string>;
1189
1364
  /**
1190
- * Removes a property from a Property Set (Pset) in the given model.
1365
+ * An event triggered when the IFC file starts loading.
1366
+ */
1367
+ readonly onIfcStartedLoading: Event<void>;
1368
+ /**
1369
+ * An event triggered when the setup process is completed.
1370
+ */
1371
+ readonly onSetup: Event<void>;
1372
+ /**
1373
+ * The settings for the IfcLoader.
1374
+ * It includes options for excluding categories, setting WASM paths, and more.
1375
+ */
1376
+ settings: IfcFragmentSettings;
1377
+ /**
1378
+ * The instance of the Web-IFC library used for handling IFC data.
1379
+ */
1380
+ webIfc: WEBIFC.IfcAPI;
1381
+ /** {@link Component.enabled} */
1382
+ enabled: boolean;
1383
+ private _material;
1384
+ private _spatialTree;
1385
+ private _metaData;
1386
+ private _fragmentInstances;
1387
+ private _civil;
1388
+ private _visitedFragments;
1389
+ private _materialT;
1390
+ constructor(components: Components);
1391
+ /** {@link Disposable.dispose} */
1392
+ dispose(): void;
1393
+ /**
1394
+ * Sets up the IfcLoader component with the provided configuration.
1191
1395
  *
1192
- * @param model - The FragmentsGroup model from which to remove the property.
1193
- * @param psetID - The express ID of the Pset from which to remove the property.
1194
- * @param propID - The express ID of the property to be removed.
1396
+ * @param config - Optional configuration settings for the IfcLoader.
1397
+ * If not provided, the existing settings will be used.
1195
1398
  *
1196
- * @returns {Promise<void>} A promise that resolves when the property has been removed.
1399
+ * @returns A Promise that resolves when the setup process is completed.
1197
1400
  *
1198
- * @throws Will throw an error if the Pset or the property to be removed are not found in the model.
1199
- * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1401
+ * @remarks
1402
+ * If the 'autoSetWasm' option is enabled in the configuration,
1403
+ * the method will automatically set the WASM paths for the Web-IFC library.
1404
+ *
1405
+ * @example
1406
+ * '''typescript
1407
+ * const ifcLoader = new IfcLoader(components);
1408
+ * await ifcLoader.setup({ autoSetWasm: true });
1409
+ * '''
1200
1410
  */
1201
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
1202
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
1411
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1203
1412
  /**
1204
- * Adds elements to a Property Set (Pset) in the given model.
1413
+ * Loads an IFC file and processes it for 3D visualization.
1205
1414
  *
1206
- * @param model - The FragmentsGroup model in which to add the elements.
1207
- * @param psetID - The express ID of the Pset to which to add the elements.
1208
- * @param elementID - The express IDs of the elements to be added.
1415
+ * @param data - The Uint8Array containing the IFC file data.
1416
+ * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1209
1417
  *
1210
- * @returns {Promise<void>} A promise that resolves when all the elements have been added.
1418
+ * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1211
1419
  *
1212
- * @throws Will throw an error if the Pset or the elements to be added are not found in the model.
1213
- * @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
1214
- * @throws Will throw an error if no relation is found between the Pset and the model.
1420
+ * @example
1421
+ * '''typescript
1422
+ * const ifcLoader = components.get(IfcLoader);
1423
+ * const group = await ifcLoader.load(ifcData);
1424
+ * '''
1215
1425
  */
1216
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
1426
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
1217
1427
  /**
1218
- * Saves the changes made to the model to a new IFC file.
1428
+ * Reads an IFC file and initializes the Web-IFC library.
1219
1429
  *
1220
- * @param model - The FragmentsGroup model from which to save the changes.
1221
- * @param ifcToSaveOn - The Uint8Array representing the original IFC file.
1430
+ * @param data - The Uint8Array containing the IFC file data.
1222
1431
  *
1223
- * @returns A promise that resolves with the modified IFC data as a Uint8Array.
1432
+ * @returns A Promise that resolves when the IFC file is opened and initialized.
1224
1433
  *
1225
- * @throws Will throw an error if any issues occur during the saving process.
1434
+ * @remarks
1435
+ * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1436
+ * It also opens the IFC model using the provided data and settings.
1437
+ *
1438
+ * @example
1439
+ * '''typescript
1440
+ * const ifcLoader = components.get(IfcLoader);
1441
+ * await ifcLoader.readIfcFile(ifcData);
1442
+ * '''
1226
1443
  */
1227
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
1444
+ readIfcFile(data: Uint8Array): Promise<number>;
1228
1445
  /**
1229
- * Sets an attribute listener for a specific attribute of an entity in the model.
1230
- * The listener will trigger an event whenever the attribute's value changes.
1231
- *
1232
- * @param model - The FragmentsGroup model in which to set the attribute listener.
1233
- * @param expressID - The express ID of the entity for which to set the listener.
1234
- * @param attributeName - The name of the attribute for which to set the listener.
1446
+ * Cleans up the IfcLoader component by resetting the Web-IFC library,
1447
+ * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1235
1448
  *
1236
- * @returns The event that will be triggered when the attribute's value changes.
1449
+ * @remarks
1450
+ * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1237
1451
  *
1238
- * @throws Will throw an error if the entity with the given expressID doesn't exist.
1239
- * @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
1240
- * @throws Will throw an error if the attribute has a badly defined handle.
1452
+ * @example
1453
+ * '''typescript
1454
+ * const ifcLoader = components.get(IfcLoader);
1455
+ * ifcLoader.cleanUp();
1456
+ * '''
1241
1457
  */
1242
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
1243
- private increaseMaxID;
1244
- private newGUID;
1245
- private getOwnerHistory;
1246
- private registerChange;
1247
- private newSingleProperty;
1458
+ cleanUp(): void;
1459
+ private getAllGeometries;
1460
+ private getMesh;
1461
+ private getGeometry;
1462
+ private autoSetWasm;
1248
1463
  }
1249
- import * as WEBIFC from "web-ifc";
1250
- import { FragmentsGroup } from "@thatopen/fragments";
1251
- import { Disposable, Event, Component, Components } from "../../core";
1252
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
1253
- export type { InverseAttribute, RelationsMap } from "./src/types";
1464
+ import { Component, Disposable, Event, Components } from "../../core";
1254
1465
  /**
1255
- * 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).
1466
+ * The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
1256
1467
  */
1257
- export declare class IfcRelationsIndexer extends Component implements Disposable {
1468
+ export declare class Exploder extends Component implements Disposable {
1258
1469
  /**
1259
1470
  * A unique identifier for the component.
1260
1471
  * This UUID is used to register the component within the Components system.
1261
1472
  */
1262
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1473
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
1263
1474
  /** {@link Disposable.onDisposed} */
1264
- readonly onDisposed: Event<string>;
1475
+ readonly onDisposed: Event<unknown>;
1476
+ /** {@link Component.enabled} */
1477
+ enabled: boolean;
1265
1478
  /**
1266
- * Event triggered when relations for a model have been indexed.
1267
- * This event provides the model's UUID and the relations map generated for that model.
1268
- *
1269
- * @property {string} modelID - The UUID of the model for which relations have been indexed.
1270
- * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1271
- * 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.
1479
+ * The height of the explosion animation.
1480
+ * This property determines the vertical distance by which fragments are moved during the explosion.
1481
+ * Default value is 10.
1272
1482
  */
1273
- readonly onRelationsIndexed: Event<{
1274
- modelID: string;
1275
- relationsMap: RelationsMap;
1276
- }>;
1483
+ height: number;
1277
1484
  /**
1278
- * Holds the relationship mappings for each model processed by the indexer.
1279
- * The structure is a map where each key is a model's UUID, and the value is another map.
1280
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1281
- * representing a specific relation type, and the value is an array of expressIDs of entities
1282
- * that are related through that relation type. This structure allows for efficient querying
1283
- * of entity relationships within a model.
1485
+ * The group name used for the explosion animation.
1486
+ * This property specifies the group of fragments that will be affected by the explosion.
1487
+ * Default value is "storeys".
1284
1488
  */
1285
- readonly relationMaps: ModelsRelationMap;
1286
- /** {@link Component.enabled} */
1287
- enabled: boolean;
1288
- private _relToAttributesMap;
1289
- private _inverseAttributes;
1290
- private _ifcRels;
1489
+ groupName: string;
1490
+ /**
1491
+ * A set of strings representing the exploded items.
1492
+ * This set is used to keep track of which items have been exploded.
1493
+ */
1494
+ list: Set<string>;
1291
1495
  constructor(components: Components);
1292
- private onFragmentsDisposed;
1293
- private indexRelations;
1496
+ /** {@link Disposable.dispose} */
1497
+ dispose(): void;
1294
1498
  /**
1295
- * Adds a relation map to the model's relations map.
1499
+ * Sets the explosion state of the fragments.
1296
1500
  *
1297
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1298
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1501
+ * @param active - A boolean indicating whether to activate or deactivate the explosion.
1299
1502
  *
1300
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1301
- */
1302
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
1303
- /**
1304
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
1305
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
1306
- * and maps them in a structured way to facilitate quick access to related entities.
1503
+ * @remarks
1504
+ * This method applies a vertical transformation to the fragments based on the 'active' parameter.
1505
+ * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
1506
+ * If 'active' is false, the fragments are moved back to their original position.
1307
1507
  *
1308
- * The process involves querying the model for each relation type associated with the inverse attributes
1309
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
1310
- * and contains a nested map where each key is an entity's expressID and its value is another map.
1311
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
1312
- * of entities that are related through that attribute.
1508
+ * The method also keeps track of the exploded items using the 'list' set.
1313
1509
  *
1314
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
1315
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
1316
- * representation of the relations indexed by entity expressIDs and relation types.
1317
- * @throws An error if the model does not have properties loaded.
1510
+ * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
1318
1511
  */
1319
- process(model: FragmentsGroup): Promise<RelationsMap>;
1512
+ set(active: boolean): void;
1513
+ }
1514
+ import * as WEBIFC from "web-ifc";
1515
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
1516
+ import { PropertiesStreamingSettings } from "./src";
1517
+ /**
1518
+ * A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
1519
+ */
1520
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
1320
1521
  /**
1321
- * Processes a given model from a WebIfc API to index its IFC entities relations.
1322
- *
1323
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
1324
- * @param modelID - The unique identifier of the model within the WebIfc API.
1325
- * @returns A promise that resolves to the relations map for the processed model.
1326
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
1522
+ * A unique identifier for the component.
1523
+ * This UUID is used to register the component within the Components system.
1327
1524
  */
1328
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
1525
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1329
1526
  /**
1330
- * Retrieves the relations of a specific entity within a model based on the given relation name.
1331
- * This method searches the indexed relation maps for the specified model and entity,
1332
- * returning the IDs of related entities if a match is found.
1333
- *
1334
- * @param model The 'FragmentsGroup' model containing the entity.
1335
- * @param expressID The unique identifier of the entity within the model.
1336
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
1337
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
1338
- * or the specified relation name is not indexed.
1527
+ * An event that is triggered when properties are streamed from the IFC file.
1528
+ * The event provides the type of the IFC entity and the corresponding data.
1339
1529
  */
1340
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
1530
+ readonly onPropertiesStreamed: AsyncEvent<{
1531
+ type: number;
1532
+ data: {
1533
+ [id: number]: any;
1534
+ };
1535
+ }>;
1341
1536
  /**
1342
- * Serializes the relations of a given relation map into a JSON string.
1343
- * 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,
1344
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1345
- * The resulting object is then serialized into a JSON string.
1346
- *
1347
- * @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.
1348
- * @returns A JSON string representing the serialized relations of the given relation map.
1537
+ * An event that is triggered to indicate the progress of the streaming process.
1538
+ * The event provides a number between 0 and 1 representing the progress percentage.
1349
1539
  */
1350
- serializeRelations(relationMap: RelationsMap): string;
1540
+ readonly onProgress: AsyncEvent<number>;
1351
1541
  /**
1352
- * Serializes the relations of a specific model into a JSON string.
1353
- * This method iterates through the relations indexed for the given model,
1354
- * organizing them into a structured object where each key is an expressID of an entity,
1355
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
1356
- * The resulting object is then serialized into a JSON string.
1357
- *
1358
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
1359
- * @returns A JSON string representing the serialized relations of the specified model.
1360
- * If the model has no indexed relations, 'null' is returned.
1542
+ * An event that is triggered when indices are streamed from the IFC file.
1543
+ * The event provides a map of indices, where the key is the entity type and the value is another map of indices.
1361
1544
  */
1362
- serializeModelRelations(model: FragmentsGroup): string | null;
1545
+ readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
1546
+ /** {@link Disposable.onDisposed} */
1547
+ readonly onDisposed: Event<string>;
1548
+ /** {@link Component.enabled} */
1549
+ enabled: boolean;
1363
1550
  /**
1364
- * Serializes all relations of every model processed by the indexer into a JSON string.
1365
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
1366
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
1367
- * and its value is another object mapping entity expressIDs to their related entities, categorized
1368
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
1369
- *
1370
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
1371
- * If no relations have been indexed, an empty object is returned as a JSON string.
1551
+ * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
1372
1552
  */
1373
- serializeAllRelations(): string;
1553
+ settings: PropertiesStreamingSettings;
1374
1554
  /**
1375
- * Converts a JSON string representing relations between entities into a structured map.
1376
- * This method parses the JSON string to reconstruct the relations map that indexes
1377
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
1378
- * and the values are maps where each key is a relation type ID and its value is an array
1379
- * of express IDs of entities related through that relation type.
1380
- *
1381
- * @param json The JSON string to be parsed into the relations map.
1382
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
1383
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
1384
- * is an array of express IDs (as numbers) of entities related through that relation type.
1555
+ * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
1385
1556
  */
1386
- getRelationsMapFromJSON(json: string): RelationsMap;
1557
+ webIfc: WEBIFC.IfcAPI;
1387
1558
  /** {@link Disposable.dispose} */
1388
- dispose(): void;
1559
+ dispose(): Promise<void>;
1389
1560
  /**
1390
- * 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.
1561
+ * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1391
1562
  *
1392
- * @param model The BIM model whose children to get.
1393
- * @param id The expressID of the item whose children to get.
1394
- * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
1563
+ * @param data - The Uint8Array containing the IFC file data.
1564
+ * @returns A Promise that resolves when the streaming process is complete.
1565
+ */
1566
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1567
+ /**
1568
+ * This method converts properties from an IFC file to tiles using a given callback function to read the file.
1395
1569
  *
1396
- * @returns A 'Set' with the expressIDs of the found items.
1570
+ * @param loadCallback - A callback function that loads the IFC file data.
1571
+ * @returns A Promise that resolves when the streaming process is complete.
1397
1572
  */
1398
- getElementsChildren(model: FragmentsGroup, id: number, found?: Set<number>): Set<number>;
1573
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1574
+ private readIfcFile;
1575
+ private streamIfcFile;
1576
+ private streamAllProperties;
1577
+ private cleanUp;
1399
1578
  }
1400
1579
  import * as THREE from "three";
1401
- import * as FRAGS from "@thatopen/fragments";
1402
- import { Component, Components } from "../../core";
1580
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
1581
+ center: THREE.Vector3;
1582
+ halfSizes: THREE.Vector3;
1583
+ rotation: THREE.Matrix3;
1584
+ transformation: THREE.Matrix4;
1585
+ };
1586
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
1587
+ import * as WEBIFC from "web-ifc";
1588
+ import { FragmentsGroup } from "@thatopen/fragments";
1589
+ import { Component, Disposable, Event, Components } from "../../core";
1403
1590
  /**
1404
- * Represents an edge measurement result.
1591
+ * Types for boolean properties in IFC schema.
1405
1592
  */
1406
- export interface MeasureEdge {
1407
- /**
1408
- * The distance between the two points of the edge.
1409
- */
1410
- distance: number;
1411
- /**
1412
- * The two points that define the edge.
1413
- */
1414
- points: THREE.Vector3[];
1593
+ export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
1594
+ /**
1595
+ * Types for string properties in IFC schema.
1596
+ */
1597
+ export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
1598
+ /**
1599
+ * Types for numeric properties in IFC schema.
1600
+ */
1601
+ export type NumericPropTypes = "IfcInteger" | "IfcReal";
1602
+ /**
1603
+ * 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.
1604
+ */
1605
+ export interface ChangeMap {
1606
+ [modelID: string]: Set<number>;
1415
1607
  }
1416
1608
  /**
1417
- * Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
1609
+ * 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.
1418
1610
  */
1419
- export declare class MeasurementUtils extends Component {
1611
+ export interface AttributeListener {
1612
+ [modelID: string]: {
1613
+ [expressID: number]: {
1614
+ [attributeName: string]: Event<String | Boolean | Number>;
1615
+ };
1616
+ };
1617
+ }
1618
+ /**
1619
+ * Component to manage and edit properties and Psets in IFC files.
1620
+ */
1621
+ export declare class IfcPropertiesManager extends Component implements Disposable {
1420
1622
  /**
1421
1623
  * A unique identifier for the component.
1422
1624
  * This UUID is used to register the component within the Components system.
1423
1625
  */
1424
- static uuid: string;
1425
- /** {@link Component.enabled} */
1426
- enabled: boolean;
1427
- constructor(components: Components);
1626
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
1627
+ /** {@link Disposable.onDisposed} */
1628
+ readonly onDisposed: Event<string>;
1428
1629
  /**
1429
- * Utility method to calculate the distance from a point to a line segment.
1430
- *
1431
- * @param point - The point from which to calculate the distance.
1432
- * @param lineStart - The start point of the line segment.
1433
- * @param lineEnd - The end point of the line segment.
1434
- * @param clamp - If true, the distance will be clamped to the line segment's length.
1435
- * @returns The distance from the point to the line segment.
1630
+ * Event triggered when a file is requested for export.
1436
1631
  */
1437
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
1632
+ readonly onRequestFile: Event<unknown>;
1438
1633
  /**
1439
- * Method to get the face of a mesh that contains a given triangle index.
1440
- * It also returns the edges of the found face and their indices.
1441
- *
1442
- * @param mesh - The mesh to get the face from. It must be indexed.
1443
- * @param triangleIndex - The index of the triangle within the mesh.
1444
- * @param instance - The instance of the mesh (optional).
1445
- * @returns An object containing the edges of the found face and their indices, or null if no face was found.
1634
+ * ArrayBuffer containing the IFC data to be exported.
1446
1635
  */
1447
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
1448
- edges: MeasureEdge[];
1449
- indices: Set<number>;
1450
- } | null;
1636
+ ifcToExport: ArrayBuffer | null;
1451
1637
  /**
1452
- * Method to get the vertices and normal of a mesh face at a given index.
1453
- * It also applies instance transformation if provided.
1454
- *
1455
- * @param mesh - The mesh to get the face from. It must be indexed.
1456
- * @param faceIndex - The index of the face within the mesh.
1457
- * @param instance - The instance of the mesh (optional).
1458
- * @returns An object containing the vertices and normal of the face.
1459
- * @throws Will throw an error if the geometry is not indexed.
1638
+ * Event triggered when an element is added to a Pset.
1460
1639
  */
1461
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
1462
- p1: THREE.Vector3;
1463
- p2: THREE.Vector3;
1464
- p3: THREE.Vector3;
1465
- faceNormal: THREE.Vector3;
1466
- };
1640
+ readonly onElementToPset: Event<{
1641
+ model: FragmentsGroup;
1642
+ psetID: number;
1643
+ elementID: number;
1644
+ }>;
1467
1645
  /**
1468
- * Method to round the vector's components to a specified number of decimal places.
1469
- * This is used to ensure numerical precision in edge detection.
1470
- *
1471
- * @param vector - The vector to round.
1472
- * @returns The vector with rounded components.
1646
+ * Event triggered when a property is added to a Pset.
1473
1647
  */
1474
- round(vector: THREE.Vector3): void;
1648
+ readonly onPropToPset: Event<{
1649
+ model: FragmentsGroup;
1650
+ psetID: number;
1651
+ propID: number;
1652
+ }>;
1475
1653
  /**
1476
- * Calculates the volume of a set of fragments.
1477
- *
1478
- * @param frags - A map of fragment IDs to their corresponding item IDs.
1479
- * @returns The total volume of the fragments and the bounding sphere.
1480
- *
1481
- * @remarks
1482
- * This method creates a set of instanced meshes from the given fragments and item IDs.
1483
- * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
1484
- *
1485
- * @throws Will throw an error if the geometry of the meshes is not indexed.
1486
- * @throws Will throw an error if the fragment manager is not available.
1654
+ * Event triggered when a Pset is removed.
1487
1655
  */
1488
- getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
1656
+ readonly onPsetRemoved: Event<{
1657
+ model: FragmentsGroup;
1658
+ psetID: number;
1659
+ }>;
1489
1660
  /**
1490
- * Calculates the total volume of a set of meshes.
1491
- *
1492
- * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
1493
- * @returns The total volume of the meshes and the bounding sphere.
1494
- *
1495
- * @remarks
1496
- * This method calculates the volume of each mesh in the provided array and returns the total volume
1497
- * and its bounding sphere.
1498
- *
1661
+ * Event triggered when data in the model changes.
1499
1662
  */
1500
- getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
1501
- private getFaceData;
1502
- private getVolumeOfMesh;
1503
- private getSignedVolumeOfTriangle;
1504
- }
1505
- import * as THREE from "three";
1506
- import { Components } from "../Components";
1507
- import { Component } from "../Types";
1508
- /**
1509
- * 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).
1510
- */
1511
- export declare class Disposer extends Component {
1512
- private _disposedComponents;
1663
+ readonly onDataChanged: Event<{
1664
+ model: FragmentsGroup;
1665
+ expressID: number;
1666
+ }>;
1667
+ /**
1668
+ * Configuration for the WebAssembly module.
1669
+ */
1670
+ wasm: {
1671
+ path: string;
1672
+ absolute: boolean;
1673
+ };
1513
1674
  /** {@link Component.enabled} */
1514
1675
  enabled: boolean;
1515
1676
  /**
1516
- * A unique identifier for the component.
1517
- * This UUID is used to register the component within the Components system.
1677
+ * Map of attribute listeners.
1518
1678
  */
1519
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
1679
+ attributeListeners: AttributeListener;
1680
+ /**
1681
+ * The currently selected model.
1682
+ */
1683
+ selectedModel?: FragmentsGroup;
1684
+ /**
1685
+ * Map of changed entities in the model.
1686
+ */
1687
+ changeMap: ChangeMap;
1520
1688
  constructor(components: Components);
1689
+ /** {@link Disposable.dispose} */
1690
+ dispose(): void;
1521
1691
  /**
1522
- * Return the UUIDs of all disposed components.
1692
+ * Static method to retrieve the IFC schema from a given model.
1693
+ *
1694
+ * @param model - The FragmentsGroup model from which to retrieve the IFC schema.
1695
+ * @throws Will throw an error if the IFC schema is not found in the model.
1696
+ * @returns The IFC schema associated with the given model.
1523
1697
  */
1524
- get(): Set<string>;
1698
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
1525
1699
  /**
1526
- * Removes a mesh, its geometry and its materials from memory. If you are
1527
- * using any of these in other parts of the application, make sure that you
1528
- * remove them from the mesh before disposing it.
1700
+ * Method to set properties data in the model.
1529
1701
  *
1530
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
1531
- * to remove.
1702
+ * @param model - The FragmentsGroup model in which to set the properties.
1703
+ * @param dataToSave - An array of objects representing the properties to be saved.
1704
+ * Each object must have an 'expressID' property, which is the express ID of the entity in the model.
1705
+ * The rest of the properties will be set as the properties of the entity.
1532
1706
  *
1533
- * @param materials - whether to dispose the materials of the mesh.
1707
+ * @returns {Promise<void>} A promise that resolves when all the properties have been set.
1534
1708
  *
1535
- * @param recursive - whether to recursively dispose the children of the mesh.
1709
+ * @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
1536
1710
  */
1537
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
1711
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
1538
1712
  /**
1539
- * Disposes a geometry from memory.
1713
+ * Creates a new Property Set (Pset) in the given model.
1540
1714
  *
1541
- * @param geometry - the
1542
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
1543
- * to remove.
1715
+ * @param model - The FragmentsGroup model in which to create the Pset.
1716
+ * @param name - The name of the Pset.
1717
+ * @param description - (Optional) The description of the Pset.
1718
+ *
1719
+ * @returns A promise that resolves with an object containing the newly created Pset and its relation.
1720
+ *
1721
+ * @throws Will throw an error if the IFC schema is not found in the model.
1722
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1544
1723
  */
1545
- disposeGeometry(geometry: THREE.BufferGeometry): void;
1546
- private disposeGeometryAndMaterials;
1547
- private disposeChildren;
1548
- private static disposeMaterial;
1549
- }
1550
- import { Component, Disposable, Event } from "../Types";
1551
- /**
1552
- * 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.
1553
- */
1554
- export declare class Components implements Disposable {
1724
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
1725
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
1726
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
1727
+ }>;
1555
1728
  /**
1556
- * The version of the @thatopen/components library.
1729
+ * Removes a Property Set (Pset) from the given model.
1730
+ *
1731
+ * @param model - The FragmentsGroup model from which to remove the Pset.
1732
+ * @param psetID - The express IDs of the Psets to be removed.
1733
+ *
1734
+ * @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
1735
+ *
1736
+ * @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
1737
+ * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1738
+ * @throws Will throw an error if no relation is found between the Pset and the model.
1557
1739
  */
1558
- static readonly release = "2.1.2";
1559
- /** {@link Disposable.onDisposed} */
1560
- readonly onDisposed: Event<void>;
1740
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
1561
1741
  /**
1562
- * The list of components created in this app.
1563
- * The keys are UUIDs and the values are instances of the components.
1742
+ * Creates a new single-value property of type string in the given model.
1743
+ *
1744
+ * @param model - The FragmentsGroup model in which to create the property.
1745
+ * @param type - The type of the property value. Must be a string property type.
1746
+ * @param name - The name of the property.
1747
+ * @param value - The value of the property. Must be a string.
1748
+ *
1749
+ * @returns The newly created single-value property.
1750
+ *
1751
+ * @throws Will throw an error if the IFC schema is not found in the model.
1752
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1564
1753
  */
1565
- readonly list: Map<string, Component>;
1754
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1566
1755
  /**
1567
- * If disabled, the animation loop will be stopped.
1568
- * Default value is false.
1756
+ * Creates a new single-value property of type numeric in the given model.
1757
+ *
1758
+ * @param model - The FragmentsGroup model in which to create the property.
1759
+ * @param type - The type of the property value. Must be a numeric property type.
1760
+ * @param name - The name of the property.
1761
+ * @param value - The value of the property. Must be a number.
1762
+ *
1763
+ * @returns The newly created single-value property.
1764
+ *
1765
+ * @throws Will throw an error if the IFC schema is not found in the model.
1766
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1569
1767
  */
1570
- enabled: boolean;
1571
- private _clock;
1768
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1572
1769
  /**
1573
- * Adds a component to the list of components.
1574
- * Throws an error if a component with the same UUID already exists.
1770
+ * Creates a new single-value property of type boolean in the given model.
1575
1771
  *
1576
- * @param uuid - The unique identifier of the component.
1577
- * @param instance - The instance of the component to be added.
1772
+ * @param model - The FragmentsGroup model in which to create the property.
1773
+ * @param type - The type of the property value. Must be a boolean property type.
1774
+ * @param name - The name of the property.
1775
+ * @param value - The value of the property. Must be a boolean.
1578
1776
  *
1579
- * @throws Will throw an error if a component with the same UUID already exists.
1777
+ * @returns The newly created single-value property.
1580
1778
  *
1581
- * @internal
1779
+ * @throws Will throw an error if the IFC schema is not found in the model.
1780
+ * @throws Will throw an error if no OwnerHistory is found in the model.
1582
1781
  */
1583
- add(uuid: string, instance: Component): void;
1782
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
1584
1783
  /**
1585
- * Retrieves a component instance by its constructor function.
1586
- * If the component does not exist in the list, it will be created and added.
1587
- *
1588
- * @template U - The type of the component to retrieve.
1589
- * @param Component - The constructor function of the component to retrieve.
1784
+ * Removes a property from a Property Set (Pset) in the given model.
1590
1785
  *
1591
- * @returns The instance of the requested component.
1786
+ * @param model - The FragmentsGroup model from which to remove the property.
1787
+ * @param psetID - The express ID of the Pset from which to remove the property.
1788
+ * @param propID - The express ID of the property to be removed.
1592
1789
  *
1593
- * @throws Will throw an error if a component with the same UUID already exists.
1790
+ * @returns {Promise<void>} A promise that resolves when the property has been removed.
1594
1791
  *
1595
- * @internal
1792
+ * @throws Will throw an error if the Pset or the property to be removed are not found in the model.
1793
+ * @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
1596
1794
  */
1597
- get<U extends Component>(Component: new (components: Components) => U): U;
1598
- constructor();
1795
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
1796
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
1599
1797
  /**
1600
- * Initializes the Components instance.
1601
- * This method starts the animation loop, sets the enabled flag to true,
1602
- * and calls the update method.
1798
+ * Adds elements to a Property Set (Pset) in the given model.
1603
1799
  *
1604
- * @returns {void}
1800
+ * @param model - The FragmentsGroup model in which to add the elements.
1801
+ * @param psetID - The express ID of the Pset to which to add the elements.
1802
+ * @param elementID - The express IDs of the elements to be added.
1803
+ *
1804
+ * @returns {Promise<void>} A promise that resolves when all the elements have been added.
1805
+ *
1806
+ * @throws Will throw an error if the Pset or the elements to be added are not found in the model.
1807
+ * @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
1808
+ * @throws Will throw an error if no relation is found between the Pset and the model.
1605
1809
  */
1606
- init(): void;
1810
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
1607
1811
  /**
1608
- * Disposes the memory of all the components and tools of this instance of
1609
- * the library. A memory leak will be created if:
1812
+ * Saves the changes made to the model to a new IFC file.
1610
1813
  *
1611
- * - An instance of the library ends up out of scope and this function isn't
1612
- * called. This is especially relevant in Single Page Applications (React,
1613
- * Angular, Vue, etc).
1814
+ * @param model - The FragmentsGroup model from which to save the changes.
1815
+ * @param ifcToSaveOn - The Uint8Array representing the original IFC file.
1614
1816
  *
1615
- * - Any of the objects of this instance (meshes, geometries,materials, etc) is
1616
- * referenced by a reference type (object or array).
1817
+ * @returns A promise that resolves with the modified IFC data as a Uint8Array.
1617
1818
  *
1618
- * You can learn more about how Three.js handles memory leaks
1619
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1819
+ * @throws Will throw an error if any issues occur during the saving process.
1820
+ */
1821
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
1822
+ /**
1823
+ * Sets an attribute listener for a specific attribute of an entity in the model.
1824
+ * The listener will trigger an event whenever the attribute's value changes.
1825
+ *
1826
+ * @param model - The FragmentsGroup model in which to set the attribute listener.
1827
+ * @param expressID - The express ID of the entity for which to set the listener.
1828
+ * @param attributeName - The name of the attribute for which to set the listener.
1829
+ *
1830
+ * @returns The event that will be triggered when the attribute's value changes.
1620
1831
  *
1832
+ * @throws Will throw an error if the entity with the given expressID doesn't exist.
1833
+ * @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
1834
+ * @throws Will throw an error if the attribute has a badly defined handle.
1621
1835
  */
1622
- dispose(): void;
1623
- private update;
1624
- private static setupBVH;
1836
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
1837
+ private increaseMaxID;
1838
+ private newGUID;
1839
+ private getOwnerHistory;
1840
+ private registerChange;
1841
+ private newSingleProperty;
1625
1842
  }
1626
1843
  import * as WEBIFC from "web-ifc";
1627
1844
  import * as FRAG from "@thatopen/fragments";
@@ -1648,503 +1865,245 @@ export declare class IfcJsonExporter extends Component {
1648
1865
  */
1649
1866
  export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1650
1867
  }
1651
- import { Component, Disposable, World, Event } from "../Types";
1652
- import { SimpleRaycaster } from "./src";
1653
- import { Components } from "../Components";
1654
- /**
1655
- * 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).
1656
- */
1657
- export declare class Raycasters extends Component implements Disposable {
1658
- /**
1659
- * A unique identifier for the component.
1660
- * This UUID is used to register the component within the Components system.
1661
- */
1662
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
1663
- /** {@link Component.enabled} */
1664
- enabled: boolean;
1665
- /**
1666
- * A Map that stores raycasters for each world.
1667
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
1668
- */
1669
- list: Map<string, SimpleRaycaster>;
1670
- /** {@link Disposable.onDisposed} */
1671
- onDisposed: Event<unknown>;
1672
- constructor(components: Components);
1673
- /**
1674
- * Retrieves a SimpleRaycaster instance for the given world.
1675
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
1676
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
1677
- *
1678
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
1679
- * @returns The SimpleRaycaster instance for the given world.
1680
- */
1681
- get(world: World): SimpleRaycaster;
1682
- /**
1683
- * Deletes the SimpleRaycaster instance associated with the given world.
1684
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
1685
- *
1686
- * @param world - The world for which to delete the SimpleRaycaster instance.
1687
- * @returns {void}
1688
- */
1689
- delete(world: World): void;
1690
- /** {@link Disposable.dispose} */
1691
- dispose(): void;
1692
- }
1693
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
1694
- import { Components } from "../Components";
1695
- import { SimpleWorld } from "./src";
1696
- /**
1697
- * A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
1698
- */
1699
- export declare class Worlds extends Component implements Updateable, Disposable {
1700
- /**
1701
- * A unique identifier for the component.
1702
- * This UUID is used to register the component within the Components system.
1703
- */
1704
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
1705
- /** {@link Updateable.onAfterUpdate} */
1706
- readonly onAfterUpdate: Event<unknown>;
1707
- /** {@link Updateable.onBeforeUpdate} */
1708
- readonly onBeforeUpdate: Event<unknown>;
1709
- /** {@link Disposable.onDisposed} */
1710
- readonly onDisposed: Event<unknown>;
1711
- /**
1712
- * An event that is triggered when a new world is created.
1713
- * The event passes the newly created world as a parameter.
1714
- */
1715
- readonly onWorldCreated: Event<World>;
1716
- /**
1717
- * An event that is triggered when a world is deleted.
1718
- * The event passes the UUID of the deleted world as a parameter.
1719
- */
1720
- readonly onWorldDeleted: Event<string>;
1721
- /**
1722
- * A collection of worlds managed by this component.
1723
- * The key is the unique identifier (UUID) of the world, and the value is the World instance.
1724
- */
1725
- list: Map<string, World>;
1726
- /** {@link Component.enabled} */
1727
- enabled: boolean;
1728
- constructor(components: Components);
1729
- /**
1730
- * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
1731
- *
1732
- * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
1733
- * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
1734
- * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
1735
- *
1736
- * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
1737
- */
1738
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
1739
- /**
1740
- * Deletes a world from the list of worlds.
1741
- *
1742
- * @param {World} world - The world to be deleted.
1743
- *
1744
- * @throws {Error} - Throws an error if the provided world is not found in the list.
1745
- *
1746
- * @returns {void}
1747
- */
1748
- delete(world: World): void;
1749
- /**
1750
- * Disposes of the Worlds component and all its managed worlds.
1751
- * This method sets the enabled flag to false, disposes of all worlds, clears the list,
1752
- * and triggers the onDisposed event.
1753
- *
1754
- * @returns {void}
1755
- */
1756
- dispose(): void;
1757
- /** {@link Updateable.update} */
1758
- update(delta?: number): void | Promise<void>;
1759
- }
1760
- import { Component, Disposable, World, Event } from "../Types";
1761
- import { GridConfig, SimpleGrid } from "./src";
1762
- import { Components } from "../Components";
1763
- /**
1764
- * 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).
1765
- */
1766
- export declare class Grids extends Component implements Disposable {
1767
- /**
1768
- * A unique identifier for the component.
1769
- * This UUID is used to register the component within the Components system.
1770
- */
1771
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
1772
- /**
1773
- * A map of world UUIDs to their corresponding grid instances.
1774
- */
1775
- list: Map<string, SimpleGrid>;
1776
- /**
1777
- * The default configuration for grid creation.
1778
- */
1779
- config: Required<GridConfig>;
1780
- /** {@link Disposable.onDisposed} */
1781
- readonly onDisposed: Event<unknown>;
1782
- /** {@link Component.enabled} */
1783
- enabled: boolean;
1784
- constructor(components: Components);
1785
- /**
1786
- * Creates a new grid for the given world.
1787
- * Throws an error if a grid already exists for the world.
1788
- *
1789
- * @param world - The world to create the grid for.
1790
- * @returns The newly created grid.
1791
- *
1792
- * @throws Will throw an error if a grid already exists for the given world.
1793
- */
1794
- create(world: World): SimpleGrid;
1795
- /**
1796
- * Deletes the grid associated with the given world.
1797
- * If a grid does not exist for the given world, this method does nothing.
1798
- *
1799
- * @param world - The world for which to delete the grid.
1800
- *
1801
- * @remarks
1802
- * This method will dispose of the grid and remove it from the internal list.
1803
- * If the world is disposed before calling this method, the grid will be automatically deleted.
1804
- */
1805
- delete(world: World): void;
1806
- /** {@link Disposable.dispose} */
1807
- dispose(): void;
1868
+ import * as THREE from "three";
1869
+ export declare class MaterialsUtils {
1870
+ static isTransparent(material: THREE.Material): boolean;
1808
1871
  }
1809
1872
  import * as THREE from "three";
1810
- import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
1811
- import { SimplePlane } from "./src";
1812
- import { Components } from "../Components";
1873
+ import { Component, Components, Disposable, Event, World } from "../core";
1813
1874
  /**
1814
- * A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
1815
- *
1816
- * @param components - the instance of {@link Components} used.
1817
- * E.g. {@link SimplePlane}.
1875
+ * Configuration interface for the VertexPicker component.
1818
1876
  */
1819
- export declare class Clipper extends Component implements Createable, Disposable, Hideable {
1820
- /**
1821
- * A unique identifier for the component.
1822
- * This UUID is used to register the component within the Components system.
1823
- */
1824
- static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
1825
- /** Event that fires when the user starts dragging a clipping plane. */
1826
- readonly onBeforeDrag: Event<void>;
1827
- /** Event that fires when the user stops dragging a clipping plane. */
1828
- readonly onAfterDrag: Event<void>;
1829
- /**
1830
- * Event that fires when the user starts creating a clipping plane.
1831
- */
1832
- readonly onBeforeCreate: Event<unknown>;
1833
- /**
1834
- * Event that fires when the user cancels the creation of a clipping plane.
1835
- */
1836
- readonly onBeforeCancel: Event<unknown>;
1837
- /**
1838
- * Event that fires after the user cancels the creation of a clipping plane.
1839
- */
1840
- readonly onAfterCancel: Event<unknown>;
1841
- /**
1842
- * Event that fires when the user starts deleting a clipping plane.
1843
- */
1844
- readonly onBeforeDelete: Event<unknown>;
1845
- /**
1846
- * Event that fires after a clipping plane has been created.
1847
- * @param plane - The newly created clipping plane.
1848
- */
1849
- readonly onAfterCreate: Event<SimplePlane>;
1850
- /**
1851
- * Event that fires after a clipping plane has been deleted.
1852
- * @param plane - The deleted clipping plane.
1853
- */
1854
- readonly onAfterDelete: Event<SimplePlane>;
1855
- /** {@link Disposable.onDisposed} */
1856
- readonly onDisposed: Event<string>;
1857
- /**
1858
- * Whether to force the clipping plane to be orthogonal in the Y direction
1859
- * (up). This is desirable when clipping a building horizontally and a
1860
- * clipping plane is created in its roof, which might have a slight
1861
- * slope for draining purposes.
1862
- */
1863
- orthogonalY: boolean;
1864
- /**
1865
- * The tolerance that determines whether an almost-horizontal clipping plane
1866
- * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
1867
- * has to be 'true' for this to apply.
1868
- */
1869
- toleranceOrthogonalY: number;
1870
- /**
1871
- * The type of clipping plane to be created.
1872
- * Default is {@link SimplePlane}.
1873
- */
1874
- Type: new (...args: any) => SimplePlane;
1877
+ export interface VertexPickerConfig {
1875
1878
  /**
1876
- * A list of all the clipping planes created by this component.
1879
+ * If true, only vertices will be picked, not the closest point on the face.
1877
1880
  */
1878
- list: SimplePlane[];
1879
- /** The material used in all the clipping planes. */
1880
- private _material;
1881
- private _size;
1882
- private _enabled;
1883
- private _visible;
1884
- /** {@link Component.enabled} */
1885
- get enabled(): boolean;
1886
- /** {@link Component.enabled} */
1887
- set enabled(state: boolean);
1888
- /** {@link Hideable.visible } */
1889
- get visible(): boolean;
1890
- /** {@link Hideable.visible } */
1891
- set visible(state: boolean);
1892
- /** The material of the clipping plane representation. */
1893
- get material(): THREE.MeshBasicMaterial;
1894
- /** The material of the clipping plane representation. */
1895
- set material(material: THREE.MeshBasicMaterial);
1896
- /** The size of the geometric representation of the clippings planes. */
1897
- get size(): number;
1898
- /** The size of the geometric representation of the clippings planes. */
1899
- set size(size: number);
1900
- constructor(components: Components);
1901
- /** {@link Disposable.dispose} */
1902
- dispose(): void;
1903
- /** {@link Createable.create} */
1904
- create(world: World): void;
1881
+ showOnlyVertex: boolean;
1905
1882
  /**
1906
- * Creates a plane in a certain place and with a certain orientation,
1907
- * without the need of the mouse.
1908
- *
1909
- * @param world - the world where this plane should be created.
1910
- * @param normal - the orientation of the clipping plane.
1911
- * @param point - the position of the clipping plane.
1912
- * navigation.
1883
+ * The maximum distance for snapping to a vertex.
1913
1884
  */
1914
- createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
1885
+ snapDistance: number;
1915
1886
  /**
1916
- * {@link Createable.delete}
1917
- *
1918
- * @param world - the world where the plane to delete is.
1919
- * @param plane - the plane to delete. If undefined, the first plane
1920
- * found under the cursor will be deleted.
1887
+ * The HTML element to use for previewing the picked vertex.
1921
1888
  */
1922
- delete(world: World, plane?: SimplePlane): void;
1923
- /** Deletes all the existing clipping planes. */
1924
- deleteAll(): void;
1925
- private deletePlane;
1926
- private pickPlane;
1927
- private getAllPlaneMeshes;
1928
- private createPlaneFromIntersection;
1929
- private getWorldNormal;
1930
- private normalizePlaneDirectionY;
1931
- private newPlane;
1932
- private updateMaterialsAndPlanes;
1933
- private _onStartDragging;
1934
- private _onEndDragging;
1889
+ previewElement: HTMLElement;
1935
1890
  }
1936
- import { Components } from "../Components";
1937
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
1938
- import { Component, Event, Disposable, World } from "../Types";
1939
1891
  /**
1940
- * 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).
1892
+ * A class that provides functionality for picking vertices in a 3D scene.
1941
1893
  */
1942
- export declare class Cullers extends Component implements Disposable {
1894
+ export declare class VertexPicker extends Component implements Disposable {
1895
+ /** {@link Disposable.onDisposed} */
1896
+ readonly onDisposed: Event<unknown>;
1943
1897
  /**
1944
- * A unique identifier for the component.
1945
- * This UUID is used to register the component within the Components system.
1898
+ * An event that is triggered when a vertex is found.
1899
+ * The event passes a THREE.Vector3 representing the position of the found vertex.
1946
1900
  */
1947
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
1901
+ readonly onVertexFound: Event<THREE.Vector3>;
1948
1902
  /**
1949
- * An event that is triggered when the Cullers component is disposed.
1903
+ * An event that is triggered when a vertex is lost.
1904
+ * The event passes a THREE.Vector3 representing the position of the lost vertex.
1950
1905
  */
1951
- readonly onDisposed: Event<unknown>;
1906
+ readonly onVertexLost: Event<THREE.Vector3>;
1907
+ /**
1908
+ * An event that is triggered when the picker is enabled or disabled
1909
+ */
1910
+ readonly onEnabled: Event<boolean>;
1911
+ /**
1912
+ * A reference to the Components instance associated with this VertexPicker.
1913
+ */
1914
+ components: Components;
1915
+ /**
1916
+ * A reference to the working plane used for vertex picking.
1917
+ * This plane is used to determine which vertices are considered valid for picking.
1918
+ * If this value is null, all vertices are considered valid.
1919
+ */
1920
+ workingPlane: THREE.Plane | null;
1921
+ private _pickedPoint;
1922
+ private _config;
1952
1923
  private _enabled;
1953
1924
  /**
1954
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
1925
+ * Sets the enabled state of the VertexPicker.
1926
+ * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1927
+ * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1928
+ *
1929
+ * @param value - The new enabled state.
1955
1930
  */
1956
- list: Map<string, MeshCullerRenderer>;
1957
- /** {@link Component.enabled} */
1958
- get enabled(): boolean;
1959
- /** {@link Component.enabled} */
1960
1931
  set enabled(value: boolean);
1961
- constructor(components: Components);
1962
1932
  /**
1963
- * Creates a new MeshCullerRenderer for the given world.
1964
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
1933
+ * Gets the current enabled state of the VertexPicker.
1965
1934
  *
1966
- * @param world - The world for which to create the MeshCullerRenderer.
1967
- * @param config - Optional configuration settings for the MeshCullerRenderer.
1935
+ * @returns The current enabled state.
1936
+ */
1937
+ get enabled(): boolean;
1938
+ /**
1939
+ * Sets the configuration for the VertexPicker component.
1968
1940
  *
1969
- * @returns The newly created or existing MeshCullerRenderer for the given world.
1941
+ * @param value - A Partial object containing the configuration properties to update.
1942
+ * The properties not provided in the value object will retain their current values.
1943
+ *
1944
+ * @example
1945
+ * '''typescript
1946
+ * vertexPicker.config = {
1947
+ * snapDistance: 0.5,
1948
+ * showOnlyVertex: true,
1949
+ * };
1950
+ * '''
1970
1951
  */
1971
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
1952
+ set config(value: Partial<VertexPickerConfig>);
1972
1953
  /**
1973
- * Deletes the MeshCullerRenderer associated with the given world.
1974
- * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
1954
+ * Gets the current configuration for the VertexPicker component.
1975
1955
  *
1976
- * @param world - The world for which to delete the MeshCullerRenderer.
1956
+ * @returns A copy of the current VertexPickerConfig object.
1977
1957
  *
1978
- * @returns {void}
1958
+ * @example
1959
+ * '''typescript
1960
+ * const currentConfig = vertexPicker.config;
1961
+ * console.log(currentConfig.snapDistance); // Output: 0.25
1962
+ * '''
1979
1963
  */
1980
- delete(world: World): void;
1964
+ get config(): Partial<VertexPickerConfig>;
1965
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
1981
1966
  /** {@link Disposable.dispose} */
1982
1967
  dispose(): void;
1968
+ /**
1969
+ * Performs the vertex picking operation based on the current state of the VertexPicker.
1970
+ *
1971
+ * @param world - The World instance to use for raycasting.
1972
+ *
1973
+ * @returns The current picked point, or null if no point is picked.
1974
+ *
1975
+ * @remarks
1976
+ * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
1977
+ * If enabled, it performs raycasting to find the closest intersecting object.
1978
+ * It then determines the closest vertex or point on the face, based on the configuration settings.
1979
+ * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
1980
+ * If the picked point is not on the working plane, it resets the 'pickedPoint'.
1981
+ * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
1982
+ */
1983
+ get(world: World): THREE.Vector3 | null;
1984
+ private getClosestVertex;
1985
+ private getVertices;
1986
+ private getVertex;
1983
1987
  }
1984
- import * as WEBIFC from "web-ifc";
1985
- export interface IfcItemsCategories {
1986
- [itemID: number]: number;
1988
+ export declare class UUID {
1989
+ private static _pattern;
1990
+ private static _lut;
1991
+ static create(): string;
1992
+ static validate(uuid: string): void;
1987
1993
  }
1988
- export declare class IfcCategories {
1989
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
1994
+ import * as THREE from "three";
1995
+ import * as FRAGS from "@thatopen/fragments";
1996
+ import { Component, Components } from "../../core";
1997
+ /**
1998
+ * Represents an edge measurement result.
1999
+ */
2000
+ export interface MeasureEdge {
2001
+ /**
2002
+ * The distance between the two points of the edge.
2003
+ */
2004
+ distance: number;
2005
+ /**
2006
+ * The two points that define the edge.
2007
+ */
2008
+ points: THREE.Vector3[];
1990
2009
  }
1991
- import { MiniMap } from "./src";
1992
- import { Component, Updateable, World, Event, Disposable } from "../Types";
1993
- import { Components } from "../Components";
1994
2010
  /**
1995
- * 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).
2011
+ * Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
1996
2012
  */
1997
- export declare class MiniMaps extends Component implements Updateable, Disposable {
2013
+ export declare class MeasurementUtils extends Component {
1998
2014
  /**
1999
2015
  * A unique identifier for the component.
2000
2016
  * This UUID is used to register the component within the Components system.
2001
2017
  */
2002
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
2003
- /** {@link Updateable.onAfterUpdate} */
2004
- readonly onAfterUpdate: Event<unknown>;
2005
- /** {@link Updateable.onBeforeUpdate} */
2006
- readonly onBeforeUpdate: Event<unknown>;
2007
- /** {@link Disposable.onDisposed} */
2008
- readonly onDisposed: Event<unknown>;
2018
+ static uuid: string;
2009
2019
  /** {@link Component.enabled} */
2010
2020
  enabled: boolean;
2011
- /**
2012
- * A collection of {@link MiniMap} instances, each associated with a unique world ID.
2013
- */
2014
- list: Map<string, MiniMap>;
2015
2021
  constructor(components: Components);
2016
2022
  /**
2017
- * Creates a new {@link MiniMap} instance associated with the given world.
2018
- * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
2023
+ * Utility method to calculate the distance from a point to a line segment.
2019
2024
  *
2020
- * @param world - The {@link World} for which to create a {@link MiniMap} instance.
2021
- * @returns The newly created {@link MiniMap} instance.
2022
- * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
2025
+ * @param point - The point from which to calculate the distance.
2026
+ * @param lineStart - The start point of the line segment.
2027
+ * @param lineEnd - The end point of the line segment.
2028
+ * @param clamp - If true, the distance will be clamped to the line segment's length.
2029
+ * @returns The distance from the point to the line segment.
2023
2030
  */
2024
- create(world: World): MiniMap;
2031
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
2025
2032
  /**
2026
- * Deletes a {@link MiniMap} instance associated with the given world ID.
2027
- * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
2033
+ * Method to get the face of a mesh that contains a given triangle index.
2034
+ * It also returns the edges of the found face and their indices.
2028
2035
  *
2029
- * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
2030
- * @returns {void}
2031
- */
2032
- delete(id: string): void;
2033
- /** {@link Disposable.dispose} */
2034
- dispose(): void;
2035
- /** {@link Updateable.update} */
2036
- update(): void;
2037
- }
2038
- import * as THREE from "three";
2039
- import { Components } from "../Components";
2040
- import { SimpleCamera } from "..";
2041
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
2042
- /**
2043
- * A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
2044
- */
2045
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
2046
- /**
2047
- * A ProjectionManager instance that manages the projection modes of the camera.
2048
- */
2049
- readonly projection: ProjectionManager;
2050
- /**
2051
- * A THREE.OrthographicCamera instance that represents the orthographic camera.
2052
- * This camera is used when the projection mode is set to orthographic.
2053
- */
2054
- readonly threeOrtho: THREE.OrthographicCamera;
2055
- /**
2056
- * A THREE.PerspectiveCamera instance that represents the perspective camera.
2057
- * This camera is used when the projection mode is set to perspective.
2036
+ * @param mesh - The mesh to get the face from. It must be indexed.
2037
+ * @param triangleIndex - The index of the triangle within the mesh.
2038
+ * @param instance - The instance of the mesh (optional).
2039
+ * @returns An object containing the edges of the found face and their indices, or null if no face was found.
2058
2040
  */
2059
- readonly threePersp: THREE.PerspectiveCamera;
2060
- protected readonly _userInputButtons: any;
2061
- protected readonly _frustumSize = 50;
2062
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
2063
- protected _mode: NavigationMode | null;
2064
- private previousSize;
2041
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
2042
+ edges: MeasureEdge[];
2043
+ indices: Set<number>;
2044
+ } | null;
2065
2045
  /**
2066
- * Getter for the current navigation mode.
2067
- * Throws an error if the mode is not found or the camera is not initialized.
2068
- *
2069
- * @returns {NavigationMode} The current navigation mode.
2046
+ * Method to get the vertices and normal of a mesh face at a given index.
2047
+ * It also applies instance transformation if provided.
2070
2048
  *
2071
- * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
2049
+ * @param mesh - The mesh to get the face from. It must be indexed.
2050
+ * @param faceIndex - The index of the face within the mesh.
2051
+ * @param instance - The instance of the mesh (optional).
2052
+ * @returns An object containing the vertices and normal of the face.
2053
+ * @throws Will throw an error if the geometry is not indexed.
2072
2054
  */
2073
- get mode(): NavigationMode;
2074
- constructor(components: Components);
2075
- /** {@link Disposable.dispose} */
2076
- dispose(): void;
2055
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
2056
+ p1: THREE.Vector3;
2057
+ p2: THREE.Vector3;
2058
+ p3: THREE.Vector3;
2059
+ faceNormal: THREE.Vector3;
2060
+ };
2077
2061
  /**
2078
- * Sets a new {@link NavigationMode} and disables the previous one.
2062
+ * Method to round the vector's components to a specified number of decimal places.
2063
+ * This is used to ensure numerical precision in edge detection.
2079
2064
  *
2080
- * @param mode - The {@link NavigationMode} to set.
2065
+ * @param vector - The vector to round.
2066
+ * @returns The vector with rounded components.
2081
2067
  */
2082
- set(mode: NavModeID): void;
2068
+ round(vector: THREE.Vector3): void;
2083
2069
  /**
2084
- * Make the camera view fit all the specified meshes.
2070
+ * Calculates the volume of a set of fragments.
2085
2071
  *
2086
- * @param meshes the meshes to fit. If it is not defined, it will
2087
- * evaluate {@link Components.meshes}.
2088
- * @param offset the distance to the fit object
2072
+ * @param frags - A map of fragment IDs to their corresponding item IDs.
2073
+ * @returns The total volume of the fragments and the bounding sphere.
2074
+ *
2075
+ * @remarks
2076
+ * This method creates a set of instanced meshes from the given fragments and item IDs.
2077
+ * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
2078
+ *
2079
+ * @throws Will throw an error if the geometry of the meshes is not indexed.
2080
+ * @throws Will throw an error if the fragment manager is not available.
2089
2081
  */
2090
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
2082
+ getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
2091
2083
  /**
2092
- * Allows or prevents all user input.
2084
+ * Calculates the total volume of a set of meshes.
2085
+ *
2086
+ * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
2087
+ * @returns The total volume of the meshes and the bounding sphere.
2088
+ *
2089
+ * @remarks
2090
+ * This method calculates the volume of each mesh in the provided array and returns the total volume
2091
+ * and its bounding sphere.
2093
2092
  *
2094
- * @param active - whether to enable or disable user inputs.
2095
2093
  */
2096
- setUserInput(active: boolean): void;
2097
- private disableUserInput;
2098
- private enableUserInput;
2099
- private newOrthoCamera;
2100
- private setOrthoPerspCameraAspect;
2094
+ getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
2095
+ private getFaceData;
2096
+ private getVolumeOfMesh;
2097
+ private getSignedVolumeOfTriangle;
2101
2098
  }
2102
- /**
2103
- * 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.
2104
- *
2105
- * @remarks
2106
- * This map is used to provide a mapping between IFC entity type numbers and their names.
2107
- * It is useful for identifying and processing different types of IFC elements in a project.
2108
- *
2109
- */
2110
- export declare const IfcElements: {
2111
- [key: number]: string;
2112
- };
2113
- /**
2114
- * 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.
2115
- */
2116
- export declare const IfcCategoryMap: {
2117
- [key: number]: string;
2118
- };
2119
- import * as FRAGS from "@thatopen/fragments";
2120
- export declare class IfcPropertiesUtils {
2121
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
2122
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
2123
- [attribute: string]: any;
2124
- } | null>;
2125
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
2126
- [relatingID: number]: number[];
2127
- }>;
2128
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
2129
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
2130
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
2131
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
2132
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
2133
- key: string | null;
2134
- name: string | null;
2135
- }>;
2136
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
2137
- key: string | null;
2138
- value: number | null;
2139
- }>;
2140
- static isRel(expressID: number): boolean;
2141
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2142
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2099
+ import * as WEBIFC from "web-ifc";
2100
+ import { IfcItemsCategories } from "../../../ifc";
2101
+ export declare class SpatialStructure {
2102
+ itemsByFloor: IfcItemsCategories;
2103
+ private _units;
2104
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2105
+ cleanUp(): void;
2143
2106
  }
2144
- /**
2145
- * A Set of unique numbers representing different types of IFC geometries.
2146
- */
2147
- export declare const GeometryTypes: Set<number>;
2148
2107
  import * as WEBIFC from "web-ifc";
2149
2108
  /** Configuration of the IFC-fragment conversion. */
2150
2109
  export declare class IfcFragmentSettings {
@@ -2186,19 +2145,39 @@ export declare class IfcFragmentSettings {
2186
2145
  */
2187
2146
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2188
2147
  }
2148
+ /**
2149
+ * A Set of unique numbers representing different types of IFC geometries.
2150
+ */
2151
+ export declare const GeometryTypes: Set<number>;
2189
2152
  import * as WEBIFC from "web-ifc";
2190
- import { IfcItemsCategories } from "../../../ifc";
2191
- export declare class SpatialStructure {
2192
- itemsByFloor: IfcItemsCategories;
2193
- private _units;
2194
- setUp(webIfc: WEBIFC.IfcAPI): void;
2195
- cleanUp(): void;
2153
+ export interface IfcItemsCategories {
2154
+ [itemID: number]: number;
2155
+ }
2156
+ export declare class IfcCategories {
2157
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2196
2158
  }
2159
+ /**
2160
+ * A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
2161
+ *
2162
+ * @remarks
2163
+ * This map is used to provide a mapping between IFC entity type numbers and their names.
2164
+ * It is useful for identifying and processing different types of IFC elements in a project.
2165
+ *
2166
+ */
2167
+ export declare const IfcElements: {
2168
+ [key: number]: string;
2169
+ };
2197
2170
  import { InverseAttribute } from "./types";
2198
2171
  export declare const relToAttributesMap: Map<number, {
2199
2172
  forRelating: InverseAttribute;
2200
2173
  forRelated: InverseAttribute;
2201
2174
  }>;
2175
+ /**
2176
+ * A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
2177
+ */
2178
+ export declare const IfcCategoryMap: {
2179
+ [key: number]: string;
2180
+ };
2202
2181
  import * as THREE from "three";
2203
2182
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
2204
2183
  /**
@@ -2288,130 +2267,89 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
2288
2267
  resize(size?: THREE.Vector2): void;
2289
2268
  private updatePlanes;
2290
2269
  }
2291
- import * as WEBIFC from "web-ifc";
2292
- import * as THREE from "three";
2293
- export declare class Units {
2294
- factor: number;
2295
- complement: number;
2296
- apply(matrix: THREE.Matrix4): void;
2297
- setUp(webIfc: WEBIFC.IfcAPI): void;
2298
- private getLengthUnits;
2299
- private getScaleMatrix;
2300
- }
2301
- import * as THREE from "three";
2302
- import * as WEBIFC from "web-ifc";
2303
2270
  import * as FRAGS from "@thatopen/fragments";
2304
- export declare class CivilReader {
2305
- defLineMat: THREE.LineBasicMaterial;
2306
- read(webIfc: WEBIFC.IfcAPI): {
2307
- alignments: Map<number, FRAGS.Alignment>;
2308
- coordinationMatrix: THREE.Matrix4;
2309
- } | undefined;
2310
- get(civilItems: any): {
2311
- alignments: Map<number, FRAGS.Alignment>;
2312
- coordinationMatrix: THREE.Matrix4;
2313
- } | undefined;
2314
- private getCurves;
2271
+ export declare class IfcPropertiesUtils {
2272
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
2273
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
2274
+ [attribute: string]: any;
2275
+ } | null>;
2276
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
2277
+ [relatingID: number]: number[];
2278
+ }>;
2279
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
2280
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
2281
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
2282
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
2283
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
2284
+ key: string | null;
2285
+ name: string | null;
2286
+ }>;
2287
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
2288
+ key: string | null;
2289
+ value: number | null;
2290
+ }>;
2291
+ static isRel(expressID: number): boolean;
2292
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2293
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2315
2294
  }
2316
- import { IfcFragmentSettings } from "../../IfcLoader/src";
2295
+ import * as THREE from "three";
2296
+ import { Hideable, Event, World, Disposable } from "../../Types";
2297
+ import { Components } from "../../Components";
2317
2298
  /**
2318
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
2299
+ * Configuration interface for the {@link SimpleGrid} class.
2319
2300
  */
2320
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
2301
+ export interface GridConfig {
2321
2302
  /**
2322
- * Amount of properties to be streamed.
2323
- * Defaults to 100 properties.
2303
+ * The color of the grid lines.
2324
2304
  */
2325
- propertiesSize: number;
2326
- }
2327
- import * as WEBIFC from "web-ifc";
2328
- export declare class IfcMetadataReader {
2329
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
2330
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
2331
- }
2332
- /**
2333
- * A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
2334
- */
2335
- export interface StreamedGeometries {
2336
- [id: number]: {
2337
- /** The bounding box of the geometry as a Float32Array. */
2338
- boundingBox: Float32Array;
2339
- /** A boolean indicating whether the geometry has holes. */
2340
- hasHoles: boolean;
2341
- /** An optional file path for the geometry data. */
2342
- geometryFile?: string;
2343
- };
2344
- }
2345
- /**
2346
- * A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
2347
- */
2348
- export interface StreamedAsset {
2349
- /** The unique identifier of the asset. */
2350
- id: number;
2351
- /** An array of geometries associated with the asset. */
2352
- geometries: {
2353
- /** The unique identifier of the geometry. */
2354
- geometryID: number;
2355
- /** The transformation matrix of the geometry as a number array. */
2356
- transformation: number[];
2357
- /** The color of the geometry as a number array. */
2358
- color: number[];
2359
- }[];
2360
- }
2361
- import { IfcFragmentSettings } from "../../IfcLoader/src";
2362
- /**
2363
- * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
2364
- */
2365
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
2305
+ color: THREE.Color;
2366
2306
  /**
2367
- * Minimum number of geometries to be streamed.
2368
- * Defaults to 10 geometries.
2307
+ * The size of the primary grid lines.
2369
2308
  */
2370
- minGeometrySize: number;
2309
+ size1: number;
2371
2310
  /**
2372
- * Minimum amount of assets to be streamed.
2373
- * Defaults to 1000 assets.
2311
+ * The size of the secondary grid lines.
2374
2312
  */
2375
- minAssetsSize: number;
2376
- }
2377
- import * as THREE from "three";
2378
- import { BaseScene, Configurable, Event } from "../../Types";
2379
- import { Components } from "../../Components";
2380
- /**
2381
- * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2382
- */
2383
- export interface SimpleSceneConfig {
2384
- directionalLight: {
2385
- color: THREE.Color;
2386
- intensity: number;
2387
- position: THREE.Vector3;
2388
- };
2389
- ambientLight: {
2390
- color: THREE.Color;
2391
- intensity: number;
2392
- };
2313
+ size2: number;
2314
+ /**
2315
+ * The distance at which the grid lines start to fade away.
2316
+ */
2317
+ distance: number;
2393
2318
  }
2394
2319
  /**
2395
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
2320
+ * An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
2396
2321
  */
2397
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2398
- /** {@link Configurable.isSetup} */
2399
- isSetup: boolean;
2322
+ export declare class SimpleGrid implements Hideable, Disposable {
2323
+ /** {@link Disposable.onDisposed} */
2324
+ readonly onDisposed: Event<unknown>;
2325
+ /** The world instance to which this Raycaster belongs. */
2326
+ world: World;
2327
+ /** The components instance to which this grid belongs. */
2328
+ components: Components;
2329
+ /** {@link Hideable.visible} */
2330
+ get visible(): boolean;
2331
+ /** {@link Hideable.visible} */
2332
+ set visible(visible: boolean);
2333
+ /** The material of the grid. */
2334
+ get material(): THREE.ShaderMaterial;
2400
2335
  /**
2401
- * The underlying Three.js scene object.
2402
- * It is used to define the 3D space containing objects, lights, and cameras.
2403
- */
2404
- three: THREE.Scene;
2405
- /** {@link Configurable.onSetup} */
2406
- readonly onSetup: Event<SimpleScene>;
2336
+ * Whether the grid should fade away with distance. Recommended to be true for
2337
+ * perspective cameras and false for orthographic cameras.
2338
+ */
2339
+ get fade(): boolean;
2407
2340
  /**
2408
- * Configuration interface for the {@link SimpleScene}.
2409
- * Defines properties for directional and ambient lights.
2341
+ * Whether the grid should fade away with distance. Recommended to be true for
2342
+ * perspective cameras and false for orthographic cameras.
2410
2343
  */
2411
- config: Required<SimpleSceneConfig>;
2412
- constructor(components: Components);
2413
- /** {@link Configurable.setup} */
2414
- setup(config?: Partial<SimpleSceneConfig>): void;
2344
+ set fade(active: boolean);
2345
+ /** The Three.js mesh that contains the infinite grid. */
2346
+ readonly three: THREE.Mesh;
2347
+ private _fade;
2348
+ constructor(components: Components, world: World, config: GridConfig);
2349
+ /** {@link Disposable.dispose} */
2350
+ dispose(): void;
2351
+ private setupEvents;
2352
+ private updateZoom;
2415
2353
  }
2416
2354
  import * as THREE from "three";
2417
2355
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
@@ -2493,6 +2431,45 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
2493
2431
  dispose(disposeResources?: boolean): void;
2494
2432
  }
2495
2433
  import * as THREE from "three";
2434
+ import { BaseScene, Configurable, Event } from "../../Types";
2435
+ import { Components } from "../../Components";
2436
+ /**
2437
+ * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2438
+ */
2439
+ export interface SimpleSceneConfig {
2440
+ directionalLight: {
2441
+ color: THREE.Color;
2442
+ intensity: number;
2443
+ position: THREE.Vector3;
2444
+ };
2445
+ ambientLight: {
2446
+ color: THREE.Color;
2447
+ intensity: number;
2448
+ };
2449
+ }
2450
+ /**
2451
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
2452
+ */
2453
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2454
+ /** {@link Configurable.isSetup} */
2455
+ isSetup: boolean;
2456
+ /**
2457
+ * The underlying Three.js scene object.
2458
+ * It is used to define the 3D space containing objects, lights, and cameras.
2459
+ */
2460
+ three: THREE.Scene;
2461
+ /** {@link Configurable.onSetup} */
2462
+ readonly onSetup: Event<SimpleScene>;
2463
+ /**
2464
+ * Configuration interface for the {@link SimpleScene}.
2465
+ * Defines properties for directional and ambient lights.
2466
+ */
2467
+ config: Required<SimpleSceneConfig>;
2468
+ constructor(components: Components);
2469
+ /** {@link Configurable.setup} */
2470
+ setup(config?: Partial<SimpleSceneConfig>): void;
2471
+ }
2472
+ import * as THREE from "three";
2496
2473
  import { BaseRenderer, Event } from "../../Types";
2497
2474
  import { Components } from "../../Components";
2498
2475
  /**
@@ -2609,6 +2586,81 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
2609
2586
  private static getSubsetOfThree;
2610
2587
  }
2611
2588
  import * as THREE from "three";
2589
+ import { Disposable, Event } from "../../Types";
2590
+ /**
2591
+ * A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
2592
+ */
2593
+ export declare class Mouse implements Disposable {
2594
+ dom: HTMLCanvasElement;
2595
+ private _event?;
2596
+ private _position;
2597
+ /** {@link Disposable.onDisposed} */
2598
+ readonly onDisposed: Event<unknown>;
2599
+ constructor(dom: HTMLCanvasElement);
2600
+ /**
2601
+ * The real position of the mouse of the Three.js canvas.
2602
+ */
2603
+ get position(): THREE.Vector2;
2604
+ /** {@link Disposable.dispose} */
2605
+ dispose(): void;
2606
+ private getPositionY;
2607
+ private getPositionX;
2608
+ private updateMouseInfo;
2609
+ private setupEvents;
2610
+ }
2611
+ import * as THREE from "three";
2612
+ import { Components } from "../../Components";
2613
+ import { Event, World, Disposable } from "../../Types";
2614
+ import { Mouse } from "./mouse";
2615
+ /**
2616
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
2617
+ */
2618
+ export declare class SimpleRaycaster implements Disposable {
2619
+ /** {@link Component.enabled} */
2620
+ enabled: boolean;
2621
+ /** The components instance to which this Raycaster belongs. */
2622
+ components: Components;
2623
+ /** {@link Disposable.onDisposed} */
2624
+ readonly onDisposed: Event<unknown>;
2625
+ /** The position of the mouse in the screen. */
2626
+ readonly mouse: Mouse;
2627
+ /**
2628
+ * A reference to the Three.js Raycaster instance.
2629
+ * This is used for raycasting operations.
2630
+ */
2631
+ readonly three: THREE.Raycaster;
2632
+ /**
2633
+ * A reference to the world instance to which this Raycaster belongs.
2634
+ * This is used to access the camera and meshes.
2635
+ */
2636
+ world: World;
2637
+ constructor(components: Components, world: World);
2638
+ /** {@link Disposable.dispose} */
2639
+ dispose(): void;
2640
+ /**
2641
+ * Throws a ray from the camera to the mouse or touch event point and returns
2642
+ * the first item found. This also takes into account the clipping planes
2643
+ * used by the renderer.
2644
+ *
2645
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2646
+ * to query. If not provided, it will query all the meshes stored in
2647
+ * {@link Components.meshes}.
2648
+ */
2649
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2650
+ /**
2651
+ * Casts a ray from a given origin in a given direction and returns the first item found.
2652
+ * This method also takes into account the clipping planes used by the renderer.
2653
+ *
2654
+ * @param origin - The origin of the ray.
2655
+ * @param direction - The direction of the ray.
2656
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2657
+ * @returns The first intersection found or 'null' if no intersection was found.
2658
+ */
2659
+ castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
2660
+ private intersect;
2661
+ private filterClippingPlanes;
2662
+ }
2663
+ import * as THREE from "three";
2612
2664
  import { Components } from "../../Components";
2613
2665
  import { AsyncEvent, Event, World } from "../../Types";
2614
2666
  /**
@@ -2700,65 +2752,6 @@ export declare class CullerRenderer {
2700
2752
  private applySettings;
2701
2753
  }
2702
2754
  import * as THREE from "three";
2703
- import { Hideable, Event, World, Disposable } from "../../Types";
2704
- import { Components } from "../../Components";
2705
- /**
2706
- * Configuration interface for the {@link SimpleGrid} class.
2707
- */
2708
- export interface GridConfig {
2709
- /**
2710
- * The color of the grid lines.
2711
- */
2712
- color: THREE.Color;
2713
- /**
2714
- * The size of the primary grid lines.
2715
- */
2716
- size1: number;
2717
- /**
2718
- * The size of the secondary grid lines.
2719
- */
2720
- size2: number;
2721
- /**
2722
- * The distance at which the grid lines start to fade away.
2723
- */
2724
- distance: number;
2725
- }
2726
- /**
2727
- * An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
2728
- */
2729
- export declare class SimpleGrid implements Hideable, Disposable {
2730
- /** {@link Disposable.onDisposed} */
2731
- readonly onDisposed: Event<unknown>;
2732
- /** The world instance to which this Raycaster belongs. */
2733
- world: World;
2734
- /** The components instance to which this grid belongs. */
2735
- components: Components;
2736
- /** {@link Hideable.visible} */
2737
- get visible(): boolean;
2738
- /** {@link Hideable.visible} */
2739
- set visible(visible: boolean);
2740
- /** The material of the grid. */
2741
- get material(): THREE.ShaderMaterial;
2742
- /**
2743
- * Whether the grid should fade away with distance. Recommended to be true for
2744
- * perspective cameras and false for orthographic cameras.
2745
- */
2746
- get fade(): boolean;
2747
- /**
2748
- * Whether the grid should fade away with distance. Recommended to be true for
2749
- * perspective cameras and false for orthographic cameras.
2750
- */
2751
- set fade(active: boolean);
2752
- /** The Three.js mesh that contains the infinite grid. */
2753
- readonly three: THREE.Mesh;
2754
- private _fade;
2755
- constructor(components: Components, world: World, config: GridConfig);
2756
- /** {@link Disposable.dispose} */
2757
- dispose(): void;
2758
- private setupEvents;
2759
- private updateZoom;
2760
- }
2761
- import * as THREE from "three";
2762
2755
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
2763
2756
  import { Components } from "../../Components";
2764
2757
  import { Event, World, Disposable } from "../../Types";
@@ -2814,6 +2807,7 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
2814
2807
  private handleWorkerMessage;
2815
2808
  private getAvailableMaterial;
2816
2809
  }
2810
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2817
2811
  /**
2818
2812
  * Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
2819
2813
  */
@@ -2842,6 +2836,19 @@ export declare class Event<T> {
2842
2836
  reset(): void;
2843
2837
  private handlers;
2844
2838
  }
2839
+ import { Base } from "./base";
2840
+ /**
2841
+ * Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
2842
+ */
2843
+ export declare abstract class Component extends Base {
2844
+ /**
2845
+ * Whether this component is active or not. The behaviour can vary depending
2846
+ * on the type of component. E.g. a disabled dimension tool will stop creating
2847
+ * dimensions, while a disabled camera will stop moving. A disabled component
2848
+ * will not be updated automatically each frame.
2849
+ */
2850
+ abstract enabled: boolean;
2851
+ }
2845
2852
  /**
2846
2853
  * Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
2847
2854
  */
@@ -2870,7 +2877,6 @@ export declare class AsyncEvent<T> {
2870
2877
  reset(): void;
2871
2878
  private handlers;
2872
2879
  }
2873
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2874
2880
  import * as THREE from "three";
2875
2881
  import CameraControls from "camera-controls";
2876
2882
  import { Event } from "./event";
@@ -2979,60 +2985,33 @@ export interface CameraControllable {
2979
2985
  */
2980
2986
  controls: CameraControls;
2981
2987
  }
2982
- import { Base } from "./base";
2988
+ import * as THREE from "three";
2989
+ import CameraControls from "camera-controls";
2990
+ import { BaseWorldItem } from "./base-world-item";
2991
+ import { CameraControllable } from "./interfaces";
2983
2992
  /**
2984
- * Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
2993
+ * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
2985
2994
  */
2986
- export declare abstract class Component extends Base {
2995
+ export declare abstract class BaseCamera extends BaseWorldItem {
2987
2996
  /**
2988
- * Whether this component is active or not. The behaviour can vary depending
2989
- * on the type of component. E.g. a disabled dimension tool will stop creating
2990
- * dimensions, while a disabled camera will stop moving. A disabled component
2991
- * will not be updated automatically each frame.
2997
+ * Whether the camera is enabled or not.
2992
2998
  */
2993
2999
  abstract enabled: boolean;
2994
- }
2995
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2996
- import { Components } from "../../Components";
2997
- /**
2998
- * Base class of the library. Useful for finding out the interfaces something implements.
2999
- */
3000
- export declare abstract class Base {
3001
- components: Components;
3002
- constructor(components: Components);
3003
- /** Whether is component is {@link Disposable}. */
3004
- isDisposeable: () => this is Disposable;
3005
- /** Whether is component is {@link Resizeable}. */
3006
- isResizeable: () => this is Resizeable;
3007
- /** Whether is component is {@link Updateable}. */
3008
- isUpdateable: () => this is Updateable;
3009
- /** Whether is component is {@link Hideable}. */
3010
- isHideable: () => this is Hideable;
3011
- /** Whether is component is {@link Configurable}. */
3012
- isConfigurable: () => this is Configurable<any>;
3013
- }
3014
- import { Base } from "./base";
3015
- import { World } from "./world";
3016
- import { Event } from "./event";
3017
- import { Components } from "../../Components";
3018
- /**
3019
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
3020
- */
3021
- export declare abstract class BaseWorldItem extends Base {
3022
- readonly worlds: Map<string, World>;
3023
3000
  /**
3024
- * Event that is triggered when a world is added or removed from the 'worlds' map.
3025
- * The event payload contains the world instance and the action ("added" or "removed").
3001
+ * The Three.js camera instance.
3002
+ */
3003
+ abstract three: THREE.Camera;
3004
+ /**
3005
+ * Optional CameraControls instance for controlling the camera.
3006
+ * This property is only available if the camera is controllable.
3026
3007
  */
3027
- readonly onWorldChanged: Event<{
3028
- world: World;
3029
- action: "added" | "removed";
3030
- }>;
3008
+ abstract controls?: CameraControls;
3031
3009
  /**
3032
- * The current world this item is associated with. It can be null if no world is currently active.
3010
+ * Checks whether the instance is {@link CameraControllable}.
3011
+ *
3012
+ * @returns True if the instance is controllable, false otherwise.
3033
3013
  */
3034
- currentWorld: World | null;
3035
- protected constructor(components: Components);
3014
+ hasCameraControls: () => this is CameraControllable;
3036
3015
  }
3037
3016
  import * as THREE from "three";
3038
3017
  import { Vector2 } from "three";
@@ -3100,68 +3079,6 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
3100
3079
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
3101
3080
  }
3102
3081
  import * as THREE from "three";
3103
- import CameraControls from "camera-controls";
3104
- import { BaseWorldItem } from "./base-world-item";
3105
- import { CameraControllable } from "./interfaces";
3106
- /**
3107
- * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
3108
- */
3109
- export declare abstract class BaseCamera extends BaseWorldItem {
3110
- /**
3111
- * Whether the camera is enabled or not.
3112
- */
3113
- abstract enabled: boolean;
3114
- /**
3115
- * The Three.js camera instance.
3116
- */
3117
- abstract three: THREE.Camera;
3118
- /**
3119
- * Optional CameraControls instance for controlling the camera.
3120
- * This property is only available if the camera is controllable.
3121
- */
3122
- abstract controls?: CameraControls;
3123
- /**
3124
- * Checks whether the instance is {@link CameraControllable}.
3125
- *
3126
- * @returns True if the instance is controllable, false otherwise.
3127
- */
3128
- hasCameraControls: () => this is CameraControllable;
3129
- }
3130
- import * as THREE from "three";
3131
- import { BaseScene } from "./base-scene";
3132
- import { BaseCamera } from "./base-camera";
3133
- import { BaseRenderer } from "./base-renderer";
3134
- import { Updateable, Disposable } from "./interfaces";
3135
- /**
3136
- * Represents a 3D world with meshes, scene, camera, renderer, and other properties.
3137
- */
3138
- export interface World extends Disposable, Updateable {
3139
- /**
3140
- * A set of meshes present in the world. This is taken into account for operations like raycasting.
3141
- */
3142
- meshes: Set<THREE.Mesh>;
3143
- /**
3144
- * The base scene of the world.
3145
- */
3146
- scene: BaseScene;
3147
- /**
3148
- * The base camera of the world.
3149
- */
3150
- camera: BaseCamera;
3151
- /**
3152
- * The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
3153
- */
3154
- renderer: BaseRenderer | null;
3155
- /**
3156
- * A unique identifier for the world.
3157
- */
3158
- uuid: string;
3159
- /**
3160
- * Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
3161
- */
3162
- isDisposing: boolean;
3163
- }
3164
- import * as THREE from "three";
3165
3082
  import { Disposable } from "./interfaces";
3166
3083
  import { Event } from "./event";
3167
3084
  import { Components } from "../../Components";
@@ -3181,203 +3098,81 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
3181
3098
  /** {@link Disposable.dispose} */
3182
3099
  dispose(): void;
3183
3100
  }
3184
- import { NavigationMode } from "./types";
3185
- import { OrthoPerspectiveCamera } from "../index";
3186
- /**
3187
- * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
3188
- */
3189
- export declare class OrbitMode implements NavigationMode {
3190
- camera: OrthoPerspectiveCamera;
3191
- /** {@link NavigationMode.enabled} */
3192
- enabled: boolean;
3193
- /** {@link NavigationMode.id} */
3194
- readonly id = "Orbit";
3195
- constructor(camera: OrthoPerspectiveCamera);
3196
- /** {@link NavigationMode.set} */
3197
- set(active: boolean): void;
3198
- private activateOrbitControls;
3199
- }
3200
- import { NavigationMode } from "./types";
3201
- import { OrthoPerspectiveCamera } from "../index";
3202
- /**
3203
- * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
3204
- */
3205
- export declare class FirstPersonMode implements NavigationMode {
3206
- private camera;
3207
- /** {@link NavigationMode.enabled} */
3208
- enabled: boolean;
3209
- /** {@link NavigationMode.id} */
3210
- readonly id = "FirstPerson";
3211
- constructor(camera: OrthoPerspectiveCamera);
3212
- /** {@link NavigationMode.set} */
3213
- set(active: boolean): void;
3214
- private setupFirstPersonCamera;
3215
- }
3216
- /**
3217
- * The projection system of the camera.
3218
- */
3219
- export type CameraProjection = "Perspective" | "Orthographic";
3220
- /**
3221
- * The extensible list of supported navigation modes.
3222
- */
3223
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3101
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
3102
+ import { Components } from "../../Components";
3224
3103
  /**
3225
- * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3104
+ * Base class of the library. Useful for finding out the interfaces something implements.
3226
3105
  */
3227
- export interface NavigationMode {
3228
- /** The unique ID of this navigation mode. */
3229
- id: NavModeID;
3230
- /**
3231
- * Enable or disable this navigation mode.
3232
- * When a new navigation mode is enabled, the previous navigation mode
3233
- * must be disabled.
3234
- *
3235
- * @param active - whether to enable or disable this mode.
3236
- * @param options - any additional data required to enable or disable it.
3237
- * */
3238
- set: (active: boolean, options?: any) => void;
3239
- /** Whether this navigation mode is active or not. */
3240
- enabled: boolean;
3106
+ export declare abstract class Base {
3107
+ components: Components;
3108
+ constructor(components: Components);
3109
+ /** Whether is component is {@link Disposable}. */
3110
+ isDisposeable: () => this is Disposable;
3111
+ /** Whether is component is {@link Resizeable}. */
3112
+ isResizeable: () => this is Resizeable;
3113
+ /** Whether is component is {@link Updateable}. */
3114
+ isUpdateable: () => this is Updateable;
3115
+ /** Whether is component is {@link Hideable}. */
3116
+ isHideable: () => this is Hideable;
3117
+ /** Whether is component is {@link Configurable}. */
3118
+ isConfigurable: () => this is Configurable<any>;
3241
3119
  }
3242
- import * as THREE from "three";
3243
- import { CameraProjection } from "./types";
3244
- import { Event } from "../../Types";
3245
- import { OrthoPerspectiveCamera } from "../index";
3120
+ import { Base } from "./base";
3121
+ import { World } from "./world";
3122
+ import { Event } from "./event";
3123
+ import { Components } from "../../Components";
3246
3124
  /**
3247
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3125
+ * One of the elements that make a world. It can be either a scene, a camera or a renderer.
3248
3126
  */
3249
- export declare class ProjectionManager {
3250
- /**
3251
- * Event that fires when the {@link CameraProjection} changes.
3252
- */
3253
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
3254
- /**
3255
- * Current projection mode of the camera.
3256
- * Default is "Perspective".
3257
- */
3258
- current: CameraProjection;
3259
- /**
3260
- * The camera controlled by this ProjectionManager.
3261
- * It can be either a PerspectiveCamera or an OrthographicCamera.
3262
- */
3263
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3264
- /** Match Ortho zoom with Perspective distance when changing projection mode */
3265
- matchOrthoDistanceEnabled: boolean;
3266
- private _component;
3267
- private _previousDistance;
3268
- constructor(camera: OrthoPerspectiveCamera);
3127
+ export declare abstract class BaseWorldItem extends Base {
3128
+ readonly worlds: Map<string, World>;
3269
3129
  /**
3270
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3271
- *
3272
- * @param projection - the new projection to set. If it is the current projection,
3273
- * it will have no effect.
3130
+ * Event that is triggered when a world is added or removed from the 'worlds' map.
3131
+ * The event payload contains the world instance and the action ("added" or "removed").
3274
3132
  */
3275
- set(projection: CameraProjection): Promise<void>;
3133
+ readonly onWorldChanged: Event<{
3134
+ world: World;
3135
+ action: "added" | "removed";
3136
+ }>;
3276
3137
  /**
3277
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
3278
- * and vice versa.
3138
+ * The current world this item is associated with. It can be null if no world is currently active.
3279
3139
  */
3280
- toggle(): Promise<void>;
3281
- private setOrthoCamera;
3282
- private getPerspectiveDims;
3283
- private setupOrthoCamera;
3284
- private getDistance;
3285
- private setPerspectiveCamera;
3140
+ currentWorld: World | null;
3141
+ protected constructor(components: Components);
3286
3142
  }
3287
3143
  import * as THREE from "three";
3288
- import { Disposable, Event } from "../../Types";
3144
+ import { BaseScene } from "./base-scene";
3145
+ import { BaseCamera } from "./base-camera";
3146
+ import { BaseRenderer } from "./base-renderer";
3147
+ import { Updateable, Disposable } from "./interfaces";
3289
3148
  /**
3290
- * 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.
3149
+ * Represents a 3D world with meshes, scene, camera, renderer, and other properties.
3291
3150
  */
3292
- export declare class Mouse implements Disposable {
3293
- dom: HTMLCanvasElement;
3294
- private _event?;
3295
- private _position;
3296
- /** {@link Disposable.onDisposed} */
3297
- readonly onDisposed: Event<unknown>;
3298
- constructor(dom: HTMLCanvasElement);
3151
+ export interface World extends Disposable, Updateable {
3299
3152
  /**
3300
- * The real position of the mouse of the Three.js canvas.
3153
+ * A set of meshes present in the world. This is taken into account for operations like raycasting.
3301
3154
  */
3302
- get position(): THREE.Vector2;
3303
- /** {@link Disposable.dispose} */
3304
- dispose(): void;
3305
- private getPositionY;
3306
- private getPositionX;
3307
- private updateMouseInfo;
3308
- private setupEvents;
3309
- }
3310
- import * as THREE from "three";
3311
- import { Components } from "../../Components";
3312
- import { Event, World, Disposable } from "../../Types";
3313
- import { Mouse } from "./mouse";
3314
- /**
3315
- * 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.
3316
- */
3317
- export declare class SimpleRaycaster implements Disposable {
3318
- /** {@link Component.enabled} */
3319
- enabled: boolean;
3320
- /** The components instance to which this Raycaster belongs. */
3321
- components: Components;
3322
- /** {@link Disposable.onDisposed} */
3323
- readonly onDisposed: Event<unknown>;
3324
- /** The position of the mouse in the screen. */
3325
- readonly mouse: Mouse;
3155
+ meshes: Set<THREE.Mesh>;
3326
3156
  /**
3327
- * A reference to the Three.js Raycaster instance.
3328
- * This is used for raycasting operations.
3157
+ * The base scene of the world.
3329
3158
  */
3330
- readonly three: THREE.Raycaster;
3159
+ scene: BaseScene;
3331
3160
  /**
3332
- * A reference to the world instance to which this Raycaster belongs.
3333
- * This is used to access the camera and meshes.
3161
+ * The base camera of the world.
3162
+ */
3163
+ camera: BaseCamera;
3164
+ /**
3165
+ * The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
3334
3166
  */
3335
- world: World;
3336
- constructor(components: Components, world: World);
3337
- /** {@link Disposable.dispose} */
3338
- dispose(): void;
3167
+ renderer: BaseRenderer | null;
3339
3168
  /**
3340
- * Throws a ray from the camera to the mouse or touch event point and returns
3341
- * the first item found. This also takes into account the clipping planes
3342
- * used by the renderer.
3343
- *
3344
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
3345
- * to query. If not provided, it will query all the meshes stored in
3346
- * {@link Components.meshes}.
3169
+ * A unique identifier for the world.
3347
3170
  */
3348
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
3171
+ uuid: string;
3349
3172
  /**
3350
- * Casts a ray from a given origin in a given direction and returns the first item found.
3351
- * This method also takes into account the clipping planes used by the renderer.
3352
- *
3353
- * @param origin - The origin of the ray.
3354
- * @param direction - The direction of the ray.
3355
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3356
- * @returns The first intersection found or 'null' if no intersection was found.
3173
+ * Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
3357
3174
  */
3358
- 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;
3359
- private intersect;
3360
- private filterClippingPlanes;
3361
- }
3362
- import { NavigationMode } from "./types";
3363
- import { OrthoPerspectiveCamera } from "../index";
3364
- /**
3365
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3366
- */
3367
- export declare class PlanMode implements NavigationMode {
3368
- private camera;
3369
- /** {@link NavigationMode.enabled} */
3370
- enabled: boolean;
3371
- /** {@link NavigationMode.id} */
3372
- readonly id = "Plan";
3373
- private mouseAction1?;
3374
- private mouseAction2?;
3375
- private mouseInitialized;
3376
- private readonly defaultAzimuthSpeed;
3377
- private readonly defaultPolarSpeed;
3378
- constructor(camera: OrthoPerspectiveCamera);
3379
- /** {@link NavigationMode.set} */
3380
- set(active: boolean): void;
3175
+ isDisposing: boolean;
3381
3176
  }
3382
3177
  import * as THREE from "three";
3383
3178
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -3408,6 +3203,8 @@ export declare class SimplePlane implements Disposable, Hideable {
3408
3203
  components: Components;
3409
3204
  /** The world instance to which this plane belongs. */
3410
3205
  world: World;
3206
+ /** A custom string to identify what this plane is used for. */
3207
+ type: string;
3411
3208
  protected readonly _helper: THREE.Object3D;
3412
3209
  protected _visible: boolean;
3413
3210
  protected _enabled: boolean;
@@ -3476,6 +3273,149 @@ export declare class SimplePlane implements Disposable, Hideable {
3476
3273
  private newHelper;
3477
3274
  private static newPlaneMesh;
3478
3275
  }
3276
+ import * as WEBIFC from "web-ifc";
3277
+ export declare class IfcMetadataReader {
3278
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3279
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3280
+ }
3281
+ import * as THREE from "three";
3282
+ import * as WEBIFC from "web-ifc";
3283
+ import * as FRAGS from "@thatopen/fragments";
3284
+ export declare class CivilReader {
3285
+ defLineMat: THREE.LineBasicMaterial;
3286
+ read(webIfc: WEBIFC.IfcAPI): {
3287
+ alignments: Map<number, FRAGS.Alignment>;
3288
+ coordinationMatrix: THREE.Matrix4;
3289
+ } | undefined;
3290
+ get(civilItems: any): {
3291
+ alignments: Map<number, FRAGS.Alignment>;
3292
+ coordinationMatrix: THREE.Matrix4;
3293
+ } | undefined;
3294
+ private getCurves;
3295
+ }
3296
+ import { NavigationMode } from "./types";
3297
+ import { OrthoPerspectiveCamera } from "../index";
3298
+ /**
3299
+ * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
3300
+ */
3301
+ export declare class FirstPersonMode implements NavigationMode {
3302
+ private camera;
3303
+ /** {@link NavigationMode.enabled} */
3304
+ enabled: boolean;
3305
+ /** {@link NavigationMode.id} */
3306
+ readonly id = "FirstPerson";
3307
+ constructor(camera: OrthoPerspectiveCamera);
3308
+ /** {@link NavigationMode.set} */
3309
+ set(active: boolean): void;
3310
+ private setupFirstPersonCamera;
3311
+ }
3312
+ import { NavigationMode } from "./types";
3313
+ import { OrthoPerspectiveCamera } from "../index";
3314
+ /**
3315
+ * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
3316
+ */
3317
+ export declare class OrbitMode implements NavigationMode {
3318
+ camera: OrthoPerspectiveCamera;
3319
+ /** {@link NavigationMode.enabled} */
3320
+ enabled: boolean;
3321
+ /** {@link NavigationMode.id} */
3322
+ readonly id = "Orbit";
3323
+ constructor(camera: OrthoPerspectiveCamera);
3324
+ /** {@link NavigationMode.set} */
3325
+ set(active: boolean): void;
3326
+ private activateOrbitControls;
3327
+ }
3328
+ import * as THREE from "three";
3329
+ import { CameraProjection } from "./types";
3330
+ import { Event } from "../../Types";
3331
+ import { OrthoPerspectiveCamera } from "../index";
3332
+ /**
3333
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3334
+ */
3335
+ export declare class ProjectionManager {
3336
+ /**
3337
+ * Event that fires when the {@link CameraProjection} changes.
3338
+ */
3339
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
3340
+ /**
3341
+ * Current projection mode of the camera.
3342
+ * Default is "Perspective".
3343
+ */
3344
+ current: CameraProjection;
3345
+ /**
3346
+ * The camera controlled by this ProjectionManager.
3347
+ * It can be either a PerspectiveCamera or an OrthographicCamera.
3348
+ */
3349
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3350
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
3351
+ matchOrthoDistanceEnabled: boolean;
3352
+ private _component;
3353
+ private _previousDistance;
3354
+ constructor(camera: OrthoPerspectiveCamera);
3355
+ /**
3356
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3357
+ *
3358
+ * @param projection - the new projection to set. If it is the current projection,
3359
+ * it will have no effect.
3360
+ */
3361
+ set(projection: CameraProjection): Promise<void>;
3362
+ /**
3363
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
3364
+ * and vice versa.
3365
+ */
3366
+ toggle(): Promise<void>;
3367
+ private setOrthoCamera;
3368
+ private getPerspectiveDims;
3369
+ private setupOrthoCamera;
3370
+ private getDistance;
3371
+ private setPerspectiveCamera;
3372
+ }
3373
+ import { NavigationMode } from "./types";
3374
+ import { OrthoPerspectiveCamera } from "../index";
3375
+ /**
3376
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3377
+ */
3378
+ export declare class PlanMode implements NavigationMode {
3379
+ private camera;
3380
+ /** {@link NavigationMode.enabled} */
3381
+ enabled: boolean;
3382
+ /** {@link NavigationMode.id} */
3383
+ readonly id = "Plan";
3384
+ private mouseAction1?;
3385
+ private mouseAction2?;
3386
+ private mouseInitialized;
3387
+ private readonly defaultAzimuthSpeed;
3388
+ private readonly defaultPolarSpeed;
3389
+ constructor(camera: OrthoPerspectiveCamera);
3390
+ /** {@link NavigationMode.set} */
3391
+ set(active: boolean): void;
3392
+ }
3393
+ /**
3394
+ * The projection system of the camera.
3395
+ */
3396
+ export type CameraProjection = "Perspective" | "Orthographic";
3397
+ /**
3398
+ * The extensible list of supported navigation modes.
3399
+ */
3400
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3401
+ /**
3402
+ * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3403
+ */
3404
+ export interface NavigationMode {
3405
+ /** The unique ID of this navigation mode. */
3406
+ id: NavModeID;
3407
+ /**
3408
+ * Enable or disable this navigation mode.
3409
+ * When a new navigation mode is enabled, the previous navigation mode
3410
+ * must be disabled.
3411
+ *
3412
+ * @param active - whether to enable or disable this mode.
3413
+ * @param options - any additional data required to enable or disable it.
3414
+ * */
3415
+ set: (active: boolean, options?: any) => void;
3416
+ /** Whether this navigation mode is active or not. */
3417
+ enabled: boolean;
3418
+ }
3479
3419
  export type RelationsMap = Map<number, Map<number, number[]>>;
3480
3420
  export interface ModelsRelationMap {
3481
3421
  [modelID: string]: RelationsMap;
@@ -3500,10 +3440,76 @@ export type InverseAttributes = [
3500
3440
  "ContainsElements"
3501
3441
  ];
3502
3442
  export type InverseAttribute = InverseAttributes[number];
3443
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3444
+ /**
3445
+ * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
3446
+ */
3447
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
3448
+ /**
3449
+ * Minimum number of geometries to be streamed.
3450
+ * Defaults to 10 geometries.
3451
+ */
3452
+ minGeometrySize: number;
3453
+ /**
3454
+ * Minimum amount of assets to be streamed.
3455
+ * Defaults to 1000 assets.
3456
+ */
3457
+ minAssetsSize: number;
3458
+ }
3503
3459
  import { BufferGeometry } from "three";
3504
3460
  import * as THREE from "three";
3505
3461
  export declare class TransformHelper {
3506
3462
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
3507
3463
  }
3464
+ import * as WEBIFC from "web-ifc";
3465
+ import * as THREE from "three";
3466
+ export declare class Units {
3467
+ factor: number;
3468
+ complement: number;
3469
+ apply(matrix: THREE.Matrix4): void;
3470
+ setUp(webIfc: WEBIFC.IfcAPI): void;
3471
+ private getLengthUnits;
3472
+ private getScaleMatrix;
3473
+ }
3474
+ /**
3475
+ * A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
3476
+ */
3477
+ export interface StreamedGeometries {
3478
+ [id: number]: {
3479
+ /** The bounding box of the geometry as a Float32Array. */
3480
+ boundingBox: Float32Array;
3481
+ /** A boolean indicating whether the geometry has holes. */
3482
+ hasHoles: boolean;
3483
+ /** An optional file path for the geometry data. */
3484
+ geometryFile?: string;
3485
+ };
3486
+ }
3487
+ /**
3488
+ * A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
3489
+ */
3490
+ export interface StreamedAsset {
3491
+ /** The unique identifier of the asset. */
3492
+ id: number;
3493
+ /** An array of geometries associated with the asset. */
3494
+ geometries: {
3495
+ /** The unique identifier of the geometry. */
3496
+ geometryID: number;
3497
+ /** The transformation matrix of the geometry as a number array. */
3498
+ transformation: number[];
3499
+ /** The color of the geometry as a number array. */
3500
+ color: number[];
3501
+ }[];
3502
+ }
3503
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3504
+ /**
3505
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3506
+ */
3507
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3508
+ /**
3509
+ * Amount of properties to be streamed.
3510
+ * Defaults to 100 properties.
3511
+ */
3512
+ propertiesSize: number;
3513
+ }
3508
3514
 
3509
3515
  }