@thatopen/components 2.0.16 → 2.0.18

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,855 +1,698 @@
1
1
  declare namespace OBC {
2
- import * as THREE from "three";
3
- import * as FRAGS from "@thatopen/fragments";
4
- import { FragmentsGroup } from "@thatopen/fragments";
5
- import { Component, Components, Disposable, Event } from "../../core";
2
+ import { Component, Disposable, Event } from "../Types";
6
3
  /**
7
- * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
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.
8
5
  */
9
- export declare class BoundingBoxer extends Component implements Disposable {
10
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
11
- /** {@link Component.enabled} */
12
- enabled: boolean;
6
+ export declare class Components implements Disposable {
7
+ /**
8
+ * The version of the @thatopen/components library.
9
+ */
10
+ static readonly release = "2.0.18";
13
11
  /** {@link Disposable.onDisposed} */
14
- readonly onDisposed: Event<unknown>;
15
- private _absoluteMin;
16
- private _absoluteMax;
17
- private _meshes;
18
- constructor(components: Components);
12
+ readonly onDisposed: Event<void>;
19
13
  /**
20
- * A static method to calculate the dimensions of a given bounding box.
21
- *
22
- * @param bbox - The bounding box to calculate the dimensions for.
23
- * @returns An object containing the width, height, depth, and center of the bounding box.
14
+ * The list of components created in this app.
15
+ * The keys are UUIDs and the values are instances of the components.
24
16
  */
25
- static getDimensions(bbox: THREE.Box3): {
26
- width: number;
27
- height: number;
28
- depth: number;
29
- center: THREE.Vector3;
30
- };
17
+ readonly list: Map<string, Component>;
31
18
  /**
32
- * A static method to create a new bounding box boundary.
33
- *
34
- * @param positive - A boolean indicating whether to create a boundary for positive or negative values.
35
- * @returns A new THREE.Vector3 representing the boundary.
19
+ * If disabled, the animation loop will be stopped.
20
+ * Default value is false.
21
+ */
22
+ enabled: boolean;
23
+ private _clock;
24
+ /**
25
+ * Adds a component to the list of components.
26
+ * Throws an error if a component with the same UUID already exists.
36
27
  *
37
- * @remarks
38
- * This method is used to create a new boundary for calculating bounding boxes.
39
- * It sets the x, y, and z components of the returned vector to positive or negative infinity,
40
- * depending on the value of the 'positive' parameter.
28
+ * @param uuid - The unique identifier of the component.
29
+ * @param instance - The instance of the component to be added.
41
30
  *
42
- * @example
43
- * '''typescript
44
- * const positiveBound = BoundingBoxer.newBound(true);
45
- * console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
31
+ * @throws Will throw an error if a component with the same UUID already exists.
46
32
  *
47
- * const negativeBound = BoundingBoxer.newBound(false);
48
- * console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
49
- * '''
33
+ * @internal
50
34
  */
51
- static newBound(positive: boolean): THREE.Vector3;
35
+ add(uuid: string, instance: Component): void;
52
36
  /**
53
- * A static method to calculate the bounding box of a set of points.
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.
54
39
  *
55
- * @param points - An array of THREE.Vector3 representing the points.
56
- * @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
57
- * @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
58
- * @returns A THREE.Box3 representing the bounding box of the given points.
40
+ * @template U - The type of the component to retrieve.
41
+ * @param Component - The constructor function of the component to retrieve.
59
42
  *
60
- * @remarks
61
- * This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
62
- * If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
43
+ * @returns The instance of the requested component.
63
44
  *
64
- * @example
65
- * '''typescript
66
- * const points = [
67
- * new THREE.Vector3(1, 2, 3),
68
- * new THREE.Vector3(4, 5, 6),
69
- * new THREE.Vector3(7, 8, 9),
70
- * ];
45
+ * @throws Will throw an error if a component with the same UUID already exists.
71
46
  *
72
- * const bbox = BoundingBoxer.getBounds(points);
73
- * console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
74
- * '''
47
+ * @internal
75
48
  */
76
- static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
77
- /** {@link Disposable.dispose} */
78
- dispose(): void;
49
+ get<U extends Component>(Component: new (components: Components) => U): U;
50
+ constructor();
79
51
  /**
80
- * Returns the bounding box of the calculated fragments.
81
- *
82
- * @returns A new THREE.Box3 instance representing the bounding box.
83
- *
84
- * @remarks
85
- * This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
86
- * The returned box represents the bounding box of the calculated fragments.
52
+ * Initializes the Components instance.
53
+ * This method starts the animation loop, sets the enabled flag to true,
54
+ * and calls the update method.
87
55
  *
88
- * @example
89
- * '''typescript
90
- * const boundingBox = boundingBoxer.get();
91
- * console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
92
- * '''
56
+ * @returns {void}
93
57
  */
94
- get(): THREE.Box3;
58
+ init(): void;
95
59
  /**
96
- * Calculates and returns a sphere that encompasses the entire bounding box.
60
+ * Disposes the memory of all the components and tools of this instance of
61
+ * the library. A memory leak will be created if:
97
62
  *
98
- * @returns A new THREE.Sphere instance representing the calculated sphere.
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).
99
66
  *
100
- * @remarks
101
- * This method calculates the center and radius of a sphere that encompasses the entire bounding box.
102
- * The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
103
- * The radius is calculated as the distance from the center to the minimum bound.
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).
104
72
  *
105
- * @example
106
- * '''typescript
107
- * const boundingBoxer = components.get(BoundingBoxer);
108
- * boundingBoxer.add(fragmentsGroup);
109
- * const boundingSphere = boundingBoxer.getSphere();
110
- * console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
111
- * '''
112
73
  */
113
- getSphere(): THREE.Sphere;
74
+ dispose(): void;
75
+ private update;
76
+ private static setupBVH;
77
+ }
78
+ import * as THREE from "three";
79
+ import { Components } from "../Components";
80
+ import { Component } from "../Types";
81
+ /**
82
+ * A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
83
+ */
84
+ export declare class Disposer extends Component {
85
+ private _disposedComponents;
86
+ /** {@link Component.enabled} */
87
+ enabled: boolean;
114
88
  /**
115
- * Returns a THREE.Mesh instance representing the bounding box.
116
- *
117
- * @returns A new THREE.Mesh instance representing the bounding box.
118
- *
119
- * @remarks
120
- * This method calculates the dimensions of the bounding box using the 'getDimensions' method.
121
- * It then creates a new THREE.BoxGeometry with the calculated dimensions.
122
- * A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
123
- * The position of the mesh is set to the center of the bounding box.
124
- *
125
- * @example
126
- * '''typescript
127
- * const boundingBoxer = components.get(BoundingBoxer);
128
- * boundingBoxer.add(fragmentsGroup);
129
- * const boundingBoxMesh = boundingBoxer.getMesh();
130
- * scene.add(boundingBoxMesh);
131
- * '''
89
+ * A unique identifier for the component.
90
+ * This UUID is used to register the component within the Components system.
132
91
  */
133
- getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
92
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
93
+ constructor(components: Components);
134
94
  /**
135
- * Resets the internal minimum and maximum vectors to positive and negative infinity, respectively.
136
- * This method is used to prepare the BoundingBoxer for a new set of fragments.
137
- *
138
- * @remarks
139
- * This method is called when a new set of fragments is added to the BoundingBoxer.
140
- * It ensures that the bounding box calculations are accurate and up-to-date.
141
- *
142
- * @example
143
- * '''typescript
144
- * const boundingBoxer = components.get(BoundingBoxer);
145
- * boundingBoxer.add(fragmentsGroup);
146
- * // ...
147
- * boundingBoxer.reset();
148
- * '''
95
+ * Return the UUIDs of all disposed components.
149
96
  */
150
- reset(): void;
97
+ get(): Set<string>;
151
98
  /**
152
- * Adds a FragmentsGroup to the BoundingBoxer.
99
+ * Removes a mesh, its geometry and its materials from memory. If you are
100
+ * using any of these in other parts of the application, make sure that you
101
+ * remove them from the mesh before disposing it.
153
102
  *
154
- * @param group - The FragmentsGroup to add.
103
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
104
+ * to remove.
155
105
  *
156
- * @remarks
157
- * This method iterates through each fragment in the provided FragmentsGroup,
158
- * and calls the 'addMesh' method for each fragment's mesh.
106
+ * @param materials - whether to dispose the materials of the mesh.
159
107
  *
160
- * @example
161
- * '''typescript
162
- * const boundingBoxer = components.get(BoundingBoxer);
163
- * boundingBoxer.add(fragmentsGroup);
164
- * '''
108
+ * @param recursive - whether to recursively dispose the children of the mesh.
165
109
  */
166
- add(group: FragmentsGroup): void;
110
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
167
111
  /**
168
- * Adds a mesh to the BoundingBoxer and calculates the bounding box.
169
- *
170
- * @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
171
- * @param itemIDs - An optional iterable of numbers representing the item IDs.
172
- *
173
- * @remarks
174
- * This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
175
- * If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
176
- * If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
112
+ * Disposes a geometry from memory.
177
113
  *
178
- * @example
179
- * '''typescript
180
- * const boundingBoxer = components.get(BoundingBoxer);
181
- * boundingBoxer.addMesh(mesh);
182
- * '''
114
+ * @param geometry - the
115
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
116
+ * to remove.
183
117
  */
184
- addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
185
- private static getFragmentBounds;
118
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
119
+ private disposeGeometryAndMaterials;
120
+ private disposeChildren;
121
+ private static disposeMaterial;
186
122
  }
187
- import * as FRAGS from "@thatopen/fragments";
188
- import { Components, Component } from "../../core";
123
+ import { Component, Disposable, World, Event } from "../Types";
124
+ import { SimpleRaycaster } from "./src";
125
+ import { Components } from "../Components";
189
126
  /**
190
- * 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).
127
+ * A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
191
128
  */
192
- export declare class Hider extends Component {
129
+ export declare class Raycasters extends Component implements Disposable {
193
130
  /**
194
131
  * A unique identifier for the component.
195
132
  * This UUID is used to register the component within the Components system.
196
133
  */
197
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
134
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
198
135
  /** {@link Component.enabled} */
199
136
  enabled: boolean;
137
+ /**
138
+ * A Map that stores raycasters for each world.
139
+ * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
140
+ */
141
+ list: Map<string, SimpleRaycaster>;
142
+ /** {@link Disposable.onDisposed} */
143
+ onDisposed: Event<unknown>;
200
144
  constructor(components: Components);
201
145
  /**
202
- * Sets the visibility of fragments within the 3D scene.
203
- * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
204
- * If 'items' is provided, only the specified fragments will be affected.
146
+ * Retrieves a SimpleRaycaster instance for the given world.
147
+ * If a SimpleRaycaster instance already exists for the world, it will be returned.
148
+ * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
205
149
  *
206
- * @param visible - The visibility state to set for the fragments.
207
- * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
208
- * If not provided, all fragments will be affected.
209
- *
210
- * @returns {void}
150
+ * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
151
+ * @returns The SimpleRaycaster instance for the given world.
211
152
  */
212
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
153
+ get(world: World): SimpleRaycaster;
213
154
  /**
214
- * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
215
- * It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
216
- *
217
- * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
218
- * If not provided, all fragments will be isolated.
155
+ * Deletes the SimpleRaycaster instance associated with the given world.
156
+ * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
219
157
  *
158
+ * @param world - The world for which to delete the SimpleRaycaster instance.
220
159
  * @returns {void}
221
160
  */
222
- isolate(items: FRAGS.FragmentIdMap): void;
223
- private updateCulledVisibility;
224
- }
225
- import * as THREE from "three";
226
- import * as FRAGS from "@thatopen/fragments";
227
- import { Disposable, Component, Event, Components } from "../../core";
228
- /**
229
- * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
230
- */
231
- export interface Classification {
232
- /**
233
- * A system within the classification.
234
- * The key is the system name, and the value is an object representing the classes within the system.
235
- */
236
- [system: string]: {
237
- /**
238
- * A class within the system.
239
- * The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
240
- */
241
- [className: string]: FRAGS.FragmentIdMap;
242
- };
161
+ delete(world: World): void;
162
+ /** {@link Disposable.dispose} */
163
+ dispose(): void;
243
164
  }
165
+ import { Component, Disposable, World, Event } from "../Types";
166
+ import { GridConfig, SimpleGrid } from "./src";
167
+ import { Components } from "../Components";
244
168
  /**
245
- * 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).
169
+ * A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
246
170
  */
247
- export declare class Classifier extends Component implements Disposable {
171
+ export declare class Grids extends Component implements Disposable {
248
172
  /**
249
173
  * A unique identifier for the component.
250
174
  * This UUID is used to register the component within the Components system.
251
175
  */
252
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
253
- /** {@link Component.enabled} */
254
- enabled: boolean;
176
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
255
177
  /**
256
- * A map representing the classification systems.
257
- * The key is the system name, and the value is an object representing the classes within the system.
178
+ * A map of world UUIDs to their corresponding grid instances.
258
179
  */
259
- list: Classification;
180
+ list: Map<string, SimpleGrid>;
181
+ /**
182
+ * The default configuration for grid creation.
183
+ */
184
+ config: Required<GridConfig>;
260
185
  /** {@link Disposable.onDisposed} */
261
186
  readonly onDisposed: Event<unknown>;
187
+ /** {@link Component.enabled} */
188
+ enabled: boolean;
262
189
  constructor(components: Components);
263
- private onFragmentsDisposed;
264
- /** {@link Disposable.dispose} */
265
- dispose(): void;
266
- /**
267
- * Removes a fragment from the classification based on its unique identifier (guid).
268
- * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
269
- *
270
- * @param guid - The unique identifier of the fragment to be removed.
271
- */
272
- remove(guid: string): void;
273
190
  /**
274
- * Finds and returns fragments based on the provided filter criteria.
275
- * If no filter is provided, it returns all fragments.
276
- *
277
- * @param filter - An optional object containing filter criteria.
278
- * The keys of the object represent the classification system names,
279
- * and the values are arrays of class names to match.
191
+ * Creates a new grid for the given world.
192
+ * Throws an error if a grid already exists for the world.
280
193
  *
281
- * @returns A map of fragment GUIDs to their respective express IDs,
282
- * where the express IDs are filtered based on the provided filter criteria.
194
+ * @param world - The world to create the grid for.
195
+ * @returns The newly created grid.
283
196
  *
284
- * @throws Will throw an error if the fragments map is malformed.
197
+ * @throws Will throw an error if a grid already exists for the given world.
285
198
  */
286
- find(filter?: {
287
- [name: string]: string[];
288
- }): FRAGS.FragmentIdMap;
199
+ create(world: World): SimpleGrid;
289
200
  /**
290
- * Classifies fragments based on their modelID.
201
+ * Deletes the grid associated with the given world.
202
+ * If a grid does not exist for the given world, this method does nothing.
291
203
  *
292
- * @param modelID - The unique identifier of the model to classify fragments by.
293
- * @param group - The FragmentsGroup containing the fragments to be classified.
204
+ * @param world - The world for which to delete the grid.
294
205
  *
295
206
  * @remarks
296
- * This method iterates through the fragments in the provided group,
297
- * and classifies them based on their modelID.
298
- * The classification is stored in the 'list.models' property,
299
- * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
300
- *
207
+ * This method will dispose of the grid and remove it from the internal list.
208
+ * If the world is disposed before calling this method, the grid will be automatically deleted.
301
209
  */
302
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
210
+ delete(world: World): void;
211
+ /** {@link Disposable.dispose} */
212
+ dispose(): void;
213
+ }
214
+ import * as THREE from "three";
215
+ import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
216
+ import { SimplePlane } from "./src";
217
+ import { Components } from "../Components";
218
+ /**
219
+ * 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).
220
+ *
221
+ * @param components - the instance of {@link Components} used.
222
+ * E.g. {@link SimplePlane}.
223
+ */
224
+ export declare class Clipper extends Component implements Createable, Disposable, Hideable {
303
225
  /**
304
- * Classifies fragments based on their PredefinedType property.
305
- *
306
- * @param group - The FragmentsGroup containing the fragments to be classified.
307
- *
308
- * @remarks
309
- * This method iterates through the properties of the fragments in the provided group,
310
- * and classifies them based on their PredefinedType property.
311
- * The classification is stored in the 'list.predefinedTypes' property,
312
- * with the PredefinedType 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.
226
+ * A unique identifier for the component.
227
+ * This UUID is used to register the component within the Components system.
315
228
  */
316
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
229
+ static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
230
+ /** Event that fires when the user starts dragging a clipping plane. */
231
+ readonly onBeforeDrag: Event<void>;
232
+ /** Event that fires when the user stops dragging a clipping plane. */
233
+ readonly onAfterDrag: Event<void>;
317
234
  /**
318
- * Classifies fragments based on their entity type.
319
- *
320
- * @param group - The FragmentsGroup containing the fragments to be classified.
321
- *
322
- * @remarks
323
- * This method iterates through the relations of the fragments in the provided group,
324
- * and classifies them based on their entity type.
325
- * The classification is stored in the 'list.entities' property,
326
- * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
327
- *
328
- * @throws Will throw an error if the fragment ID is not found.
235
+ * Event that fires when the user starts creating a clipping plane.
329
236
  */
330
- byEntity(group: FRAGS.FragmentsGroup): void;
237
+ readonly onBeforeCreate: Event<unknown>;
331
238
  /**
332
- * Classifies fragments based on a specific IFC relationship.
333
- *
334
- * @param group - The FragmentsGroup containing the fragments to be classified.
335
- * @param ifcRel - The IFC relationship number to classify fragments by.
336
- * @param systemName - The name of the classification system to store the classification.
337
- *
338
- * @remarks
339
- * This method iterates through the relations of the fragments in the provided group,
340
- * and classifies them based on the specified IFC relationship.
341
- * The classification is stored in the 'list' property under the specified system name,
342
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
343
- *
344
- * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
239
+ * Event that fires when the user cancels the creation of a clipping plane.
345
240
  */
346
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
241
+ readonly onBeforeCancel: Event<unknown>;
347
242
  /**
348
- * Classifies fragments based on their spatial structure in the IFC model.
349
- *
350
- * @param model - The FragmentsGroup containing the fragments to be classified.
351
- *
352
- * @remarks
353
- * This method iterates through the relations of the fragments in the provided group,
354
- * and classifies them based on their spatial structure in the IFC model.
355
- * The classification is stored in the 'list' property under the system name "spatialStructures",
356
- * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
357
- *
358
- * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
243
+ * Event that fires after the user cancels the creation of a clipping plane.
359
244
  */
360
- bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
245
+ readonly onAfterCancel: Event<unknown>;
361
246
  /**
362
- * Sets the color of the specified fragments.
363
- *
364
- * @param items - A map of fragment IDs to their respective express IDs.
365
- * @param color - The color to set for the fragments.
366
- * @param override - A boolean indicating whether to override the existing color of the fragments.
367
- *
368
- * @remarks
369
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
370
- * and sets their color using the 'setColor' method of the FragmentsGroup class.
371
- *
372
- * @throws Will throw an error if the fragment with the specified ID is not found.
247
+ * Event that fires when the user starts deleting a clipping plane.
373
248
  */
374
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
249
+ readonly onBeforeDelete: Event<unknown>;
375
250
  /**
376
- * Resets the color of the specified fragments to their original color.
377
- *
378
- * @param items - A map of fragment IDs to their respective express IDs.
379
- *
380
- * @remarks
381
- * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
382
- * and resets their color using the 'resetColor' method of the FragmentsGroup class.
383
- *
384
- * @throws Will throw an error if the fragment with the specified ID is not found.
251
+ * Event that fires after a clipping plane has been created.
252
+ * @param plane - The newly created clipping plane.
385
253
  */
386
- resetColor(items: FRAGS.FragmentIdMap): void;
387
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
388
- }
389
- import { Component, Disposable, Event, Components } from "../../core";
390
- /**
391
- * 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).
392
- */
393
- export declare class Exploder extends Component implements Disposable {
254
+ readonly onAfterCreate: Event<SimplePlane>;
394
255
  /**
395
- * A unique identifier for the component.
396
- * This UUID is used to register the component within the Components system.
256
+ * Event that fires after a clipping plane has been deleted.
257
+ * @param plane - The deleted clipping plane.
397
258
  */
398
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
259
+ readonly onAfterDelete: Event<SimplePlane>;
399
260
  /** {@link Disposable.onDisposed} */
400
- readonly onDisposed: Event<unknown>;
401
- /** {@link Component.enabled} */
402
- enabled: boolean;
261
+ readonly onDisposed: Event<string>;
403
262
  /**
404
- * The height of the explosion animation.
405
- * This property determines the vertical distance by which fragments are moved during the explosion.
406
- * Default value is 10.
263
+ * Whether to force the clipping plane to be orthogonal in the Y direction
264
+ * (up). This is desirable when clipping a building horizontally and a
265
+ * clipping plane is created in its roof, which might have a slight
266
+ * slope for draining purposes.
407
267
  */
408
- height: number;
268
+ orthogonalY: boolean;
409
269
  /**
410
- * The group name used for the explosion animation.
411
- * This property specifies the group of fragments that will be affected by the explosion.
412
- * Default value is "storeys".
270
+ * The tolerance that determines whether an almost-horizontal clipping plane
271
+ * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
272
+ * has to be 'true' for this to apply.
413
273
  */
414
- groupName: string;
274
+ toleranceOrthogonalY: number;
415
275
  /**
416
- * A set of strings representing the exploded items.
417
- * This set is used to keep track of which items have been exploded.
276
+ * The type of clipping plane to be created.
277
+ * Default is {@link SimplePlane}.
418
278
  */
419
- list: Set<string>;
420
- constructor(components: Components);
421
- /** {@link Disposable.dispose} */
422
- dispose(): void;
279
+ Type: new (...args: any) => SimplePlane;
423
280
  /**
424
- * Sets the explosion state of the fragments.
425
- *
426
- * @param active - A boolean indicating whether to activate or deactivate the explosion.
427
- *
428
- * @remarks
429
- * This method applies a vertical transformation to the fragments based on the 'active' parameter.
430
- * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
431
- * If 'active' is false, the fragments are moved back to their original position.
281
+ * A list of all the clipping planes created by this component.
282
+ */
283
+ list: SimplePlane[];
284
+ /** The material used in all the clipping planes. */
285
+ private _material;
286
+ private _size;
287
+ private _enabled;
288
+ private _visible;
289
+ /** {@link Component.enabled} */
290
+ get enabled(): boolean;
291
+ /** {@link Component.enabled} */
292
+ set enabled(state: boolean);
293
+ /** {@link Hideable.visible } */
294
+ get visible(): boolean;
295
+ /** {@link Hideable.visible } */
296
+ set visible(state: boolean);
297
+ /** The material of the clipping plane representation. */
298
+ get material(): THREE.MeshBasicMaterial;
299
+ /** The material of the clipping plane representation. */
300
+ set material(material: THREE.MeshBasicMaterial);
301
+ /** The size of the geometric representation of the clippings planes. */
302
+ get size(): number;
303
+ /** The size of the geometric representation of the clippings planes. */
304
+ set size(size: number);
305
+ constructor(components: Components);
306
+ /** {@link Disposable.dispose} */
307
+ dispose(): void;
308
+ /** {@link Createable.create} */
309
+ create(world: World): void;
310
+ /**
311
+ * Creates a plane in a certain place and with a certain orientation,
312
+ * without the need of the mouse.
432
313
  *
433
- * The method also keeps track of the exploded items using the 'list' set.
314
+ * @param world - the world where this plane should be created.
315
+ * @param normal - the orientation of the clipping plane.
316
+ * @param point - the position of the clipping plane.
317
+ * navigation.
318
+ */
319
+ createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
320
+ /**
321
+ * {@link Createable.delete}
434
322
  *
435
- * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
323
+ * @param world - the world where the plane to delete is.
324
+ * @param plane - the plane to delete. If undefined, the first plane
325
+ * found under the cursor will be deleted.
436
326
  */
437
- set(active: boolean): void;
327
+ delete(world: World, plane?: SimplePlane): void;
328
+ /** Deletes all the existing clipping planes. */
329
+ deleteAll(): void;
330
+ private deletePlane;
331
+ private pickPlane;
332
+ private getAllPlaneMeshes;
333
+ private createPlaneFromIntersection;
334
+ private getWorldNormal;
335
+ private normalizePlaneDirectionY;
336
+ private newPlane;
337
+ private updateMaterialsAndPlanes;
338
+ private _onStartDragging;
339
+ private _onEndDragging;
438
340
  }
439
- import * as WEBIFC from "web-ifc";
440
- import * as FRAGS from "@thatopen/fragments";
441
- import { IfcFragmentSettings } from "./src";
442
- import { Component, Components, Event, Disposable } from "../../core";
341
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
342
+ import { Components } from "../Components";
343
+ import { SimpleWorld } from "./src";
443
344
  /**
444
- * 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).
345
+ * 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).
445
346
  */
446
- export declare class IfcLoader extends Component implements Disposable {
347
+ export declare class Worlds extends Component implements Updateable, Disposable {
447
348
  /**
448
349
  * A unique identifier for the component.
449
350
  * This UUID is used to register the component within the Components system.
450
351
  */
451
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
352
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
353
+ /** {@link Updateable.onAfterUpdate} */
354
+ readonly onAfterUpdate: Event<unknown>;
355
+ /** {@link Updateable.onBeforeUpdate} */
356
+ readonly onBeforeUpdate: Event<unknown>;
452
357
  /** {@link Disposable.onDisposed} */
453
- readonly onDisposed: Event<string>;
454
- /**
455
- * An event triggered when the IFC file starts loading.
456
- */
457
- readonly onIfcStartedLoading: Event<void>;
358
+ readonly onDisposed: Event<unknown>;
458
359
  /**
459
- * An event triggered when the setup process is completed.
360
+ * An event that is triggered when a new world is created.
361
+ * The event passes the newly created world as a parameter.
460
362
  */
461
- readonly onSetup: Event<void>;
363
+ readonly onWorldCreated: Event<World>;
462
364
  /**
463
- * The settings for the IfcLoader.
464
- * It includes options for excluding categories, setting WASM paths, and more.
365
+ * An event that is triggered when a world is deleted.
366
+ * The event passes the UUID of the deleted world as a parameter.
465
367
  */
466
- settings: IfcFragmentSettings;
368
+ readonly onWorldDeleted: Event<string>;
467
369
  /**
468
- * The instance of the Web-IFC library used for handling IFC data.
370
+ * A collection of worlds managed by this component.
371
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
469
372
  */
470
- webIfc: WEBIFC.IfcAPI;
373
+ list: Map<string, World>;
471
374
  /** {@link Component.enabled} */
472
375
  enabled: boolean;
473
- private _material;
474
- private _spatialTree;
475
- private _metaData;
476
- private _fragmentInstances;
477
- private _civil;
478
- private _visitedFragments;
479
- private _materialT;
480
376
  constructor(components: Components);
481
- /** {@link Disposable.dispose} */
482
- dispose(): void;
483
- /**
484
- * Sets up the IfcLoader component with the provided configuration.
485
- *
486
- * @param config - Optional configuration settings for the IfcLoader.
487
- * If not provided, the existing settings will be used.
488
- *
489
- * @returns A Promise that resolves when the setup process is completed.
490
- *
491
- * @remarks
492
- * If the 'autoSetWasm' option is enabled in the configuration,
493
- * the method will automatically set the WASM paths for the Web-IFC library.
494
- *
495
- * @example
496
- * '''typescript
497
- * const ifcLoader = new IfcLoader(components);
498
- * await ifcLoader.setup({ autoSetWasm: true });
499
- * '''
500
- */
501
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
502
377
  /**
503
- * Loads an IFC file and processes it for 3D visualization.
504
- *
505
- * @param data - The Uint8Array containing the IFC file data.
506
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
378
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
507
379
  *
508
- * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
380
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
381
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
382
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
509
383
  *
510
- * @example
511
- * '''typescript
512
- * const ifcLoader = components.get(IfcLoader);
513
- * const group = await ifcLoader.load(ifcData);
514
- * '''
384
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
515
385
  */
516
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
386
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
517
387
  /**
518
- * Reads an IFC file and initializes the Web-IFC library.
519
- *
520
- * @param data - The Uint8Array containing the IFC file data.
388
+ * Deletes a world from the list of worlds.
521
389
  *
522
- * @returns A Promise that resolves when the IFC file is opened and initialized.
390
+ * @param {World} world - The world to be deleted.
523
391
  *
524
- * @remarks
525
- * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
526
- * It also opens the IFC model using the provided data and settings.
392
+ * @throws {Error} - Throws an error if the provided world is not found in the list.
527
393
  *
528
- * @example
529
- * '''typescript
530
- * const ifcLoader = components.get(IfcLoader);
531
- * await ifcLoader.readIfcFile(ifcData);
532
- * '''
394
+ * @returns {void}
533
395
  */
534
- readIfcFile(data: Uint8Array): Promise<number>;
396
+ delete(world: World): void;
535
397
  /**
536
- * Cleans up the IfcLoader component by resetting the Web-IFC library,
537
- * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
538
- *
539
- * @remarks
540
- * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
398
+ * Disposes of the Worlds component and all its managed worlds.
399
+ * This method sets the enabled flag to false, disposes of all worlds, clears the list,
400
+ * and triggers the onDisposed event.
541
401
  *
542
- * @example
543
- * '''typescript
544
- * const ifcLoader = components.get(IfcLoader);
545
- * ifcLoader.cleanUp();
546
- * '''
402
+ * @returns {void}
547
403
  */
548
- cleanUp(): void;
549
- private getAllGeometries;
550
- private getMesh;
551
- private getGeometry;
552
- private autoSetWasm;
404
+ dispose(): void;
405
+ /** {@link Updateable.update} */
406
+ update(delta?: number): void | Promise<void>;
553
407
  }
554
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
555
- import * as THREE from "three";
556
- import * as FRAGS from "@thatopen/fragments";
557
- import { Component, Components, Event, Disposable } from "../../core";
558
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
408
+ import { MiniMap } from "./src";
409
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
410
+ import { Components } from "../Components";
559
411
  /**
560
- * 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).
412
+ * 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).
561
413
  */
562
- export declare class FragmentsManager extends Component implements Disposable {
414
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
563
415
  /**
564
416
  * A unique identifier for the component.
565
417
  * This UUID is used to register the component within the Components system.
566
418
  */
567
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
419
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
420
+ /** {@link Updateable.onAfterUpdate} */
421
+ readonly onAfterUpdate: Event<unknown>;
422
+ /** {@link Updateable.onBeforeUpdate} */
423
+ readonly onBeforeUpdate: Event<unknown>;
568
424
  /** {@link Disposable.onDisposed} */
569
425
  readonly onDisposed: Event<unknown>;
570
- /**
571
- * Event triggered when fragments are loaded.
572
- */
573
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
574
- /**
575
- * Event triggered when fragments are disposed.
576
- */
577
- readonly onFragmentsDisposed: Event<{
578
- groupID: string;
579
- fragmentIDs: string[];
580
- }>;
581
- /**
582
- * Map containing all loaded fragments.
583
- * The key is the fragment's unique identifier, and the value is the fragment itself.
584
- */
585
- readonly list: Map<string, Fragment>;
586
- /**
587
- * Map containing all loaded fragment groups.
588
- * The key is the group's unique identifier, and the value is the group itself.
589
- */
590
- readonly groups: Map<string, FragmentsGroup>;
591
- baseCoordinationModel: string;
592
426
  /** {@link Component.enabled} */
593
427
  enabled: boolean;
594
- private _loader;
595
428
  /**
596
- * Getter for the meshes of all fragments in the FragmentsManager.
597
- * It iterates over the fragments in the list and pushes their meshes into an array.
598
- * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
429
+ * A collection of {@link MiniMap} instances, each associated with a unique world ID.
599
430
  */
600
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
431
+ list: Map<string, MiniMap>;
601
432
  constructor(components: Components);
602
- /** {@link Disposable.dispose} */
603
- dispose(): void;
604
433
  /**
605
- * Dispose of a specific fragment group.
606
- * This method removes the group from the groups map, deletes all fragments within the group from the list,
607
- * disposes of the group, and triggers the onFragmentsDisposed event.
434
+ * Creates a new {@link MiniMap} instance associated with the given world.
435
+ * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
608
436
  *
609
- * @param group - The fragment group to be disposed.
437
+ * @param world - The {@link World} for which to create a {@link MiniMap} instance.
438
+ * @returns The newly created {@link MiniMap} instance.
439
+ * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
610
440
  */
611
- disposeGroup(group: FragmentsGroup): void;
441
+ create(world: World): MiniMap;
612
442
  /**
613
- * Loads a binary file that contain fragment geometry.
614
- * @param data - The binary data to load.
615
- * @param config - Optional configuration for loading.
616
- * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
617
- * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
618
- * @returns The loaded FragmentsGroup.
619
- */
620
- load(data: Uint8Array, config?: Partial<{
621
- coordinate: boolean;
622
- name: string;
623
- properties: FRAGS.IfcProperties;
624
- relationsMap: RelationsMap;
625
- }>): FragmentsGroup;
626
- /**
627
- * Export the specified fragmentsgroup to binary data.
628
- * @param group - the fragments group to be exported.
629
- * @returns the exported data as binary buffer.
630
- */
631
- export(group: FragmentsGroup): Uint8Array;
632
- /**
633
- * Gets a map of model IDs to sets of express IDs for the given fragment ID map.
634
- * @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
635
- * @returns A map of model IDs to sets of express IDs.
636
- */
637
- getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
638
- [modelID: string]: Set<number>;
639
- };
640
- /**
641
- * Converts a map of model IDs to sets of express IDs to a fragment ID map.
642
- * @param modelIdMap - A map of model IDs to their corresponding express IDs.
643
- * @returns A fragment ID map.
644
- * @remarks
645
- * This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
646
- * and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
647
- * The fragment ID maps are then merged into a single map and returned.
648
- * 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.
649
- */
650
- modelIdToFragmentIdMap(modelIdMap: {
651
- [modelID: string]: Set<number>;
652
- }): FRAGS.FragmentIdMap;
653
- /**
654
- * Applies coordinate transformation to the provided models.
655
- * If no models are provided, all groups are used.
656
- * The first model in the list becomes the base model for coordinate transformation.
657
- * All other models are then transformed to match the base model's coordinate system.
658
- *
659
- * @param models - The models to apply coordinate transformation to.
660
- * If not provided, all groups are used.
443
+ * Deletes a {@link MiniMap} instance associated with the given world ID.
444
+ * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
661
445
  *
446
+ * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
662
447
  * @returns {void}
663
448
  */
664
- coordinate(models?: FragmentsGroup[]): void;
449
+ delete(id: string): void;
450
+ /** {@link Disposable.dispose} */
451
+ dispose(): void;
452
+ /** {@link Updateable.update} */
453
+ update(): void;
665
454
  }
666
- import * as WEBIFC from "web-ifc";
667
- import { Components, Disposable, Event, Component } from "../../core";
668
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
455
+ import { Components } from "../Components";
456
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
457
+ import { Component, Event, Disposable, World } from "../Types";
669
458
  /**
670
- * 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).
459
+ * 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).
671
460
  */
672
- export declare class IfcGeometryTiler extends Component implements Disposable {
461
+ export declare class Cullers extends Component implements Disposable {
673
462
  /**
674
463
  * A unique identifier for the component.
675
464
  * This UUID is used to register the component within the Components system.
676
465
  */
677
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
678
- /**
679
- * Event triggered when geometry is streamed.
680
- * Contains the streamed geometry data and its buffer.
681
- */
682
- readonly onGeometryStreamed: Event<{
683
- buffer: Uint8Array;
684
- data: StreamedGeometries;
685
- }>;
686
- /**
687
- * Event triggered when assets are streamed.
688
- * Contains the streamed assets.
689
- */
690
- readonly onAssetStreamed: Event<StreamedAsset[]>;
691
- /**
692
- * Event triggered to indicate the progress of the streaming process.
693
- * Contains the progress percentage.
694
- */
695
- readonly onProgress: Event<number>;
466
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
696
467
  /**
697
- * Event triggered when the IFC file is loaded.
698
- * Contains the loaded IFC file data.
468
+ * An event that is triggered when the Cullers component is disposed.
699
469
  */
700
- readonly onIfcLoaded: Event<Uint8Array>;
701
- /** {@link Disposable.onDisposed} */
702
470
  readonly onDisposed: Event<unknown>;
471
+ private _enabled;
703
472
  /**
704
- * Settings for the IfcGeometryTiler.
473
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
705
474
  */
706
- settings: IfcStreamingSettings;
475
+ list: Map<string, MeshCullerRenderer>;
707
476
  /** {@link Component.enabled} */
708
- enabled: boolean;
709
- /**
710
- * The WebIFC API instance used for IFC file processing.
711
- */
712
- webIfc: WEBIFC.IfcAPI;
713
- private _spatialTree;
714
- private _metaData;
715
- private _visitedGeometries;
716
- private _streamSerializer;
717
- private _geometries;
718
- private _geometryCount;
719
- private _civil;
720
- private _groupSerializer;
721
- private _assets;
722
- private _meshesWithHoles;
477
+ get enabled(): boolean;
478
+ /** {@link Component.enabled} */
479
+ set enabled(value: boolean);
723
480
  constructor(components: Components);
724
- /** {@link Disposable.dispose} */
725
- dispose(): void;
726
481
  /**
727
- * This method streams the IFC file from a given buffer.
728
- *
729
- * @param data - The Uint8Array containing the IFC file data.
730
- * @returns A Promise that resolves when the streaming process is complete.
482
+ * Creates a new MeshCullerRenderer for the given world.
483
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
731
484
  *
732
- * @remarks
733
- * This method cleans up any resources after the streaming process is complete.
485
+ * @param world - The world for which to create the MeshCullerRenderer.
486
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
734
487
  *
735
- * @example
736
- * '''typescript
737
- * const ifcData = await fetch('path/to/ifc/file.ifc');
738
- * const rawBuffer = await response.arrayBuffer();
739
- * const ifcBuffer = new Uint8Array(rawBuffer);
740
- * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
741
- * '''
488
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
742
489
  */
743
- streamFromBuffer(data: Uint8Array): Promise<void>;
490
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
744
491
  /**
745
- * This method streams the IFC file from a given callback.
746
- *
747
- * @param loadCallback - The callback function that will be used to load the IFC file.
748
- * @returns A Promise that resolves when the streaming process is complete.
492
+ * Deletes the MeshCullerRenderer associated with the given world.
493
+ * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
749
494
  *
750
- * @remarks
751
- * This method cleans up any resources after the streaming process is complete.
495
+ * @param world - The world for which to delete the MeshCullerRenderer.
752
496
  *
497
+ * @returns {void}
753
498
  */
754
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
755
- private readIfcFile;
756
- private streamIfcFile;
757
- private streamAllGeometries;
758
- private cleanUp;
759
- private getMesh;
760
- private getGeometry;
761
- private streamAssets;
762
- private streamGeometries;
763
- }
764
- import * as WEBIFC from "web-ifc";
765
- import * as FRAG from "@thatopen/fragments";
766
- import { Component, Components } from "../../core";
767
- /**
768
- * Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
769
- */
770
- export declare class IfcJsonExporter extends Component {
771
- /**
772
- * A unique identifier for the component.
773
- * This UUID is used to register the component within the Components system.
774
- */
775
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
776
- /** {@link Component.enabled} */
777
- enabled: boolean;
778
- constructor(components: Components);
779
- /**
780
- * Exports all the properties of an IFC into an array of JS objects.
781
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
782
- * @param modelID ID of the IFC model whose properties to extract.
783
- * @param indirect whether to get the indirect relationships as well.
784
- * @param recursiveSpatial whether to get the properties of spatial items recursively
785
- * to make the location data available (e.g. absolute position of building).
786
- */
787
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
499
+ delete(world: World): void;
500
+ /** {@link Disposable.dispose} */
501
+ dispose(): void;
788
502
  }
789
- import * as WEBIFC from "web-ifc";
790
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
791
- import { PropertiesStreamingSettings } from "./src";
503
+ import * as THREE from "three";
504
+ import { Components } from "../Components";
505
+ import { SimpleCamera } from "..";
506
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
792
507
  /**
793
- * 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).
508
+ * 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).
794
509
  */
795
- export declare class IfcPropertiesTiler extends Component implements Disposable {
796
- /**
797
- * A unique identifier for the component.
798
- * This UUID is used to register the component within the Components system.
799
- */
800
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
510
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
801
511
  /**
802
- * An event that is triggered when properties are streamed from the IFC file.
803
- * The event provides the type of the IFC entity and the corresponding data.
512
+ * A ProjectionManager instance that manages the projection modes of the camera.
804
513
  */
805
- readonly onPropertiesStreamed: AsyncEvent<{
806
- type: number;
807
- data: {
808
- [id: number]: any;
809
- };
810
- }>;
514
+ readonly projection: ProjectionManager;
811
515
  /**
812
- * An event that is triggered to indicate the progress of the streaming process.
813
- * The event provides a number between 0 and 1 representing the progress percentage.
516
+ * A THREE.OrthographicCamera instance that represents the orthographic camera.
517
+ * This camera is used when the projection mode is set to orthographic.
814
518
  */
815
- readonly onProgress: AsyncEvent<number>;
519
+ readonly threeOrtho: THREE.OrthographicCamera;
816
520
  /**
817
- * An event that is triggered when indices are streamed from the IFC file.
818
- * The event provides a map of indices, where the key is the entity type and the value is another map of indices.
521
+ * A THREE.PerspectiveCamera instance that represents the perspective camera.
522
+ * This camera is used when the projection mode is set to perspective.
819
523
  */
820
- readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
821
- /** {@link Disposable.onDisposed} */
822
- readonly onDisposed: Event<string>;
823
- /** {@link Component.enabled} */
824
- enabled: boolean;
524
+ readonly threePersp: THREE.PerspectiveCamera;
525
+ protected readonly _userInputButtons: any;
526
+ protected readonly _frustumSize = 50;
527
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
528
+ protected _mode: NavigationMode | null;
529
+ private previousSize;
825
530
  /**
826
- * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
531
+ * Getter for the current navigation mode.
532
+ * Throws an error if the mode is not found or the camera is not initialized.
533
+ *
534
+ * @returns {NavigationMode} The current navigation mode.
535
+ *
536
+ * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
827
537
  */
828
- settings: PropertiesStreamingSettings;
538
+ get mode(): NavigationMode;
539
+ constructor(components: Components);
540
+ /** {@link Disposable.dispose} */
541
+ dispose(): void;
829
542
  /**
830
- * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
543
+ * Sets a new {@link NavigationMode} and disables the previous one.
544
+ *
545
+ * @param mode - The {@link NavigationMode} to set.
831
546
  */
832
- webIfc: WEBIFC.IfcAPI;
833
- /** {@link Disposable.dispose} */
834
- dispose(): Promise<void>;
547
+ set(mode: NavModeID): void;
835
548
  /**
836
- * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
549
+ * Make the camera view fit all the specified meshes.
837
550
  *
838
- * @param data - The Uint8Array containing the IFC file data.
839
- * @returns A Promise that resolves when the streaming process is complete.
551
+ * @param meshes the meshes to fit. If it is not defined, it will
552
+ * evaluate {@link Components.meshes}.
553
+ * @param offset the distance to the fit object
840
554
  */
841
- streamFromBuffer(data: Uint8Array): Promise<void>;
555
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
842
556
  /**
843
- * This method converts properties from an IFC file to tiles using a given callback function to read the file.
557
+ * Allows or prevents all user input.
844
558
  *
845
- * @param loadCallback - A callback function that loads the IFC file data.
846
- * @returns A Promise that resolves when the streaming process is complete.
559
+ * @param active - whether to enable or disable user inputs.
847
560
  */
848
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
849
- private readIfcFile;
850
- private streamIfcFile;
851
- private streamAllProperties;
852
- private cleanUp;
561
+ setUserInput(active: boolean): void;
562
+ private disableUserInput;
563
+ private enableUserInput;
564
+ private newOrthoCamera;
565
+ private setOrthoPerspCameraAspect;
566
+ }
567
+ import * as THREE from "three";
568
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
569
+ center: THREE.Vector3;
570
+ halfSizes: THREE.Vector3;
571
+ rotation: THREE.Matrix3;
572
+ transformation: THREE.Matrix4;
573
+ };
574
+ import * as THREE from "three";
575
+ export declare class MaterialsUtils {
576
+ static isTransparent(material: THREE.Material): boolean;
577
+ }
578
+ export declare class UUID {
579
+ private static _pattern;
580
+ private static _lut;
581
+ static create(): string;
582
+ static validate(uuid: string): void;
583
+ }
584
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
585
+ import * as THREE from "three";
586
+ import { Component, Components, Disposable, Event, World } from "../core";
587
+ /**
588
+ * Configuration interface for the VertexPicker component.
589
+ */
590
+ export interface VertexPickerConfig {
591
+ /**
592
+ * If true, only vertices will be picked, not the closest point on the face.
593
+ */
594
+ showOnlyVertex: boolean;
595
+ /**
596
+ * The maximum distance for snapping to a vertex.
597
+ */
598
+ snapDistance: number;
599
+ /**
600
+ * The HTML element to use for previewing the picked vertex.
601
+ */
602
+ previewElement: HTMLElement;
603
+ }
604
+ /**
605
+ * A class that provides functionality for picking vertices in a 3D scene.
606
+ */
607
+ export declare class VertexPicker extends Component implements Disposable {
608
+ /** {@link Disposable.onDisposed} */
609
+ readonly onDisposed: Event<unknown>;
610
+ /**
611
+ * An event that is triggered when a vertex is found.
612
+ * The event passes a THREE.Vector3 representing the position of the found vertex.
613
+ */
614
+ readonly onVertexFound: Event<THREE.Vector3>;
615
+ /**
616
+ * An event that is triggered when a vertex is lost.
617
+ * The event passes a THREE.Vector3 representing the position of the lost vertex.
618
+ */
619
+ readonly onVertexLost: Event<THREE.Vector3>;
620
+ /**
621
+ * A reference to the Components instance associated with this VertexPicker.
622
+ */
623
+ components: Components;
624
+ /**
625
+ * A reference to the working plane used for vertex picking.
626
+ * This plane is used to determine which vertices are considered valid for picking.
627
+ * If this value is null, all vertices are considered valid.
628
+ */
629
+ workingPlane: THREE.Plane | null;
630
+ private _pickedPoint;
631
+ private _config;
632
+ private _enabled;
633
+ /**
634
+ * Sets the enabled state of the VertexPicker.
635
+ * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
636
+ * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
637
+ *
638
+ * @param value - The new enabled state.
639
+ */
640
+ set enabled(value: boolean);
641
+ /**
642
+ * Gets the current enabled state of the VertexPicker.
643
+ *
644
+ * @returns The current enabled state.
645
+ */
646
+ get enabled(): boolean;
647
+ /**
648
+ * Sets the configuration for the VertexPicker component.
649
+ *
650
+ * @param value - A Partial object containing the configuration properties to update.
651
+ * The properties not provided in the value object will retain their current values.
652
+ *
653
+ * @example
654
+ * '''typescript
655
+ * vertexPicker.config = {
656
+ * snapDistance: 0.5,
657
+ * showOnlyVertex: true,
658
+ * };
659
+ * '''
660
+ */
661
+ set config(value: Partial<VertexPickerConfig>);
662
+ /**
663
+ * Gets the current configuration for the VertexPicker component.
664
+ *
665
+ * @returns A copy of the current VertexPickerConfig object.
666
+ *
667
+ * @example
668
+ * '''typescript
669
+ * const currentConfig = vertexPicker.config;
670
+ * console.log(currentConfig.snapDistance); // Output: 0.25
671
+ * '''
672
+ */
673
+ get config(): Partial<VertexPickerConfig>;
674
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
675
+ /** {@link Disposable.dispose} */
676
+ dispose(): void;
677
+ /**
678
+ * Performs the vertex picking operation based on the current state of the VertexPicker.
679
+ *
680
+ * @param world - The World instance to use for raycasting.
681
+ *
682
+ * @returns The current picked point, or null if no point is picked.
683
+ *
684
+ * @remarks
685
+ * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
686
+ * If enabled, it performs raycasting to find the closest intersecting object.
687
+ * It then determines the closest vertex or point on the face, based on the configuration settings.
688
+ * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
689
+ * If the picked point is not on the working plane, it resets the 'pickedPoint'.
690
+ * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
691
+ */
692
+ get(world: World): THREE.Vector3 | null;
693
+ private getClosestVertex;
694
+ private getVertices;
695
+ private getVertex;
853
696
  }
854
697
  import * as WEBIFC from "web-ifc";
855
698
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -993,73 +836,283 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
993
836
  dispose(): void;
994
837
  }
995
838
  import * as WEBIFC from "web-ifc";
996
- import { FragmentsGroup } from "@thatopen/fragments";
997
- import { Component, Disposable, Event, Components } from "../../core";
998
- /**
999
- * Types for boolean properties in IFC schema.
1000
- */
1001
- export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
1002
- /**
1003
- * Types for string properties in IFC schema.
1004
- */
1005
- export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
1006
- /**
1007
- * Types for numeric properties in IFC schema.
1008
- */
1009
- export type NumericPropTypes = "IfcInteger" | "IfcReal";
1010
- /**
1011
- * 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.
1012
- */
1013
- export interface ChangeMap {
1014
- [modelID: string]: Set<number>;
1015
- }
1016
- /**
1017
- * 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.
1018
- */
1019
- export interface AttributeListener {
1020
- [modelID: string]: {
1021
- [expressID: number]: {
1022
- [attributeName: string]: Event<String | Boolean | Number>;
1023
- };
1024
- };
1025
- }
839
+ import * as FRAG from "@thatopen/fragments";
840
+ import { Component, Components } from "../../core";
1026
841
  /**
1027
- * Component to manage and edit properties and Psets in IFC files.
842
+ * Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
1028
843
  */
1029
- export declare class IfcPropertiesManager extends Component implements Disposable {
844
+ export declare class IfcJsonExporter extends Component {
1030
845
  /**
1031
846
  * A unique identifier for the component.
1032
847
  * This UUID is used to register the component within the Components system.
1033
848
  */
1034
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
1035
- /** {@link Disposable.onDisposed} */
1036
- readonly onDisposed: Event<string>;
1037
- /**
1038
- * Event triggered when a file is requested for export.
1039
- */
1040
- readonly onRequestFile: Event<unknown>;
849
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
850
+ /** {@link Component.enabled} */
851
+ enabled: boolean;
852
+ constructor(components: Components);
1041
853
  /**
1042
- * ArrayBuffer containing the IFC data to be exported.
854
+ * Exports all the properties of an IFC into an array of JS objects.
855
+ * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
856
+ * @param modelID ID of the IFC model whose properties to extract.
857
+ * @param indirect whether to get the indirect relationships as well.
858
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
859
+ * to make the location data available (e.g. absolute position of building).
1043
860
  */
1044
- ifcToExport: ArrayBuffer | null;
861
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
862
+ }
863
+ import * as THREE from "three";
864
+ import * as FRAGS from "@thatopen/fragments";
865
+ import { FragmentsGroup } from "@thatopen/fragments";
866
+ import { Component, Components, Disposable, Event } from "../../core";
867
+ /**
868
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
869
+ */
870
+ export declare class BoundingBoxer extends Component implements Disposable {
871
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
872
+ /** {@link Component.enabled} */
873
+ enabled: boolean;
874
+ /** {@link Disposable.onDisposed} */
875
+ readonly onDisposed: Event<unknown>;
876
+ private _absoluteMin;
877
+ private _absoluteMax;
878
+ private _meshes;
879
+ constructor(components: Components);
1045
880
  /**
1046
- * Event triggered when an element is added to a Pset.
881
+ * A static method to calculate the dimensions of a given bounding box.
882
+ *
883
+ * @param bbox - The bounding box to calculate the dimensions for.
884
+ * @returns An object containing the width, height, depth, and center of the bounding box.
1047
885
  */
1048
- readonly onElementToPset: Event<{
1049
- model: FragmentsGroup;
1050
- psetID: number;
1051
- elementID: number;
1052
- }>;
886
+ static getDimensions(bbox: THREE.Box3): {
887
+ width: number;
888
+ height: number;
889
+ depth: number;
890
+ center: THREE.Vector3;
891
+ };
1053
892
  /**
1054
- * Event triggered when a property is added to a Pset.
893
+ * A static method to create a new bounding box boundary.
894
+ *
895
+ * @param positive - A boolean indicating whether to create a boundary for positive or negative values.
896
+ * @returns A new THREE.Vector3 representing the boundary.
897
+ *
898
+ * @remarks
899
+ * This method is used to create a new boundary for calculating bounding boxes.
900
+ * It sets the x, y, and z components of the returned vector to positive or negative infinity,
901
+ * depending on the value of the 'positive' parameter.
902
+ *
903
+ * @example
904
+ * '''typescript
905
+ * const positiveBound = BoundingBoxer.newBound(true);
906
+ * console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
907
+ *
908
+ * const negativeBound = BoundingBoxer.newBound(false);
909
+ * console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
910
+ * '''
1055
911
  */
1056
- readonly onPropToPset: Event<{
1057
- model: FragmentsGroup;
1058
- psetID: number;
1059
- propID: number;
1060
- }>;
912
+ static newBound(positive: boolean): THREE.Vector3;
1061
913
  /**
1062
- * Event triggered when a Pset is removed.
914
+ * A static method to calculate the bounding box of a set of points.
915
+ *
916
+ * @param points - An array of THREE.Vector3 representing the points.
917
+ * @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
918
+ * @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
919
+ * @returns A THREE.Box3 representing the bounding box of the given points.
920
+ *
921
+ * @remarks
922
+ * This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
923
+ * If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
924
+ *
925
+ * @example
926
+ * '''typescript
927
+ * const points = [
928
+ * new THREE.Vector3(1, 2, 3),
929
+ * new THREE.Vector3(4, 5, 6),
930
+ * new THREE.Vector3(7, 8, 9),
931
+ * ];
932
+ *
933
+ * const bbox = BoundingBoxer.getBounds(points);
934
+ * console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
935
+ * '''
936
+ */
937
+ static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
938
+ /** {@link Disposable.dispose} */
939
+ dispose(): void;
940
+ /**
941
+ * Returns the bounding box of the calculated fragments.
942
+ *
943
+ * @returns A new THREE.Box3 instance representing the bounding box.
944
+ *
945
+ * @remarks
946
+ * This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
947
+ * The returned box represents the bounding box of the calculated fragments.
948
+ *
949
+ * @example
950
+ * '''typescript
951
+ * const boundingBox = boundingBoxer.get();
952
+ * console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
953
+ * '''
954
+ */
955
+ get(): THREE.Box3;
956
+ /**
957
+ * Calculates and returns a sphere that encompasses the entire bounding box.
958
+ *
959
+ * @returns A new THREE.Sphere instance representing the calculated sphere.
960
+ *
961
+ * @remarks
962
+ * This method calculates the center and radius of a sphere that encompasses the entire bounding box.
963
+ * The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
964
+ * The radius is calculated as the distance from the center to the minimum bound.
965
+ *
966
+ * @example
967
+ * '''typescript
968
+ * const boundingBoxer = components.get(BoundingBoxer);
969
+ * boundingBoxer.add(fragmentsGroup);
970
+ * const boundingSphere = boundingBoxer.getSphere();
971
+ * console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
972
+ * '''
973
+ */
974
+ getSphere(): THREE.Sphere;
975
+ /**
976
+ * Returns a THREE.Mesh instance representing the bounding box.
977
+ *
978
+ * @returns A new THREE.Mesh instance representing the bounding box.
979
+ *
980
+ * @remarks
981
+ * This method calculates the dimensions of the bounding box using the 'getDimensions' method.
982
+ * It then creates a new THREE.BoxGeometry with the calculated dimensions.
983
+ * A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
984
+ * The position of the mesh is set to the center of the bounding box.
985
+ *
986
+ * @example
987
+ * '''typescript
988
+ * const boundingBoxer = components.get(BoundingBoxer);
989
+ * boundingBoxer.add(fragmentsGroup);
990
+ * const boundingBoxMesh = boundingBoxer.getMesh();
991
+ * scene.add(boundingBoxMesh);
992
+ * '''
993
+ */
994
+ getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
995
+ /**
996
+ * Resets the internal minimum and maximum vectors to positive and negative infinity, respectively.
997
+ * This method is used to prepare the BoundingBoxer for a new set of fragments.
998
+ *
999
+ * @remarks
1000
+ * This method is called when a new set of fragments is added to the BoundingBoxer.
1001
+ * It ensures that the bounding box calculations are accurate and up-to-date.
1002
+ *
1003
+ * @example
1004
+ * '''typescript
1005
+ * const boundingBoxer = components.get(BoundingBoxer);
1006
+ * boundingBoxer.add(fragmentsGroup);
1007
+ * // ...
1008
+ * boundingBoxer.reset();
1009
+ * '''
1010
+ */
1011
+ reset(): void;
1012
+ /**
1013
+ * Adds a FragmentsGroup to the BoundingBoxer.
1014
+ *
1015
+ * @param group - The FragmentsGroup to add.
1016
+ *
1017
+ * @remarks
1018
+ * This method iterates through each fragment in the provided FragmentsGroup,
1019
+ * and calls the 'addMesh' method for each fragment's mesh.
1020
+ *
1021
+ * @example
1022
+ * '''typescript
1023
+ * const boundingBoxer = components.get(BoundingBoxer);
1024
+ * boundingBoxer.add(fragmentsGroup);
1025
+ * '''
1026
+ */
1027
+ add(group: FragmentsGroup): void;
1028
+ /**
1029
+ * Adds a mesh to the BoundingBoxer and calculates the bounding box.
1030
+ *
1031
+ * @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
1032
+ * @param itemIDs - An optional iterable of numbers representing the item IDs.
1033
+ *
1034
+ * @remarks
1035
+ * This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
1036
+ * If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
1037
+ * If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
1038
+ *
1039
+ * @example
1040
+ * '''typescript
1041
+ * const boundingBoxer = components.get(BoundingBoxer);
1042
+ * boundingBoxer.addMesh(mesh);
1043
+ * '''
1044
+ */
1045
+ addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
1046
+ private static getFragmentBounds;
1047
+ }
1048
+ import * as WEBIFC from "web-ifc";
1049
+ import { FragmentsGroup } from "@thatopen/fragments";
1050
+ import { Component, Disposable, Event, Components } from "../../core";
1051
+ /**
1052
+ * Types for boolean properties in IFC schema.
1053
+ */
1054
+ export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
1055
+ /**
1056
+ * Types for string properties in IFC schema.
1057
+ */
1058
+ export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
1059
+ /**
1060
+ * Types for numeric properties in IFC schema.
1061
+ */
1062
+ export type NumericPropTypes = "IfcInteger" | "IfcReal";
1063
+ /**
1064
+ * 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.
1065
+ */
1066
+ export interface ChangeMap {
1067
+ [modelID: string]: Set<number>;
1068
+ }
1069
+ /**
1070
+ * 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.
1071
+ */
1072
+ export interface AttributeListener {
1073
+ [modelID: string]: {
1074
+ [expressID: number]: {
1075
+ [attributeName: string]: Event<String | Boolean | Number>;
1076
+ };
1077
+ };
1078
+ }
1079
+ /**
1080
+ * Component to manage and edit properties and Psets in IFC files.
1081
+ */
1082
+ export declare class IfcPropertiesManager extends Component implements Disposable {
1083
+ /**
1084
+ * A unique identifier for the component.
1085
+ * This UUID is used to register the component within the Components system.
1086
+ */
1087
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
1088
+ /** {@link Disposable.onDisposed} */
1089
+ readonly onDisposed: Event<string>;
1090
+ /**
1091
+ * Event triggered when a file is requested for export.
1092
+ */
1093
+ readonly onRequestFile: Event<unknown>;
1094
+ /**
1095
+ * ArrayBuffer containing the IFC data to be exported.
1096
+ */
1097
+ ifcToExport: ArrayBuffer | null;
1098
+ /**
1099
+ * Event triggered when an element is added to a Pset.
1100
+ */
1101
+ readonly onElementToPset: Event<{
1102
+ model: FragmentsGroup;
1103
+ psetID: number;
1104
+ elementID: number;
1105
+ }>;
1106
+ /**
1107
+ * Event triggered when a property is added to a Pset.
1108
+ */
1109
+ readonly onPropToPset: Event<{
1110
+ model: FragmentsGroup;
1111
+ psetID: number;
1112
+ propID: number;
1113
+ }>;
1114
+ /**
1115
+ * Event triggered when a Pset is removed.
1063
1116
  */
1064
1117
  readonly onPsetRemoved: Event<{
1065
1118
  model: FragmentsGroup;
@@ -1248,578 +1301,484 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
1248
1301
  private registerChange;
1249
1302
  private newSingleProperty;
1250
1303
  }
1251
- import * as THREE from "three";
1252
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
1253
- center: THREE.Vector3;
1254
- halfSizes: THREE.Vector3;
1255
- rotation: THREE.Matrix3;
1256
- transformation: THREE.Matrix4;
1257
- };
1258
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
1259
- import { Components } from "../Components";
1260
- import { SimpleWorld } from "./src";
1304
+ import * as FRAGS from "@thatopen/fragments";
1305
+ import { Components, Component } from "../../core";
1261
1306
  /**
1262
- * 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).
1307
+ * 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).
1263
1308
  */
1264
- export declare class Worlds extends Component implements Updateable, Disposable {
1309
+ export declare class Hider extends Component {
1265
1310
  /**
1266
1311
  * A unique identifier for the component.
1267
1312
  * This UUID is used to register the component within the Components system.
1268
1313
  */
1269
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
1270
- /** {@link Updateable.onAfterUpdate} */
1271
- readonly onAfterUpdate: Event<unknown>;
1272
- /** {@link Updateable.onBeforeUpdate} */
1273
- readonly onBeforeUpdate: Event<unknown>;
1274
- /** {@link Disposable.onDisposed} */
1275
- readonly onDisposed: Event<unknown>;
1276
- /**
1277
- * An event that is triggered when a new world is created.
1278
- * The event passes the newly created world as a parameter.
1279
- */
1280
- readonly onWorldCreated: Event<World>;
1281
- /**
1282
- * An event that is triggered when a world is deleted.
1283
- * The event passes the UUID of the deleted world as a parameter.
1284
- */
1285
- readonly onWorldDeleted: Event<string>;
1286
- /**
1287
- * A collection of worlds managed by this component.
1288
- * The key is the unique identifier (UUID) of the world, and the value is the World instance.
1289
- */
1290
- list: Map<string, World>;
1314
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
1291
1315
  /** {@link Component.enabled} */
1292
1316
  enabled: boolean;
1293
1317
  constructor(components: Components);
1294
1318
  /**
1295
- * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
1319
+ * Sets the visibility of fragments within the 3D scene.
1320
+ * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
1321
+ * If 'items' is provided, only the specified fragments will be affected.
1296
1322
  *
1297
- * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
1298
- * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
1299
- * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
1323
+ * @param visible - The visibility state to set for the fragments.
1324
+ * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
1325
+ * If not provided, all fragments will be affected.
1300
1326
  *
1301
- * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
1327
+ * @returns {void}
1302
1328
  */
1303
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
1329
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
1304
1330
  /**
1305
- * Deletes a world from the list of worlds.
1306
- *
1307
- * @param {World} world - The world to be deleted.
1308
- *
1309
- * @throws {Error} - Throws an error if the provided world is not found in the list.
1331
+ * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
1332
+ * It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
1310
1333
  *
1311
- * @returns {void}
1312
- */
1313
- delete(world: World): void;
1314
- /**
1315
- * Disposes of the Worlds component and all its managed worlds.
1316
- * This method sets the enabled flag to false, disposes of all worlds, clears the list,
1317
- * and triggers the onDisposed event.
1334
+ * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
1335
+ * If not provided, all fragments will be isolated.
1318
1336
  *
1319
1337
  * @returns {void}
1320
1338
  */
1321
- dispose(): void;
1322
- /** {@link Updateable.update} */
1323
- update(delta?: number): void | Promise<void>;
1339
+ isolate(items: FRAGS.FragmentIdMap): void;
1340
+ private updateCulledVisibility;
1324
1341
  }
1325
- import * as THREE from "three";
1326
- import { Components } from "../Components";
1327
- import { Component } from "../Types";
1342
+ import { Component, Disposable, Event, Components } from "../../core";
1328
1343
  /**
1329
- * 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).
1344
+ * 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).
1330
1345
  */
1331
- export declare class Disposer extends Component {
1332
- private _disposedComponents;
1333
- /** {@link Component.enabled} */
1334
- enabled: boolean;
1346
+ export declare class Exploder extends Component implements Disposable {
1335
1347
  /**
1336
1348
  * A unique identifier for the component.
1337
1349
  * This UUID is used to register the component within the Components system.
1338
1350
  */
1339
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
1340
- constructor(components: Components);
1351
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
1352
+ /** {@link Disposable.onDisposed} */
1353
+ readonly onDisposed: Event<unknown>;
1354
+ /** {@link Component.enabled} */
1355
+ enabled: boolean;
1341
1356
  /**
1342
- * Return the UUIDs of all disposed components.
1357
+ * The height of the explosion animation.
1358
+ * This property determines the vertical distance by which fragments are moved during the explosion.
1359
+ * Default value is 10.
1343
1360
  */
1344
- get(): Set<string>;
1361
+ height: number;
1345
1362
  /**
1346
- * Removes a mesh, its geometry and its materials from memory. If you are
1347
- * using any of these in other parts of the application, make sure that you
1348
- * remove them from the mesh before disposing it.
1363
+ * The group name used for the explosion animation.
1364
+ * This property specifies the group of fragments that will be affected by the explosion.
1365
+ * Default value is "storeys".
1366
+ */
1367
+ groupName: string;
1368
+ /**
1369
+ * A set of strings representing the exploded items.
1370
+ * This set is used to keep track of which items have been exploded.
1371
+ */
1372
+ list: Set<string>;
1373
+ constructor(components: Components);
1374
+ /** {@link Disposable.dispose} */
1375
+ dispose(): void;
1376
+ /**
1377
+ * Sets the explosion state of the fragments.
1349
1378
  *
1350
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
1351
- * to remove.
1379
+ * @param active - A boolean indicating whether to activate or deactivate the explosion.
1352
1380
  *
1353
- * @param materials - whether to dispose the materials of the mesh.
1381
+ * @remarks
1382
+ * This method applies a vertical transformation to the fragments based on the 'active' parameter.
1383
+ * If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
1384
+ * If 'active' is false, the fragments are moved back to their original position.
1354
1385
  *
1355
- * @param recursive - whether to recursively dispose the children of the mesh.
1386
+ * The method also keeps track of the exploded items using the 'list' set.
1387
+ *
1388
+ * @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
1356
1389
  */
1357
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
1390
+ set(active: boolean): void;
1391
+ }
1392
+ import * as THREE from "three";
1393
+ import * as FRAGS from "@thatopen/fragments";
1394
+ import { Disposable, Component, Event, Components } from "../../core";
1395
+ /**
1396
+ * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
1397
+ */
1398
+ export interface Classification {
1358
1399
  /**
1359
- * Disposes a geometry from memory.
1360
- *
1361
- * @param geometry - the
1362
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
1363
- * to remove.
1400
+ * A system within the classification.
1401
+ * The key is the system name, and the value is an object representing the classes within the system.
1364
1402
  */
1365
- disposeGeometry(geometry: THREE.BufferGeometry): void;
1366
- private disposeGeometryAndMaterials;
1367
- private disposeChildren;
1368
- private static disposeMaterial;
1403
+ [system: string]: {
1404
+ /**
1405
+ * A class within the system.
1406
+ * The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
1407
+ */
1408
+ [className: string]: FRAGS.FragmentIdMap;
1409
+ };
1369
1410
  }
1370
- import { MiniMap } from "./src";
1371
- import { Component, Updateable, World, Event, Disposable } from "../Types";
1372
- import { Components } from "../Components";
1373
1411
  /**
1374
- * 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).
1412
+ * 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).
1375
1413
  */
1376
- export declare class MiniMaps extends Component implements Updateable, Disposable {
1414
+ export declare class Classifier extends Component implements Disposable {
1377
1415
  /**
1378
1416
  * A unique identifier for the component.
1379
1417
  * This UUID is used to register the component within the Components system.
1380
1418
  */
1381
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
1382
- /** {@link Updateable.onAfterUpdate} */
1383
- readonly onAfterUpdate: Event<unknown>;
1384
- /** {@link Updateable.onBeforeUpdate} */
1385
- readonly onBeforeUpdate: Event<unknown>;
1386
- /** {@link Disposable.onDisposed} */
1387
- readonly onDisposed: Event<unknown>;
1419
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
1388
1420
  /** {@link Component.enabled} */
1389
1421
  enabled: boolean;
1390
1422
  /**
1391
- * A collection of {@link MiniMap} instances, each associated with a unique world ID.
1423
+ * A map representing the classification systems.
1424
+ * The key is the system name, and the value is an object representing the classes within the system.
1392
1425
  */
1393
- list: Map<string, MiniMap>;
1426
+ list: Classification;
1427
+ /** {@link Disposable.onDisposed} */
1428
+ readonly onDisposed: Event<unknown>;
1394
1429
  constructor(components: Components);
1430
+ private onFragmentsDisposed;
1431
+ /** {@link Disposable.dispose} */
1432
+ dispose(): void;
1395
1433
  /**
1396
- * Creates a new {@link MiniMap} instance associated with the given world.
1397
- * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
1434
+ * Removes a fragment from the classification based on its unique identifier (guid).
1435
+ * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
1398
1436
  *
1399
- * @param world - The {@link World} for which to create a {@link MiniMap} instance.
1400
- * @returns The newly created {@link MiniMap} instance.
1401
- * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
1437
+ * @param guid - The unique identifier of the fragment to be removed.
1402
1438
  */
1403
- create(world: World): MiniMap;
1439
+ remove(guid: string): void;
1404
1440
  /**
1405
- * Deletes a {@link MiniMap} instance associated with the given world ID.
1406
- * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
1441
+ * Finds and returns fragments based on the provided filter criteria.
1442
+ * If no filter is provided, it returns all fragments.
1407
1443
  *
1408
- * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
1409
- * @returns {void}
1444
+ * @param filter - An optional object containing filter criteria.
1445
+ * The keys of the object represent the classification system names,
1446
+ * and the values are arrays of class names to match.
1447
+ *
1448
+ * @returns A map of fragment GUIDs to their respective express IDs,
1449
+ * where the express IDs are filtered based on the provided filter criteria.
1450
+ *
1451
+ * @throws Will throw an error if the fragments map is malformed.
1410
1452
  */
1411
- delete(id: string): void;
1412
- /** {@link Disposable.dispose} */
1413
- dispose(): void;
1414
- /** {@link Updateable.update} */
1415
- update(): void;
1416
- }
1417
- import { Component, Disposable, World, Event } from "../Types";
1418
- import { GridConfig, SimpleGrid } from "./src";
1419
- import { Components } from "../Components";
1420
- /**
1421
- * 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).
1422
- */
1423
- export declare class Grids extends Component implements Disposable {
1453
+ find(filter?: {
1454
+ [name: string]: string[];
1455
+ }): FRAGS.FragmentIdMap;
1424
1456
  /**
1425
- * A unique identifier for the component.
1426
- * This UUID is used to register the component within the Components system.
1457
+ * Classifies fragments based on their modelID.
1458
+ *
1459
+ * @param modelID - The unique identifier of the model to classify fragments by.
1460
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1461
+ *
1462
+ * @remarks
1463
+ * This method iterates through the fragments in the provided group,
1464
+ * and classifies them based on their modelID.
1465
+ * The classification is stored in the 'list.models' property,
1466
+ * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
1467
+ *
1427
1468
  */
1428
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
1469
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
1429
1470
  /**
1430
- * A map of world UUIDs to their corresponding grid instances.
1471
+ * Classifies fragments based on their PredefinedType property.
1472
+ *
1473
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1474
+ *
1475
+ * @remarks
1476
+ * This method iterates through the properties of the fragments in the provided group,
1477
+ * and classifies them based on their PredefinedType property.
1478
+ * The classification is stored in the 'list.predefinedTypes' property,
1479
+ * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
1480
+ *
1481
+ * @throws Will throw an error if the fragment ID is not found.
1431
1482
  */
1432
- list: Map<string, SimpleGrid>;
1483
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
1433
1484
  /**
1434
- * The default configuration for grid creation.
1485
+ * Classifies fragments based on their entity type.
1486
+ *
1487
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1488
+ *
1489
+ * @remarks
1490
+ * This method iterates through the relations of the fragments in the provided group,
1491
+ * and classifies them based on their entity type.
1492
+ * The classification is stored in the 'list.entities' property,
1493
+ * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
1494
+ *
1495
+ * @throws Will throw an error if the fragment ID is not found.
1435
1496
  */
1436
- config: Required<GridConfig>;
1437
- /** {@link Disposable.onDisposed} */
1438
- readonly onDisposed: Event<unknown>;
1439
- /** {@link Component.enabled} */
1440
- enabled: boolean;
1441
- constructor(components: Components);
1497
+ byEntity(group: FRAGS.FragmentsGroup): void;
1442
1498
  /**
1443
- * Creates a new grid for the given world.
1444
- * Throws an error if a grid already exists for the world.
1499
+ * Classifies fragments based on a specific IFC relationship.
1445
1500
  *
1446
- * @param world - The world to create the grid for.
1447
- * @returns The newly created grid.
1501
+ * @param group - The FragmentsGroup containing the fragments to be classified.
1502
+ * @param ifcRel - The IFC relationship number to classify fragments by.
1503
+ * @param systemName - The name of the classification system to store the classification.
1448
1504
  *
1449
- * @throws Will throw an error if a grid already exists for the given world.
1505
+ * @remarks
1506
+ * This method iterates through the relations of the fragments in the provided group,
1507
+ * and classifies them based on the specified IFC relationship.
1508
+ * The classification is stored in the 'list' property under the specified system name,
1509
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1510
+ *
1511
+ * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
1450
1512
  */
1451
- create(world: World): SimpleGrid;
1513
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
1452
1514
  /**
1453
- * Deletes the grid associated with the given world.
1454
- * If a grid does not exist for the given world, this method does nothing.
1515
+ * Classifies fragments based on their spatial structure in the IFC model.
1455
1516
  *
1456
- * @param world - The world for which to delete the grid.
1517
+ * @param model - The FragmentsGroup containing the fragments to be classified.
1457
1518
  *
1458
1519
  * @remarks
1459
- * This method will dispose of the grid and remove it from the internal list.
1460
- * If the world is disposed before calling this method, the grid will be automatically deleted.
1520
+ * This method iterates through the relations of the fragments in the provided group,
1521
+ * and classifies them based on their spatial structure in the IFC model.
1522
+ * The classification is stored in the 'list' property under the system name "spatialStructures",
1523
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
1524
+ *
1525
+ * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
1461
1526
  */
1462
- delete(world: World): void;
1463
- /** {@link Disposable.dispose} */
1464
- dispose(): void;
1465
- }
1466
- import { Component, Disposable, World, Event } from "../Types";
1467
- import { SimpleRaycaster } from "./src";
1468
- import { Components } from "../Components";
1469
- /**
1470
- * 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).
1471
- */
1472
- export declare class Raycasters extends Component implements Disposable {
1473
- /**
1474
- * A unique identifier for the component.
1475
- * This UUID is used to register the component within the Components system.
1476
- */
1477
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
1478
- /** {@link Component.enabled} */
1479
- enabled: boolean;
1480
- /**
1481
- * A Map that stores raycasters for each world.
1482
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
1483
- */
1484
- list: Map<string, SimpleRaycaster>;
1485
- /** {@link Disposable.onDisposed} */
1486
- onDisposed: Event<unknown>;
1487
- constructor(components: Components);
1527
+ bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
1488
1528
  /**
1489
- * Retrieves a SimpleRaycaster instance for the given world.
1490
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
1491
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
1529
+ * Sets the color of the specified fragments.
1492
1530
  *
1493
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
1494
- * @returns The SimpleRaycaster instance for the given world.
1531
+ * @param items - A map of fragment IDs to their respective express IDs.
1532
+ * @param color - The color to set for the fragments.
1533
+ * @param override - A boolean indicating whether to override the existing color of the fragments.
1534
+ *
1535
+ * @remarks
1536
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
1537
+ * and sets their color using the 'setColor' method of the FragmentsGroup class.
1538
+ *
1539
+ * @throws Will throw an error if the fragment with the specified ID is not found.
1495
1540
  */
1496
- get(world: World): SimpleRaycaster;
1541
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
1497
1542
  /**
1498
- * Deletes the SimpleRaycaster instance associated with the given world.
1499
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
1543
+ * Resets the color of the specified fragments to their original color.
1500
1544
  *
1501
- * @param world - The world for which to delete the SimpleRaycaster instance.
1502
- * @returns {void}
1545
+ * @param items - A map of fragment IDs to their respective express IDs.
1546
+ *
1547
+ * @remarks
1548
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
1549
+ * and resets their color using the 'resetColor' method of the FragmentsGroup class.
1550
+ *
1551
+ * @throws Will throw an error if the fragment with the specified ID is not found.
1503
1552
  */
1504
- delete(world: World): void;
1505
- /** {@link Disposable.dispose} */
1506
- dispose(): void;
1553
+ resetColor(items: FRAGS.FragmentIdMap): void;
1554
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
1507
1555
  }
1508
- import { Components } from "../Components";
1509
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
1510
- import { Component, Event, Disposable, World } from "../Types";
1556
+ import * as WEBIFC from "web-ifc";
1557
+ import * as FRAGS from "@thatopen/fragments";
1558
+ import { IfcFragmentSettings } from "./src";
1559
+ import { Component, Components, Event, Disposable } from "../../core";
1511
1560
  /**
1512
- * 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).
1561
+ * 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).
1513
1562
  */
1514
- export declare class Cullers extends Component implements Disposable {
1563
+ export declare class IfcLoader extends Component implements Disposable {
1515
1564
  /**
1516
1565
  * A unique identifier for the component.
1517
1566
  * This UUID is used to register the component within the Components system.
1518
1567
  */
1519
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
1568
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1569
+ /** {@link Disposable.onDisposed} */
1570
+ readonly onDisposed: Event<string>;
1520
1571
  /**
1521
- * An event that is triggered when the Cullers component is disposed.
1572
+ * An event triggered when the IFC file starts loading.
1522
1573
  */
1523
- readonly onDisposed: Event<unknown>;
1524
- private _enabled;
1574
+ readonly onIfcStartedLoading: Event<void>;
1525
1575
  /**
1526
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
1576
+ * An event triggered when the setup process is completed.
1527
1577
  */
1528
- list: Map<string, MeshCullerRenderer>;
1529
- /** {@link Component.enabled} */
1530
- get enabled(): boolean;
1531
- /** {@link Component.enabled} */
1532
- set enabled(value: boolean);
1533
- constructor(components: Components);
1578
+ readonly onSetup: Event<void>;
1534
1579
  /**
1535
- * Creates a new MeshCullerRenderer for the given world.
1536
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
1537
- *
1538
- * @param world - The world for which to create the MeshCullerRenderer.
1539
- * @param config - Optional configuration settings for the MeshCullerRenderer.
1540
- *
1541
- * @returns The newly created or existing MeshCullerRenderer for the given world.
1580
+ * The settings for the IfcLoader.
1581
+ * It includes options for excluding categories, setting WASM paths, and more.
1542
1582
  */
1543
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
1583
+ settings: IfcFragmentSettings;
1544
1584
  /**
1545
- * Deletes the MeshCullerRenderer associated with the given world.
1546
- * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
1547
- *
1548
- * @param world - The world for which to delete the MeshCullerRenderer.
1549
- *
1550
- * @returns {void}
1585
+ * The instance of the Web-IFC library used for handling IFC data.
1551
1586
  */
1552
- delete(world: World): void;
1587
+ webIfc: WEBIFC.IfcAPI;
1588
+ /** {@link Component.enabled} */
1589
+ enabled: boolean;
1590
+ private _material;
1591
+ private _spatialTree;
1592
+ private _metaData;
1593
+ private _fragmentInstances;
1594
+ private _civil;
1595
+ private _visitedFragments;
1596
+ private _materialT;
1597
+ constructor(components: Components);
1553
1598
  /** {@link Disposable.dispose} */
1554
1599
  dispose(): void;
1555
- }
1556
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
1557
- import { Component, Disposable, Event } from "../Types";
1558
- /**
1559
- * 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.
1560
- */
1561
- export declare class Components implements Disposable {
1562
- /**
1563
- * The version of the @thatopen/components library.
1564
- */
1565
- static readonly release = "2.0.14";
1566
- /** {@link Disposable.onDisposed} */
1567
- readonly onDisposed: Event<void>;
1568
- /**
1569
- * The list of components created in this app.
1570
- * The keys are UUIDs and the values are instances of the components.
1571
- */
1572
- readonly list: Map<string, Component>;
1573
- /**
1574
- * If disabled, the animation loop will be stopped.
1575
- * Default value is false.
1576
- */
1577
- enabled: boolean;
1578
- private _clock;
1579
1600
  /**
1580
- * Adds a component to the list of components.
1581
- * Throws an error if a component with the same UUID already exists.
1601
+ * Sets up the IfcLoader component with the provided configuration.
1582
1602
  *
1583
- * @param uuid - The unique identifier of the component.
1584
- * @param instance - The instance of the component to be added.
1603
+ * @param config - Optional configuration settings for the IfcLoader.
1604
+ * If not provided, the existing settings will be used.
1585
1605
  *
1586
- * @throws Will throw an error if a component with the same UUID already exists.
1606
+ * @returns A Promise that resolves when the setup process is completed.
1587
1607
  *
1588
- * @internal
1608
+ * @remarks
1609
+ * If the 'autoSetWasm' option is enabled in the configuration,
1610
+ * the method will automatically set the WASM paths for the Web-IFC library.
1611
+ *
1612
+ * @example
1613
+ * '''typescript
1614
+ * const ifcLoader = new IfcLoader(components);
1615
+ * await ifcLoader.setup({ autoSetWasm: true });
1616
+ * '''
1589
1617
  */
1590
- add(uuid: string, instance: Component): void;
1618
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1591
1619
  /**
1592
- * Retrieves a component instance by its constructor function.
1593
- * If the component does not exist in the list, it will be created and added.
1594
- *
1595
- * @template U - The type of the component to retrieve.
1596
- * @param Component - The constructor function of the component to retrieve.
1620
+ * Loads an IFC file and processes it for 3D visualization.
1597
1621
  *
1598
- * @returns The instance of the requested component.
1622
+ * @param data - The Uint8Array containing the IFC file data.
1623
+ * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1599
1624
  *
1600
- * @throws Will throw an error if a component with the same UUID already exists.
1625
+ * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1601
1626
  *
1602
- * @internal
1627
+ * @example
1628
+ * '''typescript
1629
+ * const ifcLoader = components.get(IfcLoader);
1630
+ * const group = await ifcLoader.load(ifcData);
1631
+ * '''
1603
1632
  */
1604
- get<U extends Component>(Component: new (components: Components) => U): U;
1605
- constructor();
1633
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
1606
1634
  /**
1607
- * Initializes the Components instance.
1608
- * This method starts the animation loop, sets the enabled flag to true,
1609
- * and calls the update method.
1635
+ * Reads an IFC file and initializes the Web-IFC library.
1610
1636
  *
1611
- * @returns {void}
1612
- */
1613
- init(): void;
1614
- /**
1615
- * Disposes the memory of all the components and tools of this instance of
1616
- * the library. A memory leak will be created if:
1637
+ * @param data - The Uint8Array containing the IFC file data.
1617
1638
  *
1618
- * - An instance of the library ends up out of scope and this function isn't
1619
- * called. This is especially relevant in Single Page Applications (React,
1620
- * Angular, Vue, etc).
1639
+ * @returns A Promise that resolves when the IFC file is opened and initialized.
1621
1640
  *
1622
- * - Any of the objects of this instance (meshes, geometries,materials, etc) is
1623
- * referenced by a reference type (object or array).
1641
+ * @remarks
1642
+ * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1643
+ * It also opens the IFC model using the provided data and settings.
1624
1644
  *
1625
- * You can learn more about how Three.js handles memory leaks
1626
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1645
+ * @example
1646
+ * '''typescript
1647
+ * const ifcLoader = components.get(IfcLoader);
1648
+ * await ifcLoader.readIfcFile(ifcData);
1649
+ * '''
1650
+ */
1651
+ readIfcFile(data: Uint8Array): Promise<number>;
1652
+ /**
1653
+ * Cleans up the IfcLoader component by resetting the Web-IFC library,
1654
+ * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1655
+ *
1656
+ * @remarks
1657
+ * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1627
1658
  *
1659
+ * @example
1660
+ * '''typescript
1661
+ * const ifcLoader = components.get(IfcLoader);
1662
+ * ifcLoader.cleanUp();
1663
+ * '''
1628
1664
  */
1629
- dispose(): void;
1630
- private update;
1631
- private static setupBVH;
1665
+ cleanUp(): void;
1666
+ private getAllGeometries;
1667
+ private getMesh;
1668
+ private getGeometry;
1669
+ private autoSetWasm;
1632
1670
  }
1671
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1633
1672
  import * as THREE from "three";
1634
- import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
1635
- import { SimplePlane } from "./src";
1636
- import { Components } from "../Components";
1673
+ import * as FRAGS from "@thatopen/fragments";
1674
+ import { Component, Components, Event, Disposable } from "../../core";
1675
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1637
1676
  /**
1638
- * 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).
1639
- *
1640
- * @param components - the instance of {@link Components} used.
1641
- * E.g. {@link SimplePlane}.
1677
+ * 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).
1642
1678
  */
1643
- export declare class Clipper extends Component implements Createable, Disposable, Hideable {
1679
+ export declare class FragmentsManager extends Component implements Disposable {
1644
1680
  /**
1645
1681
  * A unique identifier for the component.
1646
1682
  * This UUID is used to register the component within the Components system.
1647
1683
  */
1648
- static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
1649
- /** Event that fires when the user starts dragging a clipping plane. */
1650
- readonly onBeforeDrag: Event<void>;
1651
- /** Event that fires when the user stops dragging a clipping plane. */
1652
- readonly onAfterDrag: Event<void>;
1684
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1685
+ /** {@link Disposable.onDisposed} */
1686
+ readonly onDisposed: Event<unknown>;
1653
1687
  /**
1654
- * Event that fires when the user starts creating a clipping plane.
1688
+ * Event triggered when fragments are loaded.
1655
1689
  */
1656
- readonly onBeforeCreate: Event<unknown>;
1690
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
1657
1691
  /**
1658
- * Event that fires when the user cancels the creation of a clipping plane.
1692
+ * Event triggered when fragments are disposed.
1659
1693
  */
1660
- readonly onBeforeCancel: Event<unknown>;
1694
+ readonly onFragmentsDisposed: Event<{
1695
+ groupID: string;
1696
+ fragmentIDs: string[];
1697
+ }>;
1661
1698
  /**
1662
- * Event that fires after the user cancels the creation of a clipping plane.
1663
- */
1664
- readonly onAfterCancel: Event<unknown>;
1665
- /**
1666
- * Event that fires when the user starts deleting a clipping plane.
1667
- */
1668
- readonly onBeforeDelete: Event<unknown>;
1669
- /**
1670
- * Event that fires after a clipping plane has been created.
1671
- * @param plane - The newly created clipping plane.
1672
- */
1673
- readonly onAfterCreate: Event<SimplePlane>;
1674
- /**
1675
- * Event that fires after a clipping plane has been deleted.
1676
- * @param plane - The deleted clipping plane.
1677
- */
1678
- readonly onAfterDelete: Event<SimplePlane>;
1679
- /** {@link Disposable.onDisposed} */
1680
- readonly onDisposed: Event<string>;
1681
- /**
1682
- * Whether to force the clipping plane to be orthogonal in the Y direction
1683
- * (up). This is desirable when clipping a building horizontally and a
1684
- * clipping plane is created in its roof, which might have a slight
1685
- * slope for draining purposes.
1686
- */
1687
- orthogonalY: boolean;
1688
- /**
1689
- * The tolerance that determines whether an almost-horizontal clipping plane
1690
- * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
1691
- * has to be 'true' for this to apply.
1699
+ * Map containing all loaded fragments.
1700
+ * The key is the fragment's unique identifier, and the value is the fragment itself.
1692
1701
  */
1693
- toleranceOrthogonalY: number;
1702
+ readonly list: Map<string, Fragment>;
1694
1703
  /**
1695
- * The type of clipping plane to be created.
1696
- * Default is {@link SimplePlane}.
1704
+ * Map containing all loaded fragment groups.
1705
+ * The key is the group's unique identifier, and the value is the group itself.
1697
1706
  */
1698
- Type: new (...args: any) => SimplePlane;
1707
+ readonly groups: Map<string, FragmentsGroup>;
1708
+ baseCoordinationModel: string;
1709
+ /** {@link Component.enabled} */
1710
+ enabled: boolean;
1711
+ private _loader;
1699
1712
  /**
1700
- * A list of all the clipping planes created by this component.
1713
+ * Getter for the meshes of all fragments in the FragmentsManager.
1714
+ * It iterates over the fragments in the list and pushes their meshes into an array.
1715
+ * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
1701
1716
  */
1702
- list: SimplePlane[];
1703
- /** The material used in all the clipping planes. */
1704
- private _material;
1705
- private _size;
1706
- private _enabled;
1707
- private _visible;
1708
- /** {@link Component.enabled} */
1709
- get enabled(): boolean;
1710
- /** {@link Component.enabled} */
1711
- set enabled(state: boolean);
1712
- /** {@link Hideable.visible } */
1713
- get visible(): boolean;
1714
- /** {@link Hideable.visible } */
1715
- set visible(state: boolean);
1716
- /** The material of the clipping plane representation. */
1717
- get material(): THREE.MeshBasicMaterial;
1718
- /** The material of the clipping plane representation. */
1719
- set material(material: THREE.MeshBasicMaterial);
1720
- /** The size of the geometric representation of the clippings planes. */
1721
- get size(): number;
1722
- /** The size of the geometric representation of the clippings planes. */
1723
- set size(size: number);
1717
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
1724
1718
  constructor(components: Components);
1725
1719
  /** {@link Disposable.dispose} */
1726
1720
  dispose(): void;
1727
- /** {@link Createable.create} */
1728
- create(world: World): void;
1729
- /**
1730
- * Creates a plane in a certain place and with a certain orientation,
1731
- * without the need of the mouse.
1732
- *
1733
- * @param world - the world where this plane should be created.
1734
- * @param normal - the orientation of the clipping plane.
1735
- * @param point - the position of the clipping plane.
1736
- * navigation.
1737
- */
1738
- createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
1739
1721
  /**
1740
- * {@link Createable.delete}
1722
+ * Dispose of a specific fragment group.
1723
+ * This method removes the group from the groups map, deletes all fragments within the group from the list,
1724
+ * disposes of the group, and triggers the onFragmentsDisposed event.
1741
1725
  *
1742
- * @param world - the world where the plane to delete is.
1743
- * @param plane - the plane to delete. If undefined, the first plane
1744
- * found under the cursor will be deleted.
1745
- */
1746
- delete(world: World, plane?: SimplePlane): void;
1747
- /** Deletes all the existing clipping planes. */
1748
- deleteAll(): void;
1749
- private deletePlane;
1750
- private pickPlane;
1751
- private getAllPlaneMeshes;
1752
- private createPlaneFromIntersection;
1753
- private getWorldNormal;
1754
- private normalizePlaneDirectionY;
1755
- private newPlane;
1756
- private updateMaterialsAndPlanes;
1757
- private _onStartDragging;
1758
- private _onEndDragging;
1759
- }
1760
- import * as THREE from "three";
1761
- import { Components } from "../Components";
1762
- import { SimpleCamera } from "..";
1763
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
1764
- /**
1765
- * 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).
1766
- */
1767
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
1768
- /**
1769
- * A ProjectionManager instance that manages the projection modes of the camera.
1726
+ * @param group - The fragment group to be disposed.
1770
1727
  */
1771
- readonly projection: ProjectionManager;
1728
+ disposeGroup(group: FragmentsGroup): void;
1772
1729
  /**
1773
- * A THREE.OrthographicCamera instance that represents the orthographic camera.
1774
- * This camera is used when the projection mode is set to orthographic.
1730
+ * Loads a binary file that contain fragment geometry.
1731
+ * @param data - The binary data to load.
1732
+ * @param config - Optional configuration for loading.
1733
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
1734
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
1735
+ * @returns The loaded FragmentsGroup.
1775
1736
  */
1776
- readonly threeOrtho: THREE.OrthographicCamera;
1737
+ load(data: Uint8Array, config?: Partial<{
1738
+ coordinate: boolean;
1739
+ name: string;
1740
+ properties: FRAGS.IfcProperties;
1741
+ relationsMap: RelationsMap;
1742
+ }>): FragmentsGroup;
1777
1743
  /**
1778
- * A THREE.PerspectiveCamera instance that represents the perspective camera.
1779
- * This camera is used when the projection mode is set to perspective.
1744
+ * Export the specified fragmentsgroup to binary data.
1745
+ * @param group - the fragments group to be exported.
1746
+ * @returns the exported data as binary buffer.
1780
1747
  */
1781
- readonly threePersp: THREE.PerspectiveCamera;
1782
- protected readonly _userInputButtons: any;
1783
- protected readonly _frustumSize = 50;
1784
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
1785
- protected _mode: NavigationMode | null;
1786
- private previousSize;
1748
+ export(group: FragmentsGroup): Uint8Array;
1787
1749
  /**
1788
- * Getter for the current navigation mode.
1789
- * Throws an error if the mode is not found or the camera is not initialized.
1790
- *
1791
- * @returns {NavigationMode} The current navigation mode.
1792
- *
1793
- * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
1750
+ * Gets a map of model IDs to sets of express IDs for the given fragment ID map.
1751
+ * @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
1752
+ * @returns A map of model IDs to sets of express IDs.
1794
1753
  */
1795
- get mode(): NavigationMode;
1796
- constructor(components: Components);
1797
- /** {@link Disposable.dispose} */
1798
- dispose(): void;
1754
+ getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
1755
+ [modelID: string]: Set<number>;
1756
+ };
1799
1757
  /**
1800
- * Sets a new {@link NavigationMode} and disables the previous one.
1801
- *
1802
- * @param mode - The {@link NavigationMode} to set.
1758
+ * Converts a map of model IDs to sets of express IDs to a fragment ID map.
1759
+ * @param modelIdMap - A map of model IDs to their corresponding express IDs.
1760
+ * @returns A fragment ID map.
1761
+ * @remarks
1762
+ * This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
1763
+ * and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
1764
+ * The fragment ID maps are then merged into a single map and returned.
1765
+ * 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.
1803
1766
  */
1804
- set(mode: NavModeID): void;
1767
+ modelIdToFragmentIdMap(modelIdMap: {
1768
+ [modelID: string]: Set<number>;
1769
+ }): FRAGS.FragmentIdMap;
1805
1770
  /**
1806
- * Make the camera view fit all the specified meshes.
1771
+ * Applies coordinate transformation to the provided models.
1772
+ * If no models are provided, all groups are used.
1773
+ * The first model in the list becomes the base model for coordinate transformation.
1774
+ * All other models are then transformed to match the base model's coordinate system.
1807
1775
  *
1808
- * @param meshes the meshes to fit. If it is not defined, it will
1809
- * evaluate {@link Components.meshes}.
1810
- * @param offset the distance to the fit object
1811
- */
1812
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
1813
- /**
1814
- * Allows or prevents all user input.
1776
+ * @param models - The models to apply coordinate transformation to.
1777
+ * If not provided, all groups are used.
1815
1778
  *
1816
- * @param active - whether to enable or disable user inputs.
1779
+ * @returns {void}
1817
1780
  */
1818
- setUserInput(active: boolean): void;
1819
- private disableUserInput;
1820
- private enableUserInput;
1821
- private newOrthoCamera;
1822
- private setOrthoPerspCameraAspect;
1781
+ coordinate(models?: FragmentsGroup[]): void;
1823
1782
  }
1824
1783
  import * as THREE from "three";
1825
1784
  import { Component, Components } from "../../core";
@@ -1897,128 +1856,187 @@ export declare class MeasurementUtils extends Component {
1897
1856
  round(vector: THREE.Vector3): void;
1898
1857
  private getFaceData;
1899
1858
  }
1900
- import * as THREE from "three";
1901
- export declare class MaterialsUtils {
1902
- static isTransparent(material: THREE.Material): boolean;
1903
- }
1904
- export declare class UUID {
1905
- private static _pattern;
1906
- private static _lut;
1907
- static create(): string;
1908
- static validate(uuid: string): void;
1909
- }
1910
- import * as THREE from "three";
1911
- import { Component, Components, Disposable, Event, World } from "../core";
1859
+ import * as WEBIFC from "web-ifc";
1860
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
1861
+ import { PropertiesStreamingSettings } from "./src";
1912
1862
  /**
1913
- * Configuration interface for the VertexPicker component.
1863
+ * 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).
1914
1864
  */
1915
- export interface VertexPickerConfig {
1865
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
1916
1866
  /**
1917
- * If true, only vertices will be picked, not the closest point on the face.
1867
+ * A unique identifier for the component.
1868
+ * This UUID is used to register the component within the Components system.
1918
1869
  */
1919
- showOnlyVertex: boolean;
1870
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1920
1871
  /**
1921
- * The maximum distance for snapping to a vertex.
1872
+ * An event that is triggered when properties are streamed from the IFC file.
1873
+ * The event provides the type of the IFC entity and the corresponding data.
1922
1874
  */
1923
- snapDistance: number;
1875
+ readonly onPropertiesStreamed: AsyncEvent<{
1876
+ type: number;
1877
+ data: {
1878
+ [id: number]: any;
1879
+ };
1880
+ }>;
1924
1881
  /**
1925
- * The HTML element to use for previewing the picked vertex.
1882
+ * An event that is triggered to indicate the progress of the streaming process.
1883
+ * The event provides a number between 0 and 1 representing the progress percentage.
1926
1884
  */
1927
- previewElement: HTMLElement;
1928
- }
1929
- /**
1930
- * A class that provides functionality for picking vertices in a 3D scene.
1931
- */
1932
- export declare class VertexPicker extends Component implements Disposable {
1933
- /** {@link Disposable.onDisposed} */
1934
- readonly onDisposed: Event<unknown>;
1885
+ readonly onProgress: AsyncEvent<number>;
1935
1886
  /**
1936
- * An event that is triggered when a vertex is found.
1937
- * The event passes a THREE.Vector3 representing the position of the found vertex.
1887
+ * An event that is triggered when indices are streamed from the IFC file.
1888
+ * The event provides a map of indices, where the key is the entity type and the value is another map of indices.
1938
1889
  */
1939
- readonly onVertexFound: Event<THREE.Vector3>;
1890
+ readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
1891
+ /** {@link Disposable.onDisposed} */
1892
+ readonly onDisposed: Event<string>;
1893
+ /** {@link Component.enabled} */
1894
+ enabled: boolean;
1940
1895
  /**
1941
- * An event that is triggered when a vertex is lost.
1942
- * The event passes a THREE.Vector3 representing the position of the lost vertex.
1896
+ * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
1943
1897
  */
1944
- readonly onVertexLost: Event<THREE.Vector3>;
1898
+ settings: PropertiesStreamingSettings;
1945
1899
  /**
1946
- * A reference to the Components instance associated with this VertexPicker.
1900
+ * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
1947
1901
  */
1948
- components: Components;
1902
+ webIfc: WEBIFC.IfcAPI;
1903
+ /** {@link Disposable.dispose} */
1904
+ dispose(): Promise<void>;
1949
1905
  /**
1950
- * A reference to the working plane used for vertex picking.
1951
- * This plane is used to determine which vertices are considered valid for picking.
1952
- * If this value is null, all vertices are considered valid.
1906
+ * This method converts properties from an IFC file to tiles given its data as a Uint8Array.
1907
+ *
1908
+ * @param data - The Uint8Array containing the IFC file data.
1909
+ * @returns A Promise that resolves when the streaming process is complete.
1953
1910
  */
1954
- workingPlane: THREE.Plane | null;
1955
- private _pickedPoint;
1956
- private _config;
1957
- private _enabled;
1911
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1958
1912
  /**
1959
- * Sets the enabled state of the VertexPicker.
1960
- * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1961
- * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1913
+ * This method converts properties from an IFC file to tiles using a given callback function to read the file.
1962
1914
  *
1963
- * @param value - The new enabled state.
1915
+ * @param loadCallback - A callback function that loads the IFC file data.
1916
+ * @returns A Promise that resolves when the streaming process is complete.
1964
1917
  */
1965
- set enabled(value: boolean);
1918
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1919
+ private readIfcFile;
1920
+ private streamIfcFile;
1921
+ private streamAllProperties;
1922
+ private cleanUp;
1923
+ }
1924
+ import * as WEBIFC from "web-ifc";
1925
+ import { Components, Disposable, Event, Component } from "../../core";
1926
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
1927
+ /**
1928
+ * 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).
1929
+ */
1930
+ export declare class IfcGeometryTiler extends Component implements Disposable {
1966
1931
  /**
1967
- * Gets the current enabled state of the VertexPicker.
1968
- *
1969
- * @returns The current enabled state.
1932
+ * A unique identifier for the component.
1933
+ * This UUID is used to register the component within the Components system.
1970
1934
  */
1971
- get enabled(): boolean;
1935
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1972
1936
  /**
1973
- * Sets the configuration for the VertexPicker component.
1974
- *
1975
- * @param value - A Partial object containing the configuration properties to update.
1976
- * The properties not provided in the value object will retain their current values.
1977
- *
1978
- * @example
1979
- * '''typescript
1980
- * vertexPicker.config = {
1981
- * snapDistance: 0.5,
1982
- * showOnlyVertex: true,
1983
- * };
1984
- * '''
1937
+ * Event triggered when geometry is streamed.
1938
+ * Contains the streamed geometry data and its buffer.
1985
1939
  */
1986
- set config(value: Partial<VertexPickerConfig>);
1940
+ readonly onGeometryStreamed: Event<{
1941
+ buffer: Uint8Array;
1942
+ data: StreamedGeometries;
1943
+ }>;
1987
1944
  /**
1988
- * Gets the current configuration for the VertexPicker component.
1945
+ * Event triggered when assets are streamed.
1946
+ * Contains the streamed assets.
1947
+ */
1948
+ readonly onAssetStreamed: Event<StreamedAsset[]>;
1949
+ /**
1950
+ * Event triggered to indicate the progress of the streaming process.
1951
+ * Contains the progress percentage.
1952
+ */
1953
+ readonly onProgress: Event<number>;
1954
+ /**
1955
+ * Event triggered when the IFC file is loaded.
1956
+ * Contains the loaded IFC file data.
1957
+ */
1958
+ readonly onIfcLoaded: Event<Uint8Array>;
1959
+ /** {@link Disposable.onDisposed} */
1960
+ readonly onDisposed: Event<unknown>;
1961
+ /**
1962
+ * Settings for the IfcGeometryTiler.
1963
+ */
1964
+ settings: IfcStreamingSettings;
1965
+ /** {@link Component.enabled} */
1966
+ enabled: boolean;
1967
+ /**
1968
+ * The WebIFC API instance used for IFC file processing.
1969
+ */
1970
+ webIfc: WEBIFC.IfcAPI;
1971
+ private _spatialTree;
1972
+ private _metaData;
1973
+ private _visitedGeometries;
1974
+ private _streamSerializer;
1975
+ private _geometries;
1976
+ private _geometryCount;
1977
+ private _civil;
1978
+ private _groupSerializer;
1979
+ private _assets;
1980
+ private _meshesWithHoles;
1981
+ constructor(components: Components);
1982
+ /** {@link Disposable.dispose} */
1983
+ dispose(): void;
1984
+ /**
1985
+ * This method streams the IFC file from a given buffer.
1989
1986
  *
1990
- * @returns A copy of the current VertexPickerConfig object.
1987
+ * @param data - The Uint8Array containing the IFC file data.
1988
+ * @returns A Promise that resolves when the streaming process is complete.
1989
+ *
1990
+ * @remarks
1991
+ * This method cleans up any resources after the streaming process is complete.
1991
1992
  *
1992
1993
  * @example
1993
1994
  * '''typescript
1994
- * const currentConfig = vertexPicker.config;
1995
- * console.log(currentConfig.snapDistance); // Output: 0.25
1995
+ * const ifcData = await fetch('path/to/ifc/file.ifc');
1996
+ * const rawBuffer = await response.arrayBuffer();
1997
+ * const ifcBuffer = new Uint8Array(rawBuffer);
1998
+ * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
1996
1999
  * '''
1997
2000
  */
1998
- get config(): Partial<VertexPickerConfig>;
1999
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
2000
- /** {@link Disposable.dispose} */
2001
- dispose(): void;
2001
+ streamFromBuffer(data: Uint8Array): Promise<void>;
2002
2002
  /**
2003
- * Performs the vertex picking operation based on the current state of the VertexPicker.
2004
- *
2005
- * @param world - The World instance to use for raycasting.
2003
+ * This method streams the IFC file from a given callback.
2006
2004
  *
2007
- * @returns The current picked point, or null if no point is picked.
2005
+ * @param loadCallback - The callback function that will be used to load the IFC file.
2006
+ * @returns A Promise that resolves when the streaming process is complete.
2008
2007
  *
2009
2008
  * @remarks
2010
- * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
2011
- * If enabled, it performs raycasting to find the closest intersecting object.
2012
- * It then determines the closest vertex or point on the face, based on the configuration settings.
2013
- * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
2014
- * If the picked point is not on the working plane, it resets the 'pickedPoint'.
2015
- * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
2009
+ * This method cleans up any resources after the streaming process is complete.
2010
+ *
2016
2011
  */
2017
- get(world: World): THREE.Vector3 | null;
2018
- private getClosestVertex;
2019
- private getVertices;
2020
- private getVertex;
2012
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
2013
+ private readIfcFile;
2014
+ private streamIfcFile;
2015
+ private streamAllGeometries;
2016
+ private cleanUp;
2017
+ private getMesh;
2018
+ private getGeometry;
2019
+ private streamAssets;
2020
+ private streamGeometries;
2021
+ }
2022
+ import * as WEBIFC from "web-ifc";
2023
+ export interface IfcItemsCategories {
2024
+ [itemID: number]: number;
2025
+ }
2026
+ export declare class IfcCategories {
2027
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2021
2028
  }
2029
+ /**
2030
+ * 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.
2031
+ *
2032
+ * @remarks
2033
+ * This map is used to provide a mapping between IFC entity type numbers and their names.
2034
+ * It is useful for identifying and processing different types of IFC elements in a project.
2035
+ *
2036
+ */
2037
+ export declare const IfcElements: {
2038
+ [key: number]: string;
2039
+ };
2022
2040
  import * as FRAGS from "@thatopen/fragments";
2023
2041
  export declare class IfcPropertiesUtils {
2024
2042
  static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
@@ -2044,154 +2062,41 @@ export declare class IfcPropertiesUtils {
2044
2062
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2045
2063
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2046
2064
  }
2047
- import * as WEBIFC from "web-ifc";
2048
- export interface IfcItemsCategories {
2049
- [itemID: number]: number;
2050
- }
2051
- export declare class IfcCategories {
2052
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2053
- }
2054
2065
  /**
2055
- * 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.
2066
+ * A Set of unique numbers representing different types of IFC geometries.
2056
2067
  */
2057
- export declare const IfcCategoryMap: {
2058
- [key: number]: string;
2059
- };
2068
+ export declare const GeometryTypes: Set<number>;
2060
2069
  /**
2061
- * 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.
2062
- *
2063
- * @remarks
2064
- * This map is used to provide a mapping between IFC entity type numbers and their names.
2065
- * It is useful for identifying and processing different types of IFC elements in a project.
2066
- *
2070
+ * 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.
2067
2071
  */
2068
- export declare const IfcElements: {
2072
+ export declare const IfcCategoryMap: {
2069
2073
  [key: number]: string;
2070
2074
  };
2071
- import { InverseAttribute } from "./types";
2072
- export declare const relToAttributesMap: Map<number, {
2073
- forRelating: InverseAttribute;
2074
- forRelated: InverseAttribute;
2075
- }>;
2075
+ import * as THREE from "three";
2076
+ import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
2076
2077
  /**
2077
- * A Set of unique numbers representing different types of IFC geometries.
2078
+ * A class representing a 2D minimap of a 3D world.
2078
2079
  */
2079
- export declare const GeometryTypes: Set<number>;
2080
- import * as WEBIFC from "web-ifc";
2081
- import { IfcItemsCategories } from "../../../ifc";
2082
- export declare class SpatialStructure {
2083
- itemsByFloor: IfcItemsCategories;
2084
- private _units;
2085
- setUp(webIfc: WEBIFC.IfcAPI): void;
2086
- cleanUp(): void;
2087
- }
2088
- import * as WEBIFC from "web-ifc";
2089
- /** Configuration of the IFC-fragment conversion. */
2090
- export declare class IfcFragmentSettings {
2091
- /** Whether to extract the IFC properties into a JSON. */
2092
- includeProperties: boolean;
2080
+ export declare class MiniMap implements Resizeable, Updateable, Disposable {
2081
+ /** {@link Disposable.onDisposed} */
2082
+ readonly onDisposed: Event<unknown>;
2083
+ /** {@link Updateable.onAfterUpdate} */
2084
+ readonly onAfterUpdate: Event<unknown>;
2085
+ /** {@link Updateable.onBeforeUpdate} */
2086
+ readonly onBeforeUpdate: Event<unknown>;
2087
+ /** {@link Resizeable.onResize} */
2088
+ readonly onResize: Event<THREE.Vector2>;
2093
2089
  /**
2094
- * Generate the geometry for categories that are not included by default,
2095
- * like IFCSPACE.
2090
+ * The front offset of the minimap.
2091
+ * It determines how much the minimap's view is offset from the camera's view.
2092
+ * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
2096
2093
  */
2097
- optionalCategories: number[];
2098
- /** Whether to use the coordination data coming from the IFC files. */
2099
- coordinate: boolean;
2100
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2101
- wasm: {
2102
- path: string;
2103
- absolute: boolean;
2104
- logLevel?: WEBIFC.LogLevel;
2105
- };
2106
- /** List of categories that won't be converted to fragments. */
2107
- excludedCategories: Set<number>;
2108
- /** Whether to save the absolute location of all IFC items. */
2109
- saveLocations: boolean;
2110
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2111
- webIfc: WEBIFC.LoaderSettings;
2094
+ frontOffset: number;
2112
2095
  /**
2113
- * Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2114
- * If set to true, the path will be set to the default path of the WASM file.
2115
- * If set to false, the path must be provided manually in the 'wasm.path' property.
2116
- * Default value is true.
2096
+ * The override material for the minimap.
2097
+ * It is used to render the depth information of the world onto the minimap.
2117
2098
  */
2118
- autoSetWasm: boolean;
2119
- /**
2120
- * Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2121
- * This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
2122
- * If set to null, the default file location handler will be used.
2123
- *
2124
- * @param url - The URL of the file to locate.
2125
- * @returns The absolute path of the file.
2126
- */
2127
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2128
- }
2129
- /**
2130
- * 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.
2131
- */
2132
- export declare class Event<T> {
2133
- /**
2134
- * Add a callback to this event instance.
2135
- * @param handler - the callback to be added to this event.
2136
- */
2137
- add(handler: T extends void ? {
2138
- (): void;
2139
- } : {
2140
- (data: T): void;
2141
- }): void;
2142
- /**
2143
- * Removes a callback from this event instance.
2144
- * @param handler - the callback to be removed from this event.
2145
- */
2146
- remove(handler: T extends void ? {
2147
- (): void;
2148
- } : {
2149
- (data: T): void;
2150
- }): void;
2151
- /** Triggers all the callbacks assigned to this event. */
2152
- trigger: (data?: T) => void;
2153
- /** Gets rid of all the suscribed events. */
2154
- reset(): void;
2155
- private handlers;
2156
- }
2157
- import { Base } from "./base";
2158
- /**
2159
- * 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.
2160
- */
2161
- export declare abstract class Component extends Base {
2162
- /**
2163
- * Whether this component is active or not. The behaviour can vary depending
2164
- * on the type of component. E.g. a disabled dimension tool will stop creating
2165
- * dimensions, while a disabled camera will stop moving. A disabled component
2166
- * will not be updated automatically each frame.
2167
- */
2168
- abstract enabled: boolean;
2169
- }
2170
- import * as THREE from "three";
2171
- import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
2172
- /**
2173
- * A class representing a 2D minimap of a 3D world.
2174
- */
2175
- export declare class MiniMap implements Resizeable, Updateable, Disposable {
2176
- /** {@link Disposable.onDisposed} */
2177
- readonly onDisposed: Event<unknown>;
2178
- /** {@link Updateable.onAfterUpdate} */
2179
- readonly onAfterUpdate: Event<unknown>;
2180
- /** {@link Updateable.onBeforeUpdate} */
2181
- readonly onBeforeUpdate: Event<unknown>;
2182
- /** {@link Resizeable.onResize} */
2183
- readonly onResize: Event<THREE.Vector2>;
2184
- /**
2185
- * The front offset of the minimap.
2186
- * It determines how much the minimap's view is offset from the camera's view.
2187
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
2188
- */
2189
- frontOffset: number;
2190
- /**
2191
- * The override material for the minimap.
2192
- * It is used to render the depth information of the world onto the minimap.
2193
- */
2194
- overrideMaterial: THREE.MeshDepthMaterial;
2099
+ overrideMaterial: THREE.MeshDepthMaterial;
2195
2100
  /**
2196
2101
  * The background color of the minimap.
2197
2102
  * It is used to set the background color of the minimap's renderer.
@@ -2256,140 +2161,107 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
2256
2161
  resize(size?: THREE.Vector2): void;
2257
2162
  private updatePlanes;
2258
2163
  }
2164
+ import { InverseAttribute } from "./types";
2165
+ export declare const relToAttributesMap: Map<number, {
2166
+ forRelating: InverseAttribute;
2167
+ forRelated: InverseAttribute;
2168
+ }>;
2169
+ import * as WEBIFC from "web-ifc";
2170
+ /** Configuration of the IFC-fragment conversion. */
2171
+ export declare class IfcFragmentSettings {
2172
+ /** Whether to extract the IFC properties into a JSON. */
2173
+ includeProperties: boolean;
2174
+ /**
2175
+ * Generate the geometry for categories that are not included by default,
2176
+ * like IFCSPACE.
2177
+ */
2178
+ optionalCategories: number[];
2179
+ /** Whether to use the coordination data coming from the IFC files. */
2180
+ coordinate: boolean;
2181
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2182
+ wasm: {
2183
+ path: string;
2184
+ absolute: boolean;
2185
+ logLevel?: WEBIFC.LogLevel;
2186
+ };
2187
+ /** List of categories that won't be converted to fragments. */
2188
+ excludedCategories: Set<number>;
2189
+ /** Whether to save the absolute location of all IFC items. */
2190
+ saveLocations: boolean;
2191
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2192
+ webIfc: WEBIFC.LoaderSettings;
2193
+ /**
2194
+ * Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2195
+ * If set to true, the path will be set to the default path of the WASM file.
2196
+ * If set to false, the path must be provided manually in the 'wasm.path' property.
2197
+ * Default value is true.
2198
+ */
2199
+ autoSetWasm: boolean;
2200
+ /**
2201
+ * Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2202
+ * This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
2203
+ * If set to null, the default file location handler will be used.
2204
+ *
2205
+ * @param url - The URL of the file to locate.
2206
+ * @returns The absolute path of the file.
2207
+ */
2208
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2209
+ }
2259
2210
  /**
2260
2211
  * 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.
2261
2212
  */
2262
- export declare class AsyncEvent<T> {
2213
+ export declare class Event<T> {
2263
2214
  /**
2264
2215
  * Add a callback to this event instance.
2265
2216
  * @param handler - the callback to be added to this event.
2266
2217
  */
2267
2218
  add(handler: T extends void ? {
2268
- (): Promise<void>;
2219
+ (): void;
2269
2220
  } : {
2270
- (data: T): Promise<void>;
2221
+ (data: T): void;
2271
2222
  }): void;
2272
2223
  /**
2273
2224
  * Removes a callback from this event instance.
2274
2225
  * @param handler - the callback to be removed from this event.
2275
2226
  */
2276
2227
  remove(handler: T extends void ? {
2277
- (): Promise<void>;
2228
+ (): void;
2278
2229
  } : {
2279
- (data: T): Promise<void>;
2230
+ (data: T): void;
2280
2231
  }): void;
2281
2232
  /** Triggers all the callbacks assigned to this event. */
2282
- trigger: (data?: T) => Promise<void>;
2233
+ trigger: (data?: T) => void;
2283
2234
  /** Gets rid of all the suscribed events. */
2284
2235
  reset(): void;
2285
2236
  private handlers;
2286
2237
  }
2287
- import * as THREE from "three";
2288
- import { Vector2 } from "three";
2289
- import { Event } from "./event";
2290
- import { BaseWorldItem } from "./base-world-item";
2291
- import { Disposable, Resizeable, Updateable } from "./interfaces";
2292
- /**
2293
- * Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
2294
- */
2295
- export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
2296
- /**
2297
- * The three.js WebGLRenderer instance associated with this renderer.
2298
- *
2299
- * @abstract
2300
- * @type {THREE.WebGLRenderer}
2301
- */
2302
- abstract three: THREE.WebGLRenderer;
2303
- /** {@link Updateable.onBeforeUpdate} */
2304
- onAfterUpdate: Event<unknown>;
2305
- /** {@link Updateable.onAfterUpdate} */
2306
- onBeforeUpdate: Event<unknown>;
2307
- /** {@link Disposable.onDisposed} */
2308
- readonly onDisposed: Event<undefined>;
2309
- /** {@link Resizeable.onResize} */
2310
- readonly onResize: Event<THREE.Vector2>;
2311
- /**
2312
- * Event that fires when there has been a change to the list of clipping
2313
- * planes used by the active renderer.
2314
- */
2315
- readonly onClippingPlanesUpdated: Event<unknown>;
2316
- /** {@link Updateable.update} */
2317
- abstract update(delta?: number): void | Promise<void>;
2318
- /** {@link Disposable.dispose} */
2319
- abstract dispose(): void;
2320
- /** {@link Resizeable.getSize} */
2321
- abstract getSize(): Vector2;
2322
- /** {@link Resizeable.resize} */
2323
- abstract resize(size: Vector2 | undefined): void;
2324
- /**
2325
- * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
2326
- */
2327
- clippingPlanes: THREE.Plane[];
2328
- /**
2329
- * Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
2330
- *
2331
- * @remarks
2332
- * This method is typically called when there is a change to the list of clipping planes
2333
- * used by the active renderer.
2334
- */
2335
- updateClippingPlanes(): void;
2336
- /**
2337
- * Sets or removes a clipping plane from the renderer.
2338
- *
2339
- * @param active - A boolean indicating whether the clipping plane should be active or not.
2340
- * @param plane - The clipping plane to be added or removed.
2341
- * @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
2342
- *
2343
- * @remarks
2344
- * This method adds or removes a clipping plane from the 'clippingPlanes' array.
2345
- * If 'active' is 'true' and the plane is not already in the array, it is added.
2346
- * If 'active' is 'false' and the plane is in the array, it is removed.
2347
- * The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
2348
- * excluding any planes marked as local.
2349
- */
2350
- setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
2351
- }
2352
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2353
- import { Components } from "../../Components";
2354
- /**
2355
- * Base class of the library. Useful for finding out the interfaces something implements.
2356
- */
2357
- export declare abstract class Base {
2358
- components: Components;
2359
- constructor(components: Components);
2360
- /** Whether is component is {@link Disposable}. */
2361
- isDisposeable: () => this is Disposable;
2362
- /** Whether is component is {@link Resizeable}. */
2363
- isResizeable: () => this is Resizeable;
2364
- /** Whether is component is {@link Updateable}. */
2365
- isUpdateable: () => this is Updateable;
2366
- /** Whether is component is {@link Hideable}. */
2367
- isHideable: () => this is Hideable;
2368
- /** Whether is component is {@link Configurable}. */
2369
- isConfigurable: () => this is Configurable<any>;
2370
- }
2371
- import { Base } from "./base";
2372
- import { World } from "./world";
2373
- import { Event } from "./event";
2374
- import { Components } from "../../Components";
2375
2238
  /**
2376
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
2239
+ * 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.
2377
2240
  */
2378
- export declare abstract class BaseWorldItem extends Base {
2379
- readonly worlds: Map<string, World>;
2241
+ export declare class AsyncEvent<T> {
2380
2242
  /**
2381
- * Event that is triggered when a world is added or removed from the 'worlds' map.
2382
- * The event payload contains the world instance and the action ("added" or "removed").
2243
+ * Add a callback to this event instance.
2244
+ * @param handler - the callback to be added to this event.
2383
2245
  */
2384
- readonly onWorldChanged: Event<{
2385
- world: World;
2386
- action: "added" | "removed";
2387
- }>;
2246
+ add(handler: T extends void ? {
2247
+ (): Promise<void>;
2248
+ } : {
2249
+ (data: T): Promise<void>;
2250
+ }): void;
2388
2251
  /**
2389
- * The current world this item is associated with. It can be null if no world is currently active.
2252
+ * Removes a callback from this event instance.
2253
+ * @param handler - the callback to be removed from this event.
2390
2254
  */
2391
- currentWorld: World | null;
2392
- protected constructor(components: Components);
2255
+ remove(handler: T extends void ? {
2256
+ (): Promise<void>;
2257
+ } : {
2258
+ (data: T): Promise<void>;
2259
+ }): void;
2260
+ /** Triggers all the callbacks assigned to this event. */
2261
+ trigger: (data?: T) => Promise<void>;
2262
+ /** Gets rid of all the suscribed events. */
2263
+ reset(): void;
2264
+ private handlers;
2393
2265
  }
2394
2266
  import * as THREE from "three";
2395
2267
  import CameraControls from "camera-controls";
@@ -2499,8 +2371,52 @@ export interface CameraControllable {
2499
2371
  */
2500
2372
  controls: CameraControls;
2501
2373
  }
2502
- import * as THREE from "three";
2503
- import CameraControls from "camera-controls";
2374
+ import * as WEBIFC from "web-ifc";
2375
+ import { IfcItemsCategories } from "../../../ifc";
2376
+ export declare class SpatialStructure {
2377
+ itemsByFloor: IfcItemsCategories;
2378
+ private _units;
2379
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2380
+ cleanUp(): void;
2381
+ }
2382
+ import { Base } from "./base";
2383
+ /**
2384
+ * Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
2385
+ */
2386
+ export declare abstract class Component extends Base {
2387
+ /**
2388
+ * Whether this component is active or not. The behaviour can vary depending
2389
+ * on the type of component. E.g. a disabled dimension tool will stop creating
2390
+ * dimensions, while a disabled camera will stop moving. A disabled component
2391
+ * will not be updated automatically each frame.
2392
+ */
2393
+ abstract enabled: boolean;
2394
+ }
2395
+ import { Base } from "./base";
2396
+ import { World } from "./world";
2397
+ import { Event } from "./event";
2398
+ import { Components } from "../../Components";
2399
+ /**
2400
+ * One of the elements that make a world. It can be either a scene, a camera or a renderer.
2401
+ */
2402
+ export declare abstract class BaseWorldItem extends Base {
2403
+ readonly worlds: Map<string, World>;
2404
+ /**
2405
+ * Event that is triggered when a world is added or removed from the 'worlds' map.
2406
+ * The event payload contains the world instance and the action ("added" or "removed").
2407
+ */
2408
+ readonly onWorldChanged: Event<{
2409
+ world: World;
2410
+ action: "added" | "removed";
2411
+ }>;
2412
+ /**
2413
+ * The current world this item is associated with. It can be null if no world is currently active.
2414
+ */
2415
+ currentWorld: World | null;
2416
+ protected constructor(components: Components);
2417
+ }
2418
+ import * as THREE from "three";
2419
+ import CameraControls from "camera-controls";
2504
2420
  import { BaseWorldItem } from "./base-world-item";
2505
2421
  import { CameraControllable } from "./interfaces";
2506
2422
  /**
@@ -2527,6 +2443,25 @@ export declare abstract class BaseCamera extends BaseWorldItem {
2527
2443
  */
2528
2444
  hasCameraControls: () => this is CameraControllable;
2529
2445
  }
2446
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2447
+ import { Components } from "../../Components";
2448
+ /**
2449
+ * Base class of the library. Useful for finding out the interfaces something implements.
2450
+ */
2451
+ export declare abstract class Base {
2452
+ components: Components;
2453
+ constructor(components: Components);
2454
+ /** Whether is component is {@link Disposable}. */
2455
+ isDisposeable: () => this is Disposable;
2456
+ /** Whether is component is {@link Resizeable}. */
2457
+ isResizeable: () => this is Resizeable;
2458
+ /** Whether is component is {@link Updateable}. */
2459
+ isUpdateable: () => this is Updateable;
2460
+ /** Whether is component is {@link Hideable}. */
2461
+ isHideable: () => this is Hideable;
2462
+ /** Whether is component is {@link Configurable}. */
2463
+ isConfigurable: () => this is Configurable<any>;
2464
+ }
2530
2465
  import * as THREE from "three";
2531
2466
  import { BaseScene } from "./base-scene";
2532
2467
  import { BaseCamera } from "./base-camera";
@@ -2562,58 +2497,89 @@ export interface World extends Disposable, Updateable {
2562
2497
  isDisposing: boolean;
2563
2498
  }
2564
2499
  import * as THREE from "three";
2565
- import { Disposable } from "./interfaces";
2500
+ import { Vector2 } from "three";
2566
2501
  import { Event } from "./event";
2567
- import { Components } from "../../Components";
2568
2502
  import { BaseWorldItem } from "./base-world-item";
2503
+ import { Disposable, Resizeable, Updateable } from "./interfaces";
2569
2504
  /**
2570
- * Abstract class representing a base scene in the application. All scenes should use this class as a base.
2505
+ * Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
2571
2506
  */
2572
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
2507
+ export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
2508
+ /**
2509
+ * The three.js WebGLRenderer instance associated with this renderer.
2510
+ *
2511
+ * @abstract
2512
+ * @type {THREE.WebGLRenderer}
2513
+ */
2514
+ abstract three: THREE.WebGLRenderer;
2515
+ /** {@link Updateable.onBeforeUpdate} */
2516
+ onAfterUpdate: Event<unknown>;
2517
+ /** {@link Updateable.onAfterUpdate} */
2518
+ onBeforeUpdate: Event<unknown>;
2573
2519
  /** {@link Disposable.onDisposed} */
2574
- readonly onDisposed: Event<unknown>;
2520
+ readonly onDisposed: Event<undefined>;
2521
+ /** {@link Resizeable.onResize} */
2522
+ readonly onResize: Event<THREE.Vector2>;
2575
2523
  /**
2576
- * Abstract property representing the three.js object associated with this scene.
2577
- * It should be implemented by subclasses.
2524
+ * Event that fires when there has been a change to the list of clipping
2525
+ * planes used by the active renderer.
2578
2526
  */
2579
- abstract three: THREE.Object3D;
2580
- protected constructor(components: Components);
2527
+ readonly onClippingPlanesUpdated: Event<unknown>;
2528
+ /** {@link Updateable.update} */
2529
+ abstract update(delta?: number): void | Promise<void>;
2581
2530
  /** {@link Disposable.dispose} */
2582
- dispose(): void;
2531
+ abstract dispose(): void;
2532
+ /** {@link Resizeable.getSize} */
2533
+ abstract getSize(): Vector2;
2534
+ /** {@link Resizeable.resize} */
2535
+ abstract resize(size: Vector2 | undefined): void;
2536
+ /**
2537
+ * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
2538
+ */
2539
+ clippingPlanes: THREE.Plane[];
2540
+ /**
2541
+ * Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
2542
+ *
2543
+ * @remarks
2544
+ * This method is typically called when there is a change to the list of clipping planes
2545
+ * used by the active renderer.
2546
+ */
2547
+ updateClippingPlanes(): void;
2548
+ /**
2549
+ * Sets or removes a clipping plane from the renderer.
2550
+ *
2551
+ * @param active - A boolean indicating whether the clipping plane should be active or not.
2552
+ * @param plane - The clipping plane to be added or removed.
2553
+ * @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
2554
+ *
2555
+ * @remarks
2556
+ * This method adds or removes a clipping plane from the 'clippingPlanes' array.
2557
+ * If 'active' is 'true' and the plane is not already in the array, it is added.
2558
+ * If 'active' is 'false' and the plane is in the array, it is removed.
2559
+ * The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
2560
+ * excluding any planes marked as local.
2561
+ */
2562
+ setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
2583
2563
  }
2584
2564
  import * as THREE from "three";
2585
- import { Disposable, Event } from "../../Types";
2565
+ import { Disposable } from "./interfaces";
2566
+ import { Event } from "./event";
2567
+ import { Components } from "../../Components";
2568
+ import { BaseWorldItem } from "./base-world-item";
2586
2569
  /**
2587
- * A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
2570
+ * Abstract class representing a base scene in the application. All scenes should use this class as a base.
2588
2571
  */
2589
- export declare class Mouse implements Disposable {
2590
- dom: HTMLCanvasElement;
2591
- private _event?;
2592
- private _position;
2572
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
2593
2573
  /** {@link Disposable.onDisposed} */
2594
2574
  readonly onDisposed: Event<unknown>;
2595
- constructor(dom: HTMLCanvasElement);
2596
2575
  /**
2597
- * The real position of the mouse of the Three.js canvas.
2576
+ * Abstract property representing the three.js object associated with this scene.
2577
+ * It should be implemented by subclasses.
2598
2578
  */
2599
- get position(): THREE.Vector2;
2579
+ abstract three: THREE.Object3D;
2580
+ protected constructor(components: Components);
2600
2581
  /** {@link Disposable.dispose} */
2601
2582
  dispose(): void;
2602
- private getPositionY;
2603
- private getPositionX;
2604
- private updateMouseInfo;
2605
- private setupEvents;
2606
- }
2607
- import { IfcFragmentSettings } from "../../IfcLoader/src";
2608
- /**
2609
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
2610
- */
2611
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
2612
- /**
2613
- * Amount of properties to be streamed.
2614
- * Defaults to 100 properties.
2615
- */
2616
- propertiesSize: number;
2617
2583
  }
2618
2584
  import * as THREE from "three";
2619
2585
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
@@ -2695,56 +2661,43 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
2695
2661
  dispose(disposeResources?: boolean): void;
2696
2662
  }
2697
2663
  import * as THREE from "three";
2664
+ import { BaseScene, Configurable, Event } from "../../Types";
2698
2665
  import { Components } from "../../Components";
2699
- import { Event, World, Disposable } from "../../Types";
2700
- import { Mouse } from "./mouse";
2701
2666
  /**
2702
- * 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.
2667
+ * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2703
2668
  */
2704
- export declare class SimpleRaycaster implements Disposable {
2705
- /** {@link Component.enabled} */
2706
- enabled: boolean;
2707
- /** The components instance to which this Raycaster belongs. */
2708
- components: Components;
2709
- /** {@link Disposable.onDisposed} */
2710
- readonly onDisposed: Event<unknown>;
2711
- /** The position of the mouse in the screen. */
2712
- readonly mouse: Mouse;
2713
- /**
2714
- * A reference to the Three.js Raycaster instance.
2715
- * This is used for raycasting operations.
2716
- */
2717
- readonly three: THREE.Raycaster;
2718
- /**
2719
- * A reference to the world instance to which this Raycaster belongs.
2720
- * This is used to access the camera and meshes.
2721
- */
2722
- world: World;
2723
- constructor(components: Components, world: World);
2724
- /** {@link Disposable.dispose} */
2725
- dispose(): void;
2669
+ export interface SimpleSceneConfig {
2670
+ directionalLight: {
2671
+ color: THREE.Color;
2672
+ intensity: number;
2673
+ position: THREE.Vector3;
2674
+ };
2675
+ ambientLight: {
2676
+ color: THREE.Color;
2677
+ intensity: number;
2678
+ };
2679
+ }
2680
+ /**
2681
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
2682
+ */
2683
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2684
+ /** {@link Configurable.isSetup} */
2685
+ isSetup: boolean;
2726
2686
  /**
2727
- * Throws a ray from the camera to the mouse or touch event point and returns
2728
- * the first item found. This also takes into account the clipping planes
2729
- * used by the renderer.
2730
- *
2731
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2732
- * to query. If not provided, it will query all the meshes stored in
2733
- * {@link Components.meshes}.
2687
+ * The underlying Three.js scene object.
2688
+ * It is used to define the 3D space containing objects, lights, and cameras.
2734
2689
  */
2735
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2690
+ three: THREE.Scene;
2691
+ /** {@link Configurable.onSetup} */
2692
+ readonly onSetup: Event<SimpleScene>;
2736
2693
  /**
2737
- * Casts a ray from a given origin in a given direction and returns the first item found.
2738
- * This method also takes into account the clipping planes used by the renderer.
2739
- *
2740
- * @param origin - The origin of the ray.
2741
- * @param direction - The direction of the ray.
2742
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2743
- * @returns The first intersection found or 'null' if no intersection was found.
2694
+ * Configuration interface for the {@link SimpleScene}.
2695
+ * Defines properties for directional and ambient lights.
2744
2696
  */
2745
- 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;
2746
- private intersect;
2747
- private filterClippingPlanes;
2697
+ config: Required<SimpleSceneConfig>;
2698
+ constructor(components: Components);
2699
+ /** {@link Configurable.setup} */
2700
+ setup(config?: Partial<SimpleSceneConfig>): void;
2748
2701
  }
2749
2702
  import * as THREE from "three";
2750
2703
  import { BaseRenderer, Event } from "../../Types";
@@ -2801,43 +2754,95 @@ export declare class SimpleRenderer extends BaseRenderer {
2801
2754
  private onContextBack;
2802
2755
  }
2803
2756
  import * as THREE from "three";
2804
- import { BaseScene, Configurable, Event } from "../../Types";
2805
2757
  import { Components } from "../../Components";
2758
+ import { AsyncEvent, Event, World } from "../../Types";
2806
2759
  /**
2807
- * Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
2808
- */
2809
- export interface SimpleSceneConfig {
2810
- directionalLight: {
2811
- color: THREE.Color;
2812
- intensity: number;
2813
- position: THREE.Vector3;
2814
- };
2815
- ambientLight: {
2816
- color: THREE.Color;
2817
- intensity: number;
2818
- };
2819
- }
2820
- /**
2821
- * 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.
2760
+ * Settings to configure the CullerRenderer.
2822
2761
  */
2823
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
2824
- /** {@link Configurable.isSetup} */
2825
- isSetup: boolean;
2762
+ export interface CullerRendererSettings {
2826
2763
  /**
2827
- * The underlying Three.js scene object.
2828
- * It is used to define the 3D space containing objects, lights, and cameras.
2764
+ * Interval in milliseconds at which the visibility check should be performed.
2765
+ * Default value is 1000.
2829
2766
  */
2830
- three: THREE.Scene;
2831
- /** {@link Configurable.onSetup} */
2832
- readonly onSetup: Event<SimpleScene>;
2767
+ updateInterval?: number;
2833
2768
  /**
2834
- * Configuration interface for the {@link SimpleScene}.
2835
- * Defines properties for directional and ambient lights.
2769
+ * Width of the render target used for visibility checks.
2770
+ * Default value is 512.
2836
2771
  */
2837
- config: Required<SimpleSceneConfig>;
2838
- constructor(components: Components);
2839
- /** {@link Configurable.setup} */
2840
- setup(config?: Partial<SimpleSceneConfig>): void;
2772
+ width?: number;
2773
+ /**
2774
+ * Height of the render target used for visibility checks.
2775
+ * Default value is 512.
2776
+ */
2777
+ height?: number;
2778
+ /**
2779
+ * Whether the visibility check should be performed automatically.
2780
+ * Default value is true.
2781
+ */
2782
+ autoUpdate?: boolean;
2783
+ }
2784
+ /**
2785
+ * A base renderer to determine visibility on screen.
2786
+ */
2787
+ export declare class CullerRenderer {
2788
+ /** {@link Disposable.onDisposed} */
2789
+ readonly onDisposed: Event<string>;
2790
+ /**
2791
+ * Fires after making the visibility check to the meshes. It lists the
2792
+ * meshes that are currently visible, and the ones that were visible
2793
+ * just before but not anymore.
2794
+ */
2795
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
2796
+ /**
2797
+ * Whether this renderer is active or not. If not, it won't render anything.
2798
+ */
2799
+ enabled: boolean;
2800
+ /**
2801
+ * Needs to check whether there are objects that need to be hidden or shown.
2802
+ * You can bind this to the camera movement, to a certain interval, etc.
2803
+ */
2804
+ needsUpdate: boolean;
2805
+ /**
2806
+ * Render the internal scene used to determine the object visibility. Used
2807
+ * for debugging purposes.
2808
+ */
2809
+ renderDebugFrame: boolean;
2810
+ /** The components instance to which this renderer belongs. */
2811
+ components: Components;
2812
+ /** The world instance to which this renderer belongs. */
2813
+ readonly world: World;
2814
+ /** The THREE.js renderer used to make the visibility test. */
2815
+ readonly renderer: THREE.WebGLRenderer;
2816
+ protected autoUpdate: boolean;
2817
+ protected updateInterval: number;
2818
+ protected readonly worker: Worker;
2819
+ protected readonly scene: THREE.Scene;
2820
+ private _width;
2821
+ private _height;
2822
+ private _availableColor;
2823
+ private readonly renderTarget;
2824
+ private readonly bufferSize;
2825
+ private readonly _buffer;
2826
+ protected _isWorkerBusy: boolean;
2827
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
2828
+ /** {@link Disposable.dispose} */
2829
+ dispose(): void;
2830
+ /**
2831
+ * The function that the culler uses to reprocess the scene. Generally it's
2832
+ * better to call needsUpdate, but you can also call this to force it.
2833
+ * @param force if true, it will refresh the scene even if needsUpdate is
2834
+ * not true.
2835
+ */
2836
+ updateVisibility: (force?: boolean) => Promise<void>;
2837
+ protected getAvailableColor(): {
2838
+ r: number;
2839
+ g: number;
2840
+ b: number;
2841
+ code: string;
2842
+ };
2843
+ protected increaseColor(): void;
2844
+ protected decreaseColor(): void;
2845
+ private applySettings;
2841
2846
  }
2842
2847
  import * as THREE from "three";
2843
2848
  import CameraControls from "camera-controls";
@@ -2902,66 +2907,6 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
2902
2907
  private static getSubsetOfThree;
2903
2908
  }
2904
2909
  import * as THREE from "three";
2905
- import { Hideable, Event, World, Disposable } from "../../Types";
2906
- import { Components } from "../../Components";
2907
- /**
2908
- * Configuration interface for the {@link SimpleGrid} class.
2909
- */
2910
- export interface GridConfig {
2911
- /**
2912
- * The color of the grid lines.
2913
- */
2914
- color: THREE.Color;
2915
- /**
2916
- * The size of the primary grid lines.
2917
- */
2918
- size1: number;
2919
- /**
2920
- * The size of the secondary grid lines.
2921
- */
2922
- size2: number;
2923
- /**
2924
- * The distance at which the grid lines start to fade away.
2925
- */
2926
- distance: number;
2927
- }
2928
- /**
2929
- * 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).
2930
- */
2931
- export declare class SimpleGrid implements Hideable, Disposable {
2932
- /** {@link Disposable.onDisposed} */
2933
- readonly onDisposed: Event<unknown>;
2934
- /** The world instance to which this Raycaster belongs. */
2935
- world: World;
2936
- /** The components instance to which this grid belongs. */
2937
- components: Components;
2938
- /** {@link Hideable.visible} */
2939
- get visible(): boolean;
2940
- /** {@link Hideable.visible} */
2941
- set visible(visible: boolean);
2942
- /** The material of the grid. */
2943
- get material(): THREE.ShaderMaterial;
2944
- /**
2945
- * Whether the grid should fade away with distance. Recommended to be true for
2946
- * perspective cameras and false for orthographic cameras.
2947
- */
2948
- get fade(): boolean;
2949
- /**
2950
- * Whether the grid should fade away with distance. Recommended to be true for
2951
- * perspective cameras and false for orthographic cameras.
2952
- */
2953
- set fade(active: boolean);
2954
- /** The Three.js mesh that contains the infinite grid. */
2955
- readonly three: THREE.Mesh;
2956
- private _fade;
2957
- constructor(components: Components, world: World, config: GridConfig);
2958
- /** {@link Disposable.dispose} */
2959
- dispose(): void;
2960
- private setupEvents;
2961
- private updateZoom;
2962
- }
2963
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2964
- import * as THREE from "three";
2965
2910
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
2966
2911
  import { Components } from "../../Components";
2967
2912
  import { Event, World, Disposable } from "../../Types";
@@ -3017,187 +2962,263 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
3017
2962
  private handleWorkerMessage;
3018
2963
  private getAvailableMaterial;
3019
2964
  }
2965
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
3020
2966
  import * as THREE from "three";
3021
- import * as WEBIFC from "web-ifc";
3022
- import * as FRAGS from "@thatopen/fragments";
3023
- export declare class CivilReader {
3024
- defLineMat: THREE.LineBasicMaterial;
3025
- read(webIfc: WEBIFC.IfcAPI): {
3026
- alignments: Map<number, FRAGS.Alignment>;
3027
- coordinationMatrix: THREE.Matrix4;
3028
- } | undefined;
3029
- get(civilItems: any): {
3030
- alignments: Map<number, FRAGS.Alignment>;
3031
- coordinationMatrix: THREE.Matrix4;
3032
- } | undefined;
3033
- private getCurves;
3034
- }
3035
- import * as THREE from "three";
2967
+ import { Hideable, Event, World, Disposable } from "../../Types";
3036
2968
  import { Components } from "../../Components";
3037
- import { AsyncEvent, Event, World } from "../../Types";
3038
2969
  /**
3039
- * Settings to configure the CullerRenderer.
2970
+ * Configuration interface for the {@link SimpleGrid} class.
3040
2971
  */
3041
- export interface CullerRendererSettings {
2972
+ export interface GridConfig {
3042
2973
  /**
3043
- * Interval in milliseconds at which the visibility check should be performed.
3044
- * Default value is 1000.
2974
+ * The color of the grid lines.
3045
2975
  */
3046
- updateInterval?: number;
2976
+ color: THREE.Color;
3047
2977
  /**
3048
- * Width of the render target used for visibility checks.
3049
- * Default value is 512.
2978
+ * The size of the primary grid lines.
3050
2979
  */
3051
- width?: number;
2980
+ size1: number;
3052
2981
  /**
3053
- * Height of the render target used for visibility checks.
3054
- * Default value is 512.
2982
+ * The size of the secondary grid lines.
3055
2983
  */
3056
- height?: number;
2984
+ size2: number;
3057
2985
  /**
3058
- * Whether the visibility check should be performed automatically.
3059
- * Default value is true.
2986
+ * The distance at which the grid lines start to fade away.
3060
2987
  */
3061
- autoUpdate?: boolean;
2988
+ distance: number;
3062
2989
  }
3063
2990
  /**
3064
- * A base renderer to determine visibility on screen.
2991
+ * 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).
3065
2992
  */
3066
- export declare class CullerRenderer {
2993
+ export declare class SimpleGrid implements Hideable, Disposable {
3067
2994
  /** {@link Disposable.onDisposed} */
3068
- readonly onDisposed: Event<string>;
2995
+ readonly onDisposed: Event<unknown>;
2996
+ /** The world instance to which this Raycaster belongs. */
2997
+ world: World;
2998
+ /** The components instance to which this grid belongs. */
2999
+ components: Components;
3000
+ /** {@link Hideable.visible} */
3001
+ get visible(): boolean;
3002
+ /** {@link Hideable.visible} */
3003
+ set visible(visible: boolean);
3004
+ /** The material of the grid. */
3005
+ get material(): THREE.ShaderMaterial;
3069
3006
  /**
3070
- * Fires after making the visibility check to the meshes. It lists the
3071
- * meshes that are currently visible, and the ones that were visible
3072
- * just before but not anymore.
3007
+ * Whether the grid should fade away with distance. Recommended to be true for
3008
+ * perspective cameras and false for orthographic cameras.
3073
3009
  */
3074
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
3010
+ get fade(): boolean;
3075
3011
  /**
3076
- * Whether this renderer is active or not. If not, it won't render anything.
3012
+ * Whether the grid should fade away with distance. Recommended to be true for
3013
+ * perspective cameras and false for orthographic cameras.
3014
+ */
3015
+ set fade(active: boolean);
3016
+ /** The Three.js mesh that contains the infinite grid. */
3017
+ readonly three: THREE.Mesh;
3018
+ private _fade;
3019
+ constructor(components: Components, world: World, config: GridConfig);
3020
+ /** {@link Disposable.dispose} */
3021
+ dispose(): void;
3022
+ private setupEvents;
3023
+ private updateZoom;
3024
+ }
3025
+ import * as THREE from "three";
3026
+ import { Disposable, Event } from "../../Types";
3027
+ /**
3028
+ * 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.
3029
+ */
3030
+ export declare class Mouse implements Disposable {
3031
+ dom: HTMLCanvasElement;
3032
+ private _event?;
3033
+ private _position;
3034
+ /** {@link Disposable.onDisposed} */
3035
+ readonly onDisposed: Event<unknown>;
3036
+ constructor(dom: HTMLCanvasElement);
3037
+ /**
3038
+ * The real position of the mouse of the Three.js canvas.
3077
3039
  */
3040
+ get position(): THREE.Vector2;
3041
+ /** {@link Disposable.dispose} */
3042
+ dispose(): void;
3043
+ private getPositionY;
3044
+ private getPositionX;
3045
+ private updateMouseInfo;
3046
+ private setupEvents;
3047
+ }
3048
+ import { NavigationMode } from "./types";
3049
+ import { OrthoPerspectiveCamera } from "../index";
3050
+ /**
3051
+ * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
3052
+ */
3053
+ export declare class FirstPersonMode implements NavigationMode {
3054
+ private camera;
3055
+ /** {@link NavigationMode.enabled} */
3056
+ enabled: boolean;
3057
+ /** {@link NavigationMode.id} */
3058
+ readonly id = "FirstPerson";
3059
+ constructor(camera: OrthoPerspectiveCamera);
3060
+ /** {@link NavigationMode.set} */
3061
+ set(active: boolean): void;
3062
+ private setupFirstPersonCamera;
3063
+ }
3064
+ import * as THREE from "three";
3065
+ import { Components } from "../../Components";
3066
+ import { Event, World, Disposable } from "../../Types";
3067
+ import { Mouse } from "./mouse";
3068
+ /**
3069
+ * 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.
3070
+ */
3071
+ export declare class SimpleRaycaster implements Disposable {
3072
+ /** {@link Component.enabled} */
3078
3073
  enabled: boolean;
3074
+ /** The components instance to which this Raycaster belongs. */
3075
+ components: Components;
3076
+ /** {@link Disposable.onDisposed} */
3077
+ readonly onDisposed: Event<unknown>;
3078
+ /** The position of the mouse in the screen. */
3079
+ readonly mouse: Mouse;
3079
3080
  /**
3080
- * Needs to check whether there are objects that need to be hidden or shown.
3081
- * You can bind this to the camera movement, to a certain interval, etc.
3081
+ * A reference to the Three.js Raycaster instance.
3082
+ * This is used for raycasting operations.
3082
3083
  */
3083
- needsUpdate: boolean;
3084
+ readonly three: THREE.Raycaster;
3084
3085
  /**
3085
- * Render the internal scene used to determine the object visibility. Used
3086
- * for debugging purposes.
3086
+ * A reference to the world instance to which this Raycaster belongs.
3087
+ * This is used to access the camera and meshes.
3087
3088
  */
3088
- renderDebugFrame: boolean;
3089
- /** The components instance to which this renderer belongs. */
3090
- components: Components;
3091
- /** The world instance to which this renderer belongs. */
3092
- readonly world: World;
3093
- /** The THREE.js renderer used to make the visibility test. */
3094
- readonly renderer: THREE.WebGLRenderer;
3095
- protected autoUpdate: boolean;
3096
- protected updateInterval: number;
3097
- protected readonly worker: Worker;
3098
- protected readonly scene: THREE.Scene;
3099
- private _width;
3100
- private _height;
3101
- private _availableColor;
3102
- private readonly renderTarget;
3103
- private readonly bufferSize;
3104
- private readonly _buffer;
3105
- protected _isWorkerBusy: boolean;
3106
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
3089
+ world: World;
3090
+ constructor(components: Components, world: World);
3107
3091
  /** {@link Disposable.dispose} */
3108
3092
  dispose(): void;
3109
3093
  /**
3110
- * The function that the culler uses to reprocess the scene. Generally it's
3111
- * better to call needsUpdate, but you can also call this to force it.
3112
- * @param force if true, it will refresh the scene even if needsUpdate is
3113
- * not true.
3094
+ * Throws a ray from the camera to the mouse or touch event point and returns
3095
+ * the first item found. This also takes into account the clipping planes
3096
+ * used by the renderer.
3097
+ *
3098
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
3099
+ * to query. If not provided, it will query all the meshes stored in
3100
+ * {@link Components.meshes}.
3114
3101
  */
3115
- updateVisibility: (force?: boolean) => Promise<void>;
3116
- protected getAvailableColor(): {
3117
- r: number;
3118
- g: number;
3119
- b: number;
3120
- code: string;
3121
- };
3122
- protected increaseColor(): void;
3123
- protected decreaseColor(): void;
3124
- private applySettings;
3102
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
3103
+ /**
3104
+ * Casts a ray from a given origin in a given direction and returns the first item found.
3105
+ * This method also takes into account the clipping planes used by the renderer.
3106
+ *
3107
+ * @param origin - The origin of the ray.
3108
+ * @param direction - The direction of the ray.
3109
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3110
+ * @returns The first intersection found or 'null' if no intersection was found.
3111
+ */
3112
+ 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;
3113
+ private intersect;
3114
+ private filterClippingPlanes;
3125
3115
  }
3126
- import * as WEBIFC from "web-ifc";
3127
- import * as THREE from "three";
3128
- export declare class Units {
3129
- factor: number;
3130
- complement: number;
3131
- apply(matrix: THREE.Matrix4): void;
3132
- setUp(webIfc: WEBIFC.IfcAPI): void;
3133
- private getLengthUnits;
3134
- private getScaleMatrix;
3116
+ import { NavigationMode } from "./types";
3117
+ import { OrthoPerspectiveCamera } from "../index";
3118
+ /**
3119
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3120
+ */
3121
+ export declare class PlanMode implements NavigationMode {
3122
+ private camera;
3123
+ /** {@link NavigationMode.enabled} */
3124
+ enabled: boolean;
3125
+ /** {@link NavigationMode.id} */
3126
+ readonly id = "Plan";
3127
+ private mouseAction1?;
3128
+ private mouseAction2?;
3129
+ private mouseInitialized;
3130
+ private readonly defaultAzimuthSpeed;
3131
+ private readonly defaultPolarSpeed;
3132
+ constructor(camera: OrthoPerspectiveCamera);
3133
+ /** {@link NavigationMode.set} */
3134
+ set(active: boolean): void;
3135
3135
  }
3136
- import { IfcFragmentSettings } from "../../IfcLoader/src";
3136
+ import { NavigationMode } from "./types";
3137
+ import { OrthoPerspectiveCamera } from "../index";
3137
3138
  /**
3138
- * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
3139
+ * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
3139
3140
  */
3140
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
3141
+ export declare class OrbitMode implements NavigationMode {
3142
+ camera: OrthoPerspectiveCamera;
3143
+ /** {@link NavigationMode.enabled} */
3144
+ enabled: boolean;
3145
+ /** {@link NavigationMode.id} */
3146
+ readonly id = "Orbit";
3147
+ constructor(camera: OrthoPerspectiveCamera);
3148
+ /** {@link NavigationMode.set} */
3149
+ set(active: boolean): void;
3150
+ private activateOrbitControls;
3151
+ }
3152
+ import * as THREE from "three";
3153
+ import { CameraProjection } from "./types";
3154
+ import { Event } from "../../Types";
3155
+ import { OrthoPerspectiveCamera } from "../index";
3156
+ /**
3157
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3158
+ */
3159
+ export declare class ProjectionManager {
3160
+ /**
3161
+ * Event that fires when the {@link CameraProjection} changes.
3162
+ */
3163
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
3164
+ /**
3165
+ * Current projection mode of the camera.
3166
+ * Default is "Perspective".
3167
+ */
3168
+ current: CameraProjection;
3169
+ /**
3170
+ * The camera controlled by this ProjectionManager.
3171
+ * It can be either a PerspectiveCamera or an OrthographicCamera.
3172
+ */
3173
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3174
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
3175
+ matchOrthoDistanceEnabled: boolean;
3176
+ private _component;
3177
+ private _previousDistance;
3178
+ constructor(camera: OrthoPerspectiveCamera);
3141
3179
  /**
3142
- * Minimum number of geometries to be streamed.
3143
- * Defaults to 10 geometries.
3180
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3181
+ *
3182
+ * @param projection - the new projection to set. If it is the current projection,
3183
+ * it will have no effect.
3144
3184
  */
3145
- minGeometrySize: number;
3185
+ set(projection: CameraProjection): Promise<void>;
3146
3186
  /**
3147
- * Minimum amount of assets to be streamed.
3148
- * Defaults to 1000 assets.
3187
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
3188
+ * and vice versa.
3149
3189
  */
3150
- minAssetsSize: number;
3151
- }
3152
- import * as WEBIFC from "web-ifc";
3153
- export declare class IfcMetadataReader {
3154
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3155
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3190
+ toggle(): Promise<void>;
3191
+ private setOrthoCamera;
3192
+ private getPerspectiveDims;
3193
+ private setupOrthoCamera;
3194
+ private getDistance;
3195
+ private setPerspectiveCamera;
3156
3196
  }
3157
3197
  /**
3158
- * 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.
3198
+ * The projection system of the camera.
3159
3199
  */
3160
- export interface StreamedGeometries {
3161
- [id: number]: {
3162
- /** The bounding box of the geometry as a Float32Array. */
3163
- boundingBox: Float32Array;
3164
- /** A boolean indicating whether the geometry has holes. */
3165
- hasHoles: boolean;
3166
- /** An optional file path for the geometry data. */
3167
- geometryFile?: string;
3168
- };
3169
- }
3200
+ export type CameraProjection = "Perspective" | "Orthographic";
3170
3201
  /**
3171
- * 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.
3202
+ * The extensible list of supported navigation modes.
3172
3203
  */
3173
- export interface StreamedAsset {
3174
- /** The unique identifier of the asset. */
3175
- id: number;
3176
- /** An array of geometries associated with the asset. */
3177
- geometries: {
3178
- /** The unique identifier of the geometry. */
3179
- geometryID: number;
3180
- /** The transformation matrix of the geometry as a number array. */
3181
- transformation: number[];
3182
- /** The color of the geometry as a number array. */
3183
- color: number[];
3184
- }[];
3185
- }
3186
- import { NavigationMode } from "./types";
3187
- import { OrthoPerspectiveCamera } from "../index";
3204
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3188
3205
  /**
3189
- * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
3206
+ * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3190
3207
  */
3191
- export declare class FirstPersonMode implements NavigationMode {
3192
- private camera;
3193
- /** {@link NavigationMode.enabled} */
3208
+ export interface NavigationMode {
3209
+ /** The unique ID of this navigation mode. */
3210
+ id: NavModeID;
3211
+ /**
3212
+ * Enable or disable this navigation mode.
3213
+ * When a new navigation mode is enabled, the previous navigation mode
3214
+ * must be disabled.
3215
+ *
3216
+ * @param active - whether to enable or disable this mode.
3217
+ * @param options - any additional data required to enable or disable it.
3218
+ * */
3219
+ set: (active: boolean, options?: any) => void;
3220
+ /** Whether this navigation mode is active or not. */
3194
3221
  enabled: boolean;
3195
- /** {@link NavigationMode.id} */
3196
- readonly id = "FirstPerson";
3197
- constructor(camera: OrthoPerspectiveCamera);
3198
- /** {@link NavigationMode.set} */
3199
- set(active: boolean): void;
3200
- private setupFirstPersonCamera;
3201
3222
  }
3202
3223
  import * as THREE from "three";
3203
3224
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -3296,112 +3317,96 @@ export declare class SimplePlane implements Disposable, Hideable {
3296
3317
  private newHelper;
3297
3318
  private static newPlaneMesh;
3298
3319
  }
3299
- import { NavigationMode } from "./types";
3300
- import { OrthoPerspectiveCamera } from "../index";
3320
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3301
3321
  /**
3302
- * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
3322
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
3303
3323
  */
3304
- export declare class OrbitMode implements NavigationMode {
3305
- camera: OrthoPerspectiveCamera;
3306
- /** {@link NavigationMode.enabled} */
3307
- enabled: boolean;
3308
- /** {@link NavigationMode.id} */
3309
- readonly id = "Orbit";
3310
- constructor(camera: OrthoPerspectiveCamera);
3311
- /** {@link NavigationMode.set} */
3312
- set(active: boolean): void;
3313
- private activateOrbitControls;
3324
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
3325
+ /**
3326
+ * Amount of properties to be streamed.
3327
+ * Defaults to 100 properties.
3328
+ */
3329
+ propertiesSize: number;
3314
3330
  }
3315
3331
  import * as THREE from "three";
3316
- import { CameraProjection } from "./types";
3317
- import { Event } from "../../Types";
3318
- import { OrthoPerspectiveCamera } from "../index";
3332
+ import * as WEBIFC from "web-ifc";
3333
+ import * as FRAGS from "@thatopen/fragments";
3334
+ export declare class CivilReader {
3335
+ defLineMat: THREE.LineBasicMaterial;
3336
+ read(webIfc: WEBIFC.IfcAPI): {
3337
+ alignments: Map<number, FRAGS.Alignment>;
3338
+ coordinationMatrix: THREE.Matrix4;
3339
+ } | undefined;
3340
+ get(civilItems: any): {
3341
+ alignments: Map<number, FRAGS.Alignment>;
3342
+ coordinationMatrix: THREE.Matrix4;
3343
+ } | undefined;
3344
+ private getCurves;
3345
+ }
3346
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
3319
3347
  /**
3320
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3348
+ * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
3321
3349
  */
3322
- export declare class ProjectionManager {
3323
- /**
3324
- * Event that fires when the {@link CameraProjection} changes.
3325
- */
3326
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
3327
- /**
3328
- * Current projection mode of the camera.
3329
- * Default is "Perspective".
3330
- */
3331
- current: CameraProjection;
3332
- /**
3333
- * The camera controlled by this ProjectionManager.
3334
- * It can be either a PerspectiveCamera or an OrthographicCamera.
3335
- */
3336
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3337
- /** Match Ortho zoom with Perspective distance when changing projection mode */
3338
- matchOrthoDistanceEnabled: boolean;
3339
- private _component;
3340
- private _previousDistance;
3341
- constructor(camera: OrthoPerspectiveCamera);
3350
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
3342
3351
  /**
3343
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3344
- *
3345
- * @param projection - the new projection to set. If it is the current projection,
3346
- * it will have no effect.
3352
+ * Minimum number of geometries to be streamed.
3353
+ * Defaults to 10 geometries.
3347
3354
  */
3348
- set(projection: CameraProjection): Promise<void>;
3355
+ minGeometrySize: number;
3349
3356
  /**
3350
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
3351
- * and vice versa.
3357
+ * Minimum amount of assets to be streamed.
3358
+ * Defaults to 1000 assets.
3352
3359
  */
3353
- toggle(): Promise<void>;
3354
- private setOrthoCamera;
3355
- private getPerspectiveDims;
3356
- private setupOrthoCamera;
3357
- private getDistance;
3358
- private setPerspectiveCamera;
3360
+ minAssetsSize: number;
3359
3361
  }
3360
- import { NavigationMode } from "./types";
3361
- import { OrthoPerspectiveCamera } from "../index";
3362
- /**
3363
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3364
- */
3365
- export declare class PlanMode implements NavigationMode {
3366
- private camera;
3367
- /** {@link NavigationMode.enabled} */
3368
- enabled: boolean;
3369
- /** {@link NavigationMode.id} */
3370
- readonly id = "Plan";
3371
- private mouseAction1?;
3372
- private mouseAction2?;
3373
- private mouseInitialized;
3374
- private readonly defaultAzimuthSpeed;
3375
- private readonly defaultPolarSpeed;
3376
- constructor(camera: OrthoPerspectiveCamera);
3377
- /** {@link NavigationMode.set} */
3378
- set(active: boolean): void;
3362
+ import * as WEBIFC from "web-ifc";
3363
+ export declare class IfcMetadataReader {
3364
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3365
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
3366
+ }
3367
+ import * as WEBIFC from "web-ifc";
3368
+ import * as THREE from "three";
3369
+ export declare class Units {
3370
+ factor: number;
3371
+ complement: number;
3372
+ apply(matrix: THREE.Matrix4): void;
3373
+ setUp(webIfc: WEBIFC.IfcAPI): void;
3374
+ private getLengthUnits;
3375
+ private getScaleMatrix;
3379
3376
  }
3380
3377
  /**
3381
- * The projection system of the camera.
3382
- */
3383
- export type CameraProjection = "Perspective" | "Orthographic";
3384
- /**
3385
- * The extensible list of supported navigation modes.
3378
+ * 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.
3386
3379
  */
3387
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3380
+ export interface StreamedGeometries {
3381
+ [id: number]: {
3382
+ /** The bounding box of the geometry as a Float32Array. */
3383
+ boundingBox: Float32Array;
3384
+ /** A boolean indicating whether the geometry has holes. */
3385
+ hasHoles: boolean;
3386
+ /** An optional file path for the geometry data. */
3387
+ geometryFile?: string;
3388
+ };
3389
+ }
3388
3390
  /**
3389
- * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3391
+ * 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.
3390
3392
  */
3391
- export interface NavigationMode {
3392
- /** The unique ID of this navigation mode. */
3393
- id: NavModeID;
3394
- /**
3395
- * Enable or disable this navigation mode.
3396
- * When a new navigation mode is enabled, the previous navigation mode
3397
- * must be disabled.
3398
- *
3399
- * @param active - whether to enable or disable this mode.
3400
- * @param options - any additional data required to enable or disable it.
3401
- * */
3402
- set: (active: boolean, options?: any) => void;
3403
- /** Whether this navigation mode is active or not. */
3404
- enabled: boolean;
3393
+ export interface StreamedAsset {
3394
+ /** The unique identifier of the asset. */
3395
+ id: number;
3396
+ /** An array of geometries associated with the asset. */
3397
+ geometries: {
3398
+ /** The unique identifier of the geometry. */
3399
+ geometryID: number;
3400
+ /** The transformation matrix of the geometry as a number array. */
3401
+ transformation: number[];
3402
+ /** The color of the geometry as a number array. */
3403
+ color: number[];
3404
+ }[];
3405
+ }
3406
+ import { BufferGeometry } from "three";
3407
+ import * as THREE from "three";
3408
+ export declare class TransformHelper {
3409
+ getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
3405
3410
  }
3406
3411
  export type RelationsMap = Map<number, Map<number, number[]>>;
3407
3412
  export interface ModelsRelationMap {
@@ -3427,10 +3432,5 @@ export type InverseAttributes = [
3427
3432
  "ContainsElements"
3428
3433
  ];
3429
3434
  export type InverseAttribute = InverseAttributes[number];
3430
- import { BufferGeometry } from "three";
3431
- import * as THREE from "three";
3432
- export declare class TransformHelper {
3433
- getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
3434
- }
3435
3435
 
3436
3436
  }