@thatopen/components 2.3.12 → 2.3.14

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,4 +1,97 @@
1
1
  declare namespace OBC {
2
+ import { Component, Disposable, Event } from "../Types";
3
+ /**
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.
5
+ */
6
+ export declare class Components implements Disposable {
7
+ /**
8
+ * The version of the @thatopen/components library.
9
+ */
10
+ static readonly release = "2.3.14";
11
+ /** {@link Disposable.onDisposed} */
12
+ readonly onDisposed: Event<void>;
13
+ /**
14
+ * The list of components created in this app.
15
+ * The keys are UUIDs and the values are instances of the components.
16
+ */
17
+ readonly list: Map<string, Component>;
18
+ /**
19
+ * If disabled, the animation loop will be stopped.
20
+ * Default value is false.
21
+ */
22
+ enabled: boolean;
23
+ private _clock;
24
+ /**
25
+ * Event that triggers the Components instance is initialized.
26
+ *
27
+ * @remarks
28
+ * This event is triggered once when the {@link Components.init} method has been called and finish processing.
29
+ * This is useful to set configuration placeholders that need to be executed when the components instance is initialized.
30
+ * For example, enabling and configuring custom effects in a post-production renderer.
31
+ *
32
+ * @example
33
+ * '''typescript
34
+ * const components = new Components();
35
+ * components.onInit.add(() => {
36
+ * // Enable custom effects in the post-production renderer
37
+ * // or any other operation dependant on the component initialization
38
+ * });
39
+ * components.init();
40
+ * '''
41
+ */
42
+ readonly onInit: Event<undefined>;
43
+ /**
44
+ * Adds a component to the list of components.
45
+ * Throws an error if a component with the same UUID already exists.
46
+ *
47
+ * @param uuid - The unique identifier of the component.
48
+ * @param instance - The instance of the component to be added.
49
+ *
50
+ * @throws Will throw an error if a component with the same UUID already exists.
51
+ *
52
+ * @internal
53
+ */
54
+ add(uuid: string, instance: Component): void;
55
+ /**
56
+ * Retrieves a component instance by its constructor function.
57
+ * If the component does not exist in the list, it will be created and added.
58
+ *
59
+ * @template U - The type of the component to retrieve.
60
+ * @param Component - The constructor function of the component to retrieve.
61
+ *
62
+ * @returns The instance of the requested component.
63
+ *
64
+ * @throws Will throw an error if a component with the same UUID already exists.
65
+ *
66
+ * @internal
67
+ */
68
+ get<U extends Component>(Component: new (components: Components) => U): U;
69
+ constructor();
70
+ /**
71
+ * Initializes the Components instance.
72
+ * This method starts the animation loop, sets the enabled flag to true,
73
+ * and calls the update method.
74
+ */
75
+ init(): void;
76
+ /**
77
+ * Disposes the memory of all the components and tools of this instance of
78
+ * the library. A memory leak will be created if:
79
+ *
80
+ * - An instance of the library ends up out of scope and this function isn't
81
+ * called. This is especially relevant in Single Page Applications (React,
82
+ * Angular, Vue, etc).
83
+ *
84
+ * - Any of the objects of this instance (meshes, geometries,materials, etc) is
85
+ * referenced by a reference type (object or array).
86
+ *
87
+ * You can learn more about how Three.js handles memory leaks
88
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
89
+ *
90
+ */
91
+ dispose(): void;
92
+ private update;
93
+ private static setupBVH;
94
+ }
2
95
  import * as THREE from "three";
3
96
  import { Components } from "../Components";
4
97
  import { Component } from "../Types";
@@ -44,6 +137,48 @@ export declare class Disposer extends Component {
44
137
  private disposeChildren;
45
138
  private static disposeMaterial;
46
139
  }
140
+ import { Component, Disposable, World, Event } from "../Types";
141
+ import { SimpleRaycaster } from "./src";
142
+ import { Components } from "../Components";
143
+ /**
144
+ * 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).
145
+ */
146
+ export declare class Raycasters extends Component implements Disposable {
147
+ /**
148
+ * A unique identifier for the component.
149
+ * This UUID is used to register the component within the Components system.
150
+ */
151
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
152
+ /** {@link Component.enabled} */
153
+ enabled: boolean;
154
+ /**
155
+ * A Map that stores raycasters for each world.
156
+ * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
157
+ */
158
+ list: Map<string, SimpleRaycaster>;
159
+ /** {@link Disposable.onDisposed} */
160
+ onDisposed: Event<unknown>;
161
+ constructor(components: Components);
162
+ /**
163
+ * Retrieves a SimpleRaycaster instance for the given world.
164
+ * If a SimpleRaycaster instance already exists for the world, it will be returned.
165
+ * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
166
+ *
167
+ * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
168
+ * @returns The SimpleRaycaster instance for the given world.
169
+ */
170
+ get(world: World): SimpleRaycaster;
171
+ /**
172
+ * Deletes the SimpleRaycaster instance associated with the given world.
173
+ * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
174
+ *
175
+ * @param world - The world for which to delete the SimpleRaycaster instance.
176
+ * @returns {void}
177
+ */
178
+ delete(world: World): void;
179
+ /** {@link Disposable.dispose} */
180
+ dispose(): void;
181
+ }
47
182
  import { SimpleScene, SimpleSceneConfig, SimpleSceneConfigManager } from "../Worlds";
48
183
  import { DistanceRenderer } from "./src";
49
184
  import { Configurable, Disposable } from "../Types";
@@ -147,207 +282,72 @@ export declare class Grids extends Component implements Disposable {
147
282
  /** {@link Disposable.dispose} */
148
283
  dispose(): void;
149
284
  }
150
- import { Component, Disposable, World, Event } from "../Types";
151
- import { SimpleRaycaster } from "./src";
285
+ import * as THREE from "three";
286
+ import { Component, Configurable, Createable, Disposable, Event, Hideable, World } from "../Types";
287
+ import { SimplePlane } from "./src";
152
288
  import { Components } from "../Components";
289
+ import { ClipperConfig, ClipperConfigManager } from "./src/clipper-config";
153
290
  /**
154
- * 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).
291
+ * 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).
292
+ *
293
+ * @param components - the instance of {@link Components} used.
294
+ * E.g. {@link SimplePlane}.
155
295
  */
156
- export declare class Raycasters extends Component implements Disposable {
296
+ export declare class Clipper extends Component implements Createable, Disposable, Hideable, Configurable<ClipperConfigManager, ClipperConfig> {
157
297
  /**
158
298
  * A unique identifier for the component.
159
299
  * This UUID is used to register the component within the Components system.
160
300
  */
161
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
162
- /** {@link Component.enabled} */
163
- enabled: boolean;
301
+ static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
302
+ /** {@link Configurable.onSetup} */
303
+ readonly onSetup: Event<unknown>;
304
+ /** Event that fires when the user starts dragging a clipping plane. */
305
+ readonly onBeforeDrag: Event<void>;
306
+ /** Event that fires when the user stops dragging a clipping plane. */
307
+ readonly onAfterDrag: Event<void>;
164
308
  /**
165
- * A Map that stores raycasters for each world.
166
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
309
+ * Event that fires when the user starts creating a clipping plane.
167
310
  */
168
- list: Map<string, SimpleRaycaster>;
169
- /** {@link Disposable.onDisposed} */
170
- onDisposed: Event<unknown>;
171
- constructor(components: Components);
311
+ readonly onBeforeCreate: Event<unknown>;
172
312
  /**
173
- * Retrieves a SimpleRaycaster instance for the given world.
174
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
175
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
176
- *
177
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
178
- * @returns The SimpleRaycaster instance for the given world.
313
+ * Event that fires when the user cancels the creation of a clipping plane.
179
314
  */
180
- get(world: World): SimpleRaycaster;
315
+ readonly onBeforeCancel: Event<unknown>;
181
316
  /**
182
- * Deletes the SimpleRaycaster instance associated with the given world.
183
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
184
- *
185
- * @param world - The world for which to delete the SimpleRaycaster instance.
186
- * @returns {void}
317
+ * Event that fires after the user cancels the creation of a clipping plane.
187
318
  */
188
- delete(world: World): void;
189
- /** {@link Disposable.dispose} */
190
- dispose(): void;
191
- }
192
- import { Component, Disposable, Event } from "../Types";
193
- /**
194
- * 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.
195
- */
196
- export declare class Components implements Disposable {
319
+ readonly onAfterCancel: Event<unknown>;
197
320
  /**
198
- * The version of the @thatopen/components library.
321
+ * Event that fires when the user starts deleting a clipping plane.
199
322
  */
200
- static readonly release = "2.3.12";
201
- /** {@link Disposable.onDisposed} */
202
- readonly onDisposed: Event<void>;
323
+ readonly onBeforeDelete: Event<unknown>;
203
324
  /**
204
- * The list of components created in this app.
205
- * The keys are UUIDs and the values are instances of the components.
325
+ * Event that fires after a clipping plane has been created.
326
+ * @param plane - The newly created clipping plane.
206
327
  */
207
- readonly list: Map<string, Component>;
328
+ readonly onAfterCreate: Event<SimplePlane>;
208
329
  /**
209
- * If disabled, the animation loop will be stopped.
210
- * Default value is false.
330
+ * Event that fires after a clipping plane has been deleted.
331
+ * @param plane - The deleted clipping plane.
211
332
  */
212
- enabled: boolean;
213
- private _clock;
333
+ readonly onAfterDelete: Event<SimplePlane>;
334
+ /** {@link Disposable.onDisposed} */
335
+ readonly onDisposed: Event<string>;
336
+ /** {@link Configurable.isSetup} */
337
+ isSetup: boolean;
214
338
  /**
215
- * Event that triggers the Components instance is initialized.
216
- *
217
- * @remarks
218
- * This event is triggered once when the {@link Components.init} method has been called and finish processing.
219
- * This is useful to set configuration placeholders that need to be executed when the components instance is initialized.
220
- * For example, enabling and configuring custom effects in a post-production renderer.
221
- *
222
- * @example
223
- * '''typescript
224
- * const components = new Components();
225
- * components.onInit.add(() => {
226
- * // Enable custom effects in the post-production renderer
227
- * // or any other operation dependant on the component initialization
228
- * });
229
- * components.init();
230
- * '''
339
+ * Whether to force the clipping plane to be orthogonal in the Y direction
340
+ * (up). This is desirable when clipping a building horizontally and a
341
+ * clipping plane is created in its roof, which might have a slight
342
+ * slope for draining purposes.
231
343
  */
232
- readonly onInit: Event<undefined>;
344
+ orthogonalY: boolean;
233
345
  /**
234
- * Adds a component to the list of components.
235
- * Throws an error if a component with the same UUID already exists.
236
- *
237
- * @param uuid - The unique identifier of the component.
238
- * @param instance - The instance of the component to be added.
239
- *
240
- * @throws Will throw an error if a component with the same UUID already exists.
241
- *
242
- * @internal
346
+ * The tolerance that determines whether an almost-horizontal clipping plane
347
+ * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
348
+ * has to be 'true' for this to apply.
243
349
  */
244
- add(uuid: string, instance: Component): void;
245
- /**
246
- * Retrieves a component instance by its constructor function.
247
- * If the component does not exist in the list, it will be created and added.
248
- *
249
- * @template U - The type of the component to retrieve.
250
- * @param Component - The constructor function of the component to retrieve.
251
- *
252
- * @returns The instance of the requested component.
253
- *
254
- * @throws Will throw an error if a component with the same UUID already exists.
255
- *
256
- * @internal
257
- */
258
- get<U extends Component>(Component: new (components: Components) => U): U;
259
- constructor();
260
- /**
261
- * Initializes the Components instance.
262
- * This method starts the animation loop, sets the enabled flag to true,
263
- * and calls the update method.
264
- */
265
- init(): void;
266
- /**
267
- * Disposes the memory of all the components and tools of this instance of
268
- * the library. A memory leak will be created if:
269
- *
270
- * - An instance of the library ends up out of scope and this function isn't
271
- * called. This is especially relevant in Single Page Applications (React,
272
- * Angular, Vue, etc).
273
- *
274
- * - Any of the objects of this instance (meshes, geometries,materials, etc) is
275
- * referenced by a reference type (object or array).
276
- *
277
- * You can learn more about how Three.js handles memory leaks
278
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
279
- *
280
- */
281
- dispose(): void;
282
- private update;
283
- private static setupBVH;
284
- }
285
- import * as THREE from "three";
286
- import { Component, Configurable, Createable, Disposable, Event, Hideable, World } from "../Types";
287
- import { SimplePlane } from "./src";
288
- import { Components } from "../Components";
289
- import { ClipperConfig, ClipperConfigManager } from "./src/clipper-config";
290
- /**
291
- * 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).
292
- *
293
- * @param components - the instance of {@link Components} used.
294
- * E.g. {@link SimplePlane}.
295
- */
296
- export declare class Clipper extends Component implements Createable, Disposable, Hideable, Configurable<ClipperConfigManager, ClipperConfig> {
297
- /**
298
- * A unique identifier for the component.
299
- * This UUID is used to register the component within the Components system.
300
- */
301
- static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
302
- /** {@link Configurable.onSetup} */
303
- readonly onSetup: Event<unknown>;
304
- /** Event that fires when the user starts dragging a clipping plane. */
305
- readonly onBeforeDrag: Event<void>;
306
- /** Event that fires when the user stops dragging a clipping plane. */
307
- readonly onAfterDrag: Event<void>;
308
- /**
309
- * Event that fires when the user starts creating a clipping plane.
310
- */
311
- readonly onBeforeCreate: Event<unknown>;
312
- /**
313
- * Event that fires when the user cancels the creation of a clipping plane.
314
- */
315
- readonly onBeforeCancel: Event<unknown>;
316
- /**
317
- * Event that fires after the user cancels the creation of a clipping plane.
318
- */
319
- readonly onAfterCancel: Event<unknown>;
320
- /**
321
- * Event that fires when the user starts deleting a clipping plane.
322
- */
323
- readonly onBeforeDelete: Event<unknown>;
324
- /**
325
- * Event that fires after a clipping plane has been created.
326
- * @param plane - The newly created clipping plane.
327
- */
328
- readonly onAfterCreate: Event<SimplePlane>;
329
- /**
330
- * Event that fires after a clipping plane has been deleted.
331
- * @param plane - The deleted clipping plane.
332
- */
333
- readonly onAfterDelete: Event<SimplePlane>;
334
- /** {@link Disposable.onDisposed} */
335
- readonly onDisposed: Event<string>;
336
- /** {@link Configurable.isSetup} */
337
- isSetup: boolean;
338
- /**
339
- * Whether to force the clipping plane to be orthogonal in the Y direction
340
- * (up). This is desirable when clipping a building horizontally and a
341
- * clipping plane is created in its roof, which might have a slight
342
- * slope for draining purposes.
343
- */
344
- orthogonalY: boolean;
345
- /**
346
- * The tolerance that determines whether an almost-horizontal clipping plane
347
- * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
348
- * has to be 'true' for this to apply.
349
- */
350
- toleranceOrthogonalY: number;
350
+ toleranceOrthogonalY: number;
351
351
  /**
352
352
  * The type of clipping plane to be created.
353
353
  * Default is {@link SimplePlane}.
@@ -531,82 +531,6 @@ export declare class Cullers extends Component implements Disposable {
531
531
  */
532
532
  updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
533
533
  }
534
- import * as THREE from "three";
535
- import { Components } from "../Components";
536
- import { SimpleCamera } from "..";
537
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
538
- /**
539
- * 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).
540
- */
541
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
542
- /**
543
- * A ProjectionManager instance that manages the projection modes of the camera.
544
- */
545
- readonly projection: ProjectionManager;
546
- /**
547
- * A THREE.OrthographicCamera instance that represents the orthographic camera.
548
- * This camera is used when the projection mode is set to orthographic.
549
- */
550
- readonly threeOrtho: THREE.OrthographicCamera;
551
- /**
552
- * A THREE.PerspectiveCamera instance that represents the perspective camera.
553
- * This camera is used when the projection mode is set to perspective.
554
- */
555
- readonly threePersp: THREE.PerspectiveCamera;
556
- protected readonly _userInputButtons: any;
557
- protected readonly _frustumSize = 50;
558
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
559
- protected _mode: NavigationMode | null;
560
- private previousSize;
561
- /**
562
- * Getter for the current navigation mode.
563
- * Throws an error if the mode is not found or the camera is not initialized.
564
- *
565
- * @returns {NavigationMode} The current navigation mode.
566
- *
567
- * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
568
- */
569
- get mode(): NavigationMode;
570
- constructor(components: Components);
571
- /** {@link Disposable.dispose} */
572
- dispose(): void;
573
- /**
574
- * Sets a new {@link NavigationMode} and disables the previous one.
575
- *
576
- * @param mode - The {@link NavigationMode} to set.
577
- */
578
- set(mode: NavModeID): void;
579
- /**
580
- * Make the camera view fit all the specified meshes.
581
- *
582
- * @param meshes the meshes to fit. If it is not defined, it will
583
- * evaluate {@link Components.meshes}.
584
- * @param offset the distance to the fit object
585
- */
586
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
587
- /**
588
- * Allows or prevents all user input.
589
- *
590
- * @param active - whether to enable or disable user inputs.
591
- */
592
- setUserInput(active: boolean): void;
593
- private disableUserInput;
594
- private enableUserInput;
595
- private newOrthoCamera;
596
- private setOrthoPerspCameraAspect;
597
- }
598
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
599
- import * as THREE from "three";
600
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
601
- center: THREE.Vector3;
602
- halfSizes: THREE.Vector3;
603
- rotation: THREE.Matrix3;
604
- transformation: THREE.Matrix4;
605
- };
606
- import * as THREE from "three";
607
- export declare class MaterialsUtils {
608
- static isTransparent(material: THREE.Material): boolean;
609
- }
610
534
  import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
611
535
  import { Components } from "../Components";
612
536
  import { BCFViewpoint, Viewpoint } from "./src";
@@ -644,26 +568,6 @@ export declare class Viewpoints extends Component implements Disposable, Configu
644
568
  */
645
569
  dispose(): void;
646
570
  }
647
- import { Component, DataMap } from "../Types";
648
- import { Components } from "../Components";
649
- import { Configurator } from "./src";
650
- /**
651
- * A tool to manage all the configuration from the app centrally.
652
- */
653
- export declare class ConfigManager extends Component {
654
- /**
655
- * The list of all configurations of this app.
656
- */
657
- list: DataMap<string, Configurator<any, any>>;
658
- /** {@link Component.enabled} */
659
- enabled: boolean;
660
- /**
661
- * A unique identifier for the component.
662
- * This UUID is used to register the component within the Components system.
663
- */
664
- static readonly uuid: "b8c764e0-6b24-4e77-9a32-35fa728ee5b4";
665
- constructor(components: Components);
666
- }
667
571
  import { MiniMap } from "./src";
668
572
  import { Component, Updateable, World, Event, Disposable } from "../Types";
669
573
  import { Components } from "../Components";
@@ -713,65 +617,210 @@ export declare class MiniMaps extends Component implements Updateable, Disposabl
713
617
  /** {@link Updateable.update} */
714
618
  update(): void;
715
619
  }
716
- import * as FRAGS from "@thatopen/fragments";
717
- import { Components, Component } from "../../core";
620
+ import { Component, DataMap } from "../Types";
621
+ import { Components } from "../Components";
622
+ import { Configurator } from "./src";
718
623
  /**
719
- * 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).
624
+ * A tool to manage all the configuration from the app centrally.
720
625
  */
721
- export declare class Hider extends Component {
626
+ export declare class ConfigManager extends Component {
722
627
  /**
723
- * A unique identifier for the component.
724
- * This UUID is used to register the component within the Components system.
628
+ * The list of all configurations of this app.
725
629
  */
726
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
630
+ list: DataMap<string, Configurator<any, any>>;
727
631
  /** {@link Component.enabled} */
728
632
  enabled: boolean;
729
- constructor(components: Components);
730
- /**
731
- * Sets the visibility of fragments within the 3D scene.
732
- * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
733
- * If 'items' is provided, only the specified fragments will be affected.
734
- *
735
- * @param visible - The visibility state to set for the fragments.
736
- * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
737
- * If not provided, all fragments will be affected.
738
- *
739
- * @returns {void}
740
- */
741
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
742
633
  /**
743
- * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
744
- * It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
745
- *
746
- * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
747
- * If not provided, all fragments will be isolated.
748
- *
749
- * @returns {void}
634
+ * A unique identifier for the component.
635
+ * This UUID is used to register the component within the Components system.
750
636
  */
751
- isolate(items: FRAGS.FragmentIdMap): void;
752
- private updateCulledVisibility;
753
- }
754
- export declare class UUID {
755
- private static _pattern;
756
- private static _lut;
757
- static create(): string;
758
- static validate(uuid: string): void;
637
+ static readonly uuid: "b8c764e0-6b24-4e77-9a32-35fa728ee5b4";
638
+ constructor(components: Components);
759
639
  }
760
640
  import * as THREE from "three";
761
- import * as FRAGS from "@thatopen/fragments";
762
- import { FragmentsGroup } from "@thatopen/fragments";
763
- import { Component, Components, Disposable, Event } from "../../core";
641
+ import { Components } from "../Components";
642
+ import { SimpleCamera } from "..";
643
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
764
644
  /**
765
- * 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).
645
+ * 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).
766
646
  */
767
- export declare class BoundingBoxer extends Component implements Disposable {
768
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
769
- /** {@link Component.enabled} */
770
- enabled: boolean;
771
- /** {@link Disposable.onDisposed} */
772
- readonly onDisposed: Event<unknown>;
773
- private _absoluteMin;
774
- private _absoluteMax;
647
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
648
+ /**
649
+ * A ProjectionManager instance that manages the projection modes of the camera.
650
+ */
651
+ readonly projection: ProjectionManager;
652
+ /**
653
+ * A THREE.OrthographicCamera instance that represents the orthographic camera.
654
+ * This camera is used when the projection mode is set to orthographic.
655
+ */
656
+ readonly threeOrtho: THREE.OrthographicCamera;
657
+ /**
658
+ * A THREE.PerspectiveCamera instance that represents the perspective camera.
659
+ * This camera is used when the projection mode is set to perspective.
660
+ */
661
+ readonly threePersp: THREE.PerspectiveCamera;
662
+ protected readonly _userInputButtons: any;
663
+ protected readonly _frustumSize = 50;
664
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
665
+ protected _mode: NavigationMode | null;
666
+ private previousSize;
667
+ /**
668
+ * Getter for the current navigation mode.
669
+ * Throws an error if the mode is not found or the camera is not initialized.
670
+ *
671
+ * @returns {NavigationMode} The current navigation mode.
672
+ *
673
+ * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
674
+ */
675
+ get mode(): NavigationMode;
676
+ constructor(components: Components);
677
+ /** {@link Disposable.dispose} */
678
+ dispose(): void;
679
+ /**
680
+ * Sets a new {@link NavigationMode} and disables the previous one.
681
+ *
682
+ * @param mode - The {@link NavigationMode} to set.
683
+ */
684
+ set(mode: NavModeID): void;
685
+ /**
686
+ * Make the camera view fit all the specified meshes.
687
+ *
688
+ * @param meshes the meshes to fit. If it is not defined, it will
689
+ * evaluate {@link Components.meshes}.
690
+ * @param offset the distance to the fit object
691
+ */
692
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
693
+ /**
694
+ * Allows or prevents all user input.
695
+ *
696
+ * @param active - whether to enable or disable user inputs.
697
+ */
698
+ setUserInput(active: boolean): void;
699
+ private disableUserInput;
700
+ private enableUserInput;
701
+ private newOrthoCamera;
702
+ private setOrthoPerspCameraAspect;
703
+ }
704
+ import * as THREE from "three";
705
+ import * as FRAGS from "@thatopen/fragments";
706
+ import { Component, Components } from "../../core";
707
+ /**
708
+ * Represents an edge measurement result.
709
+ */
710
+ export interface MeasureEdge {
711
+ /**
712
+ * The distance between the two points of the edge.
713
+ */
714
+ distance: number;
715
+ /**
716
+ * The two points that define the edge.
717
+ */
718
+ points: THREE.Vector3[];
719
+ }
720
+ /**
721
+ * Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
722
+ */
723
+ export declare class MeasurementUtils extends Component {
724
+ /**
725
+ * A unique identifier for the component.
726
+ * This UUID is used to register the component within the Components system.
727
+ */
728
+ static uuid: string;
729
+ /** {@link Component.enabled} */
730
+ enabled: boolean;
731
+ constructor(components: Components);
732
+ /**
733
+ * Utility method to calculate the distance from a point to a line segment.
734
+ *
735
+ * @param point - The point from which to calculate the distance.
736
+ * @param lineStart - The start point of the line segment.
737
+ * @param lineEnd - The end point of the line segment.
738
+ * @param clamp - If true, the distance will be clamped to the line segment's length.
739
+ * @returns The distance from the point to the line segment.
740
+ */
741
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
742
+ /**
743
+ * Method to get the face of a mesh that contains a given triangle index.
744
+ * It also returns the edges of the found face and their indices.
745
+ *
746
+ * @param mesh - The mesh to get the face from. It must be indexed.
747
+ * @param triangleIndex - The index of the triangle within the mesh.
748
+ * @param instance - The instance of the mesh (optional).
749
+ * @returns An object containing the edges of the found face and their indices, or null if no face was found.
750
+ */
751
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
752
+ edges: MeasureEdge[];
753
+ indices: Set<number>;
754
+ } | null;
755
+ /**
756
+ * Method to get the vertices and normal of a mesh face at a given index.
757
+ * It also applies instance transformation if provided.
758
+ *
759
+ * @param mesh - The mesh to get the face from. It must be indexed.
760
+ * @param faceIndex - The index of the face within the mesh.
761
+ * @param instance - The instance of the mesh (optional).
762
+ * @returns An object containing the vertices and normal of the face.
763
+ * @throws Will throw an error if the geometry is not indexed.
764
+ */
765
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
766
+ p1: THREE.Vector3;
767
+ p2: THREE.Vector3;
768
+ p3: THREE.Vector3;
769
+ faceNormal: THREE.Vector3;
770
+ };
771
+ /**
772
+ * Method to round the vector's components to a specified number of decimal places.
773
+ * This is used to ensure numerical precision in edge detection.
774
+ *
775
+ * @param vector - The vector to round.
776
+ * @returns The vector with rounded components.
777
+ */
778
+ round(vector: THREE.Vector3): void;
779
+ /**
780
+ * Calculates the volume of a set of fragments.
781
+ *
782
+ * @param frags - A map of fragment IDs to their corresponding item IDs.
783
+ * @returns The total volume of the fragments and the bounding sphere.
784
+ *
785
+ * @remarks
786
+ * This method creates a set of instanced meshes from the given fragments and item IDs.
787
+ * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
788
+ *
789
+ * @throws Will throw an error if the geometry of the meshes is not indexed.
790
+ * @throws Will throw an error if the fragment manager is not available.
791
+ */
792
+ getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
793
+ /**
794
+ * Calculates the total volume of a set of meshes.
795
+ *
796
+ * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
797
+ * @returns The total volume of the meshes and the bounding sphere.
798
+ *
799
+ * @remarks
800
+ * This method calculates the volume of each mesh in the provided array and returns the total volume
801
+ * and its bounding sphere.
802
+ *
803
+ */
804
+ getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
805
+ private getFaceData;
806
+ private getVolumeOfMesh;
807
+ private getSignedVolumeOfTriangle;
808
+ }
809
+ import * as THREE from "three";
810
+ import * as FRAGS from "@thatopen/fragments";
811
+ import { FragmentsGroup } from "@thatopen/fragments";
812
+ import { Component, Components, Disposable, Event } from "../../core";
813
+ /**
814
+ * 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).
815
+ */
816
+ export declare class BoundingBoxer extends Component implements Disposable {
817
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
818
+ /** {@link Component.enabled} */
819
+ enabled: boolean;
820
+ /** {@link Disposable.onDisposed} */
821
+ readonly onDisposed: Event<unknown>;
822
+ private _absoluteMin;
823
+ private _absoluteMax;
775
824
  private _meshes;
776
825
  constructor(components: Components);
777
826
  /**
@@ -1189,120 +1238,43 @@ export declare class Classifier extends Component implements Disposable {
1189
1238
  resetColor(items: FRAGS.FragmentIdMap): void;
1190
1239
  protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
1191
1240
  }
1192
- import * as WEBIFC from "web-ifc";
1193
1241
  import * as FRAGS from "@thatopen/fragments";
1194
- import { IfcFragmentSettings } from "./src";
1195
- import { Component, Components, Event, Disposable } from "../../core";
1242
+ import { Components, Component } from "../../core";
1196
1243
  /**
1197
- * 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).
1244
+ * 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).
1198
1245
  */
1199
- export declare class IfcLoader extends Component implements Disposable {
1246
+ export declare class Hider extends Component {
1200
1247
  /**
1201
1248
  * A unique identifier for the component.
1202
1249
  * This UUID is used to register the component within the Components system.
1203
1250
  */
1204
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1205
- /** {@link Disposable.onDisposed} */
1206
- readonly onDisposed: Event<string>;
1207
- /**
1208
- * An event triggered when the IFC file starts loading.
1209
- */
1210
- readonly onIfcStartedLoading: Event<void>;
1211
- /**
1212
- * An event triggered when the setup process is completed.
1213
- */
1214
- readonly onSetup: Event<void>;
1215
- /**
1216
- * The settings for the IfcLoader.
1217
- * It includes options for excluding categories, setting WASM paths, and more.
1218
- */
1219
- settings: IfcFragmentSettings;
1220
- /**
1221
- * The instance of the Web-IFC library used for handling IFC data.
1222
- */
1223
- webIfc: WEBIFC.IfcAPI;
1251
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
1224
1252
  /** {@link Component.enabled} */
1225
1253
  enabled: boolean;
1226
- private _material;
1227
- private _spatialTree;
1228
- private _metaData;
1229
- private _fragmentInstances;
1230
- private _civil;
1231
- private _visitedFragments;
1232
- private _materialT;
1233
1254
  constructor(components: Components);
1234
- /** {@link Disposable.dispose} */
1235
- dispose(): void;
1236
1255
  /**
1237
- * Sets up the IfcLoader component with the provided configuration.
1238
- *
1239
- * @param config - Optional configuration settings for the IfcLoader.
1240
- * If not provided, the existing settings will be used.
1241
- *
1242
- * @returns A Promise that resolves when the setup process is completed.
1256
+ * Sets the visibility of fragments within the 3D scene.
1257
+ * If no 'items' parameter is provided, all fragments will be set to the specified visibility.
1258
+ * If 'items' is provided, only the specified fragments will be affected.
1243
1259
  *
1244
- * @remarks
1245
- * If the 'autoSetWasm' option is enabled in the configuration,
1246
- * the method will automatically set the WASM paths for the Web-IFC library.
1260
+ * @param visible - The visibility state to set for the fragments.
1261
+ * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
1262
+ * If not provided, all fragments will be affected.
1247
1263
  *
1248
- * @example
1249
- * '''typescript
1250
- * const ifcLoader = new IfcLoader(components);
1251
- * await ifcLoader.setup({ autoSetWasm: true });
1252
- * '''
1264
+ * @returns {void}
1253
1265
  */
1254
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1266
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
1255
1267
  /**
1256
- * Loads an IFC file and processes it for 3D visualization.
1257
- *
1258
- * @param data - The Uint8Array containing the IFC file data.
1259
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1268
+ * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
1269
+ * It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
1260
1270
  *
1261
- * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1271
+ * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
1272
+ * If not provided, all fragments will be isolated.
1262
1273
  *
1263
- * @example
1264
- * '''typescript
1265
- * const ifcLoader = components.get(IfcLoader);
1266
- * const group = await ifcLoader.load(ifcData);
1267
- * '''
1274
+ * @returns {void}
1268
1275
  */
1269
- load(data: Uint8Array, coordinate?: boolean, name?: string): Promise<FRAGS.FragmentsGroup>;
1270
- /**
1271
- * Reads an IFC file and initializes the Web-IFC library.
1272
- *
1273
- * @param data - The Uint8Array containing the IFC file data.
1274
- *
1275
- * @returns A Promise that resolves when the IFC file is opened and initialized.
1276
- *
1277
- * @remarks
1278
- * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1279
- * It also opens the IFC model using the provided data and settings.
1280
- *
1281
- * @example
1282
- * '''typescript
1283
- * const ifcLoader = components.get(IfcLoader);
1284
- * await ifcLoader.readIfcFile(ifcData);
1285
- * '''
1286
- */
1287
- readIfcFile(data: Uint8Array): Promise<number>;
1288
- /**
1289
- * Cleans up the IfcLoader component by resetting the Web-IFC library,
1290
- * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1291
- *
1292
- * @remarks
1293
- * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1294
- *
1295
- * @example
1296
- * '''typescript
1297
- * const ifcLoader = components.get(IfcLoader);
1298
- * ifcLoader.cleanUp();
1299
- * '''
1300
- */
1301
- cleanUp(): void;
1302
- private getAllGeometries;
1303
- private getMesh;
1304
- private getGeometry;
1305
- private autoSetWasm;
1276
+ isolate(items: FRAGS.FragmentIdMap): void;
1277
+ private updateCulledVisibility;
1306
1278
  }
1307
1279
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1308
1280
  import * as THREE from "three";
@@ -1457,6 +1429,121 @@ export declare class FragmentsManager extends Component implements Disposable {
1457
1429
  clone(model: FRAGS.FragmentsGroup, items?: FRAGS.FragmentIdMap): FragmentsGroup;
1458
1430
  }
1459
1431
  import * as WEBIFC from "web-ifc";
1432
+ import * as FRAGS from "@thatopen/fragments";
1433
+ import { IfcFragmentSettings } from "./src";
1434
+ import { Component, Components, Event, Disposable } from "../../core";
1435
+ /**
1436
+ * 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).
1437
+ */
1438
+ export declare class IfcLoader extends Component implements Disposable {
1439
+ /**
1440
+ * A unique identifier for the component.
1441
+ * This UUID is used to register the component within the Components system.
1442
+ */
1443
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1444
+ /** {@link Disposable.onDisposed} */
1445
+ readonly onDisposed: Event<string>;
1446
+ /**
1447
+ * An event triggered when the IFC file starts loading.
1448
+ */
1449
+ readonly onIfcStartedLoading: Event<void>;
1450
+ /**
1451
+ * An event triggered when the setup process is completed.
1452
+ */
1453
+ readonly onSetup: Event<void>;
1454
+ /**
1455
+ * The settings for the IfcLoader.
1456
+ * It includes options for excluding categories, setting WASM paths, and more.
1457
+ */
1458
+ settings: IfcFragmentSettings;
1459
+ /**
1460
+ * The instance of the Web-IFC library used for handling IFC data.
1461
+ */
1462
+ webIfc: WEBIFC.IfcAPI;
1463
+ /** {@link Component.enabled} */
1464
+ enabled: boolean;
1465
+ private _material;
1466
+ private _spatialTree;
1467
+ private _metaData;
1468
+ private _fragmentInstances;
1469
+ private _civil;
1470
+ private _visitedFragments;
1471
+ private _materialT;
1472
+ constructor(components: Components);
1473
+ /** {@link Disposable.dispose} */
1474
+ dispose(): void;
1475
+ /**
1476
+ * Sets up the IfcLoader component with the provided configuration.
1477
+ *
1478
+ * @param config - Optional configuration settings for the IfcLoader.
1479
+ * If not provided, the existing settings will be used.
1480
+ *
1481
+ * @returns A Promise that resolves when the setup process is completed.
1482
+ *
1483
+ * @remarks
1484
+ * If the 'autoSetWasm' option is enabled in the configuration,
1485
+ * the method will automatically set the WASM paths for the Web-IFC library.
1486
+ *
1487
+ * @example
1488
+ * '''typescript
1489
+ * const ifcLoader = new IfcLoader(components);
1490
+ * await ifcLoader.setup({ autoSetWasm: true });
1491
+ * '''
1492
+ */
1493
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1494
+ /**
1495
+ * Loads an IFC file and processes it for 3D visualization.
1496
+ *
1497
+ * @param data - The Uint8Array containing the IFC file data.
1498
+ * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1499
+ *
1500
+ * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1501
+ *
1502
+ * @example
1503
+ * '''typescript
1504
+ * const ifcLoader = components.get(IfcLoader);
1505
+ * const group = await ifcLoader.load(ifcData);
1506
+ * '''
1507
+ */
1508
+ load(data: Uint8Array, coordinate?: boolean, name?: string): Promise<FRAGS.FragmentsGroup>;
1509
+ /**
1510
+ * Reads an IFC file and initializes the Web-IFC library.
1511
+ *
1512
+ * @param data - The Uint8Array containing the IFC file data.
1513
+ *
1514
+ * @returns A Promise that resolves when the IFC file is opened and initialized.
1515
+ *
1516
+ * @remarks
1517
+ * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1518
+ * It also opens the IFC model using the provided data and settings.
1519
+ *
1520
+ * @example
1521
+ * '''typescript
1522
+ * const ifcLoader = components.get(IfcLoader);
1523
+ * await ifcLoader.readIfcFile(ifcData);
1524
+ * '''
1525
+ */
1526
+ readIfcFile(data: Uint8Array): Promise<number>;
1527
+ /**
1528
+ * Cleans up the IfcLoader component by resetting the Web-IFC library,
1529
+ * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1530
+ *
1531
+ * @remarks
1532
+ * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1533
+ *
1534
+ * @example
1535
+ * '''typescript
1536
+ * const ifcLoader = components.get(IfcLoader);
1537
+ * ifcLoader.cleanUp();
1538
+ * '''
1539
+ */
1540
+ cleanUp(): void;
1541
+ private getAllGeometries;
1542
+ private getMesh;
1543
+ private getGeometry;
1544
+ private autoSetWasm;
1545
+ }
1546
+ import * as WEBIFC from "web-ifc";
1460
1547
  import { AsyncEvent, Component, Disposable, Event } from "../../core";
1461
1548
  import { PropertiesStreamingSettings } from "./src";
1462
1549
  /**
@@ -1622,373 +1709,83 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
1622
1709
  private streamGeometries;
1623
1710
  private registerGeometryData;
1624
1711
  }
1625
- import * as THREE from "three";
1626
- import { Component, Components, Disposable, Event, World } from "../core";
1712
+ import * as WEBIFC from "web-ifc";
1713
+ import * as FRAG from "@thatopen/fragments";
1714
+ import { Component, Components } from "../../core";
1627
1715
  /**
1628
- * Configuration interface for the VertexPicker component.
1716
+ * 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).
1629
1717
  */
1630
- export interface VertexPickerConfig {
1631
- /**
1632
- * If true, only vertices will be picked, not the closest point on the face.
1633
- */
1634
- showOnlyVertex: boolean;
1718
+ export declare class IfcJsonExporter extends Component {
1635
1719
  /**
1636
- * The maximum distance for snapping to a vertex.
1720
+ * A unique identifier for the component.
1721
+ * This UUID is used to register the component within the Components system.
1637
1722
  */
1638
- snapDistance: number;
1723
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1724
+ /** {@link Component.enabled} */
1725
+ enabled: boolean;
1726
+ constructor(components: Components);
1639
1727
  /**
1640
- * The HTML element to use for previewing the picked vertex.
1728
+ * Exports all the properties of an IFC into an array of JS objects.
1729
+ * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1730
+ * @param modelID ID of the IFC model whose properties to extract.
1731
+ * @param indirect whether to get the indirect relationships as well.
1732
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
1733
+ * to make the location data available (e.g. absolute position of building).
1641
1734
  */
1642
- previewElement: HTMLElement;
1735
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1643
1736
  }
1737
+ import * as WEBIFC from "web-ifc";
1738
+ import { FragmentsGroup } from "@thatopen/fragments";
1739
+ import { Disposable, Event, Component, Components } from "../../core";
1740
+ import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
1644
1741
  /**
1645
- * A class that provides functionality for picking vertices in a 3D scene.
1742
+ * Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
1646
1743
  */
1647
- export declare class VertexPicker extends Component implements Disposable {
1648
- /** {@link Disposable.onDisposed} */
1649
- readonly onDisposed: Event<unknown>;
1650
- /**
1651
- * An event that is triggered when a vertex is found.
1652
- * The event passes a THREE.Vector3 representing the position of the found vertex.
1653
- */
1654
- readonly onVertexFound: Event<THREE.Vector3>;
1655
- /**
1656
- * An event that is triggered when a vertex is lost.
1657
- * The event passes a THREE.Vector3 representing the position of the lost vertex.
1658
- */
1659
- readonly onVertexLost: Event<THREE.Vector3>;
1744
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
1660
1745
  /**
1661
- * An event that is triggered when the picker is enabled or disabled
1746
+ * A unique identifier for the component.
1747
+ * This UUID is used to register the component within the Components system.
1662
1748
  */
1663
- readonly onEnabled: Event<boolean>;
1749
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1750
+ /** {@link Disposable.onDisposed} */
1751
+ readonly onDisposed: Event<string>;
1664
1752
  /**
1665
- * A reference to the Components instance associated with this VertexPicker.
1753
+ * Event triggered when relations for a model have been indexed.
1754
+ * This event provides the model's UUID and the relations map generated for that model.
1755
+ *
1756
+ * @property {string} modelID - The UUID of the model for which relations have been indexed.
1757
+ * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1758
+ * The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
1666
1759
  */
1667
- components: Components;
1760
+ readonly onRelationsIndexed: Event<{
1761
+ modelID: string;
1762
+ relationsMap: RelationsMap;
1763
+ }>;
1668
1764
  /**
1669
- * A reference to the working plane used for vertex picking.
1670
- * This plane is used to determine which vertices are considered valid for picking.
1671
- * If this value is null, all vertices are considered valid.
1765
+ * Holds the relationship mappings for each model processed by the indexer.
1766
+ * The structure is a map where each key is a model's UUID, and the value is another map.
1767
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1768
+ * representing a specific relation type, and the value is an array of expressIDs of entities
1769
+ * that are related through that relation type. This structure allows for efficient querying
1770
+ * of entity relationships within a model.
1672
1771
  */
1673
- workingPlane: THREE.Plane | null;
1674
- private _pickedPoint;
1675
- private _config;
1676
- private _enabled;
1772
+ readonly relationMaps: ModelsRelationMap;
1773
+ /** {@link Component.enabled} */
1774
+ enabled: boolean;
1775
+ private _relToAttributesMap;
1776
+ private _inverseAttributes;
1777
+ private _ifcRels;
1778
+ constructor(components: Components);
1779
+ private onFragmentsDisposed;
1780
+ private indexRelations;
1781
+ getAttributeIndex(inverseAttribute: InverseAttribute): number | null;
1677
1782
  /**
1678
- * Sets the enabled state of the VertexPicker.
1679
- * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
1680
- * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
1783
+ * Adds a relation map to the model's relations map.
1681
1784
  *
1682
- * @param value - The new enabled state.
1683
- */
1684
- set enabled(value: boolean);
1685
- /**
1686
- * Gets the current enabled state of the VertexPicker.
1785
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1786
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1687
1787
  *
1688
- * @returns The current enabled state.
1689
- */
1690
- get enabled(): boolean;
1691
- /**
1692
- * Sets the configuration for the VertexPicker component.
1693
- *
1694
- * @param value - A Partial object containing the configuration properties to update.
1695
- * The properties not provided in the value object will retain their current values.
1696
- *
1697
- * @example
1698
- * '''typescript
1699
- * vertexPicker.config = {
1700
- * snapDistance: 0.5,
1701
- * showOnlyVertex: true,
1702
- * };
1703
- * '''
1704
- */
1705
- set config(value: Partial<VertexPickerConfig>);
1706
- /**
1707
- * Gets the current configuration for the VertexPicker component.
1708
- *
1709
- * @returns A copy of the current VertexPickerConfig object.
1710
- *
1711
- * @example
1712
- * '''typescript
1713
- * const currentConfig = vertexPicker.config;
1714
- * console.log(currentConfig.snapDistance); // Output: 0.25
1715
- * '''
1716
- */
1717
- get config(): Partial<VertexPickerConfig>;
1718
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
1719
- /** {@link Disposable.dispose} */
1720
- dispose(): void;
1721
- /**
1722
- * Performs the vertex picking operation based on the current state of the VertexPicker.
1723
- *
1724
- * @param world - The World instance to use for raycasting.
1725
- *
1726
- * @returns The current picked point, or null if no point is picked.
1727
- *
1728
- * @remarks
1729
- * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
1730
- * If enabled, it performs raycasting to find the closest intersecting object.
1731
- * It then determines the closest vertex or point on the face, based on the configuration settings.
1732
- * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
1733
- * If the picked point is not on the working plane, it resets the 'pickedPoint'.
1734
- * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
1735
- */
1736
- get(world: World): THREE.Vector3 | null;
1737
- private getClosestVertex;
1738
- private getVertices;
1739
- private getVertex;
1740
- }
1741
- import { XMLParser } from "fast-xml-parser";
1742
- import { Component, Configurable, Disposable, Event, World, DataMap } from "../../core";
1743
- import { BCFTopic, Topic, BCFTopicsConfigManager, BCFTopicsConfig } from "./src";
1744
- import { Viewpoint } from "../../core/Viewpoints";
1745
- /**
1746
- * BCFTopics manages Building Collaboration Format (BCF) data the engine.
1747
- * It provides functionality for importing, exporting, and manipulating BCF data.
1748
- */
1749
- export declare class BCFTopics extends Component implements Disposable, Configurable<BCFTopicsConfigManager, BCFTopicsConfig> {
1750
- static uuid: "de977976-e4f6-4e4f-a01a-204727839802";
1751
- enabled: boolean;
1752
- static xmlParser: XMLParser;
1753
- protected _defaultConfig: Required<BCFTopicsConfig>;
1754
- config: BCFTopicsConfigManager;
1755
- readonly list: DataMap<string, Topic>;
1756
- readonly onSetup: Event<unknown>;
1757
- isSetup: boolean;
1758
- setup(config?: Partial<BCFTopicsConfig>): void;
1759
- readonly onBCFImported: Event<Topic[]>;
1760
- /**
1761
- * Creates a new BCFTopic instance and adds it to the list.
1762
- *
1763
- * @param data - Optional partial BCFTopic object to initialize the new topic with.
1764
- * If not provided, default values will be used.
1765
- * @returns The newly created BCFTopic instance.
1766
- */
1767
- create(data?: Partial<BCFTopic>): Topic;
1768
- readonly onDisposed: Event<unknown>;
1769
- /**
1770
- * Disposes of the BCFTopics component and triggers the onDisposed event.
1771
- *
1772
- * @remarks
1773
- * This method clears the list of topics and triggers the onDisposed event.
1774
- * It also resets the onDisposed event listener.
1775
- */
1776
- dispose(): void;
1777
- /**
1778
- * Retrieves the unique set of topic types used across all topics.
1779
- *
1780
- * @returns A Set containing the unique topic types.
1781
- */
1782
- get usedTypes(): Set<string>;
1783
- /**
1784
- * Retrieves the unique set of topic statuses used across all topics.
1785
- *
1786
- * @returns A Set containing the unique topic statuses.
1787
- */
1788
- get usedStatuses(): Set<string>;
1789
- /**
1790
- * Retrieves the unique set of topic priorities used across all topics.
1791
- *
1792
- * @returns A Set containing the unique topic priorities.
1793
- * Note: This method filters out any null or undefined priorities.
1794
- */
1795
- get usedPriorities(): Set<string | undefined>;
1796
- /**
1797
- * Retrieves the unique set of topic stages used across all topics.
1798
- *
1799
- * @returns A Set containing the unique topic stages.
1800
- * Note: This method filters out any null or undefined stages.
1801
- */
1802
- get usedStages(): Set<string | undefined>;
1803
- /**
1804
- * Retrieves the unique set of users associated with topics.
1805
- *
1806
- * @returns A Set containing the unique users.
1807
- * Note: This method collects users from the creation author, assigned to, modified author, and comment authors.
1808
- */
1809
- get usedUsers(): Set<string>;
1810
- /**
1811
- * Retrieves the unique set of labels used across all topics.
1812
- *
1813
- * @returns A Set containing the unique labels.
1814
- */
1815
- get usedLabels(): Set<string>;
1816
- /**
1817
- * Updates the set of extensions (types, statuses, priorities, labels, stages, users) based on the current topics.
1818
- * This method iterates through each topic in the list and adds its properties to the corresponding sets in the config.
1819
- */
1820
- updateExtensions(): void;
1821
- /**
1822
- * Updates the references to viewpoints in the topics.
1823
- * This function iterates through each topic and checks if the viewpoints exist in the viewpoints list.
1824
- * If a viewpoint does not exist, it is removed from the topic's viewpoints.
1825
- */
1826
- updateViewpointReferences(): void;
1827
- /**
1828
- * Exports the given topics to a BCF (Building Collaboration Format) zip file.
1829
- *
1830
- * @param topics - The topics to export. Defaults to all topics in the list.
1831
- * @returns A promise that resolves to a Blob containing the exported BCF zip file.
1832
- */
1833
- export(topics?: Iterable<Topic>): Promise<Blob>;
1834
- private serializeExtensions;
1835
- private processMarkupComment;
1836
- private getMarkupComments;
1837
- private getMarkupLabels;
1838
- private getMarkupViewpoints;
1839
- private getMarkupRelatedTopics;
1840
- /**
1841
- * Loads BCF (Building Collaboration Format) data into the engine.
1842
- *
1843
- * @param world - The default world where the viewpoints are going to be created.
1844
- * @param data - The BCF data to load.
1845
- *
1846
- * @returns A promise that resolves to an object containing the created viewpoints and topics.
1847
- *
1848
- * @throws An error if the BCF version is not supported.
1849
- */
1850
- load(data: Uint8Array, world: World): Promise<{
1851
- viewpoints: Viewpoint[];
1852
- topics: Topic[];
1853
- }>;
1854
- }
1855
- import * as FRAGS from "@thatopen/fragments";
1856
- import { XMLParser } from "fast-xml-parser";
1857
- import { Component, DataMap } from "../../core/Types";
1858
- import { IDSCheckResult, IDSInfo, IDSSpecification, IfcVersion } from "./src";
1859
- import { Components } from "../../core";
1860
- /**
1861
- * Component that manages Information Delivery Specification (IDS) data.
1862
- * It provides functionality for importing, exporting, and manipulating IDS data.
1863
- */
1864
- export declare class IDSSpecifications extends Component {
1865
- static uuid: "9f0b9f78-9b2e-481a-b766-2fbfd01f342c";
1866
- enabled: boolean;
1867
- static xmlParser: XMLParser;
1868
- constructor(components: Components);
1869
- readonly list: DataMap<string, IDSSpecification>;
1870
- /**
1871
- * Retrieves a FragmentIdMap based on the given IDSCheckResult array.
1872
- * The map separates the IDs into two categories: pass and fail.
1873
- *
1874
- * @param model - The FragmentsGroup model from which to retrieve the fragment map.
1875
- * @param result - An array of IDSCheckResult objects, each representing a check result.
1876
- *
1877
- * @returns An object containing two properties:
1878
- * - 'pass': A FragmentIdMap that passed the checks.
1879
- * - 'fail': A FragmentIdMap that failed the checks.
1880
- */
1881
- getFragmentIdMap(model: FRAGS.FragmentsGroup, result: IDSCheckResult[]): {
1882
- pass: FRAGS.FragmentIdMap;
1883
- fail: FRAGS.FragmentIdMap;
1884
- };
1885
- /**
1886
- * Creates a new IDSSpecification instance and adds it to the list.
1887
- *
1888
- * @param name - The name of the IDSSpecification.
1889
- * @param ifcVersion - An array of IfcVersion values that the specification supports.
1890
- *
1891
- * @returns The newly created IDSSpecification instance.
1892
- */
1893
- create(name: string, ifcVersion: IfcVersion[], identifier?: string): IDSSpecification;
1894
- /**
1895
- * Parses and processes an XML string containing Information Delivery Specification (IDS) data.
1896
- * It creates IDSSpecification instances based on the parsed data and returns them in an array.
1897
- * Also, the instances are added to the list array.
1898
- *
1899
- * @param data - The XML string to parse.
1900
- *
1901
- * @returns An array of IDSSpecification instances created from the parsed data.
1902
- */
1903
- load(data: string): IDSSpecification[];
1904
- /**
1905
- * Exports the IDSSpecifications data into an XML string.
1906
- *
1907
- * @param info - The metadata information for the exported XML.
1908
- * @param specifications - An optional iterable of IDSSpecification instances to export.
1909
- * If not provided, all specifications in the list will be exported.
1910
- *
1911
- * @returns A string containing the exported IDSSpecifications data in XML format.
1912
- */
1913
- export(info: IDSInfo, specifications?: Iterable<IDSSpecification>): string;
1914
- }
1915
- import * as WEBIFC from "web-ifc";
1916
- import * as FRAG from "@thatopen/fragments";
1917
- import { Component, Components } from "../../core";
1918
- /**
1919
- * 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).
1920
- */
1921
- export declare class IfcJsonExporter extends Component {
1922
- /**
1923
- * A unique identifier for the component.
1924
- * This UUID is used to register the component within the Components system.
1925
- */
1926
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1927
- /** {@link Component.enabled} */
1928
- enabled: boolean;
1929
- constructor(components: Components);
1930
- /**
1931
- * Exports all the properties of an IFC into an array of JS objects.
1932
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1933
- * @param modelID ID of the IFC model whose properties to extract.
1934
- * @param indirect whether to get the indirect relationships as well.
1935
- * @param recursiveSpatial whether to get the properties of spatial items recursively
1936
- * to make the location data available (e.g. absolute position of building).
1937
- */
1938
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1939
- }
1940
- import * as WEBIFC from "web-ifc";
1941
- import { FragmentsGroup } from "@thatopen/fragments";
1942
- import { Disposable, Event, Component, Components } from "../../core";
1943
- import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
1944
- /**
1945
- * Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
1946
- */
1947
- export declare class IfcRelationsIndexer extends Component implements Disposable {
1948
- /**
1949
- * A unique identifier for the component.
1950
- * This UUID is used to register the component within the Components system.
1951
- */
1952
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1953
- /** {@link Disposable.onDisposed} */
1954
- readonly onDisposed: Event<string>;
1955
- /**
1956
- * Event triggered when relations for a model have been indexed.
1957
- * This event provides the model's UUID and the relations map generated for that model.
1958
- *
1959
- * @property {string} modelID - The UUID of the model for which relations have been indexed.
1960
- * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1961
- * The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
1962
- */
1963
- readonly onRelationsIndexed: Event<{
1964
- modelID: string;
1965
- relationsMap: RelationsMap;
1966
- }>;
1967
- /**
1968
- * Holds the relationship mappings for each model processed by the indexer.
1969
- * The structure is a map where each key is a model's UUID, and the value is another map.
1970
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1971
- * representing a specific relation type, and the value is an array of expressIDs of entities
1972
- * that are related through that relation type. This structure allows for efficient querying
1973
- * of entity relationships within a model.
1974
- */
1975
- readonly relationMaps: ModelsRelationMap;
1976
- /** {@link Component.enabled} */
1977
- enabled: boolean;
1978
- private _relToAttributesMap;
1979
- private _inverseAttributes;
1980
- private _ifcRels;
1981
- constructor(components: Components);
1982
- private onFragmentsDisposed;
1983
- private indexRelations;
1984
- getAttributeIndex(inverseAttribute: InverseAttribute): number | null;
1985
- /**
1986
- * Adds a relation map to the model's relations map.
1987
- *
1988
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
1989
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
1990
- *
1991
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1788
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1992
1789
  */
1993
1790
  setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
1994
1791
  /**
@@ -2281,7 +2078,6 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
2281
2078
  */
2282
2079
  newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
2283
2080
  pset: WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
2284
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties;
2285
2081
  }>;
2286
2082
  /**
2287
2083
  * Removes a Property Set (Pset) from the given model.
@@ -2425,110 +2221,119 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
2425
2221
  private registerChange;
2426
2222
  private newSingleProperty;
2427
2223
  }
2428
- import * as THREE from "three";
2429
- import * as FRAGS from "@thatopen/fragments";
2430
- import { Component, Components } from "../../core";
2224
+ import { XMLParser } from "fast-xml-parser";
2225
+ import { Component, Configurable, Disposable, Event, World, DataMap } from "../../core";
2226
+ import { BCFTopic, Topic, BCFTopicsConfigManager, BCFTopicsConfig } from "./src";
2227
+ import { Viewpoint } from "../../core/Viewpoints";
2431
2228
  /**
2432
- * Represents an edge measurement result.
2229
+ * BCFTopics manages Building Collaboration Format (BCF) data the engine.
2230
+ * It provides functionality for importing, exporting, and manipulating BCF data.
2433
2231
  */
2434
- export interface MeasureEdge {
2232
+ export declare class BCFTopics extends Component implements Disposable, Configurable<BCFTopicsConfigManager, BCFTopicsConfig> {
2233
+ static uuid: "de977976-e4f6-4e4f-a01a-204727839802";
2234
+ enabled: boolean;
2235
+ static xmlParser: XMLParser;
2236
+ protected _defaultConfig: Required<BCFTopicsConfig>;
2237
+ config: BCFTopicsConfigManager;
2238
+ readonly list: DataMap<string, Topic>;
2239
+ readonly onSetup: Event<unknown>;
2240
+ isSetup: boolean;
2241
+ setup(config?: Partial<BCFTopicsConfig>): void;
2242
+ readonly onBCFImported: Event<Topic[]>;
2435
2243
  /**
2436
- * The distance between the two points of the edge.
2244
+ * Creates a new BCFTopic instance and adds it to the list.
2245
+ *
2246
+ * @param data - Optional partial BCFTopic object to initialize the new topic with.
2247
+ * If not provided, default values will be used.
2248
+ * @returns The newly created BCFTopic instance.
2437
2249
  */
2438
- distance: number;
2250
+ create(data?: Partial<BCFTopic>): Topic;
2251
+ readonly onDisposed: Event<unknown>;
2439
2252
  /**
2440
- * The two points that define the edge.
2253
+ * Disposes of the BCFTopics component and triggers the onDisposed event.
2254
+ *
2255
+ * @remarks
2256
+ * This method clears the list of topics and triggers the onDisposed event.
2257
+ * It also resets the onDisposed event listener.
2441
2258
  */
2442
- points: THREE.Vector3[];
2443
- }
2444
- /**
2445
- * Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
2446
- */
2447
- export declare class MeasurementUtils extends Component {
2259
+ dispose(): void;
2448
2260
  /**
2449
- * A unique identifier for the component.
2450
- * This UUID is used to register the component within the Components system.
2261
+ * Retrieves the unique set of topic types used across all topics.
2262
+ *
2263
+ * @returns A Set containing the unique topic types.
2451
2264
  */
2452
- static uuid: string;
2453
- /** {@link Component.enabled} */
2454
- enabled: boolean;
2455
- constructor(components: Components);
2265
+ get usedTypes(): Set<string>;
2456
2266
  /**
2457
- * Utility method to calculate the distance from a point to a line segment.
2267
+ * Retrieves the unique set of topic statuses used across all topics.
2458
2268
  *
2459
- * @param point - The point from which to calculate the distance.
2460
- * @param lineStart - The start point of the line segment.
2461
- * @param lineEnd - The end point of the line segment.
2462
- * @param clamp - If true, the distance will be clamped to the line segment's length.
2463
- * @returns The distance from the point to the line segment.
2269
+ * @returns A Set containing the unique topic statuses.
2464
2270
  */
2465
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
2271
+ get usedStatuses(): Set<string>;
2466
2272
  /**
2467
- * Method to get the face of a mesh that contains a given triangle index.
2468
- * It also returns the edges of the found face and their indices.
2273
+ * Retrieves the unique set of topic priorities used across all topics.
2469
2274
  *
2470
- * @param mesh - The mesh to get the face from. It must be indexed.
2471
- * @param triangleIndex - The index of the triangle within the mesh.
2472
- * @param instance - The instance of the mesh (optional).
2473
- * @returns An object containing the edges of the found face and their indices, or null if no face was found.
2275
+ * @returns A Set containing the unique topic priorities.
2276
+ * Note: This method filters out any null or undefined priorities.
2474
2277
  */
2475
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
2476
- edges: MeasureEdge[];
2477
- indices: Set<number>;
2478
- } | null;
2278
+ get usedPriorities(): Set<string | undefined>;
2479
2279
  /**
2480
- * Method to get the vertices and normal of a mesh face at a given index.
2481
- * It also applies instance transformation if provided.
2280
+ * Retrieves the unique set of topic stages used across all topics.
2482
2281
  *
2483
- * @param mesh - The mesh to get the face from. It must be indexed.
2484
- * @param faceIndex - The index of the face within the mesh.
2485
- * @param instance - The instance of the mesh (optional).
2486
- * @returns An object containing the vertices and normal of the face.
2487
- * @throws Will throw an error if the geometry is not indexed.
2282
+ * @returns A Set containing the unique topic stages.
2283
+ * Note: This method filters out any null or undefined stages.
2488
2284
  */
2489
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
2490
- p1: THREE.Vector3;
2491
- p2: THREE.Vector3;
2492
- p3: THREE.Vector3;
2493
- faceNormal: THREE.Vector3;
2494
- };
2285
+ get usedStages(): Set<string | undefined>;
2495
2286
  /**
2496
- * Method to round the vector's components to a specified number of decimal places.
2497
- * This is used to ensure numerical precision in edge detection.
2287
+ * Retrieves the unique set of users associated with topics.
2498
2288
  *
2499
- * @param vector - The vector to round.
2500
- * @returns The vector with rounded components.
2289
+ * @returns A Set containing the unique users.
2290
+ * Note: This method collects users from the creation author, assigned to, modified author, and comment authors.
2501
2291
  */
2502
- round(vector: THREE.Vector3): void;
2292
+ get usedUsers(): Set<string>;
2503
2293
  /**
2504
- * Calculates the volume of a set of fragments.
2505
- *
2506
- * @param frags - A map of fragment IDs to their corresponding item IDs.
2507
- * @returns The total volume of the fragments and the bounding sphere.
2294
+ * Retrieves the unique set of labels used across all topics.
2508
2295
  *
2509
- * @remarks
2510
- * This method creates a set of instanced meshes from the given fragments and item IDs.
2511
- * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
2296
+ * @returns A Set containing the unique labels.
2297
+ */
2298
+ get usedLabels(): Set<string>;
2299
+ /**
2300
+ * Updates the set of extensions (types, statuses, priorities, labels, stages, users) based on the current topics.
2301
+ * This method iterates through each topic in the list and adds its properties to the corresponding sets in the config.
2302
+ */
2303
+ updateExtensions(): void;
2304
+ /**
2305
+ * Updates the references to viewpoints in the topics.
2306
+ * This function iterates through each topic and checks if the viewpoints exist in the viewpoints list.
2307
+ * If a viewpoint does not exist, it is removed from the topic's viewpoints.
2308
+ */
2309
+ updateViewpointReferences(): void;
2310
+ /**
2311
+ * Exports the given topics to a BCF (Building Collaboration Format) zip file.
2512
2312
  *
2513
- * @throws Will throw an error if the geometry of the meshes is not indexed.
2514
- * @throws Will throw an error if the fragment manager is not available.
2313
+ * @param topics - The topics to export. Defaults to all topics in the list.
2314
+ * @returns A promise that resolves to a Blob containing the exported BCF zip file.
2515
2315
  */
2516
- getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
2316
+ export(topics?: Iterable<Topic>): Promise<Blob>;
2317
+ private serializeExtensions;
2318
+ private processMarkupComment;
2319
+ private getMarkupComments;
2320
+ private getMarkupLabels;
2321
+ private getMarkupViewpoints;
2322
+ private getMarkupRelatedTopics;
2517
2323
  /**
2518
- * Calculates the total volume of a set of meshes.
2324
+ * Loads BCF (Building Collaboration Format) data into the engine.
2519
2325
  *
2520
- * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
2521
- * @returns The total volume of the meshes and the bounding sphere.
2326
+ * @param world - The default world where the viewpoints are going to be created.
2327
+ * @param data - The BCF data to load.
2522
2328
  *
2523
- * @remarks
2524
- * This method calculates the volume of each mesh in the provided array and returns the total volume
2525
- * and its bounding sphere.
2329
+ * @returns A promise that resolves to an object containing the created viewpoints and topics.
2526
2330
  *
2331
+ * @throws An error if the BCF version is not supported.
2527
2332
  */
2528
- getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
2529
- private getFaceData;
2530
- private getVolumeOfMesh;
2531
- private getSignedVolumeOfTriangle;
2333
+ load(data: Uint8Array, world: World): Promise<{
2334
+ viewpoints: Viewpoint[];
2335
+ topics: Topic[];
2336
+ }>;
2532
2337
  }
2533
2338
  import { Component, Components } from "../../core";
2534
2339
  import { IfcQueryGroup } from "./src/ifc-query-group";
@@ -2573,19 +2378,229 @@ export declare class IfcFinder extends Component {
2573
2378
  /**
2574
2379
  * Creates the {@link IfcQueryGroup} with the given ID.
2575
2380
  */
2576
- delete(id: string): void;
2381
+ delete(id: string): void;
2382
+ /**
2383
+ * Deletes all {@link IfcQueryGroup} instances.
2384
+ */
2385
+ clear(): void;
2386
+ }
2387
+ import * as FRAGS from "@thatopen/fragments";
2388
+ import { XMLParser } from "fast-xml-parser";
2389
+ import { Component, DataMap } from "../../core/Types";
2390
+ import { IDSCheckResult, IDSInfo, IDSSpecification, IfcVersion } from "./src";
2391
+ import { Components } from "../../core";
2392
+ /**
2393
+ * Component that manages Information Delivery Specification (IDS) data.
2394
+ * It provides functionality for importing, exporting, and manipulating IDS data.
2395
+ */
2396
+ export declare class IDSSpecifications extends Component {
2397
+ static uuid: "9f0b9f78-9b2e-481a-b766-2fbfd01f342c";
2398
+ enabled: boolean;
2399
+ static xmlParser: XMLParser;
2400
+ constructor(components: Components);
2401
+ readonly list: DataMap<string, IDSSpecification>;
2402
+ /**
2403
+ * Retrieves a FragmentIdMap based on the given IDSCheckResult array.
2404
+ * The map separates the IDs into two categories: pass and fail.
2405
+ *
2406
+ * @param model - The FragmentsGroup model from which to retrieve the fragment map.
2407
+ * @param result - An array of IDSCheckResult objects, each representing a check result.
2408
+ *
2409
+ * @returns An object containing two properties:
2410
+ * - 'pass': A FragmentIdMap that passed the checks.
2411
+ * - 'fail': A FragmentIdMap that failed the checks.
2412
+ */
2413
+ getFragmentIdMap(model: FRAGS.FragmentsGroup, result: IDSCheckResult[]): {
2414
+ pass: FRAGS.FragmentIdMap;
2415
+ fail: FRAGS.FragmentIdMap;
2416
+ };
2417
+ /**
2418
+ * Creates a new IDSSpecification instance and adds it to the list.
2419
+ *
2420
+ * @param name - The name of the IDSSpecification.
2421
+ * @param ifcVersion - An array of IfcVersion values that the specification supports.
2422
+ *
2423
+ * @returns The newly created IDSSpecification instance.
2424
+ */
2425
+ create(name: string, ifcVersion: IfcVersion[], identifier?: string): IDSSpecification;
2426
+ /**
2427
+ * Parses and processes an XML string containing Information Delivery Specification (IDS) data.
2428
+ * It creates IDSSpecification instances based on the parsed data and returns them in an array.
2429
+ * Also, the instances are added to the list array.
2430
+ *
2431
+ * @param data - The XML string to parse.
2432
+ *
2433
+ * @returns An array of IDSSpecification instances created from the parsed data.
2434
+ */
2435
+ load(data: string): IDSSpecification[];
2436
+ /**
2437
+ * Exports the IDSSpecifications data into an XML string.
2438
+ *
2439
+ * @param info - The metadata information for the exported XML.
2440
+ * @param specifications - An optional iterable of IDSSpecification instances to export.
2441
+ * If not provided, all specifications in the list will be exported.
2442
+ *
2443
+ * @returns A string containing the exported IDSSpecifications data in XML format.
2444
+ */
2445
+ export(info: IDSInfo, specifications?: Iterable<IDSSpecification>): string;
2446
+ }
2447
+ import * as THREE from "three";
2448
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
2449
+ center: THREE.Vector3;
2450
+ halfSizes: THREE.Vector3;
2451
+ rotation: THREE.Matrix3;
2452
+ transformation: THREE.Matrix4;
2453
+ };
2454
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
2455
+ import * as THREE from "three";
2456
+ export declare class MaterialsUtils {
2457
+ static isTransparent(material: THREE.Material): boolean;
2458
+ }
2459
+ export declare class UUID {
2460
+ private static _pattern;
2461
+ private static _lut;
2462
+ static create(): string;
2463
+ static validate(uuid: string): void;
2464
+ }
2465
+ import * as THREE from "three";
2466
+ import { Component, Components, Disposable, Event, World } from "../core";
2467
+ /**
2468
+ * Configuration interface for the VertexPicker component.
2469
+ */
2470
+ export interface VertexPickerConfig {
2471
+ /**
2472
+ * If true, only vertices will be picked, not the closest point on the face.
2473
+ */
2474
+ showOnlyVertex: boolean;
2475
+ /**
2476
+ * The maximum distance for snapping to a vertex.
2477
+ */
2478
+ snapDistance: number;
2479
+ /**
2480
+ * The HTML element to use for previewing the picked vertex.
2481
+ */
2482
+ previewElement: HTMLElement;
2483
+ }
2484
+ /**
2485
+ * A class that provides functionality for picking vertices in a 3D scene.
2486
+ */
2487
+ export declare class VertexPicker extends Component implements Disposable {
2488
+ /** {@link Disposable.onDisposed} */
2489
+ readonly onDisposed: Event<unknown>;
2490
+ /**
2491
+ * An event that is triggered when a vertex is found.
2492
+ * The event passes a THREE.Vector3 representing the position of the found vertex.
2493
+ */
2494
+ readonly onVertexFound: Event<THREE.Vector3>;
2495
+ /**
2496
+ * An event that is triggered when a vertex is lost.
2497
+ * The event passes a THREE.Vector3 representing the position of the lost vertex.
2498
+ */
2499
+ readonly onVertexLost: Event<THREE.Vector3>;
2500
+ /**
2501
+ * An event that is triggered when the picker is enabled or disabled
2502
+ */
2503
+ readonly onEnabled: Event<boolean>;
2504
+ /**
2505
+ * A reference to the Components instance associated with this VertexPicker.
2506
+ */
2507
+ components: Components;
2508
+ /**
2509
+ * A reference to the working plane used for vertex picking.
2510
+ * This plane is used to determine which vertices are considered valid for picking.
2511
+ * If this value is null, all vertices are considered valid.
2512
+ */
2513
+ workingPlane: THREE.Plane | null;
2514
+ private _pickedPoint;
2515
+ private _config;
2516
+ private _enabled;
2517
+ /**
2518
+ * Sets the enabled state of the VertexPicker.
2519
+ * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
2520
+ * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
2521
+ *
2522
+ * @param value - The new enabled state.
2523
+ */
2524
+ set enabled(value: boolean);
2525
+ /**
2526
+ * Gets the current enabled state of the VertexPicker.
2527
+ *
2528
+ * @returns The current enabled state.
2529
+ */
2530
+ get enabled(): boolean;
2531
+ /**
2532
+ * Sets the configuration for the VertexPicker component.
2533
+ *
2534
+ * @param value - A Partial object containing the configuration properties to update.
2535
+ * The properties not provided in the value object will retain their current values.
2536
+ *
2537
+ * @example
2538
+ * '''typescript
2539
+ * vertexPicker.config = {
2540
+ * snapDistance: 0.5,
2541
+ * showOnlyVertex: true,
2542
+ * };
2543
+ * '''
2544
+ */
2545
+ set config(value: Partial<VertexPickerConfig>);
2546
+ /**
2547
+ * Gets the current configuration for the VertexPicker component.
2548
+ *
2549
+ * @returns A copy of the current VertexPickerConfig object.
2550
+ *
2551
+ * @example
2552
+ * '''typescript
2553
+ * const currentConfig = vertexPicker.config;
2554
+ * console.log(currentConfig.snapDistance); // Output: 0.25
2555
+ * '''
2556
+ */
2557
+ get config(): Partial<VertexPickerConfig>;
2558
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
2559
+ /** {@link Disposable.dispose} */
2560
+ dispose(): void;
2561
+ /**
2562
+ * Performs the vertex picking operation based on the current state of the VertexPicker.
2563
+ *
2564
+ * @param world - The World instance to use for raycasting.
2565
+ *
2566
+ * @returns The current picked point, or null if no point is picked.
2567
+ *
2568
+ * @remarks
2569
+ * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
2570
+ * If enabled, it performs raycasting to find the closest intersecting object.
2571
+ * It then determines the closest vertex or point on the face, based on the configuration settings.
2572
+ * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
2573
+ * If the picked point is not on the working plane, it resets the 'pickedPoint'.
2574
+ * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
2575
+ */
2576
+ get(world: World): THREE.Vector3 | null;
2577
+ private getClosestVertex;
2578
+ private getVertices;
2579
+ private getVertex;
2580
+ }
2581
+ import { BooleanSettingsControl } from "../../Types";
2582
+ import { Viewpoints } from "../index";
2583
+ import { Configurator } from "../../ConfigManager";
2584
+ /**
2585
+ * Configuration interface for the Viewpoints general behavior.
2586
+ */
2587
+ export interface ViewpointsConfig {
2577
2588
  /**
2578
- * Deletes all {@link IfcQueryGroup} instances.
2589
+ * Indicates whether to overwrite the fragments colors when applying viewpoints.
2590
+ * @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
2591
+ * @default false
2579
2592
  */
2580
- clear(): void;
2581
- }
2582
- import * as WEBIFC from "web-ifc";
2583
- export interface IfcItemsCategories {
2584
- [itemID: number]: number;
2593
+ overwriteColors: boolean;
2585
2594
  }
2586
- export declare class IfcCategories {
2587
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2595
+ type ViewpointsConfigType = {
2596
+ overwriteColors: BooleanSettingsControl;
2597
+ };
2598
+ export declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
2599
+ protected _config: ViewpointsConfigType;
2600
+ get overwriteColors(): boolean;
2601
+ set overwriteColors(value: boolean);
2588
2602
  }
2603
+ export {};
2589
2604
  import * as THREE from "three";
2590
2605
  import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
2591
2606
  import { Configurator } from "../../ConfigManager";
@@ -2619,65 +2634,6 @@ export declare class ClipperConfigManager extends Configurator<Clipper, ClipperC
2619
2634
  set size(value: number);
2620
2635
  }
2621
2636
  export {};
2622
- import { BooleanSettingsControl } from "../../Types";
2623
- import { Viewpoints } from "../index";
2624
- import { Configurator } from "../../ConfigManager";
2625
- /**
2626
- * Configuration interface for the Viewpoints general behavior.
2627
- */
2628
- export interface ViewpointsConfig {
2629
- /**
2630
- * Indicates whether to overwrite the fragments colors when applying viewpoints.
2631
- * @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
2632
- * @default false
2633
- */
2634
- overwriteColors: boolean;
2635
- }
2636
- type ViewpointsConfigType = {
2637
- overwriteColors: BooleanSettingsControl;
2638
- };
2639
- export declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
2640
- protected _config: ViewpointsConfigType;
2641
- get overwriteColors(): boolean;
2642
- set overwriteColors(value: boolean);
2643
- }
2644
- export {};
2645
- /**
2646
- * 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.
2647
- *
2648
- * @remarks
2649
- * This map is used to provide a mapping between IFC entity type numbers and their names.
2650
- * It is useful for identifying and processing different types of IFC elements in a project.
2651
- *
2652
- */
2653
- export declare const IfcElements: {
2654
- [key: number]: string;
2655
- };
2656
- import * as FRAGS from "@thatopen/fragments";
2657
- export declare class IfcPropertiesUtils {
2658
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
2659
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
2660
- [attribute: string]: any;
2661
- } | null>;
2662
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
2663
- [relatingID: number]: number[];
2664
- }>;
2665
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
2666
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
2667
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
2668
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
2669
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
2670
- key: string | null;
2671
- name: string | null;
2672
- }>;
2673
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
2674
- key: string | null;
2675
- value: number | null;
2676
- }>;
2677
- static isRel(expressID: number): boolean;
2678
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2679
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2680
- }
2681
2637
  import * as WEBIFC from "web-ifc";
2682
2638
  /** Configuration of the IFC-fragment conversion. */
2683
2639
  export declare class IfcFragmentSettings {
@@ -2703,264 +2659,94 @@ export declare class IfcFragmentSettings {
2703
2659
  /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2704
2660
  webIfc: WEBIFC.LoaderSettings;
2705
2661
  /**
2706
- * Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2707
- * If set to true, the path will be set to the default path of the WASM file.
2708
- * If set to false, the path must be provided manually in the 'wasm.path' property.
2709
- * Default value is true.
2710
- */
2711
- autoSetWasm: boolean;
2712
- /**
2713
- * Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2714
- * This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
2715
- * If set to null, the default file location handler will be used.
2716
- *
2717
- * @param url - The URL of the file to locate.
2718
- * @returns The absolute path of the file.
2719
- */
2720
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2721
- }
2722
- /**
2723
- * 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.
2724
- */
2725
- export declare const IfcCategoryMap: {
2726
- [key: number]: string;
2727
- };
2728
- export declare const ifcCategoryCase: {
2729
- [upperCase: string]: string;
2730
- };
2731
- import * as FRAGS from "@thatopen/fragments";
2732
- import * as WEBIFC from "web-ifc";
2733
- export declare class SpatialIdsFinder {
2734
- static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
2735
- }
2736
- import * as WEBIFC from "web-ifc";
2737
- import { IfcItemsCategories } from "../../../ifc";
2738
- export declare class SpatialStructure {
2739
- itemsByFloor: IfcItemsCategories;
2740
- private _units;
2741
- setUp(webIfc: WEBIFC.IfcAPI): void;
2742
- cleanUp(): void;
2743
- }
2744
- /**
2745
- * A Set of unique numbers representing different types of IFC geometries.
2746
- */
2747
- export declare const GeometryTypes: Set<number>;
2748
- import * as THREE from "three";
2749
- import { Disposable, Event } from "../../Types";
2750
- /**
2751
- * 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.
2752
- */
2753
- export declare class Mouse implements Disposable {
2754
- dom: HTMLCanvasElement;
2755
- private _event?;
2756
- private _position;
2757
- /** {@link Disposable.onDisposed} */
2758
- readonly onDisposed: Event<unknown>;
2759
- constructor(dom: HTMLCanvasElement);
2760
- /**
2761
- * The real position of the mouse of the Three.js canvas.
2762
- */
2763
- get position(): THREE.Vector2;
2764
- /** {@link Disposable.dispose} */
2765
- dispose(): void;
2766
- private getPositionY;
2767
- private getPositionX;
2768
- private updateMouseInfo;
2769
- private getDataObject;
2770
- private setupEvents;
2771
- }
2772
- import * as THREE from "three";
2773
- import { Components } from "../../Components";
2774
- import { Event, World, Disposable } from "../../Types";
2775
- import { Mouse } from "./mouse";
2776
- /**
2777
- * 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.
2778
- */
2779
- export declare class SimpleRaycaster implements Disposable {
2780
- /** {@link Component.enabled} */
2781
- enabled: boolean;
2782
- /** The components instance to which this Raycaster belongs. */
2783
- components: Components;
2784
- /** {@link Disposable.onDisposed} */
2785
- readonly onDisposed: Event<unknown>;
2786
- /** The position of the mouse in the screen. */
2787
- readonly mouse: Mouse;
2788
- /**
2789
- * A reference to the Three.js Raycaster instance.
2790
- * This is used for raycasting operations.
2791
- */
2792
- readonly three: THREE.Raycaster;
2793
- /**
2794
- * A reference to the world instance to which this Raycaster belongs.
2795
- * This is used to access the camera and meshes.
2796
- */
2797
- world: World;
2798
- constructor(components: Components, world: World);
2799
- /** {@link Disposable.dispose} */
2800
- dispose(): void;
2801
- /**
2802
- * Throws a ray from the camera to the mouse or touch event point and returns
2803
- * the first item found. This also takes into account the clipping planes
2804
- * used by the renderer.
2805
- *
2806
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
2807
- * to query. If not provided, it will query all the meshes stored in
2808
- * {@link Components.meshes}.
2809
- */
2810
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
2811
- /**
2812
- * Casts a ray from a given origin in a given direction and returns the first item found.
2813
- * This method also takes into account the clipping planes used by the renderer.
2814
- *
2815
- * @param origin - The origin of the ray.
2816
- * @param direction - The direction of the ray.
2817
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
2818
- * @returns The first intersection found or 'null' if no intersection was found.
2819
- */
2820
- 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;
2821
- private intersect;
2822
- private filterClippingPlanes;
2823
- }
2824
- import * as THREE from "three";
2825
- import { CullerRenderer } from "./culler-renderer";
2826
- import { Components } from "../../Components";
2827
- import { Event, World, Disposable } from "../../Types";
2828
- /**
2829
- * A renderer to hide/show meshes depending on their visibility from the user's point of view.
2830
- */
2831
- export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
2832
- /**
2833
- * Event triggered when the visibility of meshes is updated.
2834
- * Contains two sets: seen and unseen.
2835
- */
2836
- readonly onViewUpdated: Event<{
2837
- seen: Set<THREE.Mesh>;
2838
- unseen: Set<THREE.Mesh>;
2839
- }>;
2840
- /**
2841
- * Map of color code to THREE.InstancedMesh.
2842
- * Used to keep track of color-coded meshes.
2843
- */
2844
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
2845
- /**
2846
- * @deprecated use config.threshold instead.
2847
- */
2848
- get threshold(): number;
2849
- /**
2850
- * @deprecated use config.threshold instead.
2851
- */
2852
- set threshold(value: number);
2853
- private _colorCodeMeshMap;
2854
- private _meshIDColorCodeMap;
2855
- private _currentVisibleMeshes;
2856
- private _recentlyHiddenMeshes;
2857
- private readonly _transparentMat;
2858
- constructor(components: Components, world: World);
2859
- /** {@link Disposable.dispose} */
2860
- dispose(): void;
2861
- /**
2862
- * Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
2863
- * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
2864
- */
2865
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
2866
- /**
2867
- * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
2868
- * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
2869
- * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
2662
+ * Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2663
+ * If set to true, the path will be set to the default path of the WASM file.
2664
+ * If set to false, the path must be provided manually in the 'wasm.path' property.
2665
+ * Default value is true.
2870
2666
  */
2871
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
2667
+ autoSetWasm: boolean;
2872
2668
  /**
2873
- * Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
2874
- *
2875
- * @param meshes - The meshes to update.
2669
+ * Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
2670
+ * This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
2671
+ * If set to null, the default file location handler will be used.
2876
2672
  *
2877
- * @returns {void}
2673
+ * @param url - The URL of the file to locate.
2674
+ * @returns The absolute path of the file.
2878
2675
  */
2879
- updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
2880
- private handleWorkerMessage;
2881
- private getAvailableMaterial;
2676
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2677
+ }
2678
+ import * as FRAGS from "@thatopen/fragments";
2679
+ import * as WEBIFC from "web-ifc";
2680
+ export declare class SpatialIdsFinder {
2681
+ static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
2682
+ }
2683
+ import * as WEBIFC from "web-ifc";
2684
+ export interface IfcItemsCategories {
2685
+ [itemID: number]: number;
2686
+ }
2687
+ export declare class IfcCategories {
2688
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2689
+ }
2690
+ import * as WEBIFC from "web-ifc";
2691
+ import { IfcItemsCategories } from "../../../ifc";
2692
+ export declare class SpatialStructure {
2693
+ itemsByFloor: IfcItemsCategories;
2694
+ private _units;
2695
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2696
+ cleanUp(): void;
2882
2697
  }
2883
- import * as THREE from "three";
2884
- import { Components } from "../../Components";
2885
- import { AsyncEvent, Configurable, Event, World } from "../../Types";
2886
- import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
2887
2698
  /**
2888
- * A base renderer to determine visibility on screen.
2699
+ * 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.
2700
+ *
2701
+ * @remarks
2702
+ * This map is used to provide a mapping between IFC entity type numbers and their names.
2703
+ * It is useful for identifying and processing different types of IFC elements in a project.
2704
+ *
2889
2705
  */
2890
- export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
2891
- /** {@link Configurable.onSetup} */
2892
- readonly onSetup: Event<unknown>;
2893
- /** {@link Disposable.onDisposed} */
2894
- readonly onDisposed: Event<string>;
2895
- /**
2896
- * Fires after making the visibility check to the meshes. It lists the
2897
- * meshes that are currently visible, and the ones that were visible
2898
- * just before but not anymore.
2899
- */
2900
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
2901
- /**
2902
- * Whether this renderer is active or not. If not, it won't render anything.
2903
- */
2904
- enabled: boolean;
2905
- /**
2906
- * Needs to check whether there are objects that need to be hidden or shown.
2907
- * You can bind this to the camera movement, to a certain interval, etc.
2908
- */
2909
- needsUpdate: boolean;
2910
- /** The components instance to which this renderer belongs. */
2911
- components: Components;
2912
- /** The render target used to render the visibility scene. */
2913
- renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
2914
- /**
2915
- * The size of the buffer where the result of the visibility check is stored.
2916
- */
2917
- bufferSize: number;
2918
- /**
2919
- * The buffer when the result of the visibility check is stored.
2920
- */
2921
- buffer: Uint8Array;
2922
- /**
2923
- * Flag to indicate if the renderer shouldn't update the visibility.
2924
- */
2925
- preventUpdate: boolean;
2926
- /** {@link Configurable.config} */
2927
- config: CullerRendererConfigManager;
2928
- /** {@link Configurable.isSetup} */
2929
- isSetup: boolean;
2930
- /** The world instance to which this renderer belongs. */
2931
- readonly world: World;
2932
- /** The THREE.js renderer used to make the visibility test. */
2933
- readonly renderer: THREE.WebGLRenderer;
2934
- protected _defaultConfig: CullerRendererConfig;
2935
- protected readonly worker: Worker;
2936
- protected readonly scene: THREE.Scene;
2937
- private _availableColor;
2938
- protected _isWorkerBusy: boolean;
2939
- constructor(components: Components, world: World);
2940
- /** {@link Disposable.dispose} */
2941
- dispose(): void;
2942
- /**
2943
- * The function that the culler uses to reprocess the scene. Generally it's
2944
- * better to call needsUpdate, but you can also call this to force it.
2945
- * @param force if true, it will refresh the scene even if needsUpdate is
2946
- * not true.
2947
- */
2948
- updateVisibility: (force?: boolean) => Promise<void>;
2949
- setup(config?: Partial<CullerRendererConfig>): void;
2950
- protected getAvailableColor(): {
2951
- r: number;
2952
- g: number;
2953
- b: number;
2954
- code: string;
2955
- };
2956
- protected increaseColor(): void;
2957
- protected decreaseColor(): void;
2706
+ export declare const IfcElements: {
2707
+ [key: number]: string;
2708
+ };
2709
+ /**
2710
+ * 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.
2711
+ */
2712
+ export declare const IfcCategoryMap: {
2713
+ [key: number]: string;
2714
+ };
2715
+ import * as FRAGS from "@thatopen/fragments";
2716
+ export declare class IfcPropertiesUtils {
2717
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
2718
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
2719
+ [attribute: string]: any;
2720
+ } | null>;
2721
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
2722
+ [relatingID: number]: number[];
2723
+ }>;
2724
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
2725
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
2726
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
2727
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
2728
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
2729
+ key: string | null;
2730
+ name: string | null;
2731
+ }>;
2732
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
2733
+ key: string | null;
2734
+ value: number | null;
2735
+ }>;
2736
+ static isRel(expressID: number): boolean;
2737
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
2738
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
2958
2739
  }
2959
- import { InverseAttribute } from "./types";
2960
- export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
2961
- forRelating: InverseAttribute;
2962
- forRelated: InverseAttribute;
2963
- }>;
2740
+ export declare const ifcCategoryCase: {
2741
+ [upperCase: string]: string;
2742
+ };
2743
+ import { Components } from "../../../../core/Components";
2744
+ import { IDSFacet } from "../facets";
2745
+ export declare const createPropertyFacets: (components: Components, elements: any) => IDSFacet[];
2746
+ /**
2747
+ * A Set of unique numbers representing different types of IFC geometries.
2748
+ */
2749
+ export declare const GeometryTypes: Set<number>;
2964
2750
  import * as FRAGS from "@thatopen/fragments";
2965
2751
  import { IfcFinderQuery } from "./ifc-finder-query";
2966
2752
  import { Components } from "../../../core";
@@ -3030,9 +2816,6 @@ export declare class IfcQueryGroup {
3030
2816
  */
3031
2817
  update(modelID: string, file: File): Promise<void>;
3032
2818
  }
3033
- import { Components } from "../../../../core/Components";
3034
- import { IDSFacet } from "../facets";
3035
- export declare const createPropertyFacets: (components: Components, elements: any) => IDSFacet[];
3036
2819
  /**
3037
2820
  * 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.
3038
2821
  */
@@ -3061,7 +2844,11 @@ export declare class Event<T> {
3061
2844
  reset(): void;
3062
2845
  private handlers;
3063
2846
  }
3064
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2847
+ import { InverseAttribute } from "./types";
2848
+ export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
2849
+ forRelating: InverseAttribute;
2850
+ forRelated: InverseAttribute;
2851
+ }>;
3065
2852
  /**
3066
2853
  * Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
3067
2854
  */
@@ -3210,34 +2997,6 @@ export declare abstract class Component extends Base {
3210
2997
  */
3211
2998
  abstract enabled: boolean;
3212
2999
  }
3213
- import * as THREE from "three";
3214
- import CameraControls from "camera-controls";
3215
- import { BaseWorldItem } from "./base-world-item";
3216
- import { CameraControllable } from "./interfaces";
3217
- /**
3218
- * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
3219
- */
3220
- export declare abstract class BaseCamera extends BaseWorldItem {
3221
- /**
3222
- * Whether the camera is enabled or not.
3223
- */
3224
- abstract enabled: boolean;
3225
- /**
3226
- * The Three.js camera instance.
3227
- */
3228
- abstract three: THREE.Camera;
3229
- /**
3230
- * Optional CameraControls instance for controlling the camera.
3231
- * This property is only available if the camera is controllable.
3232
- */
3233
- abstract controls?: CameraControls;
3234
- /**
3235
- * Checks whether the instance is {@link CameraControllable}.
3236
- *
3237
- * @returns True if the instance is controllable, false otherwise.
3238
- */
3239
- hasCameraControls: () => this is CameraControllable;
3240
- }
3241
3000
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
3242
3001
  import { Components } from "../../Components";
3243
3002
  /**
@@ -3254,115 +3013,59 @@ export declare abstract class Base {
3254
3013
  isUpdateable: () => this is Updateable;
3255
3014
  /** Whether is component is {@link Hideable}. */
3256
3015
  isHideable: () => this is Hideable;
3257
- /** Whether is component is {@link Configurable}. */
3258
- isConfigurable: () => this is Configurable<any, any>;
3259
- }
3260
- import { Base } from "./base";
3261
- import { World } from "./world";
3262
- import { Event } from "./event";
3263
- import { Components } from "../../Components";
3264
- /**
3265
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
3266
- */
3267
- export declare abstract class BaseWorldItem extends Base {
3268
- readonly worlds: Map<string, World>;
3269
- /**
3270
- * Event that is triggered when a world is added or removed from the 'worlds' map.
3271
- * The event payload contains the world instance and the action ("added" or "removed").
3272
- */
3273
- readonly onWorldChanged: Event<{
3274
- world: World;
3275
- action: "added" | "removed";
3276
- }>;
3277
- /**
3278
- * The current world this item is associated with. It can be null if no world is currently active.
3279
- */
3280
- currentWorld: World | null;
3281
- protected constructor(components: Components);
3282
- }
3283
- import * as THREE from "three";
3284
- import { Disposable } from "./interfaces";
3285
- import { Event } from "./event";
3286
- import { Components } from "../../Components";
3287
- import { BaseWorldItem } from "./base-world-item";
3288
- /**
3289
- * Abstract class representing a base scene in the application. All scenes should use this class as a base.
3290
- */
3291
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
3292
- /** {@link Disposable.onDisposed} */
3293
- readonly onDisposed: Event<unknown>;
3294
- /**
3295
- * Abstract property representing the three.js object associated with this scene.
3296
- * It should be implemented by subclasses.
3297
- */
3298
- abstract three: THREE.Object3D;
3299
- /** The set of directional lights managed by this scene component. */
3300
- directionalLights: Map<string, THREE.DirectionalLight>;
3301
- /** The set of ambient lights managed by this scene component. */
3302
- ambientLights: Map<string, THREE.AmbientLight>;
3303
- protected constructor(components: Components);
3304
- /** {@link Disposable.dispose} */
3305
- dispose(): void;
3306
- deleteAllLights(): void;
3016
+ /** Whether is component is {@link Configurable}. */
3017
+ isConfigurable: () => this is Configurable<any, any>;
3307
3018
  }
3019
+ import { Base } from "./base";
3020
+ import { World } from "./world";
3308
3021
  import { Event } from "./event";
3022
+ import { Components } from "../../Components";
3309
3023
  /**
3310
- * A class that extends the built-in Set class and provides additional functionality.
3311
- * It triggers events when items are added, deleted, or the set is cleared.
3312
- *
3313
- * @template T - The type of elements in the set.
3024
+ * One of the elements that make a world. It can be either a scene, a camera or a renderer.
3314
3025
  */
3315
- export declare class DataSet<T> extends Set<T> {
3316
- /**
3317
- * An event that is triggered when a new item is added to the set.
3318
- */
3319
- readonly onItemAdded: Event<T>;
3320
- /**
3321
- * An event that is triggered when an item is deleted from the set.
3322
- */
3323
- readonly onItemDeleted: Event<unknown>;
3026
+ export declare abstract class BaseWorldItem extends Base {
3027
+ readonly worlds: Map<string, World>;
3324
3028
  /**
3325
- * An event that is triggered when the set is cleared.
3029
+ * Event that is triggered when a world is added or removed from the 'worlds' map.
3030
+ * The event payload contains the world instance and the action ("added" or "removed").
3326
3031
  */
3327
- readonly onCleared: Event<unknown>;
3032
+ readonly onWorldChanged: Event<{
3033
+ world: World;
3034
+ action: "added" | "removed";
3035
+ }>;
3328
3036
  /**
3329
- * Constructs a new instance of the DataSet class.
3330
- *
3331
- * @param iterable - An optional iterable object to initialize the set with.
3037
+ * The current world this item is associated with. It can be null if no world is currently active.
3332
3038
  */
3333
- constructor(iterable?: Iterable<T> | null);
3039
+ currentWorld: World | null;
3040
+ protected constructor(components: Components);
3041
+ }
3042
+ import * as THREE from "three";
3043
+ import CameraControls from "camera-controls";
3044
+ import { BaseWorldItem } from "./base-world-item";
3045
+ import { CameraControllable } from "./interfaces";
3046
+ /**
3047
+ * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
3048
+ */
3049
+ export declare abstract class BaseCamera extends BaseWorldItem {
3334
3050
  /**
3335
- * Clears the set and triggers the onCleared event.
3051
+ * Whether the camera is enabled or not.
3336
3052
  */
3337
- clear(): void;
3053
+ abstract enabled: boolean;
3338
3054
  /**
3339
- * Adds one or multiple values to the set and triggers the onItemAdded event per each.
3340
- *
3341
- * @param value - The value to add to the set.
3342
- * @returns - The set instance.
3055
+ * The Three.js camera instance.
3343
3056
  */
3344
- add(...value: T[]): this;
3057
+ abstract three: THREE.Camera;
3345
3058
  /**
3346
- * A function that acts as a guard for adding items to the set.
3347
- * It determines whether a given value should be allowed to be added to the set.
3348
- *
3349
- * @param value - The value to be checked against the guard.
3350
- * @returns A boolean indicating whether the value should be allowed to be added to the set.
3351
- * By default, this function always returns true, allowing all values to be added.
3352
- * You can override this behavior by providing a custom implementation.
3059
+ * Optional CameraControls instance for controlling the camera.
3060
+ * This property is only available if the camera is controllable.
3353
3061
  */
3354
- guard: (value: T) => boolean;
3062
+ abstract controls?: CameraControls;
3355
3063
  /**
3356
- * Deletes a value from the set and triggers the onItemDeleted event.
3064
+ * Checks whether the instance is {@link CameraControllable}.
3357
3065
  *
3358
- * @param value - The value to delete from the set.
3359
- * @returns - True if the value was successfully deleted, false otherwise.
3360
- */
3361
- delete(value: T): boolean;
3362
- /**
3363
- * Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
3066
+ * @returns True if the instance is controllable, false otherwise.
3364
3067
  */
3365
- dispose(): void;
3068
+ hasCameraControls: () => this is CameraControllable;
3366
3069
  }
3367
3070
  import * as THREE from "three";
3368
3071
  import { Vector2 } from "three";
@@ -3430,6 +3133,31 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
3430
3133
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
3431
3134
  }
3432
3135
  import * as THREE from "three";
3136
+ import { Disposable } from "./interfaces";
3137
+ import { Event } from "./event";
3138
+ import { Components } from "../../Components";
3139
+ import { BaseWorldItem } from "./base-world-item";
3140
+ /**
3141
+ * Abstract class representing a base scene in the application. All scenes should use this class as a base.
3142
+ */
3143
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
3144
+ /** {@link Disposable.onDisposed} */
3145
+ readonly onDisposed: Event<unknown>;
3146
+ /**
3147
+ * Abstract property representing the three.js object associated with this scene.
3148
+ * It should be implemented by subclasses.
3149
+ */
3150
+ abstract three: THREE.Object3D;
3151
+ /** The set of directional lights managed by this scene component. */
3152
+ directionalLights: Map<string, THREE.DirectionalLight>;
3153
+ /** The set of ambient lights managed by this scene component. */
3154
+ ambientLights: Map<string, THREE.AmbientLight>;
3155
+ protected constructor(components: Components);
3156
+ /** {@link Disposable.dispose} */
3157
+ dispose(): void;
3158
+ deleteAllLights(): void;
3159
+ }
3160
+ import * as THREE from "three";
3433
3161
  import { BaseScene } from "./base-scene";
3434
3162
  import { BaseCamera } from "./base-camera";
3435
3163
  import { BaseRenderer } from "./base-renderer";
@@ -3463,18 +3191,64 @@ export interface World extends Disposable, Updateable {
3463
3191
  */
3464
3192
  isDisposing: boolean;
3465
3193
  }
3466
- import { Component } from "./component";
3467
- export type ComponentUIElement = {
3468
- name: string;
3469
- componentID: string;
3470
- attributes: {
3471
- [name: string]: string;
3472
- };
3473
- get: () => HTMLElement;
3474
- };
3475
- export declare abstract class ComponentWithUI extends Component {
3476
- abstract name: string;
3477
- abstract getUI(): ComponentUIElement[];
3194
+ import { Event } from "./event";
3195
+ /**
3196
+ * A class that extends the built-in Set class and provides additional functionality.
3197
+ * It triggers events when items are added, deleted, or the set is cleared.
3198
+ *
3199
+ * @template T - The type of elements in the set.
3200
+ */
3201
+ export declare class DataSet<T> extends Set<T> {
3202
+ /**
3203
+ * An event that is triggered when a new item is added to the set.
3204
+ */
3205
+ readonly onItemAdded: Event<T>;
3206
+ /**
3207
+ * An event that is triggered when an item is deleted from the set.
3208
+ */
3209
+ readonly onItemDeleted: Event<unknown>;
3210
+ /**
3211
+ * An event that is triggered when the set is cleared.
3212
+ */
3213
+ readonly onCleared: Event<unknown>;
3214
+ /**
3215
+ * Constructs a new instance of the DataSet class.
3216
+ *
3217
+ * @param iterable - An optional iterable object to initialize the set with.
3218
+ */
3219
+ constructor(iterable?: Iterable<T> | null);
3220
+ /**
3221
+ * Clears the set and triggers the onCleared event.
3222
+ */
3223
+ clear(): void;
3224
+ /**
3225
+ * Adds one or multiple values to the set and triggers the onItemAdded event per each.
3226
+ *
3227
+ * @param value - The value to add to the set.
3228
+ * @returns - The set instance.
3229
+ */
3230
+ add(...value: T[]): this;
3231
+ /**
3232
+ * A function that acts as a guard for adding items to the set.
3233
+ * It determines whether a given value should be allowed to be added to the set.
3234
+ *
3235
+ * @param value - The value to be checked against the guard.
3236
+ * @returns A boolean indicating whether the value should be allowed to be added to the set.
3237
+ * By default, this function always returns true, allowing all values to be added.
3238
+ * You can override this behavior by providing a custom implementation.
3239
+ */
3240
+ guard: (value: T) => boolean;
3241
+ /**
3242
+ * Deletes a value from the set and triggers the onItemDeleted event.
3243
+ *
3244
+ * @param value - The value to delete from the set.
3245
+ * @returns - True if the value was successfully deleted, false otherwise.
3246
+ */
3247
+ delete(value: T): boolean;
3248
+ /**
3249
+ * Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
3250
+ */
3251
+ dispose(): void;
3478
3252
  }
3479
3253
  import { Event } from "./event";
3480
3254
  /**
@@ -3547,6 +3321,19 @@ export declare class DataMap<K, V> extends Map<K, V> {
3547
3321
  */
3548
3322
  dispose(): void;
3549
3323
  }
3324
+ import { Component } from "./component";
3325
+ export type ComponentUIElement = {
3326
+ name: string;
3327
+ componentID: string;
3328
+ attributes: {
3329
+ [name: string]: string;
3330
+ };
3331
+ get: () => HTMLElement;
3332
+ };
3333
+ export declare abstract class ComponentWithUI extends Component {
3334
+ abstract name: string;
3335
+ abstract getUI(): ComponentUIElement[];
3336
+ }
3550
3337
  import * as THREE from "three";
3551
3338
  export interface BooleanSettingsControl {
3552
3339
  type: "Boolean";
@@ -3590,29 +3377,143 @@ export interface ControlsSchema {
3590
3377
  [name: string]: ControlEntry | ControlsSchema;
3591
3378
  }
3592
3379
  import * as THREE from "three";
3593
- import { BaseScene, Configurable, Event } from "../../Types";
3380
+ import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
3594
3381
  import { Components } from "../../Components";
3595
- import { SimpleSceneConfig, SimpleSceneConfigManager } from "./simple-scene-config";
3382
+ import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
3596
3383
  /**
3597
- * 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.
3384
+ * 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).
3598
3385
  */
3599
- export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
3386
+ export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
3387
+ /** {@link Disposable.onDisposed} */
3388
+ readonly onDisposed: Event<unknown>;
3600
3389
  /** {@link Configurable.onSetup} */
3601
3390
  readonly onSetup: Event<unknown>;
3602
3391
  /** {@link Configurable.isSetup} */
3603
3392
  isSetup: boolean;
3393
+ /** The world instance to which this Raycaster belongs. */
3394
+ world: World;
3395
+ /** The components instance to which this grid belongs. */
3396
+ components: Components;
3397
+ /** {@link Configurable.config} */
3398
+ config: SimpleGridConfigManager;
3399
+ protected _defaultConfig: SimpleGridConfig;
3400
+ /** {@link Hideable.visible} */
3401
+ get visible(): boolean;
3402
+ /** {@link Hideable.visible} */
3403
+ set visible(visible: boolean);
3404
+ /** The material of the grid. */
3405
+ get material(): THREE.ShaderMaterial;
3406
+ /**
3407
+ * Whether the grid should fade away with distance. Recommended to be true for
3408
+ * perspective cameras and false for orthographic cameras.
3409
+ */
3410
+ get fade(): boolean;
3411
+ /**
3412
+ * Whether the grid should fade away with distance. Recommended to be true for
3413
+ * perspective cameras and false for orthographic cameras.
3414
+ */
3415
+ set fade(active: boolean);
3416
+ /** The Three.js mesh that contains the infinite grid. */
3417
+ readonly three: THREE.Mesh;
3418
+ private _fade;
3419
+ constructor(components: Components, world: World);
3420
+ /** {@link Configurable.setup} */
3421
+ setup(config?: Partial<SimpleGridConfig>): void;
3422
+ /** {@link Disposable.dispose} */
3423
+ dispose(): void;
3424
+ private setupEvents;
3425
+ private updateZoom;
3426
+ }
3427
+ import * as THREE from "three";
3428
+ import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
3429
+ import { Configurator } from "../../ConfigManager";
3430
+ import { SimpleGrid } from "./simple-grid";
3431
+ type SimpleGridConfigType = {
3432
+ visible: BooleanSettingsControl;
3433
+ color: ColorSettingsControl;
3434
+ primarySize: NumberSettingControl;
3435
+ secondarySize: NumberSettingControl;
3436
+ distance: NumberSettingControl;
3437
+ };
3438
+ /**
3439
+ * Configuration interface for the {@link SimpleGrid}.
3440
+ */
3441
+ export interface SimpleGridConfig {
3442
+ /**
3443
+ * Whether the grid is visible or not.
3444
+ */
3445
+ visible: boolean;
3446
+ /**
3447
+ * The color of the grid lines.
3448
+ */
3449
+ color: THREE.Color;
3450
+ /**
3451
+ * The size of the primary grid lines.
3452
+ */
3453
+ primarySize: number;
3604
3454
  /**
3605
- * The underlying Three.js scene object.
3606
- * It is used to define the 3D space containing objects, lights, and cameras.
3455
+ * The size of the secondary grid lines.
3607
3456
  */
3608
- three: THREE.Scene;
3609
- /** {@link Configurable.config} */
3610
- config: SimpleSceneConfigManager;
3611
- protected _defaultConfig: SimpleSceneConfig;
3612
- constructor(components: Components);
3613
- /** {@link Configurable.setup} */
3614
- setup(config?: Partial<SimpleSceneConfig>): void;
3615
- dispose(): void;
3457
+ secondarySize: number;
3458
+ /**
3459
+ * The distance at which the grid lines start to fade away.
3460
+ */
3461
+ distance: number;
3462
+ }
3463
+ export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
3464
+ protected _config: SimpleGridConfigType;
3465
+ /**
3466
+ * Whether the grid is visible or not.
3467
+ */
3468
+ get visible(): boolean;
3469
+ /**
3470
+ * Whether the grid is visible or not.
3471
+ */
3472
+ set visible(value: boolean);
3473
+ /**
3474
+ * The color of the grid lines.
3475
+ */
3476
+ get color(): THREE.Color;
3477
+ /**
3478
+ * The color of the grid lines.
3479
+ */
3480
+ set color(value: THREE.Color);
3481
+ /**
3482
+ * The size of the primary grid lines.
3483
+ */
3484
+ get primarySize(): number;
3485
+ /**
3486
+ * The size of the primary grid lines.
3487
+ */
3488
+ set primarySize(value: number);
3489
+ /**
3490
+ * The size of the secondary grid lines.
3491
+ */
3492
+ get secondarySize(): number;
3493
+ /**
3494
+ * The size of the secondary grid lines.
3495
+ */
3496
+ set secondarySize(value: number);
3497
+ /**
3498
+ * The distance at which the grid lines start to fade away.
3499
+ */
3500
+ get distance(): number;
3501
+ /**
3502
+ * The distance at which the grid lines start to fade away.
3503
+ */
3504
+ set distance(value: number);
3505
+ }
3506
+ export {};
3507
+ import { ControlsSchema, ControlEntry } from "../../Types";
3508
+ import { Components } from "../../Components";
3509
+ export declare abstract class Configurator<T, U extends ControlsSchema> {
3510
+ protected abstract _config: U;
3511
+ protected _component: T;
3512
+ name: string;
3513
+ uuid: string;
3514
+ get controls(): U;
3515
+ constructor(component: T, components: Components, name: string, uuid?: string);
3516
+ copyEntry(controlEntry: ControlEntry): ControlEntry;
3616
3517
  }
3617
3518
  import * as THREE from "three";
3618
3519
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
@@ -3694,6 +3595,31 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
3694
3595
  dispose(disposeResources?: boolean): void;
3695
3596
  }
3696
3597
  import * as THREE from "three";
3598
+ import { BaseScene, Configurable, Event } from "../../Types";
3599
+ import { Components } from "../../Components";
3600
+ import { SimpleSceneConfig, SimpleSceneConfigManager } from "./simple-scene-config";
3601
+ /**
3602
+ * 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.
3603
+ */
3604
+ export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
3605
+ /** {@link Configurable.onSetup} */
3606
+ readonly onSetup: Event<unknown>;
3607
+ /** {@link Configurable.isSetup} */
3608
+ isSetup: boolean;
3609
+ /**
3610
+ * The underlying Three.js scene object.
3611
+ * It is used to define the 3D space containing objects, lights, and cameras.
3612
+ */
3613
+ three: THREE.Scene;
3614
+ /** {@link Configurable.config} */
3615
+ config: SimpleSceneConfigManager;
3616
+ protected _defaultConfig: SimpleSceneConfig;
3617
+ constructor(components: Components);
3618
+ /** {@link Configurable.setup} */
3619
+ setup(config?: Partial<SimpleSceneConfig>): void;
3620
+ dispose(): void;
3621
+ }
3622
+ import * as THREE from "three";
3697
3623
  import { BaseRenderer, Event } from "../../Types";
3698
3624
  import { Components } from "../../Components";
3699
3625
  /**
@@ -3776,349 +3702,234 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
3776
3702
  * The object that controls the camera. An instance of
3777
3703
  * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
3778
3704
  * Transforming the camera directly will have no effect: you need to use this
3779
- * object to move, rotate, look at objects, etc.
3780
- */
3781
- get controls(): CameraControls;
3782
- /**
3783
- * Getter for the enabled state of the camera controls.
3784
- * If the current world is null, it returns false.
3785
- * Otherwise, it returns the enabled state of the camera controls.
3786
- *
3787
- * @returns {boolean} The enabled state of the camera controls.
3788
- */
3789
- get enabled(): boolean;
3790
- /**
3791
- * Setter for the enabled state of the camera controls.
3792
- * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
3793
- *
3794
- * @param {boolean} enabled - The new enabled state of the camera controls.
3795
- */
3796
- set enabled(enabled: boolean);
3797
- constructor(components: Components);
3798
- /** {@link Disposable.dispose} */
3799
- dispose(): void;
3800
- /** {@link Updateable.update} */
3801
- update(_delta: number): void;
3802
- /**
3803
- * Updates the aspect of the camera to match the size of the
3804
- * {@link Components.renderer}.
3805
- */
3806
- updateAspect: () => void;
3807
- private setupCamera;
3808
- private newCameraControls;
3809
- private setupEvents;
3810
- private static getSubsetOfThree;
3811
- }
3812
- import * as THREE from "three";
3813
- import { SimpleScene } from "./simple-scene";
3814
- import { ColorSettingsControl, NumberSettingControl, Vector3SettingControl } from "../../Types";
3815
- import { Configurator } from "../../ConfigManager";
3816
- type SimpleSceneConfigType = {
3817
- backgroundColor: ColorSettingsControl;
3818
- ambientLight: {
3819
- color: ColorSettingsControl;
3820
- intensity: NumberSettingControl;
3821
- };
3822
- directionalLight: {
3823
- color: ColorSettingsControl;
3824
- intensity: NumberSettingControl;
3825
- position: Vector3SettingControl;
3826
- };
3827
- };
3828
- declare class DirectionalLightConfig {
3829
- private _list;
3830
- private _scene;
3831
- constructor(list: SimpleSceneConfigType, scene: SimpleScene);
3832
- get color(): THREE.Color;
3833
- set color(value: THREE.Color);
3834
- get intensity(): number;
3835
- set intensity(value: number);
3836
- get position(): THREE.Vector3;
3837
- set position(value: THREE.Vector3);
3838
- }
3839
- declare class AmbientLightConfig {
3840
- private _list;
3841
- private _scene;
3842
- constructor(list: SimpleSceneConfigType, scene: SimpleScene);
3843
- get color(): THREE.Color;
3844
- set color(value: THREE.Color);
3845
- get intensity(): number;
3846
- set intensity(value: number);
3847
- }
3848
- /**
3849
- * Configuration interface for the {@link SimpleScene}.
3850
- */
3851
- export interface SimpleSceneConfig {
3852
- backgroundColor: THREE.Color;
3853
- directionalLight: {
3854
- color: THREE.Color;
3855
- intensity: number;
3856
- position: THREE.Vector3;
3857
- };
3858
- ambientLight: {
3859
- color: THREE.Color;
3860
- intensity: number;
3861
- };
3862
- }
3863
- export declare class SimpleSceneConfigManager extends Configurator<SimpleScene, SimpleSceneConfigType> {
3864
- protected _config: SimpleSceneConfigType;
3865
- ambientLight: AmbientLightConfig;
3866
- directionalLight: DirectionalLightConfig;
3867
- get backgroundColor(): THREE.Color;
3868
- set backgroundColor(value: THREE.Color);
3869
- }
3870
- export {};
3871
- import { NavigationMode } from "./types";
3872
- import { OrthoPerspectiveCamera } from "../index";
3873
- /**
3874
- * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
3875
- */
3876
- export declare class OrbitMode implements NavigationMode {
3877
- camera: OrthoPerspectiveCamera;
3878
- /** {@link NavigationMode.enabled} */
3879
- enabled: boolean;
3880
- /** {@link NavigationMode.id} */
3881
- readonly id = "Orbit";
3882
- constructor(camera: OrthoPerspectiveCamera);
3883
- /** {@link NavigationMode.set} */
3884
- set(active: boolean): void;
3885
- private activateOrbitControls;
3886
- }
3887
- import { NavigationMode } from "./types";
3888
- import { OrthoPerspectiveCamera } from "../index";
3889
- /**
3890
- * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
3891
- */
3892
- export declare class FirstPersonMode implements NavigationMode {
3893
- private camera;
3894
- /** {@link NavigationMode.enabled} */
3895
- enabled: boolean;
3896
- /** {@link NavigationMode.id} */
3897
- readonly id = "FirstPerson";
3898
- constructor(camera: OrthoPerspectiveCamera);
3899
- /** {@link NavigationMode.set} */
3900
- set(active: boolean): void;
3901
- private setupFirstPersonCamera;
3902
- }
3903
- import { NavigationMode } from "./types";
3904
- import { OrthoPerspectiveCamera } from "../index";
3905
- /**
3906
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
3907
- */
3908
- export declare class PlanMode implements NavigationMode {
3909
- private camera;
3910
- /** {@link NavigationMode.enabled} */
3911
- enabled: boolean;
3912
- /** {@link NavigationMode.id} */
3913
- readonly id = "Plan";
3914
- private mouseAction1?;
3915
- private mouseAction2?;
3916
- private mouseInitialized;
3917
- private readonly defaultAzimuthSpeed;
3918
- private readonly defaultPolarSpeed;
3919
- constructor(camera: OrthoPerspectiveCamera);
3920
- /** {@link NavigationMode.set} */
3921
- set(active: boolean): void;
3922
- }
3923
- import * as THREE from "three";
3924
- import { CameraProjection } from "./types";
3925
- import { Event } from "../../Types";
3926
- import { OrthoPerspectiveCamera } from "../index";
3927
- /**
3928
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3929
- */
3930
- export declare class ProjectionManager {
3931
- /**
3932
- * Event that fires when the {@link CameraProjection} changes.
3933
- */
3934
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
3935
- /**
3936
- * Current projection mode of the camera.
3937
- * Default is "Perspective".
3705
+ * object to move, rotate, look at objects, etc.
3938
3706
  */
3939
- current: CameraProjection;
3707
+ get controls(): CameraControls;
3940
3708
  /**
3941
- * The camera controlled by this ProjectionManager.
3942
- * It can be either a PerspectiveCamera or an OrthographicCamera.
3709
+ * Getter for the enabled state of the camera controls.
3710
+ * If the current world is null, it returns false.
3711
+ * Otherwise, it returns the enabled state of the camera controls.
3712
+ *
3713
+ * @returns {boolean} The enabled state of the camera controls.
3943
3714
  */
3944
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
3945
- /** Match Ortho zoom with Perspective distance when changing projection mode */
3946
- matchOrthoDistanceEnabled: boolean;
3947
- private _component;
3948
- private _previousDistance;
3949
- constructor(camera: OrthoPerspectiveCamera);
3715
+ get enabled(): boolean;
3950
3716
  /**
3951
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
3717
+ * Setter for the enabled state of the camera controls.
3718
+ * If the current world is not null, it sets the enabled state of the camera controls to the provided value.
3952
3719
  *
3953
- * @param projection - the new projection to set. If it is the current projection,
3954
- * it will have no effect.
3720
+ * @param {boolean} enabled - The new enabled state of the camera controls.
3955
3721
  */
3956
- set(projection: CameraProjection): Promise<void>;
3722
+ set enabled(enabled: boolean);
3723
+ constructor(components: Components);
3724
+ /** {@link Disposable.dispose} */
3725
+ dispose(): void;
3726
+ /** {@link Updateable.update} */
3727
+ update(_delta: number): void;
3957
3728
  /**
3958
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
3959
- * and vice versa.
3729
+ * Updates the aspect of the camera to match the size of the
3730
+ * {@link Components.renderer}.
3960
3731
  */
3961
- toggle(): Promise<void>;
3962
- private setOrthoCamera;
3963
- private getPerspectiveDims;
3964
- private setupOrthoCamera;
3965
- private getDistance;
3966
- private setPerspectiveCamera;
3967
- }
3968
- /**
3969
- * The projection system of the camera.
3970
- */
3971
- export type CameraProjection = "Perspective" | "Orthographic";
3972
- /**
3973
- * The extensible list of supported navigation modes.
3974
- */
3975
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
3976
- /**
3977
- * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
3978
- */
3979
- export interface NavigationMode {
3980
- /** The unique ID of this navigation mode. */
3981
- id: NavModeID;
3982
- /**
3983
- * Enable or disable this navigation mode.
3984
- * When a new navigation mode is enabled, the previous navigation mode
3985
- * must be disabled.
3986
- *
3987
- * @param active - whether to enable or disable this mode.
3988
- * @param options - any additional data required to enable or disable it.
3989
- * */
3990
- set: (active: boolean, options?: any) => void;
3991
- /** Whether this navigation mode is active or not. */
3992
- enabled: boolean;
3732
+ updateAspect: () => void;
3733
+ private setupCamera;
3734
+ private newCameraControls;
3735
+ private setupEvents;
3736
+ private static getSubsetOfThree;
3993
3737
  }
3994
3738
  import * as THREE from "three";
3995
- import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
3996
- import { Configurator } from "../../ConfigManager";
3997
- import { SimpleGrid } from "./simple-grid";
3998
- type SimpleGridConfigType = {
3999
- visible: BooleanSettingsControl;
4000
- color: ColorSettingsControl;
4001
- primarySize: NumberSettingControl;
4002
- secondarySize: NumberSettingControl;
4003
- distance: NumberSettingControl;
4004
- };
3739
+ import { Components } from "../../Components";
3740
+ import { AsyncEvent, Configurable, Event, World } from "../../Types";
3741
+ import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
4005
3742
  /**
4006
- * Configuration interface for the {@link SimpleGrid}.
3743
+ * A base renderer to determine visibility on screen.
4007
3744
  */
4008
- export interface SimpleGridConfig {
4009
- /**
4010
- * Whether the grid is visible or not.
4011
- */
4012
- visible: boolean;
3745
+ export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
3746
+ /** {@link Configurable.onSetup} */
3747
+ readonly onSetup: Event<unknown>;
3748
+ /** {@link Disposable.onDisposed} */
3749
+ readonly onDisposed: Event<string>;
4013
3750
  /**
4014
- * The color of the grid lines.
3751
+ * Fires after making the visibility check to the meshes. It lists the
3752
+ * meshes that are currently visible, and the ones that were visible
3753
+ * just before but not anymore.
4015
3754
  */
4016
- color: THREE.Color;
3755
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
4017
3756
  /**
4018
- * The size of the primary grid lines.
3757
+ * Whether this renderer is active or not. If not, it won't render anything.
4019
3758
  */
4020
- primarySize: number;
3759
+ enabled: boolean;
4021
3760
  /**
4022
- * The size of the secondary grid lines.
3761
+ * Needs to check whether there are objects that need to be hidden or shown.
3762
+ * You can bind this to the camera movement, to a certain interval, etc.
4023
3763
  */
4024
- secondarySize: number;
3764
+ needsUpdate: boolean;
3765
+ /** The components instance to which this renderer belongs. */
3766
+ components: Components;
3767
+ /** The render target used to render the visibility scene. */
3768
+ renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
4025
3769
  /**
4026
- * The distance at which the grid lines start to fade away.
3770
+ * The size of the buffer where the result of the visibility check is stored.
4027
3771
  */
4028
- distance: number;
4029
- }
4030
- export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
4031
- protected _config: SimpleGridConfigType;
3772
+ bufferSize: number;
4032
3773
  /**
4033
- * Whether the grid is visible or not.
3774
+ * The buffer when the result of the visibility check is stored.
4034
3775
  */
4035
- get visible(): boolean;
3776
+ buffer: Uint8Array;
4036
3777
  /**
4037
- * Whether the grid is visible or not.
3778
+ * Flag to indicate if the renderer shouldn't update the visibility.
4038
3779
  */
4039
- set visible(value: boolean);
3780
+ preventUpdate: boolean;
3781
+ /** {@link Configurable.config} */
3782
+ config: CullerRendererConfigManager;
3783
+ /** {@link Configurable.isSetup} */
3784
+ isSetup: boolean;
3785
+ /** The world instance to which this renderer belongs. */
3786
+ readonly world: World;
3787
+ /** The THREE.js renderer used to make the visibility test. */
3788
+ readonly renderer: THREE.WebGLRenderer;
3789
+ protected _defaultConfig: CullerRendererConfig;
3790
+ protected readonly worker: Worker;
3791
+ protected readonly scene: THREE.Scene;
3792
+ private _availableColor;
3793
+ protected _isWorkerBusy: boolean;
3794
+ constructor(components: Components, world: World);
3795
+ /** {@link Disposable.dispose} */
3796
+ dispose(): void;
4040
3797
  /**
4041
- * The color of the grid lines.
3798
+ * The function that the culler uses to reprocess the scene. Generally it's
3799
+ * better to call needsUpdate, but you can also call this to force it.
3800
+ * @param force if true, it will refresh the scene even if needsUpdate is
3801
+ * not true.
4042
3802
  */
4043
- get color(): THREE.Color;
3803
+ updateVisibility: (force?: boolean) => Promise<void>;
3804
+ setup(config?: Partial<CullerRendererConfig>): void;
3805
+ protected getAvailableColor(): {
3806
+ r: number;
3807
+ g: number;
3808
+ b: number;
3809
+ code: string;
3810
+ };
3811
+ protected increaseColor(): void;
3812
+ protected decreaseColor(): void;
3813
+ }
3814
+ import * as THREE from "three";
3815
+ import { CullerRenderer } from "./culler-renderer";
3816
+ import { Components } from "../../Components";
3817
+ import { Event, World, Disposable } from "../../Types";
3818
+ /**
3819
+ * A renderer to hide/show meshes depending on their visibility from the user's point of view.
3820
+ */
3821
+ export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
4044
3822
  /**
4045
- * The color of the grid lines.
3823
+ * Event triggered when the visibility of meshes is updated.
3824
+ * Contains two sets: seen and unseen.
4046
3825
  */
4047
- set color(value: THREE.Color);
3826
+ readonly onViewUpdated: Event<{
3827
+ seen: Set<THREE.Mesh>;
3828
+ unseen: Set<THREE.Mesh>;
3829
+ }>;
4048
3830
  /**
4049
- * The size of the primary grid lines.
3831
+ * Map of color code to THREE.InstancedMesh.
3832
+ * Used to keep track of color-coded meshes.
4050
3833
  */
4051
- get primarySize(): number;
3834
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
4052
3835
  /**
4053
- * The size of the primary grid lines.
3836
+ * @deprecated use config.threshold instead.
4054
3837
  */
4055
- set primarySize(value: number);
3838
+ get threshold(): number;
4056
3839
  /**
4057
- * The size of the secondary grid lines.
3840
+ * @deprecated use config.threshold instead.
4058
3841
  */
4059
- get secondarySize(): number;
3842
+ set threshold(value: number);
3843
+ private _colorCodeMeshMap;
3844
+ private _meshIDColorCodeMap;
3845
+ private _currentVisibleMeshes;
3846
+ private _recentlyHiddenMeshes;
3847
+ private readonly _transparentMat;
3848
+ constructor(components: Components, world: World);
3849
+ /** {@link Disposable.dispose} */
3850
+ dispose(): void;
4060
3851
  /**
4061
- * The size of the secondary grid lines.
3852
+ * Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
3853
+ * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
4062
3854
  */
4063
- set secondarySize(value: number);
3855
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
4064
3856
  /**
4065
- * The distance at which the grid lines start to fade away.
3857
+ * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
3858
+ * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
3859
+ * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
4066
3860
  */
4067
- get distance(): number;
3861
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
4068
3862
  /**
4069
- * The distance at which the grid lines start to fade away.
3863
+ * Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
3864
+ *
3865
+ * @param meshes - The meshes to update.
3866
+ *
3867
+ * @returns {void}
4070
3868
  */
4071
- set distance(value: number);
3869
+ updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
3870
+ private handleWorkerMessage;
3871
+ private getAvailableMaterial;
4072
3872
  }
4073
- export {};
4074
3873
  import * as THREE from "three";
4075
- import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
4076
- import { Components } from "../../Components";
4077
- import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
3874
+ import { SimpleScene } from "./simple-scene";
3875
+ import { ColorSettingsControl, NumberSettingControl, Vector3SettingControl } from "../../Types";
3876
+ import { Configurator } from "../../ConfigManager";
3877
+ type SimpleSceneConfigType = {
3878
+ backgroundColor: ColorSettingsControl;
3879
+ ambientLight: {
3880
+ color: ColorSettingsControl;
3881
+ intensity: NumberSettingControl;
3882
+ };
3883
+ directionalLight: {
3884
+ color: ColorSettingsControl;
3885
+ intensity: NumberSettingControl;
3886
+ position: Vector3SettingControl;
3887
+ };
3888
+ };
3889
+ declare class DirectionalLightConfig {
3890
+ private _list;
3891
+ private _scene;
3892
+ constructor(list: SimpleSceneConfigType, scene: SimpleScene);
3893
+ get color(): THREE.Color;
3894
+ set color(value: THREE.Color);
3895
+ get intensity(): number;
3896
+ set intensity(value: number);
3897
+ get position(): THREE.Vector3;
3898
+ set position(value: THREE.Vector3);
3899
+ }
3900
+ declare class AmbientLightConfig {
3901
+ private _list;
3902
+ private _scene;
3903
+ constructor(list: SimpleSceneConfigType, scene: SimpleScene);
3904
+ get color(): THREE.Color;
3905
+ set color(value: THREE.Color);
3906
+ get intensity(): number;
3907
+ set intensity(value: number);
3908
+ }
4078
3909
  /**
4079
- * 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).
3910
+ * Configuration interface for the {@link SimpleScene}.
4080
3911
  */
4081
- export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
4082
- /** {@link Disposable.onDisposed} */
4083
- readonly onDisposed: Event<unknown>;
4084
- /** {@link Configurable.onSetup} */
4085
- readonly onSetup: Event<unknown>;
4086
- /** {@link Configurable.isSetup} */
4087
- isSetup: boolean;
4088
- /** The world instance to which this Raycaster belongs. */
4089
- world: World;
4090
- /** The components instance to which this grid belongs. */
4091
- components: Components;
4092
- /** {@link Configurable.config} */
4093
- config: SimpleGridConfigManager;
4094
- protected _defaultConfig: SimpleGridConfig;
4095
- /** {@link Hideable.visible} */
4096
- get visible(): boolean;
4097
- /** {@link Hideable.visible} */
4098
- set visible(visible: boolean);
4099
- /** The material of the grid. */
4100
- get material(): THREE.ShaderMaterial;
4101
- /**
4102
- * Whether the grid should fade away with distance. Recommended to be true for
4103
- * perspective cameras and false for orthographic cameras.
4104
- */
4105
- get fade(): boolean;
4106
- /**
4107
- * Whether the grid should fade away with distance. Recommended to be true for
4108
- * perspective cameras and false for orthographic cameras.
4109
- */
4110
- set fade(active: boolean);
4111
- /** The Three.js mesh that contains the infinite grid. */
4112
- readonly three: THREE.Mesh;
4113
- private _fade;
4114
- constructor(components: Components, world: World);
4115
- /** {@link Configurable.setup} */
4116
- setup(config?: Partial<SimpleGridConfig>): void;
4117
- /** {@link Disposable.dispose} */
4118
- dispose(): void;
4119
- private setupEvents;
4120
- private updateZoom;
3912
+ export interface SimpleSceneConfig {
3913
+ backgroundColor: THREE.Color;
3914
+ directionalLight: {
3915
+ color: THREE.Color;
3916
+ intensity: number;
3917
+ position: THREE.Vector3;
3918
+ };
3919
+ ambientLight: {
3920
+ color: THREE.Color;
3921
+ intensity: number;
3922
+ };
3923
+ }
3924
+ export declare class SimpleSceneConfigManager extends Configurator<SimpleScene, SimpleSceneConfigType> {
3925
+ protected _config: SimpleSceneConfigType;
3926
+ ambientLight: AmbientLightConfig;
3927
+ directionalLight: DirectionalLightConfig;
3928
+ get backgroundColor(): THREE.Color;
3929
+ set backgroundColor(value: THREE.Color);
4121
3930
  }
3931
+ export {};
3932
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
4122
3933
  import * as THREE from "three";
4123
3934
  import { Resizeable, Updateable, World, Event, Disposable, Configurable } from "../../Types";
4124
3935
  import { MiniMapConfig, MiniMapConfigManager } from "./mini-map-config";
@@ -4219,17 +4030,6 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable, Conf
4219
4030
  setup(config?: Partial<MiniMapConfig>): void;
4220
4031
  private updatePlanes;
4221
4032
  }
4222
- import { ControlsSchema, ControlEntry } from "../../Types";
4223
- import { Components } from "../../Components";
4224
- export declare abstract class Configurator<T, U extends ControlsSchema> {
4225
- protected abstract _config: U;
4226
- protected _component: T;
4227
- name: string;
4228
- uuid: string;
4229
- get controls(): U;
4230
- constructor(component: T, components: Components, name: string, uuid?: string);
4231
- copyEntry(controlEntry: ControlEntry): ControlEntry;
4232
- }
4233
4033
  import * as THREE from "three";
4234
4034
  import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
4235
4035
  import { Configurator } from "../../ConfigManager";
@@ -4303,45 +4103,311 @@ export declare class MiniMapConfigManager extends Configurator<MiniMap, MiniMapC
4303
4103
  /**
4304
4104
  * The zoom of the camera in the minimap.
4305
4105
  */
4306
- set zoom(value: number);
4106
+ set zoom(value: number);
4107
+ /**
4108
+ * The front offset of the minimap.
4109
+ * It determines how much the minimap's view is offset from the camera's view.
4110
+ * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
4111
+ */
4112
+ get frontOffset(): number;
4113
+ /**
4114
+ * The front offset of the minimap.
4115
+ * It determines how much the minimap's view is offset from the camera's view.
4116
+ * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
4117
+ */
4118
+ set frontOffset(value: number);
4119
+ /**
4120
+ * The horizontal dimension of the minimap.
4121
+ */
4122
+ get sizeX(): number;
4123
+ /**
4124
+ * The horizontal dimension of the minimap.
4125
+ */
4126
+ set sizeX(value: number);
4127
+ /**
4128
+ * The vertical dimension of the minimap.
4129
+ */
4130
+ get sizeY(): number;
4131
+ /**
4132
+ * The vertical dimension of the minimap.
4133
+ */
4134
+ set sizeY(value: number);
4135
+ /**
4136
+ * The color of the background of the minimap.
4137
+ */
4138
+ get backgroundColor(): THREE.Color;
4139
+ /**
4140
+ * The color of the background of the minimap.
4141
+ */
4142
+ set backgroundColor(value: THREE.Color);
4143
+ }
4144
+ export {};
4145
+ import * as THREE from "three";
4146
+ import { Event, World } from "../../Types";
4147
+ import { Components } from "../../Components";
4148
+ /**
4149
+ * A base renderer to determine visibility on screen.
4150
+ */
4151
+ export declare class DistanceRenderer {
4152
+ /** {@link Disposable.onDisposed} */
4153
+ readonly onDisposed: Event<string>;
4154
+ /**
4155
+ * Fires after making the visibility check to the meshes. It lists the
4156
+ * meshes that are currently visible, and the ones that were visible
4157
+ * just before but not anymore.
4158
+ */
4159
+ readonly onDistanceComputed: Event<number>;
4160
+ /**
4161
+ * Objects that won't be taken into account in the distance check.
4162
+ */
4163
+ excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
4164
+ /**
4165
+ * Whether this renderer is active or not. If not, it won't render anything.
4166
+ */
4167
+ enabled: boolean;
4168
+ /**
4169
+ * Render the internal scene used to determine the object visibility. Used
4170
+ * for debugging purposes.
4171
+ */
4172
+ renderDebugFrame: boolean;
4173
+ /** The components instance to which this renderer belongs. */
4174
+ components: Components;
4175
+ /**
4176
+ * The scene where the distance is computed.
4177
+ */
4178
+ scene: THREE.Scene;
4179
+ /**
4180
+ * The camera used to compute the distance.
4181
+ */
4182
+ camera: THREE.OrthographicCamera;
4183
+ /**
4184
+ * The material used to compute the distance.
4185
+ */
4186
+ depthMaterial: THREE.ShaderMaterial;
4187
+ /** The world instance to which this renderer belongs. */
4188
+ readonly world: World;
4189
+ /** The THREE.js renderer used to make the visibility test. */
4190
+ readonly renderer: THREE.WebGLRenderer;
4191
+ protected readonly worker: Worker;
4192
+ private _width;
4193
+ private _height;
4194
+ private readonly _postQuad;
4195
+ private readonly tempRT;
4196
+ private readonly resultRT;
4197
+ private readonly bufferSize;
4198
+ private readonly _buffer;
4199
+ protected _isWorkerBusy: boolean;
4200
+ constructor(components: Components, world: World);
4201
+ /** {@link Disposable.dispose} */
4202
+ dispose(): void;
4203
+ /**
4204
+ * The function that the culler uses to reprocess the scene. Generally it's
4205
+ * better to call needsUpdate, but you can also call this to force it.
4206
+ * @param force if true, it will refresh the scene even if needsUpdate is
4207
+ * not true.
4208
+ */
4209
+ compute: () => Promise<void>;
4210
+ private handleWorkerMessage;
4211
+ }
4212
+ import { NavigationMode } from "./types";
4213
+ import { OrthoPerspectiveCamera } from "../index";
4214
+ /**
4215
+ * A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
4216
+ */
4217
+ export declare class OrbitMode implements NavigationMode {
4218
+ camera: OrthoPerspectiveCamera;
4219
+ /** {@link NavigationMode.enabled} */
4220
+ enabled: boolean;
4221
+ /** {@link NavigationMode.id} */
4222
+ readonly id = "Orbit";
4223
+ constructor(camera: OrthoPerspectiveCamera);
4224
+ /** {@link NavigationMode.set} */
4225
+ set(active: boolean): void;
4226
+ private activateOrbitControls;
4227
+ }
4228
+ import { NavigationMode } from "./types";
4229
+ import { OrthoPerspectiveCamera } from "../index";
4230
+ /**
4231
+ * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
4232
+ */
4233
+ export declare class FirstPersonMode implements NavigationMode {
4234
+ private camera;
4235
+ /** {@link NavigationMode.enabled} */
4236
+ enabled: boolean;
4237
+ /** {@link NavigationMode.id} */
4238
+ readonly id = "FirstPerson";
4239
+ constructor(camera: OrthoPerspectiveCamera);
4240
+ /** {@link NavigationMode.set} */
4241
+ set(active: boolean): void;
4242
+ private setupFirstPersonCamera;
4243
+ }
4244
+ import { NavigationMode } from "./types";
4245
+ import { OrthoPerspectiveCamera } from "../index";
4246
+ /**
4247
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
4248
+ */
4249
+ export declare class PlanMode implements NavigationMode {
4250
+ private camera;
4251
+ /** {@link NavigationMode.enabled} */
4252
+ enabled: boolean;
4253
+ /** {@link NavigationMode.id} */
4254
+ readonly id = "Plan";
4255
+ private mouseAction1?;
4256
+ private mouseAction2?;
4257
+ private mouseInitialized;
4258
+ private readonly defaultAzimuthSpeed;
4259
+ private readonly defaultPolarSpeed;
4260
+ constructor(camera: OrthoPerspectiveCamera);
4261
+ /** {@link NavigationMode.set} */
4262
+ set(active: boolean): void;
4263
+ }
4264
+ import * as THREE from "three";
4265
+ import { CameraProjection } from "./types";
4266
+ import { Event } from "../../Types";
4267
+ import { OrthoPerspectiveCamera } from "../index";
4268
+ /**
4269
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
4270
+ */
4271
+ export declare class ProjectionManager {
4272
+ /**
4273
+ * Event that fires when the {@link CameraProjection} changes.
4274
+ */
4275
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
4276
+ /**
4277
+ * Current projection mode of the camera.
4278
+ * Default is "Perspective".
4279
+ */
4280
+ current: CameraProjection;
4281
+ /**
4282
+ * The camera controlled by this ProjectionManager.
4283
+ * It can be either a PerspectiveCamera or an OrthographicCamera.
4284
+ */
4285
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
4286
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
4287
+ matchOrthoDistanceEnabled: boolean;
4288
+ private _component;
4289
+ private _previousDistance;
4290
+ constructor(camera: OrthoPerspectiveCamera);
4307
4291
  /**
4308
- * The front offset of the minimap.
4309
- * It determines how much the minimap's view is offset from the camera's view.
4310
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
4292
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
4293
+ *
4294
+ * @param projection - the new projection to set. If it is the current projection,
4295
+ * it will have no effect.
4311
4296
  */
4312
- get frontOffset(): number;
4297
+ set(projection: CameraProjection): Promise<void>;
4313
4298
  /**
4314
- * The front offset of the minimap.
4315
- * It determines how much the minimap's view is offset from the camera's view.
4316
- * By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
4299
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
4300
+ * and vice versa.
4317
4301
  */
4318
- set frontOffset(value: number);
4302
+ toggle(): Promise<void>;
4303
+ private setOrthoCamera;
4304
+ private getPerspectiveDims;
4305
+ private setupOrthoCamera;
4306
+ private getDistance;
4307
+ private setPerspectiveCamera;
4308
+ }
4309
+ /**
4310
+ * The projection system of the camera.
4311
+ */
4312
+ export type CameraProjection = "Perspective" | "Orthographic";
4313
+ /**
4314
+ * The extensible list of supported navigation modes.
4315
+ */
4316
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
4317
+ /**
4318
+ * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
4319
+ */
4320
+ export interface NavigationMode {
4321
+ /** The unique ID of this navigation mode. */
4322
+ id: NavModeID;
4319
4323
  /**
4320
- * The horizontal dimension of the minimap.
4321
- */
4322
- get sizeX(): number;
4324
+ * Enable or disable this navigation mode.
4325
+ * When a new navigation mode is enabled, the previous navigation mode
4326
+ * must be disabled.
4327
+ *
4328
+ * @param active - whether to enable or disable this mode.
4329
+ * @param options - any additional data required to enable or disable it.
4330
+ * */
4331
+ set: (active: boolean, options?: any) => void;
4332
+ /** Whether this navigation mode is active or not. */
4333
+ enabled: boolean;
4334
+ }
4335
+ import * as THREE from "three";
4336
+ import { Disposable, Event } from "../../Types";
4337
+ /**
4338
+ * 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.
4339
+ */
4340
+ export declare class Mouse implements Disposable {
4341
+ dom: HTMLCanvasElement;
4342
+ private _event?;
4343
+ private _position;
4344
+ /** {@link Disposable.onDisposed} */
4345
+ readonly onDisposed: Event<unknown>;
4346
+ constructor(dom: HTMLCanvasElement);
4323
4347
  /**
4324
- * The horizontal dimension of the minimap.
4348
+ * The real position of the mouse of the Three.js canvas.
4325
4349
  */
4326
- set sizeX(value: number);
4350
+ get position(): THREE.Vector2;
4351
+ /** {@link Disposable.dispose} */
4352
+ dispose(): void;
4353
+ private getPositionY;
4354
+ private getPositionX;
4355
+ private updateMouseInfo;
4356
+ private getDataObject;
4357
+ private setupEvents;
4358
+ }
4359
+ import * as THREE from "three";
4360
+ import { Components } from "../../Components";
4361
+ import { Event, World, Disposable } from "../../Types";
4362
+ import { Mouse } from "./mouse";
4363
+ /**
4364
+ * 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.
4365
+ */
4366
+ export declare class SimpleRaycaster implements Disposable {
4367
+ /** {@link Component.enabled} */
4368
+ enabled: boolean;
4369
+ /** The components instance to which this Raycaster belongs. */
4370
+ components: Components;
4371
+ /** {@link Disposable.onDisposed} */
4372
+ readonly onDisposed: Event<unknown>;
4373
+ /** The position of the mouse in the screen. */
4374
+ readonly mouse: Mouse;
4327
4375
  /**
4328
- * The vertical dimension of the minimap.
4376
+ * A reference to the Three.js Raycaster instance.
4377
+ * This is used for raycasting operations.
4329
4378
  */
4330
- get sizeY(): number;
4379
+ readonly three: THREE.Raycaster;
4331
4380
  /**
4332
- * The vertical dimension of the minimap.
4381
+ * A reference to the world instance to which this Raycaster belongs.
4382
+ * This is used to access the camera and meshes.
4333
4383
  */
4334
- set sizeY(value: number);
4384
+ world: World;
4385
+ constructor(components: Components, world: World);
4386
+ /** {@link Disposable.dispose} */
4387
+ dispose(): void;
4335
4388
  /**
4336
- * The color of the background of the minimap.
4389
+ * Throws a ray from the camera to the mouse or touch event point and returns
4390
+ * the first item found. This also takes into account the clipping planes
4391
+ * used by the renderer.
4392
+ *
4393
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
4394
+ * to query. If not provided, it will query all the meshes stored in
4395
+ * {@link Components.meshes}.
4337
4396
  */
4338
- get backgroundColor(): THREE.Color;
4397
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
4339
4398
  /**
4340
- * The color of the background of the minimap.
4399
+ * Casts a ray from a given origin in a given direction and returns the first item found.
4400
+ * This method also takes into account the clipping planes used by the renderer.
4401
+ *
4402
+ * @param origin - The origin of the ray.
4403
+ * @param direction - The direction of the ray.
4404
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
4405
+ * @returns The first intersection found or 'null' if no intersection was found.
4341
4406
  */
4342
- set backgroundColor(value: THREE.Color);
4407
+ 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;
4408
+ private intersect;
4409
+ private filterClippingPlanes;
4343
4410
  }
4344
- export {};
4345
4411
  import { SimplePlane } from "../../Clipper";
4346
4412
  import { DataSet } from "../../Types";
4347
4413
  export interface ViewpointCamera {
@@ -4379,73 +4445,6 @@ export interface BCFViewpoint {
4379
4445
  defaultVisibility: boolean;
4380
4446
  }
4381
4447
  import * as THREE from "three";
4382
- import { Event, World } from "../../Types";
4383
- import { Components } from "../../Components";
4384
- /**
4385
- * A base renderer to determine visibility on screen.
4386
- */
4387
- export declare class DistanceRenderer {
4388
- /** {@link Disposable.onDisposed} */
4389
- readonly onDisposed: Event<string>;
4390
- /**
4391
- * Fires after making the visibility check to the meshes. It lists the
4392
- * meshes that are currently visible, and the ones that were visible
4393
- * just before but not anymore.
4394
- */
4395
- readonly onDistanceComputed: Event<number>;
4396
- /**
4397
- * Objects that won't be taken into account in the distance check.
4398
- */
4399
- excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
4400
- /**
4401
- * Whether this renderer is active or not. If not, it won't render anything.
4402
- */
4403
- enabled: boolean;
4404
- /**
4405
- * Render the internal scene used to determine the object visibility. Used
4406
- * for debugging purposes.
4407
- */
4408
- renderDebugFrame: boolean;
4409
- /** The components instance to which this renderer belongs. */
4410
- components: Components;
4411
- /**
4412
- * The scene where the distance is computed.
4413
- */
4414
- scene: THREE.Scene;
4415
- /**
4416
- * The camera used to compute the distance.
4417
- */
4418
- camera: THREE.OrthographicCamera;
4419
- /**
4420
- * The material used to compute the distance.
4421
- */
4422
- depthMaterial: THREE.ShaderMaterial;
4423
- /** The world instance to which this renderer belongs. */
4424
- readonly world: World;
4425
- /** The THREE.js renderer used to make the visibility test. */
4426
- readonly renderer: THREE.WebGLRenderer;
4427
- protected readonly worker: Worker;
4428
- private _width;
4429
- private _height;
4430
- private readonly _postQuad;
4431
- private readonly tempRT;
4432
- private readonly resultRT;
4433
- private readonly bufferSize;
4434
- private readonly _buffer;
4435
- protected _isWorkerBusy: boolean;
4436
- constructor(components: Components, world: World);
4437
- /** {@link Disposable.dispose} */
4438
- dispose(): void;
4439
- /**
4440
- * The function that the culler uses to reprocess the scene. Generally it's
4441
- * better to call needsUpdate, but you can also call this to force it.
4442
- * @param force if true, it will refresh the scene even if needsUpdate is
4443
- * not true.
4444
- */
4445
- compute: () => Promise<void>;
4446
- private handleWorkerMessage;
4447
- }
4448
- import * as THREE from "three";
4449
4448
  import * as FRAGS from "@thatopen/fragments";
4450
4449
  import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
4451
4450
  import { CameraProjection } from "../../OrthoPerspectiveCamera";
@@ -4741,54 +4740,135 @@ export declare class SimplePlane implements Disposable, Hideable {
4741
4740
  private newHelper;
4742
4741
  private static newPlaneMesh;
4743
4742
  }
4744
- import { IfcFragmentSettings } from "../../IfcLoader/src";
4745
- /**
4746
- * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
4747
- */
4748
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
4749
- /**
4750
- * Minimum number of geometries to be streamed.
4751
- * Defaults to 10 geometries.
4752
- */
4753
- minGeometrySize: number;
4754
- /**
4755
- * Minimum amount of assets to be streamed.
4756
- * Defaults to 1000 assets.
4757
- */
4758
- minAssetsSize: number;
4759
- /**
4760
- * Maximum amount of triangles per fragment. Useful for controlling the maximum size of fragment files.
4761
- */
4762
- maxTriangles: number | null;
4743
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
4744
+ /**
4745
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
4746
+ */
4747
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
4748
+ /**
4749
+ * Amount of properties to be streamed.
4750
+ * Defaults to 100 properties.
4751
+ */
4752
+ propertiesSize: number;
4753
+ }
4754
+ import * as THREE from "three";
4755
+ import * as WEBIFC from "web-ifc";
4756
+ import * as FRAGS from "@thatopen/fragments";
4757
+ export declare class CivilReader {
4758
+ defLineMat: THREE.LineBasicMaterial;
4759
+ read(webIfc: WEBIFC.IfcAPI): {
4760
+ alignments: Map<number, FRAGS.Alignment>;
4761
+ coordinationMatrix: THREE.Matrix4;
4762
+ } | undefined;
4763
+ get(civilItems: any): {
4764
+ alignments: Map<number, FRAGS.Alignment>;
4765
+ coordinationMatrix: THREE.Matrix4;
4766
+ } | undefined;
4767
+ private getCurves;
4768
+ }
4769
+ import * as WEBIFC from "web-ifc";
4770
+ export declare class IfcMetadataReader {
4771
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
4772
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
4773
+ }
4774
+ import { Components } from "../../../../core/Components";
4775
+ import { IDSFacet } from "../facets";
4776
+ export declare const createEntityFacets: (components: Components, elements: any) => IDSFacet[];
4777
+ import { Components } from "../../../../core/Components";
4778
+ import { IDSFacet } from "../facets";
4779
+ export declare const createAttributeFacets: (components: Components, elements: any) => IDSFacet[];
4780
+ import { Components } from "../../../../core/Components";
4781
+ import { IDSFacet } from "../facets";
4782
+ export declare const createClassificationFacets: (components: Components, elements: any) => IDSFacet[];
4783
+ export type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2";
4784
+ export type IDSFacetParameterName = "Name" | "PredefinedType" | "Value" | "System" | "URI" | "PropertySet" | "BaseName" | "DataType" | "Value" | "Entity" | "Relation";
4785
+ export type IDSSimpleCardinality = "required" | "prohibited";
4786
+ export type IDSConditionalCardinaltiy = IDSSimpleCardinality | "optional";
4787
+ export type IDSSimpleParameter = string | number | boolean;
4788
+ export type IDSEnumerationParameter = string[] | number[] | boolean[];
4789
+ export type IDSPatternParameter = string;
4790
+ export type IDSBoundsParameter = {
4791
+ min?: number;
4792
+ minInclusive?: boolean;
4793
+ max?: number;
4794
+ maxInclusive?: boolean;
4795
+ };
4796
+ export type IDSLengthParameter = {
4797
+ min?: number;
4798
+ length?: number;
4799
+ max?: number;
4800
+ };
4801
+ export interface IDSRestrictionParameter {
4802
+ }
4803
+ export type IDSFacetParameterType = "simple" | "enumeration" | "pattern" | "bounds" | "length";
4804
+ export interface IDSFacetParameter {
4805
+ type: IDSFacetParameterType;
4806
+ parameter: IDSSimpleParameter | IDSEnumerationParameter | IDSPatternParameter | IDSBoundsParameter | IDSLengthParameter;
4807
+ }
4808
+ export interface IDSCheck {
4809
+ parameter: IDSFacetParameterName;
4810
+ currentValue: string | number | boolean | null;
4811
+ requiredValue: any;
4812
+ pass: boolean;
4763
4813
  }
4764
4814
  /**
4765
- * 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.
4815
+ * Represents the result of a check performed by an IDSFacet test.
4766
4816
  */
4767
- export interface StreamedGeometries {
4768
- [id: number]: {
4769
- /** The bounding box of the geometry as a Float32Array. */
4770
- boundingBox: Float32Array;
4771
- /** A boolean indicating whether the geometry has holes. */
4772
- hasHoles: boolean;
4773
- /** An optional file path for the geometry data. */
4774
- geometryFile?: string;
4775
- };
4817
+ export interface IDSCheckResult {
4818
+ guid?: string;
4819
+ expressID: number;
4820
+ pass: boolean;
4821
+ checks: IDSCheck[];
4822
+ cardinality: IDSConditionalCardinaltiy;
4823
+ }
4824
+ export interface IDSInfo {
4825
+ title: string;
4826
+ description?: string;
4827
+ copyright?: string;
4828
+ version?: string;
4829
+ author?: string;
4830
+ date?: Date;
4831
+ purpose?: string;
4832
+ milestone?: string;
4776
4833
  }
4834
+ import * as FRAGS from "@thatopen/fragments";
4835
+ import { Components } from "../../../core/Components";
4836
+ import { DataSet } from "../../../core/Types";
4837
+ import { IDSCheckResult, IfcVersion } from "./types";
4838
+ import { IDSFacet } from "./facets";
4777
4839
  /**
4778
- * 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.
4840
+ * Represents a single specification from the Information Delivery Specification (IDS) standard.
4841
+ *
4842
+ * @remarks This class provides methods for testing a model against the specification,
4843
+ * as well as serializing the specification into XML format.
4779
4844
  */
4780
- export interface StreamedAsset {
4781
- /** The unique identifier of the asset. */
4782
- id: number;
4783
- /** An array of geometries associated with the asset. */
4784
- geometries: {
4785
- /** The unique identifier of the geometry. */
4786
- geometryID: number;
4787
- /** The transformation matrix of the geometry as a number array. */
4788
- transformation: number[];
4789
- /** The color of the geometry as a number array. */
4790
- color: number[];
4791
- }[];
4845
+ export declare class IDSSpecification {
4846
+ name: string;
4847
+ ifcVersion: Set<IfcVersion>;
4848
+ identifier: string;
4849
+ description?: string;
4850
+ instructions?: string;
4851
+ requirementsDescription?: string;
4852
+ applicability: DataSet<IDSFacet>;
4853
+ requirements: DataSet<IDSFacet>;
4854
+ protected components: Components;
4855
+ constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
4856
+ /**
4857
+ * Tests the model to test against the specification's requirements.
4858
+ *
4859
+ * @param model - The model to be tested.
4860
+ * @returns An array representing the test results.
4861
+ * If no requirements are defined for the specification, an empty array is returned.
4862
+ */
4863
+ test(model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
4864
+ /**
4865
+ * Serializes the IDSSpecification instance into XML format.
4866
+ *
4867
+ * @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
4868
+ *
4869
+ * @returns The XML representation of the IDSSpecification.
4870
+ */
4871
+ serialize(): string;
4792
4872
  }
4793
4873
  /**
4794
4874
  * A rule for the {@link IfcFinder} to search items based on their category.
@@ -4874,26 +4954,6 @@ export type SerializedQuery = {
4874
4954
  [key: string]: any;
4875
4955
  }[];
4876
4956
  };
4877
- import * as WEBIFC from "web-ifc";
4878
- export declare class IfcMetadataReader {
4879
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
4880
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
4881
- }
4882
- import * as THREE from "three";
4883
- import * as WEBIFC from "web-ifc";
4884
- import * as FRAGS from "@thatopen/fragments";
4885
- export declare class CivilReader {
4886
- defLineMat: THREE.LineBasicMaterial;
4887
- read(webIfc: WEBIFC.IfcAPI): {
4888
- alignments: Map<number, FRAGS.Alignment>;
4889
- coordinationMatrix: THREE.Matrix4;
4890
- } | undefined;
4891
- get(civilItems: any): {
4892
- alignments: Map<number, FRAGS.Alignment>;
4893
- coordinationMatrix: THREE.Matrix4;
4894
- } | undefined;
4895
- private getCurves;
4896
- }
4897
4957
  import * as FRAGS from "@thatopen/fragments";
4898
4958
  import { IfcFinderRule, SerializedQuery } from "./types";
4899
4959
  import { Components, Event } from "../../../core";
@@ -4991,13 +5051,13 @@ export declare abstract class IfcFinderQuery {
4991
5051
  protected getAttributesFromLine(line: string): string[] | null;
4992
5052
  }
4993
5053
  import * as FRAGS from "@thatopen/fragments";
5054
+ import { IfcFinderRule, SerializedQuery } from "./types";
4994
5055
  import { IfcFinderQuery } from "./ifc-finder-query";
4995
- import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types";
4996
5056
  import { Components } from "../../../core";
4997
5057
  /**
4998
- * A query that checks the properties in the property sets assigned to IFC items.
5058
+ * A query that checks the direct attributes of IFC items.
4999
5059
  */
5000
- export declare class IfcPropertyQuery extends IfcFinderQuery {
5060
+ export declare class IfcBasicQuery extends IfcFinderQuery {
5001
5061
  /**
5002
5062
  * {@link IfcFinderQuery.name}
5003
5063
  */
@@ -5005,16 +5065,15 @@ export declare class IfcPropertyQuery extends IfcFinderQuery {
5005
5065
  /**
5006
5066
  * The type of this query.
5007
5067
  */
5008
- static type: "IfcPropertyQuery";
5009
- private psets;
5068
+ static type: "IfcBasicQuery";
5010
5069
  /**
5011
5070
  * {@link IfcFinderQuery.items}
5012
5071
  */
5013
5072
  get items(): FRAGS.FragmentIdMap;
5014
5073
  constructor(components: Components, data: {
5015
5074
  name: string;
5075
+ rules: IfcFinderRule[];
5016
5076
  inclusive: boolean;
5017
- rules: (IfcPropertyRule | IfcOperatorRule)[];
5018
5077
  });
5019
5078
  /**
5020
5079
  * {@link IfcFinderQuery.export}
@@ -5026,75 +5085,21 @@ export declare class IfcPropertyQuery extends IfcFinderQuery {
5026
5085
  update(modelID: string, file: File): Promise<void>;
5027
5086
  protected findInLines(modelID: string, lines: string[]): void;
5028
5087
  }
5029
- import * as WEBIFC from "web-ifc";
5030
- import * as THREE from "three";
5031
- export declare class Units {
5032
- factor: number;
5033
- complement: number;
5034
- apply(matrix: THREE.Matrix4): void;
5035
- setUp(webIfc: WEBIFC.IfcAPI): void;
5036
- private getLengthUnits;
5037
- private getScaleMatrix;
5038
- }
5039
- export type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2";
5040
- export type IDSFacetParameterName = "Name" | "PredefinedType" | "Value" | "System" | "URI" | "PropertySet" | "BaseName" | "DataType" | "Value" | "Entity" | "Relation";
5041
- export type IDSSimpleCardinality = "required" | "prohibited";
5042
- export type IDSConditionalCardinaltiy = IDSSimpleCardinality | "optional";
5043
- export type IDSSimpleParameter = string | number | boolean;
5044
- export type IDSEnumerationParameter = string[] | number[] | boolean[];
5045
- export type IDSPatternParameter = string;
5046
- export type IDSBoundsParameter = {
5047
- min?: number;
5048
- minInclusive?: boolean;
5049
- max?: number;
5050
- maxInclusive?: boolean;
5051
- };
5052
- export type IDSLengthParameter = {
5053
- min?: number;
5054
- length?: number;
5055
- max?: number;
5088
+ import { IfcRelName } from "./types";
5089
+ type IfcRelAttributePosition = {
5090
+ related: number;
5091
+ relating: number;
5056
5092
  };
5057
- export interface IDSRestrictionParameter {
5058
- }
5059
- export type IDSFacetParameterType = "simple" | "enumeration" | "pattern" | "bounds" | "length";
5060
- export interface IDSFacetParameter {
5061
- type: IDSFacetParameterType;
5062
- parameter: IDSSimpleParameter | IDSEnumerationParameter | IDSPatternParameter | IDSBoundsParameter | IDSLengthParameter;
5063
- }
5064
- export interface IDSCheck {
5065
- parameter: IDSFacetParameterName;
5066
- currentValue: string | number | boolean | null;
5067
- requiredValue: any;
5068
- pass: boolean;
5069
- }
5070
- /**
5071
- * Represents the result of a check performed by an IDSFacet test.
5072
- */
5073
- export interface IDSCheckResult {
5074
- guid?: string;
5075
- expressID: number;
5076
- pass: boolean;
5077
- checks: IDSCheck[];
5078
- cardinality: IDSConditionalCardinaltiy;
5079
- }
5080
- export interface IDSInfo {
5081
- title: string;
5082
- description?: string;
5083
- copyright?: string;
5084
- version?: string;
5085
- author?: string;
5086
- date?: Date;
5087
- purpose?: string;
5088
- milestone?: string;
5089
- }
5093
+ export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
5094
+ export {};
5090
5095
  import * as FRAGS from "@thatopen/fragments";
5091
- import { IfcFinderRule, SerializedQuery } from "./types";
5092
5096
  import { IfcFinderQuery } from "./ifc-finder-query";
5097
+ import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types";
5093
5098
  import { Components } from "../../../core";
5094
5099
  /**
5095
- * A query that checks the direct attributes of IFC items.
5100
+ * A query that checks the properties in the property sets assigned to IFC items.
5096
5101
  */
5097
- export declare class IfcBasicQuery extends IfcFinderQuery {
5102
+ export declare class IfcPropertyQuery extends IfcFinderQuery {
5098
5103
  /**
5099
5104
  * {@link IfcFinderQuery.name}
5100
5105
  */
@@ -5102,73 +5107,28 @@ export declare class IfcBasicQuery extends IfcFinderQuery {
5102
5107
  /**
5103
5108
  * The type of this query.
5104
5109
  */
5105
- static type: "IfcBasicQuery";
5110
+ static type: "IfcPropertyQuery";
5111
+ private psets;
5106
5112
  /**
5107
5113
  * {@link IfcFinderQuery.items}
5108
5114
  */
5109
5115
  get items(): FRAGS.FragmentIdMap;
5110
5116
  constructor(components: Components, data: {
5111
5117
  name: string;
5112
- rules: IfcFinderRule[];
5113
- inclusive: boolean;
5114
- });
5115
- /**
5116
- * {@link IfcFinderQuery.export}
5117
- */
5118
- export(): SerializedQuery;
5119
- /**
5120
- * {@link IfcFinderQuery.update}
5121
- */
5122
- update(modelID: string, file: File): Promise<void>;
5123
- protected findInLines(modelID: string, lines: string[]): void;
5124
- }
5125
- import * as FRAGS from "@thatopen/fragments";
5126
- import { Components } from "../../../core/Components";
5127
- import { DataSet } from "../../../core/Types";
5128
- import { IDSCheckResult, IfcVersion } from "./types";
5129
- import { IDSFacet } from "./facets";
5130
- /**
5131
- * Represents a single specification from the Information Delivery Specification (IDS) standard.
5132
- *
5133
- * @remarks This class provides methods for testing a model against the specification,
5134
- * as well as serializing the specification into XML format.
5135
- */
5136
- export declare class IDSSpecification {
5137
- name: string;
5138
- ifcVersion: Set<IfcVersion>;
5139
- identifier: string;
5140
- description?: string;
5141
- instructions?: string;
5142
- requirementsDescription?: string;
5143
- applicability: DataSet<IDSFacet>;
5144
- requirements: DataSet<IDSFacet>;
5145
- protected components: Components;
5146
- constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
5147
- /**
5148
- * Tests the model to test against the specification's requirements.
5149
- *
5150
- * @param model - The model to be tested.
5151
- * @returns An array representing the test results.
5152
- * If no requirements are defined for the specification, an empty array is returned.
5118
+ inclusive: boolean;
5119
+ rules: (IfcPropertyRule | IfcOperatorRule)[];
5120
+ });
5121
+ /**
5122
+ * {@link IfcFinderQuery.export}
5153
5123
  */
5154
- test(model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5124
+ export(): SerializedQuery;
5155
5125
  /**
5156
- * Serializes the IDSSpecification instance into XML format.
5157
- *
5158
- * @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
5159
- *
5160
- * @returns The XML representation of the IDSSpecification.
5126
+ * {@link IfcFinderQuery.update}
5161
5127
  */
5162
- serialize(): string;
5128
+ update(modelID: string, file: File): Promise<void>;
5129
+ protected findInLines(modelID: string, lines: string[]): void;
5163
5130
  }
5164
5131
  import { IfcRelName } from "./types";
5165
- type IfcRelAttributePosition = {
5166
- related: number;
5167
- relating: number;
5168
- };
5169
- export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
5170
- export {};
5171
- import { IfcRelName } from "./types";
5172
5132
  import { IfcRelation } from "../../IfcRelationsIndexer";
5173
5133
  export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
5174
5134
  export type IfcRelationNames = [
@@ -5189,16 +5149,66 @@ export type IfcRelationNames = [
5189
5149
  "IfcRelDefinesByTemplate"
5190
5150
  ];
5191
5151
  export type IfcRelName = IfcRelationNames[number];
5152
+ import * as WEBIFC from "web-ifc";
5153
+ import * as THREE from "three";
5154
+ export declare class Units {
5155
+ factor: number;
5156
+ complement: number;
5157
+ apply(matrix: THREE.Matrix4): void;
5158
+ setUp(webIfc: WEBIFC.IfcAPI): void;
5159
+ private getLengthUnits;
5160
+ private getScaleMatrix;
5161
+ }
5162
+ import { IDSFacetParameter } from "../types";
5163
+ export declare const getParameterValue: (property: any) => IDSFacetParameter | undefined;
5192
5164
  import { IfcFragmentSettings } from "../../IfcLoader/src";
5193
5165
  /**
5194
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
5166
+ * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
5195
5167
  */
5196
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
5168
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
5197
5169
  /**
5198
- * Amount of properties to be streamed.
5199
- * Defaults to 100 properties.
5170
+ * Minimum number of geometries to be streamed.
5171
+ * Defaults to 10 geometries.
5200
5172
  */
5201
- propertiesSize: number;
5173
+ minGeometrySize: number;
5174
+ /**
5175
+ * Minimum amount of assets to be streamed.
5176
+ * Defaults to 1000 assets.
5177
+ */
5178
+ minAssetsSize: number;
5179
+ /**
5180
+ * Maximum amount of triangles per fragment. Useful for controlling the maximum size of fragment files.
5181
+ */
5182
+ maxTriangles: number | null;
5183
+ }
5184
+ /**
5185
+ * 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.
5186
+ */
5187
+ export interface StreamedGeometries {
5188
+ [id: number]: {
5189
+ /** The bounding box of the geometry as a Float32Array. */
5190
+ boundingBox: Float32Array;
5191
+ /** A boolean indicating whether the geometry has holes. */
5192
+ hasHoles: boolean;
5193
+ /** An optional file path for the geometry data. */
5194
+ geometryFile?: string;
5195
+ };
5196
+ }
5197
+ /**
5198
+ * 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.
5199
+ */
5200
+ export interface StreamedAsset {
5201
+ /** The unique identifier of the asset. */
5202
+ id: number;
5203
+ /** An array of geometries associated with the asset. */
5204
+ geometries: {
5205
+ /** The unique identifier of the geometry. */
5206
+ geometryID: number;
5207
+ /** The transformation matrix of the geometry as a number array. */
5208
+ transformation: number[];
5209
+ /** The color of the geometry as a number array. */
5210
+ color: number[];
5211
+ }[];
5202
5212
  }
5203
5213
  import * as WEBIFC from "web-ifc";
5204
5214
  export type RelationsMap = Map<number, Map<number, number[]>>;
@@ -5257,15 +5267,6 @@ export type IfcRelations = [
5257
5267
  typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
5258
5268
  ];
5259
5269
  export type IfcRelation = IfcRelations[number];
5260
- import { Components } from "../../../../core/Components";
5261
- import { IDSFacet } from "../facets";
5262
- export declare const createEntityFacets: (components: Components, elements: any) => IDSFacet[];
5263
- import { Components } from "../../../../core/Components";
5264
- import { IDSFacet } from "../facets";
5265
- export declare const createAttributeFacets: (components: Components, elements: any) => IDSFacet[];
5266
- import { Components } from "../../../../core/Components";
5267
- import { IDSFacet } from "../facets";
5268
- export declare const createClassificationFacets: (components: Components, elements: any) => IDSFacet[];
5269
5270
  import { Components } from "../../../core/Components";
5270
5271
  import { Viewpoint } from "../../../core/Viewpoints";
5271
5272
  import { Comment } from "./Comment";
@@ -5389,6 +5390,25 @@ export declare class Topic implements BCFTopic {
5389
5390
  */
5390
5391
  serialize(): string;
5391
5392
  }
5393
+ export type BCFVersion = "2.1" | "3";
5394
+ export interface BCFTopic {
5395
+ guid: string;
5396
+ serverAssignedId?: string;
5397
+ type: string;
5398
+ status: string;
5399
+ title: string;
5400
+ priority?: string;
5401
+ index?: number;
5402
+ labels: Set<string>;
5403
+ creationDate: Date;
5404
+ creationAuthor: string;
5405
+ modifiedDate?: Date;
5406
+ modifiedAuthor?: string;
5407
+ dueDate?: Date;
5408
+ assignedTo?: string;
5409
+ description?: string;
5410
+ stage?: string;
5411
+ }
5392
5412
  import { Topic } from "..";
5393
5413
  import { Viewpoint } from "../../../core/Viewpoints";
5394
5414
  import { Components } from "../../../core/Components";
@@ -5429,27 +5449,6 @@ export declare class Comment {
5429
5449
  */
5430
5450
  serialize(): string;
5431
5451
  }
5432
- export type BCFVersion = "2.1" | "3";
5433
- export interface BCFTopic {
5434
- guid: string;
5435
- serverAssignedId?: string;
5436
- type: string;
5437
- status: string;
5438
- title: string;
5439
- priority?: string;
5440
- index?: number;
5441
- labels: Set<string>;
5442
- creationDate: Date;
5443
- creationAuthor: string;
5444
- modifiedDate?: Date;
5445
- modifiedAuthor?: string;
5446
- dueDate?: Date;
5447
- assignedTo?: string;
5448
- description?: string;
5449
- stage?: string;
5450
- }
5451
- import { IDSFacetParameter } from "../types";
5452
- export declare const getParameterValue: (property: any) => IDSFacetParameter | undefined;
5453
5452
  import { BCFTopics, BCFVersion } from "../index";
5454
5453
  import { BooleanSettingsControl, Configurator, SelectSettingControl, TextSetSettingControl, TextSettingsControl } from "../../../core";
5455
5454
  /**
@@ -5572,6 +5571,18 @@ export declare class BCFTopicsConfigManager extends Configurator<BCFTopics, BCFT
5572
5571
  set ignoreIncompleteTopicsOnImport(value: boolean);
5573
5572
  }
5574
5573
  export {};
5574
+ import * as FRAGS from "@thatopen/fragments";
5575
+ import { IDSCheckResult, IDSFacetParameter } from "../types";
5576
+ import { Components } from "../../../../core/Components";
5577
+ import { IDSFacet } from "./Facet";
5578
+ export declare class IDSAttribute extends IDSFacet {
5579
+ name: IDSFacetParameter;
5580
+ value?: IDSFacetParameter;
5581
+ constructor(components: Components, name: IDSFacetParameter);
5582
+ serialize(type: "applicability" | "requirement"): string;
5583
+ getEntities(): Promise<never[]>;
5584
+ test(entities: FRAGS.IfcProperties): Promise<IDSCheckResult[]>;
5585
+ }
5575
5586
  import { BooleanSettingsControl, NumberSettingControl } from "../../Types";
5576
5587
  import { Configurator } from "../../ConfigManager";
5577
5588
  import { CullerRenderer } from "../index";
@@ -5648,28 +5659,23 @@ export declare class CullerRendererConfigManager extends Configurator<CullerRend
5648
5659
  export {};
5649
5660
  import * as FRAGS from "@thatopen/fragments";
5650
5661
  import { Components } from "../../../../core/Components";
5651
- import { IDSFacetParameter, IDSCheckResult, IDSFacetParameterName, IDSCheck, IDSConditionalCardinaltiy, IDSSimpleCardinality } from "../types";
5652
- export declare abstract class IDSFacet {
5653
- protected components: Components;
5654
- cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
5655
- instructions?: string;
5656
- constructor(components: Components);
5657
- protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
5658
- protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
5659
- protected testResult: IDSCheckResult[];
5660
- protected saveResult(attrs: any, pass: boolean): void;
5661
- /**
5662
- * Returns the list of expressIDs that pass the criteria of this facet.
5663
- * @param model - The IFC model to retrieve entities from.
5664
- * @param collector - An optional object to collect the retrieved entities.
5665
- * @remarks
5666
- * If the collector already includes the entity, it won't get processed any further.
5667
- *
5668
- * @returns An array of express IDs of the retrieved entities.
5669
- */
5670
- abstract getEntities(model: FRAGS.FragmentsGroup, collector: FRAGS.IfcProperties): Promise<number[]>;
5671
- abstract test(entities: FRAGS.IfcProperties, model?: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5672
- abstract serialize(type: "applicability" | "requirement"): string;
5662
+ import { IDSCheckResult, IDSFacetParameter } from "../types";
5663
+ import { IDSFacet } from "./Facet";
5664
+ export declare class IDSClassification extends IDSFacet {
5665
+ system: IDSFacetParameter;
5666
+ value?: IDSFacetParameter;
5667
+ uri?: string;
5668
+ constructor(components: Components, system: IDSFacetParameter);
5669
+ serialize(type: "applicability" | "requirement"): string;
5670
+ getEntities(model: FRAGS.FragmentsGroup, collector?: FRAGS.IfcProperties): Promise<number[]>;
5671
+ test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5672
+ private processReferencedSource;
5673
+ private getSystems;
5674
+ private getSystemName;
5675
+ private getAllReferenceIdentifications;
5676
+ private evalSystem;
5677
+ private evalValue;
5678
+ private evalURI;
5673
5679
  }
5674
5680
  import * as FRAGS from "@thatopen/fragments";
5675
5681
  import { Components } from "../../../../core/Components";
@@ -5702,6 +5708,8 @@ export declare class IDSProperty extends IDSFacet {
5702
5708
  test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5703
5709
  private getItemsAttrName;
5704
5710
  private getValueKey;
5711
+ private getPsetProps;
5712
+ private getTypePsets;
5705
5713
  private getPsets;
5706
5714
  private evalValue;
5707
5715
  private evalDataType;
@@ -5709,43 +5717,47 @@ export declare class IDSProperty extends IDSFacet {
5709
5717
  }
5710
5718
  import * as FRAGS from "@thatopen/fragments";
5711
5719
  import { Components } from "../../../../core/Components";
5712
- import { IDSCheckResult, IDSFacetParameter } from "../types";
5713
- import { IDSFacet } from "./Facet";
5714
- export declare class IDSClassification extends IDSFacet {
5715
- system: IDSFacetParameter;
5716
- value?: IDSFacetParameter;
5717
- uri?: string;
5718
- constructor(components: Components, system: IDSFacetParameter);
5719
- serialize(type: "applicability" | "requirement"): string;
5720
- getEntities(model: FRAGS.FragmentsGroup, collector?: FRAGS.IfcProperties): Promise<number[]>;
5721
- test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5722
- private processReferencedSource;
5723
- private getSystems;
5724
- private getSystemName;
5725
- private getAllReferenceIdentifications;
5726
- private evalSystem;
5727
- private evalValue;
5728
- private evalURI;
5720
+ import { IDSFacetParameter, IDSCheckResult, IDSFacetParameterName, IDSCheck, IDSConditionalCardinaltiy, IDSSimpleCardinality } from "../types";
5721
+ export declare abstract class IDSFacet {
5722
+ protected components: Components;
5723
+ cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
5724
+ instructions?: string;
5725
+ constructor(components: Components);
5726
+ protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
5727
+ protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
5728
+ protected testResult: IDSCheckResult[];
5729
+ protected saveResult(attrs: any, pass: boolean): void;
5730
+ /**
5731
+ * Returns the list of expressIDs that pass the criteria of this facet.
5732
+ * @param model - The IFC model to retrieve entities from.
5733
+ * @param collector - An optional object to collect the retrieved entities.
5734
+ * @remarks
5735
+ * If the collector already includes the entity, it won't get processed any further.
5736
+ *
5737
+ * @returns An array of express IDs of the retrieved entities.
5738
+ */
5739
+ abstract getEntities(model: FRAGS.FragmentsGroup, collector: FRAGS.IfcProperties): Promise<number[]>;
5740
+ abstract test(entities: FRAGS.IfcProperties, model?: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5741
+ abstract serialize(type: "applicability" | "requirement"): string;
5729
5742
  }
5730
5743
  import { BCFTopics } from "../..";
5731
5744
  export declare const extensionsImporter: (manager: BCFTopics, extensionsXML: string) => void;
5732
- import * as FRAGS from "@thatopen/fragments";
5733
- import { IDSCheckResult, IDSFacetParameter } from "../types";
5734
- import { Components } from "../../../../core/Components";
5735
- import { IDSFacet } from "./Facet";
5736
- export declare class IDSAttribute extends IDSFacet {
5737
- name: IDSFacetParameter;
5738
- value?: IDSFacetParameter;
5739
- constructor(components: Components, name: IDSFacetParameter);
5740
- serialize(type: "applicability" | "requirement"): string;
5741
- getEntities(): Promise<never[]>;
5742
- test(entities: FRAGS.IfcProperties): Promise<IDSCheckResult[]>;
5743
- }
5744
5745
  import { BufferGeometry } from "three";
5745
5746
  import * as THREE from "three";
5746
5747
  export declare class TransformHelper {
5747
5748
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
5748
5749
  }
5750
+ import { IDSFacetParameter } from "../types";
5751
+ import { IDSFacet } from "./Facet";
5752
+ export declare class IdsMaterialFacet extends IDSFacet {
5753
+ value?: IDSFacetParameter;
5754
+ uri?: string;
5755
+ serialize(type: "applicability" | "requirement"): string;
5756
+ getEntities(): Promise<number[]>;
5757
+ test(): Promise<import("../types").IDSCheckResult[]>;
5758
+ }
5759
+ import { IDSFacetParameterName, IDSFacetParameter } from "../types";
5760
+ export declare const getParameterXML: (name: IDSFacetParameterName, parameter?: IDSFacetParameter) => string;
5749
5761
  import * as FRAGS from "@thatopen/fragments";
5750
5762
  import { Components } from "../../../../core/Components";
5751
5763
  import { IDSFacet } from "./Facet";
@@ -5771,16 +5783,5 @@ export declare class IDSPartOf extends IDSFacet {
5771
5783
  getEntities(model: FRAGS.FragmentsGroup, collector?: FRAGS.IfcProperties): Promise<number[]>;
5772
5784
  test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup): Promise<import("../types").IDSCheckResult[]>;
5773
5785
  }
5774
- import { IDSFacetParameter } from "../types";
5775
- import { IDSFacet } from "./Facet";
5776
- export declare class IdsMaterialFacet extends IDSFacet {
5777
- value?: IDSFacetParameter;
5778
- uri?: string;
5779
- serialize(type: "applicability" | "requirement"): string;
5780
- getEntities(): Promise<number[]>;
5781
- test(): Promise<import("../types").IDSCheckResult[]>;
5782
- }
5783
- import { IDSFacetParameterName, IDSFacetParameter } from "../types";
5784
- export declare const getParameterXML: (name: IDSFacetParameterName, parameter?: IDSFacetParameter) => string;
5785
5786
 
5786
5787
  }