@thatopen/components 2.0.5 → 2.0.6

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,488 +1,344 @@
1
1
  declare namespace OBC {
2
- import { Component, Disposable, World, Event } from "../Types";
3
- import { SimpleRaycaster } from "./src";
4
- import { Components } from "../Components";
5
- export declare class Raycasters extends Component implements Disposable {
6
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
2
+ import { Component, Disposable, Event, Components } from "../../core";
3
+ export declare class Exploder extends Component implements Disposable {
4
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
7
5
  enabled: boolean;
8
- list: Map<string, SimpleRaycaster>;
9
- onDisposed: Event<unknown>;
6
+ height: number;
7
+ groupName: string;
8
+ /** {@link Disposable.onDisposed} */
9
+ readonly onDisposed: Event<unknown>;
10
+ list: Set<string>;
10
11
  constructor(components: Components);
11
- get(world: World): SimpleRaycaster;
12
- delete(world: World): void;
13
12
  dispose(): void;
13
+ set(active: boolean): void;
14
14
  }
15
- import { Component, Disposable, World, Event } from "../Types";
16
- import { GridConfig, SimpleGrid } from "./src";
17
- import { Components } from "../Components";
18
- export declare class Grids extends Component implements Disposable {
19
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
20
- list: Map<string, SimpleGrid>;
21
- readonly onDisposed: Event<unknown>;
22
- config: Required<GridConfig>;
15
+ import * as THREE from "three";
16
+ import * as FRAGS from "@thatopen/fragments";
17
+ import { FragmentsGroup } from "@thatopen/fragments";
18
+ import { Component, Components, Disposable, Event } from "../../core";
19
+ /**
20
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
21
+ * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
22
+ */
23
+ export declare class BoundingBoxer extends Component implements Disposable {
24
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
23
25
  /** {@link Component.enabled} */
24
26
  enabled: boolean;
27
+ /** {@link Disposable.onDisposed} */
28
+ readonly onDisposed: Event<unknown>;
29
+ private _absoluteMin;
30
+ private _absoluteMax;
31
+ private _meshes;
25
32
  constructor(components: Components);
26
- create(world: World): SimpleGrid;
27
- delete(world: World): void;
33
+ static getDimensions(bbox: THREE.Box3): {
34
+ width: number;
35
+ height: number;
36
+ depth: number;
37
+ center: THREE.Vector3;
38
+ };
39
+ static newBound(positive: boolean): THREE.Vector3;
40
+ static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
41
+ /** {@link Disposable.dispose} */
28
42
  dispose(): void;
43
+ get(): THREE.Box3;
44
+ getSphere(): THREE.Sphere;
45
+ getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
46
+ reset(): void;
47
+ add(group: FragmentsGroup): void;
48
+ addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
49
+ private static getFragmentBounds;
29
50
  }
30
- import { Component, Disposable, Event } from "../Types";
31
- /**
32
- * The entry point of the Components library.
33
- * It can:
34
- * - Create and access all the components of the library.
35
- * - Update all the updatable components automatically.
36
- * - Dispose all the components, preventing memory leaks.
37
- */
38
- export declare class Components implements Disposable {
39
- static readonly release = "1.4.21";
40
- /** {@link Disposable.onDisposed} */
41
- readonly onDisposed: Event<void>;
42
- /** The list of components created in this app. */
43
- readonly list: Map<string, Component>;
44
- /** If disabled, the animation loop will be stopped. */
51
+ import * as THREE from "three";
52
+ import * as FRAGS from "@thatopen/fragments";
53
+ import { Disposable, Component, Event, Components } from "../../core";
54
+ export interface Classification {
55
+ [system: string]: {
56
+ [className: string]: FRAGS.FragmentIdMap;
57
+ };
58
+ }
59
+ export declare class Classifier extends Component implements Disposable {
60
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
61
+ /** {@link Component.enabled} */
45
62
  enabled: boolean;
46
- private _clock;
47
- add(uuid: string, instance: Component): void;
48
- /**
49
- * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
50
- * doesn't exist, it will instance it automatically.
51
- *
52
- * @param Component - The component to get or create.
53
- */
54
- get<U extends Component>(Component: new (components: Components) => U): U;
55
- constructor();
56
- /**
57
- * Initializes the library. It should be called at the start of the app after
58
- * initializing the scene, the renderer and the
59
- * camera. Additionally, if any component that need a raycaster is
60
- * used, the {@link raycaster} will need to be initialized.
61
- */
62
- init(): void;
63
- /**
64
- * Disposes the memory of all the components and tools of this instance of
65
- * the library. A memory leak will be created if:
66
- *
67
- * - An instance of the library ends up out of scope and this function isn't
68
- * called. This is especially relevant in Single Page Applications (React,
69
- * Angular, Vue, etc).
70
- *
71
- * - Any of the objects of this instance (meshes, geometries, etc) is
72
- * referenced by a reference type (object or array).
73
- *
74
- * You can learn more about how Three.js handles memory leaks
75
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
76
- *
77
- */
63
+ list: Classification;
64
+ /** {@link Disposable.onDisposed} */
65
+ readonly onDisposed: Event<unknown>;
66
+ constructor(components: Components);
67
+ private onFragmentsDisposed;
78
68
  dispose(): void;
79
- private update;
80
- private static setupBVH;
69
+ remove(guid: string): void;
70
+ find(filter?: {
71
+ [name: string]: string[];
72
+ }): FRAGS.FragmentIdMap;
73
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
74
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
75
+ byEntity(group: FRAGS.FragmentsGroup): void;
76
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
77
+ bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
78
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
79
+ resetColor(items: FRAGS.FragmentIdMap): void;
80
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
81
81
  }
82
- import { MiniMap } from "./src";
83
- import { Component, Updateable, World, Event, Disposable } from "../Types";
84
- import { Components } from "../Components";
85
- export declare class MiniMaps extends Component implements Updateable, Disposable {
86
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
87
- readonly onAfterUpdate: Event<unknown>;
88
- readonly onBeforeUpdate: Event<unknown>;
89
- readonly onDisposed: Event<unknown>;
82
+ import * as FRAGS from "@thatopen/fragments";
83
+ import { Components, Component } from "../../core";
84
+ export declare class Hider extends Component {
85
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
90
86
  enabled: boolean;
91
- list: Map<string, MiniMap>;
92
87
  constructor(components: Components);
93
- create(world: World): MiniMap;
94
- delete(id: string): void;
95
- dispose(): void;
96
- update(): void;
88
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
89
+ isolate(items: FRAGS.FragmentIdMap): void;
90
+ private updateCulledVisibility;
97
91
  }
98
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
99
- import { Components } from "../Components";
100
- import { SimpleWorld } from "./src";
101
- export declare class Worlds extends Component implements Updateable, Disposable {
102
- /**
103
- * A unique identifier for the component.
104
- * This UUID is used to register the component within the Components system.
105
- */
106
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
107
- /**
108
- * Event triggered after the update process of all worlds.
109
- * Subscribers can listen to this event to perform actions post-update.
110
- */
111
- readonly onAfterUpdate: Event<unknown>;
112
- /**
113
- * Event triggered before the update process of all worlds.
114
- * Subscribers can listen to this event to perform actions pre-update.
115
- */
116
- readonly onBeforeUpdate: Event<unknown>;
117
- /**
118
- * Event triggered when the Worlds component is disposed.
119
- * Subscribers can listen to this event to perform cleanup actions.
120
- */
92
+ import * as WEBIFC from "web-ifc";
93
+ import { Components, Disposable, Event, Component } from "../../core";
94
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
95
+ export declare class IfcGeometryTiler extends Component implements Disposable {
96
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
97
+ onGeometryStreamed: Event<{
98
+ buffer: Uint8Array;
99
+ data: StreamedGeometries;
100
+ }>;
101
+ onAssetStreamed: Event<StreamedAsset[]>;
102
+ onProgress: Event<number>;
103
+ onIfcLoaded: Event<Uint8Array>;
104
+ /** {@link Disposable.onDisposed} */
121
105
  readonly onDisposed: Event<unknown>;
122
- readonly onWorldCreated: Event<World>;
123
- readonly onWorldDeleted: Event<string>;
124
- /**
125
- * A collection of worlds managed by this component.
126
- * The key is the unique identifier (UUID) of the world, and the value is the World instance.
127
- */
128
- list: Map<string, World>;
129
- /**
130
- * A flag indicating whether the Worlds component is enabled.
131
- * If false, the update process will be skipped.
132
- */
106
+ settings: IfcStreamingSettings;
133
107
  enabled: boolean;
108
+ webIfc: WEBIFC.IfcAPI;
109
+ private _spatialTree;
110
+ private _metaData;
111
+ private _visitedGeometries;
112
+ private _streamSerializer;
113
+ private _geometries;
114
+ private _geometryCount;
115
+ private _civil;
116
+ private _groupSerializer;
117
+ private _assets;
118
+ private _meshesWithHoles;
134
119
  constructor(components: Components);
135
- /**
136
- * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
137
- *
138
- * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
139
- * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
140
- * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
141
- *
142
- * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
143
- */
144
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
145
- delete(world: World): void;
146
120
  dispose(): void;
147
- update(delta?: number): void | Promise<void>;
121
+ streamFromBuffer(data: Uint8Array): Promise<void>;
122
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
123
+ private readIfcFile;
124
+ private streamIfcFile;
125
+ private streamAllGeometries;
126
+ private cleanUp;
127
+ private getMesh;
128
+ private getGeometry;
129
+ private streamAssets;
130
+ private streamGeometries;
148
131
  }
132
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
149
133
  import * as THREE from "three";
150
- import { Components } from "../Components";
151
- import { SimpleCamera } from "..";
152
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
134
+ import * as FRAGS from "@thatopen/fragments";
135
+ import { Component, Components, Event, Disposable } from "../../core";
136
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
153
137
  /**
154
- * A flexible camera that uses
155
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
156
- * easily control the camera in 2D and 3D. It supports multiple navigation
157
- * modes, such as 2D floor plan navigation, first person and 3D orbit.
138
+ * Object that can efficiently load binary files that contain
139
+ * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
158
140
  */
159
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
160
- /**
161
- * The current {@link NavigationMode}.
162
- */
163
- _mode: NavigationMode | null;
164
- readonly projection: ProjectionManager;
165
- readonly threeOrtho: THREE.OrthographicCamera;
166
- readonly threePersp: THREE.PerspectiveCamera;
167
- protected readonly _userInputButtons: any;
168
- protected readonly _frustumSize = 50;
169
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
170
- private previousSize;
171
- get mode(): NavigationMode;
141
+ export declare class FragmentsManager extends Component implements Disposable {
142
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
143
+ /** {@link Disposable.onDisposed} */
144
+ readonly onDisposed: Event<unknown>;
145
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
146
+ readonly onFragmentsDisposed: Event<{
147
+ groupID: string;
148
+ fragmentIDs: string[];
149
+ }>;
150
+ /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
151
+ readonly list: Map<string, Fragment>;
152
+ readonly groups: Map<string, FragmentsGroup>;
153
+ /** {@link Component.enabled} */
154
+ enabled: boolean;
155
+ baseCoordinationModel: string;
156
+ private _loader;
157
+ /** The list of meshes of the created fragments. */
158
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
172
159
  constructor(components: Components);
173
160
  /** {@link Disposable.dispose} */
174
161
  dispose(): void;
162
+ disposeGroup(group: FragmentsGroup): void;
175
163
  /**
176
- * Sets a new {@link NavigationMode} and disables the previous one.
177
- *
178
- * @param mode - The {@link NavigationMode} to set.
179
- */
180
- set(mode: NavModeID): void;
181
- /**
182
- * Make the camera view fit all the specified meshes.
183
- *
184
- * @param meshes the meshes to fit. If it is not defined, it will
185
- * evaluate {@link Components.meshes}.
186
- * @param offset the distance to the fit object
164
+ * Loads a binar file that contain fragment geometry.
165
+ * @param data - The binary data to load.
166
+ * @param config - Optional configuration for loading.
167
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
168
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
169
+ * @returns The loaded FragmentsGroup.
187
170
  */
188
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
171
+ load(data: Uint8Array, config?: Partial<{
172
+ coordinate: boolean;
173
+ name: string;
174
+ properties: FRAGS.IfcProperties;
175
+ relationsMap: RelationsMap;
176
+ }>): FragmentsGroup;
189
177
  /**
190
- * Allows or prevents all user input.
191
- *
192
- * @param active - whether to enable or disable user inputs.
178
+ * Export the specified fragments.
179
+ * @param group - the fragments group to be exported.
180
+ * @returns the exported data as binary buffer.
193
181
  */
194
- setUserInput(active: boolean): void;
195
- private disableUserInput;
196
- private enableUserInput;
197
- private newOrthoCamera;
198
- private setOrthoPerspCameraAspect;
182
+ export(group: FragmentsGroup): Uint8Array;
183
+ coordinate(models?: FragmentsGroup[]): void;
199
184
  }
200
- import * as THREE from "three";
201
- import { Components } from "../Components";
202
- import { Component } from "../Types";
185
+ import * as WEBIFC from "web-ifc";
186
+ import * as FRAGS from "@thatopen/fragments";
187
+ import { IfcFragmentSettings } from "./src";
188
+ import { Component, Components, Event, Disposable } from "../../core";
189
+ export declare class IfcLoader extends Component implements Disposable {
190
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
191
+ readonly onIfcStartedLoading: Event<void>;
192
+ readonly onSetup: Event<void>;
193
+ /** {@link Disposable.onDisposed} */
194
+ readonly onDisposed: Event<string>;
195
+ settings: IfcFragmentSettings;
196
+ enabled: boolean;
197
+ webIfc: WEBIFC.IfcAPI;
198
+ private _material;
199
+ private _spatialTree;
200
+ private _metaData;
201
+ private _fragmentInstances;
202
+ private _civil;
203
+ private _visitedFragments;
204
+ private _materialT;
205
+ constructor(components: Components);
206
+ dispose(): void;
207
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
208
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
209
+ readIfcFile(data: Uint8Array): Promise<number>;
210
+ private getAllGeometries;
211
+ cleanUp(): void;
212
+ private getMesh;
213
+ private getGeometry;
214
+ private autoSetWasm;
215
+ }
216
+ import * as WEBIFC from "web-ifc";
217
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
218
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
219
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
220
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
221
+ onPropertiesStreamed: AsyncEvent<{
222
+ type: number;
223
+ data: {
224
+ [id: number]: any;
225
+ };
226
+ }>;
227
+ onProgress: AsyncEvent<number>;
228
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
229
+ /** {@link Disposable.onDisposed} */
230
+ readonly onDisposed: Event<string>;
231
+ enabled: boolean;
232
+ settings: PropertiesStreamingSettings;
233
+ webIfc: WEBIFC.IfcAPI;
234
+ dispose(): Promise<void>;
235
+ streamFromBuffer(data: Uint8Array): Promise<void>;
236
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
237
+ private readIfcFile;
238
+ private streamIfcFile;
239
+ private streamAllProperties;
240
+ private cleanUp;
241
+ }
242
+ import * as WEBIFC from "web-ifc";
243
+ import * as FRAG from "@thatopen/fragments";
244
+ import { Component, Components } from "../../core";
203
245
  /**
204
- * A tool to safely remove meshes and geometries from memory to
205
- * [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
246
+ * Object to export all the properties from an IFC to a JS object.
206
247
  */
207
- export declare class Disposer extends Component {
208
- private _disposedComponents;
248
+ export declare class IfcJsonExporter extends Component {
249
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
209
250
  /** {@link Component.enabled} */
210
251
  enabled: boolean;
211
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
212
252
  constructor(components: Components);
213
253
  /**
214
- * {@link Component.uuid}.
215
- * @return the list of UUIDs of deleted components.
216
- */
217
- get(): Set<string>;
218
- /**
219
- * Removes a mesh, its geometry and its materials from memory. If you are
220
- * using any of these in other parts of the application, make sure that you
221
- * remove them from the mesh before disposing it.
222
- *
223
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
224
- * to remove.
225
- *
226
- * @param materials - whether to dispose the materials of the mesh.
227
- *
228
- * @param recursive - whether to recursively dispose the children of the mesh.
229
- */
230
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
231
- /**
232
- * Disposes a geometry from memory.
233
- *
234
- * @param geometry - the
235
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
236
- * to remove.
254
+ * Exports all the properties of an IFC into an array of JS objects.
255
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
256
+ * @param modelID ID of the IFC model whose properties to extract.
257
+ * @param indirect whether to get the indirect relationships as well.
258
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
259
+ * to make the location data available (e.g. absolute position of building).
237
260
  */
238
- disposeGeometry(geometry: THREE.BufferGeometry): void;
239
- private disposeGeometryAndMaterials;
240
- private disposeChildren;
241
- private static disposeMaterial;
261
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
242
262
  }
243
- import { Components } from "../Components";
244
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
245
- import { Component, Event, Disposable, World } from "../Types";
263
+ import * as WEBIFC from "web-ifc";
264
+ import { FragmentsGroup } from "@thatopen/fragments";
265
+ import { Component, Disposable, Event, Components } from "../../core";
266
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
267
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
268
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
269
+ interface ChangeMap {
270
+ [modelID: string]: Set<number>;
271
+ }
272
+ interface AttributeListener {
273
+ [modelID: string]: {
274
+ [expressID: number]: {
275
+ [attributeName: string]: Event<String | Boolean | Number>;
276
+ };
277
+ };
278
+ }
279
+ export declare class IfcPropertiesManager extends Component implements Disposable {
280
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
281
+ /** {@link Disposable.onDisposed} */
282
+ readonly onDisposed: Event<string>;
283
+ readonly onRequestFile: Event<unknown>;
284
+ ifcToExport: ArrayBuffer | null;
285
+ readonly onElementToPset: Event<{
286
+ model: FragmentsGroup;
287
+ psetID: number;
288
+ elementID: number;
289
+ }>;
290
+ readonly onPropToPset: Event<{
291
+ model: FragmentsGroup;
292
+ psetID: number;
293
+ propID: number;
294
+ }>;
295
+ readonly onPsetRemoved: Event<{
296
+ model: FragmentsGroup;
297
+ psetID: number;
298
+ }>;
299
+ readonly onDataChanged: Event<{
300
+ model: FragmentsGroup;
301
+ expressID: number;
302
+ }>;
303
+ wasm: {
304
+ path: string;
305
+ absolute: boolean;
306
+ };
307
+ enabled: boolean;
308
+ attributeListeners: AttributeListener;
309
+ selectedModel?: FragmentsGroup;
310
+ changeMap: ChangeMap;
311
+ constructor(components: Components);
312
+ dispose(): void;
313
+ private increaseMaxID;
314
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
315
+ private newGUID;
316
+ private getOwnerHistory;
317
+ private registerChange;
318
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
319
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
320
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
321
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
322
+ }>;
323
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
324
+ private newSingleProperty;
325
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
326
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
327
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
328
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
329
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
330
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
331
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
332
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
333
+ }
334
+ export {};
335
+ import * as WEBIFC from "web-ifc";
336
+ import { FragmentsGroup } from "@thatopen/fragments";
337
+ import { Disposable, Event, Component, Components } from "../../core";
338
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
246
339
  /**
247
- * A tool to handle big scenes efficiently by automatically hiding the objects
248
- * that are not visible to the camera.
249
- */
250
- export declare class Cullers extends Component implements Disposable {
251
- /**
252
- * A unique identifier for the Cullers component.
253
- */
254
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
255
- /**
256
- * Indicates whether the Cullers component is enabled.
257
- */
258
- private _enabled;
259
- /**
260
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
261
- */
262
- list: Map<string, MeshCullerRenderer>;
263
- /**
264
- * An event that is triggered when the Cullers component is disposed.
265
- */
266
- readonly onDisposed: Event<unknown>;
267
- /**
268
- * Gets the enabled state of the Cullers component.
269
- *
270
- * @returns The current enabled state.
271
- */
272
- get enabled(): boolean;
273
- /**
274
- * Sets the enabled state of the Cullers component.
275
- * Also sets the enabled state of all MeshCullerRenderer instances.
276
- *
277
- * @param value - The new enabled state.
278
- */
279
- set enabled(value: boolean);
280
- constructor(components: Components);
281
- /**
282
- * Creates a new MeshCullerRenderer for the given world.
283
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
284
- *
285
- * @param world - The world for which to create the MeshCullerRenderer.
286
- * @param config - Optional configuration settings for the MeshCullerRenderer.
287
- *
288
- * @returns The newly created or existing MeshCullerRenderer for the given world.
289
- */
290
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
291
- delete(world: World): void;
292
- /** {@link Disposable.dispose} */
293
- dispose(): void;
294
- }
295
- import * as THREE from "three";
296
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
297
- center: THREE.Vector3;
298
- halfSizes: THREE.Vector3;
299
- rotation: THREE.Matrix3;
300
- transformation: THREE.Matrix4;
301
- };
302
- import * as THREE from "three";
303
- import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
304
- import { SimplePlane } from "./src";
305
- import { Components } from "../Components";
306
- /**
307
- * A lightweight component to easily create and handle
308
- * [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
309
- *
310
- * @param components - the instance of {@link Components} used.
311
- * E.g. {@link SimplePlane}.
312
- */
313
- export declare class Clipper extends Component implements Createable, Disposable, Hideable {
314
- static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
315
- /** {@link Createable.onAfterCreate} */
316
- readonly onAfterCreate: Event<SimplePlane>;
317
- /** {@link Createable.onAfterDelete} */
318
- readonly onAfterDelete: Event<SimplePlane>;
319
- /** Event that fires when the user starts dragging a clipping plane. */
320
- readonly onBeforeDrag: Event<void>;
321
- /** Event that fires when the user stops dragging a clipping plane. */
322
- readonly onAfterDrag: Event<void>;
323
- readonly onBeforeCreate: Event<unknown>;
324
- readonly onBeforeCancel: Event<unknown>;
325
- readonly onAfterCancel: Event<unknown>;
326
- readonly onBeforeDelete: Event<unknown>;
327
- /** {@link Disposable.onDisposed} */
328
- readonly onDisposed: Event<string>;
329
- /**
330
- * Whether to force the clipping plane to be orthogonal in the Y direction
331
- * (up). This is desirable when clipping a building horizontally and a
332
- * clipping plane is created in its roof, which might have a slight
333
- * slope for draining purposes.
334
- */
335
- orthogonalY: boolean;
336
- /**
337
- * The tolerance that determines whether an almost-horizontal clipping plane
338
- * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
339
- * has to be 'true' for this to apply.
340
- */
341
- toleranceOrthogonalY: number;
342
- Type: new (...args: any) => SimplePlane;
343
- list: SimplePlane[];
344
- /** The material used in all the clipping planes. */
345
- private _material;
346
- private _size;
347
- private _enabled;
348
- private _visible;
349
- /** {@link Component.enabled} */
350
- get enabled(): boolean;
351
- /** {@link Component.enabled} */
352
- set enabled(state: boolean);
353
- /** {@link Hideable.visible } */
354
- get visible(): boolean;
355
- /** {@link Hideable.visible } */
356
- set visible(state: boolean);
357
- /** The material of the clipping plane representation. */
358
- get material(): THREE.MeshBasicMaterial;
359
- /** The material of the clipping plane representation. */
360
- set material(material: THREE.MeshBasicMaterial);
361
- /** The size of the geometric representation of the clippings planes. */
362
- get size(): number;
363
- /** The size of the geometric representation of the clippings planes. */
364
- set size(size: number);
365
- constructor(components: Components);
366
- /** {@link Disposable.dispose} */
367
- dispose(): void;
368
- /** {@link Createable.create} */
369
- create(world: World): void;
370
- /**
371
- * Creates a plane in a certain place and with a certain orientation,
372
- * without the need of the mouse.
373
- *
374
- * @param world - the world where this plane should be created.
375
- * @param normal - the orientation of the clipping plane.
376
- * @param point - the position of the clipping plane.
377
- * navigation.
378
- */
379
- createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
380
- /**
381
- * {@link Createable.delete}
382
- *
383
- * @param world - the world where the plane to delete is.
384
- * @param plane - the plane to delete. If undefined, the first plane
385
- * found under the cursor will be deleted.
386
- */
387
- delete(world: World, plane?: SimplePlane): void;
388
- /** Deletes all the existing clipping planes. */
389
- deleteAll(): void;
390
- private deletePlane;
391
- private pickPlane;
392
- private getAllPlaneMeshes;
393
- private createPlaneFromIntersection;
394
- private getWorldNormal;
395
- private normalizePlaneDirectionY;
396
- private newPlane;
397
- private updateMaterialsAndPlanes;
398
- private _onStartDragging;
399
- private _onEndDragging;
400
- }
401
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
402
- import * as THREE from "three";
403
- export declare class MaterialsUtils {
404
- static isTransparent(material: THREE.Material): boolean;
405
- }
406
- import * as THREE from "three";
407
- import { Component, Components, Event, World } from "../core";
408
- export interface VertexPickerConfig {
409
- showOnlyVertex: boolean;
410
- snapDistance: number;
411
- previewElement: HTMLElement;
412
- }
413
- export declare class VertexPicker extends Component {
414
- onVertexFound: Event<THREE.Vector3>;
415
- onVertexLost: Event<THREE.Vector3>;
416
- components: Components;
417
- private _pickedPoint;
418
- private _config;
419
- private _enabled;
420
- private _workingPlane;
421
- set enabled(value: boolean);
422
- get enabled(): boolean;
423
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
424
- set workingPlane(plane: THREE.Plane | null);
425
- get workingPlane(): THREE.Plane | null;
426
- set config(value: Partial<VertexPickerConfig>);
427
- get config(): Partial<VertexPickerConfig>;
428
- dispose(): void;
429
- get(world: World): THREE.Vector3 | null;
430
- private getClosestVertex;
431
- private getVertices;
432
- private getVertex;
433
- }
434
- import * as THREE from "three";
435
- import { Component, Components } from "../../core";
436
- export interface MeasureEdge {
437
- distance: number;
438
- points: THREE.Vector3[];
439
- }
440
- export declare class MeasurementUtils extends Component {
441
- enabled: boolean;
442
- static uuid: string;
443
- constructor(components: Components);
444
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
445
- edges: MeasureEdge[];
446
- indices: Set<number>;
447
- } | null;
448
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
449
- private getFaceData;
450
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
451
- p1: THREE.Vector3;
452
- p2: THREE.Vector3;
453
- p3: THREE.Vector3;
454
- faceNormal: THREE.Vector3;
455
- };
456
- private round;
457
- }
458
- import * as WEBIFC from "web-ifc";
459
- import * as FRAG from "@thatopen/fragments";
460
- import { Component, Components } from "../../core";
461
- /**
462
- * Object to export all the properties from an IFC to a JS object.
463
- */
464
- export declare class IfcJsonExporter extends Component {
465
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
466
- /** {@link Component.enabled} */
467
- enabled: boolean;
468
- constructor(components: Components);
469
- /**
470
- * Exports all the properties of an IFC into an array of JS objects.
471
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
472
- * @param modelID ID of the IFC model whose properties to extract.
473
- * @param indirect whether to get the indirect relationships as well.
474
- * @param recursiveSpatial whether to get the properties of spatial items recursively
475
- * to make the location data available (e.g. absolute position of building).
476
- */
477
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
478
- }
479
- import * as WEBIFC from "web-ifc";
480
- import { FragmentsGroup } from "@thatopen/fragments";
481
- import { Disposable, Event, Component, Components } from "../../core";
482
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
483
- /**
484
- * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
485
- * 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.
340
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
341
+ * 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.
486
342
  */
487
343
  export declare class IfcRelationsIndexer extends Component implements Disposable {
488
344
  static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
@@ -607,305 +463,478 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
607
463
  */
608
464
  dispose(): void;
609
465
  }
610
- export type { InverseAttribute } from "./src/types";
611
- import * as WEBIFC from "web-ifc";
612
- import { FragmentsGroup } from "@thatopen/fragments";
613
- import { Component, Disposable, Event, Components } from "../../core";
614
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
615
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
616
- type NumericPropTypes = "IfcInteger" | "IfcReal";
617
- interface ChangeMap {
618
- [modelID: string]: Set<number>;
619
- }
620
- interface AttributeListener {
621
- [modelID: string]: {
622
- [expressID: number]: {
623
- [attributeName: string]: Event<String | Boolean | Number>;
624
- };
625
- };
626
- }
627
- export declare class IfcPropertiesManager extends Component implements Disposable {
628
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
629
- /** {@link Disposable.onDisposed} */
630
- readonly onDisposed: Event<string>;
631
- readonly onRequestFile: Event<unknown>;
632
- ifcToExport: ArrayBuffer | null;
633
- readonly onElementToPset: Event<{
634
- model: FragmentsGroup;
635
- psetID: number;
636
- elementID: number;
637
- }>;
638
- readonly onPropToPset: Event<{
639
- model: FragmentsGroup;
640
- psetID: number;
641
- propID: number;
642
- }>;
643
- readonly onPsetRemoved: Event<{
644
- model: FragmentsGroup;
645
- psetID: number;
646
- }>;
647
- readonly onDataChanged: Event<{
648
- model: FragmentsGroup;
649
- expressID: number;
650
- }>;
651
- wasm: {
652
- path: string;
653
- absolute: boolean;
466
+ export type { InverseAttribute, RelationsMap } from "./src/types";
467
+ import { Component, Disposable, Event } from "../Types";
468
+ /**
469
+ * The entry point of the Components library.
470
+ * It can:
471
+ * - Create and access all the components of the library.
472
+ * - Update all the updatable components automatically.
473
+ * - Dispose all the components, preventing memory leaks.
474
+ */
475
+ export declare class Components implements Disposable {
476
+ static readonly release = "1.4.21";
477
+ /** {@link Disposable.onDisposed} */
478
+ readonly onDisposed: Event<void>;
479
+ /** The list of components created in this app. */
480
+ readonly list: Map<string, Component>;
481
+ /** If disabled, the animation loop will be stopped. */
482
+ enabled: boolean;
483
+ private _clock;
484
+ add(uuid: string, instance: Component): void;
485
+ /**
486
+ * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
487
+ * doesn't exist, it will instance it automatically.
488
+ *
489
+ * @param Component - The component to get or create.
490
+ */
491
+ get<U extends Component>(Component: new (components: Components) => U): U;
492
+ constructor();
493
+ /**
494
+ * Initializes the library. It should be called at the start of the app after
495
+ * initializing the scene, the renderer and the
496
+ * camera. Additionally, if any component that need a raycaster is
497
+ * used, the {@link raycaster} will need to be initialized.
498
+ */
499
+ init(): void;
500
+ /**
501
+ * Disposes the memory of all the components and tools of this instance of
502
+ * the library. A memory leak will be created if:
503
+ *
504
+ * - An instance of the library ends up out of scope and this function isn't
505
+ * called. This is especially relevant in Single Page Applications (React,
506
+ * Angular, Vue, etc).
507
+ *
508
+ * - Any of the objects of this instance (meshes, geometries, etc) is
509
+ * referenced by a reference type (object or array).
510
+ *
511
+ * You can learn more about how Three.js handles memory leaks
512
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
513
+ *
514
+ */
515
+ dispose(): void;
516
+ private update;
517
+ private static setupBVH;
518
+ }
519
+ import * as THREE from "three";
520
+ import { Component, Components } from "../../core";
521
+ export interface MeasureEdge {
522
+ distance: number;
523
+ points: THREE.Vector3[];
524
+ }
525
+ export declare class MeasurementUtils extends Component {
526
+ enabled: boolean;
527
+ static uuid: string;
528
+ constructor(components: Components);
529
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
530
+ edges: MeasureEdge[];
531
+ indices: Set<number>;
532
+ } | null;
533
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
534
+ private getFaceData;
535
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
536
+ p1: THREE.Vector3;
537
+ p2: THREE.Vector3;
538
+ p3: THREE.Vector3;
539
+ faceNormal: THREE.Vector3;
654
540
  };
541
+ private round;
542
+ }
543
+ import * as THREE from "three";
544
+ import { Components } from "../Components";
545
+ import { Component } from "../Types";
546
+ /**
547
+ * A tool to safely remove meshes and geometries from memory to
548
+ * [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
549
+ */
550
+ export declare class Disposer extends Component {
551
+ private _disposedComponents;
552
+ /** {@link Component.enabled} */
655
553
  enabled: boolean;
656
- attributeListeners: AttributeListener;
657
- selectedModel?: FragmentsGroup;
658
- changeMap: ChangeMap;
554
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
659
555
  constructor(components: Components);
556
+ /**
557
+ * {@link Component.uuid}.
558
+ * @return the list of UUIDs of deleted components.
559
+ */
560
+ get(): Set<string>;
561
+ /**
562
+ * Removes a mesh, its geometry and its materials from memory. If you are
563
+ * using any of these in other parts of the application, make sure that you
564
+ * remove them from the mesh before disposing it.
565
+ *
566
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
567
+ * to remove.
568
+ *
569
+ * @param materials - whether to dispose the materials of the mesh.
570
+ *
571
+ * @param recursive - whether to recursively dispose the children of the mesh.
572
+ */
573
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
574
+ /**
575
+ * Disposes a geometry from memory.
576
+ *
577
+ * @param geometry - the
578
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
579
+ * to remove.
580
+ */
581
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
582
+ private disposeGeometryAndMaterials;
583
+ private disposeChildren;
584
+ private static disposeMaterial;
585
+ }
586
+ import { Component, Disposable, World, Event } from "../Types";
587
+ import { SimpleRaycaster } from "./src";
588
+ import { Components } from "../Components";
589
+ export declare class Raycasters extends Component implements Disposable {
590
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
591
+ enabled: boolean;
592
+ list: Map<string, SimpleRaycaster>;
593
+ onDisposed: Event<unknown>;
594
+ constructor(components: Components);
595
+ get(world: World): SimpleRaycaster;
596
+ delete(world: World): void;
660
597
  dispose(): void;
661
- private increaseMaxID;
662
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
663
- private newGUID;
664
- private getOwnerHistory;
665
- private registerChange;
666
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
667
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
668
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
669
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
670
- }>;
671
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
672
- private newSingleProperty;
673
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
674
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
675
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
676
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
677
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
678
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
679
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
680
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
681
598
  }
682
- export {};
599
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
600
+ import { Components } from "../Components";
601
+ import { SimpleWorld } from "./src";
602
+ export declare class Worlds extends Component implements Updateable, Disposable {
603
+ /**
604
+ * A unique identifier for the component.
605
+ * This UUID is used to register the component within the Components system.
606
+ */
607
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
608
+ /**
609
+ * Event triggered after the update process of all worlds.
610
+ * Subscribers can listen to this event to perform actions post-update.
611
+ */
612
+ readonly onAfterUpdate: Event<unknown>;
613
+ /**
614
+ * Event triggered before the update process of all worlds.
615
+ * Subscribers can listen to this event to perform actions pre-update.
616
+ */
617
+ readonly onBeforeUpdate: Event<unknown>;
618
+ /**
619
+ * Event triggered when the Worlds component is disposed.
620
+ * Subscribers can listen to this event to perform cleanup actions.
621
+ */
622
+ readonly onDisposed: Event<unknown>;
623
+ readonly onWorldCreated: Event<World>;
624
+ readonly onWorldDeleted: Event<string>;
625
+ /**
626
+ * A collection of worlds managed by this component.
627
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
628
+ */
629
+ list: Map<string, World>;
630
+ /**
631
+ * A flag indicating whether the Worlds component is enabled.
632
+ * If false, the update process will be skipped.
633
+ */
634
+ enabled: boolean;
635
+ constructor(components: Components);
636
+ /**
637
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
638
+ *
639
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
640
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
641
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
642
+ *
643
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
644
+ */
645
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
646
+ delete(world: World): void;
647
+ dispose(): void;
648
+ update(delta?: number): void | Promise<void>;
649
+ }
650
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
683
651
  import * as THREE from "three";
684
- import * as FRAGS from "@thatopen/fragments";
685
- import { FragmentsGroup } from "@thatopen/fragments";
686
- import { Component, Components, Disposable, Event } from "../../core";
652
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
653
+ center: THREE.Vector3;
654
+ halfSizes: THREE.Vector3;
655
+ rotation: THREE.Matrix3;
656
+ transformation: THREE.Matrix4;
657
+ };
658
+ import * as THREE from "three";
659
+ export declare class MaterialsUtils {
660
+ static isTransparent(material: THREE.Material): boolean;
661
+ }
662
+ export declare class UUID {
663
+ private static _pattern;
664
+ private static _lut;
665
+ static create(): string;
666
+ static validate(uuid: string): void;
667
+ }
668
+ import { Component, Disposable, World, Event } from "../Types";
669
+ import { GridConfig, SimpleGrid } from "./src";
670
+ import { Components } from "../Components";
671
+ export declare class Grids extends Component implements Disposable {
672
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
673
+ list: Map<string, SimpleGrid>;
674
+ readonly onDisposed: Event<unknown>;
675
+ config: Required<GridConfig>;
676
+ /** {@link Component.enabled} */
677
+ enabled: boolean;
678
+ constructor(components: Components);
679
+ create(world: World): SimpleGrid;
680
+ delete(world: World): void;
681
+ dispose(): void;
682
+ }
683
+ import * as WEBIFC from "web-ifc";
684
+ export interface IfcItemsCategories {
685
+ [itemID: number]: number;
686
+ }
687
+ export declare class IfcCategories {
688
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
689
+ }
690
+ import * as THREE from "three";
691
+ import { Component, Components, Event, World } from "../core";
692
+ export interface VertexPickerConfig {
693
+ showOnlyVertex: boolean;
694
+ snapDistance: number;
695
+ previewElement: HTMLElement;
696
+ }
697
+ export declare class VertexPicker extends Component {
698
+ onVertexFound: Event<THREE.Vector3>;
699
+ onVertexLost: Event<THREE.Vector3>;
700
+ components: Components;
701
+ private _pickedPoint;
702
+ private _config;
703
+ private _enabled;
704
+ private _workingPlane;
705
+ set enabled(value: boolean);
706
+ get enabled(): boolean;
707
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
708
+ set workingPlane(plane: THREE.Plane | null);
709
+ get workingPlane(): THREE.Plane | null;
710
+ set config(value: Partial<VertexPickerConfig>);
711
+ get config(): Partial<VertexPickerConfig>;
712
+ dispose(): void;
713
+ get(world: World): THREE.Vector3 | null;
714
+ private getClosestVertex;
715
+ private getVertices;
716
+ private getVertex;
717
+ }
718
+ export declare const IfcElements: {
719
+ [key: number]: string;
720
+ };
721
+ import * as THREE from "three";
722
+ import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
723
+ import { SimplePlane } from "./src";
724
+ import { Components } from "../Components";
687
725
  /**
688
- * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
689
- * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
726
+ * A lightweight component to easily create and handle
727
+ * [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
728
+ *
729
+ * @param components - the instance of {@link Components} used.
730
+ * E.g. {@link SimplePlane}.
690
731
  */
691
- export declare class BoundingBoxer extends Component implements Disposable {
692
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
732
+ export declare class Clipper extends Component implements Createable, Disposable, Hideable {
733
+ static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
734
+ /** {@link Createable.onAfterCreate} */
735
+ readonly onAfterCreate: Event<SimplePlane>;
736
+ /** {@link Createable.onAfterDelete} */
737
+ readonly onAfterDelete: Event<SimplePlane>;
738
+ /** Event that fires when the user starts dragging a clipping plane. */
739
+ readonly onBeforeDrag: Event<void>;
740
+ /** Event that fires when the user stops dragging a clipping plane. */
741
+ readonly onAfterDrag: Event<void>;
742
+ readonly onBeforeCreate: Event<unknown>;
743
+ readonly onBeforeCancel: Event<unknown>;
744
+ readonly onAfterCancel: Event<unknown>;
745
+ readonly onBeforeDelete: Event<unknown>;
746
+ /** {@link Disposable.onDisposed} */
747
+ readonly onDisposed: Event<string>;
748
+ /**
749
+ * Whether to force the clipping plane to be orthogonal in the Y direction
750
+ * (up). This is desirable when clipping a building horizontally and a
751
+ * clipping plane is created in its roof, which might have a slight
752
+ * slope for draining purposes.
753
+ */
754
+ orthogonalY: boolean;
755
+ /**
756
+ * The tolerance that determines whether an almost-horizontal clipping plane
757
+ * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
758
+ * has to be 'true' for this to apply.
759
+ */
760
+ toleranceOrthogonalY: number;
761
+ Type: new (...args: any) => SimplePlane;
762
+ list: SimplePlane[];
763
+ /** The material used in all the clipping planes. */
764
+ private _material;
765
+ private _size;
766
+ private _enabled;
767
+ private _visible;
693
768
  /** {@link Component.enabled} */
694
- enabled: boolean;
695
- /** {@link Disposable.onDisposed} */
696
- readonly onDisposed: Event<unknown>;
697
- private _absoluteMin;
698
- private _absoluteMax;
699
- private _meshes;
700
- constructor(components: Components);
701
- static getDimensions(bbox: THREE.Box3): {
702
- width: number;
703
- height: number;
704
- depth: number;
705
- center: THREE.Vector3;
706
- };
707
- static newBound(positive: boolean): THREE.Vector3;
708
- static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
709
- /** {@link Disposable.dispose} */
710
- dispose(): void;
711
- get(): THREE.Box3;
712
- getSphere(): THREE.Sphere;
713
- getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
714
- reset(): void;
715
- add(group: FragmentsGroup): void;
716
- addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
717
- private static getFragmentBounds;
718
- }
719
- import * as THREE from "three";
720
- import * as FRAGS from "@thatopen/fragments";
721
- import { Disposable, Component, Event, Components } from "../../core";
722
- export interface Classification {
723
- [system: string]: {
724
- [className: string]: FRAGS.FragmentIdMap;
725
- };
726
- }
727
- export declare class Classifier extends Component implements Disposable {
728
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
769
+ get enabled(): boolean;
729
770
  /** {@link Component.enabled} */
730
- enabled: boolean;
731
- list: Classification;
732
- /** {@link Disposable.onDisposed} */
733
- readonly onDisposed: Event<unknown>;
771
+ set enabled(state: boolean);
772
+ /** {@link Hideable.visible } */
773
+ get visible(): boolean;
774
+ /** {@link Hideable.visible } */
775
+ set visible(state: boolean);
776
+ /** The material of the clipping plane representation. */
777
+ get material(): THREE.MeshBasicMaterial;
778
+ /** The material of the clipping plane representation. */
779
+ set material(material: THREE.MeshBasicMaterial);
780
+ /** The size of the geometric representation of the clippings planes. */
781
+ get size(): number;
782
+ /** The size of the geometric representation of the clippings planes. */
783
+ set size(size: number);
734
784
  constructor(components: Components);
735
- private onFragmentsDisposed;
785
+ /** {@link Disposable.dispose} */
736
786
  dispose(): void;
737
- remove(guid: string): void;
738
- find(filter?: {
739
- [name: string]: string[];
740
- }): FRAGS.FragmentIdMap;
741
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
742
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
743
- byEntity(group: FRAGS.FragmentsGroup): void;
744
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
745
- bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
746
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
747
- resetColor(items: FRAGS.FragmentIdMap): void;
748
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
787
+ /** {@link Createable.create} */
788
+ create(world: World): void;
789
+ /**
790
+ * Creates a plane in a certain place and with a certain orientation,
791
+ * without the need of the mouse.
792
+ *
793
+ * @param world - the world where this plane should be created.
794
+ * @param normal - the orientation of the clipping plane.
795
+ * @param point - the position of the clipping plane.
796
+ * navigation.
797
+ */
798
+ createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
799
+ /**
800
+ * {@link Createable.delete}
801
+ *
802
+ * @param world - the world where the plane to delete is.
803
+ * @param plane - the plane to delete. If undefined, the first plane
804
+ * found under the cursor will be deleted.
805
+ */
806
+ delete(world: World, plane?: SimplePlane): void;
807
+ /** Deletes all the existing clipping planes. */
808
+ deleteAll(): void;
809
+ private deletePlane;
810
+ private pickPlane;
811
+ private getAllPlaneMeshes;
812
+ private createPlaneFromIntersection;
813
+ private getWorldNormal;
814
+ private normalizePlaneDirectionY;
815
+ private newPlane;
816
+ private updateMaterialsAndPlanes;
817
+ private _onStartDragging;
818
+ private _onEndDragging;
749
819
  }
750
- import { Component, Disposable, Event, Components } from "../../core";
751
- export declare class Exploder extends Component implements Disposable {
752
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
753
- enabled: boolean;
754
- height: number;
755
- groupName: string;
756
- /** {@link Disposable.onDisposed} */
820
+ import { Components } from "../Components";
821
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
822
+ import { Component, Event, Disposable, World } from "../Types";
823
+ /**
824
+ * A tool to handle big scenes efficiently by automatically hiding the objects
825
+ * that are not visible to the camera.
826
+ */
827
+ export declare class Cullers extends Component implements Disposable {
828
+ /**
829
+ * A unique identifier for the Cullers component.
830
+ */
831
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
832
+ /**
833
+ * Indicates whether the Cullers component is enabled.
834
+ */
835
+ private _enabled;
836
+ /**
837
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
838
+ */
839
+ list: Map<string, MeshCullerRenderer>;
840
+ /**
841
+ * An event that is triggered when the Cullers component is disposed.
842
+ */
757
843
  readonly onDisposed: Event<unknown>;
758
- list: Set<string>;
844
+ /**
845
+ * Gets the enabled state of the Cullers component.
846
+ *
847
+ * @returns The current enabled state.
848
+ */
849
+ get enabled(): boolean;
850
+ /**
851
+ * Sets the enabled state of the Cullers component.
852
+ * Also sets the enabled state of all MeshCullerRenderer instances.
853
+ *
854
+ * @param value - The new enabled state.
855
+ */
856
+ set enabled(value: boolean);
759
857
  constructor(components: Components);
858
+ /**
859
+ * Creates a new MeshCullerRenderer for the given world.
860
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
861
+ *
862
+ * @param world - The world for which to create the MeshCullerRenderer.
863
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
864
+ *
865
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
866
+ */
867
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
868
+ delete(world: World): void;
869
+ /** {@link Disposable.dispose} */
760
870
  dispose(): void;
761
- set(active: boolean): void;
762
- }
763
- import * as FRAGS from "@thatopen/fragments";
764
- import { Components, Component } from "../../core";
765
- export declare class Hider extends Component {
766
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
767
- enabled: boolean;
768
- constructor(components: Components);
769
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
770
- isolate(items: FRAGS.FragmentIdMap): void;
771
- private updateCulledVisibility;
772
871
  }
773
- export declare class UUID {
774
- private static _pattern;
775
- private static _lut;
776
- static create(): string;
777
- static validate(uuid: string): void;
778
- }
779
- import * as WEBIFC from "web-ifc";
780
- import { Components, Disposable, Event, Component } from "../../core";
781
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
782
- export declare class IfcGeometryTiler extends Component implements Disposable {
783
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
784
- onGeometryStreamed: Event<{
785
- buffer: Uint8Array;
786
- data: StreamedGeometries;
787
- }>;
788
- onAssetStreamed: Event<StreamedAsset[]>;
789
- onProgress: Event<number>;
790
- onIfcLoaded: Event<Uint8Array>;
791
- /** {@link Disposable.onDisposed} */
872
+ import { MiniMap } from "./src";
873
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
874
+ import { Components } from "../Components";
875
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
876
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
877
+ readonly onAfterUpdate: Event<unknown>;
878
+ readonly onBeforeUpdate: Event<unknown>;
792
879
  readonly onDisposed: Event<unknown>;
793
- settings: IfcStreamingSettings;
794
880
  enabled: boolean;
795
- webIfc: WEBIFC.IfcAPI;
796
- private _spatialTree;
797
- private _metaData;
798
- private _visitedGeometries;
799
- private _streamSerializer;
800
- private _geometries;
801
- private _geometryCount;
802
- private _civil;
803
- private _groupSerializer;
804
- private _assets;
805
- private _meshesWithHoles;
881
+ list: Map<string, MiniMap>;
806
882
  constructor(components: Components);
883
+ create(world: World): MiniMap;
884
+ delete(id: string): void;
807
885
  dispose(): void;
808
- streamFromBuffer(data: Uint8Array): Promise<void>;
809
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
810
- private readIfcFile;
811
- private streamIfcFile;
812
- private streamAllGeometries;
813
- private cleanUp;
814
- private getMesh;
815
- private getGeometry;
816
- private streamAssets;
817
- private streamGeometries;
886
+ update(): void;
818
887
  }
819
- export declare const IfcCategoryMap: {
820
- [key: number]: string;
821
- };
822
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
823
888
  import * as THREE from "three";
824
- import * as FRAGS from "@thatopen/fragments";
825
- import { Component, Components, Event, Disposable } from "../../core";
826
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
889
+ import { Components } from "../Components";
890
+ import { SimpleCamera } from "..";
891
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
827
892
  /**
828
- * Object that can efficiently load binary files that contain
829
- * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
893
+ * A flexible camera that uses
894
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
895
+ * easily control the camera in 2D and 3D. It supports multiple navigation
896
+ * modes, such as 2D floor plan navigation, first person and 3D orbit.
830
897
  */
831
- export declare class FragmentsManager extends Component implements Disposable {
832
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
833
- /** {@link Disposable.onDisposed} */
834
- readonly onDisposed: Event<unknown>;
835
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
836
- readonly onFragmentsDisposed: Event<{
837
- groupID: string;
838
- fragmentIDs: string[];
839
- }>;
840
- /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
841
- readonly list: Map<string, Fragment>;
842
- readonly groups: Map<string, FragmentsGroup>;
843
- /** {@link Component.enabled} */
844
- enabled: boolean;
845
- baseCoordinationModel: string;
846
- private _loader;
847
- /** The list of meshes of the created fragments. */
848
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
898
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
899
+ /**
900
+ * The current {@link NavigationMode}.
901
+ */
902
+ _mode: NavigationMode | null;
903
+ readonly projection: ProjectionManager;
904
+ readonly threeOrtho: THREE.OrthographicCamera;
905
+ readonly threePersp: THREE.PerspectiveCamera;
906
+ protected readonly _userInputButtons: any;
907
+ protected readonly _frustumSize = 50;
908
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
909
+ private previousSize;
910
+ get mode(): NavigationMode;
849
911
  constructor(components: Components);
850
912
  /** {@link Disposable.dispose} */
851
913
  dispose(): void;
852
- disposeGroup(group: FragmentsGroup): void;
853
914
  /**
854
- * Loads a binar file that contain fragment geometry.
855
- * @param data - The binary data to load.
856
- * @param config - Optional configuration for loading.
857
- * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
858
- * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
859
- * @returns The loaded FragmentsGroup.
915
+ * Sets a new {@link NavigationMode} and disables the previous one.
916
+ *
917
+ * @param mode - The {@link NavigationMode} to set.
860
918
  */
861
- load(data: Uint8Array, config?: Partial<{
862
- coordinate: boolean;
863
- properties: FRAGS.IfcProperties;
864
- relationsMap: RelationsMap;
865
- }>): FragmentsGroup;
919
+ set(mode: NavModeID): void;
866
920
  /**
867
- * Export the specified fragments.
868
- * @param group - the fragments group to be exported.
869
- * @returns the exported data as binary buffer.
921
+ * Make the camera view fit all the specified meshes.
922
+ *
923
+ * @param meshes the meshes to fit. If it is not defined, it will
924
+ * evaluate {@link Components.meshes}.
925
+ * @param offset the distance to the fit object
870
926
  */
871
- export(group: FragmentsGroup): Uint8Array;
872
- coordinate(models?: FragmentsGroup[]): void;
873
- }
874
- import * as WEBIFC from "web-ifc";
875
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
876
- import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
877
- export declare class IfcPropertiesTiler extends Component implements Disposable {
878
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
879
- onPropertiesStreamed: AsyncEvent<{
880
- type: number;
881
- data: {
882
- [id: number]: any;
883
- };
884
- }>;
885
- onProgress: AsyncEvent<number>;
886
- onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
887
- /** {@link Disposable.onDisposed} */
888
- readonly onDisposed: Event<string>;
889
- enabled: boolean;
890
- settings: PropertiesStreamingSettings;
891
- webIfc: WEBIFC.IfcAPI;
892
- dispose(): Promise<void>;
893
- streamFromBuffer(data: Uint8Array): Promise<void>;
894
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
895
- private readIfcFile;
896
- private streamIfcFile;
897
- private streamAllProperties;
898
- private cleanUp;
899
- }
900
- export declare const IfcElements: {
901
- [key: number]: string;
902
- };
903
- import * as WEBIFC from "web-ifc";
904
- export interface IfcItemsCategories {
905
- [itemID: number]: number;
906
- }
907
- export declare class IfcCategories {
908
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
927
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
928
+ /**
929
+ * Allows or prevents all user input.
930
+ *
931
+ * @param active - whether to enable or disable user inputs.
932
+ */
933
+ setUserInput(active: boolean): void;
934
+ private disableUserInput;
935
+ private enableUserInput;
936
+ private newOrthoCamera;
937
+ private setOrthoPerspCameraAspect;
909
938
  }
910
939
  import * as FRAGS from "@thatopen/fragments";
911
940
  export declare class IfcPropertiesUtils {
@@ -932,43 +961,23 @@ export declare class IfcPropertiesUtils {
932
961
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
933
962
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
934
963
  }
935
- import * as WEBIFC from "web-ifc";
936
- import * as FRAGS from "@thatopen/fragments";
937
- import { IfcFragmentSettings } from "./src";
938
- import { Component, Components, Event, Disposable } from "../../core";
939
- export declare class IfcLoader extends Component implements Disposable {
940
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
941
- readonly onIfcStartedLoading: Event<void>;
942
- readonly onSetup: Event<void>;
943
- /** {@link Disposable.onDisposed} */
944
- readonly onDisposed: Event<string>;
945
- settings: IfcFragmentSettings;
946
- enabled: boolean;
947
- webIfc: WEBIFC.IfcAPI;
948
- private _material;
949
- private _spatialTree;
950
- private _metaData;
951
- private _fragmentInstances;
952
- private _civil;
953
- private _visitedFragments;
954
- private _materialT;
955
- constructor(components: Components);
956
- dispose(): void;
957
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
958
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
959
- readIfcFile(data: Uint8Array): Promise<number>;
960
- private getAllGeometries;
961
- cleanUp(): void;
962
- private getMesh;
963
- private getGeometry;
964
- private autoSetWasm;
965
- }
964
+ export declare const IfcCategoryMap: {
965
+ [key: number]: string;
966
+ };
966
967
  export declare const GeometryTypes: Set<number>;
967
968
  import { InverseAttribute } from "./types";
968
969
  export declare const relToAttributesMap: Map<number, {
969
970
  forRelating: InverseAttribute;
970
971
  forRelated: InverseAttribute;
971
972
  }>;
973
+ import * as WEBIFC from "web-ifc";
974
+ import { IfcItemsCategories } from "../../../ifc";
975
+ export declare class SpatialStructure {
976
+ itemsByFloor: IfcItemsCategories;
977
+ private _units;
978
+ setUp(webIfc: WEBIFC.IfcAPI): void;
979
+ cleanUp(): void;
980
+ }
972
981
  import * as THREE from "three";
973
982
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
974
983
  export declare class MiniMap implements Resizeable, Updateable, Disposable {
@@ -1003,86 +1012,6 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
1003
1012
  resize(size?: THREE.Vector2): void;
1004
1013
  private updatePlanes;
1005
1014
  }
1006
- import * as WEBIFC from "web-ifc";
1007
- import { IfcItemsCategories } from "../../../ifc";
1008
- export declare class SpatialStructure {
1009
- itemsByFloor: IfcItemsCategories;
1010
- private _units;
1011
- setUp(webIfc: WEBIFC.IfcAPI): void;
1012
- cleanUp(): void;
1013
- }
1014
- /// <reference types="node" />
1015
- import * as THREE from "three";
1016
- import { Hideable, Event, World } from "../../Types";
1017
- import { Components } from "../../Components";
1018
- export interface GridConfig {
1019
- color: THREE.Color;
1020
- size1: number;
1021
- size2: number;
1022
- distance: number;
1023
- }
1024
- /**
1025
- * An infinite grid. Created by
1026
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1027
- * and translated to typescript by
1028
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1029
- */
1030
- export declare class SimpleGrid implements Hideable, Disposable {
1031
- /** {@link Disposable.onDisposed} */
1032
- readonly onDisposed: Event<unknown>;
1033
- world: World;
1034
- components: Components;
1035
- /** {@link Hideable.visible} */
1036
- get visible(): boolean;
1037
- /** {@link Hideable.visible} */
1038
- set visible(visible: boolean);
1039
- /** The material of the grid. */
1040
- get material(): THREE.ShaderMaterial;
1041
- /**
1042
- * Whether the grid should fade away with distance. Recommended to be true for
1043
- * perspective cameras and false for orthographic cameras.
1044
- */
1045
- get fade(): boolean;
1046
- /**
1047
- * Whether the grid should fade away with distance. Recommended to be true for
1048
- * perspective cameras and false for orthographic cameras.
1049
- */
1050
- set fade(active: boolean);
1051
- readonly three: THREE.Mesh;
1052
- private _fade;
1053
- constructor(components: Components, world: World, config: GridConfig);
1054
- [Symbol.dispose](): void;
1055
- /** {@link Disposable.dispose} */
1056
- dispose(): void;
1057
- private setupEvents;
1058
- private updateZoom;
1059
- }
1060
- import * as THREE from "three";
1061
- import { Disposable, Event } from "../../Types";
1062
- /**
1063
- * A helper to easily get the real position of the mouse in the Three.js canvas
1064
- * to work with tools like the
1065
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1066
- * been transformed through CSS or doesn't occupy the whole screen.
1067
- */
1068
- export declare class Mouse implements Disposable {
1069
- dom: HTMLCanvasElement;
1070
- private _event?;
1071
- private _position;
1072
- /** {@link Disposable.onDisposed} */
1073
- readonly onDisposed: Event<unknown>;
1074
- constructor(dom: HTMLCanvasElement);
1075
- /**
1076
- * The real position of the mouse of the Three.js canvas.
1077
- */
1078
- get position(): THREE.Vector2;
1079
- /** {@link Disposable.dispose} */
1080
- dispose(): void;
1081
- private getPositionY;
1082
- private getPositionX;
1083
- private updateMouseInfo;
1084
- private setupEvents;
1085
- }
1086
1015
  /**
1087
1016
  * Simple event handler by
1088
1017
  * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
@@ -1092,66 +1021,64 @@ export declare class Mouse implements Disposable {
1092
1021
  * - If you want to maintain the reference to 'this', you will need to declare
1093
1022
  * the callback as an arrow function.
1094
1023
  */
1095
- export declare class AsyncEvent<T> {
1024
+ export declare class Event<T> {
1096
1025
  /**
1097
1026
  * Add a callback to this event instance.
1098
1027
  * @param handler - the callback to be added to this event.
1099
1028
  */
1100
1029
  add(handler: T extends void ? {
1101
- (): Promise<void>;
1030
+ (): void;
1102
1031
  } : {
1103
- (data: T): Promise<void>;
1032
+ (data: T): void;
1104
1033
  }): void;
1105
1034
  /**
1106
1035
  * Removes a callback from this event instance.
1107
1036
  * @param handler - the callback to be removed from this event.
1108
1037
  */
1109
1038
  remove(handler: T extends void ? {
1110
- (): Promise<void>;
1039
+ (): void;
1111
1040
  } : {
1112
- (data: T): Promise<void>;
1041
+ (data: T): void;
1113
1042
  }): void;
1114
1043
  /** Triggers all the callbacks assigned to this event. */
1115
- trigger: (data?: T) => Promise<void>;
1044
+ trigger: (data?: T) => void;
1116
1045
  /** Gets rid of all the suscribed events. */
1117
1046
  reset(): void;
1118
1047
  private handlers;
1119
1048
  }
1120
- import * as THREE from "three";
1121
- import { Components } from "../../Components";
1122
- import { Event, World, Disposable } from "../../Types";
1123
- import { Mouse } from "./mouse";
1124
1049
  /**
1125
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1126
- * that allows to easily get items from the scene using the mouse and touch
1127
- * events.
1050
+ * Simple event handler by
1051
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1052
+ * Keep in mind that:
1053
+ * - If you want to remove it later, you might want to declare the callback as
1054
+ * an object.
1055
+ * - If you want to maintain the reference to 'this', you will need to declare
1056
+ * the callback as an arrow function.
1128
1057
  */
1129
- export declare class SimpleRaycaster implements Disposable {
1130
- /** {@link Component.enabled} */
1131
- enabled: boolean;
1132
- components: Components;
1133
- /** {@link Disposable.onDisposed} */
1134
- readonly onDisposed: Event<unknown>;
1135
- /** The position of the mouse in the screen. */
1136
- readonly mouse: Mouse;
1137
- readonly three: THREE.Raycaster;
1138
- world: World;
1139
- constructor(components: Components, world: World);
1140
- /** {@link Disposable.dispose} */
1141
- dispose(): void;
1058
+ export declare class AsyncEvent<T> {
1142
1059
  /**
1143
- * Throws a ray from the camera to the mouse or touch event point and returns
1144
- * the first item found. This also takes into account the clipping planes
1145
- * used by the renderer.
1146
- *
1147
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1148
- * to query. If not provided, it will query all the meshes stored in
1149
- * {@link Components.meshes}.
1060
+ * Add a callback to this event instance.
1061
+ * @param handler - the callback to be added to this event.
1062
+ */
1063
+ add(handler: T extends void ? {
1064
+ (): Promise<void>;
1065
+ } : {
1066
+ (data: T): Promise<void>;
1067
+ }): void;
1068
+ /**
1069
+ * Removes a callback from this event instance.
1070
+ * @param handler - the callback to be removed from this event.
1150
1071
  */
1151
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1152
- 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;
1153
- private intersect;
1154
- private filterClippingPlanes;
1072
+ remove(handler: T extends void ? {
1073
+ (): Promise<void>;
1074
+ } : {
1075
+ (data: T): Promise<void>;
1076
+ }): void;
1077
+ /** Triggers all the callbacks assigned to this event. */
1078
+ trigger: (data?: T) => Promise<void>;
1079
+ /** Gets rid of all the suscribed events. */
1080
+ reset(): void;
1081
+ private handlers;
1155
1082
  }
1156
1083
  import * as THREE from "three";
1157
1084
  import CameraControls from "camera-controls";
@@ -1276,39 +1203,22 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1276
1203
  export interface CameraControllable {
1277
1204
  controls: CameraControls;
1278
1205
  }
1206
+ import { Base } from "./base";
1207
+ import { World } from "./world";
1208
+ import { Event } from "./event";
1209
+ import { Components } from "../../Components";
1279
1210
  /**
1280
- * Simple event handler by
1281
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1282
- * Keep in mind that:
1283
- * - If you want to remove it later, you might want to declare the callback as
1284
- * an object.
1285
- * - If you want to maintain the reference to 'this', you will need to declare
1286
- * the callback as an arrow function.
1211
+ * One of the elements that make a world. It can be either a scene, a camera
1212
+ * or a renderer.
1287
1213
  */
1288
- export declare class Event<T> {
1289
- /**
1290
- * Add a callback to this event instance.
1291
- * @param handler - the callback to be added to this event.
1292
- */
1293
- add(handler: T extends void ? {
1294
- (): void;
1295
- } : {
1296
- (data: T): void;
1297
- }): void;
1298
- /**
1299
- * Removes a callback from this event instance.
1300
- * @param handler - the callback to be removed from this event.
1301
- */
1302
- remove(handler: T extends void ? {
1303
- (): void;
1304
- } : {
1305
- (data: T): void;
1306
- }): void;
1307
- /** Triggers all the callbacks assigned to this event. */
1308
- trigger: (data?: T) => void;
1309
- /** Gets rid of all the suscribed events. */
1310
- reset(): void;
1311
- private handlers;
1214
+ export declare abstract class BaseWorldItem extends Base {
1215
+ readonly worlds: Map<string, World>;
1216
+ readonly onWorldChanged: Event<{
1217
+ world: World;
1218
+ action: "added" | "removed";
1219
+ }>;
1220
+ currentWorld: World | null;
1221
+ protected constructor(components: Components);
1312
1222
  }
1313
1223
  import { Base } from "./base";
1314
1224
  /**
@@ -1347,34 +1257,6 @@ export declare abstract class Base {
1347
1257
  /** Whether is component is {@link Configurable}. */
1348
1258
  isConfigurable: () => this is Configurable<any>;
1349
1259
  }
1350
- import { Base } from "./base";
1351
- import { World } from "./world";
1352
- import { Event } from "./event";
1353
- import { Components } from "../../Components";
1354
- /**
1355
- * One of the elements that make a world. It can be either a scene, a camera
1356
- * or a renderer.
1357
- */
1358
- export declare abstract class BaseWorldItem extends Base {
1359
- readonly worlds: Map<string, World>;
1360
- readonly onWorldChanged: Event<{
1361
- world: World;
1362
- action: "added" | "removed";
1363
- }>;
1364
- currentWorld: World | null;
1365
- protected constructor(components: Components);
1366
- }
1367
- import * as THREE from "three";
1368
- import CameraControls from "camera-controls";
1369
- import { BaseWorldItem } from "./base-world-item";
1370
- import { CameraControllable } from "./interfaces";
1371
- export declare abstract class BaseCamera extends BaseWorldItem {
1372
- abstract enabled: boolean;
1373
- abstract three: THREE.Camera;
1374
- abstract controls?: CameraControls;
1375
- /** Whether is instance is {@link CameraControllable}. */
1376
- hasCameraControls: () => this is CameraControllable;
1377
- }
1378
1260
  import * as THREE from "three";
1379
1261
  import { Vector2 } from "three";
1380
1262
  import { Event } from "./event";
@@ -1416,17 +1298,15 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1416
1298
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1417
1299
  }
1418
1300
  import * as THREE from "three";
1419
- import { Disposable } from "./interfaces";
1420
- import { Event } from "./event";
1421
- import { Components } from "../../Components";
1301
+ import CameraControls from "camera-controls";
1422
1302
  import { BaseWorldItem } from "./base-world-item";
1423
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1424
- /** {@link Disposable.onDisposed} */
1425
- readonly onDisposed: Event<unknown>;
1426
- abstract three: THREE.Object3D;
1427
- protected constructor(components: Components);
1428
- /** {@link Disposable.dispose} */
1429
- dispose(): void;
1303
+ import { CameraControllable } from "./interfaces";
1304
+ export declare abstract class BaseCamera extends BaseWorldItem {
1305
+ abstract enabled: boolean;
1306
+ abstract three: THREE.Camera;
1307
+ abstract controls?: CameraControls;
1308
+ /** Whether is instance is {@link CameraControllable}. */
1309
+ hasCameraControls: () => this is CameraControllable;
1430
1310
  }
1431
1311
  import * as THREE from "three";
1432
1312
  import { BaseScene } from "./base-scene";
@@ -1442,6 +1322,125 @@ export interface World extends Disposable, Updateable {
1442
1322
  isDisposing: boolean;
1443
1323
  }
1444
1324
  import * as THREE from "three";
1325
+ import { Disposable } from "./interfaces";
1326
+ import { Event } from "./event";
1327
+ import { Components } from "../../Components";
1328
+ import { BaseWorldItem } from "./base-world-item";
1329
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1330
+ /** {@link Disposable.onDisposed} */
1331
+ readonly onDisposed: Event<unknown>;
1332
+ abstract three: THREE.Object3D;
1333
+ protected constructor(components: Components);
1334
+ /** {@link Disposable.dispose} */
1335
+ dispose(): void;
1336
+ }
1337
+ import * as THREE from "three";
1338
+ import { Disposable, Event } from "../../Types";
1339
+ /**
1340
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1341
+ * to work with tools like the
1342
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1343
+ * been transformed through CSS or doesn't occupy the whole screen.
1344
+ */
1345
+ export declare class Mouse implements Disposable {
1346
+ dom: HTMLCanvasElement;
1347
+ private _event?;
1348
+ private _position;
1349
+ /** {@link Disposable.onDisposed} */
1350
+ readonly onDisposed: Event<unknown>;
1351
+ constructor(dom: HTMLCanvasElement);
1352
+ /**
1353
+ * The real position of the mouse of the Three.js canvas.
1354
+ */
1355
+ get position(): THREE.Vector2;
1356
+ /** {@link Disposable.dispose} */
1357
+ dispose(): void;
1358
+ private getPositionY;
1359
+ private getPositionX;
1360
+ private updateMouseInfo;
1361
+ private setupEvents;
1362
+ }
1363
+ import * as THREE from "three";
1364
+ import { Hideable, Event, World, Disposable } from "../../Types";
1365
+ import { Components } from "../../Components";
1366
+ export interface GridConfig {
1367
+ color: THREE.Color;
1368
+ size1: number;
1369
+ size2: number;
1370
+ distance: number;
1371
+ }
1372
+ /**
1373
+ * An infinite grid. Created by
1374
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1375
+ * and translated to typescript by
1376
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1377
+ */
1378
+ export declare class SimpleGrid implements Hideable, Disposable {
1379
+ /** {@link Disposable.onDisposed} */
1380
+ readonly onDisposed: Event<unknown>;
1381
+ world: World;
1382
+ components: Components;
1383
+ /** {@link Hideable.visible} */
1384
+ get visible(): boolean;
1385
+ /** {@link Hideable.visible} */
1386
+ set visible(visible: boolean);
1387
+ /** The material of the grid. */
1388
+ get material(): THREE.ShaderMaterial;
1389
+ /**
1390
+ * Whether the grid should fade away with distance. Recommended to be true for
1391
+ * perspective cameras and false for orthographic cameras.
1392
+ */
1393
+ get fade(): boolean;
1394
+ /**
1395
+ * Whether the grid should fade away with distance. Recommended to be true for
1396
+ * perspective cameras and false for orthographic cameras.
1397
+ */
1398
+ set fade(active: boolean);
1399
+ readonly three: THREE.Mesh;
1400
+ private _fade;
1401
+ constructor(components: Components, world: World, config: GridConfig);
1402
+ /** {@link Disposable.dispose} */
1403
+ dispose(): void;
1404
+ private setupEvents;
1405
+ private updateZoom;
1406
+ }
1407
+ import * as THREE from "three";
1408
+ import { Components } from "../../Components";
1409
+ import { Event, World, Disposable } from "../../Types";
1410
+ import { Mouse } from "./mouse";
1411
+ /**
1412
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1413
+ * that allows to easily get items from the scene using the mouse and touch
1414
+ * events.
1415
+ */
1416
+ export declare class SimpleRaycaster implements Disposable {
1417
+ /** {@link Component.enabled} */
1418
+ enabled: boolean;
1419
+ components: Components;
1420
+ /** {@link Disposable.onDisposed} */
1421
+ readonly onDisposed: Event<unknown>;
1422
+ /** The position of the mouse in the screen. */
1423
+ readonly mouse: Mouse;
1424
+ readonly three: THREE.Raycaster;
1425
+ world: World;
1426
+ constructor(components: Components, world: World);
1427
+ /** {@link Disposable.dispose} */
1428
+ dispose(): void;
1429
+ /**
1430
+ * Throws a ray from the camera to the mouse or touch event point and returns
1431
+ * the first item found. This also takes into account the clipping planes
1432
+ * used by the renderer.
1433
+ *
1434
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1435
+ * to query. If not provided, it will query all the meshes stored in
1436
+ * {@link Components.meshes}.
1437
+ */
1438
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1439
+ 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;
1440
+ private intersect;
1441
+ private filterClippingPlanes;
1442
+ }
1443
+ import * as THREE from "three";
1445
1444
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1446
1445
  import { Components } from "../../Components";
1447
1446
  export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
@@ -1470,6 +1469,68 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
1470
1469
  dispose(disposeResources?: boolean): void;
1471
1470
  }
1472
1471
  import * as THREE from "three";
1472
+ import { BaseScene, Configurable, Event } from "../../Types";
1473
+ import { Components } from "../../Components";
1474
+ export interface SimpleSceneConfig {
1475
+ directionalLight: {
1476
+ color: THREE.Color;
1477
+ intensity: number;
1478
+ position: THREE.Vector3;
1479
+ };
1480
+ ambientLight: {
1481
+ color: THREE.Color;
1482
+ intensity: number;
1483
+ };
1484
+ }
1485
+ /**
1486
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1487
+ * objects hierarchically, and easily dispose them when you are finished with it.
1488
+ * @noInheritDoc
1489
+ */
1490
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1491
+ /** {@link Configurable.isSetup} */
1492
+ isSetup: boolean;
1493
+ three: THREE.Scene;
1494
+ /** {@link Configurable.onSetup} */
1495
+ readonly onSetup: Event<SimpleScene>;
1496
+ config: Required<SimpleSceneConfig>;
1497
+ constructor(components: Components);
1498
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1499
+ setup(config?: Partial<SimpleSceneConfig>): void;
1500
+ }
1501
+ import * as THREE from "three";
1502
+ import { BaseRenderer, Event } from "../../Types";
1503
+ import { Components } from "../../Components";
1504
+ /**
1505
+ * A basic renderer capable of rendering
1506
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1507
+ */
1508
+ export declare class SimpleRenderer extends BaseRenderer {
1509
+ enabled: boolean;
1510
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1511
+ container: HTMLElement;
1512
+ three: THREE.WebGLRenderer;
1513
+ protected _canvas: HTMLCanvasElement;
1514
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1515
+ protected _resizeObserver: ResizeObserver | null;
1516
+ protected onContainerUpdated: Event<unknown>;
1517
+ private _resizing;
1518
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1519
+ /** {@link Updateable.update} */
1520
+ update(): void;
1521
+ /** {@link Disposable.dispose} */
1522
+ dispose(): void;
1523
+ /** {@link Resizeable.getSize}. */
1524
+ getSize(): THREE.Vector2;
1525
+ /** {@link Resizeable.resize} */
1526
+ resize: (size?: THREE.Vector2) => void;
1527
+ setupEvents(active: boolean): void;
1528
+ private resizeEvent;
1529
+ private setupRenderer;
1530
+ private onContextLost;
1531
+ private onContextBack;
1532
+ }
1533
+ import * as THREE from "three";
1473
1534
  import CameraControls from "camera-controls";
1474
1535
  import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1475
1536
  import { Components } from "../../Components";
@@ -1516,103 +1577,113 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
1516
1577
  private static getSubsetOfThree;
1517
1578
  }
1518
1579
  import * as THREE from "three";
1519
- import { Components } from "../../Components";
1520
- import { AsyncEvent, Event, World } from "../../Types";
1521
- export interface CullerRendererSettings {
1522
- updateInterval?: number;
1523
- width?: number;
1524
- height?: number;
1525
- autoUpdate?: boolean;
1580
+ import * as WEBIFC from "web-ifc";
1581
+ import * as FRAGS from "@thatopen/fragments";
1582
+ export declare class CivilReader {
1583
+ defLineMat: THREE.LineBasicMaterial;
1584
+ read(webIfc: WEBIFC.IfcAPI): {
1585
+ alignments: Map<number, FRAGS.Alignment>;
1586
+ coordinationMatrix: THREE.Matrix4;
1587
+ } | undefined;
1588
+ get(civilItems: any): {
1589
+ alignments: Map<number, FRAGS.Alignment>;
1590
+ coordinationMatrix: THREE.Matrix4;
1591
+ } | undefined;
1592
+ private getCurves;
1526
1593
  }
1527
- /**
1528
- * A base renderer to determine visibility on screen
1529
- */
1530
- export declare class CullerRenderer {
1531
- /** {@link Disposable.onDisposed} */
1532
- readonly onDisposed: Event<string>;
1594
+ import * as WEBIFC from "web-ifc";
1595
+ /** Configuration of the IFC-fragment conversion. */
1596
+ export declare class IfcFragmentSettings {
1597
+ /** Whether to extract the IFC properties into a JSON. */
1598
+ includeProperties: boolean;
1533
1599
  /**
1534
- * Fires after making the visibility check to the meshes. It lists the
1535
- * meshes that are currently visible, and the ones that were visible
1536
- * just before but not anymore.
1600
+ * Generate the geometry for categories that are not included by default,
1601
+ * like IFCSPACE.
1537
1602
  */
1538
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1539
- /** {@link Component.enabled} */
1603
+ optionalCategories: number[];
1604
+ /** Whether to use the coordination data coming from the IFC files. */
1605
+ coordinate: boolean;
1606
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1607
+ wasm: {
1608
+ path: string;
1609
+ absolute: boolean;
1610
+ logLevel?: WEBIFC.LogLevel;
1611
+ };
1612
+ /** List of categories that won't be converted to fragments. */
1613
+ excludedCategories: Set<number>;
1614
+ /** Whether to save the absolute location of all IFC items. */
1615
+ saveLocations: boolean;
1616
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1617
+ webIfc: WEBIFC.LoaderSettings;
1618
+ autoSetWasm: boolean;
1619
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1620
+ }
1621
+ import * as WEBIFC from "web-ifc";
1622
+ export declare class IfcMetadataReader {
1623
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1624
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1625
+ }
1626
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
1627
+ /** Configuration of the IFC-fragment streaming. */
1628
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1629
+ minGeometrySize: number;
1630
+ minAssetsSize: number;
1631
+ }
1632
+ /** Configuration of the IFC-fragment streaming. */
1633
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1634
+ propertiesSize: number;
1635
+ }
1636
+ import * as WEBIFC from "web-ifc";
1637
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1638
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1639
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1640
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1641
+ onPropertiesStreamed: AsyncEvent<{
1642
+ type: number;
1643
+ data: {
1644
+ [id: number]: any;
1645
+ };
1646
+ }>;
1647
+ onProgress: AsyncEvent<number>;
1648
+ onIndicesStreamed: AsyncEvent<number[][]>;
1649
+ /** {@link Disposable.onDisposed} */
1650
+ readonly onDisposed: Event<string>;
1540
1651
  enabled: boolean;
1541
- /**
1542
- * Needs to check whether there are objects that need to be hidden or shown.
1543
- * You can bind this to the camera movement, to a certain interval, etc.
1544
- */
1545
- needsUpdate: boolean;
1546
- /**
1547
- * Render the internal scene used to determine the object visibility. Used
1548
- * for debugging purposes.
1549
- */
1550
- renderDebugFrame: boolean;
1551
- components: Components;
1552
- readonly world: World;
1553
- readonly renderer: THREE.WebGLRenderer;
1554
- protected autoUpdate: boolean;
1555
- protected updateInterval: number;
1556
- protected readonly worker: Worker;
1557
- protected readonly scene: THREE.Scene;
1558
- private _width;
1559
- private _height;
1560
- private _availableColor;
1561
- private readonly renderTarget;
1562
- private readonly bufferSize;
1563
- private readonly _buffer;
1564
- protected _isWorkerBusy: boolean;
1565
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1566
- /** {@link Disposable.dispose} */
1567
- dispose(): void;
1568
- /**
1569
- * The function that the culler uses to reprocess the scene. Generally it's
1570
- * better to call needsUpdate, but you can also call this to force it.
1571
- * @param force if true, it will refresh the scene even if needsUpdate is
1572
- * not true.
1573
- */
1574
- updateVisibility: (force?: boolean) => Promise<void>;
1575
- protected getAvailableColor(): {
1576
- r: number;
1577
- g: number;
1578
- b: number;
1579
- code: string;
1652
+ settings: PropertiesStreamingSettings;
1653
+ webIfc: WEBIFC.IfcAPI;
1654
+ dispose(): Promise<void>;
1655
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1656
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1657
+ private readIfcFile;
1658
+ private streamIfcFile;
1659
+ private streamAllProperties;
1660
+ private getIndices;
1661
+ private cleanUp;
1662
+ }
1663
+ export interface StreamedGeometries {
1664
+ [id: number]: {
1665
+ boundingBox: Float32Array;
1666
+ hasHoles: boolean;
1667
+ geometryFile?: string;
1580
1668
  };
1581
- protected increaseColor(): void;
1582
- protected decreaseColor(): void;
1583
- private applySettings;
1584
1669
  }
1670
+ export interface StreamedAsset {
1671
+ id: number;
1672
+ geometries: {
1673
+ geometryID: number;
1674
+ transformation: number[];
1675
+ color: number[];
1676
+ }[];
1677
+ }
1678
+ import * as WEBIFC from "web-ifc";
1585
1679
  import * as THREE from "three";
1586
- import { BaseRenderer, Event } from "../../Types";
1587
- import { Components } from "../../Components";
1588
- /**
1589
- * A basic renderer capable of rendering
1590
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1591
- */
1592
- export declare class SimpleRenderer extends BaseRenderer {
1593
- enabled: boolean;
1594
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
1595
- container: HTMLElement;
1596
- three: THREE.WebGLRenderer;
1597
- protected _canvas: HTMLCanvasElement;
1598
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1599
- protected _resizeObserver: ResizeObserver | null;
1600
- protected onContainerUpdated: Event<unknown>;
1601
- private _resizing;
1602
- constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1603
- /** {@link Updateable.update} */
1604
- update(): void;
1605
- /** {@link Disposable.dispose} */
1606
- dispose(): void;
1607
- /** {@link Resizeable.getSize}. */
1608
- getSize(): THREE.Vector2;
1609
- /** {@link Resizeable.resize} */
1610
- resize: (size?: THREE.Vector2) => void;
1611
- setupEvents(active: boolean): void;
1612
- private resizeEvent;
1613
- private setupRenderer;
1614
- private onContextLost;
1615
- private onContextBack;
1680
+ export declare class Units {
1681
+ factor: number;
1682
+ complement: number;
1683
+ apply(matrix: THREE.Matrix4): void;
1684
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1685
+ private getLengthUnits;
1686
+ private getScaleMatrix;
1616
1687
  }
1617
1688
  import * as THREE from "three";
1618
1689
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -1664,75 +1735,33 @@ export declare class SimplePlane implements Disposable, Hideable {
1664
1735
  update: () => void;
1665
1736
  /** {@link Disposable.dispose} */
1666
1737
  dispose(): void;
1667
- private reset;
1668
- protected toggleControls(state: boolean): void;
1669
- private newTransformControls;
1670
- private initializeControls;
1671
- private createArrowBoundingBox;
1672
- private changeDrag;
1673
- private notifyDraggingChanged;
1674
- private preventCameraMovement;
1675
- private newHelper;
1676
- private static newPlaneMesh;
1677
- }
1678
- import * as THREE from "three";
1679
- import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1680
- import { Components } from "../../Components";
1681
- import { Event, World } from "../../Types";
1682
- /**
1683
- * A renderer to determine a mesh visibility on screen
1684
- */
1685
- export declare class MeshCullerRenderer extends CullerRenderer {
1686
- threshold: number;
1687
- readonly onViewUpdated: Event<{
1688
- seen: Set<THREE.Mesh>;
1689
- unseen: Set<THREE.Mesh>;
1690
- }>;
1691
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1692
- isProcessing: boolean;
1693
- private _colorCodeMeshMap;
1694
- private _meshIDColorCodeMap;
1695
- private _currentVisibleMeshes;
1696
- private _recentlyHiddenMeshes;
1697
- private _intervalID;
1698
- private readonly _transparentMat;
1699
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1700
- dispose(): void;
1701
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1702
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1703
- private handleWorkerMessage;
1704
- private getAvailableMaterial;
1705
- }
1706
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1707
- import * as THREE from "three";
1708
- import { BaseScene, Configurable, Event } from "../../Types";
1709
- import { Components } from "../../Components";
1710
- export interface SimpleSceneConfig {
1711
- directionalLight: {
1712
- color: THREE.Color;
1713
- intensity: number;
1714
- position: THREE.Vector3;
1715
- };
1716
- ambientLight: {
1717
- color: THREE.Color;
1718
- intensity: number;
1719
- };
1738
+ private reset;
1739
+ protected toggleControls(state: boolean): void;
1740
+ private newTransformControls;
1741
+ private initializeControls;
1742
+ private createArrowBoundingBox;
1743
+ private changeDrag;
1744
+ private notifyDraggingChanged;
1745
+ private preventCameraMovement;
1746
+ private newHelper;
1747
+ private static newPlaneMesh;
1720
1748
  }
1749
+ import { NavigationMode } from "./types";
1750
+ import { OrthoPerspectiveCamera } from "../index";
1721
1751
  /**
1722
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1723
- * objects hierarchically, and easily dispose them when you are finished with it.
1724
- * @noInheritDoc
1752
+ * A {@link NavigationMode} that allows first person navigation,
1753
+ * simulating FPS video games.
1725
1754
  */
1726
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1727
- /** {@link Configurable.isSetup} */
1728
- isSetup: boolean;
1729
- three: THREE.Scene;
1730
- /** {@link Configurable.onSetup} */
1731
- readonly onSetup: Event<SimpleScene>;
1732
- config: Required<SimpleSceneConfig>;
1733
- constructor(components: Components);
1734
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1735
- setup(config?: Partial<SimpleSceneConfig>): void;
1755
+ export declare class FirstPersonMode implements NavigationMode {
1756
+ private camera;
1757
+ /** {@link NavigationMode.enabled} */
1758
+ enabled: boolean;
1759
+ /** {@link NavigationMode.id} */
1760
+ readonly id = "FirstPerson";
1761
+ constructor(camera: OrthoPerspectiveCamera);
1762
+ /** {@link NavigationMode.set} */
1763
+ set(active: boolean): void;
1764
+ private setupFirstPersonCamera;
1736
1765
  }
1737
1766
  import { NavigationMode } from "./types";
1738
1767
  import { OrthoPerspectiveCamera } from "../index";
@@ -1772,23 +1801,6 @@ export declare class PlanMode implements NavigationMode {
1772
1801
  /** {@link NavigationMode.set} */
1773
1802
  set(active: boolean): void;
1774
1803
  }
1775
- import { NavigationMode } from "./types";
1776
- import { OrthoPerspectiveCamera } from "../index";
1777
- /**
1778
- * A {@link NavigationMode} that allows first person navigation,
1779
- * simulating FPS video games.
1780
- */
1781
- export declare class FirstPersonMode implements NavigationMode {
1782
- private camera;
1783
- /** {@link NavigationMode.enabled} */
1784
- enabled: boolean;
1785
- /** {@link NavigationMode.id} */
1786
- readonly id = "FirstPerson";
1787
- constructor(camera: OrthoPerspectiveCamera);
1788
- /** {@link NavigationMode.set} */
1789
- set(active: boolean): void;
1790
- private setupFirstPersonCamera;
1791
- }
1792
1804
  import * as THREE from "three";
1793
1805
  import { CameraProjection } from "./types";
1794
1806
  import { Event } from "../../Types";
@@ -1826,16 +1838,6 @@ export declare class ProjectionManager {
1826
1838
  private getDistance;
1827
1839
  private setPerspectiveCamera;
1828
1840
  }
1829
- import { IfcFragmentSettings } from "../../IfcLoader/src";
1830
- /** Configuration of the IFC-fragment streaming. */
1831
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1832
- minGeometrySize: number;
1833
- minAssetsSize: number;
1834
- }
1835
- /** Configuration of the IFC-fragment streaming. */
1836
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1837
- propertiesSize: number;
1838
- }
1839
1841
  /**
1840
1842
  * The projection system of the camera.
1841
1843
  */
@@ -1863,88 +1865,101 @@ export interface NavigationMode {
1863
1865
  /** Whether this navigation mode is active or not. */
1864
1866
  enabled: boolean;
1865
1867
  }
1866
- export interface StreamedGeometries {
1867
- [id: number]: {
1868
- boundingBox: Float32Array;
1869
- hasHoles: boolean;
1870
- geometryFile?: string;
1871
- };
1872
- }
1873
- export interface StreamedAsset {
1874
- id: number;
1875
- geometries: {
1876
- geometryID: number;
1877
- transformation: number[];
1878
- color: number[];
1879
- }[];
1868
+ import * as THREE from "three";
1869
+ import { Components } from "../../Components";
1870
+ import { AsyncEvent, Event, World } from "../../Types";
1871
+ export interface CullerRendererSettings {
1872
+ updateInterval?: number;
1873
+ width?: number;
1874
+ height?: number;
1875
+ autoUpdate?: boolean;
1880
1876
  }
1881
- import * as WEBIFC from "web-ifc";
1882
- import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1883
- import { PropertiesStreamingSettings } from "./streaming-settings";
1884
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1885
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1886
- onPropertiesStreamed: AsyncEvent<{
1887
- type: number;
1888
- data: {
1889
- [id: number]: any;
1890
- };
1891
- }>;
1892
- onProgress: AsyncEvent<number>;
1893
- onIndicesStreamed: AsyncEvent<number[][]>;
1877
+ /**
1878
+ * A base renderer to determine visibility on screen
1879
+ */
1880
+ export declare class CullerRenderer {
1894
1881
  /** {@link Disposable.onDisposed} */
1895
1882
  readonly onDisposed: Event<string>;
1883
+ /**
1884
+ * Fires after making the visibility check to the meshes. It lists the
1885
+ * meshes that are currently visible, and the ones that were visible
1886
+ * just before but not anymore.
1887
+ */
1888
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1889
+ /** {@link Component.enabled} */
1896
1890
  enabled: boolean;
1897
- settings: PropertiesStreamingSettings;
1898
- webIfc: WEBIFC.IfcAPI;
1899
- dispose(): Promise<void>;
1900
- streamFromBuffer(data: Uint8Array): Promise<void>;
1901
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1902
- private readIfcFile;
1903
- private streamIfcFile;
1904
- private streamAllProperties;
1905
- private getIndices;
1906
- private cleanUp;
1907
- }
1908
- import * as WEBIFC from "web-ifc";
1909
- /** Configuration of the IFC-fragment conversion. */
1910
- export declare class IfcFragmentSettings {
1911
- /** Whether to extract the IFC properties into a JSON. */
1912
- includeProperties: boolean;
1913
1891
  /**
1914
- * Generate the geometry for categories that are not included by default,
1915
- * like IFCSPACE.
1892
+ * Needs to check whether there are objects that need to be hidden or shown.
1893
+ * You can bind this to the camera movement, to a certain interval, etc.
1916
1894
  */
1917
- optionalCategories: number[];
1918
- /** Whether to use the coordination data coming from the IFC files. */
1919
- coordinate: boolean;
1920
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1921
- wasm: {
1922
- path: string;
1923
- absolute: boolean;
1924
- logLevel?: WEBIFC.LogLevel;
1895
+ needsUpdate: boolean;
1896
+ /**
1897
+ * Render the internal scene used to determine the object visibility. Used
1898
+ * for debugging purposes.
1899
+ */
1900
+ renderDebugFrame: boolean;
1901
+ components: Components;
1902
+ readonly world: World;
1903
+ readonly renderer: THREE.WebGLRenderer;
1904
+ protected autoUpdate: boolean;
1905
+ protected updateInterval: number;
1906
+ protected readonly worker: Worker;
1907
+ protected readonly scene: THREE.Scene;
1908
+ private _width;
1909
+ private _height;
1910
+ private _availableColor;
1911
+ private readonly renderTarget;
1912
+ private readonly bufferSize;
1913
+ private readonly _buffer;
1914
+ protected _isWorkerBusy: boolean;
1915
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1916
+ /** {@link Disposable.dispose} */
1917
+ dispose(): void;
1918
+ /**
1919
+ * The function that the culler uses to reprocess the scene. Generally it's
1920
+ * better to call needsUpdate, but you can also call this to force it.
1921
+ * @param force if true, it will refresh the scene even if needsUpdate is
1922
+ * not true.
1923
+ */
1924
+ updateVisibility: (force?: boolean) => Promise<void>;
1925
+ protected getAvailableColor(): {
1926
+ r: number;
1927
+ g: number;
1928
+ b: number;
1929
+ code: string;
1925
1930
  };
1926
- /** List of categories that won't be converted to fragments. */
1927
- excludedCategories: Set<number>;
1928
- /** Whether to save the absolute location of all IFC items. */
1929
- saveLocations: boolean;
1930
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1931
- webIfc: WEBIFC.LoaderSettings;
1932
- autoSetWasm: boolean;
1933
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1931
+ protected increaseColor(): void;
1932
+ protected decreaseColor(): void;
1933
+ private applySettings;
1934
1934
  }
1935
- import * as WEBIFC from "web-ifc";
1935
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1936
1936
  import * as THREE from "three";
1937
- export declare class Units {
1938
- factor: number;
1939
- complement: number;
1940
- apply(matrix: THREE.Matrix4): void;
1941
- setUp(webIfc: WEBIFC.IfcAPI): void;
1942
- private getLengthUnits;
1943
- private getScaleMatrix;
1944
- }
1945
- import * as WEBIFC from "web-ifc";
1946
- export declare class IfcMetadataReader {
1947
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1937
+ import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1938
+ import { Components } from "../../Components";
1939
+ import { Event, World } from "../../Types";
1940
+ /**
1941
+ * A renderer to determine a mesh visibility on screen
1942
+ */
1943
+ export declare class MeshCullerRenderer extends CullerRenderer {
1944
+ threshold: number;
1945
+ readonly onViewUpdated: Event<{
1946
+ seen: Set<THREE.Mesh>;
1947
+ unseen: Set<THREE.Mesh>;
1948
+ }>;
1949
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1950
+ isProcessing: boolean;
1951
+ private _colorCodeMeshMap;
1952
+ private _meshIDColorCodeMap;
1953
+ private _currentVisibleMeshes;
1954
+ private _recentlyHiddenMeshes;
1955
+ private _intervalID;
1956
+ private readonly _transparentMat;
1957
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1958
+ dispose(): void;
1959
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1960
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1961
+ private handleWorkerMessage;
1962
+ private getAvailableMaterial;
1948
1963
  }
1949
1964
  export type RelationsMap = Map<number, Map<number, number[]>>;
1950
1965
  export interface ModelsRelationMap {
@@ -1975,20 +1990,5 @@ import * as THREE from "three";
1975
1990
  export declare class TransformHelper {
1976
1991
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
1977
1992
  }
1978
- import * as THREE from "three";
1979
- import * as WEBIFC from "web-ifc";
1980
- import * as FRAGS from "@thatopen/fragments";
1981
- export declare class CivilReader {
1982
- defLineMat: THREE.LineBasicMaterial;
1983
- read(webIfc: WEBIFC.IfcAPI): {
1984
- alignments: Map<number, FRAGS.Alignment>;
1985
- coordinationMatrix: THREE.Matrix4;
1986
- } | undefined;
1987
- get(civilItems: any): {
1988
- alignments: Map<number, FRAGS.Alignment>;
1989
- coordinationMatrix: THREE.Matrix4;
1990
- } | undefined;
1991
- private getCurves;
1992
- }
1993
1993
 
1994
1994
  }