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

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,45 +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";
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
- }
15
- import { Component, Disposable, World, Event } from "../Types";
16
- import { GridConfig, SimpleGrid } from "./src";
17
- export declare class Grids extends Component implements Disposable {
18
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
19
- list: Map<string, SimpleGrid>;
20
- onDisposed: Event<unknown>;
21
- config: Required<GridConfig>;
22
- /** {@link Component.enabled} */
23
- enabled: boolean;
24
- create(world: World): void;
25
- delete(world: World): void;
26
- dispose(): void;
27
- }
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>;
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. */
37
17
  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;
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
+ */
41
50
  dispose(): void;
42
- update(delta?: number): void | Promise<void>;
51
+ private update;
52
+ private static setupBVH;
43
53
  }
44
54
  import * as THREE from "three";
45
55
  import { Components } from "../Components";
@@ -84,26 +94,46 @@ export declare class Disposer extends Component {
84
94
  private disposeChildren;
85
95
  private static disposeMaterial;
86
96
  }
97
+ import { Component, Disposable, World, Event } from "../Types";
98
+ import { SimpleRaycaster } from "./src";
87
99
  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} */
100
+ export declare class Raycasters extends Component implements Disposable {
101
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
102
+ enabled: boolean;
103
+ list: Map<string, SimpleRaycaster>;
104
+ onDisposed: Event<unknown>;
105
+ constructor(components: Components);
106
+ get(world: World): SimpleRaycaster;
107
+ delete(world: World): void;
108
+ dispose(): void;
109
+ }
110
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
111
+ import { Components } from "../Components";
112
+ import { SimpleWorld } from "./src";
113
+ export declare class Worlds extends Component implements Updateable, Disposable {
114
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
115
+ readonly onAfterUpdate: Event<unknown>;
116
+ readonly onBeforeUpdate: Event<unknown>;
99
117
  readonly onDisposed: Event<unknown>;
100
- /** {@link Component.enabled} */
101
- get enabled(): boolean;
102
- set enabled(value: boolean);
118
+ list: Map<string, World>;
119
+ enabled: boolean;
103
120
  constructor(components: Components);
104
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
121
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
122
+ delete(world: World): void;
123
+ dispose(): void;
124
+ update(delta?: number): void | Promise<void>;
125
+ }
126
+ import { Component, Disposable, World, Event } from "../Types";
127
+ import { GridConfig, SimpleGrid } from "./src";
128
+ export declare class Grids extends Component implements Disposable {
129
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
130
+ list: Map<string, SimpleGrid>;
131
+ onDisposed: Event<unknown>;
132
+ config: Required<GridConfig>;
133
+ /** {@link Component.enabled} */
134
+ enabled: boolean;
135
+ create(world: World): void;
105
136
  delete(world: World): void;
106
- /** {@link Disposable.dispose} */
107
137
  dispose(): void;
108
138
  }
109
139
  import * as THREE from "three";
@@ -147,7 +177,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
147
177
  * has to be 'true' for this to apply.
148
178
  */
149
179
  toleranceOrthogonalY: number;
150
- list: T[];
180
+ planes: T[];
151
181
  protected PlaneType: new (...args: any) => SimplePlane | T;
152
182
  /** The material used in all the clipping planes. */
153
183
  protected _material: THREE.Material;
@@ -209,58 +239,6 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
209
239
  private _onStartDragging;
210
240
  private _onEndDragging;
211
241
  }
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
242
  import * as THREE from "three";
265
243
  import { Component, Disposable, Event, World } from "../Types";
266
244
  import { Components } from "../Components";
@@ -322,59 +300,147 @@ export declare class Materials extends Component implements Disposable {
322
300
  */
323
301
  removeMeshes(id: string, meshes: THREE.Mesh[]): void;
324
302
  }
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";
303
+ import { Components } from "../Components";
304
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
305
+ import { Component, Event, Disposable, World } from "../Types";
329
306
  /**
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.
307
+ * A tool to handle big scenes efficiently by automatically hiding the objects
308
+ * that are not visible to the camera.
332
309
  */
333
- export declare class FragmentBoundingBox extends Component implements Disposable {
334
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
335
- /** {@link Component.enabled} */
336
- enabled: boolean;
310
+ export declare class Cullers extends Component implements Disposable {
311
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
312
+ private _enabled;
313
+ list: Map<string, MeshCullerRenderer>;
337
314
  /** {@link Disposable.onDisposed} */
338
315
  readonly onDisposed: Event<unknown>;
339
- private _absoluteMin;
340
- private _absoluteMax;
341
- private _meshes;
316
+ /** {@link Component.enabled} */
317
+ get enabled(): boolean;
318
+ set enabled(value: boolean);
342
319
  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;
320
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
321
+ delete(world: World): void;
351
322
  /** {@link Disposable.dispose} */
352
323
  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
324
  }
361
- export declare class UUID {
362
- private static _pattern;
363
- private static _lut;
364
- static create(): string;
365
- static validate(uuid: string): void;
325
+ import * as WEBIFC from "web-ifc";
326
+ import * as FRAG from "bim-fragment";
327
+ /**
328
+ * Object to export all the properties from an IFC to a JS object.
329
+ */
330
+ export declare class IfcJsonExporter {
331
+ /**
332
+ * Exports all the properties of an IFC into an array of JS objects.
333
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
334
+ * @param modelID ID of the IFC model whose properties to extract.
335
+ * @param indirect whether to get the indirect relationships as well.
336
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
337
+ * to make the location data available (e.g. absolute position of building).
338
+ */
339
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
340
+ }
341
+ import { FragmentsGroup } from "bim-fragment";
342
+ import { Disposable, Event, Component, Components } from "../../core";
343
+ import { IfcPropertiesManager } from "../IfcPropertiesManager";
344
+ interface IndexMap {
345
+ [modelID: string]: {
346
+ [expressID: string]: Set<number>;
347
+ };
348
+ }
349
+ export declare class IfcPropertiesIndexer extends Component implements Disposable {
350
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
351
+ /** {@link Disposable.onDisposed} */
352
+ readonly onDisposed: Event<string>;
353
+ enabled: boolean;
354
+ relationsToProcess: number[];
355
+ indexMap: IndexMap;
356
+ private _propertiesManager;
357
+ readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
358
+ set propertiesManager(manager: IfcPropertiesManager | null);
359
+ get propertiesManager(): IfcPropertiesManager | null;
360
+ constructor(components: Components);
361
+ private onFragmentsDisposed;
362
+ dispose(): Promise<void>;
363
+ getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
364
+ private getNestedPsets;
365
+ private getPsetProperties;
366
+ process(model: FragmentsGroup): Promise<void>;
367
+ private setEntityIndex;
368
+ private cloneProperty;
369
+ private clonePropertyArray;
370
+ }
371
+ export {};
372
+ import * as FRAGS from "bim-fragment";
373
+ import { FragmentsGroup } from "bim-fragment";
374
+ import { Disposable, Event, Component, Components } from "../../core";
375
+ import { QueryGroup } from "./src/types";
376
+ export interface QueryResult {
377
+ [modelID: string]: {
378
+ modelEntities: Set<number>;
379
+ otherEntities: Set<number>;
380
+ };
381
+ }
382
+ export interface IndexedModels {
383
+ [modelID: string]: {
384
+ [expressID: number]: Set<number>;
385
+ };
386
+ }
387
+ export declare class IfcPropertiesFinder extends Component implements Disposable {
388
+ readonly onFound: Event<FRAGS.FragmentIdMap>;
389
+ /** {@link Disposable.onDisposed} */
390
+ readonly onDisposed: Event<unknown>;
391
+ enabled: boolean;
392
+ indexedModels: IndexedModels;
393
+ private readonly _conditionFunctions;
394
+ private _noHandleAttributes;
395
+ constructor(components: Components);
396
+ private onFragmentsDisposed;
397
+ dispose(): void;
398
+ private indexEntityRelations;
399
+ find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
400
+ private toFragmentMap;
401
+ private simpleQuery;
402
+ private getMatchingEntities;
403
+ private combineArrays;
404
+ private getCommonElements;
405
+ private arrayIntersection;
406
+ private arrayUnion;
407
+ private getConditionFunctions;
366
408
  }
367
409
  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;
410
+ import * as FRAGS from "bim-fragment";
411
+ import { FragmentsGroup } from "bim-fragment";
412
+ import { Component, Components, Disposable, Event } from "../../core";
413
+ /**
414
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
415
+ * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
416
+ */
417
+ export declare class FragmentBoundingBox extends Component implements Disposable {
418
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
419
+ /** {@link Component.enabled} */
420
+ enabled: boolean;
421
+ /** {@link Disposable.onDisposed} */
422
+ readonly onDisposed: Event<unknown>;
423
+ private _absoluteMin;
424
+ private _absoluteMax;
425
+ private _meshes;
426
+ constructor(components: Components);
427
+ static getDimensions(bbox: THREE.Box3): {
428
+ width: number;
429
+ height: number;
430
+ depth: number;
431
+ center: THREE.Vector3;
432
+ };
433
+ static newBound(positive: boolean): THREE.Vector3;
434
+ static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
435
+ /** {@link Disposable.dispose} */
436
+ dispose(): void;
437
+ get(): THREE.Box3;
438
+ getSphere(): THREE.Sphere;
439
+ getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
440
+ reset(): void;
441
+ add(group: FragmentsGroup): void;
442
+ addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
443
+ private static getFragmentBounds;
378
444
  }
379
445
  import * as FRAGS from "bim-fragment";
380
446
  import { Disposable, Component, Event, Components } from "../../core";
@@ -406,6 +472,79 @@ export declare class FragmentClassifier extends Component implements Disposable
406
472
  byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
407
473
  private saveItem;
408
474
  }
475
+ import * as WEBIFC from "web-ifc";
476
+ import { FragmentsGroup } from "bim-fragment";
477
+ import { Component, Disposable, Event, Components } from "../../core";
478
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
479
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
480
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
481
+ interface ChangeMap {
482
+ [modelID: string]: Set<number>;
483
+ }
484
+ interface AttributeListener {
485
+ [modelID: string]: {
486
+ [expressID: number]: {
487
+ [attributeName: string]: Event<String | Boolean | Number>;
488
+ };
489
+ };
490
+ }
491
+ export declare class IfcPropertiesManager extends Component implements Disposable {
492
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
493
+ /** {@link Disposable.onDisposed} */
494
+ readonly onDisposed: Event<string>;
495
+ readonly onRequestFile: Event<unknown>;
496
+ ifcToExport: ArrayBuffer | null;
497
+ readonly onElementToPset: Event<{
498
+ model: FragmentsGroup;
499
+ psetID: number;
500
+ elementID: number;
501
+ }>;
502
+ readonly onPropToPset: Event<{
503
+ model: FragmentsGroup;
504
+ psetID: number;
505
+ propID: number;
506
+ }>;
507
+ readonly onPsetRemoved: Event<{
508
+ model: FragmentsGroup;
509
+ psetID: number;
510
+ }>;
511
+ readonly onDataChanged: Event<{
512
+ model: FragmentsGroup;
513
+ expressID: number;
514
+ }>;
515
+ wasm: {
516
+ path: string;
517
+ absolute: boolean;
518
+ };
519
+ enabled: boolean;
520
+ attributeListeners: AttributeListener;
521
+ selectedModel?: FragmentsGroup;
522
+ private _changeMap;
523
+ constructor(components: Components);
524
+ get(): ChangeMap;
525
+ dispose(): void;
526
+ private increaseMaxID;
527
+ static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
528
+ private newGUID;
529
+ private getOwnerHistory;
530
+ private registerChange;
531
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
532
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
533
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
534
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
535
+ }>;
536
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
537
+ private newSingleProperty;
538
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
539
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
540
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
541
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
542
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
543
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
544
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
545
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
546
+ }
547
+ export {};
409
548
  import { Fragment, FragmentsGroup } from "bim-fragment";
410
549
  import * as THREE from "three";
411
550
  import { Component, Components, Event, Disposable } from "../../core";
@@ -456,7 +595,6 @@ import { IfcFragmentSettings } from "./src";
456
595
  import { Component, Components, Event, Disposable } from "../../core";
457
596
  export declare class FragmentIfcLoader extends Component implements Disposable {
458
597
  static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
459
- readonly onIfcLoaded: Event<FRAGS.FragmentsGroup>;
460
598
  readonly onIfcStartedLoading: Event<void>;
461
599
  readonly onSetup: Event<void>;
462
600
  /** {@link Disposable.onDisposed} */
@@ -483,201 +621,548 @@ export declare class FragmentIfcLoader extends Component implements Disposable {
483
621
  private getGeometry;
484
622
  private autoSetWasm;
485
623
  }
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
- };
493
- }
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>;
498
- 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;
505
- 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;
624
+ import * as THREE from "three";
625
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
626
+ center: THREE.Vector3;
627
+ halfSizes: THREE.Vector3;
628
+ rotation: THREE.Matrix3;
629
+ transformation: THREE.Matrix4;
630
+ };
631
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
632
+ import * as THREE from "three";
633
+ export declare class MaterialsUtils {
634
+ static isTransparent(material: THREE.Material): boolean;
515
635
  }
516
- export {};
517
- import * as WEBIFC from "web-ifc";
518
- import * as FRAG from "bim-fragment";
519
- /**
520
- * Object to export all the properties from an IFC to a JS object.
521
- */
522
- export declare class IfcJsonExporter {
523
- /**
524
- * Exports all the properties of an IFC into an array of JS objects.
525
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
526
- * @param modelID ID of the IFC model whose properties to extract.
527
- * @param indirect whether to get the indirect relationships as well.
528
- * @param recursiveSpatial whether to get the properties of spatial items recursively
529
- * to make the location data available (e.g. absolute position of building).
530
- */
531
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
636
+ export declare class UUID {
637
+ private static _pattern;
638
+ private static _lut;
639
+ static create(): string;
640
+ static validate(uuid: string): void;
532
641
  }
642
+ export declare const IfcElements: {
643
+ [key: number]: string;
644
+ };
533
645
  import * as WEBIFC from "web-ifc";
534
- import { FragmentsGroup } from "bim-fragment";
535
- import { Component, Disposable, Event, Components } from "../../core";
536
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
537
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
538
- type NumericPropTypes = "IfcInteger" | "IfcReal";
539
- interface ChangeMap {
540
- [modelID: string]: Set<number>;
646
+ export interface IfcItemsCategories {
647
+ [itemID: number]: number;
541
648
  }
542
- interface AttributeListener {
543
- [modelID: string]: {
544
- [expressID: number]: {
545
- [attributeName: string]: Event<String | Boolean | Number>;
546
- };
547
- };
649
+ export declare class IfcCategories {
650
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
548
651
  }
549
- export declare class IfcPropertiesManager extends Component implements Disposable {
550
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
652
+ export declare const IfcCategoryMap: {
653
+ [key: number]: string;
654
+ };
655
+ import * as FRAGS from "bim-fragment";
656
+ export declare class IfcPropertiesUtils {
657
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
658
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
659
+ [attribute: string]: any;
660
+ } | null>;
661
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
662
+ [relatingID: number]: number[];
663
+ }>;
664
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
665
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
666
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
667
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
668
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
669
+ key: string | null;
670
+ name: string | null;
671
+ }>;
672
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
673
+ key: string | null;
674
+ value: number | null;
675
+ }>;
676
+ static isRel(expressID: number): boolean;
677
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
678
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
679
+ }
680
+ import * as THREE from "three";
681
+ import { Disposable, Event } from "../../Types";
682
+ /**
683
+ * A helper to easily get the real position of the mouse in the Three.js canvas
684
+ * to work with tools like the
685
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
686
+ * been transformed through CSS or doesn't occupy the whole screen.
687
+ */
688
+ export declare class Mouse implements Disposable {
689
+ dom: HTMLCanvasElement;
690
+ private _event?;
691
+ private _position;
692
+ /** {@link Disposable.onDisposed} */
693
+ readonly onDisposed: Event<unknown>;
694
+ constructor(dom: HTMLCanvasElement);
695
+ /**
696
+ * The real position of the mouse of the Three.js canvas.
697
+ */
698
+ get position(): THREE.Vector2;
699
+ /** {@link Disposable.dispose} */
700
+ dispose(): void;
701
+ private getPositionY;
702
+ private getPositionX;
703
+ private updateMouseInfo;
704
+ private setupEvents;
705
+ }
706
+ import * as THREE from "three";
707
+ import { Components } from "../../Components";
708
+ import { Event, World, Disposable } from "../../Types";
709
+ import { Mouse } from "./mouse";
710
+ /**
711
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
712
+ * that allows to easily get items from the scene using the mouse and touch
713
+ * events.
714
+ */
715
+ export declare class SimpleRaycaster implements Disposable {
716
+ /** {@link Component.enabled} */
717
+ enabled: boolean;
718
+ components: Components;
719
+ /** {@link Disposable.onDisposed} */
720
+ readonly onDisposed: Event<unknown>;
721
+ /** The position of the mouse in the screen. */
722
+ readonly mouse: Mouse;
723
+ readonly three: THREE.Raycaster;
724
+ world: World;
725
+ constructor(components: Components, world: World);
726
+ /** {@link Disposable.dispose} */
727
+ dispose(): void;
728
+ /**
729
+ * Throws a ray from the camera to the mouse or touch event point and returns
730
+ * the first item found. This also takes into account the clipping planes
731
+ * used by the renderer.
732
+ *
733
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
734
+ * to query. If not provided, it will query all the meshes stored in
735
+ * {@link Components.meshes}.
736
+ */
737
+ castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
738
+ 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;
739
+ private intersect;
740
+ private filterClippingPlanes;
741
+ }
742
+ export declare const GeometryTypes: Set<number>;
743
+ import * as WEBIFC from "web-ifc";
744
+ import { IfcItemsCategories } from "../../../ifc";
745
+ export declare class SpatialStructure {
746
+ itemsByFloor: IfcItemsCategories;
747
+ private _units;
748
+ setUp(webIfc: WEBIFC.IfcAPI): void;
749
+ cleanUp(): void;
750
+ }
751
+ import * as THREE from "three";
752
+ import { Hideable, Disposable, Event, World } from "../../Types";
753
+ import { Components } from "../../Components";
754
+ /**
755
+ * Each of the planes created by {@link SimpleClipper}.
756
+ */
757
+ export declare class SimplePlane implements Disposable, Hideable {
758
+ /** Event that fires when the user starts dragging a clipping plane. */
759
+ readonly onDraggingStarted: Event<unknown>;
760
+ /** Event that fires when the user stops dragging a clipping plane. */
761
+ readonly onDraggingEnded: Event<unknown>;
762
+ /** {@link Disposable.onDisposed} */
763
+ readonly onDisposed: Event<unknown>;
764
+ readonly normal: THREE.Vector3;
765
+ readonly origin: THREE.Vector3;
766
+ readonly three: THREE.Plane;
767
+ protected readonly _helper: THREE.Object3D;
768
+ protected _visible: boolean;
769
+ protected _enabled: boolean;
770
+ components: Components;
771
+ world: World;
772
+ private _controlsActive;
773
+ private readonly _arrowBoundBox;
774
+ private readonly _planeMesh;
775
+ private readonly _controls;
776
+ private readonly _hiddenMaterial;
777
+ get enabled(): boolean;
778
+ /** {@link Component.enabled} */
779
+ set enabled(state: boolean);
780
+ /** {@link Hideable.visible } */
781
+ get visible(): boolean;
782
+ /** {@link Hideable.visible } */
783
+ set visible(state: boolean);
784
+ /** The meshes used for raycasting */
785
+ get meshes(): THREE.Mesh[];
786
+ /** The material of the clipping plane representation. */
787
+ get planeMaterial(): THREE.Material | THREE.Material[];
788
+ /** The material of the clipping plane representation. */
789
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
790
+ /** The size of the clipping plane representation. */
791
+ get size(): number;
792
+ /** Sets the size of the clipping plane representation. */
793
+ set size(size: number);
794
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
795
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
796
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
797
+ /** {@link Updateable.update} */
798
+ update: () => Promise<void>;
799
+ /** {@link Disposable.dispose} */
800
+ dispose(): void;
801
+ private reset;
802
+ protected toggleControls(state: boolean): void;
803
+ private newTransformControls;
804
+ private initializeControls;
805
+ private createArrowBoundingBox;
806
+ private changeDrag;
807
+ private notifyDraggingChanged;
808
+ private preventCameraMovement;
809
+ private newHelper;
810
+ private static newPlaneMesh;
811
+ }
812
+ import * as THREE from "three";
813
+ import { Components } from "../../Components";
814
+ import { Event, World } from "../../Types";
815
+ export interface CullerRendererSettings {
816
+ updateInterval?: number;
817
+ width?: number;
818
+ height?: number;
819
+ autoUpdate?: boolean;
820
+ }
821
+ /**
822
+ * A base renderer to determine visibility on screen
823
+ */
824
+ export declare class CullerRenderer {
551
825
  /** {@link Disposable.onDisposed} */
552
826
  readonly onDisposed: Event<string>;
553
- readonly onRequestFile: Event<unknown>;
554
- ifcToExport: ArrayBuffer | null;
555
- readonly onElementToPset: Event<{
556
- model: FragmentsGroup;
557
- psetID: number;
558
- elementID: number;
559
- }>;
560
- readonly onPropToPset: Event<{
561
- model: FragmentsGroup;
562
- psetID: number;
563
- propID: number;
827
+ /**
828
+ * Fires after making the visibility check to the meshes. It lists the
829
+ * meshes that are currently visible, and the ones that were visible
830
+ * just before but not anymore.
831
+ */
832
+ readonly onViewUpdated: Event<any>;
833
+ /** {@link Component.enabled} */
834
+ enabled: boolean;
835
+ /**
836
+ * Needs to check whether there are objects that need to be hidden or shown.
837
+ * You can bind this to the camera movement, to a certain interval, etc.
838
+ */
839
+ needsUpdate: boolean;
840
+ /**
841
+ * Render the internal scene used to determine the object visibility. Used
842
+ * for debugging purposes.
843
+ */
844
+ renderDebugFrame: boolean;
845
+ components: Components;
846
+ readonly world: World;
847
+ readonly renderer: THREE.WebGLRenderer;
848
+ protected autoUpdate: boolean;
849
+ protected updateInterval: number;
850
+ protected readonly worker: Worker;
851
+ protected readonly scene: THREE.Scene;
852
+ private _width;
853
+ private _height;
854
+ private _availableColor;
855
+ private readonly renderTarget;
856
+ private readonly bufferSize;
857
+ private readonly _buffer;
858
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
859
+ /** {@link Disposable.dispose} */
860
+ dispose(): void;
861
+ /**
862
+ * The function that the culler uses to reprocess the scene. Generally it's
863
+ * better to call needsUpdate, but you can also call this to force it.
864
+ * @param force if true, it will refresh the scene even if needsUpdate is
865
+ * not true.
866
+ */
867
+ updateVisibility: (force?: boolean) => Promise<void>;
868
+ protected getAvailableColor(): {
869
+ r: number;
870
+ g: number;
871
+ b: number;
872
+ code: string;
873
+ };
874
+ protected increaseColor(): void;
875
+ protected decreaseColor(): void;
876
+ private applySettings;
877
+ }
878
+ import * as THREE from "three";
879
+ import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
880
+ import { Components } from "../../Components";
881
+ import { Event, World } from "../../Types";
882
+ /**
883
+ * A renderer to determine a mesh visibility on screen
884
+ */
885
+ export declare class MeshCullerRenderer extends CullerRenderer {
886
+ threshold: number;
887
+ readonly onViewUpdated: Event<{
888
+ seen: Set<THREE.Mesh>;
889
+ unseen: Set<THREE.Mesh>;
564
890
  }>;
565
- readonly onPsetRemoved: Event<{
566
- model: FragmentsGroup;
567
- psetID: number;
891
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
892
+ isProcessing: boolean;
893
+ private _colorCodeMeshMap;
894
+ private _meshIDColorCodeMap;
895
+ private _currentVisibleMeshes;
896
+ private _recentlyHiddenMeshes;
897
+ private readonly _transparentMat;
898
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
899
+ dispose(): void;
900
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
901
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
902
+ private handleWorkerMessage;
903
+ private getAvailableMaterial;
904
+ }
905
+ import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
906
+ /** Configuration of the IFC-fragment streaming. */
907
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
908
+ minGeometrySize: number;
909
+ minAssetsSize: number;
910
+ }
911
+ /** Configuration of the IFC-fragment streaming. */
912
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
913
+ propertiesSize: number;
914
+ }
915
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
916
+ import * as WEBIFC from "web-ifc";
917
+ import { Component, Disposable, Event } from "../../../core";
918
+ import { PropertiesStreamingSettings } from "./streaming-settings";
919
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
920
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
921
+ onPropertiesStreamed: Event<{
922
+ type: number;
923
+ data: {
924
+ [id: number]: any;
925
+ };
568
926
  }>;
569
- readonly onDataChanged: Event<{
570
- model: FragmentsGroup;
571
- expressID: number;
927
+ onProgress: Event<number>;
928
+ onIndicesStreamed: Event<number[][]>;
929
+ /** {@link Disposable.onDisposed} */
930
+ readonly onDisposed: Event<string>;
931
+ enabled: boolean;
932
+ settings: PropertiesStreamingSettings;
933
+ webIfc: WEBIFC.IfcAPI;
934
+ dispose(): Promise<void>;
935
+ streamFromBuffer(data: Uint8Array): Promise<void>;
936
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
937
+ private readIfcFile;
938
+ private streamIfcFile;
939
+ private streamAllProperties;
940
+ private getIndices;
941
+ private cleanUp;
942
+ }
943
+ import * as WEBIFC from "web-ifc";
944
+ import { Components, Disposable, Event, Component } from "../../../core";
945
+ import { IfcStreamingSettings } from "./streaming-settings";
946
+ import { StreamedGeometries, StreamedAsset } from "./base-types";
947
+ export declare class FragmentIfcStreamConverter extends Component implements Disposable {
948
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
949
+ onGeometryStreamed: Event<{
950
+ buffer: Uint8Array;
951
+ data: StreamedGeometries;
572
952
  }>;
573
- wasm: {
574
- path: string;
575
- absolute: boolean;
576
- };
953
+ onAssetStreamed: Event<StreamedAsset[]>;
954
+ onProgress: Event<number>;
955
+ onIfcLoaded: Event<Uint8Array>;
956
+ /** {@link Disposable.onDisposed} */
957
+ readonly onDisposed: Event<unknown>;
958
+ settings: IfcStreamingSettings;
577
959
  enabled: boolean;
578
- attributeListeners: AttributeListener;
579
- selectedModel?: FragmentsGroup;
580
- private _changeMap;
960
+ webIfc: WEBIFC.IfcAPI;
961
+ private _spatialTree;
962
+ private _metaData;
963
+ private _visitedGeometries;
964
+ private _streamSerializer;
965
+ private _geometries;
966
+ private _geometryCount;
967
+ private _civil;
968
+ private _groupSerializer;
969
+ private _assets;
970
+ private _meshesWithHoles;
581
971
  constructor(components: Components);
582
- get(): ChangeMap;
583
972
  dispose(): void;
584
- private increaseMaxID;
585
- static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
586
- private newGUID;
587
- private getOwnerHistory;
588
- private registerChange;
589
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
590
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
591
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
592
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
593
- }>;
594
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
595
- private newSingleProperty;
596
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
597
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
598
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
599
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
600
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
601
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
602
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
603
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
973
+ streamFromBuffer(data: Uint8Array): Promise<void>;
974
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
975
+ private readIfcFile;
976
+ private streamIfcFile;
977
+ private streamAllGeometries;
978
+ private cleanUp;
979
+ private getMesh;
980
+ private getGeometry;
981
+ private streamAssets;
982
+ private streamGeometries;
604
983
  }
605
- 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>;
984
+ export interface StreamedGeometries {
985
+ [id: number]: {
986
+ boundingBox: Float32Array;
987
+ hasHoles: boolean;
988
+ geometryFile?: string;
989
+ };
990
+ }
991
+ export interface StreamedAsset {
992
+ id: number;
993
+ geometries: {
994
+ geometryID: number;
995
+ transformation: number[];
996
+ color: number[];
997
+ }[];
998
+ }
999
+ import * as THREE from "three";
1000
+ import { BaseRenderer, Event } from "../../Types";
1001
+ import { Components } from "../../Components";
1002
+ /**
1003
+ * A basic renderer capable of rendering
1004
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1005
+ */
1006
+ export declare class SimpleRenderer extends BaseRenderer {
1007
+ /** {@link Component.enabled} */
1008
+ enabled: boolean;
1009
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1010
+ container: HTMLElement | null;
1011
+ three: THREE.WebGLRenderer;
1012
+ protected _canvas: HTMLCanvasElement;
1013
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1014
+ protected onContainerUpdated: Event<HTMLElement>;
1015
+ constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1016
+ /** {@link Updateable.update} */
1017
+ update(): void;
1018
+ /** {@link Disposable.dispose} */
1019
+ dispose(): void;
1020
+ /** {@link Resizeable.getSize}. */
1021
+ getSize(): THREE.Vector2;
1022
+ /** {@link Resizeable.resize} */
1023
+ resize: (size?: THREE.Vector2) => void;
1024
+ setupEvents(active: boolean): void;
1025
+ private resizeEvent;
1026
+ private setupRenderer;
1027
+ private onContextLost;
1028
+ private onContextBack;
1029
+ private updateContainer;
1030
+ }
1031
+ import * as THREE from "three";
1032
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1033
+ import { Components } from "../../Components";
1034
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1035
+ /**
1036
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1037
+ */
1038
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1039
+ readonly onAfterUpdate: Event<unknown>;
1040
+ readonly onBeforeUpdate: Event<unknown>;
1041
+ enabled: boolean;
1042
+ uuid: string;
1043
+ readonly onDisposed: Event<unknown>;
1044
+ private _scene?;
1045
+ private _camera?;
1046
+ private _renderer;
1047
+ get scene(): T;
1048
+ set scene(scene: T);
1049
+ get camera(): U;
1050
+ set camera(camera: U);
1051
+ get renderer(): S | null;
1052
+ set renderer(renderer: S | null);
1053
+ constructor(components: Components);
1054
+ update(delta?: number): void;
1055
+ dispose(disposeResources?: boolean): void;
1056
+ }
1057
+ import * as THREE from "three";
1058
+ import { BaseScene, Configurable, Event } from "../../Types";
1059
+ import { Components } from "../../Components";
1060
+ export interface SimpleSceneConfig {
1061
+ directionalLight: {
1062
+ color: THREE.Color;
1063
+ intensity: number;
1064
+ position: THREE.Vector3;
614
1065
  };
615
- }
616
- export interface IndexedModels {
617
- [modelID: string]: {
618
- [expressID: number]: Set<number>;
1066
+ ambientLight: {
1067
+ color: THREE.Color;
1068
+ intensity: number;
619
1069
  };
620
1070
  }
621
- export declare class IfcPropertiesFinder extends Component implements Disposable {
622
- readonly onFound: Event<FRAGS.FragmentIdMap>;
1071
+ /**
1072
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1073
+ * objects hierarchically, and easily dispose them when you are finished with it.
1074
+ * @noInheritDoc
1075
+ */
1076
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1077
+ /** {@link Configurable.isSetup} */
1078
+ isSetup: boolean;
1079
+ three: THREE.Scene;
1080
+ /** {@link Configurable.onSetup} */
1081
+ readonly onSetup: Event<SimpleScene>;
1082
+ config: Required<SimpleSceneConfig>;
1083
+ constructor(components: Components);
1084
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1085
+ setup(config?: Partial<SimpleSceneConfig>): void;
1086
+ }
1087
+ import * as THREE from "three";
1088
+ import CameraControls from "camera-controls";
1089
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1090
+ import { Components } from "../../Components";
1091
+ /**
1092
+ * A basic camera that uses
1093
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1094
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1095
+ * what features it offers.
1096
+ */
1097
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1098
+ /** {@link Updateable.onBeforeUpdate} */
1099
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1100
+ /** {@link Updateable.onAfterUpdate} */
1101
+ readonly onAfterUpdate: Event<SimpleCamera>;
1102
+ readonly onAspectUpdated: Event<unknown>;
623
1103
  /** {@link Disposable.onDisposed} */
624
- readonly onDisposed: Event<unknown>;
625
- enabled: boolean;
626
- indexedModels: IndexedModels;
627
- private readonly _conditionFunctions;
628
- private _noHandleAttributes;
1104
+ readonly onDisposed: Event<string>;
1105
+ readonly three: THREE.PerspectiveCamera;
1106
+ private _allControls;
1107
+ /**
1108
+ * The object that controls the camera. An instance of
1109
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1110
+ * Transforming the camera directly will have no effect: you need to use this
1111
+ * object to move, rotate, look at objects, etc.
1112
+ */
1113
+ get controls(): CameraControls;
1114
+ /** {@link Component.enabled} */
1115
+ get enabled(): boolean;
1116
+ /** {@link Component.enabled} */
1117
+ set enabled(enabled: boolean);
629
1118
  constructor(components: Components);
630
- private onFragmentsDisposed;
1119
+ /** {@link Disposable.dispose} */
631
1120
  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
- }
675
- import * as WEBIFC from "web-ifc";
676
- export interface IfcItemsCategories {
677
- [itemID: number]: number;
1121
+ /** {@link Updateable.update} */
1122
+ update(_delta: number): void;
1123
+ /**
1124
+ * Updates the aspect of the camera to match the size of the
1125
+ * {@link Components.renderer}.
1126
+ */
1127
+ updateAspect: () => void;
1128
+ private setupCamera;
1129
+ private newCameraControls;
1130
+ private setupEvents;
1131
+ private static getSubsetOfThree;
678
1132
  }
679
- export declare class IfcCategories {
680
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
1133
+ /**
1134
+ * Simple event handler by
1135
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1136
+ * Keep in mind that:
1137
+ * - If you want to remove it later, you might want to declare the callback as
1138
+ * an object.
1139
+ * - If you want to maintain the reference to 'this', you will need to declare
1140
+ * the callback as an arrow function.
1141
+ */
1142
+ export declare class Event<T> {
1143
+ /**
1144
+ * Add a callback to this event instance.
1145
+ * @param handler - the callback to be added to this event.
1146
+ */
1147
+ add(handler: T extends void ? {
1148
+ (): void;
1149
+ } : {
1150
+ (data: T): void;
1151
+ }): void;
1152
+ /**
1153
+ * Removes a callback from this event instance.
1154
+ * @param handler - the callback to be removed from this event.
1155
+ */
1156
+ remove(handler: T extends void ? {
1157
+ (): void;
1158
+ } : {
1159
+ (data: T): void;
1160
+ }): void;
1161
+ /** Triggers all the callbacks assigned to this event. */
1162
+ trigger: (data?: T) => void;
1163
+ /** Gets rid of all the suscribed events. */
1164
+ reset(): void;
1165
+ private handlers;
681
1166
  }
682
1167
  import * as THREE from "three";
683
1168
  import CameraControls from "camera-controls";
@@ -832,48 +1317,6 @@ export declare abstract class Base {
832
1317
  /** Whether is component is {@link Configurable}. */
833
1318
  isConfigurable: () => this is Configurable<any>;
834
1319
  }
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;
842
- }
843
- /**
844
- * Simple event handler by
845
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
846
- * Keep in mind that:
847
- * - If you want to remove it later, you might want to declare the callback as
848
- * an object.
849
- * - If you want to maintain the reference to 'this', you will need to declare
850
- * the callback as an arrow function.
851
- */
852
- export declare class Event<T> {
853
- /**
854
- * Add a callback to this event instance.
855
- * @param handler - the callback to be added to this event.
856
- */
857
- add(handler: T extends void ? {
858
- (): void;
859
- } : {
860
- (data: T): void;
861
- }): void;
862
- /**
863
- * Removes a callback from this event instance.
864
- * @param handler - the callback to be removed from this event.
865
- */
866
- remove(handler: T extends void ? {
867
- (): void;
868
- } : {
869
- (data: T): void;
870
- }): void;
871
- /** Triggers all the callbacks assigned to this event. */
872
- trigger: (data?: T) => void;
873
- /** Gets rid of all the suscribed events. */
874
- reset(): void;
875
- private handlers;
876
- }
877
1320
  import { Base } from "./base";
878
1321
  /**
879
1322
  * Components are the building blocks of this library. Components are singleton
@@ -924,72 +1367,14 @@ import * as THREE from "three";
924
1367
  import { Disposable } from "./interfaces";
925
1368
  import { Event } from "./event";
926
1369
  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;
947
- }
948
- import * as THREE from "three";
949
- import CameraControls from "camera-controls";
950
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
951
- import { Components } from "../../Components";
952
- /**
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.
957
- */
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);
1370
+ import { BaseWorldItem } from "./base-world-item";
1371
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1372
+ /** {@link Disposable.onDisposed} */
1373
+ readonly onDisposed: Event<unknown>;
1374
+ abstract three: THREE.Object3D;
1375
+ protected constructor(components: Components);
980
1376
  /** {@link Disposable.dispose} */
981
1377
  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;
993
1378
  }
994
1379
  import * as THREE from "three";
995
1380
  import { Vector2 } from "three";
@@ -1031,239 +1416,17 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1031
1416
  */
1032
1417
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1033
1418
  }
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;
1039
- }
1040
- /** Configuration of the IFC-fragment streaming. */
1041
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1042
- propertiesSize: number;
1043
- }
1044
- import * as THREE from "three";
1045
- import { BaseScene, Configurable, Event } from "../../Types";
1046
- import { Components } from "../../Components";
1047
- export interface SimpleSceneConfig {
1048
- directionalLight: {
1049
- color: THREE.Color;
1050
- intensity: number;
1051
- position: THREE.Vector3;
1052
- };
1053
- ambientLight: {
1054
- color: THREE.Color;
1055
- intensity: number;
1056
- };
1057
- }
1058
- /**
1059
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1060
- * objects hierarchically, and easily dispose them when you are finished with it.
1061
- * @noInheritDoc
1062
- */
1063
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1064
- /** {@link Configurable.isSetup} */
1065
- isSetup: boolean;
1066
- three: THREE.Scene;
1067
- /** {@link Configurable.onSetup} */
1068
- readonly onSetup: Event<SimpleScene>;
1069
- config: Required<SimpleSceneConfig>;
1070
- constructor(components: Components);
1071
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1072
- setup(config?: Partial<SimpleSceneConfig>): void;
1073
- }
1074
- import * as THREE from "three";
1075
- import { BaseRenderer, Event } from "../../Types";
1076
- import { Components } from "../../Components";
1077
- /**
1078
- * A basic renderer capable of rendering
1079
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1080
- */
1081
- export declare class SimpleRenderer extends BaseRenderer {
1082
- /** {@link Component.enabled} */
1083
- enabled: boolean;
1084
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
1085
- container: HTMLElement | null;
1086
- three: THREE.WebGLRenderer;
1087
- protected _canvas: HTMLCanvasElement;
1088
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1089
- protected onContainerUpdated: Event<HTMLElement>;
1090
- constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1091
- /** {@link Updateable.update} */
1092
- update(): void;
1093
- /** {@link Disposable.dispose} */
1094
- dispose(): void;
1095
- /** {@link Resizeable.getSize}. */
1096
- getSize(): THREE.Vector2;
1097
- /** {@link Resizeable.resize} */
1098
- resize: (size?: THREE.Vector2) => void;
1099
- setupEvents(active: boolean): void;
1100
- private resizeEvent;
1101
- private setupRenderer;
1102
- private onContextLost;
1103
- private onContextBack;
1104
- private updateContainer;
1105
- }
1106
- import * as THREE from "three";
1107
- import { Components } from "../../Components";
1108
- import { Event, World } from "../../Types";
1109
- export interface CullerRendererSettings {
1110
- updateInterval?: number;
1111
- width?: number;
1112
- height?: number;
1113
- autoUpdate?: boolean;
1114
- }
1115
- /**
1116
- * A base renderer to determine visibility on screen
1117
- */
1118
- export declare class CullerRenderer {
1119
- /** {@link Disposable.onDisposed} */
1120
- readonly onDisposed: Event<string>;
1121
- /**
1122
- * Fires after making the visibility check to the meshes. It lists the
1123
- * meshes that are currently visible, and the ones that were visible
1124
- * just before but not anymore.
1125
- */
1126
- readonly onViewUpdated: Event<any>;
1127
- /** {@link Component.enabled} */
1128
- enabled: boolean;
1129
- /**
1130
- * Needs to check whether there are objects that need to be hidden or shown.
1131
- * You can bind this to the camera movement, to a certain interval, etc.
1132
- */
1133
- needsUpdate: boolean;
1134
- /**
1135
- * Render the internal scene used to determine the object visibility. Used
1136
- * for debugging purposes.
1137
- */
1138
- renderDebugFrame: boolean;
1139
- components: Components;
1140
- readonly world: World;
1141
- readonly renderer: THREE.WebGLRenderer;
1142
- protected autoUpdate: boolean;
1143
- protected updateInterval: number;
1144
- protected readonly worker: Worker;
1145
- protected readonly scene: THREE.Scene;
1146
- private _width;
1147
- private _height;
1148
- private _availableColor;
1149
- private readonly renderTarget;
1150
- private readonly bufferSize;
1151
- private readonly _buffer;
1152
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1153
- /** {@link Disposable.dispose} */
1154
- dispose(): void;
1155
- /**
1156
- * The function that the culler uses to reprocess the scene. Generally it's
1157
- * better to call needsUpdate, but you can also call this to force it.
1158
- * @param force if true, it will refresh the scene even if needsUpdate is
1159
- * not true.
1160
- */
1161
- updateVisibility: (force?: boolean) => Promise<void>;
1162
- protected getAvailableColor(): {
1163
- r: number;
1164
- g: number;
1165
- b: number;
1166
- code: string;
1167
- };
1168
- protected increaseColor(): void;
1169
- protected decreaseColor(): void;
1170
- private applySettings;
1171
- }
1172
- 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
1419
  import * as THREE from "three";
1242
- import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1243
- import { Components } from "../../Components";
1244
- import { Event, World } from "../../Types";
1245
- /**
1246
- * A renderer to determine a mesh visibility on screen
1247
- */
1248
- export declare class MeshCullerRenderer extends CullerRenderer {
1249
- threshold: number;
1250
- readonly onViewUpdated: Event<{
1251
- seen: Set<THREE.Mesh>;
1252
- unseen: Set<THREE.Mesh>;
1253
- }>;
1254
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1255
- isProcessing: boolean;
1256
- private _colorCodeMeshMap;
1257
- private _meshIDColorCodeMap;
1258
- private _currentVisibleMeshes;
1259
- private _recentlyHiddenMeshes;
1260
- private readonly _transparentMat;
1261
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1262
- dispose(): void;
1263
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1264
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1265
- private handleWorkerMessage;
1266
- private getAvailableMaterial;
1420
+ import { BaseScene } from "./base-scene";
1421
+ import { BaseCamera } from "./base-camera";
1422
+ import { BaseRenderer } from "./base-renderer";
1423
+ import { Updateable, Disposable } from "./interfaces";
1424
+ export interface World extends Disposable, Updateable {
1425
+ meshes: Set<THREE.Mesh>;
1426
+ scene: BaseScene;
1427
+ camera: BaseCamera;
1428
+ renderer: BaseRenderer | null;
1429
+ uuid: string;
1267
1430
  }
1268
1431
  /// <reference types="node" />
1269
1432
  import * as THREE from "three";
@@ -1313,174 +1476,6 @@ export declare class SimpleGrid implements Hideable, Disposable {
1313
1476
  private setupEvents;
1314
1477
  private updateZoom;
1315
1478
  }
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
- import * as THREE from "three";
1424
- import { Hideable, Disposable, Event, World } from "../../Types";
1425
- import { Components } from "../../Components";
1426
- /**
1427
- * Each of the planes created by {@link SimpleClipper}.
1428
- */
1429
- export declare class SimplePlane implements Disposable, Hideable {
1430
- /** Event that fires when the user starts dragging a clipping plane. */
1431
- readonly onDraggingStarted: Event<unknown>;
1432
- /** Event that fires when the user stops dragging a clipping plane. */
1433
- readonly onDraggingEnded: Event<unknown>;
1434
- /** {@link Disposable.onDisposed} */
1435
- readonly onDisposed: Event<unknown>;
1436
- readonly normal: THREE.Vector3;
1437
- readonly origin: THREE.Vector3;
1438
- readonly three: THREE.Plane;
1439
- protected readonly _helper: THREE.Object3D;
1440
- protected _visible: boolean;
1441
- protected _enabled: boolean;
1442
- components: Components;
1443
- world: World;
1444
- private _controlsActive;
1445
- private readonly _arrowBoundBox;
1446
- private readonly _planeMesh;
1447
- private readonly _controls;
1448
- private readonly _hiddenMaterial;
1449
- get enabled(): boolean;
1450
- /** {@link Component.enabled} */
1451
- set enabled(state: boolean);
1452
- /** {@link Hideable.visible } */
1453
- get visible(): boolean;
1454
- /** {@link Hideable.visible } */
1455
- set visible(state: boolean);
1456
- /** The meshes used for raycasting */
1457
- get meshes(): THREE.Mesh[];
1458
- /** The material of the clipping plane representation. */
1459
- get planeMaterial(): THREE.Material | THREE.Material[];
1460
- /** The material of the clipping plane representation. */
1461
- set planeMaterial(material: THREE.Material | THREE.Material[]);
1462
- /** The size of the clipping plane representation. */
1463
- get size(): number;
1464
- /** Sets the size of the clipping plane representation. */
1465
- set size(size: number);
1466
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1467
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1468
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
1469
- /** {@link Updateable.update} */
1470
- update: () => Promise<void>;
1471
- /** {@link Disposable.dispose} */
1472
- dispose(): void;
1473
- private reset;
1474
- protected toggleControls(state: boolean): void;
1475
- private newTransformControls;
1476
- private initializeControls;
1477
- private createArrowBoundingBox;
1478
- private changeDrag;
1479
- private notifyDraggingChanged;
1480
- private preventCameraMovement;
1481
- private newHelper;
1482
- private static newPlaneMesh;
1483
- }
1484
1479
  import * as WEBIFC from "web-ifc";
1485
1480
  import * as THREE from "three";
1486
1481
  export declare class Units {
@@ -1518,21 +1513,6 @@ export declare class IfcFragmentSettings {
1518
1513
  autoSetWasm: boolean;
1519
1514
  customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1520
1515
  }
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;
1535
- }
1536
1516
  import * as THREE from "three";
1537
1517
  import * as WEBIFC from "web-ifc";
1538
1518
  import * as FRAGS from "bim-fragment";
@@ -1548,11 +1528,30 @@ export declare class CivilReader {
1548
1528
  } | undefined;
1549
1529
  private getCurves;
1550
1530
  }
1531
+ import * as WEBIFC from "web-ifc";
1532
+ export declare class IfcMetadataReader {
1533
+ get(webIfc: WEBIFC.IfcAPI, type: number): string;
1534
+ }
1551
1535
  import { BufferGeometry } from "three";
1552
1536
  import * as THREE from "three";
1553
1537
  export declare class TransformHelper {
1554
1538
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
1555
1539
  }
1540
+ import { Component, Disposable, Event, Components } from "../../core";
1541
+ export declare class FragmentExploder extends Component implements Disposable {
1542
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
1543
+ enabled: boolean;
1544
+ height: number;
1545
+ groupName: string;
1546
+ /** {@link Disposable.onDisposed} */
1547
+ readonly onDisposed: Event<string>;
1548
+ list: Set<string>;
1549
+ constructor(components: Components);
1550
+ dispose(): void;
1551
+ explode(): void;
1552
+ reset(): void;
1553
+ update(): void;
1554
+ }
1556
1555
  export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
1557
1556
  export type ConditionFunctions = {
1558
1557
  [queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
@@ -1576,169 +1575,5 @@ export interface Query {
1576
1575
  description?: string;
1577
1576
  groups: QueryGroup;
1578
1577
  }
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
1578
 
1744
1579
  }