@thatopen/components 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,4 @@
1
1
  declare namespace OBC {
2
- import * as THREE from "three";
3
- import { Components } from "../Components";
4
- import { Component } from "../Types";
5
- /**
6
- * A tool to safely remove meshes and geometries from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
7
- */
8
- export declare class Disposer extends Component {
9
- private _disposedComponents;
10
- /** {@link Component.enabled} */
11
- enabled: boolean;
12
- /**
13
- * A unique identifier for the component.
14
- * This UUID is used to register the component within the Components system.
15
- */
16
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
17
- constructor(components: Components);
18
- /**
19
- * Return the UUIDs of all disposed components.
20
- */
21
- get(): Set<string>;
22
- /**
23
- * Removes a mesh, its geometry and its materials from memory. If you are
24
- * using any of these in other parts of the application, make sure that you
25
- * remove them from the mesh before disposing it.
26
- *
27
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
28
- * to remove.
29
- *
30
- * @param materials - whether to dispose the materials of the mesh.
31
- *
32
- * @param recursive - whether to recursively dispose the children of the mesh.
33
- */
34
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
35
- /**
36
- * Disposes a geometry from memory.
37
- *
38
- * @param geometry - the
39
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
40
- * to remove.
41
- */
42
- disposeGeometry(geometry: THREE.BufferGeometry): void;
43
- private disposeGeometryAndMaterials;
44
- private disposeChildren;
45
- private static disposeMaterial;
46
- }
47
2
  import { Component, Disposable, Event } from "../Types";
48
3
  /**
49
4
  * The entry point of the Components library. It can create and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
@@ -52,7 +7,7 @@ export declare class Components implements Disposable {
52
7
  /**
53
8
  * The version of the @thatopen/components library.
54
9
  */
55
- static readonly release = "2.0.8";
10
+ static readonly release = "2.0.11";
56
11
  /** {@link Disposable.onDisposed} */
57
12
  readonly onDisposed: Event<void>;
58
13
  /**
@@ -67,30 +22,30 @@ export declare class Components implements Disposable {
67
22
  enabled: boolean;
68
23
  private _clock;
69
24
  /**
70
- * Adds a component to the list of components.
71
- * Throws an error if a component with the same UUID already exists.
72
- *
73
- * @param uuid - The unique identifier of the component.
74
- * @param instance - The instance of the component to be added.
75
- *
76
- * @throws Will throw an error if a component with the same UUID already exists.
77
- *
78
- * @internal
79
- */
25
+ * Adds a component to the list of components.
26
+ * Throws an error if a component with the same UUID already exists.
27
+ *
28
+ * @param uuid - The unique identifier of the component.
29
+ * @param instance - The instance of the component to be added.
30
+ *
31
+ * @throws Will throw an error if a component with the same UUID already exists.
32
+ *
33
+ * @internal
34
+ */
80
35
  add(uuid: string, instance: Component): void;
81
36
  /**
82
- * Retrieves a component instance by its constructor function.
83
- * If the component does not exist in the list, it will be created and added.
84
- *
85
- * @template U - The type of the component to retrieve.
86
- * @param Component - The constructor function of the component to retrieve.
87
- *
88
- * @returns The instance of the requested component.
89
- *
90
- * @throws Will throw an error if a component with the same UUID already exists.
91
- *
92
- * @internal
93
- */
37
+ * Retrieves a component instance by its constructor function.
38
+ * If the component does not exist in the list, it will be created and added.
39
+ *
40
+ * @template U - The type of the component to retrieve.
41
+ * @param Component - The constructor function of the component to retrieve.
42
+ *
43
+ * @returns The instance of the requested component.
44
+ *
45
+ * @throws Will throw an error if a component with the same UUID already exists.
46
+ *
47
+ * @internal
48
+ */
94
49
  get<U extends Component>(Component: new (components: Components) => U): U;
95
50
  constructor();
96
51
  /**
@@ -120,6 +75,51 @@ export declare class Components implements Disposable {
120
75
  private update;
121
76
  private static setupBVH;
122
77
  }
78
+ import * as THREE from "three";
79
+ import { Components } from "../Components";
80
+ import { Component } from "../Types";
81
+ /**
82
+ * A tool to safely remove meshes and geometries from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
83
+ */
84
+ export declare class Disposer extends Component {
85
+ private _disposedComponents;
86
+ /** {@link Component.enabled} */
87
+ enabled: boolean;
88
+ /**
89
+ * A unique identifier for the component.
90
+ * This UUID is used to register the component within the Components system.
91
+ */
92
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
93
+ constructor(components: Components);
94
+ /**
95
+ * Return the UUIDs of all disposed components.
96
+ */
97
+ get(): Set<string>;
98
+ /**
99
+ * Removes a mesh, its geometry and its materials from memory. If you are
100
+ * using any of these in other parts of the application, make sure that you
101
+ * remove them from the mesh before disposing it.
102
+ *
103
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
104
+ * to remove.
105
+ *
106
+ * @param materials - whether to dispose the materials of the mesh.
107
+ *
108
+ * @param recursive - whether to recursively dispose the children of the mesh.
109
+ */
110
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
111
+ /**
112
+ * Disposes a geometry from memory.
113
+ *
114
+ * @param geometry - the
115
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
116
+ * to remove.
117
+ */
118
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
119
+ private disposeGeometryAndMaterials;
120
+ private disposeChildren;
121
+ private static disposeMaterial;
122
+ }
123
123
  import { Component, Disposable, World, Event } from "../Types";
124
124
  import { SimpleRaycaster } from "./src";
125
125
  import { Components } from "../Components";
@@ -417,40 +417,6 @@ import * as THREE from "three";
417
417
  export declare class MaterialsUtils {
418
418
  static isTransparent(material: THREE.Material): boolean;
419
419
  }
420
- export declare class UUID {
421
- private static _pattern;
422
- private static _lut;
423
- static create(): string;
424
- static validate(uuid: string): void;
425
- }
426
- import * as THREE from "three";
427
- import { Component, Components, Event, World } from "../core";
428
- export interface VertexPickerConfig {
429
- showOnlyVertex: boolean;
430
- snapDistance: number;
431
- previewElement: HTMLElement;
432
- }
433
- export declare class VertexPicker extends Component {
434
- onVertexFound: Event<THREE.Vector3>;
435
- onVertexLost: Event<THREE.Vector3>;
436
- components: Components;
437
- private _pickedPoint;
438
- private _config;
439
- private _enabled;
440
- private _workingPlane;
441
- set enabled(value: boolean);
442
- get enabled(): boolean;
443
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
444
- set workingPlane(plane: THREE.Plane | null);
445
- get workingPlane(): THREE.Plane | null;
446
- set config(value: Partial<VertexPickerConfig>);
447
- get config(): Partial<VertexPickerConfig>;
448
- dispose(): void;
449
- get(world: World): THREE.Vector3 | null;
450
- private getClosestVertex;
451
- private getVertices;
452
- private getVertex;
453
- }
454
420
  import { Components } from "../Components";
455
421
  import { MeshCullerRenderer, CullerRendererSettings } from "./src";
456
422
  import { Component, Event, Disposable, World } from "../Types";
@@ -499,53 +465,6 @@ export declare class Cullers extends Component implements Disposable {
499
465
  /** {@link Disposable.dispose} */
500
466
  dispose(): void;
501
467
  }
502
- import { MiniMap } from "./src";
503
- import { Component, Updateable, World, Event, Disposable } from "../Types";
504
- import { Components } from "../Components";
505
- /**
506
- * A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID.
507
- */
508
- export declare class MiniMaps extends Component implements Updateable, Disposable {
509
- /**
510
- * A unique identifier for the component.
511
- * This UUID is used to register the component within the Components system.
512
- */
513
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
514
- /** {@link Updateable.onAfterUpdate} */
515
- readonly onAfterUpdate: Event<unknown>;
516
- /** {@link Updateable.onBeforeUpdate} */
517
- readonly onBeforeUpdate: Event<unknown>;
518
- /** {@link Disposable.onDisposed} */
519
- readonly onDisposed: Event<unknown>;
520
- /** {@link Component.enabled} */
521
- enabled: boolean;
522
- /**
523
- * A collection of {@link MiniMap} instances, each associated with a unique world ID.
524
- */
525
- list: Map<string, MiniMap>;
526
- constructor(components: Components);
527
- /**
528
- * Creates a new {@link MiniMap} instance associated with the given world.
529
- * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
530
- *
531
- * @param world - The {@link World} for which to create a {@link MiniMap} instance.
532
- * @returns The newly created {@link MiniMap} instance.
533
- * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
534
- */
535
- create(world: World): MiniMap;
536
- /**
537
- * Deletes a {@link MiniMap} instance associated with the given world ID.
538
- * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
539
- *
540
- * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
541
- * @returns {void}
542
- */
543
- delete(id: string): void;
544
- /** {@link Disposable.dispose} */
545
- dispose(): void;
546
- /** {@link Updateable.update} */
547
- update(): void;
548
- }
549
468
  import * as THREE from "three";
550
469
  import { Components } from "../Components";
551
470
  import { SimpleCamera } from "..";
@@ -610,99 +529,98 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
610
529
  private newOrthoCamera;
611
530
  private setOrthoPerspCameraAspect;
612
531
  }
613
- import * as WEBIFC from "web-ifc";
614
- import * as FRAG from "@thatopen/fragments";
615
- import { Component, Components } from "../../core";
532
+ import { MiniMap } from "./src";
533
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
534
+ import { Components } from "../Components";
616
535
  /**
617
- * Object to export all the properties from an IFC to a JS object.
536
+ * A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID.
618
537
  */
619
- export declare class IfcJsonExporter extends Component {
620
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
538
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
539
+ /**
540
+ * A unique identifier for the component.
541
+ * This UUID is used to register the component within the Components system.
542
+ */
543
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
544
+ /** {@link Updateable.onAfterUpdate} */
545
+ readonly onAfterUpdate: Event<unknown>;
546
+ /** {@link Updateable.onBeforeUpdate} */
547
+ readonly onBeforeUpdate: Event<unknown>;
548
+ /** {@link Disposable.onDisposed} */
549
+ readonly onDisposed: Event<unknown>;
621
550
  /** {@link Component.enabled} */
622
551
  enabled: boolean;
552
+ /**
553
+ * A collection of {@link MiniMap} instances, each associated with a unique world ID.
554
+ */
555
+ list: Map<string, MiniMap>;
623
556
  constructor(components: Components);
624
557
  /**
625
- * Exports all the properties of an IFC into an array of JS objects.
626
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
627
- * @param modelID ID of the IFC model whose properties to extract.
628
- * @param indirect whether to get the indirect relationships as well.
629
- * @param recursiveSpatial whether to get the properties of spatial items recursively
630
- * to make the location data available (e.g. absolute position of building).
631
- */
632
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
558
+ * Creates a new {@link MiniMap} instance associated with the given world.
559
+ * If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
560
+ *
561
+ * @param world - The {@link World} for which to create a {@link MiniMap} instance.
562
+ * @returns The newly created {@link MiniMap} instance.
563
+ * @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
564
+ */
565
+ create(world: World): MiniMap;
566
+ /**
567
+ * Deletes a {@link MiniMap} instance associated with the given world ID.
568
+ * If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
569
+ *
570
+ * @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
571
+ * @returns {void}
572
+ */
573
+ delete(id: string): void;
574
+ /** {@link Disposable.dispose} */
575
+ dispose(): void;
576
+ /** {@link Updateable.update} */
577
+ update(): void;
633
578
  }
634
- import * as WEBIFC from "web-ifc";
635
- import { FragmentsGroup } from "@thatopen/fragments";
636
- import { Component, Disposable, Event, Components } from "../../core";
637
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
638
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
639
- type NumericPropTypes = "IfcInteger" | "IfcReal";
640
- interface ChangeMap {
641
- [modelID: string]: Set<number>;
579
+ import * as THREE from "three";
580
+ import { Component, Components } from "../../core";
581
+ export interface MeasureEdge {
582
+ distance: number;
583
+ points: THREE.Vector3[];
642
584
  }
643
- interface AttributeListener {
644
- [modelID: string]: {
645
- [expressID: number]: {
646
- [attributeName: string]: Event<String | Boolean | Number>;
647
- };
585
+ export declare class MeasurementUtils extends Component {
586
+ enabled: boolean;
587
+ static uuid: string;
588
+ constructor(components: Components);
589
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
590
+ edges: MeasureEdge[];
591
+ indices: Set<number>;
592
+ } | null;
593
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
594
+ private getFaceData;
595
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
596
+ p1: THREE.Vector3;
597
+ p2: THREE.Vector3;
598
+ p3: THREE.Vector3;
599
+ faceNormal: THREE.Vector3;
648
600
  };
601
+ private round;
649
602
  }
650
- export declare class IfcPropertiesManager extends Component implements Disposable {
651
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
652
- /** {@link Disposable.onDisposed} */
653
- readonly onDisposed: Event<string>;
654
- readonly onRequestFile: Event<unknown>;
655
- ifcToExport: ArrayBuffer | null;
656
- readonly onElementToPset: Event<{
657
- model: FragmentsGroup;
658
- psetID: number;
659
- elementID: number;
660
- }>;
661
- readonly onPropToPset: Event<{
662
- model: FragmentsGroup;
663
- psetID: number;
664
- propID: number;
665
- }>;
666
- readonly onPsetRemoved: Event<{
667
- model: FragmentsGroup;
668
- psetID: number;
669
- }>;
670
- readonly onDataChanged: Event<{
671
- model: FragmentsGroup;
672
- expressID: number;
673
- }>;
674
- wasm: {
675
- path: string;
676
- absolute: boolean;
677
- };
603
+ import * as WEBIFC from "web-ifc";
604
+ import * as FRAG from "@thatopen/fragments";
605
+ import { Component, Components } from "../../core";
606
+ /**
607
+ * Object to export all the properties from an IFC to a JS object.
608
+ */
609
+ export declare class IfcJsonExporter extends Component {
610
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
611
+ /** {@link Component.enabled} */
678
612
  enabled: boolean;
679
- attributeListeners: AttributeListener;
680
- selectedModel?: FragmentsGroup;
681
- changeMap: ChangeMap;
682
613
  constructor(components: Components);
683
- dispose(): void;
684
- private increaseMaxID;
685
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
686
- private newGUID;
687
- private getOwnerHistory;
688
- private registerChange;
689
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
690
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
691
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
692
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
693
- }>;
694
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
695
- private newSingleProperty;
696
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
697
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
698
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
699
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
700
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
701
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
702
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
703
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
614
+ /**
615
+ * Exports all the properties of an IFC into an array of JS objects.
616
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
617
+ * @param modelID ID of the IFC model whose properties to extract.
618
+ * @param indirect whether to get the indirect relationships as well.
619
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
620
+ * to make the location data available (e.g. absolute position of building).
621
+ */
622
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
704
623
  }
705
- export {};
706
624
  import * as WEBIFC from "web-ifc";
707
625
  import { FragmentsGroup } from "@thatopen/fragments";
708
626
  import { Disposable, Event, Component, Components } from "../../core";
@@ -835,47 +753,122 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
835
753
  dispose(): void;
836
754
  }
837
755
  export type { InverseAttribute, RelationsMap } from "./src/types";
838
- import * as THREE from "three";
839
- import * as FRAGS from "@thatopen/fragments";
840
- import { Disposable, Component, Event, Components } from "../../core";
841
- export interface Classification {
842
- [system: string]: {
843
- [className: string]: FRAGS.FragmentIdMap;
756
+ import * as WEBIFC from "web-ifc";
757
+ import { FragmentsGroup } from "@thatopen/fragments";
758
+ import { Component, Disposable, Event, Components } from "../../core";
759
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
760
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
761
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
762
+ interface ChangeMap {
763
+ [modelID: string]: Set<number>;
764
+ }
765
+ interface AttributeListener {
766
+ [modelID: string]: {
767
+ [expressID: number]: {
768
+ [attributeName: string]: Event<String | Boolean | Number>;
769
+ };
844
770
  };
845
771
  }
846
- export declare class Classifier extends Component implements Disposable {
847
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
848
- /** {@link Component.enabled} */
849
- enabled: boolean;
850
- list: Classification;
772
+ export declare class IfcPropertiesManager extends Component implements Disposable {
773
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
851
774
  /** {@link Disposable.onDisposed} */
852
- readonly onDisposed: Event<unknown>;
775
+ readonly onDisposed: Event<string>;
776
+ readonly onRequestFile: Event<unknown>;
777
+ ifcToExport: ArrayBuffer | null;
778
+ readonly onElementToPset: Event<{
779
+ model: FragmentsGroup;
780
+ psetID: number;
781
+ elementID: number;
782
+ }>;
783
+ readonly onPropToPset: Event<{
784
+ model: FragmentsGroup;
785
+ psetID: number;
786
+ propID: number;
787
+ }>;
788
+ readonly onPsetRemoved: Event<{
789
+ model: FragmentsGroup;
790
+ psetID: number;
791
+ }>;
792
+ readonly onDataChanged: Event<{
793
+ model: FragmentsGroup;
794
+ expressID: number;
795
+ }>;
796
+ wasm: {
797
+ path: string;
798
+ absolute: boolean;
799
+ };
800
+ enabled: boolean;
801
+ attributeListeners: AttributeListener;
802
+ selectedModel?: FragmentsGroup;
803
+ changeMap: ChangeMap;
853
804
  constructor(components: Components);
854
- private onFragmentsDisposed;
855
805
  dispose(): void;
856
- remove(guid: string): void;
857
- find(filter?: {
858
- [name: string]: string[];
859
- }): FRAGS.FragmentIdMap;
860
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
861
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
862
- byEntity(group: FRAGS.FragmentsGroup): void;
863
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
864
- bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
865
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
866
- resetColor(items: FRAGS.FragmentIdMap): void;
867
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
806
+ private increaseMaxID;
807
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
808
+ private newGUID;
809
+ private getOwnerHistory;
810
+ private registerChange;
811
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
812
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
813
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
814
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
815
+ }>;
816
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
817
+ private newSingleProperty;
818
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
819
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
820
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
821
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
822
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
823
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
824
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
825
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
868
826
  }
869
- import * as FRAGS from "@thatopen/fragments";
870
- import { Components, Component } from "../../core";
871
- export declare class Hider extends Component {
872
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
873
- enabled: boolean;
874
- constructor(components: Components);
875
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
876
- isolate(items: FRAGS.FragmentIdMap): void;
877
- private updateCulledVisibility;
827
+ export {};
828
+ export declare class UUID {
829
+ private static _pattern;
830
+ private static _lut;
831
+ static create(): string;
832
+ static validate(uuid: string): void;
833
+ }
834
+ import * as THREE from "three";
835
+ import { Component, Components, Event, World } from "../core";
836
+ export interface VertexPickerConfig {
837
+ showOnlyVertex: boolean;
838
+ snapDistance: number;
839
+ previewElement: HTMLElement;
840
+ }
841
+ export declare class VertexPicker extends Component {
842
+ onVertexFound: Event<THREE.Vector3>;
843
+ onVertexLost: Event<THREE.Vector3>;
844
+ components: Components;
845
+ private _pickedPoint;
846
+ private _config;
847
+ private _enabled;
848
+ private _workingPlane;
849
+ set enabled(value: boolean);
850
+ get enabled(): boolean;
851
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
852
+ set workingPlane(plane: THREE.Plane | null);
853
+ get workingPlane(): THREE.Plane | null;
854
+ set config(value: Partial<VertexPickerConfig>);
855
+ get config(): Partial<VertexPickerConfig>;
856
+ dispose(): void;
857
+ get(world: World): THREE.Vector3 | null;
858
+ private getClosestVertex;
859
+ private getVertices;
860
+ private getVertex;
861
+ }
862
+ import * as WEBIFC from "web-ifc";
863
+ export interface IfcItemsCategories {
864
+ [itemID: number]: number;
865
+ }
866
+ export declare class IfcCategories {
867
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
878
868
  }
869
+ export declare const IfcElements: {
870
+ [key: number]: string;
871
+ };
879
872
  import * as THREE from "three";
880
873
  import * as FRAGS from "@thatopen/fragments";
881
874
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -924,36 +917,46 @@ export declare class Exploder extends Component implements Disposable {
924
917
  dispose(): void;
925
918
  set(active: boolean): void;
926
919
  }
927
- import * as WEBIFC from "web-ifc";
920
+ import * as THREE from "three";
928
921
  import * as FRAGS from "@thatopen/fragments";
929
- import { IfcFragmentSettings } from "./src";
930
- import { Component, Components, Event, Disposable } from "../../core";
931
- export declare class IfcLoader extends Component implements Disposable {
932
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
933
- readonly onIfcStartedLoading: Event<void>;
934
- readonly onSetup: Event<void>;
935
- /** {@link Disposable.onDisposed} */
936
- readonly onDisposed: Event<string>;
937
- settings: IfcFragmentSettings;
922
+ import { Disposable, Component, Event, Components } from "../../core";
923
+ export interface Classification {
924
+ [system: string]: {
925
+ [className: string]: FRAGS.FragmentIdMap;
926
+ };
927
+ }
928
+ export declare class Classifier extends Component implements Disposable {
929
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
930
+ /** {@link Component.enabled} */
938
931
  enabled: boolean;
939
- webIfc: WEBIFC.IfcAPI;
940
- private _material;
941
- private _spatialTree;
942
- private _metaData;
943
- private _fragmentInstances;
944
- private _civil;
945
- private _visitedFragments;
946
- private _materialT;
932
+ list: Classification;
933
+ /** {@link Disposable.onDisposed} */
934
+ readonly onDisposed: Event<unknown>;
947
935
  constructor(components: Components);
936
+ private onFragmentsDisposed;
948
937
  dispose(): void;
949
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
950
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
951
- readIfcFile(data: Uint8Array): Promise<number>;
952
- private getAllGeometries;
953
- cleanUp(): void;
954
- private getMesh;
955
- private getGeometry;
956
- private autoSetWasm;
938
+ remove(guid: string): void;
939
+ find(filter?: {
940
+ [name: string]: string[];
941
+ }): FRAGS.FragmentIdMap;
942
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
943
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
944
+ byEntity(group: FRAGS.FragmentsGroup): void;
945
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
946
+ bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
947
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
948
+ resetColor(items: FRAGS.FragmentIdMap): void;
949
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
950
+ }
951
+ import * as FRAGS from "@thatopen/fragments";
952
+ import { Components, Component } from "../../core";
953
+ export declare class Hider extends Component {
954
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
955
+ enabled: boolean;
956
+ constructor(components: Components);
957
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
958
+ isolate(items: FRAGS.FragmentIdMap): void;
959
+ private updateCulledVisibility;
957
960
  }
958
961
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
959
962
  import * as THREE from "three";
@@ -1029,6 +1032,37 @@ export declare class FragmentsManager extends Component implements Disposable {
1029
1032
  coordinate(models?: FragmentsGroup[]): void;
1030
1033
  }
1031
1034
  import * as WEBIFC from "web-ifc";
1035
+ import * as FRAGS from "@thatopen/fragments";
1036
+ import { IfcFragmentSettings } from "./src";
1037
+ import { Component, Components, Event, Disposable } from "../../core";
1038
+ export declare class IfcLoader extends Component implements Disposable {
1039
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
1040
+ readonly onIfcStartedLoading: Event<void>;
1041
+ readonly onSetup: Event<void>;
1042
+ /** {@link Disposable.onDisposed} */
1043
+ readonly onDisposed: Event<string>;
1044
+ settings: IfcFragmentSettings;
1045
+ enabled: boolean;
1046
+ webIfc: WEBIFC.IfcAPI;
1047
+ private _material;
1048
+ private _spatialTree;
1049
+ private _metaData;
1050
+ private _fragmentInstances;
1051
+ private _civil;
1052
+ private _visitedFragments;
1053
+ private _materialT;
1054
+ constructor(components: Components);
1055
+ dispose(): void;
1056
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
1057
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
1058
+ readIfcFile(data: Uint8Array): Promise<number>;
1059
+ private getAllGeometries;
1060
+ cleanUp(): void;
1061
+ private getMesh;
1062
+ private getGeometry;
1063
+ private autoSetWasm;
1064
+ }
1065
+ import * as WEBIFC from "web-ifc";
1032
1066
  import { Components, Disposable, Event, Component } from "../../core";
1033
1067
  import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
1034
1068
  export declare class IfcGeometryTiler extends Component implements Disposable {
@@ -1094,38 +1128,7 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
1094
1128
  private streamAllProperties;
1095
1129
  private cleanUp;
1096
1130
  }
1097
- import * as THREE from "three";
1098
- import { Component, Components } from "../../core";
1099
- export interface MeasureEdge {
1100
- distance: number;
1101
- points: THREE.Vector3[];
1102
- }
1103
- export declare class MeasurementUtils extends Component {
1104
- enabled: boolean;
1105
- static uuid: string;
1106
- constructor(components: Components);
1107
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
1108
- edges: MeasureEdge[];
1109
- indices: Set<number>;
1110
- } | null;
1111
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
1112
- private getFaceData;
1113
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
1114
- p1: THREE.Vector3;
1115
- p2: THREE.Vector3;
1116
- p3: THREE.Vector3;
1117
- faceNormal: THREE.Vector3;
1118
- };
1119
- private round;
1120
- }
1121
- import * as WEBIFC from "web-ifc";
1122
- export interface IfcItemsCategories {
1123
- [itemID: number]: number;
1124
- }
1125
- export declare class IfcCategories {
1126
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
1127
- }
1128
- export declare const IfcElements: {
1131
+ export declare const IfcCategoryMap: {
1129
1132
  [key: number]: string;
1130
1133
  };
1131
1134
  import * as FRAGS from "@thatopen/fragments";
@@ -1153,9 +1156,7 @@ export declare class IfcPropertiesUtils {
1153
1156
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
1154
1157
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
1155
1158
  }
1156
- export declare const IfcCategoryMap: {
1157
- [key: number]: string;
1158
- };
1159
+ export declare const GeometryTypes: Set<number>;
1159
1160
  import * as THREE from "three";
1160
1161
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
1161
1162
  /**
@@ -1245,12 +1246,19 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
1245
1246
  resize(size?: THREE.Vector2): void;
1246
1247
  private updatePlanes;
1247
1248
  }
1248
- export declare const GeometryTypes: Set<number>;
1249
1249
  import { InverseAttribute } from "./types";
1250
1250
  export declare const relToAttributesMap: Map<number, {
1251
1251
  forRelating: InverseAttribute;
1252
1252
  forRelated: InverseAttribute;
1253
1253
  }>;
1254
+ import * as WEBIFC from "web-ifc";
1255
+ import { IfcItemsCategories } from "../../../ifc";
1256
+ export declare class SpatialStructure {
1257
+ itemsByFloor: IfcItemsCategories;
1258
+ private _units;
1259
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1260
+ cleanUp(): void;
1261
+ }
1254
1262
  /**
1255
1263
  * 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.
1256
1264
  */
@@ -1279,18 +1287,33 @@ export declare class Event<T> {
1279
1287
  reset(): void;
1280
1288
  private handlers;
1281
1289
  }
1282
- import { Base } from "./base";
1283
1290
  /**
1284
- * 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.
1291
+ * 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.
1285
1292
  */
1286
- export declare abstract class Component extends Base {
1293
+ export declare class AsyncEvent<T> {
1287
1294
  /**
1288
- * Whether this component is active or not. The behaviour can vary depending
1289
- * on the type of component. E.g. a disabled dimension tool will stop creating
1290
- * dimensions, while a disabled camera will stop moving. A disabled component
1291
- * will not be updated automatically each frame.
1295
+ * Add a callback to this event instance.
1296
+ * @param handler - the callback to be added to this event.
1292
1297
  */
1293
- abstract enabled: boolean;
1298
+ add(handler: T extends void ? {
1299
+ (): Promise<void>;
1300
+ } : {
1301
+ (data: T): Promise<void>;
1302
+ }): void;
1303
+ /**
1304
+ * Removes a callback from this event instance.
1305
+ * @param handler - the callback to be removed from this event.
1306
+ */
1307
+ remove(handler: T extends void ? {
1308
+ (): Promise<void>;
1309
+ } : {
1310
+ (data: T): Promise<void>;
1311
+ }): void;
1312
+ /** Triggers all the callbacks assigned to this event. */
1313
+ trigger: (data?: T) => Promise<void>;
1314
+ /** Gets rid of all the suscribed events. */
1315
+ reset(): void;
1316
+ private handlers;
1294
1317
  }
1295
1318
  import * as THREE from "three";
1296
1319
  import CameraControls from "camera-controls";
@@ -1400,13 +1423,18 @@ export interface CameraControllable {
1400
1423
  */
1401
1424
  controls: CameraControls;
1402
1425
  }
1403
- import * as WEBIFC from "web-ifc";
1404
- import { IfcItemsCategories } from "../../../ifc";
1405
- export declare class SpatialStructure {
1406
- itemsByFloor: IfcItemsCategories;
1407
- private _units;
1408
- setUp(webIfc: WEBIFC.IfcAPI): void;
1409
- cleanUp(): void;
1426
+ import { Base } from "./base";
1427
+ /**
1428
+ * 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.
1429
+ */
1430
+ export declare abstract class Component extends Base {
1431
+ /**
1432
+ * Whether this component is active or not. The behaviour can vary depending
1433
+ * on the type of component. E.g. a disabled dimension tool will stop creating
1434
+ * dimensions, while a disabled camera will stop moving. A disabled component
1435
+ * will not be updated automatically each frame.
1436
+ */
1437
+ abstract enabled: boolean;
1410
1438
  }
1411
1439
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1412
1440
  import { Components } from "../../Components";
@@ -1427,34 +1455,6 @@ export declare abstract class Base {
1427
1455
  /** Whether is component is {@link Configurable}. */
1428
1456
  isConfigurable: () => this is Configurable<any>;
1429
1457
  }
1430
- /**
1431
- * 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.
1432
- */
1433
- export declare class AsyncEvent<T> {
1434
- /**
1435
- * Add a callback to this event instance.
1436
- * @param handler - the callback to be added to this event.
1437
- */
1438
- add(handler: T extends void ? {
1439
- (): Promise<void>;
1440
- } : {
1441
- (data: T): Promise<void>;
1442
- }): void;
1443
- /**
1444
- * Removes a callback from this event instance.
1445
- * @param handler - the callback to be removed from this event.
1446
- */
1447
- remove(handler: T extends void ? {
1448
- (): Promise<void>;
1449
- } : {
1450
- (data: T): Promise<void>;
1451
- }): void;
1452
- /** Triggers all the callbacks assigned to this event. */
1453
- trigger: (data?: T) => Promise<void>;
1454
- /** Gets rid of all the suscribed events. */
1455
- reset(): void;
1456
- private handlers;
1457
- }
1458
1458
  import { Base } from "./base";
1459
1459
  import { World } from "./world";
1460
1460
  import { Event } from "./event";
@@ -1626,148 +1626,199 @@ export interface World extends Disposable, Updateable {
1626
1626
  isDisposing: boolean;
1627
1627
  }
1628
1628
  import * as THREE from "three";
1629
- import { Hideable, Disposable, Event, World } from "../../Types";
1630
1629
  import { Components } from "../../Components";
1630
+ import { AsyncEvent, Event, World } from "../../Types";
1631
1631
  /**
1632
- * Each of the planes created by the clipper.
1632
+ * Interface for settings to configure the CullerRenderer.
1633
1633
  */
1634
- export declare class SimplePlane implements Disposable, Hideable {
1635
- /** Event that fires when the user starts dragging a clipping plane. */
1636
- readonly onDraggingStarted: Event<unknown>;
1637
- /** Event that fires when the user stops dragging a clipping plane. */
1638
- readonly onDraggingEnded: Event<unknown>;
1639
- /** {@link Disposable.onDisposed} */
1640
- readonly onDisposed: Event<unknown>;
1634
+ export interface CullerRendererSettings {
1641
1635
  /**
1642
- * The normal vector of the clipping plane.
1636
+ * Interval in milliseconds at which the visibility check should be performed.
1637
+ * Default value is 1000.
1643
1638
  */
1644
- readonly normal: THREE.Vector3;
1639
+ updateInterval?: number;
1645
1640
  /**
1646
- * The origin point of the clipping plane.
1641
+ * Width of the render target used for visibility checks.
1642
+ * Default value is 512.
1647
1643
  */
1648
- readonly origin: THREE.Vector3;
1644
+ width?: number;
1649
1645
  /**
1650
- * The THREE.js Plane object representing the clipping plane.
1646
+ * Height of the render target used for visibility checks.
1647
+ * Default value is 512.
1651
1648
  */
1652
- readonly three: THREE.Plane;
1653
- /** The components instance to which this plane belongs. */
1654
- components: Components;
1655
- /** The world instance to which this plane belongs. */
1656
- world: World;
1657
- protected readonly _helper: THREE.Object3D;
1658
- protected _visible: boolean;
1659
- protected _enabled: boolean;
1660
- private _controlsActive;
1661
- private readonly _arrowBoundBox;
1662
- private readonly _planeMesh;
1663
- private readonly _controls;
1664
- private readonly _hiddenMaterial;
1649
+ height?: number;
1665
1650
  /**
1666
- * Getter for the enabled state of the clipping plane.
1667
- * @returns {boolean} The current enabled state.
1651
+ * Whether the visibility check should be performed automatically.
1652
+ * Default value is true.
1668
1653
  */
1669
- get enabled(): boolean;
1654
+ autoUpdate?: boolean;
1655
+ }
1656
+ /**
1657
+ * A base renderer to determine visibility on screen.
1658
+ */
1659
+ export declare class CullerRenderer {
1660
+ /** {@link Disposable.onDisposed} */
1661
+ readonly onDisposed: Event<string>;
1670
1662
  /**
1671
- * Setter for the enabled state of the clipping plane.
1672
- * Updates the clipping plane state in the renderer and throws an error if no renderer is found.
1673
- * @param {boolean} state - The new enabled state.
1663
+ * Fires after making the visibility check to the meshes. It lists the
1664
+ * meshes that are currently visible, and the ones that were visible
1665
+ * just before but not anymore.
1674
1666
  */
1675
- set enabled(state: boolean);
1676
- /** {@link Hideable.visible } */
1677
- get visible(): boolean;
1678
- /** {@link Hideable.visible } */
1679
- set visible(state: boolean);
1680
- /** The meshes used for raycasting */
1681
- get meshes(): THREE.Mesh[];
1682
- /** The material of the clipping plane representation. */
1683
- get planeMaterial(): THREE.Material | THREE.Material[];
1684
- /** The material of the clipping plane representation. */
1685
- set planeMaterial(material: THREE.Material | THREE.Material[]);
1686
- /** The size of the clipping plane representation. */
1687
- get size(): number;
1688
- /** Sets the size of the clipping plane representation. */
1689
- set size(size: number);
1667
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1690
1668
  /**
1691
- * Getter for the helper object of the clipping plane.
1692
- * The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
1693
- * It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
1694
- *
1695
- * @returns {THREE.Object3D} The helper object of the clipping plane.
1696
- */
1697
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1698
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1669
+ * Whether this renderer is active or not. If not, it won't render anything.
1670
+ */
1671
+ enabled: boolean;
1699
1672
  /**
1700
- * Sets the clipping plane's normal and origin from the given normal and point.
1701
- * This method resets the clipping plane's state, updates the normal and origin,
1702
- * and positions the helper object accordingly.
1703
- *
1704
- * @param normal - The new normal vector for the clipping plane.
1705
- * @param point - The new origin point for the clipping plane.
1706
- *
1707
- * @returns {void}
1708
- */
1709
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
1710
- /** {@link Updateable.update} */
1711
- update: () => void;
1673
+ * Needs to check whether there are objects that need to be hidden or shown.
1674
+ * You can bind this to the camera movement, to a certain interval, etc.
1675
+ */
1676
+ needsUpdate: boolean;
1677
+ /**
1678
+ * Render the internal scene used to determine the object visibility. Used
1679
+ * for debugging purposes.
1680
+ */
1681
+ renderDebugFrame: boolean;
1682
+ /** The components instance to which this renderer belongs. */
1683
+ components: Components;
1684
+ /** The world instance to which this renderer belongs. */
1685
+ readonly world: World;
1686
+ /** The THREE.js renderer used to make the visibility test. */
1687
+ readonly renderer: THREE.WebGLRenderer;
1688
+ protected autoUpdate: boolean;
1689
+ protected updateInterval: number;
1690
+ protected readonly worker: Worker;
1691
+ protected readonly scene: THREE.Scene;
1692
+ private _width;
1693
+ private _height;
1694
+ private _availableColor;
1695
+ private readonly renderTarget;
1696
+ private readonly bufferSize;
1697
+ private readonly _buffer;
1698
+ protected _isWorkerBusy: boolean;
1699
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1712
1700
  /** {@link Disposable.dispose} */
1713
1701
  dispose(): void;
1714
- private reset;
1715
- protected toggleControls(state: boolean): void;
1716
- private newTransformControls;
1717
- private initializeControls;
1718
- private createArrowBoundingBox;
1719
- private changeDrag;
1720
- private notifyDraggingChanged;
1721
- private preventCameraMovement;
1722
- private newHelper;
1723
- private static newPlaneMesh;
1702
+ /**
1703
+ * The function that the culler uses to reprocess the scene. Generally it's
1704
+ * better to call needsUpdate, but you can also call this to force it.
1705
+ * @param force if true, it will refresh the scene even if needsUpdate is
1706
+ * not true.
1707
+ */
1708
+ updateVisibility: (force?: boolean) => Promise<void>;
1709
+ protected getAvailableColor(): {
1710
+ r: number;
1711
+ g: number;
1712
+ b: number;
1713
+ code: string;
1714
+ };
1715
+ protected increaseColor(): void;
1716
+ protected decreaseColor(): void;
1717
+ private applySettings;
1724
1718
  }
1725
1719
  import * as THREE from "three";
1726
- import { Hideable, Event, World, Disposable } from "../../Types";
1720
+ import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1727
1721
  import { Components } from "../../Components";
1728
- export interface GridConfig {
1729
- color: THREE.Color;
1730
- size1: number;
1731
- size2: number;
1732
- distance: number;
1733
- }
1722
+ import { Event, World, Disposable } from "../../Types";
1734
1723
  /**
1735
- * An infinite grid. Created by
1736
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1737
- * and translated to typescript by
1738
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1724
+ * A renderer to determine a mesh visibility on screen.
1739
1725
  */
1740
- export declare class SimpleGrid implements Hideable, Disposable {
1741
- /** {@link Disposable.onDisposed} */
1742
- readonly onDisposed: Event<unknown>;
1743
- /** The world instance to which this Raycaster belongs. */
1744
- world: World;
1745
- /** The components instance to which this grid belongs. */
1746
- components: Components;
1747
- /** {@link Hideable.visible} */
1748
- get visible(): boolean;
1749
- /** {@link Hideable.visible} */
1750
- set visible(visible: boolean);
1751
- /** The material of the grid. */
1752
- get material(): THREE.ShaderMaterial;
1726
+ export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
1753
1727
  /**
1754
- * Whether the grid should fade away with distance. Recommended to be true for
1755
- * perspective cameras and false for orthographic cameras.
1728
+ * Event triggered when the visibility of meshes is updated.
1729
+ * Contains two sets: seen and unseen.
1756
1730
  */
1757
- get fade(): boolean;
1731
+ readonly onViewUpdated: Event<{
1732
+ seen: Set<THREE.Mesh>;
1733
+ unseen: Set<THREE.Mesh>;
1734
+ }>;
1758
1735
  /**
1759
- * Whether the grid should fade away with distance. Recommended to be true for
1760
- * perspective cameras and false for orthographic cameras.
1736
+ * Pixels in screen a geometry must occupy to be considered "seen".
1737
+ * Default value is 100.
1761
1738
  */
1762
- set fade(active: boolean);
1763
- /** The Three.js mesh that contains the infinite grid. */
1764
- readonly three: THREE.Mesh;
1765
- private _fade;
1766
- constructor(components: Components, world: World, config: GridConfig);
1739
+ threshold: number;
1740
+ /**
1741
+ * Map of color code to THREE.InstancedMesh.
1742
+ * Used to keep track of color-coded meshes.
1743
+ */
1744
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1745
+ /**
1746
+ * Flag to indicate if the renderer is currently processing.
1747
+ * Used to prevent concurrent processing.
1748
+ */
1749
+ isProcessing: boolean;
1750
+ private _colorCodeMeshMap;
1751
+ private _meshIDColorCodeMap;
1752
+ private _currentVisibleMeshes;
1753
+ private _recentlyHiddenMeshes;
1754
+ private _intervalID;
1755
+ private readonly _transparentMat;
1756
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1767
1757
  /** {@link Disposable.dispose} */
1768
1758
  dispose(): void;
1769
- private setupEvents;
1770
- private updateZoom;
1759
+ /**
1760
+ * 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.
1761
+ * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
1762
+ * @returns {void}
1763
+ */
1764
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1765
+ /**
1766
+ * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
1767
+ * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
1768
+ * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
1769
+ * @returns {void}
1770
+ */
1771
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1772
+ private handleWorkerMessage;
1773
+ private getAvailableMaterial;
1774
+ }
1775
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1776
+ import * as WEBIFC from "web-ifc";
1777
+ /** Configuration of the IFC-fragment conversion. */
1778
+ export declare class IfcFragmentSettings {
1779
+ /** Whether to extract the IFC properties into a JSON. */
1780
+ includeProperties: boolean;
1781
+ /**
1782
+ * Generate the geometry for categories that are not included by default,
1783
+ * like IFCSPACE.
1784
+ */
1785
+ optionalCategories: number[];
1786
+ /** Whether to use the coordination data coming from the IFC files. */
1787
+ coordinate: boolean;
1788
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1789
+ wasm: {
1790
+ path: string;
1791
+ absolute: boolean;
1792
+ logLevel?: WEBIFC.LogLevel;
1793
+ };
1794
+ /** List of categories that won't be converted to fragments. */
1795
+ excludedCategories: Set<number>;
1796
+ /** Whether to save the absolute location of all IFC items. */
1797
+ saveLocations: boolean;
1798
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1799
+ webIfc: WEBIFC.LoaderSettings;
1800
+ autoSetWasm: boolean;
1801
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1802
+ }
1803
+ import * as THREE from "three";
1804
+ import * as WEBIFC from "web-ifc";
1805
+ import * as FRAGS from "@thatopen/fragments";
1806
+ export declare class CivilReader {
1807
+ defLineMat: THREE.LineBasicMaterial;
1808
+ read(webIfc: WEBIFC.IfcAPI): {
1809
+ alignments: Map<number, FRAGS.Alignment>;
1810
+ coordinationMatrix: THREE.Matrix4;
1811
+ } | undefined;
1812
+ get(civilItems: any): {
1813
+ alignments: Map<number, FRAGS.Alignment>;
1814
+ coordinationMatrix: THREE.Matrix4;
1815
+ } | undefined;
1816
+ private getCurves;
1817
+ }
1818
+ import * as WEBIFC from "web-ifc";
1819
+ export declare class IfcMetadataReader {
1820
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1821
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1771
1822
  }
1772
1823
  import * as THREE from "three";
1773
1824
  import { BaseScene, Configurable, Event } from "../../Types";
@@ -2004,24 +2055,236 @@ export declare class SimpleRenderer extends BaseRenderer {
2004
2055
  private onContextBack;
2005
2056
  }
2006
2057
  import * as THREE from "three";
2007
- import { Disposable, Event } from "../../Types";
2058
+ import { Hideable, Event, World, Disposable } from "../../Types";
2059
+ import { Components } from "../../Components";
2060
+ export interface GridConfig {
2061
+ color: THREE.Color;
2062
+ size1: number;
2063
+ size2: number;
2064
+ distance: number;
2065
+ }
2008
2066
  /**
2009
- * A helper to easily get the real position of the mouse in the Three.js canvas
2010
- * to work with tools like the
2011
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
2012
- * been transformed through CSS or doesn't occupy the whole screen.
2067
+ * An infinite grid. Created by
2068
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
2069
+ * and translated to typescript by
2070
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
2013
2071
  */
2014
- export declare class Mouse implements Disposable {
2015
- dom: HTMLCanvasElement;
2016
- private _event?;
2017
- private _position;
2072
+ export declare class SimpleGrid implements Hideable, Disposable {
2018
2073
  /** {@link Disposable.onDisposed} */
2019
2074
  readonly onDisposed: Event<unknown>;
2020
- constructor(dom: HTMLCanvasElement);
2075
+ /** The world instance to which this Raycaster belongs. */
2076
+ world: World;
2077
+ /** The components instance to which this grid belongs. */
2078
+ components: Components;
2079
+ /** {@link Hideable.visible} */
2080
+ get visible(): boolean;
2081
+ /** {@link Hideable.visible} */
2082
+ set visible(visible: boolean);
2083
+ /** The material of the grid. */
2084
+ get material(): THREE.ShaderMaterial;
2021
2085
  /**
2022
- * The real position of the mouse of the Three.js canvas.
2086
+ * Whether the grid should fade away with distance. Recommended to be true for
2087
+ * perspective cameras and false for orthographic cameras.
2023
2088
  */
2024
- get position(): THREE.Vector2;
2089
+ get fade(): boolean;
2090
+ /**
2091
+ * Whether the grid should fade away with distance. Recommended to be true for
2092
+ * perspective cameras and false for orthographic cameras.
2093
+ */
2094
+ set fade(active: boolean);
2095
+ /** The Three.js mesh that contains the infinite grid. */
2096
+ readonly three: THREE.Mesh;
2097
+ private _fade;
2098
+ constructor(components: Components, world: World, config: GridConfig);
2099
+ /** {@link Disposable.dispose} */
2100
+ dispose(): void;
2101
+ private setupEvents;
2102
+ private updateZoom;
2103
+ }
2104
+ import * as THREE from "three";
2105
+ import { Hideable, Disposable, Event, World } from "../../Types";
2106
+ import { Components } from "../../Components";
2107
+ /**
2108
+ * Each of the planes created by the clipper.
2109
+ */
2110
+ export declare class SimplePlane implements Disposable, Hideable {
2111
+ /** Event that fires when the user starts dragging a clipping plane. */
2112
+ readonly onDraggingStarted: Event<unknown>;
2113
+ /** Event that fires when the user stops dragging a clipping plane. */
2114
+ readonly onDraggingEnded: Event<unknown>;
2115
+ /** {@link Disposable.onDisposed} */
2116
+ readonly onDisposed: Event<unknown>;
2117
+ /**
2118
+ * The normal vector of the clipping plane.
2119
+ */
2120
+ readonly normal: THREE.Vector3;
2121
+ /**
2122
+ * The origin point of the clipping plane.
2123
+ */
2124
+ readonly origin: THREE.Vector3;
2125
+ /**
2126
+ * The THREE.js Plane object representing the clipping plane.
2127
+ */
2128
+ readonly three: THREE.Plane;
2129
+ /** The components instance to which this plane belongs. */
2130
+ components: Components;
2131
+ /** The world instance to which this plane belongs. */
2132
+ world: World;
2133
+ protected readonly _helper: THREE.Object3D;
2134
+ protected _visible: boolean;
2135
+ protected _enabled: boolean;
2136
+ private _controlsActive;
2137
+ private readonly _arrowBoundBox;
2138
+ private readonly _planeMesh;
2139
+ private readonly _controls;
2140
+ private readonly _hiddenMaterial;
2141
+ /**
2142
+ * Getter for the enabled state of the clipping plane.
2143
+ * @returns {boolean} The current enabled state.
2144
+ */
2145
+ get enabled(): boolean;
2146
+ /**
2147
+ * Setter for the enabled state of the clipping plane.
2148
+ * Updates the clipping plane state in the renderer and throws an error if no renderer is found.
2149
+ * @param {boolean} state - The new enabled state.
2150
+ */
2151
+ set enabled(state: boolean);
2152
+ /** {@link Hideable.visible } */
2153
+ get visible(): boolean;
2154
+ /** {@link Hideable.visible } */
2155
+ set visible(state: boolean);
2156
+ /** The meshes used for raycasting */
2157
+ get meshes(): THREE.Mesh[];
2158
+ /** The material of the clipping plane representation. */
2159
+ get planeMaterial(): THREE.Material | THREE.Material[];
2160
+ /** The material of the clipping plane representation. */
2161
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
2162
+ /** The size of the clipping plane representation. */
2163
+ get size(): number;
2164
+ /** Sets the size of the clipping plane representation. */
2165
+ set size(size: number);
2166
+ /**
2167
+ * Getter for the helper object of the clipping plane.
2168
+ * The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
2169
+ * It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
2170
+ *
2171
+ * @returns {THREE.Object3D} The helper object of the clipping plane.
2172
+ */
2173
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
2174
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
2175
+ /**
2176
+ * Sets the clipping plane's normal and origin from the given normal and point.
2177
+ * This method resets the clipping plane's state, updates the normal and origin,
2178
+ * and positions the helper object accordingly.
2179
+ *
2180
+ * @param normal - The new normal vector for the clipping plane.
2181
+ * @param point - The new origin point for the clipping plane.
2182
+ *
2183
+ * @returns {void}
2184
+ */
2185
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
2186
+ /** {@link Updateable.update} */
2187
+ update: () => void;
2188
+ /** {@link Disposable.dispose} */
2189
+ dispose(): void;
2190
+ private reset;
2191
+ protected toggleControls(state: boolean): void;
2192
+ private newTransformControls;
2193
+ private initializeControls;
2194
+ private createArrowBoundingBox;
2195
+ private changeDrag;
2196
+ private notifyDraggingChanged;
2197
+ private preventCameraMovement;
2198
+ private newHelper;
2199
+ private static newPlaneMesh;
2200
+ }
2201
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
2202
+ /** Configuration of the IFC-fragment streaming. */
2203
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
2204
+ minGeometrySize: number;
2205
+ minAssetsSize: number;
2206
+ }
2207
+ /** Configuration of the IFC-fragment streaming. */
2208
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
2209
+ propertiesSize: number;
2210
+ }
2211
+ export interface StreamedGeometries {
2212
+ [id: number]: {
2213
+ boundingBox: Float32Array;
2214
+ hasHoles: boolean;
2215
+ geometryFile?: string;
2216
+ };
2217
+ }
2218
+ export interface StreamedAsset {
2219
+ id: number;
2220
+ geometries: {
2221
+ geometryID: number;
2222
+ transformation: number[];
2223
+ color: number[];
2224
+ }[];
2225
+ }
2226
+ import * as WEBIFC from "web-ifc";
2227
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
2228
+ import { PropertiesStreamingSettings } from "./streaming-settings";
2229
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
2230
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
2231
+ onPropertiesStreamed: AsyncEvent<{
2232
+ type: number;
2233
+ data: {
2234
+ [id: number]: any;
2235
+ };
2236
+ }>;
2237
+ onProgress: AsyncEvent<number>;
2238
+ onIndicesStreamed: AsyncEvent<number[][]>;
2239
+ /** {@link Disposable.onDisposed} */
2240
+ readonly onDisposed: Event<string>;
2241
+ enabled: boolean;
2242
+ settings: PropertiesStreamingSettings;
2243
+ webIfc: WEBIFC.IfcAPI;
2244
+ dispose(): Promise<void>;
2245
+ streamFromBuffer(data: Uint8Array): Promise<void>;
2246
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
2247
+ private readIfcFile;
2248
+ private streamIfcFile;
2249
+ private streamAllProperties;
2250
+ private getIndices;
2251
+ private cleanUp;
2252
+ }
2253
+ import { NavigationMode } from "./types";
2254
+ import { OrthoPerspectiveCamera } from "../index";
2255
+ /**
2256
+ * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
2257
+ */
2258
+ export declare class FirstPersonMode implements NavigationMode {
2259
+ private camera;
2260
+ /** {@link NavigationMode.enabled} */
2261
+ enabled: boolean;
2262
+ /** {@link NavigationMode.id} */
2263
+ readonly id = "FirstPerson";
2264
+ constructor(camera: OrthoPerspectiveCamera);
2265
+ /** {@link NavigationMode.set} */
2266
+ set(active: boolean): void;
2267
+ private setupFirstPersonCamera;
2268
+ }
2269
+ import * as THREE from "three";
2270
+ import { Disposable, Event } from "../../Types";
2271
+ /**
2272
+ * A helper to easily get the real position of the mouse in the Three.js canvas
2273
+ * to work with tools like the
2274
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
2275
+ * been transformed through CSS or doesn't occupy the whole screen.
2276
+ */
2277
+ export declare class Mouse implements Disposable {
2278
+ dom: HTMLCanvasElement;
2279
+ private _event?;
2280
+ private _position;
2281
+ /** {@link Disposable.onDisposed} */
2282
+ readonly onDisposed: Event<unknown>;
2283
+ constructor(dom: HTMLCanvasElement);
2284
+ /**
2285
+ * The real position of the mouse of the Three.js canvas.
2286
+ */
2287
+ get position(): THREE.Vector2;
2025
2288
  /** {@link Disposable.dispose} */
2026
2289
  dispose(): void;
2027
2290
  private getPositionY;
@@ -2083,170 +2346,6 @@ export declare class SimpleRaycaster implements Disposable {
2083
2346
  private intersect;
2084
2347
  private filterClippingPlanes;
2085
2348
  }
2086
- import * as THREE from "three";
2087
- import { Components } from "../../Components";
2088
- import { AsyncEvent, Event, World } from "../../Types";
2089
- /**
2090
- * Interface for settings to configure the CullerRenderer.
2091
- */
2092
- export interface CullerRendererSettings {
2093
- /**
2094
- * Interval in milliseconds at which the visibility check should be performed.
2095
- * Default value is 1000.
2096
- */
2097
- updateInterval?: number;
2098
- /**
2099
- * Width of the render target used for visibility checks.
2100
- * Default value is 512.
2101
- */
2102
- width?: number;
2103
- /**
2104
- * Height of the render target used for visibility checks.
2105
- * Default value is 512.
2106
- */
2107
- height?: number;
2108
- /**
2109
- * Whether the visibility check should be performed automatically.
2110
- * Default value is true.
2111
- */
2112
- autoUpdate?: boolean;
2113
- }
2114
- /**
2115
- * A base renderer to determine visibility on screen.
2116
- */
2117
- export declare class CullerRenderer {
2118
- /** {@link Disposable.onDisposed} */
2119
- readonly onDisposed: Event<string>;
2120
- /**
2121
- * Fires after making the visibility check to the meshes. It lists the
2122
- * meshes that are currently visible, and the ones that were visible
2123
- * just before but not anymore.
2124
- */
2125
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
2126
- /**
2127
- * Whether this renderer is active or not. If not, it won't render anything.
2128
- */
2129
- enabled: boolean;
2130
- /**
2131
- * Needs to check whether there are objects that need to be hidden or shown.
2132
- * You can bind this to the camera movement, to a certain interval, etc.
2133
- */
2134
- needsUpdate: boolean;
2135
- /**
2136
- * Render the internal scene used to determine the object visibility. Used
2137
- * for debugging purposes.
2138
- */
2139
- renderDebugFrame: boolean;
2140
- /** The components instance to which this renderer belongs. */
2141
- components: Components;
2142
- /** The world instance to which this renderer belongs. */
2143
- readonly world: World;
2144
- /** The THREE.js renderer used to make the visibility test. */
2145
- readonly renderer: THREE.WebGLRenderer;
2146
- protected autoUpdate: boolean;
2147
- protected updateInterval: number;
2148
- protected readonly worker: Worker;
2149
- protected readonly scene: THREE.Scene;
2150
- private _width;
2151
- private _height;
2152
- private _availableColor;
2153
- private readonly renderTarget;
2154
- private readonly bufferSize;
2155
- private readonly _buffer;
2156
- protected _isWorkerBusy: boolean;
2157
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
2158
- /** {@link Disposable.dispose} */
2159
- dispose(): void;
2160
- /**
2161
- * The function that the culler uses to reprocess the scene. Generally it's
2162
- * better to call needsUpdate, but you can also call this to force it.
2163
- * @param force if true, it will refresh the scene even if needsUpdate is
2164
- * not true.
2165
- */
2166
- updateVisibility: (force?: boolean) => Promise<void>;
2167
- protected getAvailableColor(): {
2168
- r: number;
2169
- g: number;
2170
- b: number;
2171
- code: string;
2172
- };
2173
- protected increaseColor(): void;
2174
- protected decreaseColor(): void;
2175
- private applySettings;
2176
- }
2177
- import * as THREE from "three";
2178
- import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
2179
- import { Components } from "../../Components";
2180
- import { Event, World, Disposable } from "../../Types";
2181
- /**
2182
- * A renderer to determine a mesh visibility on screen.
2183
- */
2184
- export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
2185
- /**
2186
- * Event triggered when the visibility of meshes is updated.
2187
- * Contains two sets: seen and unseen.
2188
- */
2189
- readonly onViewUpdated: Event<{
2190
- seen: Set<THREE.Mesh>;
2191
- unseen: Set<THREE.Mesh>;
2192
- }>;
2193
- /**
2194
- * Pixels in screen a geometry must occupy to be considered "seen".
2195
- * Default value is 100.
2196
- */
2197
- threshold: number;
2198
- /**
2199
- * Map of color code to THREE.InstancedMesh.
2200
- * Used to keep track of color-coded meshes.
2201
- */
2202
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
2203
- /**
2204
- * Flag to indicate if the renderer is currently processing.
2205
- * Used to prevent concurrent processing.
2206
- */
2207
- isProcessing: boolean;
2208
- private _colorCodeMeshMap;
2209
- private _meshIDColorCodeMap;
2210
- private _currentVisibleMeshes;
2211
- private _recentlyHiddenMeshes;
2212
- private _intervalID;
2213
- private readonly _transparentMat;
2214
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
2215
- /** {@link Disposable.dispose} */
2216
- dispose(): void;
2217
- /**
2218
- * 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.
2219
- * @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
2220
- * @returns {void}
2221
- */
2222
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
2223
- /**
2224
- * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
2225
- * When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
2226
- * @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
2227
- * @returns {void}
2228
- */
2229
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
2230
- private handleWorkerMessage;
2231
- private getAvailableMaterial;
2232
- }
2233
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
2234
- import { NavigationMode } from "./types";
2235
- import { OrthoPerspectiveCamera } from "../index";
2236
- /**
2237
- * A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
2238
- */
2239
- export declare class FirstPersonMode implements NavigationMode {
2240
- private camera;
2241
- /** {@link NavigationMode.enabled} */
2242
- enabled: boolean;
2243
- /** {@link NavigationMode.id} */
2244
- readonly id = "FirstPerson";
2245
- constructor(camera: OrthoPerspectiveCamera);
2246
- /** {@link NavigationMode.set} */
2247
- set(active: boolean): void;
2248
- private setupFirstPersonCamera;
2249
- }
2250
2349
  import { NavigationMode } from "./types";
2251
2350
  import { OrthoPerspectiveCamera } from "../index";
2252
2351
  /**
@@ -2354,104 +2453,15 @@ export interface NavigationMode {
2354
2453
  /** Whether this navigation mode is active or not. */
2355
2454
  enabled: boolean;
2356
2455
  }
2357
- import * as THREE from "three";
2358
- import * as WEBIFC from "web-ifc";
2359
- import * as FRAGS from "@thatopen/fragments";
2360
- export declare class CivilReader {
2361
- defLineMat: THREE.LineBasicMaterial;
2362
- read(webIfc: WEBIFC.IfcAPI): {
2363
- alignments: Map<number, FRAGS.Alignment>;
2364
- coordinationMatrix: THREE.Matrix4;
2365
- } | undefined;
2366
- get(civilItems: any): {
2367
- alignments: Map<number, FRAGS.Alignment>;
2368
- coordinationMatrix: THREE.Matrix4;
2369
- } | undefined;
2370
- private getCurves;
2371
- }
2372
- import * as WEBIFC from "web-ifc";
2373
- /** Configuration of the IFC-fragment conversion. */
2374
- export declare class IfcFragmentSettings {
2375
- /** Whether to extract the IFC properties into a JSON. */
2376
- includeProperties: boolean;
2377
- /**
2378
- * Generate the geometry for categories that are not included by default,
2379
- * like IFCSPACE.
2380
- */
2381
- optionalCategories: number[];
2382
- /** Whether to use the coordination data coming from the IFC files. */
2383
- coordinate: boolean;
2384
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2385
- wasm: {
2386
- path: string;
2387
- absolute: boolean;
2388
- logLevel?: WEBIFC.LogLevel;
2389
- };
2390
- /** List of categories that won't be converted to fragments. */
2391
- excludedCategories: Set<number>;
2392
- /** Whether to save the absolute location of all IFC items. */
2393
- saveLocations: boolean;
2394
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
2395
- webIfc: WEBIFC.LoaderSettings;
2396
- autoSetWasm: boolean;
2397
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
2398
- }
2399
2456
  import * as WEBIFC from "web-ifc";
2400
- export declare class IfcMetadataReader {
2401
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
2402
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
2403
- }
2404
- import { IfcFragmentSettings } from "../../IfcLoader/src";
2405
- /** Configuration of the IFC-fragment streaming. */
2406
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
2407
- minGeometrySize: number;
2408
- minAssetsSize: number;
2409
- }
2410
- /** Configuration of the IFC-fragment streaming. */
2411
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
2412
- propertiesSize: number;
2413
- }
2414
- export interface StreamedGeometries {
2415
- [id: number]: {
2416
- boundingBox: Float32Array;
2417
- hasHoles: boolean;
2418
- geometryFile?: string;
2419
- };
2420
- }
2421
- export interface StreamedAsset {
2422
- id: number;
2423
- geometries: {
2424
- geometryID: number;
2425
- transformation: number[];
2426
- color: number[];
2427
- }[];
2428
- }
2429
- import * as WEBIFC from "web-ifc";
2430
- import { AsyncEvent, Component, Disposable, Event } from "../../../core";
2431
- import { PropertiesStreamingSettings } from "./streaming-settings";
2432
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
2433
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
2434
- onPropertiesStreamed: AsyncEvent<{
2435
- type: number;
2436
- data: {
2437
- [id: number]: any;
2438
- };
2439
- }>;
2440
- onProgress: AsyncEvent<number>;
2441
- onIndicesStreamed: AsyncEvent<number[][]>;
2442
- /** {@link Disposable.onDisposed} */
2443
- readonly onDisposed: Event<string>;
2444
- enabled: boolean;
2445
- settings: PropertiesStreamingSettings;
2446
- webIfc: WEBIFC.IfcAPI;
2447
- dispose(): Promise<void>;
2448
- streamFromBuffer(data: Uint8Array): Promise<void>;
2449
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
2450
- private readIfcFile;
2451
- private streamIfcFile;
2452
- private streamAllProperties;
2453
- private getIndices;
2454
- private cleanUp;
2457
+ import * as THREE from "three";
2458
+ export declare class Units {
2459
+ factor: number;
2460
+ complement: number;
2461
+ apply(matrix: THREE.Matrix4): void;
2462
+ setUp(webIfc: WEBIFC.IfcAPI): void;
2463
+ private getLengthUnits;
2464
+ private getScaleMatrix;
2455
2465
  }
2456
2466
  export type RelationsMap = Map<number, Map<number, number[]>>;
2457
2467
  export interface ModelsRelationMap {
@@ -2477,16 +2487,6 @@ export type InverseAttributes = [
2477
2487
  "ContainsElements"
2478
2488
  ];
2479
2489
  export type InverseAttribute = InverseAttributes[number];
2480
- import * as WEBIFC from "web-ifc";
2481
- import * as THREE from "three";
2482
- export declare class Units {
2483
- factor: number;
2484
- complement: number;
2485
- apply(matrix: THREE.Matrix4): void;
2486
- setUp(webIfc: WEBIFC.IfcAPI): void;
2487
- private getLengthUnits;
2488
- private getScaleMatrix;
2489
- }
2490
2490
  import { BufferGeometry } from "three";
2491
2491
  import * as THREE from "three";
2492
2492
  export declare class TransformHelper {