@thatopen/components 2.0.0-alpha.1 → 2.0.0-alpha.10

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.
Files changed (53) hide show
  1. package/dist/core/Clipper/index.d.ts +3 -3
  2. package/dist/core/Cullers/src/culler-renderer.d.ts +3 -2
  3. package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +1 -0
  4. package/dist/core/Materials/index.d.ts +3 -15
  5. package/dist/core/MiniMap/index.d.ts +15 -0
  6. package/dist/core/MiniMap/src/index.d.ts +34 -0
  7. package/dist/{navigation → core}/OrthoPerspectiveCamera/index.d.ts +2 -1
  8. package/dist/{navigation → core}/OrthoPerspectiveCamera/src/projections.d.ts +3 -3
  9. package/dist/core/Types/src/async-event.d.ts +34 -0
  10. package/dist/core/Types/src/index.d.ts +1 -0
  11. package/dist/core/Types/src/interfaces.d.ts +3 -14
  12. package/dist/core/Worlds/src/simple-renderer.d.ts +3 -4
  13. package/dist/core/index.d.ts +2 -0
  14. package/dist/fragments/{FragmentBoundingBox → BoundingBoxes}/index.d.ts +4 -4
  15. package/dist/fragments/FragmentClassifier/index.d.ts +5 -4
  16. package/dist/fragments/FragmentHider/index.d.ts +10 -0
  17. package/dist/fragments/FragmentIfcLoader/index.d.ts +1 -2
  18. package/dist/fragments/FragmentIfcLoader/src/civil-reader.d.ts +1 -1
  19. package/dist/fragments/FragmentIfcLoader/src/index.d.ts +1 -0
  20. package/dist/fragments/FragmentManager/index.d.ts +1 -1
  21. package/dist/fragments/{FragmentIfcStreamer/src/fragment-ifc-stream-converter.d.ts → IfcGeometryTiler/index.d.ts} +4 -4
  22. package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/fragment-props-stream-converter.d.ts +4 -4
  23. package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/index.d.ts +0 -1
  24. package/dist/fragments/IfcPropertiesTiler/index.d.ts +26 -0
  25. package/dist/fragments/index.d.ts +5 -2
  26. package/dist/ifc/IfcJsonExporter/index.d.ts +1 -1
  27. package/dist/ifc/IfcPropertiesFinder/index.d.ts +2 -2
  28. package/dist/ifc/IfcPropertiesManager/index.d.ts +2 -2
  29. package/dist/ifc/IfcRelationsIndexer/index.d.ts +135 -0
  30. package/dist/ifc/IfcRelationsIndexer/src/getRelationMap.d.ts +3 -0
  31. package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +4 -0
  32. package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +24 -0
  33. package/dist/ifc/Utils/properties-utils.d.ts +1 -1
  34. package/dist/ifc/index.d.ts +1 -1
  35. package/dist/index.cjs +5 -5
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.mjs +3484 -2525
  38. package/dist/measurement/Utils/index.d.ts +20 -0
  39. package/dist/measurement/index.d.ts +1 -0
  40. package/dist/namespace.d.ts +1237 -954
  41. package/dist/utils/index.d.ts +1 -0
  42. package/dist/utils/vertex-picker.d.ts +31 -0
  43. package/package.json +6 -5
  44. package/dist/fragments/FragmentIfcStreamer/index.d.ts +0 -1
  45. package/dist/ifc/IfcPropertiesIndexer/index.d.ts +0 -31
  46. package/dist/navigation/index.d.ts +0 -1
  47. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -0
  48. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/index.d.ts +0 -0
  49. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -0
  50. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -0
  51. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/types.d.ts +0 -0
  52. /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/base-types.d.ts +0 -0
  53. /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/streaming-settings.d.ts +0 -0
@@ -1,16 +1,55 @@
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 } from "../Types";
3
+ /**
4
+ * The entry point of the Components library.
5
+ * It can:
6
+ * - Create and access all the components of the library.
7
+ * - Update all the updatable components automatically.
8
+ * - Dispose all the components, preventing memory leaks.
9
+ */
10
+ export declare class Components implements Disposable {
11
+ static readonly release = "1.4.21";
12
+ /** {@link Disposable.onDisposed} */
13
+ readonly onDisposed: Event<void>;
14
+ /** The list of components created in this app. */
15
+ readonly list: Map<string, Component>;
16
+ /** If disabled, the animation loop will be stopped. */
7
17
  enabled: boolean;
8
- list: Map<string, SimpleRaycaster>;
9
- onDisposed: Event<unknown>;
10
- constructor(components: Components);
11
- get(world: World): SimpleRaycaster;
12
- delete(world: World): void;
18
+ private _clock;
19
+ add(uuid: string, instance: Component): void;
20
+ /**
21
+ * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
22
+ * doesn't exist, it will instance it automatically.
23
+ *
24
+ * @param Component - The component to get or create.
25
+ */
26
+ get<U extends Component>(Component: new (components: Components) => U): U;
27
+ constructor();
28
+ /**
29
+ * Initializes the library. It should be called at the start of the app after
30
+ * initializing the scene, the renderer and the
31
+ * camera. Additionally, if any component that need a raycaster is
32
+ * used, the {@link raycaster} will need to be initialized.
33
+ */
34
+ init(): void;
35
+ /**
36
+ * Disposes the memory of all the components and tools of this instance of
37
+ * the library. A memory leak will be created if:
38
+ *
39
+ * - An instance of the library ends up out of scope and this function isn't
40
+ * called. This is especially relevant in Single Page Applications (React,
41
+ * Angular, Vue, etc).
42
+ *
43
+ * - Any of the objects of this instance (meshes, geometries, etc) is
44
+ * referenced by a reference type (object or array).
45
+ *
46
+ * You can learn more about how Three.js handles memory leaks
47
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
48
+ *
49
+ */
13
50
  dispose(): void;
51
+ private update;
52
+ private static setupBVH;
14
53
  }
15
54
  import { Component, Disposable, World, Event } from "../Types";
16
55
  import { GridConfig, SimpleGrid } from "./src";
@@ -25,22 +64,6 @@ export declare class Grids extends Component implements Disposable {
25
64
  delete(world: World): void;
26
65
  dispose(): void;
27
66
  }
28
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
29
- import { Components } from "../Components";
30
- import { SimpleWorld } from "./src";
31
- export declare class Worlds extends Component implements Updateable, Disposable {
32
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
33
- readonly onAfterUpdate: Event<unknown>;
34
- readonly onBeforeUpdate: Event<unknown>;
35
- readonly onDisposed: Event<unknown>;
36
- list: Map<string, World>;
37
- enabled: boolean;
38
- constructor(components: Components);
39
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
40
- delete(world: World): void;
41
- dispose(): void;
42
- update(delta?: number): void | Promise<void>;
43
- }
44
67
  import * as THREE from "three";
45
68
  import { Components } from "../Components";
46
69
  import { Component } from "../Types";
@@ -84,28 +107,6 @@ export declare class Disposer extends Component {
84
107
  private disposeChildren;
85
108
  private static disposeMaterial;
86
109
  }
87
- import { Components } from "../Components";
88
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
89
- import { Component, Event, Disposable, World } from "../Types";
90
- /**
91
- * A tool to handle big scenes efficiently by automatically hiding the objects
92
- * that are not visible to the camera.
93
- */
94
- export declare class Cullers extends Component implements Disposable {
95
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
96
- private _enabled;
97
- list: Map<string, MeshCullerRenderer>;
98
- /** {@link Disposable.onDisposed} */
99
- readonly onDisposed: Event<unknown>;
100
- /** {@link Component.enabled} */
101
- get enabled(): boolean;
102
- set enabled(value: boolean);
103
- constructor(components: Components);
104
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
105
- delete(world: World): void;
106
- /** {@link Disposable.dispose} */
107
- dispose(): void;
108
- }
109
110
  import * as THREE from "three";
110
111
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
111
112
  import { SimplePlane } from "./src";
@@ -150,7 +151,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
150
151
  list: T[];
151
152
  protected PlaneType: new (...args: any) => SimplePlane | T;
152
153
  /** The material used in all the clipping planes. */
153
- protected _material: THREE.Material;
154
+ protected _material: THREE.MeshBasicMaterial;
154
155
  private _size;
155
156
  private _enabled;
156
157
  private _visible;
@@ -163,9 +164,9 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
163
164
  /** {@link Hideable.visible } */
164
165
  set visible(state: boolean);
165
166
  /** The material of the clipping plane representation. */
166
- get material(): THREE.Material;
167
+ get material(): THREE.MeshBasicMaterial;
167
168
  /** The material of the clipping plane representation. */
168
- set material(material: THREE.Material);
169
+ set material(material: THREE.MeshBasicMaterial);
169
170
  /** The size of the geometric representation of the clippings planes. */
170
171
  get size(): number;
171
172
  /** The size of the geometric representation of the clippings planes. */
@@ -209,60 +210,8 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
209
210
  private _onStartDragging;
210
211
  private _onEndDragging;
211
212
  }
212
- import { Component, Disposable, Event } from "../Types";
213
- /**
214
- * The entry point of the Components library.
215
- * It can:
216
- * - Create and access all the components of the library.
217
- * - Update all the updatable components automatically.
218
- * - Dispose all the components, preventing memory leaks.
219
- */
220
- export declare class Components implements Disposable {
221
- static readonly release = "1.4.21";
222
- /** {@link Disposable.onDisposed} */
223
- readonly onDisposed: Event<void>;
224
- /** The list of components created in this app. */
225
- readonly list: Map<string, Component>;
226
- /** If disabled, the animation loop will be stopped. */
227
- enabled: boolean;
228
- private _clock;
229
- add(uuid: string, instance: Component): void;
230
- /**
231
- * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
232
- * doesn't exist, it will instance it automatically.
233
- *
234
- * @param Component - The component to get or create.
235
- */
236
- get<U extends Component>(Component: new (components: Components) => U): U;
237
- constructor();
238
- /**
239
- * Initializes the library. It should be called at the start of the app after
240
- * initializing the scene, the renderer and the
241
- * camera. Additionally, if any component that need a raycaster is
242
- * used, the {@link raycaster} will need to be initialized.
243
- */
244
- init(): void;
245
- /**
246
- * Disposes the memory of all the components and tools of this instance of
247
- * the library. A memory leak will be created if:
248
- *
249
- * - An instance of the library ends up out of scope and this function isn't
250
- * called. This is especially relevant in Single Page Applications (React,
251
- * Angular, Vue, etc).
252
- *
253
- * - Any of the objects of this instance (meshes, geometries, etc) is
254
- * referenced by a reference type (object or array).
255
- *
256
- * You can learn more about how Three.js handles memory leaks
257
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
258
- *
259
- */
260
- dispose(): void;
261
- private update;
262
- private static setupBVH;
263
- }
264
213
  import * as THREE from "three";
265
- import { Component, Disposable, Event, World } from "../Types";
214
+ import { Component, Disposable, Event } from "../Types";
266
215
  import { Components } from "../Components";
267
216
  /**
268
217
  * A tool to easily handle the materials of massive amounts of
@@ -272,7 +221,6 @@ export declare class Materials extends Component implements Disposable {
272
221
  static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
273
222
  /** {@link Component.enabled} */
274
223
  enabled: boolean;
275
- private _originalBackground;
276
224
  /** {@link Disposable.onDisposed} */
277
225
  readonly onDisposed: Event<string>;
278
226
  list: {
@@ -283,6 +231,8 @@ export declare class Materials extends Component implements Disposable {
283
231
  };
284
232
  private _originals;
285
233
  constructor(components: Components);
234
+ /** {@link Disposable.dispose} */
235
+ dispose(): void;
286
236
  /**
287
237
  * Turns the specified material styles on or off.
288
238
  *
@@ -290,19 +240,6 @@ export declare class Materials extends Component implements Disposable {
290
240
  * @param ids the ids of the style to turn on or off.
291
241
  */
292
242
  set(active: boolean, ids?: string[]): void;
293
- /** {@link Disposable.dispose} */
294
- dispose(): void;
295
- /**
296
- * Sets the color of the background of the scene.
297
- *
298
- * @param color: the color to apply.
299
- */
300
- setBackgroundColor(color: THREE.Color, world: World): void;
301
- /**
302
- * Resets the scene background to the color that was being used
303
- * before applying the material manager.
304
- */
305
- resetBackgroundColor(world: World): void;
306
243
  /**
307
244
  * Creates a new material style.
308
245
  * @param id the identifier of the style to create.
@@ -322,200 +259,101 @@ export declare class Materials extends Component implements Disposable {
322
259
  */
323
260
  removeMeshes(id: string, meshes: THREE.Mesh[]): void;
324
261
  }
325
- import * as THREE from "three";
326
- import * as FRAGS from "bim-fragment";
327
- import { FragmentsGroup } from "bim-fragment";
328
- import { Component, Components, Disposable, Event } from "../../core";
329
- /**
330
- * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
331
- * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
332
- */
333
- export declare class FragmentBoundingBox extends Component implements Disposable {
334
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
335
- /** {@link Component.enabled} */
262
+ import { Component, Disposable, World, Event } from "../Types";
263
+ import { SimpleRaycaster } from "./src";
264
+ import { Components } from "../Components";
265
+ export declare class Raycasters extends Component implements Disposable {
266
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
336
267
  enabled: boolean;
337
- /** {@link Disposable.onDisposed} */
338
- readonly onDisposed: Event<unknown>;
339
- private _absoluteMin;
340
- private _absoluteMax;
341
- private _meshes;
268
+ list: Map<string, SimpleRaycaster>;
269
+ onDisposed: Event<unknown>;
342
270
  constructor(components: Components);
343
- static getDimensions(bbox: THREE.Box3): {
344
- width: number;
345
- height: number;
346
- depth: number;
347
- center: THREE.Vector3;
348
- };
349
- static newBound(positive: boolean): THREE.Vector3;
350
- static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
351
- /** {@link Disposable.dispose} */
271
+ get(world: World): SimpleRaycaster;
272
+ delete(world: World): void;
352
273
  dispose(): void;
353
- get(): THREE.Box3;
354
- getSphere(): THREE.Sphere;
355
- getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
356
- reset(): void;
357
- add(group: FragmentsGroup): void;
358
- addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
359
- private static getFragmentBounds;
360
- }
361
- export declare class UUID {
362
- private static _pattern;
363
- private static _lut;
364
- static create(): string;
365
- static validate(uuid: string): void;
366
- }
367
- import * as THREE from "three";
368
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
369
- center: THREE.Vector3;
370
- halfSizes: THREE.Vector3;
371
- rotation: THREE.Matrix3;
372
- transformation: THREE.Matrix4;
373
- };
374
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
375
- import * as THREE from "three";
376
- export declare class MaterialsUtils {
377
- static isTransparent(material: THREE.Material): boolean;
378
- }
379
- import * as FRAGS from "bim-fragment";
380
- import { Disposable, Component, Event, Components } from "../../core";
381
- export interface Classification {
382
- [system: string]: {
383
- [className: string]: FRAGS.FragmentIdMap;
384
- };
385
274
  }
386
- export declare class FragmentClassifier extends Component implements Disposable {
387
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
388
- /** {@link Component.enabled} */
389
- enabled: boolean;
390
- private _groupSystems;
391
- /** {@link Disposable.onDisposed} */
275
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
276
+ import { Components } from "../Components";
277
+ import { SimpleWorld } from "./src";
278
+ export declare class Worlds extends Component implements Updateable, Disposable {
279
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
280
+ readonly onAfterUpdate: Event<unknown>;
281
+ readonly onBeforeUpdate: Event<unknown>;
392
282
  readonly onDisposed: Event<unknown>;
283
+ list: Map<string, World>;
284
+ enabled: boolean;
393
285
  constructor(components: Components);
394
- private onFragmentsDisposed;
395
- /** {@link Component.get} */
396
- get(): Classification;
286
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
287
+ delete(world: World): void;
397
288
  dispose(): void;
398
- remove(guid: string): void;
399
- find(filter?: {
400
- [name: string]: string[];
401
- }): FRAGS.FragmentIdMap;
402
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
403
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
404
- byEntity(group: FRAGS.FragmentsGroup): void;
405
- byStorey(group: FRAGS.FragmentsGroup): void;
406
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
407
- private saveItem;
289
+ update(delta?: number): void | Promise<void>;
408
290
  }
409
- import { Fragment, FragmentsGroup } from "bim-fragment";
410
291
  import * as THREE from "three";
411
- import { Component, Components, Event, Disposable } from "../../core";
292
+ import { Components } from "../../core/Components";
293
+ import { SimpleCamera } from "../../core";
294
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
412
295
  /**
413
- * Object that can efficiently load binary files that contain
414
- * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
415
- */
416
- export declare class FragmentManager extends Component implements Disposable {
417
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
418
- /** {@link Disposable.onDisposed} */
419
- readonly onDisposed: Event<unknown>;
420
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
421
- readonly onFragmentsDisposed: Event<{
422
- groupID: string;
423
- fragmentIDs: string[];
424
- }>;
425
- /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
426
- readonly list: Map<string, Fragment>;
427
- readonly groups: Map<string, FragmentsGroup>;
428
- /** {@link Component.enabled} */
429
- enabled: boolean;
430
- baseCoordinationModel: string;
431
- private _loader;
432
- /** The list of meshes of the created fragments. */
433
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
296
+ * A flexible camera that uses
297
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
298
+ * easily control the camera in 2D and 3D. It supports multiple navigation
299
+ * modes, such as 2D floor plan navigation, first person and 3D orbit.
300
+ */
301
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
302
+ /**
303
+ * The current {@link NavigationMode}.
304
+ */
305
+ mode: NavigationMode;
306
+ readonly projection: ProjectionManager;
307
+ readonly threeOrtho: THREE.OrthographicCamera;
308
+ protected readonly _userInputButtons: any;
309
+ protected readonly _frustumSize = 50;
310
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
311
+ get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
434
312
  constructor(components: Components);
435
313
  /** {@link Disposable.dispose} */
436
314
  dispose(): void;
437
- disposeGroup(group: FragmentsGroup): void;
438
315
  /**
439
- * Loads one or many fragments into the scene.
440
- * @param data - the bytes containing the data for the fragments to load.
441
- * @param coordinate - whether this fragmentsgroup should be federated with the others.
442
- * @returns the list of IDs of the loaded fragments.
316
+ * Sets a new {@link NavigationMode} and disables the previous one.
317
+ *
318
+ * @param mode - The {@link NavigationMode} to set.
443
319
  */
444
- load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
320
+ set(mode: NavModeID): void;
445
321
  /**
446
- * Export the specified fragments.
447
- * @param group - the fragments group to be exported.
448
- * @returns the exported data as binary buffer.
322
+ * Make the camera view fit all the specified meshes.
323
+ *
324
+ * @param meshes the meshes to fit. If it is not defined, it will
325
+ * evaluate {@link Components.meshes}.
326
+ * @param offset the distance to the fit object
449
327
  */
450
- export(group: FragmentsGroup): Uint8Array;
451
- coordinate(models?: FragmentsGroup[]): void;
452
- }
453
- import * as WEBIFC from "web-ifc";
454
- import * as FRAGS from "bim-fragment";
455
- import { IfcFragmentSettings } from "./src";
456
- import { Component, Components, Event, Disposable } from "../../core";
457
- export declare class FragmentIfcLoader extends Component implements Disposable {
458
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
459
- readonly onIfcLoaded: Event<FRAGS.FragmentsGroup>;
460
- readonly onIfcStartedLoading: Event<void>;
461
- readonly onSetup: Event<void>;
462
- /** {@link Disposable.onDisposed} */
463
- readonly onDisposed: Event<string>;
464
- settings: IfcFragmentSettings;
465
- enabled: boolean;
466
- webIfc: WEBIFC.IfcAPI;
467
- private _material;
468
- private _spatialTree;
469
- private _metaData;
470
- private _fragmentInstances;
471
- private _civil;
472
- private _propertyExporter;
473
- private _visitedFragments;
474
- private _materialT;
475
- constructor(components: Components);
476
- dispose(): void;
477
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
478
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
479
- readIfcFile(data: Uint8Array): Promise<number>;
480
- private getAllGeometries;
481
- cleanUp(): void;
482
- private getMesh;
483
- private getGeometry;
484
- private autoSetWasm;
485
- }
486
- import { FragmentsGroup } from "bim-fragment";
487
- import { Disposable, Event, Component, Components } from "../../core";
488
- import { IfcPropertiesManager } from "../IfcPropertiesManager";
489
- interface IndexMap {
490
- [modelID: string]: {
491
- [expressID: string]: Set<number>;
492
- };
328
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
329
+ /**
330
+ * Allows or prevents all user input.
331
+ *
332
+ * @param active - whether to enable or disable user inputs.
333
+ */
334
+ setUserInput(active: boolean): void;
335
+ private disableUserInput;
336
+ private enableUserInput;
337
+ private newOrthoCamera;
338
+ private setOrthoCameraAspect;
493
339
  }
494
- export declare class IfcPropertiesIndexer extends Component implements Disposable {
495
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
496
- /** {@link Disposable.onDisposed} */
497
- readonly onDisposed: Event<string>;
340
+ import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
341
+ import { MiniMap } from "./src";
342
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
343
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
344
+ readonly onAfterUpdate: Event<unknown>;
345
+ readonly onBeforeUpdate: Event<unknown>;
346
+ readonly onDisposed: Event<unknown>;
498
347
  enabled: boolean;
499
- relationsToProcess: number[];
500
- indexMap: IndexMap;
501
- private _propertiesManager;
502
- readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
503
- set propertiesManager(manager: IfcPropertiesManager | null);
504
- get propertiesManager(): IfcPropertiesManager | null;
348
+ list: Map<string, MiniMap>;
505
349
  constructor(components: Components);
506
- private onFragmentsDisposed;
507
- dispose(): Promise<void>;
508
- getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
509
- private getNestedPsets;
510
- private getPsetProperties;
511
- process(model: FragmentsGroup): Promise<void>;
512
- private setEntityIndex;
513
- private cloneProperty;
514
- private clonePropertyArray;
350
+ create(world: World): MiniMap;
351
+ delete(id: string): void;
352
+ dispose(): void | Promise<void>;
353
+ update(): void;
515
354
  }
516
- export {};
517
355
  import * as WEBIFC from "web-ifc";
518
- import * as FRAG from "bim-fragment";
356
+ import * as FRAG from "@thatopen/fragments";
519
357
  /**
520
358
  * Object to export all the properties from an IFC to a JS object.
521
359
  */
@@ -530,8 +368,52 @@ export declare class IfcJsonExporter {
530
368
  */
531
369
  export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
532
370
  }
371
+ import * as THREE from "three";
372
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
373
+ center: THREE.Vector3;
374
+ halfSizes: THREE.Vector3;
375
+ rotation: THREE.Matrix3;
376
+ transformation: THREE.Matrix4;
377
+ };
378
+ import * as FRAGS from "@thatopen/fragments";
379
+ import { FragmentsGroup } from "@thatopen/fragments";
380
+ import { Disposable, Event, Component, Components } from "../../core";
381
+ import { QueryGroup } from "./src/types";
382
+ export interface QueryResult {
383
+ [modelID: string]: {
384
+ modelEntities: Set<number>;
385
+ otherEntities: Set<number>;
386
+ };
387
+ }
388
+ export interface IndexedModels {
389
+ [modelID: string]: {
390
+ [expressID: number]: Set<number>;
391
+ };
392
+ }
393
+ export declare class IfcPropertiesFinder extends Component implements Disposable {
394
+ readonly onFound: Event<FRAGS.FragmentIdMap>;
395
+ /** {@link Disposable.onDisposed} */
396
+ readonly onDisposed: Event<unknown>;
397
+ enabled: boolean;
398
+ indexedModels: IndexedModels;
399
+ private readonly _conditionFunctions;
400
+ private _noHandleAttributes;
401
+ constructor(components: Components);
402
+ private onFragmentsDisposed;
403
+ dispose(): void;
404
+ private indexEntityRelations;
405
+ find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
406
+ private toFragmentMap;
407
+ private simpleQuery;
408
+ private getMatchingEntities;
409
+ private combineArrays;
410
+ private getCommonElements;
411
+ private arrayIntersection;
412
+ private arrayUnion;
413
+ private getConditionFunctions;
414
+ }
533
415
  import * as WEBIFC from "web-ifc";
534
- import { FragmentsGroup } from "bim-fragment";
416
+ import { FragmentsGroup } from "@thatopen/fragments";
535
417
  import { Component, Disposable, Event, Components } from "../../core";
536
418
  type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
537
419
  type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
@@ -582,7 +464,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
582
464
  get(): ChangeMap;
583
465
  dispose(): void;
584
466
  private increaseMaxID;
585
- static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
467
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
586
468
  private newGUID;
587
469
  private getOwnerHistory;
588
470
  private registerChange;
@@ -603,102 +485,779 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
603
485
  setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
604
486
  }
605
487
  export {};
606
- import * as FRAGS from "bim-fragment";
607
- import { FragmentsGroup } from "bim-fragment";
608
- import { Disposable, Event, Component, Components } from "../../core";
609
- import { QueryGroup } from "./src/types";
610
- export interface QueryResult {
611
- [modelID: string]: {
612
- modelEntities: Set<number>;
613
- otherEntities: Set<number>;
614
- };
615
- }
616
- export interface IndexedModels {
617
- [modelID: string]: {
618
- [expressID: number]: Set<number>;
619
- };
620
- }
621
- export declare class IfcPropertiesFinder extends Component implements Disposable {
622
- readonly onFound: Event<FRAGS.FragmentIdMap>;
488
+ import { Components } from "../Components";
489
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
490
+ import { Component, Event, Disposable, World } from "../Types";
491
+ /**
492
+ * A tool to handle big scenes efficiently by automatically hiding the objects
493
+ * that are not visible to the camera.
494
+ */
495
+ export declare class Cullers extends Component implements Disposable {
496
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
497
+ private _enabled;
498
+ list: Map<string, MeshCullerRenderer>;
623
499
  /** {@link Disposable.onDisposed} */
624
500
  readonly onDisposed: Event<unknown>;
625
- enabled: boolean;
626
- indexedModels: IndexedModels;
627
- private readonly _conditionFunctions;
628
- private _noHandleAttributes;
501
+ /** {@link Component.enabled} */
502
+ get enabled(): boolean;
503
+ set enabled(value: boolean);
629
504
  constructor(components: Components);
630
- private onFragmentsDisposed;
505
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
506
+ delete(world: World): void;
507
+ /** {@link Disposable.dispose} */
631
508
  dispose(): void;
632
- private indexEntityRelations;
633
- find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
634
- private toFragmentMap;
635
- private simpleQuery;
636
- private getMatchingEntities;
637
- private combineArrays;
638
- private getCommonElements;
639
- private arrayIntersection;
640
- private arrayUnion;
641
- private getConditionFunctions;
642
- }
643
- export declare const GeometryTypes: Set<number>;
644
- export declare const IfcElements: {
645
- [key: number]: string;
646
- };
647
- export declare const IfcCategoryMap: {
648
- [key: number]: string;
649
- };
650
- import * as FRAGS from "bim-fragment";
651
- export declare class IfcPropertiesUtils {
652
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
653
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
654
- [attribute: string]: any;
655
- } | null>;
656
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
657
- [relatingID: number]: number[];
658
- }>;
659
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
660
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
661
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
662
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
663
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
664
- key: string | null;
665
- name: string | null;
666
- }>;
667
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
668
- key: string | null;
669
- value: number | null;
670
- }>;
671
- static isRel(expressID: number): boolean;
672
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
673
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
674
509
  }
675
510
  import * as WEBIFC from "web-ifc";
676
- export interface IfcItemsCategories {
677
- [itemID: number]: number;
678
- }
679
- export declare class IfcCategories {
680
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
681
- }
682
- import * as THREE from "three";
683
- import CameraControls from "camera-controls";
684
- import { Event } from "./event";
511
+ import { FragmentsGroup } from "@thatopen/fragments";
512
+ import { Disposable, Event, Component, Components } from "../../core";
513
+ import { RelationsMap, ModelsRelationMap, InverseAttributes, InverseAttribute } from "./src/types";
685
514
  /**
686
- * Whether this component has to be manually destroyed once you are done with
687
- * it to prevent
688
- * [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
689
- * This also ensures that the DOM events created by that component will be
690
- * cleaned up.
515
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
516
+ * 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.
691
517
  */
692
- export interface Disposable {
518
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
519
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
520
+ /** {@link Disposable.onDisposed} */
521
+ readonly onDisposed: Event<string>;
522
+ enabled: boolean;
523
+ readonly onRelationsIndexed: Event<{
524
+ modelID: string;
525
+ relationsMap: RelationsMap;
526
+ }>;
527
+ private _relToAttributesMap;
693
528
  /**
694
- * Destroys the object from memory to prevent a
695
- * [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
529
+ * Array of inverse attribute names.
530
+ * This array is used to define the inverse attributes that the indexer will process and index.
696
531
  */
697
- dispose: () => void | Promise<void>;
698
- /** Fired after the tool has been {@link Disposable.dispose()} */
699
- readonly onDisposed: Event<any>;
700
- }
701
- /**
532
+ readonly inverseAttributes: InverseAttributes;
533
+ /**
534
+ * Holds the relationship mappings for each model processed by the indexer.
535
+ * The structure is a map where each key is a model's UUID, and the value is another map.
536
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
537
+ * representing a specific relation type, and the value is an array of expressIDs of entities
538
+ * that are related through that relation type. This structure allows for efficient querying
539
+ * of entity relationships within a model.
540
+ */
541
+ readonly relationMaps: ModelsRelationMap;
542
+ constructor(components: Components);
543
+ private onFragmentsDisposed;
544
+ private getAttributeRels;
545
+ /**
546
+ * Adds a relation map to the model's relations map.
547
+ *
548
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
549
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
550
+ *
551
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
552
+ */
553
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
554
+ /**
555
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
556
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
557
+ * and maps them in a structured way to facilitate quick access to related entities.
558
+ *
559
+ * The process involves querying the model for each relation type associated with the inverse attributes
560
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
561
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
562
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
563
+ * of entities that are related through that attribute.
564
+ *
565
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
566
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
567
+ * representation of the relations indexed by entity expressIDs and relation types.
568
+ * @throws An error if the model does not have properties loaded.
569
+ */
570
+ process(model: FragmentsGroup): Promise<RelationsMap>;
571
+ /**
572
+ * Processes a given model from a WebIfc API to index its IFC entities relations based on predefined inverse attributes.
573
+ *
574
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
575
+ * @param modelID - The unique identifier of the model within the WebIfc API.
576
+ * @returns A promise that resolves to the relations map for the processed model.
577
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
578
+ */
579
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
580
+ /**
581
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
582
+ * This method searches the indexed relation maps for the specified model and entity,
583
+ * returning the IDs of related entities if a match is found.
584
+ *
585
+ * @param model The 'FragmentsGroup' model containing the entity.
586
+ * @param expressID The unique identifier of the entity within the model.
587
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
588
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
589
+ * or the specified relation name is not indexed.
590
+ */
591
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
592
+ /**
593
+ * Serializes the relations of a given relation map into a JSON string.
594
+ * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
595
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
596
+ * The resulting object is then serialized into a JSON string.
597
+ *
598
+ * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
599
+ * @returns A JSON string representing the serialized relations of the given relation map.
600
+ */
601
+ serializeRelations(relationMap: RelationsMap): string;
602
+ /**
603
+ * Serializes the relations of a specific model into a JSON string.
604
+ * This method iterates through the relations indexed for the given model,
605
+ * organizing them into a structured object where each key is an expressID of an entity,
606
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
607
+ * The resulting object is then serialized into a JSON string.
608
+ *
609
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
610
+ * @returns A JSON string representing the serialized relations of the specified model.
611
+ * If the model has no indexed relations, 'null' is returned.
612
+ */
613
+ serializeModelRelations(model: FragmentsGroup): string | null;
614
+ /**
615
+ * Serializes all relations of every model processed by the indexer into a JSON string.
616
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
617
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
618
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
619
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
620
+ *
621
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
622
+ * If no relations have been indexed, an empty object is returned as a JSON string.
623
+ */
624
+ serializeAllRelations(): string;
625
+ /**
626
+ * Converts a JSON string representing relations between entities into a structured map.
627
+ * This method parses the JSON string to reconstruct the relations map that indexes
628
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
629
+ * and the values are maps where each key is a relation type ID and its value is an array
630
+ * of express IDs of entities related through that relation type.
631
+ *
632
+ * @param json The JSON string to be parsed into the relations map.
633
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
634
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
635
+ * is an array of express IDs (as numbers) of entities related through that relation type.
636
+ */
637
+ getRelationsMapFromJSON(json: string): RelationsMap;
638
+ /**
639
+ * Disposes the component, cleaning up resources and detaching event listeners.
640
+ * This ensures that the component is properly cleaned up and does not leave behind any
641
+ * references that could prevent garbage collection.
642
+ */
643
+ dispose(): void;
644
+ }
645
+ import * as THREE from "three";
646
+ import * as FRAGS from "@thatopen/fragments";
647
+ import { FragmentsGroup } from "@thatopen/fragments";
648
+ import { Component, Components, Disposable, Event } from "../../core";
649
+ /**
650
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
651
+ * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
652
+ */
653
+ export declare class BoundingBoxes extends Component implements Disposable {
654
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
655
+ /** {@link Component.enabled} */
656
+ enabled: boolean;
657
+ /** {@link Disposable.onDisposed} */
658
+ readonly onDisposed: Event<unknown>;
659
+ private _absoluteMin;
660
+ private _absoluteMax;
661
+ private _meshes;
662
+ constructor(components: Components);
663
+ static getDimensions(bbox: THREE.Box3): {
664
+ width: number;
665
+ height: number;
666
+ depth: number;
667
+ center: THREE.Vector3;
668
+ };
669
+ static newBound(positive: boolean): THREE.Vector3;
670
+ static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
671
+ /** {@link Disposable.dispose} */
672
+ dispose(): void;
673
+ get(): THREE.Box3;
674
+ getSphere(): THREE.Sphere;
675
+ getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
676
+ reset(): void;
677
+ add(group: FragmentsGroup): void;
678
+ addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
679
+ private static getFragmentBounds;
680
+ }
681
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
682
+ import * as FRAGS from "@thatopen/fragments";
683
+ import { Components, Component } from "../../core";
684
+ export declare class FragmentHider extends Component {
685
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
686
+ enabled: boolean;
687
+ constructor(components: Components);
688
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
689
+ isolate(items: FRAGS.FragmentIdMap): void;
690
+ private updateCulledVisibility;
691
+ }
692
+ import * as THREE from "three";
693
+ import * as FRAGS from "@thatopen/fragments";
694
+ import { Disposable, Component, Event, Components } from "../../core";
695
+ export interface Classification {
696
+ [system: string]: {
697
+ [className: string]: FRAGS.FragmentIdMap;
698
+ };
699
+ }
700
+ export declare class FragmentClassifier extends Component implements Disposable {
701
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
702
+ /** {@link Component.enabled} */
703
+ enabled: boolean;
704
+ list: Classification;
705
+ /** {@link Disposable.onDisposed} */
706
+ readonly onDisposed: Event<unknown>;
707
+ constructor(components: Components);
708
+ private onFragmentsDisposed;
709
+ dispose(): void;
710
+ remove(guid: string): void;
711
+ find(filter?: {
712
+ [name: string]: string[];
713
+ }): FRAGS.FragmentIdMap;
714
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
715
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
716
+ byEntity(group: FRAGS.FragmentsGroup): void;
717
+ byStorey(group: FRAGS.FragmentsGroup): void;
718
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
719
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
720
+ resetColor(items: FRAGS.FragmentIdMap): void;
721
+ private saveItem;
722
+ }
723
+ import { Component, Disposable, Event, Components } from "../../core";
724
+ export declare class FragmentExploder extends Component implements Disposable {
725
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
726
+ enabled: boolean;
727
+ height: number;
728
+ groupName: string;
729
+ /** {@link Disposable.onDisposed} */
730
+ readonly onDisposed: Event<string>;
731
+ list: Set<string>;
732
+ constructor(components: Components);
733
+ dispose(): void;
734
+ explode(): void;
735
+ reset(): void;
736
+ update(): void;
737
+ }
738
+ import * as WEBIFC from "web-ifc";
739
+ import * as FRAGS from "@thatopen/fragments";
740
+ import { IfcFragmentSettings } from "./src";
741
+ import { Component, Components, Event, Disposable } from "../../core";
742
+ export declare class FragmentIfcLoader extends Component implements Disposable {
743
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
744
+ readonly onIfcStartedLoading: Event<void>;
745
+ readonly onSetup: Event<void>;
746
+ /** {@link Disposable.onDisposed} */
747
+ readonly onDisposed: Event<string>;
748
+ settings: IfcFragmentSettings;
749
+ enabled: boolean;
750
+ webIfc: WEBIFC.IfcAPI;
751
+ private _material;
752
+ private _spatialTree;
753
+ private _metaData;
754
+ private _fragmentInstances;
755
+ private _civil;
756
+ private _propertyExporter;
757
+ private _visitedFragments;
758
+ private _materialT;
759
+ constructor(components: Components);
760
+ dispose(): void;
761
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
762
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
763
+ readIfcFile(data: Uint8Array): Promise<number>;
764
+ private getAllGeometries;
765
+ cleanUp(): void;
766
+ private getMesh;
767
+ private getGeometry;
768
+ private autoSetWasm;
769
+ }
770
+ import * as WEBIFC from "web-ifc";
771
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
772
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
773
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
774
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
775
+ onPropertiesStreamed: AsyncEvent<{
776
+ type: number;
777
+ data: {
778
+ [id: number]: any;
779
+ };
780
+ }>;
781
+ onProgress: AsyncEvent<number>;
782
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
783
+ /** {@link Disposable.onDisposed} */
784
+ readonly onDisposed: Event<string>;
785
+ enabled: boolean;
786
+ settings: PropertiesStreamingSettings;
787
+ webIfc: WEBIFC.IfcAPI;
788
+ dispose(): Promise<void>;
789
+ streamFromBuffer(data: Uint8Array): Promise<void>;
790
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
791
+ private readIfcFile;
792
+ private streamIfcFile;
793
+ private streamAllProperties;
794
+ private cleanUp;
795
+ }
796
+ import * as WEBIFC from "web-ifc";
797
+ import { Components, Disposable, Event, Component } from "../../core";
798
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
799
+ export declare class IfcGeometryTiler extends Component implements Disposable {
800
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
801
+ onGeometryStreamed: Event<{
802
+ buffer: Uint8Array;
803
+ data: StreamedGeometries;
804
+ }>;
805
+ onAssetStreamed: Event<StreamedAsset[]>;
806
+ onProgress: Event<number>;
807
+ onIfcLoaded: Event<Uint8Array>;
808
+ /** {@link Disposable.onDisposed} */
809
+ readonly onDisposed: Event<unknown>;
810
+ settings: IfcStreamingSettings;
811
+ enabled: boolean;
812
+ webIfc: WEBIFC.IfcAPI;
813
+ private _spatialTree;
814
+ private _metaData;
815
+ private _visitedGeometries;
816
+ private _streamSerializer;
817
+ private _geometries;
818
+ private _geometryCount;
819
+ private _civil;
820
+ private _groupSerializer;
821
+ private _assets;
822
+ private _meshesWithHoles;
823
+ constructor(components: Components);
824
+ dispose(): void;
825
+ streamFromBuffer(data: Uint8Array): Promise<void>;
826
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
827
+ private readIfcFile;
828
+ private streamIfcFile;
829
+ private streamAllGeometries;
830
+ private cleanUp;
831
+ private getMesh;
832
+ private getGeometry;
833
+ private streamAssets;
834
+ private streamGeometries;
835
+ }
836
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
837
+ import * as THREE from "three";
838
+ import { Component, Components, Event, Disposable } from "../../core";
839
+ /**
840
+ * Object that can efficiently load binary files that contain
841
+ * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
842
+ */
843
+ export declare class FragmentManager extends Component implements Disposable {
844
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
845
+ /** {@link Disposable.onDisposed} */
846
+ readonly onDisposed: Event<unknown>;
847
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
848
+ readonly onFragmentsDisposed: Event<{
849
+ groupID: string;
850
+ fragmentIDs: string[];
851
+ }>;
852
+ /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
853
+ readonly list: Map<string, Fragment>;
854
+ readonly groups: Map<string, FragmentsGroup>;
855
+ /** {@link Component.enabled} */
856
+ enabled: boolean;
857
+ baseCoordinationModel: string;
858
+ private _loader;
859
+ /** The list of meshes of the created fragments. */
860
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
861
+ constructor(components: Components);
862
+ /** {@link Disposable.dispose} */
863
+ dispose(): void;
864
+ disposeGroup(group: FragmentsGroup): void;
865
+ /**
866
+ * Loads one or many fragments into the scene.
867
+ * @param data - the bytes containing the data for the fragments to load.
868
+ * @param coordinate - whether this fragmentsgroup should be federated with the others.
869
+ * @returns the list of IDs of the loaded fragments.
870
+ */
871
+ load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
872
+ /**
873
+ * Export the specified fragments.
874
+ * @param group - the fragments group to be exported.
875
+ * @returns the exported data as binary buffer.
876
+ */
877
+ export(group: FragmentsGroup): Uint8Array;
878
+ coordinate(models?: FragmentsGroup[]): void;
879
+ }
880
+ import * as THREE from "three";
881
+ export declare class MaterialsUtils {
882
+ static isTransparent(material: THREE.Material): boolean;
883
+ }
884
+ export declare class UUID {
885
+ private static _pattern;
886
+ private static _lut;
887
+ static create(): string;
888
+ static validate(uuid: string): void;
889
+ }
890
+ import * as THREE from "three";
891
+ import { Component, Components, Event, World, Disposable } from "../core";
892
+ export interface VertexPickerConfig {
893
+ showOnlyVertex: boolean;
894
+ snapDistance: number;
895
+ previewElement: HTMLElement;
896
+ }
897
+ export declare class VertexPicker extends Component implements Disposable {
898
+ onVertexFound: Event<THREE.Vector3>;
899
+ onVertexLost: Event<THREE.Vector3>;
900
+ components: Components;
901
+ private _pickedPoint;
902
+ private _config;
903
+ private _enabled;
904
+ private _workingPlane;
905
+ /** {@link Disposable.onDisposed} */
906
+ readonly onDisposed: Event<unknown>;
907
+ set enabled(value: boolean);
908
+ get enabled(): boolean;
909
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
910
+ [Symbol.dispose](): void;
911
+ set workingPlane(plane: THREE.Plane | null);
912
+ get workingPlane(): THREE.Plane | null;
913
+ set config(value: Partial<VertexPickerConfig>);
914
+ get config(): Partial<VertexPickerConfig>;
915
+ dispose(): void;
916
+ get(world: World): THREE.Vector3 | null;
917
+ private getClosestVertex;
918
+ private getVertices;
919
+ private getVertex;
920
+ }
921
+ export declare const IfcElements: {
922
+ [key: number]: string;
923
+ };
924
+ import * as WEBIFC from "web-ifc";
925
+ export interface IfcItemsCategories {
926
+ [itemID: number]: number;
927
+ }
928
+ export declare class IfcCategories {
929
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
930
+ }
931
+ import * as FRAGS from "@thatopen/fragments";
932
+ export declare class IfcPropertiesUtils {
933
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
934
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
935
+ [attribute: string]: any;
936
+ } | null>;
937
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
938
+ [relatingID: number]: number[];
939
+ }>;
940
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
941
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
942
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
943
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
944
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
945
+ key: string | null;
946
+ name: string | null;
947
+ }>;
948
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
949
+ key: string | null;
950
+ value: number | null;
951
+ }>;
952
+ static isRel(expressID: number): boolean;
953
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
954
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
955
+ }
956
+ export declare const IfcCategoryMap: {
957
+ [key: number]: string;
958
+ };
959
+ import * as THREE from "three";
960
+ export interface MeasureEdge {
961
+ distance: number;
962
+ points: THREE.Vector3[];
963
+ }
964
+ export declare class MeasurementUtils {
965
+ static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
966
+ edges: MeasureEdge[];
967
+ indices: Set<number>;
968
+ } | null;
969
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
970
+ private static getFaceData;
971
+ static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
972
+ p1: THREE.Vector3;
973
+ p2: THREE.Vector3;
974
+ p3: THREE.Vector3;
975
+ faceNormal: THREE.Vector3;
976
+ };
977
+ private static round;
978
+ }
979
+ export declare const GeometryTypes: Set<number>;
980
+ import * as THREE from "three";
981
+ import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
982
+ export declare class MiniMap implements Resizeable, Updateable, Disposable {
983
+ /** {@link Disposable.onDisposed} */
984
+ readonly onDisposed: Event<unknown>;
985
+ readonly onAfterUpdate: Event<unknown>;
986
+ readonly onBeforeUpdate: Event<unknown>;
987
+ readonly onResize: Event<THREE.Vector2>;
988
+ frontOffset: number;
989
+ overrideMaterial: THREE.MeshDepthMaterial;
990
+ backgroundColor: THREE.Color;
991
+ renderer: THREE.WebGLRenderer;
992
+ enabled: boolean;
993
+ world: World;
994
+ private _lockRotation;
995
+ private _camera;
996
+ private _plane;
997
+ private _size;
998
+ private _tempVector1;
999
+ private _tempVector2;
1000
+ private _tempTarget;
1001
+ private readonly down;
1002
+ get lockRotation(): boolean;
1003
+ set lockRotation(active: boolean);
1004
+ get zoom(): number;
1005
+ set zoom(value: number);
1006
+ constructor(world: World);
1007
+ dispose(): void;
1008
+ get(): THREE.OrthographicCamera;
1009
+ update(): void;
1010
+ getSize(): THREE.Vector2;
1011
+ resize(size?: THREE.Vector2): void;
1012
+ private updatePlanes;
1013
+ }
1014
+ export declare const relToAttributesMap: Map<number, {
1015
+ forRelating?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
1016
+ forRelated?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
1017
+ }>;
1018
+ import * as WEBIFC from "web-ifc";
1019
+ import { IfcItemsCategories } from "../../../ifc";
1020
+ export declare class SpatialStructure {
1021
+ itemsByFloor: IfcItemsCategories;
1022
+ private _units;
1023
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1024
+ cleanUp(): void;
1025
+ }
1026
+ import * as THREE from "three";
1027
+ import { Disposable, Event } from "../../Types";
1028
+ /**
1029
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1030
+ * to work with tools like the
1031
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1032
+ * been transformed through CSS or doesn't occupy the whole screen.
1033
+ */
1034
+ export declare class Mouse implements Disposable {
1035
+ dom: HTMLCanvasElement;
1036
+ private _event?;
1037
+ private _position;
1038
+ /** {@link Disposable.onDisposed} */
1039
+ readonly onDisposed: Event<unknown>;
1040
+ constructor(dom: HTMLCanvasElement);
1041
+ /**
1042
+ * The real position of the mouse of the Three.js canvas.
1043
+ */
1044
+ get position(): THREE.Vector2;
1045
+ /** {@link Disposable.dispose} */
1046
+ dispose(): void;
1047
+ private getPositionY;
1048
+ private getPositionX;
1049
+ private updateMouseInfo;
1050
+ private setupEvents;
1051
+ }
1052
+ export declare const getRelationMap: (properties: Record<string, Record<string, any>>, relationType: number, onElementsFound?: ((relatingID: number, relatedIDs: number[]) => void) | undefined) => {
1053
+ [relatingID: number]: number[];
1054
+ };
1055
+ import * as THREE from "three";
1056
+ import { Components } from "../../Components";
1057
+ import { Event, World, Disposable } from "../../Types";
1058
+ import { Mouse } from "./mouse";
1059
+ /**
1060
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1061
+ * that allows to easily get items from the scene using the mouse and touch
1062
+ * events.
1063
+ */
1064
+ export declare class SimpleRaycaster implements Disposable {
1065
+ /** {@link Component.enabled} */
1066
+ enabled: boolean;
1067
+ components: Components;
1068
+ /** {@link Disposable.onDisposed} */
1069
+ readonly onDisposed: Event<unknown>;
1070
+ /** The position of the mouse in the screen. */
1071
+ readonly mouse: Mouse;
1072
+ readonly three: THREE.Raycaster;
1073
+ world: World;
1074
+ constructor(components: Components, world: World);
1075
+ /** {@link Disposable.dispose} */
1076
+ dispose(): void;
1077
+ /**
1078
+ * Throws a ray from the camera to the mouse or touch event point and returns
1079
+ * the first item found. This also takes into account the clipping planes
1080
+ * used by the renderer.
1081
+ *
1082
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1083
+ * to query. If not provided, it will query all the meshes stored in
1084
+ * {@link Components.meshes}.
1085
+ */
1086
+ castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
1087
+ 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;
1088
+ private intersect;
1089
+ private filterClippingPlanes;
1090
+ }
1091
+ import { NavigationMode } from "./types";
1092
+ /**
1093
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1094
+ * like many BIM tools.
1095
+ */
1096
+ export declare class PlanMode implements NavigationMode {
1097
+ private camera;
1098
+ /** {@link NavigationMode.enabled} */
1099
+ enabled: boolean;
1100
+ /** {@link NavigationMode.id} */
1101
+ readonly id = "Plan";
1102
+ private mouseAction1?;
1103
+ private mouseAction2?;
1104
+ private mouseInitialized;
1105
+ private readonly defaultAzimuthSpeed;
1106
+ private readonly defaultPolarSpeed;
1107
+ constructor(camera: any);
1108
+ /** {@link NavigationMode.set} */
1109
+ set(active: boolean): void;
1110
+ }
1111
+ import { NavigationMode } from "./types";
1112
+ /**
1113
+ * A {@link NavigationMode} that allows 3D navigation and panning
1114
+ * like in many 3D and CAD softwares.
1115
+ */
1116
+ export declare class OrbitMode implements NavigationMode {
1117
+ camera: any;
1118
+ /** {@link NavigationMode.enabled} */
1119
+ enabled: boolean;
1120
+ /** {@link NavigationMode.id} */
1121
+ readonly id = "Orbit";
1122
+ constructor(camera: any);
1123
+ /** {@link NavigationMode.set} */
1124
+ set(active: boolean): void;
1125
+ private activateOrbitControls;
1126
+ }
1127
+ /**
1128
+ * The projection system of the camera.
1129
+ */
1130
+ export type CameraProjection = "Perspective" | "Orthographic";
1131
+ /**
1132
+ * The extensible list of supported navigation modes.
1133
+ */
1134
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1135
+ /**
1136
+ * An object that determines the behavior of the camera controls
1137
+ * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1138
+ */
1139
+ export interface NavigationMode {
1140
+ /** The unique ID of this navigation mode. */
1141
+ id: NavModeID;
1142
+ /**
1143
+ * Enable or disable this navigation mode.
1144
+ * When a new navigation mode is enabled, the previous navigation mode
1145
+ * must be disabled.
1146
+ *
1147
+ * @param active - whether to enable or disable this mode.
1148
+ * @param options - any additional data required to enable or disable it.
1149
+ * */
1150
+ set: (active: boolean, options?: any) => void;
1151
+ /** Whether this navigation mode is active or not. */
1152
+ enabled: boolean;
1153
+ }
1154
+ import * as THREE from "three";
1155
+ import { CameraProjection } from "./types";
1156
+ import { Event } from "../../../core";
1157
+ import { OrthoPerspectiveCamera } from "../index";
1158
+ /**
1159
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1160
+ */
1161
+ export declare class ProjectionManager {
1162
+ /**
1163
+ * Event that fires when the {@link CameraProjection} changes.
1164
+ */
1165
+ readonly onChanged: Event<THREE.Camera>;
1166
+ current: CameraProjection;
1167
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1168
+ private _component;
1169
+ private _previousDistance;
1170
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
1171
+ matchOrthoDistanceEnabled: boolean;
1172
+ constructor(camera: OrthoPerspectiveCamera);
1173
+ /**
1174
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1175
+ *
1176
+ * @param projection - the new projection to set. If it is the current projection,
1177
+ * it will have no effect.
1178
+ */
1179
+ set(projection: CameraProjection): Promise<void>;
1180
+ /**
1181
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
1182
+ * and vice versa.
1183
+ */
1184
+ toggle(): Promise<void>;
1185
+ private setOrthoCamera;
1186
+ private getDims;
1187
+ private setupOrthoCamera;
1188
+ private getDistance;
1189
+ private setPerspectiveCamera;
1190
+ }
1191
+ import { NavigationMode } from "./types";
1192
+ /**
1193
+ * A {@link NavigationMode} that allows first person navigation,
1194
+ * simulating FPS video games.
1195
+ */
1196
+ export declare class FirstPersonMode implements NavigationMode {
1197
+ private camera;
1198
+ /** {@link NavigationMode.enabled} */
1199
+ enabled: boolean;
1200
+ /** {@link NavigationMode.id} */
1201
+ readonly id = "FirstPerson";
1202
+ constructor(camera: any);
1203
+ /** {@link NavigationMode.set} */
1204
+ set(active: boolean): void;
1205
+ private setupFirstPersonCamera;
1206
+ }
1207
+ /**
1208
+ * Simple event handler by
1209
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1210
+ * Keep in mind that:
1211
+ * - If you want to remove it later, you might want to declare the callback as
1212
+ * an object.
1213
+ * - If you want to maintain the reference to 'this', you will need to declare
1214
+ * the callback as an arrow function.
1215
+ */
1216
+ export declare class Event<T> {
1217
+ /**
1218
+ * Add a callback to this event instance.
1219
+ * @param handler - the callback to be added to this event.
1220
+ */
1221
+ add(handler: T extends void ? {
1222
+ (): void;
1223
+ } : {
1224
+ (data: T): void;
1225
+ }): void;
1226
+ /**
1227
+ * Removes a callback from this event instance.
1228
+ * @param handler - the callback to be removed from this event.
1229
+ */
1230
+ remove(handler: T extends void ? {
1231
+ (): void;
1232
+ } : {
1233
+ (data: T): void;
1234
+ }): void;
1235
+ /** Triggers all the callbacks assigned to this event. */
1236
+ trigger: (data?: T) => void;
1237
+ /** Gets rid of all the suscribed events. */
1238
+ reset(): void;
1239
+ private handlers;
1240
+ }
1241
+ import * as THREE from "three";
1242
+ import CameraControls from "camera-controls";
1243
+ import { Event } from "./event";
1244
+ /**
1245
+ * Whether this component has to be manually destroyed once you are done with
1246
+ * it to prevent
1247
+ * [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1248
+ * This also ensures that the DOM events created by that component will be
1249
+ * cleaned up.
1250
+ */
1251
+ export interface Disposable {
1252
+ /**
1253
+ * Destroys the object from memory to prevent a
1254
+ * [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1255
+ */
1256
+ dispose: () => void | Promise<void>;
1257
+ /** Fired after the tool has been {@link Disposable.dispose()} */
1258
+ readonly onDisposed: Event<any>;
1259
+ }
1260
+ /**
702
1261
  * Whether the geometric representation of this component can be
703
1262
  * hidden or shown in the
704
1263
  * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
@@ -744,7 +1303,7 @@ export interface Updateable {
744
1303
  * Function used to update the state of this component each frame. For
745
1304
  * instance, a renderer component will make a render each frame.
746
1305
  */
747
- update(delta?: number): void | Promise<void>;
1306
+ update(delta?: number): void;
748
1307
  }
749
1308
  /** Basic type to describe the progress of any kind of process. */
750
1309
  export interface Progress {
@@ -759,31 +1318,20 @@ export interface Progress {
759
1318
  * dimensions.
760
1319
  */
761
1320
  export interface Createable {
762
- readonly onBeforeCreate: Event<any>;
763
1321
  /** Creates a new instance of an element (e.g. a new Dimension). */
764
1322
  create: (data: any) => void;
765
- /** Fired after successfully calling {@link Createable.create} */
766
- readonly onAfterCreate: Event<any>;
767
1323
  /**
768
1324
  * Finish the creation process of the component, successfully creating an
769
1325
  * instance of whatever the component creates.
770
1326
  */
771
- endCreation: (data: any) => void;
772
- /** Fired before calling {@link Createable.cancelCreation}. */
773
- readonly onBeforeCancel: Event<any>;
1327
+ endCreation?: (data: any) => void;
774
1328
  /**
775
1329
  * Cancels the creation process of the component, going back to the state
776
1330
  * before starting to create.
777
1331
  */
778
- cancelCreation: (data: any) => void;
779
- /** Fired after calling {@link Createable.cancelCreation}. */
780
- readonly onAfterCancel: Event<any>;
781
- /** Fired before calling {@link Createable.delete}. */
782
- readonly onBeforeDelete: Event<any>;
1332
+ cancelCreation?: (data: any) => void;
783
1333
  /** Deletes an existing instance of an element (e.g. a Dimension). */
784
1334
  delete: (data: any) => void;
785
- /** Fired after successfully calling {@link Createable.delete()} */
786
- readonly onAfterDelete: Event<any>;
787
1335
  }
788
1336
  /**
789
1337
  * Whether this component supports to be configured.
@@ -803,42 +1351,15 @@ export interface Configurable<T extends Record<string, any>> {
803
1351
  /**
804
1352
  * An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
805
1353
  */
806
- export interface BVHGeometry extends THREE.BufferGeometry {
807
- boundsTree: Object | undefined;
808
- disposeBoundsTree: () => void;
809
- }
810
- /**
811
- * Whether a camera uses the Camera Controls library.
812
- */
813
- export interface CameraControllable {
814
- controls: CameraControls;
815
- }
816
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
817
- import { Components } from "../../Components";
818
- /**
819
- * Base class of the library. Useful for finding out the interfaces it implements.
820
- */
821
- export declare abstract class Base {
822
- components: Components;
823
- constructor(components: Components);
824
- /** Whether is component is {@link Disposable}. */
825
- isDisposeable: () => this is Disposable;
826
- /** Whether is component is {@link Resizeable}. */
827
- isResizeable: () => this is Resizeable;
828
- /** Whether is component is {@link Updateable}. */
829
- isUpdateable: () => this is Updateable;
830
- /** Whether is component is {@link Hideable}. */
831
- isHideable: () => this is Hideable;
832
- /** Whether is component is {@link Configurable}. */
833
- isConfigurable: () => this is Configurable<any>;
834
- }
835
- import * as WEBIFC from "web-ifc";
836
- import { IfcItemsCategories } from "../../../ifc";
837
- export declare class SpatialStructure {
838
- itemsByFloor: IfcItemsCategories;
839
- private _units;
840
- setUp(webIfc: WEBIFC.IfcAPI): void;
841
- cleanUp(): void;
1354
+ export interface BVHGeometry extends THREE.BufferGeometry {
1355
+ boundsTree: Object | undefined;
1356
+ disposeBoundsTree: () => void;
1357
+ }
1358
+ /**
1359
+ * Whether a camera uses the Camera Controls library.
1360
+ */
1361
+ export interface CameraControllable {
1362
+ controls: CameraControls;
842
1363
  }
843
1364
  /**
844
1365
  * Simple event handler by
@@ -849,27 +1370,27 @@ export declare class SpatialStructure {
849
1370
  * - If you want to maintain the reference to 'this', you will need to declare
850
1371
  * the callback as an arrow function.
851
1372
  */
852
- export declare class Event<T> {
1373
+ export declare class AsyncEvent<T> {
853
1374
  /**
854
1375
  * Add a callback to this event instance.
855
1376
  * @param handler - the callback to be added to this event.
856
1377
  */
857
1378
  add(handler: T extends void ? {
858
- (): void;
1379
+ (): Promise<void>;
859
1380
  } : {
860
- (data: T): void;
1381
+ (data: T): Promise<void>;
861
1382
  }): void;
862
1383
  /**
863
1384
  * Removes a callback from this event instance.
864
1385
  * @param handler - the callback to be removed from this event.
865
1386
  */
866
1387
  remove(handler: T extends void ? {
867
- (): void;
1388
+ (): Promise<void>;
868
1389
  } : {
869
- (data: T): void;
1390
+ (data: T): Promise<void>;
870
1391
  }): void;
871
1392
  /** Triggers all the callbacks assigned to this event. */
872
- trigger: (data?: T) => void;
1393
+ trigger: (data?: T) => Promise<void>;
873
1394
  /** Gets rid of all the suscribed events. */
874
1395
  reset(): void;
875
1396
  private handlers;
@@ -892,23 +1413,6 @@ export declare abstract class Component extends Base {
892
1413
  */
893
1414
  abstract enabled: boolean;
894
1415
  }
895
- import { Base } from "./base";
896
- import { World } from "./world";
897
- import { Event } from "./event";
898
- import { Components } from "../../Components";
899
- /**
900
- * One of the elements that make a world. It can be either a scene, a camera
901
- * or a renderer.
902
- */
903
- export declare abstract class BaseWorldItem extends Base {
904
- readonly worlds: Map<string, World>;
905
- readonly onWorldChanged: Event<{
906
- world: World;
907
- action: "added" | "removed";
908
- }>;
909
- currentWorld: World | null;
910
- protected constructor(components: Components);
911
- }
912
1416
  import * as THREE from "three";
913
1417
  import CameraControls from "camera-controls";
914
1418
  import { BaseWorldItem } from "./base-world-item";
@@ -920,76 +1424,41 @@ export declare abstract class BaseCamera extends BaseWorldItem {
920
1424
  /** Whether is instance is {@link CameraControllable}. */
921
1425
  hasCameraControls: () => this is CameraControllable;
922
1426
  }
923
- import * as THREE from "three";
924
- import { Disposable } from "./interfaces";
925
- import { Event } from "./event";
1427
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
926
1428
  import { Components } from "../../Components";
927
- import { BaseWorldItem } from "./base-world-item";
928
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
929
- /** {@link Disposable.onDisposed} */
930
- readonly onDisposed: Event<unknown>;
931
- abstract three: THREE.Object3D;
932
- protected constructor(components: Components);
933
- /** {@link Disposable.dispose} */
934
- dispose(): void;
935
- }
936
- import * as THREE from "three";
937
- import { BaseScene } from "./base-scene";
938
- import { BaseCamera } from "./base-camera";
939
- import { BaseRenderer } from "./base-renderer";
940
- import { Updateable, Disposable } from "./interfaces";
941
- export interface World extends Disposable, Updateable {
942
- meshes: Set<THREE.Mesh>;
943
- scene: BaseScene;
944
- camera: BaseCamera;
945
- renderer: BaseRenderer | null;
946
- uuid: string;
1429
+ /**
1430
+ * Base class of the library. Useful for finding out the interfaces it implements.
1431
+ */
1432
+ export declare abstract class Base {
1433
+ components: Components;
1434
+ constructor(components: Components);
1435
+ /** Whether is component is {@link Disposable}. */
1436
+ isDisposeable: () => this is Disposable;
1437
+ /** Whether is component is {@link Resizeable}. */
1438
+ isResizeable: () => this is Resizeable;
1439
+ /** Whether is component is {@link Updateable}. */
1440
+ isUpdateable: () => this is Updateable;
1441
+ /** Whether is component is {@link Hideable}. */
1442
+ isHideable: () => this is Hideable;
1443
+ /** Whether is component is {@link Configurable}. */
1444
+ isConfigurable: () => this is Configurable<any>;
947
1445
  }
948
- import * as THREE from "three";
949
- import CameraControls from "camera-controls";
950
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1446
+ import { Base } from "./base";
1447
+ import { World } from "./world";
1448
+ import { Event } from "./event";
951
1449
  import { Components } from "../../Components";
952
1450
  /**
953
- * A basic camera that uses
954
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
955
- * easily control the camera in 2D and 3D. Check out it's API to find out
956
- * what features it offers.
1451
+ * One of the elements that make a world. It can be either a scene, a camera
1452
+ * or a renderer.
957
1453
  */
958
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
959
- /** {@link Updateable.onBeforeUpdate} */
960
- readonly onBeforeUpdate: Event<SimpleCamera>;
961
- /** {@link Updateable.onAfterUpdate} */
962
- readonly onAfterUpdate: Event<SimpleCamera>;
963
- readonly onAspectUpdated: Event<unknown>;
964
- /** {@link Disposable.onDisposed} */
965
- readonly onDisposed: Event<string>;
966
- readonly three: THREE.PerspectiveCamera;
967
- private _allControls;
968
- /**
969
- * The object that controls the camera. An instance of
970
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
971
- * Transforming the camera directly will have no effect: you need to use this
972
- * object to move, rotate, look at objects, etc.
973
- */
974
- get controls(): CameraControls;
975
- /** {@link Component.enabled} */
976
- get enabled(): boolean;
977
- /** {@link Component.enabled} */
978
- set enabled(enabled: boolean);
979
- constructor(components: Components);
980
- /** {@link Disposable.dispose} */
981
- dispose(): void;
982
- /** {@link Updateable.update} */
983
- update(_delta: number): void;
984
- /**
985
- * Updates the aspect of the camera to match the size of the
986
- * {@link Components.renderer}.
987
- */
988
- updateAspect: () => void;
989
- private setupCamera;
990
- private newCameraControls;
991
- private setupEvents;
992
- private static getSubsetOfThree;
1454
+ export declare abstract class BaseWorldItem extends Base {
1455
+ readonly worlds: Map<string, World>;
1456
+ readonly onWorldChanged: Event<{
1457
+ world: World;
1458
+ action: "added" | "removed";
1459
+ }>;
1460
+ currentWorld: World | null;
1461
+ protected constructor(components: Components);
993
1462
  }
994
1463
  import * as THREE from "three";
995
1464
  import { Vector2 } from "three";
@@ -1031,15 +1500,104 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1031
1500
  */
1032
1501
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1033
1502
  }
1034
- import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1035
- /** Configuration of the IFC-fragment streaming. */
1036
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1037
- minGeometrySize: number;
1038
- minAssetsSize: number;
1503
+ import * as THREE from "three";
1504
+ import { Disposable } from "./interfaces";
1505
+ import { Event } from "./event";
1506
+ import { Components } from "../../Components";
1507
+ import { BaseWorldItem } from "./base-world-item";
1508
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1509
+ /** {@link Disposable.onDisposed} */
1510
+ readonly onDisposed: Event<unknown>;
1511
+ abstract three: THREE.Object3D;
1512
+ protected constructor(components: Components);
1513
+ /** {@link Disposable.dispose} */
1514
+ dispose(): void;
1039
1515
  }
1040
- /** Configuration of the IFC-fragment streaming. */
1041
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1042
- propertiesSize: number;
1516
+ import * as THREE from "three";
1517
+ import { BaseScene } from "./base-scene";
1518
+ import { BaseCamera } from "./base-camera";
1519
+ import { BaseRenderer } from "./base-renderer";
1520
+ import { Updateable, Disposable } from "./interfaces";
1521
+ export interface World extends Disposable, Updateable {
1522
+ meshes: Set<THREE.Mesh>;
1523
+ scene: BaseScene;
1524
+ camera: BaseCamera;
1525
+ renderer: BaseRenderer | null;
1526
+ uuid: string;
1527
+ }
1528
+ import * as THREE from "three";
1529
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1530
+ import { Components } from "../../Components";
1531
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1532
+ /**
1533
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1534
+ */
1535
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1536
+ readonly onAfterUpdate: Event<unknown>;
1537
+ readonly onBeforeUpdate: Event<unknown>;
1538
+ enabled: boolean;
1539
+ uuid: string;
1540
+ readonly onDisposed: Event<unknown>;
1541
+ private _scene?;
1542
+ private _camera?;
1543
+ private _renderer;
1544
+ get scene(): T;
1545
+ set scene(scene: T);
1546
+ get camera(): U;
1547
+ set camera(camera: U);
1548
+ get renderer(): S | null;
1549
+ set renderer(renderer: S | null);
1550
+ constructor(components: Components);
1551
+ update(delta?: number): void;
1552
+ dispose(disposeResources?: boolean): void;
1553
+ }
1554
+ /// <reference types="node" />
1555
+ import * as THREE from "three";
1556
+ import { Hideable, Event, World } from "../../Types";
1557
+ import { Components } from "../../Components";
1558
+ export interface GridConfig {
1559
+ color: THREE.Color;
1560
+ size1: number;
1561
+ size2: number;
1562
+ distance: number;
1563
+ }
1564
+ /**
1565
+ * An infinite grid. Created by
1566
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1567
+ * and translated to typescript by
1568
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1569
+ */
1570
+ export declare class SimpleGrid implements Hideable, Disposable {
1571
+ /** {@link Disposable.onDisposed} */
1572
+ readonly onDisposed: Event<unknown>;
1573
+ world: World;
1574
+ components: Components;
1575
+ /** {@link Hideable.visible} */
1576
+ get visible(): boolean;
1577
+ /** {@link Hideable.visible} */
1578
+ set visible(visible: boolean);
1579
+ /** The material of the grid. */
1580
+ get material(): THREE.ShaderMaterial;
1581
+ /**
1582
+ * Whether the grid should fade away with distance. Recommended to be true for
1583
+ * perspective cameras and false for orthographic cameras.
1584
+ */
1585
+ get fade(): boolean;
1586
+ /**
1587
+ * Whether the grid should fade away with distance. Recommended to be true for
1588
+ * perspective cameras and false for orthographic cameras.
1589
+ */
1590
+ set fade(active: boolean);
1591
+ private readonly _grid;
1592
+ private _fade;
1593
+ constructor(components: Components, world: World, config: GridConfig);
1594
+ [Symbol.dispose](): void;
1595
+ /** {@link Component.get} */
1596
+ get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
1597
+ /** {@link Disposable.dispose} */
1598
+ dispose(): void;
1599
+ private setupEvents;
1600
+ private updateZoom;
1043
1601
  }
1044
1602
  import * as THREE from "three";
1045
1603
  import { BaseScene, Configurable, Event } from "../../Types";
@@ -1068,8 +1626,54 @@ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1068
1626
  readonly onSetup: Event<SimpleScene>;
1069
1627
  config: Required<SimpleSceneConfig>;
1070
1628
  constructor(components: Components);
1071
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1072
- setup(config?: Partial<SimpleSceneConfig>): void;
1629
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1630
+ setup(config?: Partial<SimpleSceneConfig>): void;
1631
+ }
1632
+ import * as THREE from "three";
1633
+ import CameraControls from "camera-controls";
1634
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1635
+ import { Components } from "../../Components";
1636
+ /**
1637
+ * A basic camera that uses
1638
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1639
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1640
+ * what features it offers.
1641
+ */
1642
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1643
+ /** {@link Updateable.onBeforeUpdate} */
1644
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1645
+ /** {@link Updateable.onAfterUpdate} */
1646
+ readonly onAfterUpdate: Event<SimpleCamera>;
1647
+ readonly onAspectUpdated: Event<unknown>;
1648
+ /** {@link Disposable.onDisposed} */
1649
+ readonly onDisposed: Event<string>;
1650
+ readonly three: THREE.PerspectiveCamera;
1651
+ private _allControls;
1652
+ /**
1653
+ * The object that controls the camera. An instance of
1654
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1655
+ * Transforming the camera directly will have no effect: you need to use this
1656
+ * object to move, rotate, look at objects, etc.
1657
+ */
1658
+ get controls(): CameraControls;
1659
+ /** {@link Component.enabled} */
1660
+ get enabled(): boolean;
1661
+ /** {@link Component.enabled} */
1662
+ set enabled(enabled: boolean);
1663
+ constructor(components: Components);
1664
+ /** {@link Disposable.dispose} */
1665
+ dispose(): void;
1666
+ /** {@link Updateable.update} */
1667
+ update(_delta: number): void;
1668
+ /**
1669
+ * Updates the aspect of the camera to match the size of the
1670
+ * {@link Components.renderer}.
1671
+ */
1672
+ updateAspect: () => void;
1673
+ private setupCamera;
1674
+ private newCameraControls;
1675
+ private setupEvents;
1676
+ private static getSubsetOfThree;
1073
1677
  }
1074
1678
  import * as THREE from "three";
1075
1679
  import { BaseRenderer, Event } from "../../Types";
@@ -1079,15 +1683,15 @@ import { Components } from "../../Components";
1079
1683
  * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1080
1684
  */
1081
1685
  export declare class SimpleRenderer extends BaseRenderer {
1082
- /** {@link Component.enabled} */
1083
1686
  enabled: boolean;
1084
1687
  /** The HTML container of the THREE.js canvas where the scene is rendered. */
1085
- container: HTMLElement | null;
1688
+ container: HTMLElement;
1086
1689
  three: THREE.WebGLRenderer;
1087
1690
  protected _canvas: HTMLCanvasElement;
1088
1691
  protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1692
+ protected _resizeObserver: ResizeObserver | null;
1089
1693
  protected onContainerUpdated: Event<HTMLElement>;
1090
- constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1694
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1091
1695
  /** {@link Updateable.update} */
1092
1696
  update(): void;
1093
1697
  /** {@link Disposable.dispose} */
@@ -1101,11 +1705,10 @@ export declare class SimpleRenderer extends BaseRenderer {
1101
1705
  private setupRenderer;
1102
1706
  private onContextLost;
1103
1707
  private onContextBack;
1104
- private updateContainer;
1105
1708
  }
1106
1709
  import * as THREE from "three";
1107
1710
  import { Components } from "../../Components";
1108
- import { Event, World } from "../../Types";
1711
+ import { AsyncEvent, Event, World } from "../../Types";
1109
1712
  export interface CullerRendererSettings {
1110
1713
  updateInterval?: number;
1111
1714
  width?: number;
@@ -1123,7 +1726,7 @@ export declare class CullerRenderer {
1123
1726
  * meshes that are currently visible, and the ones that were visible
1124
1727
  * just before but not anymore.
1125
1728
  */
1126
- readonly onViewUpdated: Event<any>;
1729
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1127
1730
  /** {@link Component.enabled} */
1128
1731
  enabled: boolean;
1129
1732
  /**
@@ -1149,6 +1752,7 @@ export declare class CullerRenderer {
1149
1752
  private readonly renderTarget;
1150
1753
  private readonly bufferSize;
1151
1754
  private readonly _buffer;
1755
+ protected _isWorkerBusy: boolean;
1152
1756
  constructor(components: Components, world: World, settings?: CullerRendererSettings);
1153
1757
  /** {@link Disposable.dispose} */
1154
1758
  dispose(): void;
@@ -1170,74 +1774,6 @@ export declare class CullerRenderer {
1170
1774
  private applySettings;
1171
1775
  }
1172
1776
  export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1173
- import * as WEBIFC from "web-ifc";
1174
- import { Components, Disposable, Event, Component } from "../../../core";
1175
- import { IfcStreamingSettings } from "./streaming-settings";
1176
- import { StreamedGeometries, StreamedAsset } from "./base-types";
1177
- export declare class FragmentIfcStreamConverter extends Component implements Disposable {
1178
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1179
- onGeometryStreamed: Event<{
1180
- buffer: Uint8Array;
1181
- data: StreamedGeometries;
1182
- }>;
1183
- onAssetStreamed: Event<StreamedAsset[]>;
1184
- onProgress: Event<number>;
1185
- onIfcLoaded: Event<Uint8Array>;
1186
- /** {@link Disposable.onDisposed} */
1187
- readonly onDisposed: Event<unknown>;
1188
- settings: IfcStreamingSettings;
1189
- enabled: boolean;
1190
- webIfc: WEBIFC.IfcAPI;
1191
- private _spatialTree;
1192
- private _metaData;
1193
- private _visitedGeometries;
1194
- private _streamSerializer;
1195
- private _geometries;
1196
- private _geometryCount;
1197
- private _civil;
1198
- private _groupSerializer;
1199
- private _assets;
1200
- private _meshesWithHoles;
1201
- constructor(components: Components);
1202
- dispose(): void;
1203
- streamFromBuffer(data: Uint8Array): Promise<void>;
1204
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1205
- private readIfcFile;
1206
- private streamIfcFile;
1207
- private streamAllGeometries;
1208
- private cleanUp;
1209
- private getMesh;
1210
- private getGeometry;
1211
- private streamAssets;
1212
- private streamGeometries;
1213
- }
1214
- import * as WEBIFC from "web-ifc";
1215
- import { Component, Disposable, Event } from "../../../core";
1216
- import { PropertiesStreamingSettings } from "./streaming-settings";
1217
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1218
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1219
- onPropertiesStreamed: Event<{
1220
- type: number;
1221
- data: {
1222
- [id: number]: any;
1223
- };
1224
- }>;
1225
- onProgress: Event<number>;
1226
- onIndicesStreamed: Event<number[][]>;
1227
- /** {@link Disposable.onDisposed} */
1228
- readonly onDisposed: Event<string>;
1229
- enabled: boolean;
1230
- settings: PropertiesStreamingSettings;
1231
- webIfc: WEBIFC.IfcAPI;
1232
- dispose(): Promise<void>;
1233
- streamFromBuffer(data: Uint8Array): Promise<void>;
1234
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1235
- private readIfcFile;
1236
- private streamIfcFile;
1237
- private streamAllProperties;
1238
- private getIndices;
1239
- private cleanUp;
1240
- }
1241
1777
  import * as THREE from "three";
1242
1778
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1243
1779
  import { Components } from "../../Components";
@@ -1257,6 +1793,7 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1257
1793
  private _meshIDColorCodeMap;
1258
1794
  private _currentVisibleMeshes;
1259
1795
  private _recentlyHiddenMeshes;
1796
+ private _intervalID;
1260
1797
  private readonly _transparentMat;
1261
1798
  constructor(components: Components, world: World, settings?: CullerRendererSettings);
1262
1799
  dispose(): void;
@@ -1265,161 +1802,6 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1265
1802
  private handleWorkerMessage;
1266
1803
  private getAvailableMaterial;
1267
1804
  }
1268
- /// <reference types="node" />
1269
- import * as THREE from "three";
1270
- import { Hideable, Event, World } from "../../Types";
1271
- import { Components } from "../../Components";
1272
- export interface GridConfig {
1273
- color: THREE.Color;
1274
- size1: number;
1275
- size2: number;
1276
- distance: number;
1277
- }
1278
- /**
1279
- * An infinite grid. Created by
1280
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1281
- * and translated to typescript by
1282
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1283
- */
1284
- export declare class SimpleGrid implements Hideable, Disposable {
1285
- /** {@link Disposable.onDisposed} */
1286
- readonly onDisposed: Event<unknown>;
1287
- world: World;
1288
- components: Components;
1289
- /** {@link Hideable.visible} */
1290
- get visible(): boolean;
1291
- /** {@link Hideable.visible} */
1292
- set visible(visible: boolean);
1293
- /** The material of the grid. */
1294
- get material(): THREE.ShaderMaterial;
1295
- /**
1296
- * Whether the grid should fade away with distance. Recommended to be true for
1297
- * perspective cameras and false for orthographic cameras.
1298
- */
1299
- get fade(): boolean;
1300
- /**
1301
- * Whether the grid should fade away with distance. Recommended to be true for
1302
- * perspective cameras and false for orthographic cameras.
1303
- */
1304
- set fade(active: boolean);
1305
- private readonly _grid;
1306
- private _fade;
1307
- constructor(components: Components, world: World, config: GridConfig);
1308
- [Symbol.dispose](): void;
1309
- /** {@link Component.get} */
1310
- get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
1311
- /** {@link Disposable.dispose} */
1312
- dispose(): void;
1313
- private setupEvents;
1314
- private updateZoom;
1315
- }
1316
- export interface StreamedGeometries {
1317
- [id: number]: {
1318
- boundingBox: Float32Array;
1319
- hasHoles: boolean;
1320
- geometryFile?: string;
1321
- };
1322
- }
1323
- export interface StreamedAsset {
1324
- id: number;
1325
- geometries: {
1326
- geometryID: number;
1327
- transformation: number[];
1328
- color: number[];
1329
- }[];
1330
- }
1331
- import * as THREE from "three";
1332
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1333
- import { Components } from "../../Components";
1334
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1335
- /**
1336
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1337
- */
1338
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1339
- readonly onAfterUpdate: Event<unknown>;
1340
- readonly onBeforeUpdate: Event<unknown>;
1341
- enabled: boolean;
1342
- uuid: string;
1343
- readonly onDisposed: Event<unknown>;
1344
- private _scene?;
1345
- private _camera?;
1346
- private _renderer;
1347
- get scene(): T;
1348
- set scene(scene: T);
1349
- get camera(): U;
1350
- set camera(camera: U);
1351
- get renderer(): S | null;
1352
- set renderer(renderer: S | null);
1353
- constructor(components: Components);
1354
- update(delta?: number): void;
1355
- dispose(disposeResources?: boolean): void;
1356
- }
1357
- import * as THREE from "three";
1358
- import { Disposable, Event } from "../../Types";
1359
- /**
1360
- * A helper to easily get the real position of the mouse in the Three.js canvas
1361
- * to work with tools like the
1362
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1363
- * been transformed through CSS or doesn't occupy the whole screen.
1364
- */
1365
- export declare class Mouse implements Disposable {
1366
- dom: HTMLCanvasElement;
1367
- private _event?;
1368
- private _position;
1369
- /** {@link Disposable.onDisposed} */
1370
- readonly onDisposed: Event<unknown>;
1371
- constructor(dom: HTMLCanvasElement);
1372
- /**
1373
- * The real position of the mouse of the Three.js canvas.
1374
- */
1375
- get position(): THREE.Vector2;
1376
- /** {@link Disposable.dispose} */
1377
- dispose(): void;
1378
- private getPositionY;
1379
- private getPositionX;
1380
- private updateMouseInfo;
1381
- private setupEvents;
1382
- }
1383
- import * as THREE from "three";
1384
- import { Components } from "../../Components";
1385
- import { Event, World, Disposable } from "../../Types";
1386
- import { Mouse } from "./mouse";
1387
- /**
1388
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1389
- * that allows to easily get items from the scene using the mouse and touch
1390
- * events.
1391
- */
1392
- export declare class SimpleRaycaster implements Disposable {
1393
- /** {@link Component.enabled} */
1394
- enabled: boolean;
1395
- components: Components;
1396
- /** {@link Disposable.onDisposed} */
1397
- readonly onDisposed: Event<unknown>;
1398
- /** The position of the mouse in the screen. */
1399
- readonly mouse: Mouse;
1400
- readonly three: THREE.Raycaster;
1401
- world: World;
1402
- constructor(components: Components, world: World);
1403
- /** {@link Disposable.dispose} */
1404
- dispose(): void;
1405
- /**
1406
- * Throws a ray from the camera to the mouse or touch event point and returns
1407
- * the first item found. This also takes into account the clipping planes
1408
- * used by the renderer.
1409
- *
1410
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1411
- * to query. If not provided, it will query all the meshes stored in
1412
- * {@link Components.meshes}.
1413
- */
1414
- castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
1415
- 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;
1416
- private intersect;
1417
- private filterClippingPlanes;
1418
- }
1419
- import * as WEBIFC from "web-ifc";
1420
- export declare class IfcMetadataReader {
1421
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1422
- }
1423
1805
  import * as THREE from "three";
1424
1806
  import { Hideable, Disposable, Event, World } from "../../Types";
1425
1807
  import { Components } from "../../Components";
@@ -1481,15 +1863,57 @@ export declare class SimplePlane implements Disposable, Hideable {
1481
1863
  private newHelper;
1482
1864
  private static newPlaneMesh;
1483
1865
  }
1866
+ import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1867
+ /** Configuration of the IFC-fragment streaming. */
1868
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1869
+ minGeometrySize: number;
1870
+ minAssetsSize: number;
1871
+ }
1872
+ /** Configuration of the IFC-fragment streaming. */
1873
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1874
+ propertiesSize: number;
1875
+ }
1876
+ import * as THREE from "three";
1877
+ import * as WEBIFC from "web-ifc";
1878
+ import * as FRAGS from "@thatopen/fragments";
1879
+ export declare class CivilReader {
1880
+ defLineMat: THREE.LineBasicMaterial;
1881
+ read(webIfc: WEBIFC.IfcAPI): {
1882
+ alignments: Map<number, FRAGS.Alignment>;
1883
+ coordinationMatrix: THREE.Matrix4;
1884
+ } | undefined;
1885
+ get(civilItems: any): {
1886
+ alignments: Map<number, FRAGS.Alignment>;
1887
+ coordinationMatrix: THREE.Matrix4;
1888
+ } | undefined;
1889
+ private getCurves;
1890
+ }
1484
1891
  import * as WEBIFC from "web-ifc";
1485
- import * as THREE from "three";
1486
- export declare class Units {
1487
- factor: number;
1488
- complement: number;
1489
- apply(matrix: THREE.Matrix4): void;
1490
- setUp(webIfc: WEBIFC.IfcAPI): void;
1491
- private getLengthUnits;
1492
- private getScaleMatrix;
1892
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1893
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1894
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1895
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1896
+ onPropertiesStreamed: AsyncEvent<{
1897
+ type: number;
1898
+ data: {
1899
+ [id: number]: any;
1900
+ };
1901
+ }>;
1902
+ onProgress: AsyncEvent<number>;
1903
+ onIndicesStreamed: AsyncEvent<number[][]>;
1904
+ /** {@link Disposable.onDisposed} */
1905
+ readonly onDisposed: Event<string>;
1906
+ enabled: boolean;
1907
+ settings: PropertiesStreamingSettings;
1908
+ webIfc: WEBIFC.IfcAPI;
1909
+ dispose(): Promise<void>;
1910
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1911
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1912
+ private readIfcFile;
1913
+ private streamIfcFile;
1914
+ private streamAllProperties;
1915
+ private getIndices;
1916
+ private cleanUp;
1493
1917
  }
1494
1918
  import * as WEBIFC from "web-ifc";
1495
1919
  /** Configuration of the IFC-fragment conversion. */
@@ -1518,36 +1942,59 @@ export declare class IfcFragmentSettings {
1518
1942
  autoSetWasm: boolean;
1519
1943
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1520
1944
  }
1521
- import { Component, Disposable, Event, Components } from "../../core";
1522
- export declare class FragmentExploder extends Component implements Disposable {
1523
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
1524
- enabled: boolean;
1525
- height: number;
1526
- groupName: string;
1527
- /** {@link Disposable.onDisposed} */
1528
- readonly onDisposed: Event<string>;
1529
- list: Set<string>;
1530
- constructor(components: Components);
1531
- dispose(): void;
1532
- explode(): void;
1533
- reset(): void;
1534
- update(): void;
1945
+ import * as WEBIFC from "web-ifc";
1946
+ export declare class IfcMetadataReader {
1947
+ get(webIfc: WEBIFC.IfcAPI, type: number): string;
1948
+ }
1949
+ export interface StreamedGeometries {
1950
+ [id: number]: {
1951
+ boundingBox: Float32Array;
1952
+ hasHoles: boolean;
1953
+ geometryFile?: string;
1954
+ };
1955
+ }
1956
+ export interface StreamedAsset {
1957
+ id: number;
1958
+ geometries: {
1959
+ geometryID: number;
1960
+ transformation: number[];
1961
+ color: number[];
1962
+ }[];
1535
1963
  }
1536
- import * as THREE from "three";
1537
1964
  import * as WEBIFC from "web-ifc";
1538
- import * as FRAGS from "bim-fragment";
1539
- export declare class CivilReader {
1540
- defLineMat: THREE.LineBasicMaterial;
1541
- read(webIfc: WEBIFC.IfcAPI): {
1542
- alignments: Map<number, FRAGS.Alignment>;
1543
- coordinationMatrix: THREE.Matrix4;
1544
- } | undefined;
1545
- get(civilItems: any): {
1546
- alignments: Map<number, FRAGS.Alignment>;
1547
- coordinationMatrix: THREE.Matrix4;
1548
- } | undefined;
1549
- private getCurves;
1965
+ import * as THREE from "three";
1966
+ export declare class Units {
1967
+ factor: number;
1968
+ complement: number;
1969
+ apply(matrix: THREE.Matrix4): void;
1970
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1971
+ private getLengthUnits;
1972
+ private getScaleMatrix;
1973
+ }
1974
+ export type RelationsMap = Map<number, Map<number, number[]>>;
1975
+ export interface ModelsRelationMap {
1976
+ [modelID: string]: RelationsMap;
1550
1977
  }
1978
+ /**
1979
+ * Type alias for an array of inverse attribute names.
1980
+ */
1981
+ export type InverseAttributes = [
1982
+ "IsDecomposedBy",
1983
+ "Decomposes",
1984
+ "AssociatedTo",
1985
+ "HasAssociations",
1986
+ "ClassificationForObjects",
1987
+ "IsGroupedBy",
1988
+ "HasAssignments",
1989
+ "IsDefinedBy",
1990
+ "DefinesOcurrence",
1991
+ "IsTypedBy",
1992
+ "Types",
1993
+ "Defines",
1994
+ "ContainedInStructure",
1995
+ "ContainsElements"
1996
+ ];
1997
+ export type InverseAttribute = InverseAttributes[number];
1551
1998
  import { BufferGeometry } from "three";
1552
1999
  import * as THREE from "three";
1553
2000
  export declare class TransformHelper {
@@ -1576,169 +2023,5 @@ export interface Query {
1576
2023
  description?: string;
1577
2024
  groups: QueryGroup;
1578
2025
  }
1579
- import { NavigationMode } from "./types";
1580
- /**
1581
- * A {@link NavigationMode} that allows 3D navigation and panning
1582
- * like in many 3D and CAD softwares.
1583
- */
1584
- export declare class OrbitMode implements NavigationMode {
1585
- camera: any;
1586
- /** {@link NavigationMode.enabled} */
1587
- enabled: boolean;
1588
- /** {@link NavigationMode.id} */
1589
- readonly id = "Orbit";
1590
- constructor(camera: any);
1591
- /** {@link NavigationMode.set} */
1592
- set(active: boolean): void;
1593
- private activateOrbitControls;
1594
- }
1595
- /**
1596
- * The projection system of the camera.
1597
- */
1598
- export type CameraProjection = "Perspective" | "Orthographic";
1599
- /**
1600
- * The extensible list of supported navigation modes.
1601
- */
1602
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1603
- /**
1604
- * An object that determines the behavior of the camera controls
1605
- * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1606
- */
1607
- export interface NavigationMode {
1608
- /** The unique ID of this navigation mode. */
1609
- id: NavModeID;
1610
- /**
1611
- * Enable or disable this navigation mode.
1612
- * When a new navigation mode is enabled, the previous navigation mode
1613
- * must be disabled.
1614
- *
1615
- * @param active - whether to enable or disable this mode.
1616
- * @param options - any additional data required to enable or disable it.
1617
- * */
1618
- set: (active: boolean, options?: any) => void;
1619
- /** Whether this navigation mode is active or not. */
1620
- enabled: boolean;
1621
- }
1622
- import { NavigationMode } from "./types";
1623
- /**
1624
- * A {@link NavigationMode} that allows first person navigation,
1625
- * simulating FPS video games.
1626
- */
1627
- export declare class FirstPersonMode implements NavigationMode {
1628
- private camera;
1629
- /** {@link NavigationMode.enabled} */
1630
- enabled: boolean;
1631
- /** {@link NavigationMode.id} */
1632
- readonly id = "FirstPerson";
1633
- constructor(camera: any);
1634
- /** {@link NavigationMode.set} */
1635
- set(active: boolean): void;
1636
- private setupFirstPersonCamera;
1637
- }
1638
- import { NavigationMode } from "./types";
1639
- /**
1640
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1641
- * like many BIM tools.
1642
- */
1643
- export declare class PlanMode implements NavigationMode {
1644
- private camera;
1645
- /** {@link NavigationMode.enabled} */
1646
- enabled: boolean;
1647
- /** {@link NavigationMode.id} */
1648
- readonly id = "Plan";
1649
- private mouseAction1?;
1650
- private mouseAction2?;
1651
- private mouseInitialized;
1652
- private readonly defaultAzimuthSpeed;
1653
- private readonly defaultPolarSpeed;
1654
- constructor(camera: any);
1655
- /** {@link NavigationMode.set} */
1656
- set(active: boolean): void;
1657
- }
1658
- import * as THREE from "three";
1659
- import { CameraProjection } from "./types";
1660
- import { Event } from "../../../core";
1661
- import { OrthoPerspectiveCamera } from "../index";
1662
- /**
1663
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1664
- */
1665
- export declare class ProjectionManager {
1666
- /**
1667
- * Event that fires when the {@link CameraProjection} changes.
1668
- */
1669
- readonly onProjectionChanged: Event<THREE.Camera>;
1670
- projection: CameraProjection;
1671
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1672
- private _component;
1673
- private _previousDistance;
1674
- /** Match Ortho zoom with Perspective distance when changing projection mode */
1675
- matchOrthoDistanceEnabled: boolean;
1676
- constructor(camera: OrthoPerspectiveCamera);
1677
- /**
1678
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1679
- *
1680
- * @param projection - the new projection to set. If it is the current projection,
1681
- * it will have no effect.
1682
- */
1683
- set(projection: CameraProjection): Promise<void>;
1684
- /**
1685
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
1686
- * and vice versa.
1687
- */
1688
- toggle(): Promise<void>;
1689
- private setOrthoCamera;
1690
- private getDims;
1691
- private setupOrthoCamera;
1692
- private getDistance;
1693
- private setPerspectiveCamera;
1694
- }
1695
- import * as THREE from "three";
1696
- import { Components } from "../../core/Components";
1697
- import { SimpleCamera } from "../../core";
1698
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
1699
- /**
1700
- * A flexible camera that uses
1701
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1702
- * easily control the camera in 2D and 3D. It supports multiple navigation
1703
- * modes, such as 2D floor plan navigation, first person and 3D orbit.
1704
- */
1705
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
1706
- /**
1707
- * The current {@link NavigationMode}.
1708
- */
1709
- mode: NavigationMode;
1710
- readonly core: ProjectionManager;
1711
- readonly threeOrtho: THREE.OrthographicCamera;
1712
- protected readonly _userInputButtons: any;
1713
- protected readonly _frustumSize = 50;
1714
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
1715
- constructor(components: Components);
1716
- /** {@link Disposable.dispose} */
1717
- dispose(): void;
1718
- /**
1719
- * Sets a new {@link NavigationMode} and disables the previous one.
1720
- *
1721
- * @param mode - The {@link NavigationMode} to set.
1722
- */
1723
- set(mode: NavModeID): void;
1724
- /**
1725
- * Make the camera view fit all the specified meshes.
1726
- *
1727
- * @param meshes the meshes to fit. If it is not defined, it will
1728
- * evaluate {@link Components.meshes}.
1729
- * @param offset the distance to the fit object
1730
- */
1731
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
1732
- /**
1733
- * Allows or prevents all user input.
1734
- *
1735
- * @param active - whether to enable or disable user inputs.
1736
- */
1737
- setUserInput(active: boolean): void;
1738
- private disableUserInput;
1739
- private enableUserInput;
1740
- private newOrthoCamera;
1741
- private setOrthoCameraAspect;
1742
- }
1743
2026
 
1744
2027
  }