@thatopen/components 2.0.0-alpha.16 → 2.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,17 @@
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";
7
+ 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;
13
+ dispose(): void;
14
+ }
2
15
  import * as THREE from "three";
3
16
  import { Components } from "../Components";
4
17
  import { Component } from "../Types";
@@ -42,17 +55,137 @@ export declare class Disposer extends Component {
42
55
  private disposeChildren;
43
56
  private static disposeMaterial;
44
57
  }
45
- import { Component, Disposable, World, Event } from "../Types";
46
- import { SimpleRaycaster } from "./src";
58
+ import { MiniMap } from "./src";
59
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
47
60
  import { Components } from "../Components";
48
- export declare class Raycasters extends Component implements Disposable {
49
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
61
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
62
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
63
+ readonly onAfterUpdate: Event<unknown>;
64
+ readonly onBeforeUpdate: Event<unknown>;
65
+ readonly onDisposed: Event<unknown>;
50
66
  enabled: boolean;
51
- list: Map<string, SimpleRaycaster>;
67
+ list: Map<string, MiniMap>;
68
+ constructor(components: Components);
69
+ create(world: World): MiniMap;
70
+ delete(id: string): void;
71
+ dispose(): void;
72
+ update(): void;
73
+ }
74
+ import { Component, Disposable, World, Event } from "../Types";
75
+ import { GridConfig, SimpleGrid } from "./src";
76
+ export declare class Grids extends Component implements Disposable {
77
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
78
+ list: Map<string, SimpleGrid>;
52
79
  onDisposed: Event<unknown>;
80
+ config: Required<GridConfig>;
81
+ /** {@link Component.enabled} */
82
+ enabled: boolean;
83
+ create(world: World): SimpleGrid;
84
+ delete(world: World): void;
85
+ dispose(): void;
86
+ }
87
+ import { Component, Disposable, Event } from "../Types";
88
+ /**
89
+ * The entry point of the Components library.
90
+ * It can:
91
+ * - Create and access all the components of the library.
92
+ * - Update all the updatable components automatically.
93
+ * - Dispose all the components, preventing memory leaks.
94
+ */
95
+ export declare class Components implements Disposable {
96
+ static readonly release = "1.4.21";
97
+ /** {@link Disposable.onDisposed} */
98
+ readonly onDisposed: Event<void>;
99
+ /** The list of components created in this app. */
100
+ readonly list: Map<string, Component>;
101
+ /** If disabled, the animation loop will be stopped. */
102
+ enabled: boolean;
103
+ private _clock;
104
+ add(uuid: string, instance: Component): void;
105
+ /**
106
+ * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
107
+ * doesn't exist, it will instance it automatically.
108
+ *
109
+ * @param Component - The component to get or create.
110
+ */
111
+ get<U extends Component>(Component: new (components: Components) => U): U;
112
+ constructor();
113
+ /**
114
+ * Initializes the library. It should be called at the start of the app after
115
+ * initializing the scene, the renderer and the
116
+ * camera. Additionally, if any component that need a raycaster is
117
+ * used, the {@link raycaster} will need to be initialized.
118
+ */
119
+ init(): void;
120
+ /**
121
+ * Disposes the memory of all the components and tools of this instance of
122
+ * the library. A memory leak will be created if:
123
+ *
124
+ * - An instance of the library ends up out of scope and this function isn't
125
+ * called. This is especially relevant in Single Page Applications (React,
126
+ * Angular, Vue, etc).
127
+ *
128
+ * - Any of the objects of this instance (meshes, geometries, etc) is
129
+ * referenced by a reference type (object or array).
130
+ *
131
+ * You can learn more about how Three.js handles memory leaks
132
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
133
+ *
134
+ */
135
+ dispose(): void;
136
+ private update;
137
+ private static setupBVH;
138
+ }
139
+ import { Components } from "../Components";
140
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
141
+ import { Component, Event, Disposable, World } from "../Types";
142
+ /**
143
+ * A tool to handle big scenes efficiently by automatically hiding the objects
144
+ * that are not visible to the camera.
145
+ */
146
+ export declare class Cullers extends Component implements Disposable {
147
+ /**
148
+ * A unique identifier for the Cullers component.
149
+ */
150
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
151
+ /**
152
+ * Indicates whether the Cullers component is enabled.
153
+ */
154
+ private _enabled;
155
+ /**
156
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
157
+ */
158
+ list: Map<string, MeshCullerRenderer>;
159
+ /**
160
+ * An event that is triggered when the Cullers component is disposed.
161
+ */
162
+ readonly onDisposed: Event<unknown>;
163
+ /**
164
+ * Gets the enabled state of the Cullers component.
165
+ *
166
+ * @returns The current enabled state.
167
+ */
168
+ get enabled(): boolean;
169
+ /**
170
+ * Sets the enabled state of the Cullers component.
171
+ * Also sets the enabled state of all MeshCullerRenderer instances.
172
+ *
173
+ * @param value - The new enabled state.
174
+ */
175
+ set enabled(value: boolean);
53
176
  constructor(components: Components);
54
- get(world: World): SimpleRaycaster;
177
+ /**
178
+ * Creates a new MeshCullerRenderer for the given world.
179
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
180
+ *
181
+ * @param world - The world for which to create the MeshCullerRenderer.
182
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
183
+ *
184
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
185
+ */
186
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
55
187
  delete(world: World): void;
188
+ /** {@link Disposable.dispose} */
56
189
  dispose(): void;
57
190
  }
58
191
  import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
@@ -106,35 +239,6 @@ export declare class Worlds extends Component implements Updateable, Disposable
106
239
  dispose(): void;
107
240
  update(delta?: number): void | Promise<void>;
108
241
  }
109
- import { MiniMap } from "./src";
110
- import { Component, Updateable, World, Event, Disposable } from "../Types";
111
- import { Components } from "../Components";
112
- export declare class MiniMaps extends Component implements Updateable, Disposable {
113
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
114
- readonly onAfterUpdate: Event<unknown>;
115
- readonly onBeforeUpdate: Event<unknown>;
116
- readonly onDisposed: Event<unknown>;
117
- enabled: boolean;
118
- list: Map<string, MiniMap>;
119
- constructor(components: Components);
120
- create(world: World): MiniMap;
121
- delete(id: string): void;
122
- dispose(): void;
123
- update(): void;
124
- }
125
- import { Component, Disposable, World, Event } from "../Types";
126
- import { GridConfig, SimpleGrid } from "./src";
127
- export declare class Grids extends Component implements Disposable {
128
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
129
- list: Map<string, SimpleGrid>;
130
- onDisposed: Event<unknown>;
131
- config: Required<GridConfig>;
132
- /** {@link Component.enabled} */
133
- enabled: boolean;
134
- create(world: World): SimpleGrid;
135
- delete(world: World): void;
136
- dispose(): void;
137
- }
138
242
  import * as THREE from "three";
139
243
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
140
244
  import { SimplePlane } from "./src";
@@ -234,160 +338,78 @@ export declare class Clipper extends Component implements Createable, Disposable
234
338
  private _onStartDragging;
235
339
  private _onEndDragging;
236
340
  }
237
- import { Component, Disposable, Event } from "../Types";
341
+ import * as THREE from "three";
342
+ import { Components } from "../Components";
343
+ import { SimpleCamera } from "..";
344
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
238
345
  /**
239
- * The entry point of the Components library.
240
- * It can:
241
- * - Create and access all the components of the library.
242
- * - Update all the updatable components automatically.
243
- * - Dispose all the components, preventing memory leaks.
346
+ * A flexible camera that uses
347
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
348
+ * easily control the camera in 2D and 3D. It supports multiple navigation
349
+ * modes, such as 2D floor plan navigation, first person and 3D orbit.
244
350
  */
245
- export declare class Components implements Disposable {
246
- static readonly release = "1.4.21";
247
- /** {@link Disposable.onDisposed} */
248
- readonly onDisposed: Event<void>;
249
- /** The list of components created in this app. */
250
- readonly list: Map<string, Component>;
251
- /** If disabled, the animation loop will be stopped. */
252
- enabled: boolean;
253
- private _clock;
254
- add(uuid: string, instance: Component): void;
351
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
255
352
  /**
256
- * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
257
- * doesn't exist, it will instance it automatically.
258
- *
259
- * @param Component - The component to get or create.
353
+ * The current {@link NavigationMode}.
260
354
  */
261
- get<U extends Component>(Component: new (components: Components) => U): U;
262
- constructor();
355
+ _mode: NavigationMode | null;
356
+ readonly projection: ProjectionManager;
357
+ readonly threeOrtho: THREE.OrthographicCamera;
358
+ readonly threePersp: THREE.PerspectiveCamera;
359
+ protected readonly _userInputButtons: any;
360
+ protected readonly _frustumSize = 50;
361
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
362
+ private previousSize;
363
+ get mode(): NavigationMode;
364
+ constructor(components: Components);
365
+ /** {@link Disposable.dispose} */
366
+ dispose(): void;
263
367
  /**
264
- * Initializes the library. It should be called at the start of the app after
265
- * initializing the scene, the renderer and the
266
- * camera. Additionally, if any component that need a raycaster is
267
- * used, the {@link raycaster} will need to be initialized.
368
+ * Sets a new {@link NavigationMode} and disables the previous one.
369
+ *
370
+ * @param mode - The {@link NavigationMode} to set.
268
371
  */
269
- init(): void;
372
+ set(mode: NavModeID): void;
270
373
  /**
271
- * Disposes the memory of all the components and tools of this instance of
272
- * the library. A memory leak will be created if:
273
- *
274
- * - An instance of the library ends up out of scope and this function isn't
275
- * called. This is especially relevant in Single Page Applications (React,
276
- * Angular, Vue, etc).
277
- *
278
- * - Any of the objects of this instance (meshes, geometries, etc) is
279
- * referenced by a reference type (object or array).
374
+ * Make the camera view fit all the specified meshes.
280
375
  *
281
- * You can learn more about how Three.js handles memory leaks
282
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
376
+ * @param meshes the meshes to fit. If it is not defined, it will
377
+ * evaluate {@link Components.meshes}.
378
+ * @param offset the distance to the fit object
379
+ */
380
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
381
+ /**
382
+ * Allows or prevents all user input.
283
383
  *
384
+ * @param active - whether to enable or disable user inputs.
284
385
  */
285
- dispose(): void;
286
- private update;
287
- private static setupBVH;
386
+ setUserInput(active: boolean): void;
387
+ private disableUserInput;
388
+ private enableUserInput;
389
+ private newOrthoCamera;
390
+ private setOrthoPerspCameraAspect;
288
391
  }
289
- import { Components } from "../Components";
290
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
291
- import { Component, Event, Disposable, World } from "../Types";
292
- /**
293
- * A tool to handle big scenes efficiently by automatically hiding the objects
294
- * that are not visible to the camera.
295
- */
296
- export declare class Cullers extends Component implements Disposable {
297
- /**
298
- * A unique identifier for the Cullers component.
299
- */
300
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
301
- /**
302
- * Indicates whether the Cullers component is enabled.
303
- */
304
- private _enabled;
305
- /**
306
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
307
- */
308
- list: Map<string, MeshCullerRenderer>;
309
- /**
310
- * An event that is triggered when the Cullers component is disposed.
311
- */
392
+ import { Component, Disposable, Event, Components } from "../../core";
393
+ export declare class Exploder extends Component implements Disposable {
394
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
395
+ enabled: boolean;
396
+ height: number;
397
+ groupName: string;
398
+ /** {@link Disposable.onDisposed} */
312
399
  readonly onDisposed: Event<unknown>;
313
- /**
314
- * Gets the enabled state of the Cullers component.
315
- *
316
- * @returns The current enabled state.
317
- */
318
- get enabled(): boolean;
319
- /**
320
- * Sets the enabled state of the Cullers component.
321
- * Also sets the enabled state of all MeshCullerRenderer instances.
322
- *
323
- * @param value - The new enabled state.
324
- */
325
- set enabled(value: boolean);
400
+ list: Set<string>;
326
401
  constructor(components: Components);
327
- /**
328
- * Creates a new MeshCullerRenderer for the given world.
329
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
330
- *
331
- * @param world - The world for which to create the MeshCullerRenderer.
332
- * @param config - Optional configuration settings for the MeshCullerRenderer.
333
- *
334
- * @returns The newly created or existing MeshCullerRenderer for the given world.
335
- */
336
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
337
- delete(world: World): void;
338
- /** {@link Disposable.dispose} */
339
402
  dispose(): void;
403
+ set(active: boolean): void;
340
404
  }
341
405
  import * as THREE from "three";
342
- import { Components } from "../Components";
343
- import { SimpleCamera } from "..";
344
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
345
- /**
346
- * A flexible camera that uses
347
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
348
- * easily control the camera in 2D and 3D. It supports multiple navigation
349
- * modes, such as 2D floor plan navigation, first person and 3D orbit.
350
- */
351
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
352
- /**
353
- * The current {@link NavigationMode}.
354
- */
355
- _mode: NavigationMode | null;
356
- readonly projection: ProjectionManager;
357
- readonly threeOrtho: THREE.OrthographicCamera;
358
- readonly threePersp: THREE.PerspectiveCamera;
359
- protected readonly _userInputButtons: any;
360
- protected readonly _frustumSize = 50;
361
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
362
- get mode(): NavigationMode;
363
- constructor(components: Components);
364
- /** {@link Disposable.dispose} */
365
- dispose(): void;
366
- /**
367
- * Sets a new {@link NavigationMode} and disables the previous one.
368
- *
369
- * @param mode - The {@link NavigationMode} to set.
370
- */
371
- set(mode: NavModeID): void;
372
- /**
373
- * Make the camera view fit all the specified meshes.
374
- *
375
- * @param meshes the meshes to fit. If it is not defined, it will
376
- * evaluate {@link Components.meshes}.
377
- * @param offset the distance to the fit object
378
- */
379
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
380
- /**
381
- * Allows or prevents all user input.
382
- *
383
- * @param active - whether to enable or disable user inputs.
384
- */
385
- setUserInput(active: boolean): void;
386
- private disableUserInput;
387
- private enableUserInput;
388
- private newOrthoCamera;
389
- private setOrthoCameraAspect;
390
- }
406
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
407
+ center: THREE.Vector3;
408
+ halfSizes: THREE.Vector3;
409
+ rotation: THREE.Matrix3;
410
+ transformation: THREE.Matrix4;
411
+ };
412
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
391
413
  import * as THREE from "three";
392
414
  import * as FRAGS from "@thatopen/fragments";
393
415
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -425,28 +447,6 @@ export declare class BoundingBoxer extends Component implements Disposable {
425
447
  private static getFragmentBounds;
426
448
  }
427
449
  import * as THREE from "three";
428
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
429
- center: THREE.Vector3;
430
- halfSizes: THREE.Vector3;
431
- rotation: THREE.Matrix3;
432
- transformation: THREE.Matrix4;
433
- };
434
- import * as FRAGS from "@thatopen/fragments";
435
- import { Components, Component } from "../../core";
436
- export declare class FragmentHider extends Component {
437
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
438
- enabled: boolean;
439
- constructor(components: Components);
440
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
441
- isolate(items: FRAGS.FragmentIdMap): void;
442
- private updateCulledVisibility;
443
- }
444
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
445
- import * as THREE from "three";
446
- export declare class MaterialsUtils {
447
- static isTransparent(material: THREE.Material): boolean;
448
- }
449
- import * as THREE from "three";
450
450
  import * as FRAGS from "@thatopen/fragments";
451
451
  import { Disposable, Component, Event, Components } from "../../core";
452
452
  export interface Classification {
@@ -477,6 +477,47 @@ export declare class Classifier extends Component implements Disposable {
477
477
  resetColor(items: FRAGS.FragmentIdMap): void;
478
478
  private saveItem;
479
479
  }
480
+ import * as FRAGS from "@thatopen/fragments";
481
+ import { Components, Component } from "../../core";
482
+ export declare class FragmentHider extends Component {
483
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
484
+ enabled: boolean;
485
+ constructor(components: Components);
486
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
487
+ isolate(items: FRAGS.FragmentIdMap): void;
488
+ private updateCulledVisibility;
489
+ }
490
+ import * as WEBIFC from "web-ifc";
491
+ import * as FRAGS from "@thatopen/fragments";
492
+ import { IfcFragmentSettings } from "./src";
493
+ import { Component, Components, Event, Disposable } from "../../core";
494
+ export declare class IfcLoader extends Component implements Disposable {
495
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
496
+ readonly onIfcStartedLoading: Event<void>;
497
+ readonly onSetup: Event<void>;
498
+ /** {@link Disposable.onDisposed} */
499
+ readonly onDisposed: Event<string>;
500
+ settings: IfcFragmentSettings;
501
+ enabled: boolean;
502
+ webIfc: WEBIFC.IfcAPI;
503
+ private _material;
504
+ private _spatialTree;
505
+ private _metaData;
506
+ private _fragmentInstances;
507
+ private _civil;
508
+ private _visitedFragments;
509
+ private _materialT;
510
+ constructor(components: Components);
511
+ dispose(): void;
512
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
513
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
514
+ readIfcFile(data: Uint8Array): Promise<number>;
515
+ private getAllGeometries;
516
+ cleanUp(): void;
517
+ private getMesh;
518
+ private getGeometry;
519
+ private autoSetWasm;
520
+ }
480
521
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
481
522
  import * as THREE from "three";
482
523
  import * as FRAGS from "@thatopen/fragments";
@@ -529,76 +570,6 @@ export declare class FragmentsManager extends Component implements Disposable {
529
570
  export(group: FragmentsGroup): Uint8Array;
530
571
  coordinate(models?: FragmentsGroup[]): void;
531
572
  }
532
- import { Component, Disposable, Event, Components } from "../../core";
533
- export declare class Exploder extends Component implements Disposable {
534
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
535
- enabled: boolean;
536
- height: number;
537
- groupName: string;
538
- /** {@link Disposable.onDisposed} */
539
- readonly onDisposed: Event<unknown>;
540
- list: Set<string>;
541
- constructor(components: Components);
542
- dispose(): void;
543
- set(active: boolean): void;
544
- }
545
- import * as WEBIFC from "web-ifc";
546
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
547
- import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
548
- export declare class IfcPropertiesTiler extends Component implements Disposable {
549
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
550
- onPropertiesStreamed: AsyncEvent<{
551
- type: number;
552
- data: {
553
- [id: number]: any;
554
- };
555
- }>;
556
- onProgress: AsyncEvent<number>;
557
- onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
558
- /** {@link Disposable.onDisposed} */
559
- readonly onDisposed: Event<string>;
560
- enabled: boolean;
561
- settings: PropertiesStreamingSettings;
562
- webIfc: WEBIFC.IfcAPI;
563
- dispose(): Promise<void>;
564
- streamFromBuffer(data: Uint8Array): Promise<void>;
565
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
566
- private readIfcFile;
567
- private streamIfcFile;
568
- private streamAllProperties;
569
- private cleanUp;
570
- }
571
- import * as WEBIFC from "web-ifc";
572
- import * as FRAGS from "@thatopen/fragments";
573
- import { IfcFragmentSettings } from "./src";
574
- import { Component, Components, Event, Disposable } from "../../core";
575
- export declare class IfcLoader extends Component implements Disposable {
576
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
577
- readonly onIfcStartedLoading: Event<void>;
578
- readonly onSetup: Event<void>;
579
- /** {@link Disposable.onDisposed} */
580
- readonly onDisposed: Event<string>;
581
- settings: IfcFragmentSettings;
582
- enabled: boolean;
583
- webIfc: WEBIFC.IfcAPI;
584
- private _material;
585
- private _spatialTree;
586
- private _metaData;
587
- private _fragmentInstances;
588
- private _civil;
589
- private _visitedFragments;
590
- private _materialT;
591
- constructor(components: Components);
592
- dispose(): void;
593
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
594
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
595
- readIfcFile(data: Uint8Array): Promise<number>;
596
- private getAllGeometries;
597
- cleanUp(): void;
598
- private getMesh;
599
- private getGeometry;
600
- private autoSetWasm;
601
- }
602
573
  import * as WEBIFC from "web-ifc";
603
574
  import { Components, Disposable, Event, Component } from "../../core";
604
575
  import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
@@ -640,20 +611,91 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
640
611
  private streamGeometries;
641
612
  }
642
613
  import * as WEBIFC from "web-ifc";
643
- import { FragmentsGroup } from "@thatopen/fragments";
644
- import { Disposable, Event, Component, Components } from "../../core";
645
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
646
- /**
647
- * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
648
- * 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.
649
- */
650
- export declare class IfcRelationsIndexer extends Component implements Disposable {
651
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
652
- /** {@link Disposable.onDisposed} */
653
- readonly onDisposed: Event<string>;
654
- enabled: boolean;
655
- readonly onRelationsIndexed: Event<{
656
- modelID: string;
614
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
615
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
616
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
617
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
618
+ onPropertiesStreamed: AsyncEvent<{
619
+ type: number;
620
+ data: {
621
+ [id: number]: any;
622
+ };
623
+ }>;
624
+ onProgress: AsyncEvent<number>;
625
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
626
+ /** {@link Disposable.onDisposed} */
627
+ readonly onDisposed: Event<string>;
628
+ enabled: boolean;
629
+ settings: PropertiesStreamingSettings;
630
+ webIfc: WEBIFC.IfcAPI;
631
+ dispose(): Promise<void>;
632
+ streamFromBuffer(data: Uint8Array): Promise<void>;
633
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
634
+ private readIfcFile;
635
+ private streamIfcFile;
636
+ private streamAllProperties;
637
+ private cleanUp;
638
+ }
639
+ import * as WEBIFC from "web-ifc";
640
+ import * as FRAG from "@thatopen/fragments";
641
+ import { Component, Components } from "../../core";
642
+ /**
643
+ * Object to export all the properties from an IFC to a JS object.
644
+ */
645
+ export declare class IfcJsonExporter extends Component {
646
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
647
+ /** {@link Component.enabled} */
648
+ enabled: boolean;
649
+ constructor(components: Components);
650
+ /**
651
+ * Exports all the properties of an IFC into an array of JS objects.
652
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
653
+ * @param modelID ID of the IFC model whose properties to extract.
654
+ * @param indirect whether to get the indirect relationships as well.
655
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
656
+ * to make the location data available (e.g. absolute position of building).
657
+ */
658
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
659
+ }
660
+ import * as THREE from "three";
661
+ import { Component, Components } from "../../core";
662
+ export interface MeasureEdge {
663
+ distance: number;
664
+ points: THREE.Vector3[];
665
+ }
666
+ export declare class MeasurementUtils extends Component {
667
+ enabled: boolean;
668
+ static uuid: string;
669
+ constructor(components: Components);
670
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
671
+ edges: MeasureEdge[];
672
+ indices: Set<number>;
673
+ } | null;
674
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
675
+ private getFaceData;
676
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
677
+ p1: THREE.Vector3;
678
+ p2: THREE.Vector3;
679
+ p3: THREE.Vector3;
680
+ faceNormal: THREE.Vector3;
681
+ };
682
+ private round;
683
+ }
684
+ import * as WEBIFC from "web-ifc";
685
+ import { FragmentsGroup } from "@thatopen/fragments";
686
+ import { Disposable, Event, Component, Components } from "../../core";
687
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
688
+ /**
689
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
690
+ * 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
+ */
692
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
693
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
694
+ /** {@link Disposable.onDisposed} */
695
+ readonly onDisposed: Event<string>;
696
+ enabled: boolean;
697
+ readonly onRelationsIndexed: Event<{
698
+ modelID: string;
657
699
  relationsMap: RelationsMap;
658
700
  }>;
659
701
  private _relToAttributesMap;
@@ -771,51 +813,6 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
771
813
  dispose(): void;
772
814
  }
773
815
  export type { InverseAttribute } from "./src/types";
774
- import * as THREE from "three";
775
- import { Component, Components } from "../../core";
776
- export interface MeasureEdge {
777
- distance: number;
778
- points: THREE.Vector3[];
779
- }
780
- export declare class MeasurementUtils extends Component {
781
- enabled: boolean;
782
- static uuid: string;
783
- constructor(components: Components);
784
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
785
- edges: MeasureEdge[];
786
- indices: Set<number>;
787
- } | null;
788
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
789
- private getFaceData;
790
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
791
- p1: THREE.Vector3;
792
- p2: THREE.Vector3;
793
- p3: THREE.Vector3;
794
- faceNormal: THREE.Vector3;
795
- };
796
- private round;
797
- }
798
- import * as WEBIFC from "web-ifc";
799
- import * as FRAG from "@thatopen/fragments";
800
- import { Component, Components } from "../../core";
801
- /**
802
- * Object to export all the properties from an IFC to a JS object.
803
- */
804
- export declare class IfcJsonExporter extends Component {
805
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
806
- /** {@link Component.enabled} */
807
- enabled: boolean;
808
- constructor(components: Components);
809
- /**
810
- * Exports all the properties of an IFC into an array of JS objects.
811
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
812
- * @param modelID ID of the IFC model whose properties to extract.
813
- * @param indirect whether to get the indirect relationships as well.
814
- * @param recursiveSpatial whether to get the properties of spatial items recursively
815
- * to make the location data available (e.g. absolute position of building).
816
- */
817
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
818
- }
819
816
  import * as WEBIFC from "web-ifc";
820
817
  import { FragmentsGroup } from "@thatopen/fragments";
821
818
  import { Component, Disposable, Event, Components } from "../../core";
@@ -888,6 +885,10 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
888
885
  setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
889
886
  }
890
887
  export {};
888
+ import * as THREE from "three";
889
+ export declare class MaterialsUtils {
890
+ static isTransparent(material: THREE.Material): boolean;
891
+ }
891
892
  export declare class UUID {
892
893
  private static _pattern;
893
894
  private static _lut;
@@ -922,7 +923,7 @@ export declare class VertexPicker extends Component {
922
923
  private getVertices;
923
924
  private getVertex;
924
925
  }
925
- export declare const IfcElements: {
926
+ export declare const IfcCategoryMap: {
926
927
  [key: number]: string;
927
928
  };
928
929
  import * as WEBIFC from "web-ifc";
@@ -975,7 +976,7 @@ export declare class SpatialStructure {
975
976
  setUp(webIfc: WEBIFC.IfcAPI): void;
976
977
  cleanUp(): void;
977
978
  }
978
- export declare const IfcCategoryMap: {
979
+ export declare const IfcElements: {
979
980
  [key: number]: string;
980
981
  };
981
982
  import * as FRAGS from "@thatopen/fragments";
@@ -1003,74 +1004,6 @@ export declare class IfcPropertiesUtils {
1003
1004
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
1004
1005
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
1005
1006
  }
1006
- /**
1007
- * Simple event handler by
1008
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1009
- * Keep in mind that:
1010
- * - If you want to remove it later, you might want to declare the callback as
1011
- * an object.
1012
- * - If you want to maintain the reference to 'this', you will need to declare
1013
- * the callback as an arrow function.
1014
- */
1015
- export declare class Event<T> {
1016
- /**
1017
- * Add a callback to this event instance.
1018
- * @param handler - the callback to be added to this event.
1019
- */
1020
- add(handler: T extends void ? {
1021
- (): void;
1022
- } : {
1023
- (data: T): void;
1024
- }): void;
1025
- /**
1026
- * Removes a callback from this event instance.
1027
- * @param handler - the callback to be removed from this event.
1028
- */
1029
- remove(handler: T extends void ? {
1030
- (): void;
1031
- } : {
1032
- (data: T): void;
1033
- }): void;
1034
- /** Triggers all the callbacks assigned to this event. */
1035
- trigger: (data?: T) => void;
1036
- /** Gets rid of all the suscribed events. */
1037
- reset(): void;
1038
- private handlers;
1039
- }
1040
- /**
1041
- * Simple event handler by
1042
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1043
- * Keep in mind that:
1044
- * - If you want to remove it later, you might want to declare the callback as
1045
- * an object.
1046
- * - If you want to maintain the reference to 'this', you will need to declare
1047
- * the callback as an arrow function.
1048
- */
1049
- export declare class AsyncEvent<T> {
1050
- /**
1051
- * Add a callback to this event instance.
1052
- * @param handler - the callback to be added to this event.
1053
- */
1054
- add(handler: T extends void ? {
1055
- (): Promise<void>;
1056
- } : {
1057
- (data: T): Promise<void>;
1058
- }): void;
1059
- /**
1060
- * Removes a callback from this event instance.
1061
- * @param handler - the callback to be removed from this event.
1062
- */
1063
- remove(handler: T extends void ? {
1064
- (): Promise<void>;
1065
- } : {
1066
- (data: T): Promise<void>;
1067
- }): void;
1068
- /** Triggers all the callbacks assigned to this event. */
1069
- trigger: (data?: T) => Promise<void>;
1070
- /** Gets rid of all the suscribed events. */
1071
- reset(): void;
1072
- private handlers;
1073
- }
1074
1007
  import * as THREE from "three";
1075
1008
  import CameraControls from "camera-controls";
1076
1009
  import { Event } from "./event";
@@ -1194,83 +1127,110 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1194
1127
  export interface CameraControllable {
1195
1128
  controls: CameraControls;
1196
1129
  }
1197
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1198
- import { Components } from "../../Components";
1199
- /**
1200
- * Base class of the library. Useful for finding out the interfaces it implements.
1201
- */
1202
- export declare abstract class Base {
1203
- components: Components;
1204
- constructor(components: Components);
1205
- /** Whether is component is {@link Disposable}. */
1206
- isDisposeable: () => this is Disposable;
1207
- /** Whether is component is {@link Resizeable}. */
1208
- isResizeable: () => this is Resizeable;
1209
- /** Whether is component is {@link Updateable}. */
1210
- isUpdateable: () => this is Updateable;
1211
- /** Whether is component is {@link Hideable}. */
1212
- isHideable: () => this is Hideable;
1213
- /** Whether is component is {@link Configurable}. */
1214
- isConfigurable: () => this is Configurable<any>;
1215
- }
1216
- import { Base } from "./base";
1217
1130
  /**
1218
- * Components are the building blocks of this library. Components are singleton
1219
- * elements that contain specific functionality. For instance, the SimpleClipper
1220
- * Component can create, delete and handle 3D clipping planes. Components must be
1221
- * unique (they can't be instanced more than once), and have a static UUID that
1222
- * identifies them uniquely. The can be accessed globally using the {@link Components}
1223
- * instance.
1131
+ * Simple event handler by
1132
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1133
+ * Keep in mind that:
1134
+ * - If you want to remove it later, you might want to declare the callback as
1135
+ * an object.
1136
+ * - If you want to maintain the reference to 'this', you will need to declare
1137
+ * the callback as an arrow function.
1224
1138
  */
1225
- export declare abstract class Component extends Base {
1139
+ export declare class AsyncEvent<T> {
1226
1140
  /**
1227
- * Whether this component is active or not. The behaviour can vary depending
1228
- * on the type of component. E.g. a disabled dimension tool will stop creating
1229
- * dimensions, while a disabled camera will stop moving. A disabled component
1230
- * will not be updated automatically each frame.
1141
+ * Add a callback to this event instance.
1142
+ * @param handler - the callback to be added to this event.
1231
1143
  */
1232
- abstract enabled: boolean;
1233
- }
1234
- import { Base } from "./base";
1235
- import { World } from "./world";
1236
- import { Event } from "./event";
1237
- import { Components } from "../../Components";
1238
- /**
1239
- * One of the elements that make a world. It can be either a scene, a camera
1240
- * or a renderer.
1144
+ add(handler: T extends void ? {
1145
+ (): Promise<void>;
1146
+ } : {
1147
+ (data: T): Promise<void>;
1148
+ }): void;
1149
+ /**
1150
+ * Removes a callback from this event instance.
1151
+ * @param handler - the callback to be removed from this event.
1152
+ */
1153
+ remove(handler: T extends void ? {
1154
+ (): Promise<void>;
1155
+ } : {
1156
+ (data: T): Promise<void>;
1157
+ }): void;
1158
+ /** Triggers all the callbacks assigned to this event. */
1159
+ trigger: (data?: T) => Promise<void>;
1160
+ /** Gets rid of all the suscribed events. */
1161
+ reset(): void;
1162
+ private handlers;
1163
+ }
1164
+ /**
1165
+ * Simple event handler by
1166
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1167
+ * Keep in mind that:
1168
+ * - If you want to remove it later, you might want to declare the callback as
1169
+ * an object.
1170
+ * - If you want to maintain the reference to 'this', you will need to declare
1171
+ * the callback as an arrow function.
1241
1172
  */
1242
- export declare abstract class BaseWorldItem extends Base {
1243
- readonly worlds: Map<string, World>;
1244
- readonly onWorldChanged: Event<{
1245
- world: World;
1246
- action: "added" | "removed";
1247
- }>;
1248
- currentWorld: World | null;
1249
- protected constructor(components: Components);
1173
+ export declare class Event<T> {
1174
+ /**
1175
+ * Add a callback to this event instance.
1176
+ * @param handler - the callback to be added to this event.
1177
+ */
1178
+ add(handler: T extends void ? {
1179
+ (): void;
1180
+ } : {
1181
+ (data: T): void;
1182
+ }): void;
1183
+ /**
1184
+ * Removes a callback from this event instance.
1185
+ * @param handler - the callback to be removed from this event.
1186
+ */
1187
+ remove(handler: T extends void ? {
1188
+ (): void;
1189
+ } : {
1190
+ (data: T): void;
1191
+ }): void;
1192
+ /** Triggers all the callbacks assigned to this event. */
1193
+ trigger: (data?: T) => void;
1194
+ /** Gets rid of all the suscribed events. */
1195
+ reset(): void;
1196
+ private handlers;
1250
1197
  }
1251
- import * as THREE from "three";
1252
- import { Disposable } from "./interfaces";
1253
- import { Event } from "./event";
1198
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1254
1199
  import { Components } from "../../Components";
1255
- import { BaseWorldItem } from "./base-world-item";
1256
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1257
- /** {@link Disposable.onDisposed} */
1258
- readonly onDisposed: Event<unknown>;
1259
- abstract three: THREE.Object3D;
1260
- protected constructor(components: Components);
1261
- /** {@link Disposable.dispose} */
1262
- dispose(): void;
1200
+ /**
1201
+ * Base class of the library. Useful for finding out the interfaces it implements.
1202
+ */
1203
+ export declare abstract class Base {
1204
+ components: Components;
1205
+ constructor(components: Components);
1206
+ /** Whether is component is {@link Disposable}. */
1207
+ isDisposeable: () => this is Disposable;
1208
+ /** Whether is component is {@link Resizeable}. */
1209
+ isResizeable: () => this is Resizeable;
1210
+ /** Whether is component is {@link Updateable}. */
1211
+ isUpdateable: () => this is Updateable;
1212
+ /** Whether is component is {@link Hideable}. */
1213
+ isHideable: () => this is Hideable;
1214
+ /** Whether is component is {@link Configurable}. */
1215
+ isConfigurable: () => this is Configurable<any>;
1263
1216
  }
1264
- import * as THREE from "three";
1265
- import CameraControls from "camera-controls";
1266
- import { BaseWorldItem } from "./base-world-item";
1267
- import { CameraControllable } from "./interfaces";
1268
- export declare abstract class BaseCamera extends BaseWorldItem {
1217
+ import { Base } from "./base";
1218
+ /**
1219
+ * Components are the building blocks of this library. Components are singleton
1220
+ * elements that contain specific functionality. For instance, the SimpleClipper
1221
+ * Component can create, delete and handle 3D clipping planes. Components must be
1222
+ * unique (they can't be instanced more than once), and have a static UUID that
1223
+ * identifies them uniquely. The can be accessed globally using the {@link Components}
1224
+ * instance.
1225
+ */
1226
+ export declare abstract class Component extends Base {
1227
+ /**
1228
+ * Whether this component is active or not. The behaviour can vary depending
1229
+ * on the type of component. E.g. a disabled dimension tool will stop creating
1230
+ * dimensions, while a disabled camera will stop moving. A disabled component
1231
+ * will not be updated automatically each frame.
1232
+ */
1269
1233
  abstract enabled: boolean;
1270
- abstract three: THREE.Camera;
1271
- abstract controls?: CameraControls;
1272
- /** Whether is instance is {@link CameraControllable}. */
1273
- hasCameraControls: () => this is CameraControllable;
1274
1234
  }
1275
1235
  import * as THREE from "three";
1276
1236
  import { Vector2 } from "three";
@@ -1312,6 +1272,34 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1312
1272
  */
1313
1273
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1314
1274
  }
1275
+ import { Base } from "./base";
1276
+ import { World } from "./world";
1277
+ import { Event } from "./event";
1278
+ import { Components } from "../../Components";
1279
+ /**
1280
+ * One of the elements that make a world. It can be either a scene, a camera
1281
+ * or a renderer.
1282
+ */
1283
+ export declare abstract class BaseWorldItem extends Base {
1284
+ readonly worlds: Map<string, World>;
1285
+ readonly onWorldChanged: Event<{
1286
+ world: World;
1287
+ action: "added" | "removed";
1288
+ }>;
1289
+ currentWorld: World | null;
1290
+ protected constructor(components: Components);
1291
+ }
1292
+ import * as THREE from "three";
1293
+ import CameraControls from "camera-controls";
1294
+ import { BaseWorldItem } from "./base-world-item";
1295
+ import { CameraControllable } from "./interfaces";
1296
+ export declare abstract class BaseCamera extends BaseWorldItem {
1297
+ abstract enabled: boolean;
1298
+ abstract three: THREE.Camera;
1299
+ abstract controls?: CameraControls;
1300
+ /** Whether is instance is {@link CameraControllable}. */
1301
+ hasCameraControls: () => this is CameraControllable;
1302
+ }
1315
1303
  import * as THREE from "three";
1316
1304
  import { BaseScene } from "./base-scene";
1317
1305
  import { BaseCamera } from "./base-camera";
@@ -1325,224 +1313,43 @@ export interface World extends Disposable, Updateable {
1325
1313
  uuid: string;
1326
1314
  }
1327
1315
  import * as THREE from "three";
1328
- import { BaseScene, Configurable, Event } from "../../Types";
1329
- import { Components } from "../../Components";
1330
- export interface SimpleSceneConfig {
1331
- directionalLight: {
1332
- color: THREE.Color;
1333
- intensity: number;
1334
- position: THREE.Vector3;
1335
- };
1336
- ambientLight: {
1337
- color: THREE.Color;
1338
- intensity: number;
1339
- };
1340
- }
1341
- /**
1342
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1343
- * objects hierarchically, and easily dispose them when you are finished with it.
1344
- * @noInheritDoc
1345
- */
1346
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1347
- /** {@link Configurable.isSetup} */
1348
- isSetup: boolean;
1349
- three: THREE.Scene;
1350
- /** {@link Configurable.onSetup} */
1351
- readonly onSetup: Event<SimpleScene>;
1352
- config: Required<SimpleSceneConfig>;
1353
- constructor(components: Components);
1354
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1355
- setup(config?: Partial<SimpleSceneConfig>): void;
1356
- }
1357
- import * as THREE from "three";
1358
- import { BaseRenderer, Event } from "../../Types";
1359
- import { Components } from "../../Components";
1360
- /**
1361
- * A basic renderer capable of rendering
1362
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1363
- */
1364
- export declare class SimpleRenderer extends BaseRenderer {
1365
- enabled: boolean;
1366
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
1367
- container: HTMLElement;
1368
- three: THREE.WebGLRenderer;
1369
- protected _canvas: HTMLCanvasElement;
1370
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1371
- protected _resizeObserver: ResizeObserver | null;
1372
- protected onContainerUpdated: Event<unknown>;
1373
- constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1374
- /** {@link Updateable.update} */
1375
- update(): void;
1376
- /** {@link Disposable.dispose} */
1377
- dispose(): void;
1378
- /** {@link Resizeable.getSize}. */
1379
- getSize(): THREE.Vector2;
1380
- /** {@link Resizeable.resize} */
1381
- resize: (size?: THREE.Vector2) => void;
1382
- setupEvents(active: boolean): void;
1383
- private resizeEvent;
1384
- private setupRenderer;
1385
- private onContextLost;
1386
- private onContextBack;
1387
- }
1388
- import { InverseAttribute } from "./types";
1389
- export declare const relToAttributesMap: Map<number, {
1390
- forRelating: InverseAttribute;
1391
- forRelated: InverseAttribute;
1392
- }>;
1393
- /// <reference types="node" />
1394
- import * as THREE from "three";
1395
- import { Hideable, Event, World } from "../../Types";
1316
+ import { Disposable } from "./interfaces";
1317
+ import { Event } from "./event";
1396
1318
  import { Components } from "../../Components";
1397
- export interface GridConfig {
1398
- color: THREE.Color;
1399
- size1: number;
1400
- size2: number;
1401
- distance: number;
1402
- }
1403
- /**
1404
- * An infinite grid. Created by
1405
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1406
- * and translated to typescript by
1407
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1408
- */
1409
- export declare class SimpleGrid implements Hideable, Disposable {
1319
+ import { BaseWorldItem } from "./base-world-item";
1320
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1410
1321
  /** {@link Disposable.onDisposed} */
1411
1322
  readonly onDisposed: Event<unknown>;
1412
- world: World;
1413
- components: Components;
1414
- /** {@link Hideable.visible} */
1415
- get visible(): boolean;
1416
- /** {@link Hideable.visible} */
1417
- set visible(visible: boolean);
1418
- /** The material of the grid. */
1419
- get material(): THREE.ShaderMaterial;
1420
- /**
1421
- * Whether the grid should fade away with distance. Recommended to be true for
1422
- * perspective cameras and false for orthographic cameras.
1423
- */
1424
- get fade(): boolean;
1425
- /**
1426
- * Whether the grid should fade away with distance. Recommended to be true for
1427
- * perspective cameras and false for orthographic cameras.
1428
- */
1429
- set fade(active: boolean);
1430
- readonly three: THREE.Mesh;
1431
- private _fade;
1432
- constructor(components: Components, world: World, config: GridConfig);
1433
- [Symbol.dispose](): void;
1434
- /** {@link Disposable.dispose} */
1435
- dispose(): void;
1436
- private setupEvents;
1437
- private updateZoom;
1438
- }
1439
- import * as THREE from "three";
1440
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1441
- import { Components } from "../../Components";
1442
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1443
- /**
1444
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1445
- */
1446
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1447
- readonly onAfterUpdate: Event<unknown>;
1448
- readonly onBeforeUpdate: Event<unknown>;
1449
- enabled: boolean;
1450
- uuid: string;
1451
- readonly onDisposed: Event<unknown>;
1452
- private _scene?;
1453
- private _camera?;
1454
- private _renderer;
1455
- get scene(): T;
1456
- set scene(scene: T);
1457
- get camera(): U;
1458
- set camera(camera: U);
1459
- get renderer(): S | null;
1460
- set renderer(renderer: S | null);
1461
- constructor(components: Components);
1462
- update(delta?: number): void;
1463
- dispose(disposeResources?: boolean): void;
1464
- }
1465
- import * as THREE from "three";
1466
- import CameraControls from "camera-controls";
1467
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1468
- import { Components } from "../../Components";
1469
- /**
1470
- * A basic camera that uses
1471
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1472
- * easily control the camera in 2D and 3D. Check out it's API to find out
1473
- * what features it offers.
1474
- */
1475
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1476
- /** {@link Updateable.onBeforeUpdate} */
1477
- readonly onBeforeUpdate: Event<SimpleCamera>;
1478
- /** {@link Updateable.onAfterUpdate} */
1479
- readonly onAfterUpdate: Event<SimpleCamera>;
1480
- readonly onAspectUpdated: Event<unknown>;
1481
- /** {@link Disposable.onDisposed} */
1482
- readonly onDisposed: Event<string>;
1483
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1484
- private _allControls;
1485
- /**
1486
- * The object that controls the camera. An instance of
1487
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1488
- * Transforming the camera directly will have no effect: you need to use this
1489
- * object to move, rotate, look at objects, etc.
1490
- */
1491
- get controls(): CameraControls;
1492
- /** {@link Component.enabled} */
1493
- get enabled(): boolean;
1494
- /** {@link Component.enabled} */
1495
- set enabled(enabled: boolean);
1496
- constructor(components: Components);
1323
+ abstract three: THREE.Object3D;
1324
+ protected constructor(components: Components);
1497
1325
  /** {@link Disposable.dispose} */
1498
1326
  dispose(): void;
1499
- /** {@link Updateable.update} */
1500
- update(_delta: number): void;
1501
- /**
1502
- * Updates the aspect of the camera to match the size of the
1503
- * {@link Components.renderer}.
1504
- */
1505
- updateAspect: () => void;
1506
- private setupCamera;
1507
- private newCameraControls;
1508
- private setupEvents;
1509
- private static getSubsetOfThree;
1510
1327
  }
1511
1328
  import * as THREE from "three";
1512
- import { Components } from "../../Components";
1513
- import { Event, World, Disposable } from "../../Types";
1514
- import { Mouse } from "./mouse";
1329
+ import { Disposable, Event } from "../../Types";
1515
1330
  /**
1516
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1517
- * that allows to easily get items from the scene using the mouse and touch
1518
- * events.
1519
- */
1520
- export declare class SimpleRaycaster implements Disposable {
1521
- /** {@link Component.enabled} */
1522
- enabled: boolean;
1523
- components: Components;
1331
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1332
+ * to work with tools like the
1333
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1334
+ * been transformed through CSS or doesn't occupy the whole screen.
1335
+ */
1336
+ export declare class Mouse implements Disposable {
1337
+ dom: HTMLCanvasElement;
1338
+ private _event?;
1339
+ private _position;
1524
1340
  /** {@link Disposable.onDisposed} */
1525
1341
  readonly onDisposed: Event<unknown>;
1526
- /** The position of the mouse in the screen. */
1527
- readonly mouse: Mouse;
1528
- readonly three: THREE.Raycaster;
1529
- world: World;
1530
- constructor(components: Components, world: World);
1531
- /** {@link Disposable.dispose} */
1532
- dispose(): void;
1342
+ constructor(dom: HTMLCanvasElement);
1533
1343
  /**
1534
- * Throws a ray from the camera to the mouse or touch event point and returns
1535
- * the first item found. This also takes into account the clipping planes
1536
- * used by the renderer.
1537
- *
1538
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1539
- * to query. If not provided, it will query all the meshes stored in
1540
- * {@link Components.meshes}.
1344
+ * The real position of the mouse of the Three.js canvas.
1541
1345
  */
1542
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1543
- 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;
1544
- private intersect;
1545
- private filterClippingPlanes;
1346
+ get position(): THREE.Vector2;
1347
+ /** {@link Disposable.dispose} */
1348
+ dispose(): void;
1349
+ private getPositionY;
1350
+ private getPositionX;
1351
+ private updateMouseInfo;
1352
+ private setupEvents;
1546
1353
  }
1547
1354
  import * as THREE from "three";
1548
1355
  import { Components } from "../../Components";
@@ -1611,6 +1418,47 @@ export declare class CullerRenderer {
1611
1418
  protected decreaseColor(): void;
1612
1419
  private applySettings;
1613
1420
  }
1421
+ import { InverseAttribute } from "./types";
1422
+ export declare const relToAttributesMap: Map<number, {
1423
+ forRelating: InverseAttribute;
1424
+ forRelated: InverseAttribute;
1425
+ }>;
1426
+ import * as THREE from "three";
1427
+ import { Components } from "../../Components";
1428
+ import { Event, World, Disposable } from "../../Types";
1429
+ import { Mouse } from "./mouse";
1430
+ /**
1431
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1432
+ * that allows to easily get items from the scene using the mouse and touch
1433
+ * events.
1434
+ */
1435
+ export declare class SimpleRaycaster implements Disposable {
1436
+ /** {@link Component.enabled} */
1437
+ enabled: boolean;
1438
+ components: Components;
1439
+ /** {@link Disposable.onDisposed} */
1440
+ readonly onDisposed: Event<unknown>;
1441
+ /** The position of the mouse in the screen. */
1442
+ readonly mouse: Mouse;
1443
+ readonly three: THREE.Raycaster;
1444
+ world: World;
1445
+ constructor(components: Components, world: World);
1446
+ /** {@link Disposable.dispose} */
1447
+ dispose(): void;
1448
+ /**
1449
+ * Throws a ray from the camera to the mouse or touch event point and returns
1450
+ * the first item found. This also takes into account the clipping planes
1451
+ * used by the renderer.
1452
+ *
1453
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1454
+ * to query. If not provided, it will query all the meshes stored in
1455
+ * {@link Components.meshes}.
1456
+ */
1457
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1458
+ 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;
1459
+ private intersect;
1460
+ private filterClippingPlanes;
1461
+ }
1614
1462
  import * as THREE from "three";
1615
1463
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1616
1464
  import { Components } from "../../Components";
@@ -1639,51 +1487,52 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1639
1487
  private handleWorkerMessage;
1640
1488
  private getAvailableMaterial;
1641
1489
  }
1490
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1491
+ /// <reference types="node" />
1642
1492
  import * as THREE from "three";
1643
- import { Disposable, Event } from "../../Types";
1493
+ import { Hideable, Event, World } from "../../Types";
1494
+ import { Components } from "../../Components";
1495
+ export interface GridConfig {
1496
+ color: THREE.Color;
1497
+ size1: number;
1498
+ size2: number;
1499
+ distance: number;
1500
+ }
1644
1501
  /**
1645
- * A helper to easily get the real position of the mouse in the Three.js canvas
1646
- * to work with tools like the
1647
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1648
- * been transformed through CSS or doesn't occupy the whole screen.
1502
+ * An infinite grid. Created by
1503
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1504
+ * and translated to typescript by
1505
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1649
1506
  */
1650
- export declare class Mouse implements Disposable {
1651
- dom: HTMLCanvasElement;
1652
- private _event?;
1653
- private _position;
1507
+ export declare class SimpleGrid implements Hideable, Disposable {
1654
1508
  /** {@link Disposable.onDisposed} */
1655
1509
  readonly onDisposed: Event<unknown>;
1656
- constructor(dom: HTMLCanvasElement);
1510
+ world: World;
1511
+ components: Components;
1512
+ /** {@link Hideable.visible} */
1513
+ get visible(): boolean;
1514
+ /** {@link Hideable.visible} */
1515
+ set visible(visible: boolean);
1516
+ /** The material of the grid. */
1517
+ get material(): THREE.ShaderMaterial;
1657
1518
  /**
1658
- * The real position of the mouse of the Three.js canvas.
1519
+ * Whether the grid should fade away with distance. Recommended to be true for
1520
+ * perspective cameras and false for orthographic cameras.
1659
1521
  */
1660
- get position(): THREE.Vector2;
1522
+ get fade(): boolean;
1523
+ /**
1524
+ * Whether the grid should fade away with distance. Recommended to be true for
1525
+ * perspective cameras and false for orthographic cameras.
1526
+ */
1527
+ set fade(active: boolean);
1528
+ readonly three: THREE.Mesh;
1529
+ private _fade;
1530
+ constructor(components: Components, world: World, config: GridConfig);
1531
+ [Symbol.dispose](): void;
1661
1532
  /** {@link Disposable.dispose} */
1662
1533
  dispose(): void;
1663
- private getPositionY;
1664
- private getPositionX;
1665
- private updateMouseInfo;
1666
1534
  private setupEvents;
1667
- }
1668
- import * as WEBIFC from "web-ifc";
1669
- export declare class IfcMetadataReader {
1670
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1671
- }
1672
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1673
- import * as THREE from "three";
1674
- import * as WEBIFC from "web-ifc";
1675
- import * as FRAGS from "@thatopen/fragments";
1676
- export declare class CivilReader {
1677
- defLineMat: THREE.LineBasicMaterial;
1678
- read(webIfc: WEBIFC.IfcAPI): {
1679
- alignments: Map<number, FRAGS.Alignment>;
1680
- coordinationMatrix: THREE.Matrix4;
1681
- } | undefined;
1682
- get(civilItems: any): {
1683
- alignments: Map<number, FRAGS.Alignment>;
1684
- coordinationMatrix: THREE.Matrix4;
1685
- } | undefined;
1686
- private getCurves;
1535
+ private updateZoom;
1687
1536
  }
1688
1537
  import * as WEBIFC from "web-ifc";
1689
1538
  /** Configuration of the IFC-fragment conversion. */
@@ -1712,60 +1561,210 @@ export declare class IfcFragmentSettings {
1712
1561
  autoSetWasm: boolean;
1713
1562
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1714
1563
  }
1715
- import { NavigationMode } from "./types";
1716
- import { OrthoPerspectiveCamera } from "../index";
1564
+ import * as THREE from "three";
1565
+ import * as WEBIFC from "web-ifc";
1566
+ import * as FRAGS from "@thatopen/fragments";
1567
+ export declare class CivilReader {
1568
+ defLineMat: THREE.LineBasicMaterial;
1569
+ read(webIfc: WEBIFC.IfcAPI): {
1570
+ alignments: Map<number, FRAGS.Alignment>;
1571
+ coordinationMatrix: THREE.Matrix4;
1572
+ } | undefined;
1573
+ get(civilItems: any): {
1574
+ alignments: Map<number, FRAGS.Alignment>;
1575
+ coordinationMatrix: THREE.Matrix4;
1576
+ } | undefined;
1577
+ private getCurves;
1578
+ }
1579
+ import * as WEBIFC from "web-ifc";
1580
+ export declare class IfcMetadataReader {
1581
+ get(webIfc: WEBIFC.IfcAPI, type: number): string;
1582
+ }
1583
+ export interface StreamedGeometries {
1584
+ [id: number]: {
1585
+ boundingBox: Float32Array;
1586
+ hasHoles: boolean;
1587
+ geometryFile?: string;
1588
+ };
1589
+ }
1590
+ export interface StreamedAsset {
1591
+ id: number;
1592
+ geometries: {
1593
+ geometryID: number;
1594
+ transformation: number[];
1595
+ color: number[];
1596
+ }[];
1597
+ }
1598
+ import * as WEBIFC from "web-ifc";
1599
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1600
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1601
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1602
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1603
+ onPropertiesStreamed: AsyncEvent<{
1604
+ type: number;
1605
+ data: {
1606
+ [id: number]: any;
1607
+ };
1608
+ }>;
1609
+ onProgress: AsyncEvent<number>;
1610
+ onIndicesStreamed: AsyncEvent<number[][]>;
1611
+ /** {@link Disposable.onDisposed} */
1612
+ readonly onDisposed: Event<string>;
1613
+ enabled: boolean;
1614
+ settings: PropertiesStreamingSettings;
1615
+ webIfc: WEBIFC.IfcAPI;
1616
+ dispose(): Promise<void>;
1617
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1618
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1619
+ private readIfcFile;
1620
+ private streamIfcFile;
1621
+ private streamAllProperties;
1622
+ private getIndices;
1623
+ private cleanUp;
1624
+ }
1625
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
1626
+ /** Configuration of the IFC-fragment streaming. */
1627
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1628
+ minGeometrySize: number;
1629
+ minAssetsSize: number;
1630
+ }
1631
+ /** Configuration of the IFC-fragment streaming. */
1632
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1633
+ propertiesSize: number;
1634
+ }
1635
+ import * as THREE from "three";
1636
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1637
+ import { Components } from "../../Components";
1638
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1639
+ /**
1640
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1641
+ */
1642
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1643
+ readonly onAfterUpdate: Event<unknown>;
1644
+ readonly onBeforeUpdate: Event<unknown>;
1645
+ enabled: boolean;
1646
+ uuid: string;
1647
+ readonly onDisposed: Event<unknown>;
1648
+ private _scene?;
1649
+ private _camera?;
1650
+ private _renderer;
1651
+ get scene(): T;
1652
+ set scene(scene: T);
1653
+ get camera(): U;
1654
+ set camera(camera: U);
1655
+ get renderer(): S | null;
1656
+ set renderer(renderer: S | null);
1657
+ constructor(components: Components);
1658
+ update(delta?: number): void;
1659
+ dispose(disposeResources?: boolean): void;
1660
+ }
1661
+ import * as THREE from "three";
1662
+ import { BaseRenderer, Event } from "../../Types";
1663
+ import { Components } from "../../Components";
1717
1664
  /**
1718
- * A {@link NavigationMode} that allows first person navigation,
1719
- * simulating FPS video games.
1665
+ * A basic renderer capable of rendering
1666
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1720
1667
  */
1721
- export declare class FirstPersonMode implements NavigationMode {
1722
- private camera;
1723
- /** {@link NavigationMode.enabled} */
1668
+ export declare class SimpleRenderer extends BaseRenderer {
1724
1669
  enabled: boolean;
1725
- /** {@link NavigationMode.id} */
1726
- readonly id = "FirstPerson";
1727
- constructor(camera: OrthoPerspectiveCamera);
1728
- /** {@link NavigationMode.set} */
1729
- set(active: boolean): void;
1730
- private setupFirstPersonCamera;
1670
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1671
+ container: HTMLElement;
1672
+ three: THREE.WebGLRenderer;
1673
+ protected _canvas: HTMLCanvasElement;
1674
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1675
+ protected _resizeObserver: ResizeObserver | null;
1676
+ protected onContainerUpdated: Event<unknown>;
1677
+ private _resizing;
1678
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1679
+ /** {@link Updateable.update} */
1680
+ update(): void;
1681
+ /** {@link Disposable.dispose} */
1682
+ dispose(): void;
1683
+ /** {@link Resizeable.getSize}. */
1684
+ getSize(): THREE.Vector2;
1685
+ /** {@link Resizeable.resize} */
1686
+ resize: (size?: THREE.Vector2) => void;
1687
+ setupEvents(active: boolean): void;
1688
+ private resizeEvent;
1689
+ private setupRenderer;
1690
+ private onContextLost;
1691
+ private onContextBack;
1731
1692
  }
1732
- import { NavigationMode } from "./types";
1733
- import { OrthoPerspectiveCamera } from "../index";
1693
+ import * as THREE from "three";
1694
+ import CameraControls from "camera-controls";
1695
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1696
+ import { Components } from "../../Components";
1734
1697
  /**
1735
- * A {@link NavigationMode} that allows 3D navigation and panning
1736
- * like in many 3D and CAD softwares.
1698
+ * A basic camera that uses
1699
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1700
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1701
+ * what features it offers.
1737
1702
  */
1738
- export declare class OrbitMode implements NavigationMode {
1739
- camera: OrthoPerspectiveCamera;
1740
- /** {@link NavigationMode.enabled} */
1741
- enabled: boolean;
1742
- /** {@link NavigationMode.id} */
1743
- readonly id = "Orbit";
1744
- constructor(camera: OrthoPerspectiveCamera);
1745
- /** {@link NavigationMode.set} */
1746
- set(active: boolean): void;
1747
- private activateOrbitControls;
1703
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1704
+ /** {@link Updateable.onBeforeUpdate} */
1705
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1706
+ /** {@link Updateable.onAfterUpdate} */
1707
+ readonly onAfterUpdate: Event<SimpleCamera>;
1708
+ readonly onAspectUpdated: Event<unknown>;
1709
+ /** {@link Disposable.onDisposed} */
1710
+ readonly onDisposed: Event<string>;
1711
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1712
+ private _allControls;
1713
+ /**
1714
+ * The object that controls the camera. An instance of
1715
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1716
+ * Transforming the camera directly will have no effect: you need to use this
1717
+ * object to move, rotate, look at objects, etc.
1718
+ */
1719
+ get controls(): CameraControls;
1720
+ /** {@link Component.enabled} */
1721
+ get enabled(): boolean;
1722
+ /** {@link Component.enabled} */
1723
+ set enabled(enabled: boolean);
1724
+ constructor(components: Components);
1725
+ /** {@link Disposable.dispose} */
1726
+ dispose(): void;
1727
+ /** {@link Updateable.update} */
1728
+ update(_delta: number): void;
1729
+ /**
1730
+ * Updates the aspect of the camera to match the size of the
1731
+ * {@link Components.renderer}.
1732
+ */
1733
+ updateAspect: () => void;
1734
+ private setupCamera;
1735
+ private newCameraControls;
1736
+ private setupEvents;
1737
+ private static getSubsetOfThree;
1738
+ }
1739
+ import * as THREE from "three";
1740
+ import { BaseScene, Configurable, Event } from "../../Types";
1741
+ import { Components } from "../../Components";
1742
+ export interface SimpleSceneConfig {
1743
+ directionalLight: {
1744
+ color: THREE.Color;
1745
+ intensity: number;
1746
+ position: THREE.Vector3;
1747
+ };
1748
+ ambientLight: {
1749
+ color: THREE.Color;
1750
+ intensity: number;
1751
+ };
1748
1752
  }
1749
- import { NavigationMode } from "./types";
1750
- import { OrthoPerspectiveCamera } from "../index";
1751
1753
  /**
1752
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1753
- * like many BIM tools.
1754
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1755
+ * objects hierarchically, and easily dispose them when you are finished with it.
1756
+ * @noInheritDoc
1754
1757
  */
1755
- export declare class PlanMode implements NavigationMode {
1756
- private camera;
1757
- /** {@link NavigationMode.enabled} */
1758
- enabled: boolean;
1759
- /** {@link NavigationMode.id} */
1760
- readonly id = "Plan";
1761
- private mouseAction1?;
1762
- private mouseAction2?;
1763
- private mouseInitialized;
1764
- private readonly defaultAzimuthSpeed;
1765
- private readonly defaultPolarSpeed;
1766
- constructor(camera: OrthoPerspectiveCamera);
1767
- /** {@link NavigationMode.set} */
1768
- set(active: boolean): void;
1758
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1759
+ /** {@link Configurable.isSetup} */
1760
+ isSetup: boolean;
1761
+ three: THREE.Scene;
1762
+ /** {@link Configurable.onSetup} */
1763
+ readonly onSetup: Event<SimpleScene>;
1764
+ config: Required<SimpleSceneConfig>;
1765
+ constructor(components: Components);
1766
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1767
+ setup(config?: Partial<SimpleSceneConfig>): void;
1769
1768
  }
1770
1769
  import * as THREE from "three";
1771
1770
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -1828,6 +1827,61 @@ export declare class SimplePlane implements Disposable, Hideable {
1828
1827
  private newHelper;
1829
1828
  private static newPlaneMesh;
1830
1829
  }
1830
+ import { NavigationMode } from "./types";
1831
+ import { OrthoPerspectiveCamera } from "../index";
1832
+ /**
1833
+ * A {@link NavigationMode} that allows first person navigation,
1834
+ * simulating FPS video games.
1835
+ */
1836
+ export declare class FirstPersonMode implements NavigationMode {
1837
+ private camera;
1838
+ /** {@link NavigationMode.enabled} */
1839
+ enabled: boolean;
1840
+ /** {@link NavigationMode.id} */
1841
+ readonly id = "FirstPerson";
1842
+ constructor(camera: OrthoPerspectiveCamera);
1843
+ /** {@link NavigationMode.set} */
1844
+ set(active: boolean): void;
1845
+ private setupFirstPersonCamera;
1846
+ }
1847
+ import { NavigationMode } from "./types";
1848
+ import { OrthoPerspectiveCamera } from "../index";
1849
+ /**
1850
+ * A {@link NavigationMode} that allows 3D navigation and panning
1851
+ * like in many 3D and CAD softwares.
1852
+ */
1853
+ export declare class OrbitMode implements NavigationMode {
1854
+ camera: OrthoPerspectiveCamera;
1855
+ /** {@link NavigationMode.enabled} */
1856
+ enabled: boolean;
1857
+ /** {@link NavigationMode.id} */
1858
+ readonly id = "Orbit";
1859
+ constructor(camera: OrthoPerspectiveCamera);
1860
+ /** {@link NavigationMode.set} */
1861
+ set(active: boolean): void;
1862
+ private activateOrbitControls;
1863
+ }
1864
+ import { NavigationMode } from "./types";
1865
+ import { OrthoPerspectiveCamera } from "../index";
1866
+ /**
1867
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1868
+ * like many BIM tools.
1869
+ */
1870
+ export declare class PlanMode implements NavigationMode {
1871
+ private camera;
1872
+ /** {@link NavigationMode.enabled} */
1873
+ enabled: boolean;
1874
+ /** {@link NavigationMode.id} */
1875
+ readonly id = "Plan";
1876
+ private mouseAction1?;
1877
+ private mouseAction2?;
1878
+ private mouseInitialized;
1879
+ private readonly defaultAzimuthSpeed;
1880
+ private readonly defaultPolarSpeed;
1881
+ constructor(camera: OrthoPerspectiveCamera);
1882
+ /** {@link NavigationMode.set} */
1883
+ set(active: boolean): void;
1884
+ }
1831
1885
  import * as THREE from "three";
1832
1886
  import { CameraProjection } from "./types";
1833
1887
  import { Event } from "../../Types";
@@ -1892,68 +1946,6 @@ export interface NavigationMode {
1892
1946
  /** Whether this navigation mode is active or not. */
1893
1947
  enabled: boolean;
1894
1948
  }
1895
- import * as WEBIFC from "web-ifc";
1896
- import * as THREE from "three";
1897
- export declare class Units {
1898
- factor: number;
1899
- complement: number;
1900
- apply(matrix: THREE.Matrix4): void;
1901
- setUp(webIfc: WEBIFC.IfcAPI): void;
1902
- private getLengthUnits;
1903
- private getScaleMatrix;
1904
- }
1905
- import { IfcFragmentSettings } from "../../IfcLoader/src";
1906
- /** Configuration of the IFC-fragment streaming. */
1907
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1908
- minGeometrySize: number;
1909
- minAssetsSize: number;
1910
- }
1911
- /** Configuration of the IFC-fragment streaming. */
1912
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1913
- propertiesSize: number;
1914
- }
1915
- export interface StreamedGeometries {
1916
- [id: number]: {
1917
- boundingBox: Float32Array;
1918
- hasHoles: boolean;
1919
- geometryFile?: string;
1920
- };
1921
- }
1922
- export interface StreamedAsset {
1923
- id: number;
1924
- geometries: {
1925
- geometryID: number;
1926
- transformation: number[];
1927
- color: number[];
1928
- }[];
1929
- }
1930
- import * as WEBIFC from "web-ifc";
1931
- import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1932
- import { PropertiesStreamingSettings } from "./streaming-settings";
1933
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1934
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1935
- onPropertiesStreamed: AsyncEvent<{
1936
- type: number;
1937
- data: {
1938
- [id: number]: any;
1939
- };
1940
- }>;
1941
- onProgress: AsyncEvent<number>;
1942
- onIndicesStreamed: AsyncEvent<number[][]>;
1943
- /** {@link Disposable.onDisposed} */
1944
- readonly onDisposed: Event<string>;
1945
- enabled: boolean;
1946
- settings: PropertiesStreamingSettings;
1947
- webIfc: WEBIFC.IfcAPI;
1948
- dispose(): Promise<void>;
1949
- streamFromBuffer(data: Uint8Array): Promise<void>;
1950
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1951
- private readIfcFile;
1952
- private streamIfcFile;
1953
- private streamAllProperties;
1954
- private getIndices;
1955
- private cleanUp;
1956
- }
1957
1949
  export type RelationsMap = Map<number, Map<number, number[]>>;
1958
1950
  export interface ModelsRelationMap {
1959
1951
  [modelID: string]: RelationsMap;
@@ -1978,6 +1970,16 @@ export type InverseAttributes = [
1978
1970
  "ContainsElements"
1979
1971
  ];
1980
1972
  export type InverseAttribute = InverseAttributes[number];
1973
+ import * as WEBIFC from "web-ifc";
1974
+ import * as THREE from "three";
1975
+ export declare class Units {
1976
+ factor: number;
1977
+ complement: number;
1978
+ apply(matrix: THREE.Matrix4): void;
1979
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1980
+ private getLengthUnits;
1981
+ private getScaleMatrix;
1982
+ }
1981
1983
  import { BufferGeometry } from "three";
1982
1984
  import * as THREE from "three";
1983
1985
  export declare class TransformHelper {