@thatopen/components 2.0.8 → 2.0.9

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,242 +1,4 @@
1
1
  declare namespace OBC {
2
- import * as WEBIFC from "web-ifc";
3
- import { FragmentsGroup } from "@thatopen/fragments";
4
- import { Disposable, Event, Component, Components } from "../../core";
5
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
6
- /**
7
- * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
8
- * 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.
9
- */
10
- export declare class IfcRelationsIndexer extends Component implements Disposable {
11
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
12
- /** {@link Disposable.onDisposed} */
13
- readonly onDisposed: Event<string>;
14
- enabled: boolean;
15
- readonly onRelationsIndexed: Event<{
16
- modelID: string;
17
- relationsMap: RelationsMap;
18
- }>;
19
- private _relToAttributesMap;
20
- private _inverseAttributes;
21
- private _ifcRels;
22
- /**
23
- * Holds the relationship mappings for each model processed by the indexer.
24
- * The structure is a map where each key is a model's UUID, and the value is another map.
25
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
26
- * representing a specific relation type, and the value is an array of expressIDs of entities
27
- * that are related through that relation type. This structure allows for efficient querying
28
- * of entity relationships within a model.
29
- */
30
- readonly relationMaps: ModelsRelationMap;
31
- constructor(components: Components);
32
- private onFragmentsDisposed;
33
- /**
34
- * Adds a relation map to the model's relations map.
35
- *
36
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
37
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
38
- *
39
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
40
- */
41
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
42
- /**
43
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
44
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
45
- * and maps them in a structured way to facilitate quick access to related entities.
46
- *
47
- * The process involves querying the model for each relation type associated with the inverse attributes
48
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
49
- * and contains a nested map where each key is an entity's expressID and its value is another map.
50
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
51
- * of entities that are related through that attribute.
52
- *
53
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
54
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
55
- * representation of the relations indexed by entity expressIDs and relation types.
56
- * @throws An error if the model does not have properties loaded.
57
- */
58
- process(model: FragmentsGroup): Promise<RelationsMap>;
59
- /**
60
- * Processes a given model from a WebIfc API to index its IFC entities relations.
61
- *
62
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
63
- * @param modelID - The unique identifier of the model within the WebIfc API.
64
- * @returns A promise that resolves to the relations map for the processed model.
65
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
66
- */
67
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
68
- /**
69
- * Retrieves the relations of a specific entity within a model based on the given relation name.
70
- * This method searches the indexed relation maps for the specified model and entity,
71
- * returning the IDs of related entities if a match is found.
72
- *
73
- * @param model The 'FragmentsGroup' model containing the entity.
74
- * @param expressID The unique identifier of the entity within the model.
75
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
76
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
77
- * or the specified relation name is not indexed.
78
- */
79
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
80
- /**
81
- * Serializes the relations of a given relation map into a JSON string.
82
- * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
83
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
84
- * The resulting object is then serialized into a JSON string.
85
- *
86
- * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
87
- * @returns A JSON string representing the serialized relations of the given relation map.
88
- */
89
- serializeRelations(relationMap: RelationsMap): string;
90
- /**
91
- * Serializes the relations of a specific model into a JSON string.
92
- * This method iterates through the relations indexed for the given model,
93
- * organizing them into a structured object where each key is an expressID of an entity,
94
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
95
- * The resulting object is then serialized into a JSON string.
96
- *
97
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
98
- * @returns A JSON string representing the serialized relations of the specified model.
99
- * If the model has no indexed relations, 'null' is returned.
100
- */
101
- serializeModelRelations(model: FragmentsGroup): string | null;
102
- /**
103
- * Serializes all relations of every model processed by the indexer into a JSON string.
104
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
105
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
106
- * and its value is another object mapping entity expressIDs to their related entities, categorized
107
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
108
- *
109
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
110
- * If no relations have been indexed, an empty object is returned as a JSON string.
111
- */
112
- serializeAllRelations(): string;
113
- /**
114
- * Converts a JSON string representing relations between entities into a structured map.
115
- * This method parses the JSON string to reconstruct the relations map that indexes
116
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
117
- * and the values are maps where each key is a relation type ID and its value is an array
118
- * of express IDs of entities related through that relation type.
119
- *
120
- * @param json The JSON string to be parsed into the relations map.
121
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
122
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
123
- * is an array of express IDs (as numbers) of entities related through that relation type.
124
- */
125
- getRelationsMapFromJSON(json: string): RelationsMap;
126
- /**
127
- * Disposes the component, cleaning up resources and detaching event listeners.
128
- * This ensures that the component is properly cleaned up and does not leave behind any
129
- * references that could prevent garbage collection.
130
- */
131
- dispose(): void;
132
- }
133
- export type { InverseAttribute, RelationsMap } from "./src/types";
134
- import * as WEBIFC from "web-ifc";
135
- import * as FRAG from "@thatopen/fragments";
136
- import { Component, Components } from "../../core";
137
- /**
138
- * Object to export all the properties from an IFC to a JS object.
139
- */
140
- export declare class IfcJsonExporter extends Component {
141
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
142
- /** {@link Component.enabled} */
143
- enabled: boolean;
144
- constructor(components: Components);
145
- /**
146
- * Exports all the properties of an IFC into an array of JS objects.
147
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
148
- * @param modelID ID of the IFC model whose properties to extract.
149
- * @param indirect whether to get the indirect relationships as well.
150
- * @param recursiveSpatial whether to get the properties of spatial items recursively
151
- * to make the location data available (e.g. absolute position of building).
152
- */
153
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
154
- }
155
- import { Component, Disposable, World, Event } from "../Types";
156
- import { SimpleRaycaster } from "./src";
157
- import { Components } from "../Components";
158
- export declare class Raycasters extends Component implements Disposable {
159
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
160
- enabled: boolean;
161
- list: Map<string, SimpleRaycaster>;
162
- onDisposed: Event<unknown>;
163
- constructor(components: Components);
164
- get(world: World): SimpleRaycaster;
165
- delete(world: World): void;
166
- dispose(): void;
167
- }
168
- import * as WEBIFC from "web-ifc";
169
- import { FragmentsGroup } from "@thatopen/fragments";
170
- import { Component, Disposable, Event, Components } from "../../core";
171
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
172
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
173
- type NumericPropTypes = "IfcInteger" | "IfcReal";
174
- interface ChangeMap {
175
- [modelID: string]: Set<number>;
176
- }
177
- interface AttributeListener {
178
- [modelID: string]: {
179
- [expressID: number]: {
180
- [attributeName: string]: Event<String | Boolean | Number>;
181
- };
182
- };
183
- }
184
- export declare class IfcPropertiesManager extends Component implements Disposable {
185
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
186
- /** {@link Disposable.onDisposed} */
187
- readonly onDisposed: Event<string>;
188
- readonly onRequestFile: Event<unknown>;
189
- ifcToExport: ArrayBuffer | null;
190
- readonly onElementToPset: Event<{
191
- model: FragmentsGroup;
192
- psetID: number;
193
- elementID: number;
194
- }>;
195
- readonly onPropToPset: Event<{
196
- model: FragmentsGroup;
197
- psetID: number;
198
- propID: number;
199
- }>;
200
- readonly onPsetRemoved: Event<{
201
- model: FragmentsGroup;
202
- psetID: number;
203
- }>;
204
- readonly onDataChanged: Event<{
205
- model: FragmentsGroup;
206
- expressID: number;
207
- }>;
208
- wasm: {
209
- path: string;
210
- absolute: boolean;
211
- };
212
- enabled: boolean;
213
- attributeListeners: AttributeListener;
214
- selectedModel?: FragmentsGroup;
215
- changeMap: ChangeMap;
216
- constructor(components: Components);
217
- dispose(): void;
218
- private increaseMaxID;
219
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
220
- private newGUID;
221
- private getOwnerHistory;
222
- private registerChange;
223
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
224
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
225
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
226
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
227
- }>;
228
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
229
- private newSingleProperty;
230
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
231
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
232
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
233
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
234
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
235
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
236
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
237
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
238
- }
239
- export {};
240
2
  import { Component, Disposable, Event } from "../Types";
241
3
  /**
242
4
  * The entry point of the Components library.
@@ -332,29 +94,33 @@ export declare class Disposer extends Component {
332
94
  private disposeChildren;
333
95
  private static disposeMaterial;
334
96
  }
335
- import * as THREE from "three";
336
- import { Component, Components } from "../../core";
337
- export interface MeasureEdge {
338
- distance: number;
339
- points: THREE.Vector3[];
340
- }
341
- export declare class MeasurementUtils extends Component {
97
+ import { Component, Disposable, World, Event } from "../Types";
98
+ import { SimpleRaycaster } from "./src";
99
+ import { Components } from "../Components";
100
+ export declare class Raycasters extends Component implements Disposable {
101
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
342
102
  enabled: boolean;
343
- static uuid: string;
103
+ list: Map<string, SimpleRaycaster>;
104
+ onDisposed: Event<unknown>;
344
105
  constructor(components: Components);
345
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
346
- edges: MeasureEdge[];
347
- indices: Set<number>;
348
- } | null;
349
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
350
- private getFaceData;
351
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
352
- p1: THREE.Vector3;
353
- p2: THREE.Vector3;
354
- p3: THREE.Vector3;
355
- faceNormal: THREE.Vector3;
356
- };
357
- private round;
106
+ get(world: World): SimpleRaycaster;
107
+ delete(world: World): void;
108
+ dispose(): void;
109
+ }
110
+ import { Component, Disposable, World, Event } from "../Types";
111
+ import { GridConfig, SimpleGrid } from "./src";
112
+ import { Components } from "../Components";
113
+ export declare class Grids extends Component implements Disposable {
114
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
115
+ list: Map<string, SimpleGrid>;
116
+ readonly onDisposed: Event<unknown>;
117
+ config: Required<GridConfig>;
118
+ /** {@link Component.enabled} */
119
+ enabled: boolean;
120
+ constructor(components: Components);
121
+ create(world: World): SimpleGrid;
122
+ delete(world: World): void;
123
+ dispose(): void;
358
124
  }
359
125
  import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
360
126
  import { Components } from "../Components";
@@ -407,52 +173,6 @@ export declare class Worlds extends Component implements Updateable, Disposable
407
173
  dispose(): void;
408
174
  update(delta?: number): void | Promise<void>;
409
175
  }
410
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
411
- import * as THREE from "three";
412
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
413
- center: THREE.Vector3;
414
- halfSizes: THREE.Vector3;
415
- rotation: THREE.Matrix3;
416
- transformation: THREE.Matrix4;
417
- };
418
- import * as THREE from "three";
419
- export declare class MaterialsUtils {
420
- static isTransparent(material: THREE.Material): boolean;
421
- }
422
- export declare class UUID {
423
- private static _pattern;
424
- private static _lut;
425
- static create(): string;
426
- static validate(uuid: string): void;
427
- }
428
- import * as THREE from "three";
429
- import { Component, Components, Event, World } from "../core";
430
- export interface VertexPickerConfig {
431
- showOnlyVertex: boolean;
432
- snapDistance: number;
433
- previewElement: HTMLElement;
434
- }
435
- export declare class VertexPicker extends Component {
436
- onVertexFound: Event<THREE.Vector3>;
437
- onVertexLost: Event<THREE.Vector3>;
438
- components: Components;
439
- private _pickedPoint;
440
- private _config;
441
- private _enabled;
442
- private _workingPlane;
443
- set enabled(value: boolean);
444
- get enabled(): boolean;
445
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
446
- set workingPlane(plane: THREE.Plane | null);
447
- get workingPlane(): THREE.Plane | null;
448
- set config(value: Partial<VertexPickerConfig>);
449
- get config(): Partial<VertexPickerConfig>;
450
- dispose(): void;
451
- get(world: World): THREE.Vector3 | null;
452
- private getClosestVertex;
453
- private getVertices;
454
- private getVertex;
455
- }
456
176
  import * as THREE from "three";
457
177
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
458
178
  import { SimplePlane } from "./src";
@@ -552,21 +272,6 @@ export declare class Clipper extends Component implements Createable, Disposable
552
272
  private _onStartDragging;
553
273
  private _onEndDragging;
554
274
  }
555
- import { Component, Disposable, World, Event } from "../Types";
556
- import { GridConfig, SimpleGrid } from "./src";
557
- import { Components } from "../Components";
558
- export declare class Grids extends Component implements Disposable {
559
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
560
- list: Map<string, SimpleGrid>;
561
- readonly onDisposed: Event<unknown>;
562
- config: Required<GridConfig>;
563
- /** {@link Component.enabled} */
564
- enabled: boolean;
565
- constructor(components: Components);
566
- create(world: World): SimpleGrid;
567
- delete(world: World): void;
568
- dispose(): void;
569
- }
570
275
  import { Components } from "../Components";
571
276
  import { MeshCullerRenderer, CullerRendererSettings } from "./src";
572
277
  import { Component, Event, Disposable, World } from "../Types";
@@ -687,6 +392,30 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
687
392
  private setOrthoPerspCameraAspect;
688
393
  }
689
394
  import * as THREE from "three";
395
+ import { Component, Components } from "../../core";
396
+ export interface MeasureEdge {
397
+ distance: number;
398
+ points: THREE.Vector3[];
399
+ }
400
+ export declare class MeasurementUtils extends Component {
401
+ enabled: boolean;
402
+ static uuid: string;
403
+ constructor(components: Components);
404
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
405
+ edges: MeasureEdge[];
406
+ indices: Set<number>;
407
+ } | null;
408
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
409
+ private getFaceData;
410
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
411
+ p1: THREE.Vector3;
412
+ p2: THREE.Vector3;
413
+ p3: THREE.Vector3;
414
+ faceNormal: THREE.Vector3;
415
+ };
416
+ private round;
417
+ }
418
+ import * as THREE from "three";
690
419
  import * as FRAGS from "@thatopen/fragments";
691
420
  import { FragmentsGroup } from "@thatopen/fragments";
692
421
  import { Component, Components, Disposable, Event } from "../../core";
@@ -753,6 +482,16 @@ export declare class Classifier extends Component implements Disposable {
753
482
  resetColor(items: FRAGS.FragmentIdMap): void;
754
483
  protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
755
484
  }
485
+ import * as FRAGS from "@thatopen/fragments";
486
+ import { Components, Component } from "../../core";
487
+ export declare class Hider extends Component {
488
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
489
+ enabled: boolean;
490
+ constructor(components: Components);
491
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
492
+ isolate(items: FRAGS.FragmentIdMap): void;
493
+ private updateCulledVisibility;
494
+ }
756
495
  import { Component, Disposable, Event, Components } from "../../core";
757
496
  export declare class Exploder extends Component implements Disposable {
758
497
  static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
@@ -766,47 +505,6 @@ export declare class Exploder extends Component implements Disposable {
766
505
  dispose(): void;
767
506
  set(active: boolean): void;
768
507
  }
769
- import * as WEBIFC from "web-ifc";
770
- import * as FRAGS from "@thatopen/fragments";
771
- import { IfcFragmentSettings } from "./src";
772
- import { Component, Components, Event, Disposable } from "../../core";
773
- export declare class IfcLoader extends Component implements Disposable {
774
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
775
- readonly onIfcStartedLoading: Event<void>;
776
- readonly onSetup: Event<void>;
777
- /** {@link Disposable.onDisposed} */
778
- readonly onDisposed: Event<string>;
779
- settings: IfcFragmentSettings;
780
- enabled: boolean;
781
- webIfc: WEBIFC.IfcAPI;
782
- private _material;
783
- private _spatialTree;
784
- private _metaData;
785
- private _fragmentInstances;
786
- private _civil;
787
- private _visitedFragments;
788
- private _materialT;
789
- constructor(components: Components);
790
- dispose(): void;
791
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
792
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
793
- readIfcFile(data: Uint8Array): Promise<number>;
794
- private getAllGeometries;
795
- cleanUp(): void;
796
- private getMesh;
797
- private getGeometry;
798
- private autoSetWasm;
799
- }
800
- import * as FRAGS from "@thatopen/fragments";
801
- import { Components, Component } from "../../core";
802
- export declare class Hider extends Component {
803
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
804
- enabled: boolean;
805
- constructor(components: Components);
806
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
807
- isolate(items: FRAGS.FragmentIdMap): void;
808
- private updateCulledVisibility;
809
- }
810
508
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
811
509
  import * as THREE from "three";
812
510
  import * as FRAGS from "@thatopen/fragments";
@@ -860,45 +558,37 @@ export declare class FragmentsManager extends Component implements Disposable {
860
558
  export(group: FragmentsGroup): Uint8Array;
861
559
  coordinate(models?: FragmentsGroup[]): void;
862
560
  }
863
- export declare const IfcElements: {
864
- [key: number]: string;
865
- };
866
561
  import * as WEBIFC from "web-ifc";
867
- export interface IfcItemsCategories {
868
- [itemID: number]: number;
869
- }
870
- export declare class IfcCategories {
871
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
872
- }
873
562
  import * as FRAGS from "@thatopen/fragments";
874
- export declare class IfcPropertiesUtils {
875
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
876
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
877
- [attribute: string]: any;
878
- } | null>;
879
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
880
- [relatingID: number]: number[];
881
- }>;
882
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
883
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
884
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
885
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
886
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
887
- key: string | null;
888
- name: string | null;
889
- }>;
890
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
891
- key: string | null;
892
- value: number | null;
893
- }>;
894
- static isRel(expressID: number): boolean;
895
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
896
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
563
+ import { IfcFragmentSettings } from "./src";
564
+ import { Component, Components, Event, Disposable } from "../../core";
565
+ export declare class IfcLoader extends Component implements Disposable {
566
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
567
+ readonly onIfcStartedLoading: Event<void>;
568
+ readonly onSetup: Event<void>;
569
+ /** {@link Disposable.onDisposed} */
570
+ readonly onDisposed: Event<string>;
571
+ settings: IfcFragmentSettings;
572
+ enabled: boolean;
573
+ webIfc: WEBIFC.IfcAPI;
574
+ private _material;
575
+ private _spatialTree;
576
+ private _metaData;
577
+ private _fragmentInstances;
578
+ private _civil;
579
+ private _visitedFragments;
580
+ private _materialT;
581
+ constructor(components: Components);
582
+ dispose(): void;
583
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
584
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
585
+ readIfcFile(data: Uint8Array): Promise<number>;
586
+ private getAllGeometries;
587
+ cleanUp(): void;
588
+ private getMesh;
589
+ private getGeometry;
590
+ private autoSetWasm;
897
591
  }
898
- export declare const IfcCategoryMap: {
899
- [key: number]: string;
900
- };
901
- export declare const GeometryTypes: Set<number>;
902
592
  import * as WEBIFC from "web-ifc";
903
593
  import { Components, Disposable, Event, Component } from "../../core";
904
594
  import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
@@ -939,6 +629,52 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
939
629
  private streamAssets;
940
630
  private streamGeometries;
941
631
  }
632
+ import * as THREE from "three";
633
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
634
+ center: THREE.Vector3;
635
+ halfSizes: THREE.Vector3;
636
+ rotation: THREE.Matrix3;
637
+ transformation: THREE.Matrix4;
638
+ };
639
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
640
+ import * as THREE from "three";
641
+ export declare class MaterialsUtils {
642
+ static isTransparent(material: THREE.Material): boolean;
643
+ }
644
+ export declare class UUID {
645
+ private static _pattern;
646
+ private static _lut;
647
+ static create(): string;
648
+ static validate(uuid: string): void;
649
+ }
650
+ import * as THREE from "three";
651
+ import { Component, Components, Event, World } from "../core";
652
+ export interface VertexPickerConfig {
653
+ showOnlyVertex: boolean;
654
+ snapDistance: number;
655
+ previewElement: HTMLElement;
656
+ }
657
+ export declare class VertexPicker extends Component {
658
+ onVertexFound: Event<THREE.Vector3>;
659
+ onVertexLost: Event<THREE.Vector3>;
660
+ components: Components;
661
+ private _pickedPoint;
662
+ private _config;
663
+ private _enabled;
664
+ private _workingPlane;
665
+ set enabled(value: boolean);
666
+ get enabled(): boolean;
667
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
668
+ set workingPlane(plane: THREE.Plane | null);
669
+ get workingPlane(): THREE.Plane | null;
670
+ set config(value: Partial<VertexPickerConfig>);
671
+ get config(): Partial<VertexPickerConfig>;
672
+ dispose(): void;
673
+ get(world: World): THREE.Vector3 | null;
674
+ private getClosestVertex;
675
+ private getVertices;
676
+ private getVertex;
677
+ }
942
678
  import * as WEBIFC from "web-ifc";
943
679
  import { AsyncEvent, Component, Disposable, Event } from "../../core";
944
680
  import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
@@ -965,11 +701,232 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
965
701
  private streamAllProperties;
966
702
  private cleanUp;
967
703
  }
968
- import { InverseAttribute } from "./types";
969
- export declare const relToAttributesMap: Map<number, {
970
- forRelating: InverseAttribute;
971
- forRelated: InverseAttribute;
972
- }>;
704
+ import * as WEBIFC from "web-ifc";
705
+ import * as FRAG from "@thatopen/fragments";
706
+ import { Component, Components } from "../../core";
707
+ /**
708
+ * Object to export all the properties from an IFC to a JS object.
709
+ */
710
+ export declare class IfcJsonExporter extends Component {
711
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
712
+ /** {@link Component.enabled} */
713
+ enabled: boolean;
714
+ constructor(components: Components);
715
+ /**
716
+ * Exports all the properties of an IFC into an array of JS objects.
717
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
718
+ * @param modelID ID of the IFC model whose properties to extract.
719
+ * @param indirect whether to get the indirect relationships as well.
720
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
721
+ * to make the location data available (e.g. absolute position of building).
722
+ */
723
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
724
+ }
725
+ import * as WEBIFC from "web-ifc";
726
+ import { FragmentsGroup } from "@thatopen/fragments";
727
+ import { Disposable, Event, Component, Components } from "../../core";
728
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
729
+ /**
730
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
731
+ * 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.
732
+ */
733
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
734
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
735
+ /** {@link Disposable.onDisposed} */
736
+ readonly onDisposed: Event<string>;
737
+ enabled: boolean;
738
+ readonly onRelationsIndexed: Event<{
739
+ modelID: string;
740
+ relationsMap: RelationsMap;
741
+ }>;
742
+ private _relToAttributesMap;
743
+ private _inverseAttributes;
744
+ private _ifcRels;
745
+ /**
746
+ * Holds the relationship mappings for each model processed by the indexer.
747
+ * The structure is a map where each key is a model's UUID, and the value is another map.
748
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
749
+ * representing a specific relation type, and the value is an array of expressIDs of entities
750
+ * that are related through that relation type. This structure allows for efficient querying
751
+ * of entity relationships within a model.
752
+ */
753
+ readonly relationMaps: ModelsRelationMap;
754
+ constructor(components: Components);
755
+ private onFragmentsDisposed;
756
+ private indexRelations;
757
+ /**
758
+ * Adds a relation map to the model's relations map.
759
+ *
760
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
761
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
762
+ *
763
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
764
+ */
765
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
766
+ /**
767
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
768
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
769
+ * and maps them in a structured way to facilitate quick access to related entities.
770
+ *
771
+ * The process involves querying the model for each relation type associated with the inverse attributes
772
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
773
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
774
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
775
+ * of entities that are related through that attribute.
776
+ *
777
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
778
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
779
+ * representation of the relations indexed by entity expressIDs and relation types.
780
+ * @throws An error if the model does not have properties loaded.
781
+ */
782
+ process(model: FragmentsGroup): Promise<RelationsMap>;
783
+ /**
784
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
785
+ *
786
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
787
+ * @param modelID - The unique identifier of the model within the WebIfc API.
788
+ * @returns A promise that resolves to the relations map for the processed model.
789
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
790
+ */
791
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
792
+ /**
793
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
794
+ * This method searches the indexed relation maps for the specified model and entity,
795
+ * returning the IDs of related entities if a match is found.
796
+ *
797
+ * @param model The 'FragmentsGroup' model containing the entity.
798
+ * @param expressID The unique identifier of the entity within the model.
799
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
800
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
801
+ * or the specified relation name is not indexed.
802
+ */
803
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
804
+ /**
805
+ * Serializes the relations of a given relation map into a JSON string.
806
+ * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
807
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
808
+ * The resulting object is then serialized into a JSON string.
809
+ *
810
+ * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
811
+ * @returns A JSON string representing the serialized relations of the given relation map.
812
+ */
813
+ serializeRelations(relationMap: RelationsMap): string;
814
+ /**
815
+ * Serializes the relations of a specific model into a JSON string.
816
+ * This method iterates through the relations indexed for the given model,
817
+ * organizing them into a structured object where each key is an expressID of an entity,
818
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
819
+ * The resulting object is then serialized into a JSON string.
820
+ *
821
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
822
+ * @returns A JSON string representing the serialized relations of the specified model.
823
+ * If the model has no indexed relations, 'null' is returned.
824
+ */
825
+ serializeModelRelations(model: FragmentsGroup): string | null;
826
+ /**
827
+ * Serializes all relations of every model processed by the indexer into a JSON string.
828
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
829
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
830
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
831
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
832
+ *
833
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
834
+ * If no relations have been indexed, an empty object is returned as a JSON string.
835
+ */
836
+ serializeAllRelations(): string;
837
+ /**
838
+ * Converts a JSON string representing relations between entities into a structured map.
839
+ * This method parses the JSON string to reconstruct the relations map that indexes
840
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
841
+ * and the values are maps where each key is a relation type ID and its value is an array
842
+ * of express IDs of entities related through that relation type.
843
+ *
844
+ * @param json The JSON string to be parsed into the relations map.
845
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
846
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
847
+ * is an array of express IDs (as numbers) of entities related through that relation type.
848
+ */
849
+ getRelationsMapFromJSON(json: string): RelationsMap;
850
+ /**
851
+ * Disposes the component, cleaning up resources and detaching event listeners.
852
+ * This ensures that the component is properly cleaned up and does not leave behind any
853
+ * references that could prevent garbage collection.
854
+ */
855
+ dispose(): void;
856
+ }
857
+ export type { InverseAttribute, RelationsMap } from "./src/types";
858
+ import * as WEBIFC from "web-ifc";
859
+ import { FragmentsGroup } from "@thatopen/fragments";
860
+ import { Component, Disposable, Event, Components } from "../../core";
861
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
862
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
863
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
864
+ interface ChangeMap {
865
+ [modelID: string]: Set<number>;
866
+ }
867
+ interface AttributeListener {
868
+ [modelID: string]: {
869
+ [expressID: number]: {
870
+ [attributeName: string]: Event<String | Boolean | Number>;
871
+ };
872
+ };
873
+ }
874
+ export declare class IfcPropertiesManager extends Component implements Disposable {
875
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
876
+ /** {@link Disposable.onDisposed} */
877
+ readonly onDisposed: Event<string>;
878
+ readonly onRequestFile: Event<unknown>;
879
+ ifcToExport: ArrayBuffer | null;
880
+ readonly onElementToPset: Event<{
881
+ model: FragmentsGroup;
882
+ psetID: number;
883
+ elementID: number;
884
+ }>;
885
+ readonly onPropToPset: Event<{
886
+ model: FragmentsGroup;
887
+ psetID: number;
888
+ propID: number;
889
+ }>;
890
+ readonly onPsetRemoved: Event<{
891
+ model: FragmentsGroup;
892
+ psetID: number;
893
+ }>;
894
+ readonly onDataChanged: Event<{
895
+ model: FragmentsGroup;
896
+ expressID: number;
897
+ }>;
898
+ wasm: {
899
+ path: string;
900
+ absolute: boolean;
901
+ };
902
+ enabled: boolean;
903
+ attributeListeners: AttributeListener;
904
+ selectedModel?: FragmentsGroup;
905
+ changeMap: ChangeMap;
906
+ constructor(components: Components);
907
+ dispose(): void;
908
+ private increaseMaxID;
909
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
910
+ private newGUID;
911
+ private getOwnerHistory;
912
+ private registerChange;
913
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
914
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
915
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
916
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
917
+ }>;
918
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
919
+ private newSingleProperty;
920
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
921
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
922
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
923
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
924
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
925
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
926
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
927
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
928
+ }
929
+ export {};
973
930
  import * as THREE from "three";
974
931
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
975
932
  export declare class MiniMap implements Resizeable, Updateable, Disposable {
@@ -1004,6 +961,7 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
1004
961
  resize(size?: THREE.Vector2): void;
1005
962
  private updatePlanes;
1006
963
  }
964
+ export declare const GeometryTypes: Set<number>;
1007
965
  import * as WEBIFC from "web-ifc";
1008
966
  import { IfcItemsCategories } from "../../../ifc";
1009
967
  export declare class SpatialStructure {
@@ -1012,6 +970,78 @@ export declare class SpatialStructure {
1012
970
  setUp(webIfc: WEBIFC.IfcAPI): void;
1013
971
  cleanUp(): void;
1014
972
  }
973
+ import * as WEBIFC from "web-ifc";
974
+ export interface IfcItemsCategories {
975
+ [itemID: number]: number;
976
+ }
977
+ export declare class IfcCategories {
978
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
979
+ }
980
+ export declare const IfcElements: {
981
+ [key: number]: string;
982
+ };
983
+ export declare const IfcCategoryMap: {
984
+ [key: number]: string;
985
+ };
986
+ import * as FRAGS from "@thatopen/fragments";
987
+ export declare class IfcPropertiesUtils {
988
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
989
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
990
+ [attribute: string]: any;
991
+ } | null>;
992
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
993
+ [relatingID: number]: number[];
994
+ }>;
995
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
996
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
997
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
998
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
999
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
1000
+ key: string | null;
1001
+ name: string | null;
1002
+ }>;
1003
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
1004
+ key: string | null;
1005
+ value: number | null;
1006
+ }>;
1007
+ static isRel(expressID: number): boolean;
1008
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
1009
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
1010
+ }
1011
+ /**
1012
+ * Simple event handler by
1013
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1014
+ * Keep in mind that:
1015
+ * - If you want to remove it later, you might want to declare the callback as
1016
+ * an object.
1017
+ * - If you want to maintain the reference to 'this', you will need to declare
1018
+ * the callback as an arrow function.
1019
+ */
1020
+ export declare class Event<T> {
1021
+ /**
1022
+ * Add a callback to this event instance.
1023
+ * @param handler - the callback to be added to this event.
1024
+ */
1025
+ add(handler: T extends void ? {
1026
+ (): void;
1027
+ } : {
1028
+ (data: T): void;
1029
+ }): void;
1030
+ /**
1031
+ * Removes a callback from this event instance.
1032
+ * @param handler - the callback to be removed from this event.
1033
+ */
1034
+ remove(handler: T extends void ? {
1035
+ (): void;
1036
+ } : {
1037
+ (data: T): void;
1038
+ }): void;
1039
+ /** Triggers all the callbacks assigned to this event. */
1040
+ trigger: (data?: T) => void;
1041
+ /** Gets rid of all the suscribed events. */
1042
+ reset(): void;
1043
+ private handlers;
1044
+ }
1015
1045
  /**
1016
1046
  * Simple event handler by
1017
1047
  * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
@@ -1046,6 +1076,23 @@ export declare class AsyncEvent<T> {
1046
1076
  reset(): void;
1047
1077
  private handlers;
1048
1078
  }
1079
+ import { Base } from "./base";
1080
+ import { World } from "./world";
1081
+ import { Event } from "./event";
1082
+ import { Components } from "../../Components";
1083
+ /**
1084
+ * One of the elements that make a world. It can be either a scene, a camera
1085
+ * or a renderer.
1086
+ */
1087
+ export declare abstract class BaseWorldItem extends Base {
1088
+ readonly worlds: Map<string, World>;
1089
+ readonly onWorldChanged: Event<{
1090
+ world: World;
1091
+ action: "added" | "removed";
1092
+ }>;
1093
+ currentWorld: World | null;
1094
+ protected constructor(components: Components);
1095
+ }
1049
1096
  import * as THREE from "three";
1050
1097
  import CameraControls from "camera-controls";
1051
1098
  import { Event } from "./event";
@@ -1169,58 +1216,6 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1169
1216
  export interface CameraControllable {
1170
1217
  controls: CameraControls;
1171
1218
  }
1172
- import { Base } from "./base";
1173
- /**
1174
- * Components are the building blocks of this library. Components are singleton
1175
- * elements that contain specific functionality. For instance, the SimpleClipper
1176
- * Component can create, delete and handle 3D clipping planes. Components must be
1177
- * unique (they can't be instanced more than once), and have a static UUID that
1178
- * identifies them uniquely. The can be accessed globally using the {@link Components}
1179
- * instance.
1180
- */
1181
- export declare abstract class Component extends Base {
1182
- /**
1183
- * Whether this component is active or not. The behaviour can vary depending
1184
- * on the type of component. E.g. a disabled dimension tool will stop creating
1185
- * dimensions, while a disabled camera will stop moving. A disabled component
1186
- * will not be updated automatically each frame.
1187
- */
1188
- abstract enabled: boolean;
1189
- }
1190
- /**
1191
- * Simple event handler by
1192
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1193
- * Keep in mind that:
1194
- * - If you want to remove it later, you might want to declare the callback as
1195
- * an object.
1196
- * - If you want to maintain the reference to 'this', you will need to declare
1197
- * the callback as an arrow function.
1198
- */
1199
- export declare class Event<T> {
1200
- /**
1201
- * Add a callback to this event instance.
1202
- * @param handler - the callback to be added to this event.
1203
- */
1204
- add(handler: T extends void ? {
1205
- (): void;
1206
- } : {
1207
- (data: T): void;
1208
- }): void;
1209
- /**
1210
- * Removes a callback from this event instance.
1211
- * @param handler - the callback to be removed from this event.
1212
- */
1213
- remove(handler: T extends void ? {
1214
- (): void;
1215
- } : {
1216
- (data: T): void;
1217
- }): void;
1218
- /** Triggers all the callbacks assigned to this event. */
1219
- trigger: (data?: T) => void;
1220
- /** Gets rid of all the suscribed events. */
1221
- reset(): void;
1222
- private handlers;
1223
- }
1224
1219
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1225
1220
  import { Components } from "../../Components";
1226
1221
  /**
@@ -1240,22 +1235,28 @@ export declare abstract class Base {
1240
1235
  /** Whether is component is {@link Configurable}. */
1241
1236
  isConfigurable: () => this is Configurable<any>;
1242
1237
  }
1238
+ import { InverseAttribute } from "./types";
1239
+ export declare const relToAttributesMap: Map<number, {
1240
+ forRelating: InverseAttribute;
1241
+ forRelated: InverseAttribute;
1242
+ }>;
1243
1243
  import { Base } from "./base";
1244
- import { World } from "./world";
1245
- import { Event } from "./event";
1246
- import { Components } from "../../Components";
1247
1244
  /**
1248
- * One of the elements that make a world. It can be either a scene, a camera
1249
- * or a renderer.
1245
+ * Components are the building blocks of this library. Components are singleton
1246
+ * elements that contain specific functionality. For instance, the SimpleClipper
1247
+ * Component can create, delete and handle 3D clipping planes. Components must be
1248
+ * unique (they can't be instanced more than once), and have a static UUID that
1249
+ * identifies them uniquely. The can be accessed globally using the {@link Components}
1250
+ * instance.
1250
1251
  */
1251
- export declare abstract class BaseWorldItem extends Base {
1252
- readonly worlds: Map<string, World>;
1253
- readonly onWorldChanged: Event<{
1254
- world: World;
1255
- action: "added" | "removed";
1256
- }>;
1257
- currentWorld: World | null;
1258
- protected constructor(components: Components);
1252
+ export declare abstract class Component extends Base {
1253
+ /**
1254
+ * Whether this component is active or not. The behaviour can vary depending
1255
+ * on the type of component. E.g. a disabled dimension tool will stop creating
1256
+ * dimensions, while a disabled camera will stop moving. A disabled component
1257
+ * will not be updated automatically each frame.
1258
+ */
1259
+ abstract enabled: boolean;
1259
1260
  }
1260
1261
  import * as THREE from "three";
1261
1262
  import CameraControls from "camera-controls";
@@ -1335,34 +1336,66 @@ export interface World extends Disposable, Updateable {
1335
1336
  isDisposing: boolean;
1336
1337
  }
1337
1338
  import * as THREE from "three";
1338
- import { BaseScene, Configurable, Event } from "../../Types";
1339
- import { Components } from "../../Components";
1340
- export interface SimpleSceneConfig {
1341
- directionalLight: {
1342
- color: THREE.Color;
1343
- intensity: number;
1344
- position: THREE.Vector3;
1345
- };
1346
- ambientLight: {
1347
- color: THREE.Color;
1348
- intensity: number;
1349
- };
1339
+ import { Disposable, Event } from "../../Types";
1340
+ /**
1341
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1342
+ * to work with tools like the
1343
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1344
+ * been transformed through CSS or doesn't occupy the whole screen.
1345
+ */
1346
+ export declare class Mouse implements Disposable {
1347
+ dom: HTMLCanvasElement;
1348
+ private _event?;
1349
+ private _position;
1350
+ /** {@link Disposable.onDisposed} */
1351
+ readonly onDisposed: Event<unknown>;
1352
+ constructor(dom: HTMLCanvasElement);
1353
+ /**
1354
+ * The real position of the mouse of the Three.js canvas.
1355
+ */
1356
+ get position(): THREE.Vector2;
1357
+ /** {@link Disposable.dispose} */
1358
+ dispose(): void;
1359
+ private getPositionY;
1360
+ private getPositionX;
1361
+ private updateMouseInfo;
1362
+ private setupEvents;
1350
1363
  }
1364
+ import * as THREE from "three";
1365
+ import { Components } from "../../Components";
1366
+ import { Event, World, Disposable } from "../../Types";
1367
+ import { Mouse } from "./mouse";
1351
1368
  /**
1352
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1353
- * objects hierarchically, and easily dispose them when you are finished with it.
1354
- * @noInheritDoc
1369
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1370
+ * that allows to easily get items from the scene using the mouse and touch
1371
+ * events.
1355
1372
  */
1356
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1357
- /** {@link Configurable.isSetup} */
1358
- isSetup: boolean;
1359
- three: THREE.Scene;
1360
- /** {@link Configurable.onSetup} */
1361
- readonly onSetup: Event<SimpleScene>;
1362
- config: Required<SimpleSceneConfig>;
1363
- constructor(components: Components);
1364
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1365
- setup(config?: Partial<SimpleSceneConfig>): void;
1373
+ export declare class SimpleRaycaster implements Disposable {
1374
+ /** {@link Component.enabled} */
1375
+ enabled: boolean;
1376
+ components: Components;
1377
+ /** {@link Disposable.onDisposed} */
1378
+ readonly onDisposed: Event<unknown>;
1379
+ /** The position of the mouse in the screen. */
1380
+ readonly mouse: Mouse;
1381
+ readonly three: THREE.Raycaster;
1382
+ world: World;
1383
+ constructor(components: Components, world: World);
1384
+ /** {@link Disposable.dispose} */
1385
+ dispose(): void;
1386
+ /**
1387
+ * Throws a ray from the camera to the mouse or touch event point and returns
1388
+ * the first item found. This also takes into account the clipping planes
1389
+ * used by the renderer.
1390
+ *
1391
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1392
+ * to query. If not provided, it will query all the meshes stored in
1393
+ * {@link Components.meshes}.
1394
+ */
1395
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1396
+ 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;
1397
+ private intersect;
1398
+ private filterClippingPlanes;
1366
1399
  }
1367
1400
  import * as THREE from "three";
1368
1401
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
@@ -1425,48 +1458,34 @@ export declare class SimpleRenderer extends BaseRenderer {
1425
1458
  private onContextBack;
1426
1459
  }
1427
1460
  import * as THREE from "three";
1428
- import { Hideable, Event, World, Disposable } from "../../Types";
1461
+ import { BaseScene, Configurable, Event } from "../../Types";
1429
1462
  import { Components } from "../../Components";
1430
- export interface GridConfig {
1431
- color: THREE.Color;
1432
- size1: number;
1433
- size2: number;
1434
- distance: number;
1463
+ export interface SimpleSceneConfig {
1464
+ directionalLight: {
1465
+ color: THREE.Color;
1466
+ intensity: number;
1467
+ position: THREE.Vector3;
1468
+ };
1469
+ ambientLight: {
1470
+ color: THREE.Color;
1471
+ intensity: number;
1472
+ };
1435
1473
  }
1436
1474
  /**
1437
- * An infinite grid. Created by
1438
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1439
- * and translated to typescript by
1440
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1475
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1476
+ * objects hierarchically, and easily dispose them when you are finished with it.
1477
+ * @noInheritDoc
1441
1478
  */
1442
- export declare class SimpleGrid implements Hideable, Disposable {
1443
- /** {@link Disposable.onDisposed} */
1444
- readonly onDisposed: Event<unknown>;
1445
- world: World;
1446
- components: Components;
1447
- /** {@link Hideable.visible} */
1448
- get visible(): boolean;
1449
- /** {@link Hideable.visible} */
1450
- set visible(visible: boolean);
1451
- /** The material of the grid. */
1452
- get material(): THREE.ShaderMaterial;
1453
- /**
1454
- * Whether the grid should fade away with distance. Recommended to be true for
1455
- * perspective cameras and false for orthographic cameras.
1456
- */
1457
- get fade(): boolean;
1458
- /**
1459
- * Whether the grid should fade away with distance. Recommended to be true for
1460
- * perspective cameras and false for orthographic cameras.
1461
- */
1462
- set fade(active: boolean);
1463
- readonly three: THREE.Mesh;
1464
- private _fade;
1465
- constructor(components: Components, world: World, config: GridConfig);
1466
- /** {@link Disposable.dispose} */
1467
- dispose(): void;
1468
- private setupEvents;
1469
- private updateZoom;
1479
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1480
+ /** {@link Configurable.isSetup} */
1481
+ isSetup: boolean;
1482
+ three: THREE.Scene;
1483
+ /** {@link Configurable.onSetup} */
1484
+ readonly onSetup: Event<SimpleScene>;
1485
+ config: Required<SimpleSceneConfig>;
1486
+ constructor(components: Components);
1487
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1488
+ setup(config?: Partial<SimpleSceneConfig>): void;
1470
1489
  }
1471
1490
  import * as THREE from "three";
1472
1491
  import CameraControls from "camera-controls";
@@ -1514,186 +1533,49 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
1514
1533
  private setupEvents;
1515
1534
  private static getSubsetOfThree;
1516
1535
  }
1517
- import { NavigationMode } from "./types";
1518
- import { OrthoPerspectiveCamera } from "../index";
1519
- /**
1520
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1521
- * like many BIM tools.
1522
- */
1523
- export declare class PlanMode implements NavigationMode {
1524
- private camera;
1525
- /** {@link NavigationMode.enabled} */
1526
- enabled: boolean;
1527
- /** {@link NavigationMode.id} */
1528
- readonly id = "Plan";
1529
- private mouseAction1?;
1530
- private mouseAction2?;
1531
- private mouseInitialized;
1532
- private readonly defaultAzimuthSpeed;
1533
- private readonly defaultPolarSpeed;
1534
- constructor(camera: OrthoPerspectiveCamera);
1535
- /** {@link NavigationMode.set} */
1536
- set(active: boolean): void;
1537
- }
1538
- import { NavigationMode } from "./types";
1539
- import { OrthoPerspectiveCamera } from "../index";
1540
- /**
1541
- * A {@link NavigationMode} that allows 3D navigation and panning
1542
- * like in many 3D and CAD softwares.
1543
- */
1544
- export declare class OrbitMode implements NavigationMode {
1545
- camera: OrthoPerspectiveCamera;
1546
- /** {@link NavigationMode.enabled} */
1547
- enabled: boolean;
1548
- /** {@link NavigationMode.id} */
1549
- readonly id = "Orbit";
1550
- constructor(camera: OrthoPerspectiveCamera);
1551
- /** {@link NavigationMode.set} */
1552
- set(active: boolean): void;
1553
- private activateOrbitControls;
1554
- }
1555
- import { NavigationMode } from "./types";
1556
- import { OrthoPerspectiveCamera } from "../index";
1557
- /**
1558
- * A {@link NavigationMode} that allows first person navigation,
1559
- * simulating FPS video games.
1560
- */
1561
- export declare class FirstPersonMode implements NavigationMode {
1562
- private camera;
1563
- /** {@link NavigationMode.enabled} */
1564
- enabled: boolean;
1565
- /** {@link NavigationMode.id} */
1566
- readonly id = "FirstPerson";
1567
- constructor(camera: OrthoPerspectiveCamera);
1568
- /** {@link NavigationMode.set} */
1569
- set(active: boolean): void;
1570
- private setupFirstPersonCamera;
1571
- }
1572
1536
  import * as THREE from "three";
1573
- import { CameraProjection } from "./types";
1574
- import { Event } from "../../Types";
1575
- import { OrthoPerspectiveCamera } from "../index";
1576
- /**
1577
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1578
- */
1579
- export declare class ProjectionManager {
1580
- /**
1581
- * Event that fires when the {@link CameraProjection} changes.
1582
- */
1583
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1584
- current: CameraProjection;
1585
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1586
- private _component;
1587
- private _previousDistance;
1588
- /** Match Ortho zoom with Perspective distance when changing projection mode */
1589
- matchOrthoDistanceEnabled: boolean;
1590
- constructor(camera: OrthoPerspectiveCamera);
1591
- /**
1592
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1593
- *
1594
- * @param projection - the new projection to set. If it is the current projection,
1595
- * it will have no effect.
1596
- */
1597
- set(projection: CameraProjection): Promise<void>;
1598
- /**
1599
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
1600
- * and vice versa.
1601
- */
1602
- toggle(): Promise<void>;
1603
- private setOrthoCamera;
1604
- private getPerspectiveDims;
1605
- private setupOrthoCamera;
1606
- private getDistance;
1607
- private setPerspectiveCamera;
1608
- }
1609
- /**
1610
- * The projection system of the camera.
1611
- */
1612
- export type CameraProjection = "Perspective" | "Orthographic";
1613
- /**
1614
- * The extensible list of supported navigation modes.
1615
- */
1616
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1617
- /**
1618
- * An object that determines the behavior of the camera controls
1619
- * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1620
- */
1621
- export interface NavigationMode {
1622
- /** The unique ID of this navigation mode. */
1623
- id: NavModeID;
1624
- /**
1625
- * Enable or disable this navigation mode.
1626
- * When a new navigation mode is enabled, the previous navigation mode
1627
- * must be disabled.
1628
- *
1629
- * @param active - whether to enable or disable this mode.
1630
- * @param options - any additional data required to enable or disable it.
1631
- * */
1632
- set: (active: boolean, options?: any) => void;
1633
- /** Whether this navigation mode is active or not. */
1634
- enabled: boolean;
1537
+ import { Hideable, Event, World, Disposable } from "../../Types";
1538
+ import { Components } from "../../Components";
1539
+ export interface GridConfig {
1540
+ color: THREE.Color;
1541
+ size1: number;
1542
+ size2: number;
1543
+ distance: number;
1635
1544
  }
1636
- import * as THREE from "three";
1637
- import { Disposable, Event } from "../../Types";
1638
1545
  /**
1639
- * A helper to easily get the real position of the mouse in the Three.js canvas
1640
- * to work with tools like the
1641
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1642
- * been transformed through CSS or doesn't occupy the whole screen.
1546
+ * An infinite grid. Created by
1547
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1548
+ * and translated to typescript by
1549
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1643
1550
  */
1644
- export declare class Mouse implements Disposable {
1645
- dom: HTMLCanvasElement;
1646
- private _event?;
1647
- private _position;
1551
+ export declare class SimpleGrid implements Hideable, Disposable {
1648
1552
  /** {@link Disposable.onDisposed} */
1649
1553
  readonly onDisposed: Event<unknown>;
1650
- constructor(dom: HTMLCanvasElement);
1554
+ world: World;
1555
+ components: Components;
1556
+ /** {@link Hideable.visible} */
1557
+ get visible(): boolean;
1558
+ /** {@link Hideable.visible} */
1559
+ set visible(visible: boolean);
1560
+ /** The material of the grid. */
1561
+ get material(): THREE.ShaderMaterial;
1651
1562
  /**
1652
- * The real position of the mouse of the Three.js canvas.
1563
+ * Whether the grid should fade away with distance. Recommended to be true for
1564
+ * perspective cameras and false for orthographic cameras.
1653
1565
  */
1654
- get position(): THREE.Vector2;
1655
- /** {@link Disposable.dispose} */
1656
- dispose(): void;
1657
- private getPositionY;
1658
- private getPositionX;
1659
- private updateMouseInfo;
1660
- private setupEvents;
1661
- }
1662
- import * as THREE from "three";
1663
- import { Components } from "../../Components";
1664
- import { Event, World, Disposable } from "../../Types";
1665
- import { Mouse } from "./mouse";
1666
- /**
1667
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1668
- * that allows to easily get items from the scene using the mouse and touch
1669
- * events.
1670
- */
1671
- export declare class SimpleRaycaster implements Disposable {
1672
- /** {@link Component.enabled} */
1673
- enabled: boolean;
1674
- components: Components;
1675
- /** {@link Disposable.onDisposed} */
1676
- readonly onDisposed: Event<unknown>;
1677
- /** The position of the mouse in the screen. */
1678
- readonly mouse: Mouse;
1679
- readonly three: THREE.Raycaster;
1680
- world: World;
1681
- constructor(components: Components, world: World);
1566
+ get fade(): boolean;
1567
+ /**
1568
+ * Whether the grid should fade away with distance. Recommended to be true for
1569
+ * perspective cameras and false for orthographic cameras.
1570
+ */
1571
+ set fade(active: boolean);
1572
+ readonly three: THREE.Mesh;
1573
+ private _fade;
1574
+ constructor(components: Components, world: World, config: GridConfig);
1682
1575
  /** {@link Disposable.dispose} */
1683
1576
  dispose(): void;
1684
- /**
1685
- * Throws a ray from the camera to the mouse or touch event point and returns
1686
- * the first item found. This also takes into account the clipping planes
1687
- * used by the renderer.
1688
- *
1689
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1690
- * to query. If not provided, it will query all the meshes stored in
1691
- * {@link Components.meshes}.
1692
- */
1693
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1694
- 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;
1695
- private intersect;
1696
- private filterClippingPlanes;
1577
+ private setupEvents;
1578
+ private updateZoom;
1697
1579
  }
1698
1580
  import * as THREE from "three";
1699
1581
  import { Components } from "../../Components";
@@ -1762,7 +1644,6 @@ export declare class CullerRenderer {
1762
1644
  protected decreaseColor(): void;
1763
1645
  private applySettings;
1764
1646
  }
1765
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1766
1647
  import * as THREE from "three";
1767
1648
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1768
1649
  import { Components } from "../../Components";
@@ -1791,6 +1672,59 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1791
1672
  private handleWorkerMessage;
1792
1673
  private getAvailableMaterial;
1793
1674
  }
1675
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1676
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
1677
+ /** Configuration of the IFC-fragment streaming. */
1678
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1679
+ minGeometrySize: number;
1680
+ minAssetsSize: number;
1681
+ }
1682
+ /** Configuration of the IFC-fragment streaming. */
1683
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1684
+ propertiesSize: number;
1685
+ }
1686
+ import * as WEBIFC from "web-ifc";
1687
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1688
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1689
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1690
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1691
+ onPropertiesStreamed: AsyncEvent<{
1692
+ type: number;
1693
+ data: {
1694
+ [id: number]: any;
1695
+ };
1696
+ }>;
1697
+ onProgress: AsyncEvent<number>;
1698
+ onIndicesStreamed: AsyncEvent<number[][]>;
1699
+ /** {@link Disposable.onDisposed} */
1700
+ readonly onDisposed: Event<string>;
1701
+ enabled: boolean;
1702
+ settings: PropertiesStreamingSettings;
1703
+ webIfc: WEBIFC.IfcAPI;
1704
+ dispose(): Promise<void>;
1705
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1706
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1707
+ private readIfcFile;
1708
+ private streamIfcFile;
1709
+ private streamAllProperties;
1710
+ private getIndices;
1711
+ private cleanUp;
1712
+ }
1713
+ export interface StreamedGeometries {
1714
+ [id: number]: {
1715
+ boundingBox: Float32Array;
1716
+ hasHoles: boolean;
1717
+ geometryFile?: string;
1718
+ };
1719
+ }
1720
+ export interface StreamedAsset {
1721
+ id: number;
1722
+ geometries: {
1723
+ geometryID: number;
1724
+ transformation: number[];
1725
+ color: number[];
1726
+ }[];
1727
+ }
1794
1728
  import * as THREE from "three";
1795
1729
  import { Hideable, Disposable, Event, World } from "../../Types";
1796
1730
  import { Components } from "../../Components";
@@ -1853,6 +1787,11 @@ export declare class SimplePlane implements Disposable, Hideable {
1853
1787
  private static newPlaneMesh;
1854
1788
  }
1855
1789
  import * as WEBIFC from "web-ifc";
1790
+ export declare class IfcMetadataReader {
1791
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1792
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1793
+ }
1794
+ import * as WEBIFC from "web-ifc";
1856
1795
  /** Configuration of the IFC-fragment conversion. */
1857
1796
  export declare class IfcFragmentSettings {
1858
1797
  /** Whether to extract the IFC properties into a JSON. */
@@ -1894,72 +1833,124 @@ export declare class CivilReader {
1894
1833
  } | undefined;
1895
1834
  private getCurves;
1896
1835
  }
1897
- import * as WEBIFC from "web-ifc";
1898
- export declare class IfcMetadataReader {
1899
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1900
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1901
- }
1902
- import { IfcFragmentSettings } from "../../IfcLoader/src";
1903
- /** Configuration of the IFC-fragment streaming. */
1904
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1905
- minGeometrySize: number;
1906
- minAssetsSize: number;
1907
- }
1908
- /** Configuration of the IFC-fragment streaming. */
1909
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1910
- propertiesSize: number;
1836
+ import { NavigationMode } from "./types";
1837
+ import { OrthoPerspectiveCamera } from "../index";
1838
+ /**
1839
+ * A {@link NavigationMode} that allows first person navigation,
1840
+ * simulating FPS video games.
1841
+ */
1842
+ export declare class FirstPersonMode implements NavigationMode {
1843
+ private camera;
1844
+ /** {@link NavigationMode.enabled} */
1845
+ enabled: boolean;
1846
+ /** {@link NavigationMode.id} */
1847
+ readonly id = "FirstPerson";
1848
+ constructor(camera: OrthoPerspectiveCamera);
1849
+ /** {@link NavigationMode.set} */
1850
+ set(active: boolean): void;
1851
+ private setupFirstPersonCamera;
1911
1852
  }
1912
- export interface StreamedGeometries {
1913
- [id: number]: {
1914
- boundingBox: Float32Array;
1915
- hasHoles: boolean;
1916
- geometryFile?: string;
1917
- };
1853
+ import { NavigationMode } from "./types";
1854
+ import { OrthoPerspectiveCamera } from "../index";
1855
+ /**
1856
+ * A {@link NavigationMode} that allows 3D navigation and panning
1857
+ * like in many 3D and CAD softwares.
1858
+ */
1859
+ export declare class OrbitMode implements NavigationMode {
1860
+ camera: OrthoPerspectiveCamera;
1861
+ /** {@link NavigationMode.enabled} */
1862
+ enabled: boolean;
1863
+ /** {@link NavigationMode.id} */
1864
+ readonly id = "Orbit";
1865
+ constructor(camera: OrthoPerspectiveCamera);
1866
+ /** {@link NavigationMode.set} */
1867
+ set(active: boolean): void;
1868
+ private activateOrbitControls;
1918
1869
  }
1919
- export interface StreamedAsset {
1920
- id: number;
1921
- geometries: {
1922
- geometryID: number;
1923
- transformation: number[];
1924
- color: number[];
1925
- }[];
1870
+ import { NavigationMode } from "./types";
1871
+ import { OrthoPerspectiveCamera } from "../index";
1872
+ /**
1873
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1874
+ * like many BIM tools.
1875
+ */
1876
+ export declare class PlanMode implements NavigationMode {
1877
+ private camera;
1878
+ /** {@link NavigationMode.enabled} */
1879
+ enabled: boolean;
1880
+ /** {@link NavigationMode.id} */
1881
+ readonly id = "Plan";
1882
+ private mouseAction1?;
1883
+ private mouseAction2?;
1884
+ private mouseInitialized;
1885
+ private readonly defaultAzimuthSpeed;
1886
+ private readonly defaultPolarSpeed;
1887
+ constructor(camera: OrthoPerspectiveCamera);
1888
+ /** {@link NavigationMode.set} */
1889
+ set(active: boolean): void;
1926
1890
  }
1927
- import * as WEBIFC from "web-ifc";
1928
1891
  import * as THREE from "three";
1929
- export declare class Units {
1930
- factor: number;
1931
- complement: number;
1932
- apply(matrix: THREE.Matrix4): void;
1933
- setUp(webIfc: WEBIFC.IfcAPI): void;
1934
- private getLengthUnits;
1935
- private getScaleMatrix;
1892
+ import { CameraProjection } from "./types";
1893
+ import { Event } from "../../Types";
1894
+ import { OrthoPerspectiveCamera } from "../index";
1895
+ /**
1896
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1897
+ */
1898
+ export declare class ProjectionManager {
1899
+ /**
1900
+ * Event that fires when the {@link CameraProjection} changes.
1901
+ */
1902
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1903
+ current: CameraProjection;
1904
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1905
+ private _component;
1906
+ private _previousDistance;
1907
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
1908
+ matchOrthoDistanceEnabled: boolean;
1909
+ constructor(camera: OrthoPerspectiveCamera);
1910
+ /**
1911
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1912
+ *
1913
+ * @param projection - the new projection to set. If it is the current projection,
1914
+ * it will have no effect.
1915
+ */
1916
+ set(projection: CameraProjection): Promise<void>;
1917
+ /**
1918
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
1919
+ * and vice versa.
1920
+ */
1921
+ toggle(): Promise<void>;
1922
+ private setOrthoCamera;
1923
+ private getPerspectiveDims;
1924
+ private setupOrthoCamera;
1925
+ private getDistance;
1926
+ private setPerspectiveCamera;
1936
1927
  }
1937
- import * as WEBIFC from "web-ifc";
1938
- import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1939
- import { PropertiesStreamingSettings } from "./streaming-settings";
1940
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1941
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1942
- onPropertiesStreamed: AsyncEvent<{
1943
- type: number;
1944
- data: {
1945
- [id: number]: any;
1946
- };
1947
- }>;
1948
- onProgress: AsyncEvent<number>;
1949
- onIndicesStreamed: AsyncEvent<number[][]>;
1950
- /** {@link Disposable.onDisposed} */
1951
- readonly onDisposed: Event<string>;
1928
+ /**
1929
+ * The projection system of the camera.
1930
+ */
1931
+ export type CameraProjection = "Perspective" | "Orthographic";
1932
+ /**
1933
+ * The extensible list of supported navigation modes.
1934
+ */
1935
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1936
+ /**
1937
+ * An object that determines the behavior of the camera controls
1938
+ * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1939
+ */
1940
+ export interface NavigationMode {
1941
+ /** The unique ID of this navigation mode. */
1942
+ id: NavModeID;
1943
+ /**
1944
+ * Enable or disable this navigation mode.
1945
+ * When a new navigation mode is enabled, the previous navigation mode
1946
+ * must be disabled.
1947
+ *
1948
+ * @param active - whether to enable or disable this mode.
1949
+ * @param options - any additional data required to enable or disable it.
1950
+ * */
1951
+ set: (active: boolean, options?: any) => void;
1952
+ /** Whether this navigation mode is active or not. */
1952
1953
  enabled: boolean;
1953
- settings: PropertiesStreamingSettings;
1954
- webIfc: WEBIFC.IfcAPI;
1955
- dispose(): Promise<void>;
1956
- streamFromBuffer(data: Uint8Array): Promise<void>;
1957
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1958
- private readIfcFile;
1959
- private streamIfcFile;
1960
- private streamAllProperties;
1961
- private getIndices;
1962
- private cleanUp;
1963
1954
  }
1964
1955
  export type RelationsMap = Map<number, Map<number, number[]>>;
1965
1956
  export interface ModelsRelationMap {
@@ -1985,6 +1976,16 @@ export type InverseAttributes = [
1985
1976
  "ContainsElements"
1986
1977
  ];
1987
1978
  export type InverseAttribute = InverseAttributes[number];
1979
+ import * as WEBIFC from "web-ifc";
1980
+ import * as THREE from "three";
1981
+ export declare class Units {
1982
+ factor: number;
1983
+ complement: number;
1984
+ apply(matrix: THREE.Matrix4): void;
1985
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1986
+ private getLengthUnits;
1987
+ private getScaleMatrix;
1988
+ }
1988
1989
  import { BufferGeometry } from "three";
1989
1990
  import * as THREE from "three";
1990
1991
  export declare class TransformHelper {