@thatopen/components 2.3.15 → 2.3.16

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.
@@ -7,7 +7,7 @@ export declare class Components implements Disposable {
7
7
  /**
8
8
  * The version of the @thatopen/components library.
9
9
  */
10
- static readonly release = "2.3.15";
10
+ static readonly release = "2.3.16";
11
11
  /** {@link Disposable.onDisposed} */
12
12
  readonly onDisposed: Event<void>;
13
13
  /**
@@ -195,66 +195,6 @@ export declare class ShadowedScene extends SimpleScene implements Disposable, Co
195
195
  updateShadows(): Promise<void>;
196
196
  private recomputeShadows;
197
197
  }
198
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer, DataMap } from "../Types";
199
- import { Components } from "../Components";
200
- import { SimpleWorld } from "./src";
201
- /**
202
- * A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
203
- */
204
- export declare class Worlds extends Component implements Updateable, Disposable {
205
- /**
206
- * A unique identifier for the component.
207
- * This UUID is used to register the component within the Components system.
208
- */
209
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
210
- /** {@link Updateable.onAfterUpdate} */
211
- readonly onAfterUpdate: Event<unknown>;
212
- /** {@link Updateable.onBeforeUpdate} */
213
- readonly onBeforeUpdate: Event<unknown>;
214
- /** {@link Disposable.onDisposed} */
215
- readonly onDisposed: Event<unknown>;
216
- /**
217
- * A collection of worlds managed by this component.
218
- * The key is the unique identifier (UUID) of the world, and the value is the World instance.
219
- */
220
- list: DataMap<string, World>;
221
- /** {@link Component.enabled} */
222
- enabled: boolean;
223
- constructor(components: Components);
224
- /**
225
- * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
226
- *
227
- * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
228
- * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
229
- * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
230
- *
231
- * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
232
- */
233
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
234
- /**
235
- * Deletes a world from the list of worlds.
236
- *
237
- * @param {World} world - The world to be deleted.
238
- *
239
- * @throws {Error} - Throws an error if the provided world is not found in the list.
240
- */
241
- delete(world: World): void;
242
- /**
243
- * Disposes of the Worlds component and all its managed worlds.
244
- * This method sets the enabled flag to false, disposes of all worlds, clears the list,
245
- * and triggers the onDisposed event.
246
- */
247
- dispose(): void;
248
- /** {@link Updateable.update} */
249
- update(delta?: number): void | Promise<void>;
250
- }
251
- import * as THREE from "three";
252
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
253
- center: THREE.Vector3;
254
- halfSizes: THREE.Vector3;
255
- rotation: THREE.Matrix3;
256
- transformation: THREE.Matrix4;
257
- };
258
198
  import { Component, Disposable, World, Event } from "../Types";
259
199
  import { SimpleRaycaster } from "./src";
260
200
  import { Components } from "../Components";
@@ -297,17 +237,6 @@ export declare class Raycasters extends Component implements Disposable {
297
237
  /** {@link Disposable.dispose} */
298
238
  dispose(): void;
299
239
  }
300
- import * as THREE from "three";
301
- export declare class MaterialsUtils {
302
- static isTransparent(material: THREE.Material): boolean;
303
- }
304
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
305
- export declare class UUID {
306
- private static _pattern;
307
- private static _lut;
308
- static create(): string;
309
- static validate(uuid: string): void;
310
- }
311
240
  import { Component, Disposable, World, Event } from "../Types";
312
241
  import { SimpleGrid } from "./src";
313
242
  import { Components } from "../Components";
@@ -353,60 +282,58 @@ export declare class Grids extends Component implements Disposable {
353
282
  /** {@link Disposable.dispose} */
354
283
  dispose(): void;
355
284
  }
356
- import * as THREE from "three";
285
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer, DataMap } from "../Types";
357
286
  import { Components } from "../Components";
358
- import { MeshCullerRenderer } from "./src";
359
- import { Component, Event, Disposable, World } from "../Types";
287
+ import { SimpleWorld } from "./src";
360
288
  /**
361
- * A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
289
+ * A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
362
290
  */
363
- export declare class Cullers extends Component implements Disposable {
291
+ export declare class Worlds extends Component implements Updateable, Disposable {
364
292
  /**
365
293
  * A unique identifier for the component.
366
294
  * This UUID is used to register the component within the Components system.
367
295
  */
368
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
369
- /**
370
- * An event that is triggered when the Cullers component is disposed.
371
- */
296
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
297
+ /** {@link Updateable.onAfterUpdate} */
298
+ readonly onAfterUpdate: Event<unknown>;
299
+ /** {@link Updateable.onBeforeUpdate} */
300
+ readonly onBeforeUpdate: Event<unknown>;
301
+ /** {@link Disposable.onDisposed} */
372
302
  readonly onDisposed: Event<unknown>;
373
- private _enabled;
374
303
  /**
375
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
304
+ * A collection of worlds managed by this component.
305
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
376
306
  */
377
- list: Map<string, MeshCullerRenderer>;
378
- /** {@link Component.enabled} */
379
- get enabled(): boolean;
307
+ list: DataMap<string, World>;
380
308
  /** {@link Component.enabled} */
381
- set enabled(value: boolean);
309
+ enabled: boolean;
382
310
  constructor(components: Components);
383
311
  /**
384
- * Creates a new MeshCullerRenderer for the given world.
385
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
312
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
386
313
  *
387
- * @param world - The world for which to create the MeshCullerRenderer.
314
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
315
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
316
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
388
317
  *
389
- * @returns The newly created or existing MeshCullerRenderer for the given world.
318
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
390
319
  */
391
- create(world: World): MeshCullerRenderer;
320
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
392
321
  /**
393
- * Deletes the MeshCullerRenderer associated with the given world.
394
- * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
322
+ * Deletes a world from the list of worlds.
395
323
  *
396
- * @param world - The world for which to delete the MeshCullerRenderer.
324
+ * @param {World} world - The world to be deleted.
397
325
  *
398
- * @returns {void}
326
+ * @throws {Error} - Throws an error if the provided world is not found in the list.
399
327
  */
400
328
  delete(world: World): void;
401
- /** {@link Disposable.dispose} */
402
- dispose(): void;
403
329
  /**
404
- * Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
405
- *
406
- * @param meshes - The meshes to update.
407
- *
330
+ * Disposes of the Worlds component and all its managed worlds.
331
+ * This method sets the enabled flag to false, disposes of all worlds, clears the list,
332
+ * and triggers the onDisposed event.
408
333
  */
409
- updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
334
+ dispose(): void;
335
+ /** {@link Updateable.update} */
336
+ update(delta?: number): void | Promise<void>;
410
337
  }
411
338
  import * as THREE from "three";
412
339
  import { Component, Configurable, Createable, Disposable, Event, Hideable, World } from "../Types";
@@ -549,6 +476,61 @@ export declare class Clipper extends Component implements Createable, Disposable
549
476
  private _onStartDragging;
550
477
  private _onEndDragging;
551
478
  }
479
+ import * as THREE from "three";
480
+ import { Components } from "../Components";
481
+ import { MeshCullerRenderer } from "./src";
482
+ import { Component, Event, Disposable, World } from "../Types";
483
+ /**
484
+ * A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
485
+ */
486
+ export declare class Cullers extends Component implements Disposable {
487
+ /**
488
+ * A unique identifier for the component.
489
+ * This UUID is used to register the component within the Components system.
490
+ */
491
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
492
+ /**
493
+ * An event that is triggered when the Cullers component is disposed.
494
+ */
495
+ readonly onDisposed: Event<unknown>;
496
+ private _enabled;
497
+ /**
498
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
499
+ */
500
+ list: Map<string, MeshCullerRenderer>;
501
+ /** {@link Component.enabled} */
502
+ get enabled(): boolean;
503
+ /** {@link Component.enabled} */
504
+ set enabled(value: boolean);
505
+ constructor(components: Components);
506
+ /**
507
+ * Creates a new MeshCullerRenderer for the given world.
508
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
509
+ *
510
+ * @param world - The world for which to create the MeshCullerRenderer.
511
+ *
512
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
513
+ */
514
+ create(world: World): MeshCullerRenderer;
515
+ /**
516
+ * Deletes the MeshCullerRenderer associated with the given world.
517
+ * If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
518
+ *
519
+ * @param world - The world for which to delete the MeshCullerRenderer.
520
+ *
521
+ * @returns {void}
522
+ */
523
+ delete(world: World): void;
524
+ /** {@link Disposable.dispose} */
525
+ dispose(): void;
526
+ /**
527
+ * Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
528
+ *
529
+ * @param meshes - The meshes to update.
530
+ *
531
+ */
532
+ updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
533
+ }
552
534
  import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
553
535
  import { Components } from "../Components";
554
536
  import { BCFViewpoint, Viewpoint } from "./src";
@@ -656,184 +638,109 @@ export declare class ConfigManager extends Component {
656
638
  constructor(components: Components);
657
639
  }
658
640
  import * as THREE from "three";
659
- import { Components } from "../Components";
660
- import { SimpleCamera } from "..";
661
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
641
+ import * as FRAGS from "@thatopen/fragments";
642
+ import { Component, Components } from "../../core";
662
643
  /**
663
- * 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).
644
+ * Represents an edge measurement result.
664
645
  */
665
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
646
+ export interface MeasureEdge {
666
647
  /**
667
- * A ProjectionManager instance that manages the projection modes of the camera.
648
+ * The distance between the two points of the edge.
668
649
  */
669
- readonly projection: ProjectionManager;
650
+ distance: number;
670
651
  /**
671
- * A THREE.OrthographicCamera instance that represents the orthographic camera.
672
- * This camera is used when the projection mode is set to orthographic.
652
+ * The two points that define the edge.
673
653
  */
674
- readonly threeOrtho: THREE.OrthographicCamera;
654
+ points: THREE.Vector3[];
655
+ }
656
+ /**
657
+ * 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).
658
+ */
659
+ export declare class MeasurementUtils extends Component {
675
660
  /**
676
- * A THREE.PerspectiveCamera instance that represents the perspective camera.
677
- * This camera is used when the projection mode is set to perspective.
661
+ * A unique identifier for the component.
662
+ * This UUID is used to register the component within the Components system.
678
663
  */
679
- readonly threePersp: THREE.PerspectiveCamera;
680
- protected readonly _userInputButtons: any;
681
- protected readonly _frustumSize = 50;
682
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
683
- protected _mode: NavigationMode | null;
684
- private previousSize;
664
+ static uuid: string;
665
+ /** {@link Component.enabled} */
666
+ enabled: boolean;
667
+ constructor(components: Components);
685
668
  /**
686
- * Getter for the current navigation mode.
687
- * Throws an error if the mode is not found or the camera is not initialized.
688
- *
689
- * @returns {NavigationMode} The current navigation mode.
669
+ * Utility method to calculate the distance from a point to a line segment.
690
670
  *
691
- * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
671
+ * @param point - The point from which to calculate the distance.
672
+ * @param lineStart - The start point of the line segment.
673
+ * @param lineEnd - The end point of the line segment.
674
+ * @param clamp - If true, the distance will be clamped to the line segment's length.
675
+ * @returns The distance from the point to the line segment.
692
676
  */
693
- get mode(): NavigationMode;
694
- constructor(components: Components);
695
- /** {@link Disposable.dispose} */
696
- dispose(): void;
677
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
697
678
  /**
698
- * Sets a new {@link NavigationMode} and disables the previous one.
679
+ * Method to get the face of a mesh that contains a given triangle index.
680
+ * It also returns the edges of the found face and their indices.
699
681
  *
700
- * @param mode - The {@link NavigationMode} to set.
682
+ * @param mesh - The mesh to get the face from. It must be indexed.
683
+ * @param triangleIndex - The index of the triangle within the mesh.
684
+ * @param instance - The instance of the mesh (optional).
685
+ * @returns An object containing the edges of the found face and their indices, or null if no face was found.
701
686
  */
702
- set(mode: NavModeID): void;
687
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
688
+ edges: MeasureEdge[];
689
+ indices: Set<number>;
690
+ } | null;
703
691
  /**
704
- * Make the camera view fit all the specified meshes.
692
+ * Method to get the vertices and normal of a mesh face at a given index.
693
+ * It also applies instance transformation if provided.
705
694
  *
706
- * @param meshes the meshes to fit. If it is not defined, it will
707
- * evaluate {@link Components.meshes}.
708
- * @param offset the distance to the fit object
709
- */
710
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
711
- /**
712
- * Allows or prevents all user input.
713
- *
714
- * @param active - whether to enable or disable user inputs.
715
- */
716
- setUserInput(active: boolean): void;
717
- private disableUserInput;
718
- private enableUserInput;
719
- private newOrthoCamera;
720
- private setOrthoPerspCameraAspect;
721
- }
722
- import * as THREE from "three";
723
- import { Component, Components, Disposable, Event, World } from "../core";
724
- /**
725
- * Configuration interface for the VertexPicker component.
726
- */
727
- export interface VertexPickerConfig {
728
- /**
729
- * If true, only vertices will be picked, not the closest point on the face.
730
- */
731
- showOnlyVertex: boolean;
732
- /**
733
- * The maximum distance for snapping to a vertex.
734
- */
735
- snapDistance: number;
736
- /**
737
- * The HTML element to use for previewing the picked vertex.
738
- */
739
- previewElement: HTMLElement;
740
- }
741
- /**
742
- * A class that provides functionality for picking vertices in a 3D scene.
743
- */
744
- export declare class VertexPicker extends Component implements Disposable {
745
- /** {@link Disposable.onDisposed} */
746
- readonly onDisposed: Event<unknown>;
747
- /**
748
- * An event that is triggered when a vertex is found.
749
- * The event passes a THREE.Vector3 representing the position of the found vertex.
750
- */
751
- readonly onVertexFound: Event<THREE.Vector3>;
752
- /**
753
- * An event that is triggered when a vertex is lost.
754
- * The event passes a THREE.Vector3 representing the position of the lost vertex.
755
- */
756
- readonly onVertexLost: Event<THREE.Vector3>;
757
- /**
758
- * An event that is triggered when the picker is enabled or disabled
759
- */
760
- readonly onEnabled: Event<boolean>;
761
- /**
762
- * A reference to the Components instance associated with this VertexPicker.
763
- */
764
- components: Components;
765
- /**
766
- * A reference to the working plane used for vertex picking.
767
- * This plane is used to determine which vertices are considered valid for picking.
768
- * If this value is null, all vertices are considered valid.
769
- */
770
- workingPlane: THREE.Plane | null;
771
- private _pickedPoint;
772
- private _config;
773
- private _enabled;
774
- /**
775
- * Sets the enabled state of the VertexPicker.
776
- * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
777
- * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
778
- *
779
- * @param value - The new enabled state.
695
+ * @param mesh - The mesh to get the face from. It must be indexed.
696
+ * @param faceIndex - The index of the face within the mesh.
697
+ * @param instance - The instance of the mesh (optional).
698
+ * @returns An object containing the vertices and normal of the face.
699
+ * @throws Will throw an error if the geometry is not indexed.
780
700
  */
781
- set enabled(value: boolean);
701
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
702
+ p1: THREE.Vector3;
703
+ p2: THREE.Vector3;
704
+ p3: THREE.Vector3;
705
+ faceNormal: THREE.Vector3;
706
+ };
782
707
  /**
783
- * Gets the current enabled state of the VertexPicker.
708
+ * Method to round the vector's components to a specified number of decimal places.
709
+ * This is used to ensure numerical precision in edge detection.
784
710
  *
785
- * @returns The current enabled state.
711
+ * @param vector - The vector to round.
712
+ * @returns The vector with rounded components.
786
713
  */
787
- get enabled(): boolean;
714
+ round(vector: THREE.Vector3): void;
788
715
  /**
789
- * Sets the configuration for the VertexPicker component.
790
- *
791
- * @param value - A Partial object containing the configuration properties to update.
792
- * The properties not provided in the value object will retain their current values.
716
+ * Calculates the volume of a set of fragments.
793
717
  *
794
- * @example
795
- * '''typescript
796
- * vertexPicker.config = {
797
- * snapDistance: 0.5,
798
- * showOnlyVertex: true,
799
- * };
800
- * '''
801
- */
802
- set config(value: Partial<VertexPickerConfig>);
803
- /**
804
- * Gets the current configuration for the VertexPicker component.
718
+ * @param frags - A map of fragment IDs to their corresponding item IDs.
719
+ * @returns The total volume of the fragments and the bounding sphere.
805
720
  *
806
- * @returns A copy of the current VertexPickerConfig object.
721
+ * @remarks
722
+ * This method creates a set of instanced meshes from the given fragments and item IDs.
723
+ * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
807
724
  *
808
- * @example
809
- * '''typescript
810
- * const currentConfig = vertexPicker.config;
811
- * console.log(currentConfig.snapDistance); // Output: 0.25
812
- * '''
725
+ * @throws Will throw an error if the geometry of the meshes is not indexed.
726
+ * @throws Will throw an error if the fragment manager is not available.
813
727
  */
814
- get config(): Partial<VertexPickerConfig>;
815
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
816
- /** {@link Disposable.dispose} */
817
- dispose(): void;
728
+ getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
818
729
  /**
819
- * Performs the vertex picking operation based on the current state of the VertexPicker.
820
- *
821
- * @param world - The World instance to use for raycasting.
730
+ * Calculates the total volume of a set of meshes.
822
731
  *
823
- * @returns The current picked point, or null if no point is picked.
732
+ * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
733
+ * @returns The total volume of the meshes and the bounding sphere.
824
734
  *
825
735
  * @remarks
826
- * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
827
- * If enabled, it performs raycasting to find the closest intersecting object.
828
- * It then determines the closest vertex or point on the face, based on the configuration settings.
829
- * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
830
- * If the picked point is not on the working plane, it resets the 'pickedPoint'.
831
- * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
736
+ * This method calculates the volume of each mesh in the provided array and returns the total volume
737
+ * and its bounding sphere.
738
+ *
832
739
  */
833
- get(world: World): THREE.Vector3 | null;
834
- private getClosestVertex;
835
- private getVertices;
836
- private getVertex;
740
+ getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
741
+ private getFaceData;
742
+ private getVolumeOfMesh;
743
+ private getSignedVolumeOfTriangle;
837
744
  }
838
745
  import * as THREE from "three";
839
746
  import * as FRAGS from "@thatopen/fragments";
@@ -1188,6 +1095,7 @@ export declare class Classifier extends Component implements Disposable {
1188
1095
  bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
1189
1096
  useProperties?: boolean;
1190
1097
  isolate?: Set<number>;
1098
+ systemName?: string;
1191
1099
  }): Promise<void>;
1192
1100
  /**
1193
1101
  * Sets the color of the specified fragments.
@@ -1267,6 +1175,70 @@ export declare class Exploder extends Component implements Disposable {
1267
1175
  */
1268
1176
  set(active: boolean): void;
1269
1177
  }
1178
+ import * as THREE from "three";
1179
+ import { Components } from "../Components";
1180
+ import { SimpleCamera } from "..";
1181
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
1182
+ /**
1183
+ * 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).
1184
+ */
1185
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
1186
+ /**
1187
+ * A ProjectionManager instance that manages the projection modes of the camera.
1188
+ */
1189
+ readonly projection: ProjectionManager;
1190
+ /**
1191
+ * A THREE.OrthographicCamera instance that represents the orthographic camera.
1192
+ * This camera is used when the projection mode is set to orthographic.
1193
+ */
1194
+ readonly threeOrtho: THREE.OrthographicCamera;
1195
+ /**
1196
+ * A THREE.PerspectiveCamera instance that represents the perspective camera.
1197
+ * This camera is used when the projection mode is set to perspective.
1198
+ */
1199
+ readonly threePersp: THREE.PerspectiveCamera;
1200
+ protected readonly _userInputButtons: any;
1201
+ protected readonly _frustumSize = 50;
1202
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
1203
+ protected _mode: NavigationMode | null;
1204
+ private previousSize;
1205
+ /**
1206
+ * Getter for the current navigation mode.
1207
+ * Throws an error if the mode is not found or the camera is not initialized.
1208
+ *
1209
+ * @returns {NavigationMode} The current navigation mode.
1210
+ *
1211
+ * @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
1212
+ */
1213
+ get mode(): NavigationMode;
1214
+ constructor(components: Components);
1215
+ /** {@link Disposable.dispose} */
1216
+ dispose(): void;
1217
+ /**
1218
+ * Sets a new {@link NavigationMode} and disables the previous one.
1219
+ *
1220
+ * @param mode - The {@link NavigationMode} to set.
1221
+ */
1222
+ set(mode: NavModeID): void;
1223
+ /**
1224
+ * Make the camera view fit all the specified meshes.
1225
+ *
1226
+ * @param meshes the meshes to fit. If it is not defined, it will
1227
+ * evaluate {@link Components.meshes}.
1228
+ * @param offset the distance to the fit object
1229
+ */
1230
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
1231
+ /**
1232
+ * Allows or prevents all user input.
1233
+ *
1234
+ * @param active - whether to enable or disable user inputs.
1235
+ */
1236
+ setUserInput(active: boolean): void;
1237
+ private disableUserInput;
1238
+ private enableUserInput;
1239
+ private newOrthoCamera;
1240
+ private setOrthoPerspCameraAspect;
1241
+ }
1270
1242
  import * as FRAGS from "@thatopen/fragments";
1271
1243
  import { Components, Component } from "../../core";
1272
1244
  /**
@@ -1305,160 +1277,45 @@ export declare class Hider extends Component {
1305
1277
  isolate(items: FRAGS.FragmentIdMap): void;
1306
1278
  private updateCulledVisibility;
1307
1279
  }
1308
- import * as WEBIFC from "web-ifc";
1280
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1281
+ import * as THREE from "three";
1309
1282
  import * as FRAGS from "@thatopen/fragments";
1310
- import { IfcFragmentSettings } from "./src";
1311
- import { Component, Components, Event, Disposable } from "../../core";
1283
+ import { Component, Components, Event, Disposable, DataMap } from "../../core";
1284
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1312
1285
  /**
1313
- * 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).
1286
+ * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
1314
1287
  */
1315
- export declare class IfcLoader extends Component implements Disposable {
1288
+ export declare class FragmentsManager extends Component implements Disposable {
1316
1289
  /**
1317
1290
  * A unique identifier for the component.
1318
1291
  * This UUID is used to register the component within the Components system.
1319
1292
  */
1320
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1293
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1321
1294
  /** {@link Disposable.onDisposed} */
1322
- readonly onDisposed: Event<string>;
1295
+ readonly onDisposed: Event<unknown>;
1323
1296
  /**
1324
- * An event triggered when the IFC file starts loading.
1297
+ * Event triggered when fragments are loaded.
1325
1298
  */
1326
- readonly onIfcStartedLoading: Event<void>;
1299
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
1327
1300
  /**
1328
- * An event triggered when the setup process is completed.
1301
+ * Event triggered when fragments are disposed.
1329
1302
  */
1330
- readonly onSetup: Event<void>;
1303
+ readonly onFragmentsDisposed: Event<{
1304
+ groupID: string;
1305
+ fragmentIDs: string[];
1306
+ }>;
1331
1307
  /**
1332
- * The settings for the IfcLoader.
1333
- * It includes options for excluding categories, setting WASM paths, and more.
1308
+ * DataMap containing all loaded fragments.
1309
+ * The key is the fragment's unique identifier, and the value is the fragment itself.
1334
1310
  */
1335
- settings: IfcFragmentSettings;
1311
+ readonly list: DataMap<string, Fragment>;
1336
1312
  /**
1337
- * The instance of the Web-IFC library used for handling IFC data.
1313
+ * DataMap containing all loaded fragment groups.
1314
+ * The key is the group's unique identifier, and the value is the group itself.
1338
1315
  */
1339
- webIfc: WEBIFC.IfcAPI;
1340
- /** {@link Component.enabled} */
1341
- enabled: boolean;
1342
- private _material;
1343
- private _spatialTree;
1344
- private _metaData;
1345
- private _fragmentInstances;
1346
- private _civil;
1347
- private _visitedFragments;
1348
- private _materialT;
1349
- constructor(components: Components);
1350
- /** {@link Disposable.dispose} */
1351
- dispose(): void;
1352
- /**
1353
- * Sets up the IfcLoader component with the provided configuration.
1354
- *
1355
- * @param config - Optional configuration settings for the IfcLoader.
1356
- * If not provided, the existing settings will be used.
1357
- *
1358
- * @returns A Promise that resolves when the setup process is completed.
1359
- *
1360
- * @remarks
1361
- * If the 'autoSetWasm' option is enabled in the configuration,
1362
- * the method will automatically set the WASM paths for the Web-IFC library.
1363
- *
1364
- * @example
1365
- * '''typescript
1366
- * const ifcLoader = new IfcLoader(components);
1367
- * await ifcLoader.setup({ autoSetWasm: true });
1368
- * '''
1369
- */
1370
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1371
- /**
1372
- * Loads an IFC file and processes it for 3D visualization.
1373
- *
1374
- * @param data - The Uint8Array containing the IFC file data.
1375
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1376
- *
1377
- * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1378
- *
1379
- * @example
1380
- * '''typescript
1381
- * const ifcLoader = components.get(IfcLoader);
1382
- * const group = await ifcLoader.load(ifcData);
1383
- * '''
1384
- */
1385
- load(data: Uint8Array, coordinate?: boolean, name?: string): Promise<FRAGS.FragmentsGroup>;
1386
- /**
1387
- * Reads an IFC file and initializes the Web-IFC library.
1388
- *
1389
- * @param data - The Uint8Array containing the IFC file data.
1390
- *
1391
- * @returns A Promise that resolves when the IFC file is opened and initialized.
1392
- *
1393
- * @remarks
1394
- * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1395
- * It also opens the IFC model using the provided data and settings.
1396
- *
1397
- * @example
1398
- * '''typescript
1399
- * const ifcLoader = components.get(IfcLoader);
1400
- * await ifcLoader.readIfcFile(ifcData);
1401
- * '''
1402
- */
1403
- readIfcFile(data: Uint8Array): Promise<number>;
1404
- /**
1405
- * Cleans up the IfcLoader component by resetting the Web-IFC library,
1406
- * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1407
- *
1408
- * @remarks
1409
- * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1410
- *
1411
- * @example
1412
- * '''typescript
1413
- * const ifcLoader = components.get(IfcLoader);
1414
- * ifcLoader.cleanUp();
1415
- * '''
1416
- */
1417
- cleanUp(): void;
1418
- private getAllGeometries;
1419
- private getMesh;
1420
- private getGeometry;
1421
- private autoSetWasm;
1422
- }
1423
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
1424
- import * as THREE from "three";
1425
- import * as FRAGS from "@thatopen/fragments";
1426
- import { Component, Components, Event, Disposable, DataMap } from "../../core";
1427
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
1428
- /**
1429
- * Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
1430
- */
1431
- export declare class FragmentsManager extends Component implements Disposable {
1432
- /**
1433
- * A unique identifier for the component.
1434
- * This UUID is used to register the component within the Components system.
1435
- */
1436
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
1437
- /** {@link Disposable.onDisposed} */
1438
- readonly onDisposed: Event<unknown>;
1439
- /**
1440
- * Event triggered when fragments are loaded.
1441
- */
1442
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
1443
- /**
1444
- * Event triggered when fragments are disposed.
1445
- */
1446
- readonly onFragmentsDisposed: Event<{
1447
- groupID: string;
1448
- fragmentIDs: string[];
1449
- }>;
1450
- /**
1451
- * DataMap containing all loaded fragments.
1452
- * The key is the fragment's unique identifier, and the value is the fragment itself.
1453
- */
1454
- readonly list: DataMap<string, Fragment>;
1455
- /**
1456
- * DataMap containing all loaded fragment groups.
1457
- * The key is the group's unique identifier, and the value is the group itself.
1458
- */
1459
- readonly groups: DataMap<string, FragmentsGroup>;
1460
- baseCoordinationModel: string;
1461
- baseCoordinationMatrix: THREE.Matrix4;
1316
+ readonly groups: DataMap<string, FragmentsGroup>;
1317
+ baseCoordinationModel: string;
1318
+ baseCoordinationMatrix: THREE.Matrix4;
1462
1319
  /** {@link Component.enabled} */
1463
1320
  enabled: boolean;
1464
1321
  private _loader;
@@ -1573,105 +1430,119 @@ export declare class FragmentsManager extends Component implements Disposable {
1573
1430
  clone(model: FRAGS.FragmentsGroup, items?: FRAGS.FragmentIdMap): FragmentsGroup;
1574
1431
  }
1575
1432
  import * as WEBIFC from "web-ifc";
1576
- import { Components, Disposable, Event, Component, AsyncEvent } from "../../core";
1577
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
1433
+ import * as FRAGS from "@thatopen/fragments";
1434
+ import { IfcFragmentSettings } from "./src";
1435
+ import { Component, Components, Event, Disposable } from "../../core";
1578
1436
  /**
1579
- * A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
1437
+ * 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).
1580
1438
  */
1581
- export declare class IfcGeometryTiler extends Component implements Disposable {
1439
+ export declare class IfcLoader extends Component implements Disposable {
1582
1440
  /**
1583
1441
  * A unique identifier for the component.
1584
1442
  * This UUID is used to register the component within the Components system.
1585
1443
  */
1586
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1587
- /**
1588
- * Event triggered when geometry is streamed.
1589
- * Contains the streamed geometry data and its buffer.
1590
- */
1591
- readonly onGeometryStreamed: AsyncEvent<{
1592
- buffer: Uint8Array;
1593
- data: StreamedGeometries;
1594
- }>;
1444
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1445
+ /** {@link Disposable.onDisposed} */
1446
+ readonly onDisposed: Event<string>;
1595
1447
  /**
1596
- * Event triggered when assets are streamed.
1597
- * Contains the streamed assets.
1448
+ * An event triggered when the IFC file starts loading.
1598
1449
  */
1599
- readonly onAssetStreamed: AsyncEvent<StreamedAsset[]>;
1450
+ readonly onIfcStartedLoading: Event<void>;
1600
1451
  /**
1601
- * Event triggered to indicate the progress of the streaming process.
1602
- * Contains the progress percentage.
1452
+ * An event triggered when the setup process is completed.
1603
1453
  */
1604
- readonly onProgress: AsyncEvent<number>;
1454
+ readonly onSetup: Event<void>;
1605
1455
  /**
1606
- * Event triggered when the IFC file is loaded.
1607
- * Contains the loaded IFC file data.
1456
+ * The settings for the IfcLoader.
1457
+ * It includes options for excluding categories, setting WASM paths, and more.
1608
1458
  */
1609
- readonly onIfcLoaded: AsyncEvent<Uint8Array>;
1610
- /** {@link Disposable.onDisposed} */
1611
- readonly onDisposed: Event<unknown>;
1459
+ settings: IfcFragmentSettings;
1612
1460
  /**
1613
- * Settings for the IfcGeometryTiler.
1461
+ * The instance of the Web-IFC library used for handling IFC data.
1614
1462
  */
1615
- settings: IfcStreamingSettings;
1463
+ webIfc: WEBIFC.IfcAPI;
1616
1464
  /** {@link Component.enabled} */
1617
1465
  enabled: boolean;
1618
- /**
1619
- * The WebIFC API instance used for IFC file processing.
1620
- */
1621
- webIfc: WEBIFC.IfcAPI;
1622
- private _nextAvailableID;
1623
- private _splittedGeometries;
1466
+ private _material;
1624
1467
  private _spatialTree;
1625
1468
  private _metaData;
1626
- private _visitedGeometries;
1627
- private _streamSerializer;
1628
- private _geometries;
1629
- private _geometryCount;
1469
+ private _fragmentInstances;
1630
1470
  private _civil;
1631
- private _groupSerializer;
1632
- private _assets;
1633
- private _meshesWithHoles;
1471
+ private _visitedFragments;
1472
+ private _materialT;
1634
1473
  constructor(components: Components);
1635
1474
  /** {@link Disposable.dispose} */
1636
1475
  dispose(): void;
1637
1476
  /**
1638
- * This method streams the IFC file from a given buffer.
1477
+ * Sets up the IfcLoader component with the provided configuration.
1639
1478
  *
1640
- * @param data - The Uint8Array containing the IFC file data.
1641
- * @returns A Promise that resolves when the streaming process is complete.
1479
+ * @param config - Optional configuration settings for the IfcLoader.
1480
+ * If not provided, the existing settings will be used.
1481
+ *
1482
+ * @returns A Promise that resolves when the setup process is completed.
1642
1483
  *
1643
1484
  * @remarks
1644
- * This method cleans up any resources after the streaming process is complete.
1485
+ * If the 'autoSetWasm' option is enabled in the configuration,
1486
+ * the method will automatically set the WASM paths for the Web-IFC library.
1645
1487
  *
1646
1488
  * @example
1647
1489
  * '''typescript
1648
- * const ifcData = await fetch('path/to/ifc/file.ifc');
1649
- * const rawBuffer = await response.arrayBuffer();
1650
- * const ifcBuffer = new Uint8Array(rawBuffer);
1651
- * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
1490
+ * const ifcLoader = new IfcLoader(components);
1491
+ * await ifcLoader.setup({ autoSetWasm: true });
1652
1492
  * '''
1653
1493
  */
1654
- streamFromBuffer(data: Uint8Array): Promise<void>;
1494
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1655
1495
  /**
1656
- * This method streams the IFC file from a given callback.
1496
+ * Loads an IFC file and processes it for 3D visualization.
1657
1497
  *
1658
- * @param loadCallback - The callback function that will be used to load the IFC file.
1659
- * @returns A Promise that resolves when the streaming process is complete.
1498
+ * @param data - The Uint8Array containing the IFC file data.
1499
+ * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
1500
+ *
1501
+ * @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
1502
+ *
1503
+ * @example
1504
+ * '''typescript
1505
+ * const ifcLoader = components.get(IfcLoader);
1506
+ * const group = await ifcLoader.load(ifcData);
1507
+ * '''
1508
+ */
1509
+ load(data: Uint8Array, coordinate?: boolean, name?: string): Promise<FRAGS.FragmentsGroup>;
1510
+ /**
1511
+ * Reads an IFC file and initializes the Web-IFC library.
1512
+ *
1513
+ * @param data - The Uint8Array containing the IFC file data.
1514
+ *
1515
+ * @returns A Promise that resolves when the IFC file is opened and initialized.
1660
1516
  *
1661
1517
  * @remarks
1662
- * This method cleans up any resources after the streaming process is complete.
1518
+ * This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
1519
+ * It also opens the IFC model using the provided data and settings.
1663
1520
  *
1521
+ * @example
1522
+ * '''typescript
1523
+ * const ifcLoader = components.get(IfcLoader);
1524
+ * await ifcLoader.readIfcFile(ifcData);
1525
+ * '''
1664
1526
  */
1665
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1666
- private readIfcFile;
1667
- private streamIfcFile;
1668
- private streamAllGeometries;
1669
- private cleanUp;
1527
+ readIfcFile(data: Uint8Array): Promise<number>;
1528
+ /**
1529
+ * Cleans up the IfcLoader component by resetting the Web-IFC library,
1530
+ * clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
1531
+ *
1532
+ * @remarks
1533
+ * This method is called automatically after using the .load() method, so usually you don't need to use it manually.
1534
+ *
1535
+ * @example
1536
+ * '''typescript
1537
+ * const ifcLoader = components.get(IfcLoader);
1538
+ * ifcLoader.cleanUp();
1539
+ * '''
1540
+ */
1541
+ cleanUp(): void;
1542
+ private getAllGeometries;
1670
1543
  private getMesh;
1671
1544
  private getGeometry;
1672
- private streamAssets;
1673
- private streamGeometries;
1674
- private registerGeometryData;
1545
+ private autoSetWasm;
1675
1546
  }
1676
1547
  import * as WEBIFC from "web-ifc";
1677
1548
  import { AsyncEvent, Component, Disposable, Event } from "../../core";
@@ -1738,8 +1609,194 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
1738
1609
  private streamAllProperties;
1739
1610
  private cleanUp;
1740
1611
  }
1741
- import { XMLParser } from "fast-xml-parser";
1742
- import { Component, Configurable, Disposable, Event, World, DataMap } from "../../core";
1612
+ import * as WEBIFC from "web-ifc";
1613
+ import { Components, Disposable, Event, Component, AsyncEvent } from "../../core";
1614
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
1615
+ /**
1616
+ * A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
1617
+ */
1618
+ export declare class IfcGeometryTiler extends Component implements Disposable {
1619
+ /**
1620
+ * A unique identifier for the component.
1621
+ * This UUID is used to register the component within the Components system.
1622
+ */
1623
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1624
+ /**
1625
+ * Event triggered when geometry is streamed.
1626
+ * Contains the streamed geometry data and its buffer.
1627
+ */
1628
+ readonly onGeometryStreamed: AsyncEvent<{
1629
+ buffer: Uint8Array;
1630
+ data: StreamedGeometries;
1631
+ }>;
1632
+ /**
1633
+ * Event triggered when assets are streamed.
1634
+ * Contains the streamed assets.
1635
+ */
1636
+ readonly onAssetStreamed: AsyncEvent<StreamedAsset[]>;
1637
+ /**
1638
+ * Event triggered to indicate the progress of the streaming process.
1639
+ * Contains the progress percentage.
1640
+ */
1641
+ readonly onProgress: AsyncEvent<number>;
1642
+ /**
1643
+ * Event triggered when the IFC file is loaded.
1644
+ * Contains the loaded IFC file data.
1645
+ */
1646
+ readonly onIfcLoaded: AsyncEvent<Uint8Array>;
1647
+ /** {@link Disposable.onDisposed} */
1648
+ readonly onDisposed: Event<unknown>;
1649
+ /**
1650
+ * Settings for the IfcGeometryTiler.
1651
+ */
1652
+ settings: IfcStreamingSettings;
1653
+ /** {@link Component.enabled} */
1654
+ enabled: boolean;
1655
+ /**
1656
+ * The WebIFC API instance used for IFC file processing.
1657
+ */
1658
+ webIfc: WEBIFC.IfcAPI;
1659
+ private _nextAvailableID;
1660
+ private _splittedGeometries;
1661
+ private _spatialTree;
1662
+ private _metaData;
1663
+ private _visitedGeometries;
1664
+ private _streamSerializer;
1665
+ private _geometries;
1666
+ private _geometryCount;
1667
+ private _civil;
1668
+ private _groupSerializer;
1669
+ private _assets;
1670
+ private _meshesWithHoles;
1671
+ constructor(components: Components);
1672
+ /** {@link Disposable.dispose} */
1673
+ dispose(): void;
1674
+ /**
1675
+ * This method streams the IFC file from a given buffer.
1676
+ *
1677
+ * @param data - The Uint8Array containing the IFC file data.
1678
+ * @returns A Promise that resolves when the streaming process is complete.
1679
+ *
1680
+ * @remarks
1681
+ * This method cleans up any resources after the streaming process is complete.
1682
+ *
1683
+ * @example
1684
+ * '''typescript
1685
+ * const ifcData = await fetch('path/to/ifc/file.ifc');
1686
+ * const rawBuffer = await response.arrayBuffer();
1687
+ * const ifcBuffer = new Uint8Array(rawBuffer);
1688
+ * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
1689
+ * '''
1690
+ */
1691
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1692
+ /**
1693
+ * This method streams the IFC file from a given callback.
1694
+ *
1695
+ * @param loadCallback - The callback function that will be used to load the IFC file.
1696
+ * @returns A Promise that resolves when the streaming process is complete.
1697
+ *
1698
+ * @remarks
1699
+ * This method cleans up any resources after the streaming process is complete.
1700
+ *
1701
+ */
1702
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1703
+ private readIfcFile;
1704
+ private streamIfcFile;
1705
+ private streamAllGeometries;
1706
+ private cleanUp;
1707
+ private getMesh;
1708
+ private getGeometry;
1709
+ private streamAssets;
1710
+ private streamGeometries;
1711
+ private registerGeometryData;
1712
+ }
1713
+ import * as FRAGS from "@thatopen/fragments";
1714
+ import { XMLParser } from "fast-xml-parser";
1715
+ import { Component, DataMap } from "../../core/Types";
1716
+ import { IDSCheckResult, IDSInfo, IDSSpecification, IfcVersion } from "./src";
1717
+ import { Components } from "../../core";
1718
+ /**
1719
+ * Component that manages Information Delivery Specification (IDS) data.
1720
+ * It provides functionality for importing, exporting, and manipulating IDS data.
1721
+ */
1722
+ export declare class IDSSpecifications extends Component {
1723
+ static uuid: "9f0b9f78-9b2e-481a-b766-2fbfd01f342c";
1724
+ enabled: boolean;
1725
+ static xmlParser: XMLParser;
1726
+ constructor(components: Components);
1727
+ readonly list: DataMap<string, IDSSpecification>;
1728
+ /**
1729
+ * Retrieves a FragmentIdMap based on the given IDSCheckResult array.
1730
+ * The map separates the IDs into two categories: pass and fail.
1731
+ *
1732
+ * @param model - The FragmentsGroup model from which to retrieve the fragment map.
1733
+ * @param result - An array of IDSCheckResult objects, each representing a check result.
1734
+ *
1735
+ * @returns An object containing two properties:
1736
+ * - 'pass': A FragmentIdMap that passed the checks.
1737
+ * - 'fail': A FragmentIdMap that failed the checks.
1738
+ */
1739
+ getFragmentIdMap(model: FRAGS.FragmentsGroup, result: IDSCheckResult[]): {
1740
+ pass: FRAGS.FragmentIdMap;
1741
+ fail: FRAGS.FragmentIdMap;
1742
+ };
1743
+ /**
1744
+ * Creates a new IDSSpecification instance and adds it to the list.
1745
+ *
1746
+ * @param name - The name of the IDSSpecification.
1747
+ * @param ifcVersion - An array of IfcVersion values that the specification supports.
1748
+ *
1749
+ * @returns The newly created IDSSpecification instance.
1750
+ */
1751
+ create(name: string, ifcVersion: IfcVersion[], identifier?: string): IDSSpecification;
1752
+ /**
1753
+ * Parses and processes an XML string containing Information Delivery Specification (IDS) data.
1754
+ * It creates IDSSpecification instances based on the parsed data and returns them in an array.
1755
+ * Also, the instances are added to the list array.
1756
+ *
1757
+ * @param data - The XML string to parse.
1758
+ *
1759
+ * @returns An array of IDSSpecification instances created from the parsed data.
1760
+ */
1761
+ load(data: string): IDSSpecification[];
1762
+ /**
1763
+ * Exports the IDSSpecifications data into an XML string.
1764
+ *
1765
+ * @param info - The metadata information for the exported XML.
1766
+ * @param specifications - An optional iterable of IDSSpecification instances to export.
1767
+ * If not provided, all specifications in the list will be exported.
1768
+ *
1769
+ * @returns A string containing the exported IDSSpecifications data in XML format.
1770
+ */
1771
+ export(info: IDSInfo, specifications?: Iterable<IDSSpecification>): string;
1772
+ }
1773
+ import * as WEBIFC from "web-ifc";
1774
+ import * as FRAG from "@thatopen/fragments";
1775
+ import { Component, Components } from "../../core";
1776
+ /**
1777
+ * 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).
1778
+ */
1779
+ export declare class IfcJsonExporter extends Component {
1780
+ /**
1781
+ * A unique identifier for the component.
1782
+ * This UUID is used to register the component within the Components system.
1783
+ */
1784
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
1785
+ /** {@link Component.enabled} */
1786
+ enabled: boolean;
1787
+ constructor(components: Components);
1788
+ /**
1789
+ * Exports all the properties of an IFC into an array of JS objects.
1790
+ * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
1791
+ * @param modelID ID of the IFC model whose properties to extract.
1792
+ * @param indirect whether to get the indirect relationships as well.
1793
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
1794
+ * to make the location data available (e.g. absolute position of building).
1795
+ */
1796
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
1797
+ }
1798
+ import { XMLParser } from "fast-xml-parser";
1799
+ import { Component, Configurable, Disposable, Event, World, DataMap } from "../../core";
1743
1800
  import { BCFTopic, Topic, BCFTopicsConfigManager, BCFTopicsConfig } from "./src";
1744
1801
  import { Viewpoint } from "../../core/Viewpoints";
1745
1802
  /**
@@ -1852,253 +1909,40 @@ export declare class BCFTopics extends Component implements Disposable, Configur
1852
1909
  topics: Topic[];
1853
1910
  }>;
1854
1911
  }
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";
1912
+ import * as WEBIFC from "web-ifc";
1913
+ import { FragmentsGroup } from "@thatopen/fragments";
1914
+ import { Disposable, Event, Component, Components } from "../../core";
1915
+ import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation, RelationsProcessingConfig, EntitiesRelatedEvent } from "./src";
1860
1916
  /**
1861
- * Component that manages Information Delivery Specification (IDS) data.
1862
- * It provides functionality for importing, exporting, and manipulating IDS data.
1917
+ * 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).
1863
1918
  */
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>;
1919
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
1870
1920
  /**
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.
1921
+ * A unique identifier for the component.
1922
+ * This UUID is used to register the component within the Components system.
1880
1923
  */
1881
- getFragmentIdMap(model: FRAGS.FragmentsGroup, result: IDSCheckResult[]): {
1882
- pass: FRAGS.FragmentIdMap;
1883
- fail: FRAGS.FragmentIdMap;
1884
- };
1924
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1925
+ /** {@link Disposable.onDisposed} */
1926
+ readonly onDisposed: Event<string>;
1885
1927
  /**
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.
1928
+ * Event triggered when relations for a model have been indexed.
1929
+ * This event provides the model's UUID and the relations map generated for that model.
1890
1930
  *
1891
- * @returns The newly created IDSSpecification instance.
1931
+ * @property {string} modelID - The UUID of the model for which relations have been indexed.
1932
+ * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
1933
+ * 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.
1892
1934
  */
1893
- create(name: string, ifcVersion: IfcVersion[], identifier?: string): IDSSpecification;
1935
+ readonly onRelationsIndexed: Event<{
1936
+ modelID: string;
1937
+ relationsMap: RelationsMap;
1938
+ }>;
1894
1939
  /**
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 THREE from "three";
1916
- import * as FRAGS from "@thatopen/fragments";
1917
- import { Component, Components } from "../../core";
1918
- /**
1919
- * Represents an edge measurement result.
1920
- */
1921
- export interface MeasureEdge {
1922
- /**
1923
- * The distance between the two points of the edge.
1924
- */
1925
- distance: number;
1926
- /**
1927
- * The two points that define the edge.
1928
- */
1929
- points: THREE.Vector3[];
1930
- }
1931
- /**
1932
- * 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).
1933
- */
1934
- export declare class MeasurementUtils extends Component {
1935
- /**
1936
- * A unique identifier for the component.
1937
- * This UUID is used to register the component within the Components system.
1938
- */
1939
- static uuid: string;
1940
- /** {@link Component.enabled} */
1941
- enabled: boolean;
1942
- constructor(components: Components);
1943
- /**
1944
- * Utility method to calculate the distance from a point to a line segment.
1945
- *
1946
- * @param point - The point from which to calculate the distance.
1947
- * @param lineStart - The start point of the line segment.
1948
- * @param lineEnd - The end point of the line segment.
1949
- * @param clamp - If true, the distance will be clamped to the line segment's length.
1950
- * @returns The distance from the point to the line segment.
1951
- */
1952
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
1953
- /**
1954
- * Method to get the face of a mesh that contains a given triangle index.
1955
- * It also returns the edges of the found face and their indices.
1956
- *
1957
- * @param mesh - The mesh to get the face from. It must be indexed.
1958
- * @param triangleIndex - The index of the triangle within the mesh.
1959
- * @param instance - The instance of the mesh (optional).
1960
- * @returns An object containing the edges of the found face and their indices, or null if no face was found.
1961
- */
1962
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
1963
- edges: MeasureEdge[];
1964
- indices: Set<number>;
1965
- } | null;
1966
- /**
1967
- * Method to get the vertices and normal of a mesh face at a given index.
1968
- * It also applies instance transformation if provided.
1969
- *
1970
- * @param mesh - The mesh to get the face from. It must be indexed.
1971
- * @param faceIndex - The index of the face within the mesh.
1972
- * @param instance - The instance of the mesh (optional).
1973
- * @returns An object containing the vertices and normal of the face.
1974
- * @throws Will throw an error if the geometry is not indexed.
1975
- */
1976
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
1977
- p1: THREE.Vector3;
1978
- p2: THREE.Vector3;
1979
- p3: THREE.Vector3;
1980
- faceNormal: THREE.Vector3;
1981
- };
1982
- /**
1983
- * Method to round the vector's components to a specified number of decimal places.
1984
- * This is used to ensure numerical precision in edge detection.
1985
- *
1986
- * @param vector - The vector to round.
1987
- * @returns The vector with rounded components.
1988
- */
1989
- round(vector: THREE.Vector3): void;
1990
- /**
1991
- * Calculates the volume of a set of fragments.
1992
- *
1993
- * @param frags - A map of fragment IDs to their corresponding item IDs.
1994
- * @returns The total volume of the fragments and the bounding sphere.
1995
- *
1996
- * @remarks
1997
- * This method creates a set of instanced meshes from the given fragments and item IDs.
1998
- * It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
1999
- *
2000
- * @throws Will throw an error if the geometry of the meshes is not indexed.
2001
- * @throws Will throw an error if the fragment manager is not available.
2002
- */
2003
- getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
2004
- /**
2005
- * Calculates the total volume of a set of meshes.
2006
- *
2007
- * @param meshes - An array of meshes or instanced meshes to calculate the volume from.
2008
- * @returns The total volume of the meshes and the bounding sphere.
2009
- *
2010
- * @remarks
2011
- * This method calculates the volume of each mesh in the provided array and returns the total volume
2012
- * and its bounding sphere.
2013
- *
2014
- */
2015
- getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
2016
- private getFaceData;
2017
- private getVolumeOfMesh;
2018
- private getSignedVolumeOfTriangle;
2019
- }
2020
- import * as WEBIFC from "web-ifc";
2021
- import * as FRAG from "@thatopen/fragments";
2022
- import { Component, Components } from "../../core";
2023
- /**
2024
- * 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).
2025
- */
2026
- export declare class IfcJsonExporter extends Component {
2027
- /**
2028
- * A unique identifier for the component.
2029
- * This UUID is used to register the component within the Components system.
2030
- */
2031
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
2032
- /** {@link Component.enabled} */
2033
- enabled: boolean;
2034
- constructor(components: Components);
2035
- /**
2036
- * Exports all the properties of an IFC into an array of JS objects.
2037
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
2038
- * @param modelID ID of the IFC model whose properties to extract.
2039
- * @param indirect whether to get the indirect relationships as well.
2040
- * @param recursiveSpatial whether to get the properties of spatial items recursively
2041
- * to make the location data available (e.g. absolute position of building).
2042
- */
2043
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
2044
- }
2045
- import { BooleanSettingsControl } from "../../Types";
2046
- import { Viewpoints } from "../index";
2047
- import { Configurator } from "../../ConfigManager";
2048
- /**
2049
- * Configuration interface for the Viewpoints general behavior.
2050
- */
2051
- export interface ViewpointsConfig {
2052
- /**
2053
- * Indicates whether to overwrite the fragments colors when applying viewpoints.
2054
- * @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
2055
- * @default false
2056
- */
2057
- overwriteColors: boolean;
2058
- }
2059
- type ViewpointsConfigType = {
2060
- overwriteColors: BooleanSettingsControl;
2061
- };
2062
- export declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
2063
- protected _config: ViewpointsConfigType;
2064
- get overwriteColors(): boolean;
2065
- set overwriteColors(value: boolean);
2066
- }
2067
- export {};
2068
- import * as WEBIFC from "web-ifc";
2069
- import { FragmentsGroup } from "@thatopen/fragments";
2070
- import { Disposable, Event, Component, Components } from "../../core";
2071
- import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation, RelationsProcessingConfig, EntitiesRelatedEvent } from "./src";
2072
- /**
2073
- * 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).
2074
- */
2075
- export declare class IfcRelationsIndexer extends Component implements Disposable {
2076
- /**
2077
- * A unique identifier for the component.
2078
- * This UUID is used to register the component within the Components system.
2079
- */
2080
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
2081
- /** {@link Disposable.onDisposed} */
2082
- readonly onDisposed: Event<string>;
2083
- /**
2084
- * Event triggered when relations for a model have been indexed.
2085
- * This event provides the model's UUID and the relations map generated for that model.
2086
- *
2087
- * @property {string} modelID - The UUID of the model for which relations have been indexed.
2088
- * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
2089
- * 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.
2090
- */
2091
- readonly onRelationsIndexed: Event<{
2092
- modelID: string;
2093
- relationsMap: RelationsMap;
2094
- }>;
2095
- /**
2096
- * Holds the relationship mappings for each model processed by the indexer.
2097
- * The structure is a map where each key is a model's UUID, and the value is another map.
2098
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
2099
- * representing a specific relation type, and the value is an array of expressIDs of entities
2100
- * that are related through that relation type. This structure allows for efficient querying
2101
- * of entity relationships within a model.
1940
+ * Holds the relationship mappings for each model processed by the indexer.
1941
+ * The structure is a map where each key is a model's UUID, and the value is another map.
1942
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
1943
+ * representing a specific relation type, and the value is an array of expressIDs of entities
1944
+ * that are related through that relation type. This structure allows for efficient querying
1945
+ * of entity relationships within a model.
2102
1946
  */
2103
1947
  readonly relationMaps: ModelsRelationMap;
2104
1948
  /** {@link Component.enabled} */
@@ -2591,53 +2435,210 @@ export declare class IfcFinder extends Component {
2591
2435
  */
2592
2436
  clear(): void;
2593
2437
  }
2594
- import * as WEBIFC from "web-ifc";
2595
- export interface IfcItemsCategories {
2596
- [itemID: number]: number;
2597
- }
2598
- export declare class IfcCategories {
2599
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2600
- }
2601
2438
  import * as THREE from "three";
2602
- import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
2603
- import { Configurator } from "../../ConfigManager";
2604
- import { Clipper } from "../index";
2605
- type ClipperConfigType = {
2606
- enabled: BooleanSettingsControl;
2607
- visible: BooleanSettingsControl;
2608
- color: ColorSettingsControl;
2609
- opacity: NumberSettingControl;
2610
- size: NumberSettingControl;
2439
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
2440
+ center: THREE.Vector3;
2441
+ halfSizes: THREE.Vector3;
2442
+ rotation: THREE.Matrix3;
2443
+ transformation: THREE.Matrix4;
2611
2444
  };
2612
- /**
2613
- * Configuration interface for the {@link Clipper}.
2614
- */
2615
- export interface ClipperConfig {
2616
- color: THREE.Color;
2617
- opacity: number;
2618
- size: number;
2445
+ import * as THREE from "three";
2446
+ export declare class MaterialsUtils {
2447
+ static isTransparent(material: THREE.Material): boolean;
2619
2448
  }
2620
- export declare class ClipperConfigManager extends Configurator<Clipper, ClipperConfigType> {
2621
- protected _config: ClipperConfigType;
2622
- get enabled(): boolean;
2623
- set enabled(value: boolean);
2624
- get visible(): boolean;
2625
- set visible(value: boolean);
2626
- get color(): THREE.Color;
2627
- set color(value: THREE.Color);
2628
- get opacity(): number;
2629
- set opacity(value: number);
2630
- get size(): number;
2631
- set size(value: number);
2449
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
2450
+ export declare class UUID {
2451
+ private static _pattern;
2452
+ private static _lut;
2453
+ static create(): string;
2454
+ static validate(uuid: string): void;
2632
2455
  }
2633
- export {};
2456
+ import * as THREE from "three";
2457
+ import { Component, Components, Disposable, Event, World } from "../core";
2634
2458
  /**
2635
- * 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.
2636
- *
2637
- * @remarks
2638
- * This map is used to provide a mapping between IFC entity type numbers and their names.
2639
- * It is useful for identifying and processing different types of IFC elements in a project.
2640
- *
2459
+ * Configuration interface for the VertexPicker component.
2460
+ */
2461
+ export interface VertexPickerConfig {
2462
+ /**
2463
+ * If true, only vertices will be picked, not the closest point on the face.
2464
+ */
2465
+ showOnlyVertex: boolean;
2466
+ /**
2467
+ * The maximum distance for snapping to a vertex.
2468
+ */
2469
+ snapDistance: number;
2470
+ /**
2471
+ * The HTML element to use for previewing the picked vertex.
2472
+ */
2473
+ previewElement: HTMLElement;
2474
+ }
2475
+ /**
2476
+ * A class that provides functionality for picking vertices in a 3D scene.
2477
+ */
2478
+ export declare class VertexPicker extends Component implements Disposable {
2479
+ /** {@link Disposable.onDisposed} */
2480
+ readonly onDisposed: Event<unknown>;
2481
+ /**
2482
+ * An event that is triggered when a vertex is found.
2483
+ * The event passes a THREE.Vector3 representing the position of the found vertex.
2484
+ */
2485
+ readonly onVertexFound: Event<THREE.Vector3>;
2486
+ /**
2487
+ * An event that is triggered when a vertex is lost.
2488
+ * The event passes a THREE.Vector3 representing the position of the lost vertex.
2489
+ */
2490
+ readonly onVertexLost: Event<THREE.Vector3>;
2491
+ /**
2492
+ * An event that is triggered when the picker is enabled or disabled
2493
+ */
2494
+ readonly onEnabled: Event<boolean>;
2495
+ /**
2496
+ * A reference to the Components instance associated with this VertexPicker.
2497
+ */
2498
+ components: Components;
2499
+ /**
2500
+ * A reference to the working plane used for vertex picking.
2501
+ * This plane is used to determine which vertices are considered valid for picking.
2502
+ * If this value is null, all vertices are considered valid.
2503
+ */
2504
+ workingPlane: THREE.Plane | null;
2505
+ private _pickedPoint;
2506
+ private _config;
2507
+ private _enabled;
2508
+ /**
2509
+ * Sets the enabled state of the VertexPicker.
2510
+ * When enabled, the VertexPicker will actively search for vertices in the 3D scene.
2511
+ * When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
2512
+ *
2513
+ * @param value - The new enabled state.
2514
+ */
2515
+ set enabled(value: boolean);
2516
+ /**
2517
+ * Gets the current enabled state of the VertexPicker.
2518
+ *
2519
+ * @returns The current enabled state.
2520
+ */
2521
+ get enabled(): boolean;
2522
+ /**
2523
+ * Sets the configuration for the VertexPicker component.
2524
+ *
2525
+ * @param value - A Partial object containing the configuration properties to update.
2526
+ * The properties not provided in the value object will retain their current values.
2527
+ *
2528
+ * @example
2529
+ * '''typescript
2530
+ * vertexPicker.config = {
2531
+ * snapDistance: 0.5,
2532
+ * showOnlyVertex: true,
2533
+ * };
2534
+ * '''
2535
+ */
2536
+ set config(value: Partial<VertexPickerConfig>);
2537
+ /**
2538
+ * Gets the current configuration for the VertexPicker component.
2539
+ *
2540
+ * @returns A copy of the current VertexPickerConfig object.
2541
+ *
2542
+ * @example
2543
+ * '''typescript
2544
+ * const currentConfig = vertexPicker.config;
2545
+ * console.log(currentConfig.snapDistance); // Output: 0.25
2546
+ * '''
2547
+ */
2548
+ get config(): Partial<VertexPickerConfig>;
2549
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
2550
+ /** {@link Disposable.dispose} */
2551
+ dispose(): void;
2552
+ /**
2553
+ * Performs the vertex picking operation based on the current state of the VertexPicker.
2554
+ *
2555
+ * @param world - The World instance to use for raycasting.
2556
+ *
2557
+ * @returns The current picked point, or null if no point is picked.
2558
+ *
2559
+ * @remarks
2560
+ * This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
2561
+ * If enabled, it performs raycasting to find the closest intersecting object.
2562
+ * It then determines the closest vertex or point on the face, based on the configuration settings.
2563
+ * If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
2564
+ * If the picked point is not on the working plane, it resets the 'pickedPoint'.
2565
+ * If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
2566
+ */
2567
+ get(world: World): THREE.Vector3 | null;
2568
+ private getClosestVertex;
2569
+ private getVertices;
2570
+ private getVertex;
2571
+ }
2572
+ import { BooleanSettingsControl } from "../../Types";
2573
+ import { Viewpoints } from "../index";
2574
+ import { Configurator } from "../../ConfigManager";
2575
+ /**
2576
+ * Configuration interface for the Viewpoints general behavior.
2577
+ */
2578
+ export interface ViewpointsConfig {
2579
+ /**
2580
+ * Indicates whether to overwrite the fragments colors when applying viewpoints.
2581
+ * @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
2582
+ * @default false
2583
+ */
2584
+ overwriteColors: boolean;
2585
+ }
2586
+ type ViewpointsConfigType = {
2587
+ overwriteColors: BooleanSettingsControl;
2588
+ };
2589
+ export declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
2590
+ protected _config: ViewpointsConfigType;
2591
+ get overwriteColors(): boolean;
2592
+ set overwriteColors(value: boolean);
2593
+ }
2594
+ export {};
2595
+ import * as THREE from "three";
2596
+ import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
2597
+ import { Configurator } from "../../ConfigManager";
2598
+ import { Clipper } from "../index";
2599
+ type ClipperConfigType = {
2600
+ enabled: BooleanSettingsControl;
2601
+ visible: BooleanSettingsControl;
2602
+ color: ColorSettingsControl;
2603
+ opacity: NumberSettingControl;
2604
+ size: NumberSettingControl;
2605
+ };
2606
+ /**
2607
+ * Configuration interface for the {@link Clipper}.
2608
+ */
2609
+ export interface ClipperConfig {
2610
+ color: THREE.Color;
2611
+ opacity: number;
2612
+ size: number;
2613
+ }
2614
+ export declare class ClipperConfigManager extends Configurator<Clipper, ClipperConfigType> {
2615
+ protected _config: ClipperConfigType;
2616
+ get enabled(): boolean;
2617
+ set enabled(value: boolean);
2618
+ get visible(): boolean;
2619
+ set visible(value: boolean);
2620
+ get color(): THREE.Color;
2621
+ set color(value: THREE.Color);
2622
+ get opacity(): number;
2623
+ set opacity(value: number);
2624
+ get size(): number;
2625
+ set size(value: number);
2626
+ }
2627
+ export {};
2628
+ import * as WEBIFC from "web-ifc";
2629
+ export interface IfcItemsCategories {
2630
+ [itemID: number]: number;
2631
+ }
2632
+ export declare class IfcCategories {
2633
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
2634
+ }
2635
+ /**
2636
+ * 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.
2637
+ *
2638
+ * @remarks
2639
+ * This map is used to provide a mapping between IFC entity type numbers and their names.
2640
+ * It is useful for identifying and processing different types of IFC elements in a project.
2641
+ *
2641
2642
  */
2642
2643
  export declare const IfcElements: {
2643
2644
  [key: number]: string;
@@ -2676,26 +2677,6 @@ export declare class IfcPropertiesUtils {
2676
2677
  export declare const ifcCategoryCase: {
2677
2678
  [upperCase: string]: string;
2678
2679
  };
2679
- /**
2680
- * A Set of unique numbers representing different types of IFC geometries.
2681
- */
2682
- export declare const GeometryTypes: Set<number>;
2683
- import { Components } from "../../../../core/Components";
2684
- import { IDSFacet } from "../facets";
2685
- export declare const createPropertyFacets: (components: Components, elements: any) => IDSFacet[];
2686
- import * as WEBIFC from "web-ifc";
2687
- import { IfcItemsCategories } from "../../../ifc";
2688
- export declare class SpatialStructure {
2689
- itemsByFloor: IfcItemsCategories;
2690
- private _units;
2691
- setUp(webIfc: WEBIFC.IfcAPI): void;
2692
- cleanUp(): void;
2693
- }
2694
- import * as FRAGS from "@thatopen/fragments";
2695
- import * as WEBIFC from "web-ifc";
2696
- export declare class SpatialIdsFinder {
2697
- static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
2698
- }
2699
2680
  import * as FRAGS from "@thatopen/fragments";
2700
2681
  import { IfcFinderQuery } from "./ifc-finder-query";
2701
2682
  import { Components } from "../../../core";
@@ -2766,6 +2747,14 @@ export declare class IfcQueryGroup {
2766
2747
  update(modelID: string, file: File): Promise<void>;
2767
2748
  }
2768
2749
  import * as WEBIFC from "web-ifc";
2750
+ import { IfcItemsCategories } from "../../../ifc";
2751
+ export declare class SpatialStructure {
2752
+ itemsByFloor: IfcItemsCategories;
2753
+ private _units;
2754
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2755
+ cleanUp(): void;
2756
+ }
2757
+ import * as WEBIFC from "web-ifc";
2769
2758
  /** Configuration of the IFC-fragment conversion. */
2770
2759
  export declare class IfcFragmentSettings {
2771
2760
  /** Whether to extract the IFC properties into a JSON. */
@@ -2806,383 +2795,578 @@ export declare class IfcFragmentSettings {
2806
2795
  */
2807
2796
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2808
2797
  }
2798
+ import * as FRAGS from "@thatopen/fragments";
2799
+ import * as WEBIFC from "web-ifc";
2800
+ export declare class SpatialIdsFinder {
2801
+ static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
2802
+ }
2803
+ /**
2804
+ * A Set of unique numbers representing different types of IFC geometries.
2805
+ */
2806
+ export declare const GeometryTypes: Set<number>;
2809
2807
  import { InverseAttribute } from "./types";
2810
2808
  export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
2811
2809
  forRelating: InverseAttribute;
2812
2810
  forRelated: InverseAttribute;
2813
2811
  }>;
2814
- import { SimplePlane } from "../../Clipper";
2815
- import { DataSet } from "../../Types";
2816
- export interface ViewpointCamera {
2817
- direction: {
2818
- x: number;
2819
- y: number;
2820
- z: number;
2821
- };
2822
- position: {
2823
- x: number;
2824
- y: number;
2825
- z: number;
2826
- };
2827
- aspectRatio: number;
2828
- }
2829
- export interface ViewpointPerspectiveCamera extends ViewpointCamera {
2830
- fov: number;
2831
- }
2832
- export interface ViewpointOrthographicCamera extends ViewpointCamera {
2833
- viewToWorldScale: number;
2834
- }
2812
+ import { Components } from "../../../../core/Components";
2813
+ import { IDSFacet } from "../facets";
2814
+ export declare const createPropertyFacets: (components: Components, elements: any) => IDSFacet[];
2835
2815
  /**
2836
- * Represents a viewpoint in a BCF file.
2816
+ * 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.
2837
2817
  */
2838
- export interface BCFViewpoint {
2839
- title?: string;
2840
- guid: string;
2841
- camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
2842
- selectionComponents: Iterable<string>;
2843
- exceptionComponents: Iterable<string>;
2844
- clippingPlanes: DataSet<SimplePlane>;
2845
- spacesVisible: boolean;
2846
- spaceBoundariesVisible: boolean;
2847
- openingsVisible: boolean;
2848
- defaultVisibility: boolean;
2818
+ export declare class Event<T> {
2819
+ /**
2820
+ * Add a callback to this event instance.
2821
+ * @param handler - the callback to be added to this event.
2822
+ */
2823
+ add(handler: T extends void ? {
2824
+ (): void;
2825
+ } : {
2826
+ (data: T): void;
2827
+ }): void;
2828
+ /**
2829
+ * Removes a callback from this event instance.
2830
+ * @param handler - the callback to be removed from this event.
2831
+ */
2832
+ remove(handler: T extends void ? {
2833
+ (): void;
2834
+ } : {
2835
+ (data: T): void;
2836
+ }): void;
2837
+ /** Triggers all the callbacks assigned to this event. */
2838
+ trigger: (data?: T) => void;
2839
+ /** Gets rid of all the suscribed events. */
2840
+ reset(): void;
2841
+ private handlers;
2842
+ }
2843
+ /**
2844
+ * 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.
2845
+ */
2846
+ export declare class AsyncEvent<T> {
2847
+ /**
2848
+ * Add a callback to this event instance.
2849
+ * @param handler - the callback to be added to this event.
2850
+ */
2851
+ add(handler: T extends void ? {
2852
+ (): Promise<void>;
2853
+ } : {
2854
+ (data: T): Promise<void>;
2855
+ }): void;
2856
+ /**
2857
+ * Removes a callback from this event instance.
2858
+ * @param handler - the callback to be removed from this event.
2859
+ */
2860
+ remove(handler: T extends void ? {
2861
+ (): Promise<void>;
2862
+ } : {
2863
+ (data: T): Promise<void>;
2864
+ }): void;
2865
+ /** Triggers all the callbacks assigned to this event. */
2866
+ trigger: (data?: T) => Promise<void>;
2867
+ /** Gets rid of all the suscribed events. */
2868
+ reset(): void;
2869
+ private handlers;
2849
2870
  }
2850
2871
  import * as THREE from "three";
2851
- import * as FRAGS from "@thatopen/fragments";
2852
- import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
2853
- import { CameraProjection } from "../../OrthoPerspectiveCamera";
2854
- import { Components } from "../../Components";
2855
- import { DataMap, DataSet, World } from "../../Types";
2856
- import { SimplePlane } from "../../Clipper";
2872
+ import CameraControls from "camera-controls";
2873
+ import { Event } from "./event";
2857
2874
  /**
2858
- * Represents a BCF compliant viewpoint from BuildingSMART.
2859
- *
2860
- * The Viewpoint class provides methods for managing and interacting with viewpoints.
2861
- * It includes functionality for setting viewpoint properties, updating the camera,
2862
- * applying color to components, and serializing the viewpoint for export.
2875
+ * Whether this component has to be manually destroyed once you are done with it to prevent [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). This also ensures that the DOM events created by that component will be cleaned up.
2863
2876
  */
2864
- export declare class Viewpoint implements BCFViewpoint {
2865
- title?: string;
2866
- readonly guid: string;
2877
+ export interface Disposable {
2867
2878
  /**
2868
- * ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
2869
- * Each clipping plane is defined by Location and Direction.
2870
- * The Direction vector points in the invisible direction meaning the half-space that is clipped.
2871
- * @experimental
2879
+ * Destroys the object from memory to prevent a
2880
+ * [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
2872
2881
  */
2873
- clippingPlanes: DataSet<SimplePlane>;
2874
- camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
2882
+ dispose: () => void | Promise<void>;
2883
+ /** Fired after the tool has been disposed. */
2884
+ readonly onDisposed: Event<any>;
2885
+ }
2886
+ /**
2887
+ * Whether the geometric representation of this component can be hidden or shown in the [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
2888
+ */
2889
+ export interface Hideable {
2875
2890
  /**
2876
- * A list of components GUIDs to hide when defaultVisibility = true or to show when defaultVisibility = false
2891
+ * Whether the geometric representation of this component is
2892
+ * currently visible or not in the
2893
+ * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
2877
2894
  */
2878
- readonly exceptionComponents: DataSet<string>;
2895
+ visible: boolean;
2896
+ }
2897
+ /**
2898
+ * Whether this component can be resized. The meaning of this can vary depending on the component: resizing a [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) component could mean changing its resolution, whereas resizing a [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
2899
+ */
2900
+ export interface Resizeable {
2879
2901
  /**
2880
- * A list of components GUIDs that should be selected (highlighted) when displaying a viewpoint.
2902
+ * Sets size of this component (e.g. the resolution of a
2903
+ * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
2904
+ * component.
2881
2905
  */
2882
- readonly selectionComponents: DataSet<string>;
2906
+ resize: (size?: THREE.Vector2) => void;
2907
+ /** Event that fires when the component has been resized. */
2908
+ onResize: Event<THREE.Vector2>;
2883
2909
  /**
2884
- * A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
2885
- * For this to work, call viewpoint.colorize()
2910
+ * Gets the current size of this component (e.g. the resolution of a
2911
+ * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
2912
+ * component.
2886
2913
  */
2887
- readonly componentColors: DataMap<THREE.Color, string[]>;
2914
+ getSize: () => THREE.Vector2;
2915
+ }
2916
+ /** Whether this component should be updated each frame. */
2917
+ export interface Updateable {
2918
+ /** Actions that should be executed after updating the component. */
2919
+ onAfterUpdate: Event<any>;
2920
+ /** Actions that should be executed before updating the component. */
2921
+ onBeforeUpdate: Event<any>;
2888
2922
  /**
2889
- * Boolean flags to allow fine control over the visibility of spaces.
2890
- * A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
2891
- * @default false
2923
+ * Function used to update the state of this component each frame. For
2924
+ * instance, a renderer component will make a render each frame.
2892
2925
  */
2893
- spacesVisible: boolean;
2926
+ update(delta?: number): void;
2927
+ }
2928
+ /** Basic type to describe the progress of any kind of process. */
2929
+ export interface Progress {
2930
+ /** The amount of things that have been done already. */
2931
+ current: number;
2932
+ /** The total amount of things to be done by the process. */
2933
+ total: number;
2934
+ }
2935
+ /**
2936
+ * Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
2937
+ */
2938
+ export interface Createable {
2939
+ /** Creates a new instance of an element (e.g. a new Dimension). */
2940
+ create: (data: any) => void;
2894
2941
  /**
2895
- * Boolean flags to allow fine control over the visibility of space boundaries.
2896
- * A typical use of these flags is when DefaultVisibility=true but space boundaries should remain hidden.
2897
- * @default false
2942
+ * Finish the creation process of the component, successfully creating an
2943
+ * instance of whatever the component creates.
2898
2944
  */
2899
- spaceBoundariesVisible: boolean;
2945
+ endCreation?: (data: any) => void;
2900
2946
  /**
2901
- * Boolean flags to allow fine control over the visibility of openings.
2902
- * A typical use of these flags is when DefaultVisibility=true but openings should remain hidden.
2903
- * @default false
2947
+ * Cancels the creation process of the component, going back to the state
2948
+ * before starting to create.
2904
2949
  */
2905
- openingsVisible: boolean;
2950
+ cancelCreation?: (data: any) => void;
2951
+ /** Deletes an existing instance of an element (e.g. a Dimension). */
2952
+ delete: (data: any) => void;
2953
+ }
2954
+ /**
2955
+ * Whether this component supports to be configured.
2956
+ */
2957
+ export interface Configurable<T, U> {
2958
+ /** Wether this components has been already configured. */
2959
+ isSetup: boolean;
2960
+ /** Use the provided configuration to set up the tool. */
2961
+ setup: (config?: Partial<U>) => void | Promise<void>;
2962
+ /** Fired after successfully calling {@link Configurable.setup()} */
2963
+ readonly onSetup: Event<any>;
2964
+ /** Object holding the tool configuration. You can edit this directly to change the object.
2965
+ */
2966
+ config: Required<T>;
2967
+ }
2968
+ /**
2969
+ * Whether a camera uses the Camera Controls library.
2970
+ */
2971
+ export interface CameraControllable {
2906
2972
  /**
2907
- * When true, all components should be visible unless listed in the exceptions
2908
- * When false all components should be invisible unless listed in the exceptions
2973
+ * An instance of CameraControls that provides camera control functionalities.
2974
+ * This instance is used to manipulate the camera.
2909
2975
  */
2910
- defaultVisibility: boolean;
2911
- private get _selectionModelIdMap();
2912
- private get _exceptionModelIdMap();
2976
+ controls: CameraControls;
2977
+ }
2978
+ import { Base } from "./base";
2979
+ /**
2980
+ * Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
2981
+ */
2982
+ export declare abstract class Component extends Base {
2913
2983
  /**
2914
- * A list of components that should be selected (highlighted) when displaying a viewpoint.
2915
- * @returns The fragmentIdMap for components marked as selections.
2984
+ * Whether this component is active or not. The behaviour can vary depending
2985
+ * on the type of component. E.g. a disabled dimension tool will stop creating
2986
+ * dimensions, while a disabled camera will stop moving. A disabled component
2987
+ * will not be updated automatically each frame.
2916
2988
  */
2917
- get selection(): FRAGS.FragmentIdMap;
2989
+ abstract enabled: boolean;
2990
+ }
2991
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2992
+ import { Components } from "../../Components";
2993
+ /**
2994
+ * Base class of the library. Useful for finding out the interfaces something implements.
2995
+ */
2996
+ export declare abstract class Base {
2997
+ components: Components;
2998
+ constructor(components: Components);
2999
+ /** Whether is component is {@link Disposable}. */
3000
+ isDisposeable: () => this is Disposable;
3001
+ /** Whether is component is {@link Resizeable}. */
3002
+ isResizeable: () => this is Resizeable;
3003
+ /** Whether is component is {@link Updateable}. */
3004
+ isUpdateable: () => this is Updateable;
3005
+ /** Whether is component is {@link Hideable}. */
3006
+ isHideable: () => this is Hideable;
3007
+ /** Whether is component is {@link Configurable}. */
3008
+ isConfigurable: () => this is Configurable<any, any>;
3009
+ }
3010
+ import * as THREE from "three";
3011
+ import CameraControls from "camera-controls";
3012
+ import { BaseWorldItem } from "./base-world-item";
3013
+ import { CameraControllable } from "./interfaces";
3014
+ /**
3015
+ * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
3016
+ */
3017
+ export declare abstract class BaseCamera extends BaseWorldItem {
2918
3018
  /**
2919
- * A list of components to hide when defaultVisibility = true or to show when defaultVisibility = false
2920
- * @returns The fragmentIdMap for components marked as exceptions.
3019
+ * Whether the camera is enabled or not.
2921
3020
  */
2922
- get exception(): FRAGS.FragmentIdMap;
3021
+ abstract enabled: boolean;
2923
3022
  /**
2924
- * Retrieves the projection type of the viewpoint's camera.
2925
- *
2926
- * @returns A string representing the projection type of the viewpoint's camera.
2927
- * It can be either 'Perspective' or 'Orthographic'.
3023
+ * The Three.js camera instance.
2928
3024
  */
2929
- get projection(): CameraProjection;
3025
+ abstract three: THREE.Camera;
2930
3026
  /**
2931
- * Retrieves the position vector of the viewpoint's camera.
3027
+ * Optional CameraControls instance for controlling the camera.
3028
+ * This property is only available if the camera is controllable.
3029
+ */
3030
+ abstract controls?: CameraControls;
3031
+ /**
3032
+ * Checks whether the instance is {@link CameraControllable}.
2932
3033
  *
2933
- * @remarks
2934
- * The position vector represents the camera's position in the world coordinate system.
2935
- * The function applies the base coordinate system transformation to the position vector.
3034
+ * @returns True if the instance is controllable, false otherwise.
3035
+ */
3036
+ hasCameraControls: () => this is CameraControllable;
3037
+ }
3038
+ import { Base } from "./base";
3039
+ import { World } from "./world";
3040
+ import { Event } from "./event";
3041
+ import { Components } from "../../Components";
3042
+ /**
3043
+ * One of the elements that make a world. It can be either a scene, a camera or a renderer.
3044
+ */
3045
+ export declare abstract class BaseWorldItem extends Base {
3046
+ readonly worlds: Map<string, World>;
3047
+ /**
3048
+ * Event that is triggered when a world is added or removed from the 'worlds' map.
3049
+ * The event payload contains the world instance and the action ("added" or "removed").
3050
+ */
3051
+ readonly onWorldChanged: Event<{
3052
+ world: World;
3053
+ action: "added" | "removed";
3054
+ }>;
3055
+ /**
3056
+ * The current world this item is associated with. It can be null if no world is currently active.
3057
+ */
3058
+ currentWorld: World | null;
3059
+ protected constructor(components: Components);
3060
+ }
3061
+ import * as THREE from "three";
3062
+ import { Vector2 } from "three";
3063
+ import { Event } from "./event";
3064
+ import { BaseWorldItem } from "./base-world-item";
3065
+ import { Disposable, Resizeable, Updateable } from "./interfaces";
3066
+ /**
3067
+ * Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
3068
+ */
3069
+ export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
3070
+ /**
3071
+ * The three.js WebGLRenderer instance associated with this renderer.
2936
3072
  *
2937
- * @returns A THREE.Vector3 representing the position of the viewpoint's camera.
3073
+ * @abstract
3074
+ * @type {THREE.WebGLRenderer}
2938
3075
  */
2939
- get position(): THREE.Vector3;
3076
+ abstract three: THREE.WebGLRenderer;
3077
+ /** {@link Updateable.onBeforeUpdate} */
3078
+ onAfterUpdate: Event<unknown>;
3079
+ /** {@link Updateable.onAfterUpdate} */
3080
+ onBeforeUpdate: Event<unknown>;
3081
+ /** {@link Disposable.onDisposed} */
3082
+ readonly onDisposed: Event<undefined>;
3083
+ /** {@link Resizeable.onResize} */
3084
+ readonly onResize: Event<THREE.Vector2>;
2940
3085
  /**
2941
- * Retrieves the direction vector of the viewpoint's camera.
3086
+ * Event that fires when there has been a change to the list of clipping
3087
+ * planes used by the active renderer.
3088
+ */
3089
+ readonly onClippingPlanesUpdated: Event<unknown>;
3090
+ /** {@link Updateable.update} */
3091
+ abstract update(delta?: number): void | Promise<void>;
3092
+ /** {@link Disposable.dispose} */
3093
+ abstract dispose(): void;
3094
+ /** {@link Resizeable.getSize} */
3095
+ abstract getSize(): Vector2;
3096
+ /** {@link Resizeable.resize} */
3097
+ abstract resize(size: Vector2 | undefined): void;
3098
+ /**
3099
+ * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
3100
+ */
3101
+ clippingPlanes: THREE.Plane[];
3102
+ /**
3103
+ * Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
2942
3104
  *
2943
3105
  * @remarks
2944
- * The direction vector represents the direction in which the camera is pointing.
2945
- * It is calculated by extracting the x, y, and z components from the camera's direction property.
3106
+ * This method is typically called when there is a change to the list of clipping planes
3107
+ * used by the active renderer.
3108
+ */
3109
+ updateClippingPlanes(): void;
3110
+ /**
3111
+ * Sets or removes a clipping plane from the renderer.
2946
3112
  *
2947
- * @returns A THREE.Vector3 representing the direction of the viewpoint's camera.
3113
+ * @param active - A boolean indicating whether the clipping plane should be active or not.
3114
+ * @param plane - The clipping plane to be added or removed.
3115
+ * @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
3116
+ *
3117
+ * @remarks
3118
+ * This method adds or removes a clipping plane from the 'clippingPlanes' array.
3119
+ * If 'active' is 'true' and the plane is not already in the array, it is added.
3120
+ * If 'active' is 'false' and the plane is in the array, it is removed.
3121
+ * The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
3122
+ * excluding any planes marked as local.
2948
3123
  */
2949
- get direction(): THREE.Vector3;
2950
- private _components;
3124
+ setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
3125
+ }
3126
+ import * as THREE from "three";
3127
+ import { Disposable } from "./interfaces";
3128
+ import { Event } from "./event";
3129
+ import { Components } from "../../Components";
3130
+ import { BaseWorldItem } from "./base-world-item";
3131
+ /**
3132
+ * Abstract class representing a base scene in the application. All scenes should use this class as a base.
3133
+ */
3134
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
3135
+ /** {@link Disposable.onDisposed} */
3136
+ readonly onDisposed: Event<unknown>;
3137
+ /**
3138
+ * Abstract property representing the three.js object associated with this scene.
3139
+ * It should be implemented by subclasses.
3140
+ */
3141
+ abstract three: THREE.Object3D;
3142
+ /** The set of directional lights managed by this scene component. */
3143
+ directionalLights: Map<string, THREE.DirectionalLight>;
3144
+ /** The set of ambient lights managed by this scene component. */
3145
+ ambientLights: Map<string, THREE.AmbientLight>;
3146
+ protected constructor(components: Components);
3147
+ /** {@link Disposable.dispose} */
3148
+ dispose(): void;
3149
+ deleteAllLights(): void;
3150
+ }
3151
+ import { Event } from "./event";
3152
+ /**
3153
+ * A class that extends the built-in Set class and provides additional functionality.
3154
+ * It triggers events when items are added, deleted, or the set is cleared.
3155
+ *
3156
+ * @template T - The type of elements in the set.
3157
+ */
3158
+ export declare class DataSet<T> extends Set<T> {
2951
3159
  /**
2952
- * Represents the world in which the viewpoints are created and managed.
3160
+ * An event that is triggered when a new item is added to the set.
2953
3161
  */
2954
- readonly world: World;
2955
- private get _managerVersion();
3162
+ readonly onItemAdded: Event<T>;
2956
3163
  /**
2957
- * Retrieves the list of BCF topics associated with the current viewpoint.
2958
- *
2959
- * @remarks
2960
- * This function retrieves the BCFTopics manager from the components,
2961
- * then filters the list of topics to find those associated with the current viewpoint.
2962
- *
2963
- * @returns An array of BCF topics associated with the current viewpoint.
3164
+ * An event that is triggered when an item is deleted from the set.
2964
3165
  */
2965
- get topics(): import("../../../openbim/BCFTopics").Topic[];
2966
- constructor(components: Components, world: World, _config?: {
2967
- data?: Partial<BCFViewpoint>;
2968
- setCamera?: boolean;
2969
- });
3166
+ readonly onItemDeleted: Event<unknown>;
2970
3167
  /**
2971
- * Adds components to the viewpoint based on the provided fragment ID map.
2972
- *
2973
- * @param fragmentIdMap - A map containing fragment IDs as keys and arrays of express IDs as values.
3168
+ * An event that is triggered when the set is cleared.
2974
3169
  */
2975
- addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
3170
+ readonly onCleared: Event<unknown>;
2976
3171
  /**
2977
- * Replace the properties of the viewpoint with the provided data.
2978
- *
2979
- * @remarks The guid will be ommited as it shouldn't change after it has been initially set.
2980
- * @remarks The existing selection and exception components will be fully replaced in case new ones are provided.
2981
- *
2982
- * @param data - An object containing the properties to be set.
2983
- * The properties not included in the object will remain unchanged.
3172
+ * Constructs a new instance of the DataSet class.
2984
3173
  *
2985
- * @returns The viewpoint instance with the updated properties.
3174
+ * @param iterable - An optional iterable object to initialize the set with.
2986
3175
  */
2987
- set(data: Partial<BCFViewpoint>): this;
3176
+ constructor(iterable?: Iterable<T> | null);
2988
3177
  /**
2989
- * Sets the viewpoint of the camera in the world.
2990
- *
2991
- * @remarks
2992
- * This function calculates the target position based on the viewpoint information.
2993
- * It sets the visibility of the viewpoint components and then applies the viewpoint using the camera's controls.
2994
- *
2995
- * @param transition - Indicates whether the camera movement should have a transition effect.
2996
- * Default value is 'true'.
2997
- *
2998
- * @throws An error if the world's camera does not have camera controls.
2999
- *
3000
- * @returns A Promise that resolves when the camera has been set.
3178
+ * Clears the set and triggers the onCleared event.
3001
3179
  */
3002
- go(transition?: boolean): Promise<void>;
3180
+ clear(): void;
3003
3181
  /**
3004
- * Updates the camera settings of the viewpoint based on the current world's camera and renderer.
3005
- *
3006
- * @remarks
3007
- * This function retrieves the camera's position, direction, and aspect ratio from the world's camera and renderer.
3008
- * It then calculates the camera's perspective or orthographic settings based on the camera type.
3009
- * Finally, it updates the viewpoint's camera settings and updates the viewpoint to the Viewpoints manager.
3182
+ * Adds one or multiple values to the set and triggers the onItemAdded event per each.
3010
3183
  *
3011
- * @throws An error if the world's camera does not have camera controls.
3012
- * @throws An error if the world's renderer is not available.
3184
+ * @param value - The value to add to the set.
3185
+ * @returns - The set instance.
3013
3186
  */
3014
- updateCamera(): void;
3015
- applyVisibility(): void;
3187
+ add(...value: T[]): this;
3016
3188
  /**
3017
- * Applies color to the components in the viewpoint based on their GUIDs.
3018
- *
3019
- * This function iterates through the 'componentColors' map, retrieves the fragment IDs
3020
- * corresponding to each color, and then uses the 'Classifier' to apply the color to those fragments.
3189
+ * A function that acts as a guard for adding items to the set.
3190
+ * It determines whether a given value should be allowed to be added to the set.
3021
3191
  *
3022
- * @remarks
3023
- * The color is applied using the 'Classifier.setColor' method, which sets the color of the specified fragments.
3024
- * The color is provided as a hexadecimal string, prefixed with a '#'.
3025
- */
3026
- applyColors(): void;
3027
- /**
3028
- * Resets the colors of all components in the viewpoint to their original color.
3192
+ * @param value - The value to be checked against the guard.
3193
+ * @returns A boolean indicating whether the value should be allowed to be added to the set.
3194
+ * By default, this function always returns true, allowing all values to be added.
3195
+ * You can override this behavior by providing a custom implementation.
3029
3196
  */
3030
- resetColors(): void;
3031
- private createComponentTags;
3032
- private createColorTags;
3197
+ guard: (value: T) => boolean;
3033
3198
  /**
3034
- * Serializes the viewpoint into a buildingSMART compliant XML string for export.
3035
- *
3036
- * @param version - The version of the BCF Manager to use for serialization.
3037
- * If not provided, the current version of the manager will be used.
3038
- *
3039
- * @returns A Promise that resolves to an XML string representing the viewpoint.
3040
- * The XML string follows the BCF VisualizationInfo schema.
3199
+ * Deletes a value from the set and triggers the onItemDeleted event.
3041
3200
  *
3042
- * @throws An error if the world's camera does not have camera controls.
3043
- * @throws An error if the world's renderer is not available.
3044
- */
3045
- serialize(version?: string): Promise<string>;
3046
- }
3047
- import { ControlsSchema, ControlEntry } from "../../Types";
3048
- import { Components } from "../../Components";
3049
- export declare abstract class Configurator<T, U extends ControlsSchema> {
3050
- protected abstract _config: U;
3051
- protected _component: T;
3052
- name: string;
3053
- uuid: string;
3054
- get controls(): U;
3055
- constructor(component: T, components: Components, name: string, uuid?: string);
3056
- copyEntry(controlEntry: ControlEntry): ControlEntry;
3057
- }
3058
- import * as THREE from "three";
3059
- import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
3060
- import { Components } from "../../Components";
3061
- import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
3062
- /**
3063
- * 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).
3064
- */
3065
- export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
3066
- /** {@link Disposable.onDisposed} */
3067
- readonly onDisposed: Event<unknown>;
3068
- /** {@link Configurable.onSetup} */
3069
- readonly onSetup: Event<unknown>;
3070
- /** {@link Configurable.isSetup} */
3071
- isSetup: boolean;
3072
- /** The world instance to which this Raycaster belongs. */
3073
- world: World;
3074
- /** The components instance to which this grid belongs. */
3075
- components: Components;
3076
- /** {@link Configurable.config} */
3077
- config: SimpleGridConfigManager;
3078
- protected _defaultConfig: SimpleGridConfig;
3079
- /** {@link Hideable.visible} */
3080
- get visible(): boolean;
3081
- /** {@link Hideable.visible} */
3082
- set visible(visible: boolean);
3083
- /** The material of the grid. */
3084
- get material(): THREE.ShaderMaterial;
3085
- /**
3086
- * Whether the grid should fade away with distance. Recommended to be true for
3087
- * perspective cameras and false for orthographic cameras.
3201
+ * @param value - The value to delete from the set.
3202
+ * @returns - True if the value was successfully deleted, false otherwise.
3088
3203
  */
3089
- get fade(): boolean;
3204
+ delete(value: T): boolean;
3090
3205
  /**
3091
- * Whether the grid should fade away with distance. Recommended to be true for
3092
- * perspective cameras and false for orthographic cameras.
3206
+ * Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
3093
3207
  */
3094
- set fade(active: boolean);
3095
- /** The Three.js mesh that contains the infinite grid. */
3096
- readonly three: THREE.Mesh;
3097
- private _fade;
3098
- constructor(components: Components, world: World);
3099
- /** {@link Configurable.setup} */
3100
- setup(config?: Partial<SimpleGridConfig>): void;
3101
- /** {@link Disposable.dispose} */
3102
3208
  dispose(): void;
3103
- private setupEvents;
3104
- private updateZoom;
3105
3209
  }
3106
3210
  import * as THREE from "three";
3107
- import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
3108
- import { Configurator } from "../../ConfigManager";
3109
- import { SimpleGrid } from "./simple-grid";
3110
- type SimpleGridConfigType = {
3111
- visible: BooleanSettingsControl;
3112
- color: ColorSettingsControl;
3113
- primarySize: NumberSettingControl;
3114
- secondarySize: NumberSettingControl;
3115
- distance: NumberSettingControl;
3116
- };
3211
+ import { BaseScene } from "./base-scene";
3212
+ import { BaseCamera } from "./base-camera";
3213
+ import { BaseRenderer } from "./base-renderer";
3214
+ import { Updateable, Disposable } from "./interfaces";
3117
3215
  /**
3118
- * Configuration interface for the {@link SimpleGrid}.
3216
+ * Represents a 3D world with meshes, scene, camera, renderer, and other properties.
3119
3217
  */
3120
- export interface SimpleGridConfig {
3218
+ export interface World extends Disposable, Updateable {
3121
3219
  /**
3122
- * Whether the grid is visible or not.
3220
+ * A set of meshes present in the world. This is taken into account for operations like raycasting.
3123
3221
  */
3124
- visible: boolean;
3222
+ meshes: Set<THREE.Mesh>;
3125
3223
  /**
3126
- * The color of the grid lines.
3224
+ * The base scene of the world.
3127
3225
  */
3128
- color: THREE.Color;
3226
+ scene: BaseScene;
3129
3227
  /**
3130
- * The size of the primary grid lines.
3228
+ * The base camera of the world.
3131
3229
  */
3132
- primarySize: number;
3230
+ camera: BaseCamera;
3133
3231
  /**
3134
- * The size of the secondary grid lines.
3232
+ * The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
3135
3233
  */
3136
- secondarySize: number;
3234
+ renderer: BaseRenderer | null;
3137
3235
  /**
3138
- * The distance at which the grid lines start to fade away.
3236
+ * A unique identifier for the world.
3139
3237
  */
3140
- distance: number;
3238
+ uuid: string;
3239
+ /**
3240
+ * Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
3241
+ */
3242
+ isDisposing: boolean;
3141
3243
  }
3142
- export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
3143
- protected _config: SimpleGridConfigType;
3244
+ import { Event } from "./event";
3245
+ /**
3246
+ * A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations.
3247
+ *
3248
+ * @template K - The type of keys in the map.
3249
+ * @template V - The type of values in the map.
3250
+ */
3251
+ export declare class DataMap<K, V> extends Map<K, V> {
3144
3252
  /**
3145
- * Whether the grid is visible or not.
3253
+ * An event triggered when a new item is set in the map.
3146
3254
  */
3147
- get visible(): boolean;
3255
+ readonly onItemSet: Event<{
3256
+ key: K;
3257
+ value: V;
3258
+ }>;
3148
3259
  /**
3149
- * Whether the grid is visible or not.
3260
+ * An event triggered when an existing item in the map is updated.
3150
3261
  */
3151
- set visible(value: boolean);
3262
+ readonly onItemUpdated: Event<{
3263
+ key: K;
3264
+ value: V;
3265
+ }>;
3152
3266
  /**
3153
- * The color of the grid lines.
3267
+ * An event triggered when an item is deleted from the map.
3154
3268
  */
3155
- get color(): THREE.Color;
3269
+ readonly onItemDeleted: Event<K>;
3156
3270
  /**
3157
- * The color of the grid lines.
3271
+ * An event triggered when the map is cleared.
3158
3272
  */
3159
- set color(value: THREE.Color);
3273
+ readonly onCleared: Event<unknown>;
3160
3274
  /**
3161
- * The size of the primary grid lines.
3275
+ * Constructs a new DataMap instance.
3276
+ *
3277
+ * @param iterable - An iterable object containing key-value pairs to populate the map.
3162
3278
  */
3163
- get primarySize(): number;
3279
+ constructor(iterable?: Iterable<readonly [K, V]> | null | undefined);
3164
3280
  /**
3165
- * The size of the primary grid lines.
3281
+ * Clears the map and triggers the onCleared event.
3166
3282
  */
3167
- set primarySize(value: number);
3283
+ clear(): void;
3168
3284
  /**
3169
- * The size of the secondary grid lines.
3285
+ * Sets the value for the specified key in the map and triggers the appropriate event (onItemSet or onItemUpdated).
3286
+ *
3287
+ * @param key - The key of the item to set.
3288
+ * @param value - The value of the item to set.
3289
+ * @returns The DataMap instance.
3170
3290
  */
3171
- get secondarySize(): number;
3291
+ set(key: K, value: V): this;
3172
3292
  /**
3173
- * The size of the secondary grid lines.
3293
+ * A function that acts as a guard for adding items to the set.
3294
+ * It determines whether a given value should be allowed to be added to the set.
3295
+ *
3296
+ * @param key - The key of the entry to be checked against the guard.
3297
+ * @param value - The value of the entry to be checked against the guard.
3298
+ * @returns A boolean indicating whether the value should be allowed to be added to the set.
3299
+ * By default, this function always returns true, allowing all values to be added.
3300
+ * You can override this behavior by providing a custom implementation.
3174
3301
  */
3175
- set secondarySize(value: number);
3302
+ guard: (key: K, value: V) => boolean;
3176
3303
  /**
3177
- * The distance at which the grid lines start to fade away.
3304
+ * Deletes the specified key from the map and triggers the onItemDeleted event if the key was found.
3305
+ *
3306
+ * @param key - The key of the item to delete.
3307
+ * @returns True if the key was found and deleted; otherwise, false.
3178
3308
  */
3179
- get distance(): number;
3309
+ delete(key: K): boolean;
3180
3310
  /**
3181
- * The distance at which the grid lines start to fade away.
3311
+ * Clears the map and resets the events.
3182
3312
  */
3183
- set distance(value: number);
3313
+ dispose(): void;
3314
+ }
3315
+ import { Component } from "./component";
3316
+ export type ComponentUIElement = {
3317
+ name: string;
3318
+ componentID: string;
3319
+ attributes: {
3320
+ [name: string]: string;
3321
+ };
3322
+ get: () => HTMLElement;
3323
+ };
3324
+ export declare abstract class ComponentWithUI extends Component {
3325
+ abstract name: string;
3326
+ abstract getUI(): ComponentUIElement[];
3327
+ }
3328
+ import * as THREE from "three";
3329
+ export interface BooleanSettingsControl {
3330
+ type: "Boolean";
3331
+ value: boolean;
3332
+ }
3333
+ export interface ColorSettingsControl {
3334
+ type: "Color";
3335
+ value: THREE.Color;
3336
+ }
3337
+ export interface TextSettingsControl {
3338
+ type: "Text";
3339
+ value: string;
3340
+ }
3341
+ export interface NumberSettingControl {
3342
+ type: "Number";
3343
+ interpolable: boolean;
3344
+ min?: number;
3345
+ max?: number;
3346
+ value: number;
3347
+ }
3348
+ export interface SelectSettingControl {
3349
+ type: "Select";
3350
+ multiple: boolean;
3351
+ options: Set<string>;
3352
+ value: string;
3353
+ }
3354
+ export interface Vector3SettingControl {
3355
+ type: "Vector3";
3356
+ value: THREE.Vector3;
3357
+ }
3358
+ export interface TextSetSettingControl {
3359
+ type: "TextSet";
3360
+ value: Set<string>;
3361
+ }
3362
+ export interface NoControl {
3363
+ type: "None";
3364
+ value: any;
3365
+ }
3366
+ export type ControlEntry = BooleanSettingsControl | ColorSettingsControl | TextSettingsControl | NumberSettingControl | SelectSettingControl | Vector3SettingControl | TextSetSettingControl | NoControl;
3367
+ export interface ControlsSchema {
3368
+ [name: string]: ControlEntry | ControlsSchema;
3184
3369
  }
3185
- export {};
3186
3370
  import * as THREE from "three";
3187
3371
  import { Resizeable, Updateable, World, Event, Disposable, Configurable } from "../../Types";
3188
3372
  import { MiniMapConfig, MiniMapConfigManager } from "./mini-map-config";
@@ -3396,29 +3580,216 @@ export declare class MiniMapConfigManager extends Configurator<MiniMap, MiniMapC
3396
3580
  }
3397
3581
  export {};
3398
3582
  import * as THREE from "three";
3399
- import { BaseScene, Configurable, Event } from "../../Types";
3400
3583
  import { Components } from "../../Components";
3401
- import { SimpleSceneConfig, SimpleSceneConfigManager } from "./simple-scene-config";
3584
+ import { AsyncEvent, Configurable, Event, World } from "../../Types";
3585
+ import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
3402
3586
  /**
3403
- * 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.
3587
+ * A base renderer to determine visibility on screen.
3404
3588
  */
3405
- export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
3589
+ export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
3406
3590
  /** {@link Configurable.onSetup} */
3407
3591
  readonly onSetup: Event<unknown>;
3592
+ /** {@link Disposable.onDisposed} */
3593
+ readonly onDisposed: Event<string>;
3594
+ /**
3595
+ * Fires after making the visibility check to the meshes. It lists the
3596
+ * meshes that are currently visible, and the ones that were visible
3597
+ * just before but not anymore.
3598
+ */
3599
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
3600
+ /**
3601
+ * Whether this renderer is active or not. If not, it won't render anything.
3602
+ */
3603
+ enabled: boolean;
3604
+ /**
3605
+ * Needs to check whether there are objects that need to be hidden or shown.
3606
+ * You can bind this to the camera movement, to a certain interval, etc.
3607
+ */
3608
+ needsUpdate: boolean;
3609
+ /** The components instance to which this renderer belongs. */
3610
+ components: Components;
3611
+ /** The render target used to render the visibility scene. */
3612
+ renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
3613
+ /**
3614
+ * The size of the buffer where the result of the visibility check is stored.
3615
+ */
3616
+ bufferSize: number;
3617
+ /**
3618
+ * The buffer when the result of the visibility check is stored.
3619
+ */
3620
+ buffer: Uint8Array;
3621
+ /**
3622
+ * Flag to indicate if the renderer shouldn't update the visibility.
3623
+ */
3624
+ preventUpdate: boolean;
3625
+ /** {@link Configurable.config} */
3626
+ config: CullerRendererConfigManager;
3408
3627
  /** {@link Configurable.isSetup} */
3409
3628
  isSetup: boolean;
3629
+ /** The world instance to which this renderer belongs. */
3630
+ readonly world: World;
3631
+ /** The THREE.js renderer used to make the visibility test. */
3632
+ readonly renderer: THREE.WebGLRenderer;
3633
+ protected _defaultConfig: CullerRendererConfig;
3634
+ protected readonly worker: Worker;
3635
+ protected readonly scene: THREE.Scene;
3636
+ private _availableColor;
3637
+ protected _isWorkerBusy: boolean;
3638
+ constructor(components: Components, world: World);
3639
+ /** {@link Disposable.dispose} */
3640
+ dispose(): void;
3641
+ /**
3642
+ * The function that the culler uses to reprocess the scene. Generally it's
3643
+ * better to call needsUpdate, but you can also call this to force it.
3644
+ * @param force if true, it will refresh the scene even if needsUpdate is
3645
+ * not true.
3646
+ */
3647
+ updateVisibility: (force?: boolean) => Promise<void>;
3648
+ setup(config?: Partial<CullerRendererConfig>): void;
3649
+ protected getAvailableColor(): {
3650
+ r: number;
3651
+ g: number;
3652
+ b: number;
3653
+ code: string;
3654
+ };
3655
+ protected increaseColor(): void;
3656
+ protected decreaseColor(): void;
3657
+ }
3658
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
3659
+ import * as THREE from "three";
3660
+ import { CullerRenderer } from "./culler-renderer";
3661
+ import { Components } from "../../Components";
3662
+ import { Event, World, Disposable } from "../../Types";
3663
+ /**
3664
+ * A renderer to hide/show meshes depending on their visibility from the user's point of view.
3665
+ */
3666
+ export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
3667
+ /**
3668
+ * Event triggered when the visibility of meshes is updated.
3669
+ * Contains two sets: seen and unseen.
3670
+ */
3671
+ readonly onViewUpdated: Event<{
3672
+ seen: Set<THREE.Mesh>;
3673
+ unseen: Set<THREE.Mesh>;
3674
+ }>;
3675
+ /**
3676
+ * Map of color code to THREE.InstancedMesh.
3677
+ * Used to keep track of color-coded meshes.
3678
+ */
3679
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
3680
+ /**
3681
+ * @deprecated use config.threshold instead.
3682
+ */
3683
+ get threshold(): number;
3684
+ /**
3685
+ * @deprecated use config.threshold instead.
3686
+ */
3687
+ set threshold(value: number);
3688
+ private _colorCodeMeshMap;
3689
+ private _meshIDColorCodeMap;
3690
+ private _currentVisibleMeshes;
3691
+ private _recentlyHiddenMeshes;
3692
+ private readonly _transparentMat;
3693
+ constructor(components: Components, world: World);
3694
+ /** {@link Disposable.dispose} */
3695
+ dispose(): void;
3696
+ /**
3697
+ * 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.
3698
+ * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
3699
+ */
3700
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
3701
+ /**
3702
+ * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
3703
+ * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
3704
+ * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
3705
+ */
3706
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
3707
+ /**
3708
+ * 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.
3709
+ *
3710
+ * @param meshes - The meshes to update.
3711
+ *
3712
+ * @returns {void}
3713
+ */
3714
+ updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
3715
+ private handleWorkerMessage;
3716
+ private getAvailableMaterial;
3717
+ }
3718
+ import * as THREE from "three";
3719
+ import { Disposable, Event } from "../../Types";
3720
+ /**
3721
+ * 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.
3722
+ */
3723
+ export declare class Mouse implements Disposable {
3724
+ dom: HTMLCanvasElement;
3725
+ private _event?;
3726
+ private _position;
3727
+ /** {@link Disposable.onDisposed} */
3728
+ readonly onDisposed: Event<unknown>;
3729
+ constructor(dom: HTMLCanvasElement);
3730
+ /**
3731
+ * The real position of the mouse of the Three.js canvas.
3732
+ */
3733
+ get position(): THREE.Vector2;
3734
+ /** {@link Disposable.dispose} */
3735
+ dispose(): void;
3736
+ private getPositionY;
3737
+ private getPositionX;
3738
+ private updateMouseInfo;
3739
+ private getDataObject;
3740
+ private setupEvents;
3741
+ }
3742
+ import * as THREE from "three";
3743
+ import { Components } from "../../Components";
3744
+ import { Event, World, Disposable } from "../../Types";
3745
+ import { Mouse } from "./mouse";
3746
+ /**
3747
+ * 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.
3748
+ */
3749
+ export declare class SimpleRaycaster implements Disposable {
3750
+ /** {@link Component.enabled} */
3751
+ enabled: boolean;
3752
+ /** The components instance to which this Raycaster belongs. */
3753
+ components: Components;
3754
+ /** {@link Disposable.onDisposed} */
3755
+ readonly onDisposed: Event<unknown>;
3756
+ /** The position of the mouse in the screen. */
3757
+ readonly mouse: Mouse;
3758
+ /**
3759
+ * A reference to the Three.js Raycaster instance.
3760
+ * This is used for raycasting operations.
3761
+ */
3762
+ readonly three: THREE.Raycaster;
3410
3763
  /**
3411
- * The underlying Three.js scene object.
3412
- * It is used to define the 3D space containing objects, lights, and cameras.
3764
+ * A reference to the world instance to which this Raycaster belongs.
3765
+ * This is used to access the camera and meshes.
3413
3766
  */
3414
- three: THREE.Scene;
3415
- /** {@link Configurable.config} */
3416
- config: SimpleSceneConfigManager;
3417
- protected _defaultConfig: SimpleSceneConfig;
3418
- constructor(components: Components);
3419
- /** {@link Configurable.setup} */
3420
- setup(config?: Partial<SimpleSceneConfig>): void;
3767
+ world: World;
3768
+ constructor(components: Components, world: World);
3769
+ /** {@link Disposable.dispose} */
3421
3770
  dispose(): void;
3771
+ /**
3772
+ * Throws a ray from the camera to the mouse or touch event point and returns
3773
+ * the first item found. This also takes into account the clipping planes
3774
+ * used by the renderer.
3775
+ *
3776
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
3777
+ * to query. If not provided, it will query all the meshes stored in
3778
+ * {@link Components.meshes}.
3779
+ */
3780
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
3781
+ /**
3782
+ * Casts a ray from a given origin in a given direction and returns the first item found.
3783
+ * This method also takes into account the clipping planes used by the renderer.
3784
+ *
3785
+ * @param origin - The origin of the ray.
3786
+ * @param direction - The direction of the ray.
3787
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3788
+ * @returns The first intersection found or 'null' if no intersection was found.
3789
+ */
3790
+ 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;
3791
+ private intersect;
3792
+ private filterClippingPlanes;
3422
3793
  }
3423
3794
  import * as THREE from "three";
3424
3795
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
@@ -3500,58 +3871,29 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
3500
3871
  dispose(disposeResources?: boolean): void;
3501
3872
  }
3502
3873
  import * as THREE from "three";
3503
- import { BaseRenderer, Event } from "../../Types";
3874
+ import { BaseScene, Configurable, Event } from "../../Types";
3504
3875
  import { Components } from "../../Components";
3876
+ import { SimpleSceneConfig, SimpleSceneConfigManager } from "./simple-scene-config";
3505
3877
  /**
3506
- * A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
3878
+ * 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.
3507
3879
  */
3508
- export declare class SimpleRenderer extends BaseRenderer {
3509
- /**
3510
- * Indicates whether the renderer is enabled. If it's not, it won't be updated.
3511
- * Default is 'true'.
3512
- */
3513
- enabled: boolean;
3514
- /**
3515
- * The HTML container of the THREE.js canvas where the scene is rendered.
3516
- */
3517
- container: HTMLElement;
3518
- /**
3519
- * The THREE.js WebGLRenderer instance.
3520
- */
3521
- three: THREE.WebGLRenderer;
3522
- protected _canvas: HTMLCanvasElement;
3523
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
3524
- protected _resizeObserver: ResizeObserver | null;
3525
- protected onContainerUpdated: Event<unknown>;
3526
- private _resizing;
3880
+ export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
3881
+ /** {@link Configurable.onSetup} */
3882
+ readonly onSetup: Event<unknown>;
3883
+ /** {@link Configurable.isSetup} */
3884
+ isSetup: boolean;
3527
3885
  /**
3528
- * Constructor for the SimpleRenderer class.
3529
- *
3530
- * @param components - The components instance.
3531
- * @param container - The HTML container where the THREE.js canvas will be rendered.
3532
- * @param parameters - Optional parameters for the THREE.js WebGLRenderer.
3886
+ * The underlying Three.js scene object.
3887
+ * It is used to define the 3D space containing objects, lights, and cameras.
3533
3888
  */
3534
- constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
3535
- /** {@link Updateable.update} */
3536
- update(): void;
3537
- /** {@link Disposable.dispose} */
3889
+ three: THREE.Scene;
3890
+ /** {@link Configurable.config} */
3891
+ config: SimpleSceneConfigManager;
3892
+ protected _defaultConfig: SimpleSceneConfig;
3893
+ constructor(components: Components);
3894
+ /** {@link Configurable.setup} */
3895
+ setup(config?: Partial<SimpleSceneConfig>): void;
3538
3896
  dispose(): void;
3539
- /** {@link Resizeable.getSize}. */
3540
- getSize(): THREE.Vector2;
3541
- /** {@link Resizeable.resize} */
3542
- resize: (size?: THREE.Vector2) => void;
3543
- /**
3544
- * Sets up and manages the event listeners for the renderer.
3545
- *
3546
- * @param active - A boolean indicating whether to activate or deactivate the event listeners.
3547
- *
3548
- * @throws Will throw an error if the renderer does not have an HTML container.
3549
- */
3550
- setupEvents(active: boolean): void;
3551
- private resizeEvent;
3552
- private setupRenderer;
3553
- private onContextLost;
3554
- private onContextBack;
3555
3897
  }
3556
3898
  import * as THREE from "three";
3557
3899
  import CameraControls from "camera-controls";
@@ -3609,163 +3951,22 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
3609
3951
  * Updates the aspect of the camera to match the size of the
3610
3952
  * {@link Components.renderer}.
3611
3953
  */
3612
- updateAspect: () => void;
3613
- private setupCamera;
3614
- private newCameraControls;
3615
- private setupEvents;
3616
- private static getSubsetOfThree;
3617
- }
3618
- import * as THREE from "three";
3619
- import { Disposable, Event } from "../../Types";
3620
- /**
3621
- * 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.
3622
- */
3623
- export declare class Mouse implements Disposable {
3624
- dom: HTMLCanvasElement;
3625
- private _event?;
3626
- private _position;
3627
- /** {@link Disposable.onDisposed} */
3628
- readonly onDisposed: Event<unknown>;
3629
- constructor(dom: HTMLCanvasElement);
3630
- /**
3631
- * The real position of the mouse of the Three.js canvas.
3632
- */
3633
- get position(): THREE.Vector2;
3634
- /** {@link Disposable.dispose} */
3635
- dispose(): void;
3636
- private getPositionY;
3637
- private getPositionX;
3638
- private updateMouseInfo;
3639
- private getDataObject;
3640
- private setupEvents;
3641
- }
3642
- import * as THREE from "three";
3643
- import { Components } from "../../Components";
3644
- import { Event, World, Disposable } from "../../Types";
3645
- import { Mouse } from "./mouse";
3646
- /**
3647
- * 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.
3648
- */
3649
- export declare class SimpleRaycaster implements Disposable {
3650
- /** {@link Component.enabled} */
3651
- enabled: boolean;
3652
- /** The components instance to which this Raycaster belongs. */
3653
- components: Components;
3654
- /** {@link Disposable.onDisposed} */
3655
- readonly onDisposed: Event<unknown>;
3656
- /** The position of the mouse in the screen. */
3657
- readonly mouse: Mouse;
3658
- /**
3659
- * A reference to the Three.js Raycaster instance.
3660
- * This is used for raycasting operations.
3661
- */
3662
- readonly three: THREE.Raycaster;
3663
- /**
3664
- * A reference to the world instance to which this Raycaster belongs.
3665
- * This is used to access the camera and meshes.
3666
- */
3667
- world: World;
3668
- constructor(components: Components, world: World);
3669
- /** {@link Disposable.dispose} */
3670
- dispose(): void;
3671
- /**
3672
- * Throws a ray from the camera to the mouse or touch event point and returns
3673
- * the first item found. This also takes into account the clipping planes
3674
- * used by the renderer.
3675
- *
3676
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
3677
- * to query. If not provided, it will query all the meshes stored in
3678
- * {@link Components.meshes}.
3679
- */
3680
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
3681
- /**
3682
- * Casts a ray from a given origin in a given direction and returns the first item found.
3683
- * This method also takes into account the clipping planes used by the renderer.
3684
- *
3685
- * @param origin - The origin of the ray.
3686
- * @param direction - The direction of the ray.
3687
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3688
- * @returns The first intersection found or 'null' if no intersection was found.
3689
- */
3690
- 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;
3691
- private intersect;
3692
- private filterClippingPlanes;
3693
- }
3694
- import * as THREE from "three";
3695
- import { Components } from "../../Components";
3696
- import { AsyncEvent, Configurable, Event, World } from "../../Types";
3697
- import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
3698
- /**
3699
- * A base renderer to determine visibility on screen.
3700
- */
3701
- export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
3702
- /** {@link Configurable.onSetup} */
3703
- readonly onSetup: Event<unknown>;
3704
- /** {@link Disposable.onDisposed} */
3705
- readonly onDisposed: Event<string>;
3706
- /**
3707
- * Fires after making the visibility check to the meshes. It lists the
3708
- * meshes that are currently visible, and the ones that were visible
3709
- * just before but not anymore.
3710
- */
3711
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
3712
- /**
3713
- * Whether this renderer is active or not. If not, it won't render anything.
3714
- */
3715
- enabled: boolean;
3716
- /**
3717
- * Needs to check whether there are objects that need to be hidden or shown.
3718
- * You can bind this to the camera movement, to a certain interval, etc.
3719
- */
3720
- needsUpdate: boolean;
3721
- /** The components instance to which this renderer belongs. */
3722
- components: Components;
3723
- /** The render target used to render the visibility scene. */
3724
- renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
3725
- /**
3726
- * The size of the buffer where the result of the visibility check is stored.
3727
- */
3728
- bufferSize: number;
3729
- /**
3730
- * The buffer when the result of the visibility check is stored.
3731
- */
3732
- buffer: Uint8Array;
3733
- /**
3734
- * Flag to indicate if the renderer shouldn't update the visibility.
3735
- */
3736
- preventUpdate: boolean;
3737
- /** {@link Configurable.config} */
3738
- config: CullerRendererConfigManager;
3739
- /** {@link Configurable.isSetup} */
3740
- isSetup: boolean;
3741
- /** The world instance to which this renderer belongs. */
3742
- readonly world: World;
3743
- /** The THREE.js renderer used to make the visibility test. */
3744
- readonly renderer: THREE.WebGLRenderer;
3745
- protected _defaultConfig: CullerRendererConfig;
3746
- protected readonly worker: Worker;
3747
- protected readonly scene: THREE.Scene;
3748
- private _availableColor;
3749
- protected _isWorkerBusy: boolean;
3750
- constructor(components: Components, world: World);
3751
- /** {@link Disposable.dispose} */
3752
- dispose(): void;
3753
- /**
3754
- * The function that the culler uses to reprocess the scene. Generally it's
3755
- * better to call needsUpdate, but you can also call this to force it.
3756
- * @param force if true, it will refresh the scene even if needsUpdate is
3757
- * not true.
3758
- */
3759
- updateVisibility: (force?: boolean) => Promise<void>;
3760
- setup(config?: Partial<CullerRendererConfig>): void;
3761
- protected getAvailableColor(): {
3762
- r: number;
3763
- g: number;
3764
- b: number;
3765
- code: string;
3766
- };
3767
- protected increaseColor(): void;
3768
- protected decreaseColor(): void;
3954
+ updateAspect: () => void;
3955
+ private setupCamera;
3956
+ private newCameraControls;
3957
+ private setupEvents;
3958
+ private static getSubsetOfThree;
3959
+ }
3960
+ import { ControlsSchema, ControlEntry } from "../../Types";
3961
+ import { Components } from "../../Components";
3962
+ export declare abstract class Configurator<T, U extends ControlsSchema> {
3963
+ protected abstract _config: U;
3964
+ protected _component: T;
3965
+ name: string;
3966
+ uuid: string;
3967
+ get controls(): U;
3968
+ constructor(component: T, components: Components, name: string, uuid?: string);
3969
+ copyEntry(controlEntry: ControlEntry): ControlEntry;
3769
3970
  }
3770
3971
  import * as THREE from "three";
3771
3972
  import { SimpleScene } from "./simple-scene";
@@ -3827,619 +4028,419 @@ export declare class SimpleSceneConfigManager extends Configurator<SimpleScene,
3827
4028
  }
3828
4029
  export {};
3829
4030
  import * as THREE from "three";
3830
- import { CullerRenderer } from "./culler-renderer";
4031
+ import { BaseRenderer, Event } from "../../Types";
3831
4032
  import { Components } from "../../Components";
3832
- import { Event, World, Disposable } from "../../Types";
3833
4033
  /**
3834
- * A renderer to hide/show meshes depending on their visibility from the user's point of view.
4034
+ * A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
3835
4035
  */
3836
- export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
4036
+ export declare class SimpleRenderer extends BaseRenderer {
3837
4037
  /**
3838
- * Event triggered when the visibility of meshes is updated.
3839
- * Contains two sets: seen and unseen.
4038
+ * Indicates whether the renderer is enabled. If it's not, it won't be updated.
4039
+ * Default is 'true'.
3840
4040
  */
3841
- readonly onViewUpdated: Event<{
3842
- seen: Set<THREE.Mesh>;
3843
- unseen: Set<THREE.Mesh>;
3844
- }>;
4041
+ enabled: boolean;
3845
4042
  /**
3846
- * Map of color code to THREE.InstancedMesh.
3847
- * Used to keep track of color-coded meshes.
4043
+ * The HTML container of the THREE.js canvas where the scene is rendered.
3848
4044
  */
3849
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
4045
+ container: HTMLElement;
3850
4046
  /**
3851
- * @deprecated use config.threshold instead.
4047
+ * The THREE.js WebGLRenderer instance.
3852
4048
  */
3853
- get threshold(): number;
4049
+ three: THREE.WebGLRenderer;
4050
+ protected _canvas: HTMLCanvasElement;
4051
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
4052
+ protected _resizeObserver: ResizeObserver | null;
4053
+ protected onContainerUpdated: Event<unknown>;
4054
+ private _resizing;
3854
4055
  /**
3855
- * @deprecated use config.threshold instead.
4056
+ * Constructor for the SimpleRenderer class.
4057
+ *
4058
+ * @param components - The components instance.
4059
+ * @param container - The HTML container where the THREE.js canvas will be rendered.
4060
+ * @param parameters - Optional parameters for the THREE.js WebGLRenderer.
3856
4061
  */
3857
- set threshold(value: number);
3858
- private _colorCodeMeshMap;
3859
- private _meshIDColorCodeMap;
3860
- private _currentVisibleMeshes;
3861
- private _recentlyHiddenMeshes;
3862
- private readonly _transparentMat;
3863
- constructor(components: Components, world: World);
4062
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
4063
+ /** {@link Updateable.update} */
4064
+ update(): void;
3864
4065
  /** {@link Disposable.dispose} */
3865
4066
  dispose(): void;
4067
+ /** {@link Resizeable.getSize}. */
4068
+ getSize(): THREE.Vector2;
4069
+ /** {@link Resizeable.resize} */
4070
+ resize: (size?: THREE.Vector2) => void;
3866
4071
  /**
3867
- * 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.
3868
- * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
3869
- */
3870
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
3871
- /**
3872
- * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
3873
- * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
3874
- * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
3875
- */
3876
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
3877
- /**
3878
- * 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.
4072
+ * Sets up and manages the event listeners for the renderer.
3879
4073
  *
3880
- * @param meshes - The meshes to update.
4074
+ * @param active - A boolean indicating whether to activate or deactivate the event listeners.
3881
4075
  *
3882
- * @returns {void}
3883
- */
3884
- updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
3885
- private handleWorkerMessage;
3886
- private getAvailableMaterial;
3887
- }
3888
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
3889
- /**
3890
- * 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.
3891
- */
3892
- export declare class Event<T> {
3893
- /**
3894
- * Add a callback to this event instance.
3895
- * @param handler - the callback to be added to this event.
3896
- */
3897
- add(handler: T extends void ? {
3898
- (): void;
3899
- } : {
3900
- (data: T): void;
3901
- }): void;
3902
- /**
3903
- * Removes a callback from this event instance.
3904
- * @param handler - the callback to be removed from this event.
3905
- */
3906
- remove(handler: T extends void ? {
3907
- (): void;
3908
- } : {
3909
- (data: T): void;
3910
- }): void;
3911
- /** Triggers all the callbacks assigned to this event. */
3912
- trigger: (data?: T) => void;
3913
- /** Gets rid of all the suscribed events. */
3914
- reset(): void;
3915
- private handlers;
3916
- }
3917
- /**
3918
- * 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.
3919
- */
3920
- export declare class AsyncEvent<T> {
3921
- /**
3922
- * Add a callback to this event instance.
3923
- * @param handler - the callback to be added to this event.
3924
- */
3925
- add(handler: T extends void ? {
3926
- (): Promise<void>;
3927
- } : {
3928
- (data: T): Promise<void>;
3929
- }): void;
3930
- /**
3931
- * Removes a callback from this event instance.
3932
- * @param handler - the callback to be removed from this event.
3933
- */
3934
- remove(handler: T extends void ? {
3935
- (): Promise<void>;
3936
- } : {
3937
- (data: T): Promise<void>;
3938
- }): void;
3939
- /** Triggers all the callbacks assigned to this event. */
3940
- trigger: (data?: T) => Promise<void>;
3941
- /** Gets rid of all the suscribed events. */
3942
- reset(): void;
3943
- private handlers;
3944
- }
3945
- import * as THREE from "three";
3946
- import CameraControls from "camera-controls";
3947
- import { Event } from "./event";
3948
- /**
3949
- * Whether this component has to be manually destroyed once you are done with it to prevent [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). This also ensures that the DOM events created by that component will be cleaned up.
3950
- */
3951
- export interface Disposable {
3952
- /**
3953
- * Destroys the object from memory to prevent a
3954
- * [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
3955
- */
3956
- dispose: () => void | Promise<void>;
3957
- /** Fired after the tool has been disposed. */
3958
- readonly onDisposed: Event<any>;
3959
- }
3960
- /**
3961
- * Whether the geometric representation of this component can be hidden or shown in the [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
3962
- */
3963
- export interface Hideable {
3964
- /**
3965
- * Whether the geometric representation of this component is
3966
- * currently visible or not in the
3967
- * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
3968
- */
3969
- visible: boolean;
3970
- }
3971
- /**
3972
- * Whether this component can be resized. The meaning of this can vary depending on the component: resizing a [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) component could mean changing its resolution, whereas resizing a [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
3973
- */
3974
- export interface Resizeable {
3975
- /**
3976
- * Sets size of this component (e.g. the resolution of a
3977
- * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
3978
- * component.
3979
- */
3980
- resize: (size?: THREE.Vector2) => void;
3981
- /** Event that fires when the component has been resized. */
3982
- onResize: Event<THREE.Vector2>;
3983
- /**
3984
- * Gets the current size of this component (e.g. the resolution of a
3985
- * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
3986
- * component.
3987
- */
3988
- getSize: () => THREE.Vector2;
3989
- }
3990
- /** Whether this component should be updated each frame. */
3991
- export interface Updateable {
3992
- /** Actions that should be executed after updating the component. */
3993
- onAfterUpdate: Event<any>;
3994
- /** Actions that should be executed before updating the component. */
3995
- onBeforeUpdate: Event<any>;
3996
- /**
3997
- * Function used to update the state of this component each frame. For
3998
- * instance, a renderer component will make a render each frame.
3999
- */
4000
- update(delta?: number): void;
4001
- }
4002
- /** Basic type to describe the progress of any kind of process. */
4003
- export interface Progress {
4004
- /** The amount of things that have been done already. */
4005
- current: number;
4006
- /** The total amount of things to be done by the process. */
4007
- total: number;
4008
- }
4009
- /**
4010
- * Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
4011
- */
4012
- export interface Createable {
4013
- /** Creates a new instance of an element (e.g. a new Dimension). */
4014
- create: (data: any) => void;
4015
- /**
4016
- * Finish the creation process of the component, successfully creating an
4017
- * instance of whatever the component creates.
4018
- */
4019
- endCreation?: (data: any) => void;
4020
- /**
4021
- * Cancels the creation process of the component, going back to the state
4022
- * before starting to create.
4076
+ * @throws Will throw an error if the renderer does not have an HTML container.
4023
4077
  */
4024
- cancelCreation?: (data: any) => void;
4025
- /** Deletes an existing instance of an element (e.g. a Dimension). */
4026
- delete: (data: any) => void;
4078
+ setupEvents(active: boolean): void;
4079
+ private resizeEvent;
4080
+ private setupRenderer;
4081
+ private onContextLost;
4082
+ private onContextBack;
4027
4083
  }
4028
- /**
4029
- * Whether this component supports to be configured.
4030
- */
4031
- export interface Configurable<T, U> {
4032
- /** Wether this components has been already configured. */
4033
- isSetup: boolean;
4034
- /** Use the provided configuration to set up the tool. */
4035
- setup: (config?: Partial<U>) => void | Promise<void>;
4036
- /** Fired after successfully calling {@link Configurable.setup()} */
4037
- readonly onSetup: Event<any>;
4038
- /** Object holding the tool configuration. You can edit this directly to change the object.
4039
- */
4040
- config: Required<T>;
4084
+ import { SimplePlane } from "../../Clipper";
4085
+ import { DataSet } from "../../Types";
4086
+ export interface ViewpointCamera {
4087
+ direction: {
4088
+ x: number;
4089
+ y: number;
4090
+ z: number;
4091
+ };
4092
+ position: {
4093
+ x: number;
4094
+ y: number;
4095
+ z: number;
4096
+ };
4097
+ aspectRatio: number;
4041
4098
  }
4042
- /**
4043
- * Whether a camera uses the Camera Controls library.
4044
- */
4045
- export interface CameraControllable {
4046
- /**
4047
- * An instance of CameraControls that provides camera control functionalities.
4048
- * This instance is used to manipulate the camera.
4049
- */
4050
- controls: CameraControls;
4099
+ export interface ViewpointPerspectiveCamera extends ViewpointCamera {
4100
+ fov: number;
4051
4101
  }
4052
- import { Base } from "./base";
4053
- /**
4054
- * Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
4055
- */
4056
- export declare abstract class Component extends Base {
4057
- /**
4058
- * Whether this component is active or not. The behaviour can vary depending
4059
- * on the type of component. E.g. a disabled dimension tool will stop creating
4060
- * dimensions, while a disabled camera will stop moving. A disabled component
4061
- * will not be updated automatically each frame.
4062
- */
4063
- abstract enabled: boolean;
4102
+ export interface ViewpointOrthographicCamera extends ViewpointCamera {
4103
+ viewToWorldScale: number;
4064
4104
  }
4065
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
4066
- import { Components } from "../../Components";
4067
4105
  /**
4068
- * Base class of the library. Useful for finding out the interfaces something implements.
4106
+ * Represents a viewpoint in a BCF file.
4069
4107
  */
4070
- export declare abstract class Base {
4071
- components: Components;
4072
- constructor(components: Components);
4073
- /** Whether is component is {@link Disposable}. */
4074
- isDisposeable: () => this is Disposable;
4075
- /** Whether is component is {@link Resizeable}. */
4076
- isResizeable: () => this is Resizeable;
4077
- /** Whether is component is {@link Updateable}. */
4078
- isUpdateable: () => this is Updateable;
4079
- /** Whether is component is {@link Hideable}. */
4080
- isHideable: () => this is Hideable;
4081
- /** Whether is component is {@link Configurable}. */
4082
- isConfigurable: () => this is Configurable<any, any>;
4108
+ export interface BCFViewpoint {
4109
+ title?: string;
4110
+ guid: string;
4111
+ camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
4112
+ selectionComponents: Iterable<string>;
4113
+ exceptionComponents: Iterable<string>;
4114
+ clippingPlanes: DataSet<SimplePlane>;
4115
+ spacesVisible: boolean;
4116
+ spaceBoundariesVisible: boolean;
4117
+ openingsVisible: boolean;
4118
+ defaultVisibility: boolean;
4083
4119
  }
4084
- import { Base } from "./base";
4085
- import { World } from "./world";
4086
- import { Event } from "./event";
4120
+ import * as THREE from "three";
4121
+ import * as FRAGS from "@thatopen/fragments";
4122
+ import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
4123
+ import { CameraProjection } from "../../OrthoPerspectiveCamera";
4087
4124
  import { Components } from "../../Components";
4125
+ import { DataMap, DataSet, World } from "../../Types";
4126
+ import { SimplePlane } from "../../Clipper";
4088
4127
  /**
4089
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
4128
+ * Represents a BCF compliant viewpoint from BuildingSMART.
4129
+ *
4130
+ * The Viewpoint class provides methods for managing and interacting with viewpoints.
4131
+ * It includes functionality for setting viewpoint properties, updating the camera,
4132
+ * applying color to components, and serializing the viewpoint for export.
4090
4133
  */
4091
- export declare abstract class BaseWorldItem extends Base {
4092
- readonly worlds: Map<string, World>;
4134
+ export declare class Viewpoint implements BCFViewpoint {
4135
+ title?: string;
4136
+ readonly guid: string;
4093
4137
  /**
4094
- * Event that is triggered when a world is added or removed from the 'worlds' map.
4095
- * The event payload contains the world instance and the action ("added" or "removed").
4138
+ * ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
4139
+ * Each clipping plane is defined by Location and Direction.
4140
+ * The Direction vector points in the invisible direction meaning the half-space that is clipped.
4141
+ * @experimental
4096
4142
  */
4097
- readonly onWorldChanged: Event<{
4098
- world: World;
4099
- action: "added" | "removed";
4100
- }>;
4143
+ clippingPlanes: DataSet<SimplePlane>;
4144
+ camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
4101
4145
  /**
4102
- * The current world this item is associated with. It can be null if no world is currently active.
4146
+ * A list of components GUIDs to hide when defaultVisibility = true or to show when defaultVisibility = false
4103
4147
  */
4104
- currentWorld: World | null;
4105
- protected constructor(components: Components);
4106
- }
4107
- import * as THREE from "three";
4108
- import CameraControls from "camera-controls";
4109
- import { BaseWorldItem } from "./base-world-item";
4110
- import { CameraControllable } from "./interfaces";
4111
- /**
4112
- * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
4113
- */
4114
- export declare abstract class BaseCamera extends BaseWorldItem {
4148
+ readonly exceptionComponents: DataSet<string>;
4115
4149
  /**
4116
- * Whether the camera is enabled or not.
4150
+ * A list of components GUIDs that should be selected (highlighted) when displaying a viewpoint.
4117
4151
  */
4118
- abstract enabled: boolean;
4152
+ readonly selectionComponents: DataSet<string>;
4119
4153
  /**
4120
- * The Three.js camera instance.
4154
+ * A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
4155
+ * For this to work, call viewpoint.colorize()
4121
4156
  */
4122
- abstract three: THREE.Camera;
4157
+ readonly componentColors: DataMap<THREE.Color, string[]>;
4123
4158
  /**
4124
- * Optional CameraControls instance for controlling the camera.
4125
- * This property is only available if the camera is controllable.
4159
+ * Boolean flags to allow fine control over the visibility of spaces.
4160
+ * A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
4161
+ * @default false
4126
4162
  */
4127
- abstract controls?: CameraControls;
4163
+ spacesVisible: boolean;
4128
4164
  /**
4129
- * Checks whether the instance is {@link CameraControllable}.
4130
- *
4131
- * @returns True if the instance is controllable, false otherwise.
4165
+ * Boolean flags to allow fine control over the visibility of space boundaries.
4166
+ * A typical use of these flags is when DefaultVisibility=true but space boundaries should remain hidden.
4167
+ * @default false
4132
4168
  */
4133
- hasCameraControls: () => this is CameraControllable;
4134
- }
4135
- import * as THREE from "three";
4136
- import { Disposable } from "./interfaces";
4137
- import { Event } from "./event";
4138
- import { Components } from "../../Components";
4139
- import { BaseWorldItem } from "./base-world-item";
4140
- /**
4141
- * Abstract class representing a base scene in the application. All scenes should use this class as a base.
4142
- */
4143
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
4144
- /** {@link Disposable.onDisposed} */
4145
- readonly onDisposed: Event<unknown>;
4169
+ spaceBoundariesVisible: boolean;
4146
4170
  /**
4147
- * Abstract property representing the three.js object associated with this scene.
4148
- * It should be implemented by subclasses.
4171
+ * Boolean flags to allow fine control over the visibility of openings.
4172
+ * A typical use of these flags is when DefaultVisibility=true but openings should remain hidden.
4173
+ * @default false
4149
4174
  */
4150
- abstract three: THREE.Object3D;
4151
- /** The set of directional lights managed by this scene component. */
4152
- directionalLights: Map<string, THREE.DirectionalLight>;
4153
- /** The set of ambient lights managed by this scene component. */
4154
- ambientLights: Map<string, THREE.AmbientLight>;
4155
- protected constructor(components: Components);
4156
- /** {@link Disposable.dispose} */
4157
- dispose(): void;
4158
- deleteAllLights(): void;
4159
- }
4160
- import * as THREE from "three";
4161
- import { Vector2 } from "three";
4162
- import { Event } from "./event";
4163
- import { BaseWorldItem } from "./base-world-item";
4164
- import { Disposable, Resizeable, Updateable } from "./interfaces";
4165
- /**
4166
- * Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
4167
- */
4168
- export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
4175
+ openingsVisible: boolean;
4169
4176
  /**
4170
- * The three.js WebGLRenderer instance associated with this renderer.
4171
- *
4172
- * @abstract
4173
- * @type {THREE.WebGLRenderer}
4177
+ * When true, all components should be visible unless listed in the exceptions
4178
+ * When false all components should be invisible unless listed in the exceptions
4174
4179
  */
4175
- abstract three: THREE.WebGLRenderer;
4176
- /** {@link Updateable.onBeforeUpdate} */
4177
- onAfterUpdate: Event<unknown>;
4178
- /** {@link Updateable.onAfterUpdate} */
4179
- onBeforeUpdate: Event<unknown>;
4180
- /** {@link Disposable.onDisposed} */
4181
- readonly onDisposed: Event<undefined>;
4182
- /** {@link Resizeable.onResize} */
4183
- readonly onResize: Event<THREE.Vector2>;
4180
+ defaultVisibility: boolean;
4181
+ private get _selectionModelIdMap();
4182
+ private get _exceptionModelIdMap();
4184
4183
  /**
4185
- * Event that fires when there has been a change to the list of clipping
4186
- * planes used by the active renderer.
4184
+ * A list of components that should be selected (highlighted) when displaying a viewpoint.
4185
+ * @returns The fragmentIdMap for components marked as selections.
4187
4186
  */
4188
- readonly onClippingPlanesUpdated: Event<unknown>;
4189
- /** {@link Updateable.update} */
4190
- abstract update(delta?: number): void | Promise<void>;
4191
- /** {@link Disposable.dispose} */
4192
- abstract dispose(): void;
4193
- /** {@link Resizeable.getSize} */
4194
- abstract getSize(): Vector2;
4195
- /** {@link Resizeable.resize} */
4196
- abstract resize(size: Vector2 | undefined): void;
4187
+ get selection(): FRAGS.FragmentIdMap;
4197
4188
  /**
4198
- * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
4189
+ * A list of components to hide when defaultVisibility = true or to show when defaultVisibility = false
4190
+ * @returns The fragmentIdMap for components marked as exceptions.
4199
4191
  */
4200
- clippingPlanes: THREE.Plane[];
4192
+ get exception(): FRAGS.FragmentIdMap;
4201
4193
  /**
4202
- * Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
4194
+ * Retrieves the projection type of the viewpoint's camera.
4203
4195
  *
4204
- * @remarks
4205
- * This method is typically called when there is a change to the list of clipping planes
4206
- * used by the active renderer.
4196
+ * @returns A string representing the projection type of the viewpoint's camera.
4197
+ * It can be either 'Perspective' or 'Orthographic'.
4207
4198
  */
4208
- updateClippingPlanes(): void;
4199
+ get projection(): CameraProjection;
4209
4200
  /**
4210
- * Sets or removes a clipping plane from the renderer.
4211
- *
4212
- * @param active - A boolean indicating whether the clipping plane should be active or not.
4213
- * @param plane - The clipping plane to be added or removed.
4214
- * @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
4201
+ * Retrieves the position vector of the viewpoint's camera.
4215
4202
  *
4216
4203
  * @remarks
4217
- * This method adds or removes a clipping plane from the 'clippingPlanes' array.
4218
- * If 'active' is 'true' and the plane is not already in the array, it is added.
4219
- * If 'active' is 'false' and the plane is in the array, it is removed.
4220
- * The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
4221
- * excluding any planes marked as local.
4204
+ * The position vector represents the camera's position in the world coordinate system.
4205
+ * The function applies the base coordinate system transformation to the position vector.
4206
+ *
4207
+ * @returns A THREE.Vector3 representing the position of the viewpoint's camera.
4222
4208
  */
4223
- setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
4224
- }
4225
- import * as THREE from "three";
4226
- import { BaseScene } from "./base-scene";
4227
- import { BaseCamera } from "./base-camera";
4228
- import { BaseRenderer } from "./base-renderer";
4229
- import { Updateable, Disposable } from "./interfaces";
4230
- /**
4231
- * Represents a 3D world with meshes, scene, camera, renderer, and other properties.
4232
- */
4233
- export interface World extends Disposable, Updateable {
4209
+ get position(): THREE.Vector3;
4234
4210
  /**
4235
- * A set of meshes present in the world. This is taken into account for operations like raycasting.
4211
+ * Retrieves the direction vector of the viewpoint's camera.
4212
+ *
4213
+ * @remarks
4214
+ * The direction vector represents the direction in which the camera is pointing.
4215
+ * It is calculated by extracting the x, y, and z components from the camera's direction property.
4216
+ *
4217
+ * @returns A THREE.Vector3 representing the direction of the viewpoint's camera.
4236
4218
  */
4237
- meshes: Set<THREE.Mesh>;
4219
+ get direction(): THREE.Vector3;
4220
+ private _components;
4238
4221
  /**
4239
- * The base scene of the world.
4222
+ * Represents the world in which the viewpoints are created and managed.
4240
4223
  */
4241
- scene: BaseScene;
4224
+ readonly world: World;
4225
+ private get _managerVersion();
4242
4226
  /**
4243
- * The base camera of the world.
4227
+ * Retrieves the list of BCF topics associated with the current viewpoint.
4228
+ *
4229
+ * @remarks
4230
+ * This function retrieves the BCFTopics manager from the components,
4231
+ * then filters the list of topics to find those associated with the current viewpoint.
4232
+ *
4233
+ * @returns An array of BCF topics associated with the current viewpoint.
4244
4234
  */
4245
- camera: BaseCamera;
4235
+ get topics(): import("../../../openbim/BCFTopics").Topic[];
4236
+ constructor(components: Components, world: World, _config?: {
4237
+ data?: Partial<BCFViewpoint>;
4238
+ setCamera?: boolean;
4239
+ });
4246
4240
  /**
4247
- * The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
4241
+ * Adds components to the viewpoint based on the provided fragment ID map.
4242
+ *
4243
+ * @param fragmentIdMap - A map containing fragment IDs as keys and arrays of express IDs as values.
4248
4244
  */
4249
- renderer: BaseRenderer | null;
4245
+ addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
4250
4246
  /**
4251
- * A unique identifier for the world.
4247
+ * Replace the properties of the viewpoint with the provided data.
4248
+ *
4249
+ * @remarks The guid will be ommited as it shouldn't change after it has been initially set.
4250
+ * @remarks The existing selection and exception components will be fully replaced in case new ones are provided.
4251
+ *
4252
+ * @param data - An object containing the properties to be set.
4253
+ * The properties not included in the object will remain unchanged.
4254
+ *
4255
+ * @returns The viewpoint instance with the updated properties.
4252
4256
  */
4253
- uuid: string;
4257
+ set(data: Partial<BCFViewpoint>): this;
4254
4258
  /**
4255
- * Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
4259
+ * Sets the viewpoint of the camera in the world.
4260
+ *
4261
+ * @remarks
4262
+ * This function calculates the target position based on the viewpoint information.
4263
+ * It sets the visibility of the viewpoint components and then applies the viewpoint using the camera's controls.
4264
+ *
4265
+ * @param transition - Indicates whether the camera movement should have a transition effect.
4266
+ * Default value is 'true'.
4267
+ *
4268
+ * @throws An error if the world's camera does not have camera controls.
4269
+ *
4270
+ * @returns A Promise that resolves when the camera has been set.
4256
4271
  */
4257
- isDisposing: boolean;
4258
- }
4259
- import { Event } from "./event";
4260
- /**
4261
- * A class that extends the built-in Set class and provides additional functionality.
4262
- * It triggers events when items are added, deleted, or the set is cleared.
4263
- *
4264
- * @template T - The type of elements in the set.
4265
- */
4266
- export declare class DataSet<T> extends Set<T> {
4272
+ go(transition?: boolean): Promise<void>;
4267
4273
  /**
4268
- * An event that is triggered when a new item is added to the set.
4274
+ * Updates the camera settings of the viewpoint based on the current world's camera and renderer.
4275
+ *
4276
+ * @remarks
4277
+ * This function retrieves the camera's position, direction, and aspect ratio from the world's camera and renderer.
4278
+ * It then calculates the camera's perspective or orthographic settings based on the camera type.
4279
+ * Finally, it updates the viewpoint's camera settings and updates the viewpoint to the Viewpoints manager.
4280
+ *
4281
+ * @throws An error if the world's camera does not have camera controls.
4282
+ * @throws An error if the world's renderer is not available.
4269
4283
  */
4270
- readonly onItemAdded: Event<T>;
4284
+ updateCamera(): void;
4285
+ applyVisibility(): void;
4271
4286
  /**
4272
- * An event that is triggered when an item is deleted from the set.
4287
+ * Applies color to the components in the viewpoint based on their GUIDs.
4288
+ *
4289
+ * This function iterates through the 'componentColors' map, retrieves the fragment IDs
4290
+ * corresponding to each color, and then uses the 'Classifier' to apply the color to those fragments.
4291
+ *
4292
+ * @remarks
4293
+ * The color is applied using the 'Classifier.setColor' method, which sets the color of the specified fragments.
4294
+ * The color is provided as a hexadecimal string, prefixed with a '#'.
4273
4295
  */
4274
- readonly onItemDeleted: Event<unknown>;
4296
+ applyColors(): void;
4275
4297
  /**
4276
- * An event that is triggered when the set is cleared.
4298
+ * Resets the colors of all components in the viewpoint to their original color.
4277
4299
  */
4278
- readonly onCleared: Event<unknown>;
4300
+ resetColors(): void;
4301
+ private createComponentTags;
4302
+ private createColorTags;
4279
4303
  /**
4280
- * Constructs a new instance of the DataSet class.
4304
+ * Serializes the viewpoint into a buildingSMART compliant XML string for export.
4281
4305
  *
4282
- * @param iterable - An optional iterable object to initialize the set with.
4306
+ * @param version - The version of the BCF Manager to use for serialization.
4307
+ * If not provided, the current version of the manager will be used.
4308
+ *
4309
+ * @returns A Promise that resolves to an XML string representing the viewpoint.
4310
+ * The XML string follows the BCF VisualizationInfo schema.
4311
+ *
4312
+ * @throws An error if the world's camera does not have camera controls.
4313
+ * @throws An error if the world's renderer is not available.
4283
4314
  */
4284
- constructor(iterable?: Iterable<T> | null);
4315
+ serialize(version?: string): Promise<string>;
4316
+ }
4317
+ import * as THREE from "three";
4318
+ import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
4319
+ import { Configurator } from "../../ConfigManager";
4320
+ import { SimpleGrid } from "./simple-grid";
4321
+ type SimpleGridConfigType = {
4322
+ visible: BooleanSettingsControl;
4323
+ color: ColorSettingsControl;
4324
+ primarySize: NumberSettingControl;
4325
+ secondarySize: NumberSettingControl;
4326
+ distance: NumberSettingControl;
4327
+ };
4328
+ /**
4329
+ * Configuration interface for the {@link SimpleGrid}.
4330
+ */
4331
+ export interface SimpleGridConfig {
4285
4332
  /**
4286
- * Clears the set and triggers the onCleared event.
4333
+ * Whether the grid is visible or not.
4287
4334
  */
4288
- clear(): void;
4335
+ visible: boolean;
4289
4336
  /**
4290
- * Adds one or multiple values to the set and triggers the onItemAdded event per each.
4291
- *
4292
- * @param value - The value to add to the set.
4293
- * @returns - The set instance.
4337
+ * The color of the grid lines.
4294
4338
  */
4295
- add(...value: T[]): this;
4339
+ color: THREE.Color;
4296
4340
  /**
4297
- * A function that acts as a guard for adding items to the set.
4298
- * It determines whether a given value should be allowed to be added to the set.
4299
- *
4300
- * @param value - The value to be checked against the guard.
4301
- * @returns A boolean indicating whether the value should be allowed to be added to the set.
4302
- * By default, this function always returns true, allowing all values to be added.
4303
- * You can override this behavior by providing a custom implementation.
4341
+ * The size of the primary grid lines.
4304
4342
  */
4305
- guard: (value: T) => boolean;
4343
+ primarySize: number;
4306
4344
  /**
4307
- * Deletes a value from the set and triggers the onItemDeleted event.
4308
- *
4309
- * @param value - The value to delete from the set.
4310
- * @returns - True if the value was successfully deleted, false otherwise.
4345
+ * The size of the secondary grid lines.
4311
4346
  */
4312
- delete(value: T): boolean;
4347
+ secondarySize: number;
4313
4348
  /**
4314
- * Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
4349
+ * The distance at which the grid lines start to fade away.
4315
4350
  */
4316
- dispose(): void;
4351
+ distance: number;
4317
4352
  }
4318
- import { Event } from "./event";
4319
- /**
4320
- * A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations.
4321
- *
4322
- * @template K - The type of keys in the map.
4323
- * @template V - The type of values in the map.
4324
- */
4325
- export declare class DataMap<K, V> extends Map<K, V> {
4353
+ export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
4354
+ protected _config: SimpleGridConfigType;
4326
4355
  /**
4327
- * An event triggered when a new item is set in the map.
4356
+ * Whether the grid is visible or not.
4328
4357
  */
4329
- readonly onItemSet: Event<{
4330
- key: K;
4331
- value: V;
4332
- }>;
4358
+ get visible(): boolean;
4333
4359
  /**
4334
- * An event triggered when an existing item in the map is updated.
4360
+ * Whether the grid is visible or not.
4335
4361
  */
4336
- readonly onItemUpdated: Event<{
4337
- key: K;
4338
- value: V;
4339
- }>;
4362
+ set visible(value: boolean);
4340
4363
  /**
4341
- * An event triggered when an item is deleted from the map.
4364
+ * The color of the grid lines.
4342
4365
  */
4343
- readonly onItemDeleted: Event<K>;
4366
+ get color(): THREE.Color;
4344
4367
  /**
4345
- * An event triggered when the map is cleared.
4368
+ * The color of the grid lines.
4346
4369
  */
4347
- readonly onCleared: Event<unknown>;
4370
+ set color(value: THREE.Color);
4348
4371
  /**
4349
- * Constructs a new DataMap instance.
4350
- *
4351
- * @param iterable - An iterable object containing key-value pairs to populate the map.
4372
+ * The size of the primary grid lines.
4352
4373
  */
4353
- constructor(iterable?: Iterable<readonly [K, V]> | null | undefined);
4374
+ get primarySize(): number;
4354
4375
  /**
4355
- * Clears the map and triggers the onCleared event.
4376
+ * The size of the primary grid lines.
4356
4377
  */
4357
- clear(): void;
4378
+ set primarySize(value: number);
4358
4379
  /**
4359
- * Sets the value for the specified key in the map and triggers the appropriate event (onItemSet or onItemUpdated).
4360
- *
4361
- * @param key - The key of the item to set.
4362
- * @param value - The value of the item to set.
4363
- * @returns The DataMap instance.
4380
+ * The size of the secondary grid lines.
4364
4381
  */
4365
- set(key: K, value: V): this;
4382
+ get secondarySize(): number;
4366
4383
  /**
4367
- * A function that acts as a guard for adding items to the set.
4368
- * It determines whether a given value should be allowed to be added to the set.
4369
- *
4370
- * @param key - The key of the entry to be checked against the guard.
4371
- * @param value - The value of the entry to be checked against the guard.
4372
- * @returns A boolean indicating whether the value should be allowed to be added to the set.
4373
- * By default, this function always returns true, allowing all values to be added.
4374
- * You can override this behavior by providing a custom implementation.
4384
+ * The size of the secondary grid lines.
4375
4385
  */
4376
- guard: (key: K, value: V) => boolean;
4386
+ set secondarySize(value: number);
4377
4387
  /**
4378
- * Deletes the specified key from the map and triggers the onItemDeleted event if the key was found.
4379
- *
4380
- * @param key - The key of the item to delete.
4381
- * @returns True if the key was found and deleted; otherwise, false.
4388
+ * The distance at which the grid lines start to fade away.
4382
4389
  */
4383
- delete(key: K): boolean;
4390
+ get distance(): number;
4384
4391
  /**
4385
- * Clears the map and resets the events.
4386
- */
4387
- dispose(): void;
4388
- }
4389
- import * as THREE from "three";
4390
- export interface BooleanSettingsControl {
4391
- type: "Boolean";
4392
- value: boolean;
4393
- }
4394
- export interface ColorSettingsControl {
4395
- type: "Color";
4396
- value: THREE.Color;
4397
- }
4398
- export interface TextSettingsControl {
4399
- type: "Text";
4400
- value: string;
4401
- }
4402
- export interface NumberSettingControl {
4403
- type: "Number";
4404
- interpolable: boolean;
4405
- min?: number;
4406
- max?: number;
4407
- value: number;
4408
- }
4409
- export interface SelectSettingControl {
4410
- type: "Select";
4411
- multiple: boolean;
4412
- options: Set<string>;
4413
- value: string;
4414
- }
4415
- export interface Vector3SettingControl {
4416
- type: "Vector3";
4417
- value: THREE.Vector3;
4418
- }
4419
- export interface TextSetSettingControl {
4420
- type: "TextSet";
4421
- value: Set<string>;
4422
- }
4423
- export interface NoControl {
4424
- type: "None";
4425
- value: any;
4426
- }
4427
- export type ControlEntry = BooleanSettingsControl | ColorSettingsControl | TextSettingsControl | NumberSettingControl | SelectSettingControl | Vector3SettingControl | TextSetSettingControl | NoControl;
4428
- export interface ControlsSchema {
4429
- [name: string]: ControlEntry | ControlsSchema;
4392
+ * The distance at which the grid lines start to fade away.
4393
+ */
4394
+ set distance(value: number);
4430
4395
  }
4431
- import { Component } from "./component";
4432
- export type ComponentUIElement = {
4433
- name: string;
4434
- componentID: string;
4435
- attributes: {
4436
- [name: string]: string;
4437
- };
4438
- get: () => HTMLElement;
4439
- };
4440
- export declare abstract class ComponentWithUI extends Component {
4441
- abstract name: string;
4442
- abstract getUI(): ComponentUIElement[];
4396
+ export {};
4397
+ import * as THREE from "three";
4398
+ import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
4399
+ import { Components } from "../../Components";
4400
+ import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
4401
+ /**
4402
+ * 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).
4403
+ */
4404
+ export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
4405
+ /** {@link Disposable.onDisposed} */
4406
+ readonly onDisposed: Event<unknown>;
4407
+ /** {@link Configurable.onSetup} */
4408
+ readonly onSetup: Event<unknown>;
4409
+ /** {@link Configurable.isSetup} */
4410
+ isSetup: boolean;
4411
+ /** The world instance to which this Raycaster belongs. */
4412
+ world: World;
4413
+ /** The components instance to which this grid belongs. */
4414
+ components: Components;
4415
+ /** {@link Configurable.config} */
4416
+ config: SimpleGridConfigManager;
4417
+ protected _defaultConfig: SimpleGridConfig;
4418
+ /** {@link Hideable.visible} */
4419
+ get visible(): boolean;
4420
+ /** {@link Hideable.visible} */
4421
+ set visible(visible: boolean);
4422
+ /** The material of the grid. */
4423
+ get material(): THREE.ShaderMaterial;
4424
+ /**
4425
+ * Whether the grid should fade away with distance. Recommended to be true for
4426
+ * perspective cameras and false for orthographic cameras.
4427
+ */
4428
+ get fade(): boolean;
4429
+ /**
4430
+ * Whether the grid should fade away with distance. Recommended to be true for
4431
+ * perspective cameras and false for orthographic cameras.
4432
+ */
4433
+ set fade(active: boolean);
4434
+ /** The Three.js mesh that contains the infinite grid. */
4435
+ readonly three: THREE.Mesh;
4436
+ private _fade;
4437
+ constructor(components: Components, world: World);
4438
+ /** {@link Configurable.setup} */
4439
+ setup(config?: Partial<SimpleGridConfig>): void;
4440
+ /** {@link Disposable.dispose} */
4441
+ dispose(): void;
4442
+ private setupEvents;
4443
+ private updateZoom;
4443
4444
  }
4444
4445
  import * as THREE from "three";
4445
4446
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -4556,73 +4557,6 @@ export declare class FirstPersonMode implements NavigationMode {
4556
4557
  set(active: boolean): void;
4557
4558
  private setupFirstPersonCamera;
4558
4559
  }
4559
- import * as THREE from "three";
4560
- import { Event, World } from "../../Types";
4561
- import { Components } from "../../Components";
4562
- /**
4563
- * A base renderer to determine visibility on screen.
4564
- */
4565
- export declare class DistanceRenderer {
4566
- /** {@link Disposable.onDisposed} */
4567
- readonly onDisposed: Event<string>;
4568
- /**
4569
- * Fires after making the visibility check to the meshes. It lists the
4570
- * meshes that are currently visible, and the ones that were visible
4571
- * just before but not anymore.
4572
- */
4573
- readonly onDistanceComputed: Event<number>;
4574
- /**
4575
- * Objects that won't be taken into account in the distance check.
4576
- */
4577
- excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
4578
- /**
4579
- * Whether this renderer is active or not. If not, it won't render anything.
4580
- */
4581
- enabled: boolean;
4582
- /**
4583
- * Render the internal scene used to determine the object visibility. Used
4584
- * for debugging purposes.
4585
- */
4586
- renderDebugFrame: boolean;
4587
- /** The components instance to which this renderer belongs. */
4588
- components: Components;
4589
- /**
4590
- * The scene where the distance is computed.
4591
- */
4592
- scene: THREE.Scene;
4593
- /**
4594
- * The camera used to compute the distance.
4595
- */
4596
- camera: THREE.OrthographicCamera;
4597
- /**
4598
- * The material used to compute the distance.
4599
- */
4600
- depthMaterial: THREE.ShaderMaterial;
4601
- /** The world instance to which this renderer belongs. */
4602
- readonly world: World;
4603
- /** The THREE.js renderer used to make the visibility test. */
4604
- readonly renderer: THREE.WebGLRenderer;
4605
- protected readonly worker: Worker;
4606
- private _width;
4607
- private _height;
4608
- private readonly _postQuad;
4609
- private readonly tempRT;
4610
- private readonly resultRT;
4611
- private readonly bufferSize;
4612
- private readonly _buffer;
4613
- protected _isWorkerBusy: boolean;
4614
- constructor(components: Components, world: World);
4615
- /** {@link Disposable.dispose} */
4616
- dispose(): void;
4617
- /**
4618
- * The function that the culler uses to reprocess the scene. Generally it's
4619
- * better to call needsUpdate, but you can also call this to force it.
4620
- * @param force if true, it will refresh the scene even if needsUpdate is
4621
- * not true.
4622
- */
4623
- compute: () => Promise<void>;
4624
- private handleWorkerMessage;
4625
- }
4626
4560
  import { NavigationMode } from "./types";
4627
4561
  import { OrthoPerspectiveCamera } from "../index";
4628
4562
  /**
@@ -4639,26 +4573,6 @@ export declare class OrbitMode implements NavigationMode {
4639
4573
  set(active: boolean): void;
4640
4574
  private activateOrbitControls;
4641
4575
  }
4642
- import { NavigationMode } from "./types";
4643
- import { OrthoPerspectiveCamera } from "../index";
4644
- /**
4645
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
4646
- */
4647
- export declare class PlanMode implements NavigationMode {
4648
- private camera;
4649
- /** {@link NavigationMode.enabled} */
4650
- enabled: boolean;
4651
- /** {@link NavigationMode.id} */
4652
- readonly id = "Plan";
4653
- private mouseAction1?;
4654
- private mouseAction2?;
4655
- private mouseInitialized;
4656
- private readonly defaultAzimuthSpeed;
4657
- private readonly defaultPolarSpeed;
4658
- constructor(camera: OrthoPerspectiveCamera);
4659
- /** {@link NavigationMode.set} */
4660
- set(active: boolean): void;
4661
- }
4662
4576
  import * as THREE from "three";
4663
4577
  import { CameraProjection } from "./types";
4664
4578
  import { Event } from "../../Types";
@@ -4704,6 +4618,26 @@ export declare class ProjectionManager {
4704
4618
  private getDistance;
4705
4619
  private setPerspectiveCamera;
4706
4620
  }
4621
+ import { NavigationMode } from "./types";
4622
+ import { OrthoPerspectiveCamera } from "../index";
4623
+ /**
4624
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
4625
+ */
4626
+ export declare class PlanMode implements NavigationMode {
4627
+ private camera;
4628
+ /** {@link NavigationMode.enabled} */
4629
+ enabled: boolean;
4630
+ /** {@link NavigationMode.id} */
4631
+ readonly id = "Plan";
4632
+ private mouseAction1?;
4633
+ private mouseAction2?;
4634
+ private mouseInitialized;
4635
+ private readonly defaultAzimuthSpeed;
4636
+ private readonly defaultPolarSpeed;
4637
+ constructor(camera: OrthoPerspectiveCamera);
4638
+ /** {@link NavigationMode.set} */
4639
+ set(active: boolean): void;
4640
+ }
4707
4641
  /**
4708
4642
  * The projection system of the camera.
4709
4643
  */
@@ -4730,6 +4664,73 @@ export interface NavigationMode {
4730
4664
  /** Whether this navigation mode is active or not. */
4731
4665
  enabled: boolean;
4732
4666
  }
4667
+ import * as THREE from "three";
4668
+ import { Event, World } from "../../Types";
4669
+ import { Components } from "../../Components";
4670
+ /**
4671
+ * A base renderer to determine visibility on screen.
4672
+ */
4673
+ export declare class DistanceRenderer {
4674
+ /** {@link Disposable.onDisposed} */
4675
+ readonly onDisposed: Event<string>;
4676
+ /**
4677
+ * Fires after making the visibility check to the meshes. It lists the
4678
+ * meshes that are currently visible, and the ones that were visible
4679
+ * just before but not anymore.
4680
+ */
4681
+ readonly onDistanceComputed: Event<number>;
4682
+ /**
4683
+ * Objects that won't be taken into account in the distance check.
4684
+ */
4685
+ excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
4686
+ /**
4687
+ * Whether this renderer is active or not. If not, it won't render anything.
4688
+ */
4689
+ enabled: boolean;
4690
+ /**
4691
+ * Render the internal scene used to determine the object visibility. Used
4692
+ * for debugging purposes.
4693
+ */
4694
+ renderDebugFrame: boolean;
4695
+ /** The components instance to which this renderer belongs. */
4696
+ components: Components;
4697
+ /**
4698
+ * The scene where the distance is computed.
4699
+ */
4700
+ scene: THREE.Scene;
4701
+ /**
4702
+ * The camera used to compute the distance.
4703
+ */
4704
+ camera: THREE.OrthographicCamera;
4705
+ /**
4706
+ * The material used to compute the distance.
4707
+ */
4708
+ depthMaterial: THREE.ShaderMaterial;
4709
+ /** The world instance to which this renderer belongs. */
4710
+ readonly world: World;
4711
+ /** The THREE.js renderer used to make the visibility test. */
4712
+ readonly renderer: THREE.WebGLRenderer;
4713
+ protected readonly worker: Worker;
4714
+ private _width;
4715
+ private _height;
4716
+ private readonly _postQuad;
4717
+ private readonly tempRT;
4718
+ private readonly resultRT;
4719
+ private readonly bufferSize;
4720
+ private readonly _buffer;
4721
+ protected _isWorkerBusy: boolean;
4722
+ constructor(components: Components, world: World);
4723
+ /** {@link Disposable.dispose} */
4724
+ dispose(): void;
4725
+ /**
4726
+ * The function that the culler uses to reprocess the scene. Generally it's
4727
+ * better to call needsUpdate, but you can also call this to force it.
4728
+ * @param force if true, it will refresh the scene even if needsUpdate is
4729
+ * not true.
4730
+ */
4731
+ compute: () => Promise<void>;
4732
+ private handleWorkerMessage;
4733
+ }
4733
4734
  /**
4734
4735
  * A rule for the {@link IfcFinder} to search items based on their category.
4735
4736
  */
@@ -4945,6 +4946,13 @@ export declare class IfcBasicQuery extends IfcFinderQuery {
4945
4946
  update(modelID: string, file: File): Promise<void>;
4946
4947
  protected findInLines(modelID: string, lines: string[]): void;
4947
4948
  }
4949
+ import { IfcRelName } from "./types";
4950
+ type IfcRelAttributePosition = {
4951
+ related: number;
4952
+ relating: number;
4953
+ };
4954
+ export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
4955
+ export {};
4948
4956
  import * as FRAGS from "@thatopen/fragments";
4949
4957
  import { IfcFinderQuery } from "./ifc-finder-query";
4950
4958
  import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types";
@@ -4978,20 +4986,12 @@ export declare class IfcPropertyQuery extends IfcFinderQuery {
4978
4986
  /**
4979
4987
  * {@link IfcFinderQuery.update}
4980
4988
  */
4981
- update(modelID: string, file: File): Promise<void>;
4982
- protected findInLines(modelID: string, lines: string[]): void;
4983
- }
4984
- import { IfcFragmentSettings } from "../../IfcLoader/src";
4985
- /**
4986
- * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
4987
- */
4988
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
4989
- /**
4990
- * Amount of properties to be streamed.
4991
- * Defaults to 100 properties.
4992
- */
4993
- propertiesSize: number;
4989
+ update(modelID: string, file: File): Promise<void>;
4990
+ protected findInLines(modelID: string, lines: string[]): void;
4994
4991
  }
4992
+ import { IfcRelName } from "./types";
4993
+ import { IfcRelation } from "../../IfcRelationsIndexer";
4994
+ export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
4995
4995
  import * as THREE from "three";
4996
4996
  import * as WEBIFC from "web-ifc";
4997
4997
  import * as FRAGS from "@thatopen/fragments";
@@ -5007,60 +5007,43 @@ export declare class CivilReader {
5007
5007
  } | undefined;
5008
5008
  private getCurves;
5009
5009
  }
5010
- import { IfcFragmentSettings } from "../../IfcLoader/src";
5011
- /**
5012
- * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
5013
- */
5014
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
5015
- /**
5016
- * Minimum number of geometries to be streamed.
5017
- * Defaults to 10 geometries.
5018
- */
5019
- minGeometrySize: number;
5020
- /**
5021
- * Minimum amount of assets to be streamed.
5022
- * Defaults to 1000 assets.
5023
- */
5024
- minAssetsSize: number;
5025
- /**
5026
- * Maximum amount of triangles per fragment. Useful for controlling the maximum size of fragment files.
5027
- */
5028
- maxTriangles: number | null;
5029
- }
5010
+ export type IfcRelationNames = [
5011
+ "IfcRelAssignsToControl",
5012
+ "IfcRelAssignsToGroup",
5013
+ "IfcRelAssignsToProduct",
5014
+ "IfcRelAssociatesClassification",
5015
+ "IfcRelAssociatesMaterial",
5016
+ "IfcRelAssociatesDocument",
5017
+ "IfcRelContainedInSpatialStructure",
5018
+ "IfcRelFlowControlElements",
5019
+ "IfcRelConnectsElements",
5020
+ "IfcRelDeclares",
5021
+ "IfcRelAggregates",
5022
+ "IfcRelNests",
5023
+ "IfcRelDefinesByProperties",
5024
+ "IfcRelDefinesByType",
5025
+ "IfcRelDefinesByTemplate"
5026
+ ];
5027
+ export type IfcRelName = IfcRelationNames[number];
5030
5028
  import * as WEBIFC from "web-ifc";
5031
5029
  export declare class IfcMetadataReader {
5032
5030
  getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
5033
5031
  getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
5034
5032
  }
5033
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
5035
5034
  /**
5036
- * 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.
5037
- */
5038
- export interface StreamedGeometries {
5039
- [id: number]: {
5040
- /** The bounding box of the geometry as a Float32Array. */
5041
- boundingBox: Float32Array;
5042
- /** A boolean indicating whether the geometry has holes. */
5043
- hasHoles: boolean;
5044
- /** An optional file path for the geometry data. */
5045
- geometryFile?: string;
5046
- };
5047
- }
5048
- /**
5049
- * 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.
5035
+ * Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
5050
5036
  */
5051
- export interface StreamedAsset {
5052
- /** The unique identifier of the asset. */
5053
- id: number;
5054
- /** An array of geometries associated with the asset. */
5055
- geometries: {
5056
- /** The unique identifier of the geometry. */
5057
- geometryID: number;
5058
- /** The transformation matrix of the geometry as a number array. */
5059
- transformation: number[];
5060
- /** The color of the geometry as a number array. */
5061
- color: number[];
5062
- }[];
5037
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
5038
+ /**
5039
+ * Amount of properties to be streamed.
5040
+ * Defaults to 100 properties.
5041
+ */
5042
+ propertiesSize: number;
5063
5043
  }
5044
+ import { Components } from "../../../../core/Components";
5045
+ import { IDSFacet } from "../facets";
5046
+ export declare const createEntityFacets: (components: Components, elements: any) => IDSFacet[];
5064
5047
  import * as WEBIFC from "web-ifc";
5065
5048
  import * as THREE from "three";
5066
5049
  export declare class Units {
@@ -5071,6 +5054,12 @@ export declare class Units {
5071
5054
  private getLengthUnits;
5072
5055
  private getScaleMatrix;
5073
5056
  }
5057
+ import { Components } from "../../../../core/Components";
5058
+ import { IDSFacet } from "../facets";
5059
+ export declare const createAttributeFacets: (components: Components, elements: any) => IDSFacet[];
5060
+ import { Components } from "../../../../core/Components";
5061
+ import { IDSFacet } from "../facets";
5062
+ export declare const createClassificationFacets: (components: Components, elements: any) => IDSFacet[];
5074
5063
  export type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2";
5075
5064
  export type IDSFacetParameterName = "Name" | "PredefinedType" | "Value" | "System" | "URI" | "PropertySet" | "BaseName" | "DataType" | "Value" | "Entity" | "Relation";
5076
5065
  export type IDSSimpleCardinality = "required" | "prohibited";
@@ -5110,188 +5099,56 @@ export interface IDSCheckResult {
5110
5099
  expressID: number;
5111
5100
  pass: boolean;
5112
5101
  checks: IDSCheck[];
5113
- cardinality: IDSConditionalCardinaltiy;
5114
- }
5115
- export interface IDSInfo {
5116
- title: string;
5117
- description?: string;
5118
- copyright?: string;
5119
- version?: string;
5120
- author?: string;
5121
- date?: Date;
5122
- purpose?: string;
5123
- milestone?: string;
5124
- }
5125
- import { Components } from "../../../../core/Components";
5126
- import { IDSFacet } from "../facets";
5127
- export declare const createEntityFacets: (components: Components, elements: any) => IDSFacet[];
5128
- import * as FRAGS from "@thatopen/fragments";
5129
- import { Components } from "../../../core/Components";
5130
- import { DataSet } from "../../../core/Types";
5131
- import { IDSCheckResult, IfcVersion } from "./types";
5132
- import { IDSFacet } from "./facets";
5133
- /**
5134
- * Represents a single specification from the Information Delivery Specification (IDS) standard.
5135
- *
5136
- * @remarks This class provides methods for testing a model against the specification,
5137
- * as well as serializing the specification into XML format.
5138
- */
5139
- export declare class IDSSpecification {
5140
- name: string;
5141
- ifcVersion: Set<IfcVersion>;
5142
- identifier: string;
5143
- description?: string;
5144
- instructions?: string;
5145
- requirementsDescription?: string;
5146
- applicability: DataSet<IDSFacet>;
5147
- requirements: DataSet<IDSFacet>;
5148
- protected components: Components;
5149
- constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
5150
- /**
5151
- * Tests the model to test against the specification's requirements.
5152
- *
5153
- * @param model - The model to be tested.
5154
- * @returns An array representing the test results.
5155
- * If no requirements are defined for the specification, an empty array is returned.
5156
- */
5157
- test(model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5158
- /**
5159
- * Serializes the IDSSpecification instance into XML format.
5160
- *
5161
- * @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
5162
- *
5163
- * @returns The XML representation of the IDSSpecification.
5164
- */
5165
- serialize(): string;
5166
- }
5167
- import { IDSFacetParameter } from "../types";
5168
- export declare const getParameterValue: (property: any) => IDSFacetParameter | undefined;
5169
- import { Components } from "../../../../core/Components";
5170
- import { IDSFacet } from "../facets";
5171
- export declare const createClassificationFacets: (components: Components, elements: any) => IDSFacet[];
5172
- import { Components } from "../../../../core/Components";
5173
- import { IDSFacet } from "../facets";
5174
- export declare const createAttributeFacets: (components: Components, elements: any) => IDSFacet[];
5175
- import * as WEBIFC from "web-ifc";
5176
- export type RelationsMap = Map<number, Map<number, number[]>>;
5177
- export interface ModelsRelationMap {
5178
- [modelID: string]: RelationsMap;
5179
- }
5180
- /**
5181
- * Type alias for an array of inverse attribute names.
5182
- */
5183
- export type InverseAttributes = [
5184
- "IsDecomposedBy",
5185
- "Decomposes",
5186
- "AssociatedTo",
5187
- "HasAssociations",
5188
- "ClassificationForObjects",
5189
- "IsGroupedBy",
5190
- "HasAssignments",
5191
- "IsDefinedBy",
5192
- "DefinesOcurrence",
5193
- "IsTypedBy",
5194
- "Types",
5195
- "Defines",
5196
- "ContainedInStructure",
5197
- "ContainsElements",
5198
- "HasControlElements",
5199
- "AssignedToFlowElement",
5200
- "ConnectedTo",
5201
- "ConnectedFrom",
5202
- "ReferencedBy",
5203
- "Declares",
5204
- "HasContext",
5205
- "Controls",
5206
- "IsNestedBy",
5207
- "Nests",
5208
- "DocumentRefForObjects"
5209
- ];
5210
- export type InverseAttribute = InverseAttributes[number];
5211
- /**
5212
- * Type alias for an array of IfcRelation types from WebIfc.
5213
- */
5214
- export type IfcRelations = [
5215
- typeof WEBIFC.IFCRELAGGREGATES,
5216
- typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
5217
- typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
5218
- typeof WEBIFC.IFCRELASSIGNSTOGROUP,
5219
- typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
5220
- typeof WEBIFC.IFCRELDEFINESBYTYPE,
5221
- typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
5222
- typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
5223
- typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
5224
- typeof WEBIFC.IFCRELCONNECTSELEMENTS,
5225
- typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
5226
- typeof WEBIFC.IFCRELDECLARES,
5227
- typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
5228
- typeof WEBIFC.IFCRELNESTS,
5229
- typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
5230
- ];
5231
- export type IfcRelation = IfcRelations[number];
5232
- export interface RelationsProcessingConfig {
5233
- relationsToProcess: IfcRelation[];
5234
- }
5235
- /**
5236
- * Interface definition of an Entities Related Event from the IfcRelationsIndexer.
5237
- * This event gets triggered when two or more entities has been related with each other.
5238
- */
5239
- export interface EntitiesRelatedEvent {
5240
- /** The type of the IFC relation. */
5241
- relType: IfcRelation;
5242
- /** The inverse attribute of the relation. */
5243
- invAttribute: InverseAttribute;
5244
- /** The IDs of the entities that are relating. */
5245
- relatingIDs: number[];
5246
- /** The IDs of the entities that are being related. */
5247
- relatedIDs: number[];
5248
- }
5249
- import { IfcRelName } from "./types";
5250
- type IfcRelAttributePosition = {
5251
- related: number;
5252
- relating: number;
5253
- };
5254
- export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
5255
- export {};
5256
- import { IfcRelName } from "./types";
5257
- import { IfcRelation } from "../../IfcRelationsIndexer";
5258
- export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
5259
- export type IfcRelationNames = [
5260
- "IfcRelAssignsToControl",
5261
- "IfcRelAssignsToGroup",
5262
- "IfcRelAssignsToProduct",
5263
- "IfcRelAssociatesClassification",
5264
- "IfcRelAssociatesMaterial",
5265
- "IfcRelAssociatesDocument",
5266
- "IfcRelContainedInSpatialStructure",
5267
- "IfcRelFlowControlElements",
5268
- "IfcRelConnectsElements",
5269
- "IfcRelDeclares",
5270
- "IfcRelAggregates",
5271
- "IfcRelNests",
5272
- "IfcRelDefinesByProperties",
5273
- "IfcRelDefinesByType",
5274
- "IfcRelDefinesByTemplate"
5275
- ];
5276
- export type IfcRelName = IfcRelationNames[number];
5277
- export type BCFVersion = "2.1" | "3";
5278
- export interface BCFTopic {
5279
- guid: string;
5280
- serverAssignedId?: string;
5281
- type: string;
5282
- status: string;
5102
+ cardinality: IDSConditionalCardinaltiy;
5103
+ }
5104
+ export interface IDSInfo {
5283
5105
  title: string;
5284
- priority?: string;
5285
- index?: number;
5286
- labels: Set<string>;
5287
- creationDate: Date;
5288
- creationAuthor: string;
5289
- modifiedDate?: Date;
5290
- modifiedAuthor?: string;
5291
- dueDate?: Date;
5292
- assignedTo?: string;
5293
5106
  description?: string;
5294
- stage?: string;
5107
+ copyright?: string;
5108
+ version?: string;
5109
+ author?: string;
5110
+ date?: Date;
5111
+ purpose?: string;
5112
+ milestone?: string;
5113
+ }
5114
+ import * as FRAGS from "@thatopen/fragments";
5115
+ import { Components } from "../../../core/Components";
5116
+ import { DataSet } from "../../../core/Types";
5117
+ import { IDSCheckResult, IfcVersion } from "./types";
5118
+ import { IDSFacet } from "./facets";
5119
+ /**
5120
+ * Represents a single specification from the Information Delivery Specification (IDS) standard.
5121
+ *
5122
+ * @remarks This class provides methods for testing a model against the specification,
5123
+ * as well as serializing the specification into XML format.
5124
+ */
5125
+ export declare class IDSSpecification {
5126
+ name: string;
5127
+ ifcVersion: Set<IfcVersion>;
5128
+ identifier: string;
5129
+ description?: string;
5130
+ instructions?: string;
5131
+ requirementsDescription?: string;
5132
+ applicability: DataSet<IDSFacet>;
5133
+ requirements: DataSet<IDSFacet>;
5134
+ protected components: Components;
5135
+ constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
5136
+ /**
5137
+ * Tests the model to test against the specification's requirements.
5138
+ *
5139
+ * @param model - The model to be tested.
5140
+ * @returns An array representing the test results.
5141
+ * If no requirements are defined for the specification, an empty array is returned.
5142
+ */
5143
+ test(model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5144
+ /**
5145
+ * Serializes the IDSSpecification instance into XML format.
5146
+ *
5147
+ * @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
5148
+ *
5149
+ * @returns The XML representation of the IDSSpecification.
5150
+ */
5151
+ serialize(): string;
5295
5152
  }
5296
5153
  import { Components } from "../../../core/Components";
5297
5154
  import { Viewpoint } from "../../../core/Viewpoints";
@@ -5416,6 +5273,25 @@ export declare class Topic implements BCFTopic {
5416
5273
  */
5417
5274
  serialize(): string;
5418
5275
  }
5276
+ export type BCFVersion = "2.1" | "3";
5277
+ export interface BCFTopic {
5278
+ guid: string;
5279
+ serverAssignedId?: string;
5280
+ type: string;
5281
+ status: string;
5282
+ title: string;
5283
+ priority?: string;
5284
+ index?: number;
5285
+ labels: Set<string>;
5286
+ creationDate: Date;
5287
+ creationAuthor: string;
5288
+ modifiedDate?: Date;
5289
+ modifiedAuthor?: string;
5290
+ dueDate?: Date;
5291
+ assignedTo?: string;
5292
+ description?: string;
5293
+ stage?: string;
5294
+ }
5419
5295
  import { Topic } from "..";
5420
5296
  import { Viewpoint } from "../../../core/Viewpoints";
5421
5297
  import { Components } from "../../../core/Components";
@@ -5578,6 +5454,82 @@ export declare class BCFTopicsConfigManager extends Configurator<BCFTopics, BCFT
5578
5454
  set ignoreIncompleteTopicsOnImport(value: boolean);
5579
5455
  }
5580
5456
  export {};
5457
+ import { IDSFacetParameter } from "../types";
5458
+ export declare const getParameterValue: (property: any) => IDSFacetParameter | undefined;
5459
+ import * as WEBIFC from "web-ifc";
5460
+ export type RelationsMap = Map<number, Map<number, number[]>>;
5461
+ export interface ModelsRelationMap {
5462
+ [modelID: string]: RelationsMap;
5463
+ }
5464
+ /**
5465
+ * Type alias for an array of inverse attribute names.
5466
+ */
5467
+ export type InverseAttributes = [
5468
+ "IsDecomposedBy",
5469
+ "Decomposes",
5470
+ "AssociatedTo",
5471
+ "HasAssociations",
5472
+ "ClassificationForObjects",
5473
+ "IsGroupedBy",
5474
+ "HasAssignments",
5475
+ "IsDefinedBy",
5476
+ "DefinesOcurrence",
5477
+ "IsTypedBy",
5478
+ "Types",
5479
+ "Defines",
5480
+ "ContainedInStructure",
5481
+ "ContainsElements",
5482
+ "HasControlElements",
5483
+ "AssignedToFlowElement",
5484
+ "ConnectedTo",
5485
+ "ConnectedFrom",
5486
+ "ReferencedBy",
5487
+ "Declares",
5488
+ "HasContext",
5489
+ "Controls",
5490
+ "IsNestedBy",
5491
+ "Nests",
5492
+ "DocumentRefForObjects"
5493
+ ];
5494
+ export type InverseAttribute = InverseAttributes[number];
5495
+ /**
5496
+ * Type alias for an array of IfcRelation types from WebIfc.
5497
+ */
5498
+ export type IfcRelations = [
5499
+ typeof WEBIFC.IFCRELAGGREGATES,
5500
+ typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
5501
+ typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
5502
+ typeof WEBIFC.IFCRELASSIGNSTOGROUP,
5503
+ typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
5504
+ typeof WEBIFC.IFCRELDEFINESBYTYPE,
5505
+ typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
5506
+ typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
5507
+ typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
5508
+ typeof WEBIFC.IFCRELCONNECTSELEMENTS,
5509
+ typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
5510
+ typeof WEBIFC.IFCRELDECLARES,
5511
+ typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
5512
+ typeof WEBIFC.IFCRELNESTS,
5513
+ typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
5514
+ ];
5515
+ export type IfcRelation = IfcRelations[number];
5516
+ export interface RelationsProcessingConfig {
5517
+ relationsToProcess: IfcRelation[];
5518
+ }
5519
+ /**
5520
+ * Interface definition of an Entities Related Event from the IfcRelationsIndexer.
5521
+ * This event gets triggered when two or more entities has been related with each other.
5522
+ */
5523
+ export interface EntitiesRelatedEvent {
5524
+ /** The type of the IFC relation. */
5525
+ relType: IfcRelation;
5526
+ /** The inverse attribute of the relation. */
5527
+ invAttribute: InverseAttribute;
5528
+ /** The IDs of the entities that are relating. */
5529
+ relatingIDs: number[];
5530
+ /** The IDs of the entities that are being related. */
5531
+ relatedIDs: number[];
5532
+ }
5581
5533
  import { BooleanSettingsControl, NumberSettingControl } from "../../Types";
5582
5534
  import { Configurator } from "../../ConfigManager";
5583
5535
  import { CullerRenderer } from "../index";
@@ -5652,6 +5604,55 @@ export declare class CullerRendererConfigManager extends Configurator<CullerRend
5652
5604
  private resetInterval;
5653
5605
  }
5654
5606
  export {};
5607
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
5608
+ /**
5609
+ * Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
5610
+ */
5611
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
5612
+ /**
5613
+ * Minimum number of geometries to be streamed.
5614
+ * Defaults to 10 geometries.
5615
+ */
5616
+ minGeometrySize: number;
5617
+ /**
5618
+ * Minimum amount of assets to be streamed.
5619
+ * Defaults to 1000 assets.
5620
+ */
5621
+ minAssetsSize: number;
5622
+ /**
5623
+ * Maximum amount of triangles per fragment. Useful for controlling the maximum size of fragment files.
5624
+ */
5625
+ maxTriangles: number | null;
5626
+ }
5627
+ /**
5628
+ * 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.
5629
+ */
5630
+ export interface StreamedGeometries {
5631
+ [id: number]: {
5632
+ /** The bounding box of the geometry as a Float32Array. */
5633
+ boundingBox: Float32Array;
5634
+ /** A boolean indicating whether the geometry has holes. */
5635
+ hasHoles: boolean;
5636
+ /** An optional file path for the geometry data. */
5637
+ geometryFile?: string;
5638
+ };
5639
+ }
5640
+ /**
5641
+ * 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.
5642
+ */
5643
+ export interface StreamedAsset {
5644
+ /** The unique identifier of the asset. */
5645
+ id: number;
5646
+ /** An array of geometries associated with the asset. */
5647
+ geometries: {
5648
+ /** The unique identifier of the geometry. */
5649
+ geometryID: number;
5650
+ /** The transformation matrix of the geometry as a number array. */
5651
+ transformation: number[];
5652
+ /** The color of the geometry as a number array. */
5653
+ color: number[];
5654
+ }[];
5655
+ }
5655
5656
  import * as FRAGS from "@thatopen/fragments";
5656
5657
  import { IDSCheckResult, IDSFacetParameter } from "../types";
5657
5658
  import { Components } from "../../../../core/Components";
@@ -5666,31 +5667,6 @@ export declare class IDSAttribute extends IDSFacet {
5666
5667
  }
5667
5668
  import * as FRAGS from "@thatopen/fragments";
5668
5669
  import { Components } from "../../../../core/Components";
5669
- import { IDSFacetParameter, IDSCheckResult, IDSFacetParameterName, IDSCheck, IDSConditionalCardinaltiy, IDSSimpleCardinality } from "../types";
5670
- export declare abstract class IDSFacet {
5671
- protected components: Components;
5672
- cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
5673
- instructions?: string;
5674
- constructor(components: Components);
5675
- protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
5676
- protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
5677
- protected testResult: IDSCheckResult[];
5678
- protected saveResult(attrs: any, pass: boolean): void;
5679
- /**
5680
- * Returns the list of expressIDs that pass the criteria of this facet.
5681
- * @param model - The IFC model to retrieve entities from.
5682
- * @param collector - An optional object to collect the retrieved entities.
5683
- * @remarks
5684
- * If the collector already includes the entity, it won't get processed any further.
5685
- *
5686
- * @returns An array of express IDs of the retrieved entities.
5687
- */
5688
- abstract getEntities(model: FRAGS.FragmentsGroup, collector: FRAGS.IfcProperties): Promise<number[]>;
5689
- abstract test(entities: FRAGS.IfcProperties, model?: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5690
- abstract serialize(type: "applicability" | "requirement"): string;
5691
- }
5692
- import * as FRAGS from "@thatopen/fragments";
5693
- import { Components } from "../../../../core/Components";
5694
5670
  import { IDSCheckResult, IDSFacetParameter } from "../types";
5695
5671
  import { IDSFacet } from "./Facet";
5696
5672
  export declare class IDSClassification extends IDSFacet {
@@ -5747,6 +5723,31 @@ export declare class IDSProperty extends IDSFacet {
5747
5723
  private evalDataType;
5748
5724
  private evalURI;
5749
5725
  }
5726
+ import * as FRAGS from "@thatopen/fragments";
5727
+ import { Components } from "../../../../core/Components";
5728
+ import { IDSFacetParameter, IDSCheckResult, IDSFacetParameterName, IDSCheck, IDSConditionalCardinaltiy, IDSSimpleCardinality } from "../types";
5729
+ export declare abstract class IDSFacet {
5730
+ protected components: Components;
5731
+ cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
5732
+ instructions?: string;
5733
+ constructor(components: Components);
5734
+ protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
5735
+ protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
5736
+ protected testResult: IDSCheckResult[];
5737
+ protected saveResult(attrs: any, pass: boolean): void;
5738
+ /**
5739
+ * Returns the list of expressIDs that pass the criteria of this facet.
5740
+ * @param model - The IFC model to retrieve entities from.
5741
+ * @param collector - An optional object to collect the retrieved entities.
5742
+ * @remarks
5743
+ * If the collector already includes the entity, it won't get processed any further.
5744
+ *
5745
+ * @returns An array of express IDs of the retrieved entities.
5746
+ */
5747
+ abstract getEntities(model: FRAGS.FragmentsGroup, collector: FRAGS.IfcProperties): Promise<number[]>;
5748
+ abstract test(entities: FRAGS.IfcProperties, model?: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
5749
+ abstract serialize(type: "applicability" | "requirement"): string;
5750
+ }
5750
5751
  import { BCFTopics } from "../..";
5751
5752
  export declare const extensionsImporter: (manager: BCFTopics, extensionsXML: string) => void;
5752
5753
  import { BufferGeometry } from "three";
@@ -5805,6 +5806,8 @@ interface V2Schema {
5805
5806
  type RelationsMap = Map<number, Map<number, {
5806
5807
  [ifcRel: number]: number[];
5807
5808
  }>>;
5809
+ import { IDSFacetParameterName, IDSFacetParameter } from "../types";
5810
+ export declare const getParameterXML: (name: IDSFacetParameterName, parameter?: IDSFacetParameter) => string;
5808
5811
  import { IDSFacetParameter } from "../types";
5809
5812
  import { IDSFacet } from "./Facet";
5810
5813
  export declare class IdsMaterialFacet extends IDSFacet {
@@ -5839,7 +5842,5 @@ export declare class IDSPartOf extends IDSFacet {
5839
5842
  getEntities(model: FRAGS.FragmentsGroup, collector?: FRAGS.IfcProperties): Promise<number[]>;
5840
5843
  test(entities: FRAGS.IfcProperties, model: FRAGS.FragmentsGroup): Promise<import("../types").IDSCheckResult[]>;
5841
5844
  }
5842
- import { IDSFacetParameterName, IDSFacetParameter } from "../types";
5843
- export declare const getParameterXML: (name: IDSFacetParameterName, parameter?: IDSFacetParameter) => string;
5844
5845
 
5845
5846
  }