@thatopen/components 2.0.0-alpha.5 → 2.0.0-alpha.7

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,17 +1,4 @@
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
2
  import * as THREE from "three";
16
3
  import { Components } from "../Components";
17
4
  import { Component } from "../Types";
@@ -55,6 +42,100 @@ export declare class Disposer extends Component {
55
42
  private disposeChildren;
56
43
  private static disposeMaterial;
57
44
  }
45
+ import { Component, Disposable, Event } from "../Types";
46
+ /**
47
+ * The entry point of the Components library.
48
+ * It can:
49
+ * - Create and access all the components of the library.
50
+ * - Update all the updatable components automatically.
51
+ * - Dispose all the components, preventing memory leaks.
52
+ */
53
+ export declare class Components implements Disposable {
54
+ static readonly release = "1.4.21";
55
+ /** {@link Disposable.onDisposed} */
56
+ readonly onDisposed: Event<void>;
57
+ /** The list of components created in this app. */
58
+ readonly list: Map<string, Component>;
59
+ /** If disabled, the animation loop will be stopped. */
60
+ enabled: boolean;
61
+ private _clock;
62
+ add(uuid: string, instance: Component): void;
63
+ /**
64
+ * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
65
+ * doesn't exist, it will instance it automatically.
66
+ *
67
+ * @param Component - The component to get or create.
68
+ */
69
+ get<U extends Component>(Component: new (components: Components) => U): U;
70
+ constructor();
71
+ /**
72
+ * Initializes the library. It should be called at the start of the app after
73
+ * initializing the scene, the renderer and the
74
+ * camera. Additionally, if any component that need a raycaster is
75
+ * used, the {@link raycaster} will need to be initialized.
76
+ */
77
+ init(): void;
78
+ /**
79
+ * Disposes the memory of all the components and tools of this instance of
80
+ * the library. A memory leak will be created if:
81
+ *
82
+ * - An instance of the library ends up out of scope and this function isn't
83
+ * called. This is especially relevant in Single Page Applications (React,
84
+ * Angular, Vue, etc).
85
+ *
86
+ * - Any of the objects of this instance (meshes, geometries, etc) is
87
+ * referenced by a reference type (object or array).
88
+ *
89
+ * You can learn more about how Three.js handles memory leaks
90
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
91
+ *
92
+ */
93
+ dispose(): void;
94
+ private update;
95
+ private static setupBVH;
96
+ }
97
+ import { Component, Disposable, World, Event } from "../Types";
98
+ import { GridConfig, SimpleGrid } from "./src";
99
+ export declare class Grids extends Component implements Disposable {
100
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
101
+ list: Map<string, SimpleGrid>;
102
+ onDisposed: Event<unknown>;
103
+ config: Required<GridConfig>;
104
+ /** {@link Component.enabled} */
105
+ enabled: boolean;
106
+ create(world: World): void;
107
+ delete(world: World): void;
108
+ dispose(): void;
109
+ }
110
+ import { Component, Disposable, World, Event } from "../Types";
111
+ import { SimpleRaycaster } from "./src";
112
+ import { Components } from "../Components";
113
+ export declare class Raycasters extends Component implements Disposable {
114
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
115
+ enabled: boolean;
116
+ list: Map<string, SimpleRaycaster>;
117
+ onDisposed: Event<unknown>;
118
+ constructor(components: Components);
119
+ get(world: World): SimpleRaycaster;
120
+ delete(world: World): void;
121
+ dispose(): void;
122
+ }
123
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
124
+ import { Components } from "../Components";
125
+ import { SimpleWorld } from "./src";
126
+ export declare class Worlds extends Component implements Updateable, Disposable {
127
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
128
+ readonly onAfterUpdate: Event<unknown>;
129
+ readonly onBeforeUpdate: Event<unknown>;
130
+ readonly onDisposed: Event<unknown>;
131
+ list: Map<string, World>;
132
+ enabled: boolean;
133
+ constructor(components: Components);
134
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
135
+ delete(world: World): void;
136
+ dispose(): void;
137
+ update(delta?: number): void | Promise<void>;
138
+ }
58
139
  import * as THREE from "three";
59
140
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
60
141
  import { SimplePlane } from "./src";
@@ -158,109 +239,6 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
158
239
  private _onStartDragging;
159
240
  private _onEndDragging;
160
241
  }
161
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
162
- import { Components } from "../Components";
163
- import { SimpleWorld } from "./src";
164
- export declare class Worlds extends Component implements Updateable, Disposable {
165
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
166
- readonly onAfterUpdate: Event<unknown>;
167
- readonly onBeforeUpdate: Event<unknown>;
168
- readonly onDisposed: Event<unknown>;
169
- list: Map<string, World>;
170
- enabled: boolean;
171
- constructor(components: Components);
172
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
173
- delete(world: World): void;
174
- dispose(): void;
175
- update(delta?: number): void | Promise<void>;
176
- }
177
- import { Component, Disposable, Event } from "../Types";
178
- /**
179
- * The entry point of the Components library.
180
- * It can:
181
- * - Create and access all the components of the library.
182
- * - Update all the updatable components automatically.
183
- * - Dispose all the components, preventing memory leaks.
184
- */
185
- export declare class Components implements Disposable {
186
- static readonly release = "1.4.21";
187
- /** {@link Disposable.onDisposed} */
188
- readonly onDisposed: Event<void>;
189
- /** The list of components created in this app. */
190
- readonly list: Map<string, Component>;
191
- /** If disabled, the animation loop will be stopped. */
192
- enabled: boolean;
193
- private _clock;
194
- add(uuid: string, instance: Component): void;
195
- /**
196
- * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
197
- * doesn't exist, it will instance it automatically.
198
- *
199
- * @param Component - The component to get or create.
200
- */
201
- get<U extends Component>(Component: new (components: Components) => U): U;
202
- constructor();
203
- /**
204
- * Initializes the library. It should be called at the start of the app after
205
- * initializing the scene, the renderer and the
206
- * camera. Additionally, if any component that need a raycaster is
207
- * used, the {@link raycaster} will need to be initialized.
208
- */
209
- init(): void;
210
- /**
211
- * Disposes the memory of all the components and tools of this instance of
212
- * the library. A memory leak will be created if:
213
- *
214
- * - An instance of the library ends up out of scope and this function isn't
215
- * called. This is especially relevant in Single Page Applications (React,
216
- * Angular, Vue, etc).
217
- *
218
- * - Any of the objects of this instance (meshes, geometries, etc) is
219
- * referenced by a reference type (object or array).
220
- *
221
- * You can learn more about how Three.js handles memory leaks
222
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
223
- *
224
- */
225
- dispose(): void;
226
- private update;
227
- private static setupBVH;
228
- }
229
- import { Components } from "../Components";
230
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
231
- import { Component, Event, Disposable, World } from "../Types";
232
- /**
233
- * A tool to handle big scenes efficiently by automatically hiding the objects
234
- * that are not visible to the camera.
235
- */
236
- export declare class Cullers extends Component implements Disposable {
237
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
238
- private _enabled;
239
- list: Map<string, MeshCullerRenderer>;
240
- /** {@link Disposable.onDisposed} */
241
- readonly onDisposed: Event<unknown>;
242
- /** {@link Component.enabled} */
243
- get enabled(): boolean;
244
- set enabled(value: boolean);
245
- constructor(components: Components);
246
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
247
- delete(world: World): void;
248
- /** {@link Disposable.dispose} */
249
- dispose(): void;
250
- }
251
- import { Component, Disposable, World, Event } from "../Types";
252
- import { GridConfig, SimpleGrid } from "./src";
253
- export declare class Grids extends Component implements Disposable {
254
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
255
- list: Map<string, SimpleGrid>;
256
- onDisposed: Event<unknown>;
257
- config: Required<GridConfig>;
258
- /** {@link Component.enabled} */
259
- enabled: boolean;
260
- create(world: World): void;
261
- delete(world: World): void;
262
- dispose(): void;
263
- }
264
242
  import * as THREE from "three";
265
243
  import { Component, Disposable, Event, World } from "../Types";
266
244
  import { Components } from "../Components";
@@ -322,84 +300,27 @@ export declare class Materials extends Component implements Disposable {
322
300
  */
323
301
  removeMeshes(id: string, meshes: THREE.Mesh[]): void;
324
302
  }
325
- import * as FRAGS from "@thatopen/fragments";
326
- import { Disposable, Component, Event, Components } from "../../core";
327
- export interface Classification {
328
- [system: string]: {
329
- [className: string]: FRAGS.FragmentIdMap;
330
- };
331
- }
332
- export declare class FragmentClassifier extends Component implements Disposable {
333
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
334
- /** {@link Component.enabled} */
335
- enabled: boolean;
336
- private _groupSystems;
303
+ import { Components } from "../Components";
304
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
305
+ import { Component, Event, Disposable, World } from "../Types";
306
+ /**
307
+ * A tool to handle big scenes efficiently by automatically hiding the objects
308
+ * that are not visible to the camera.
309
+ */
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>;
316
+ /** {@link Component.enabled} */
317
+ get enabled(): boolean;
318
+ set enabled(value: boolean);
339
319
  constructor(components: Components);
340
- private onFragmentsDisposed;
341
- /** {@link Component.get} */
342
- get(): Classification;
320
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
321
+ delete(world: World): void;
322
+ /** {@link Disposable.dispose} */
343
323
  dispose(): void;
344
- remove(guid: string): void;
345
- find(filter?: {
346
- [name: string]: string[];
347
- }): FRAGS.FragmentIdMap;
348
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
349
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
350
- byEntity(group: FRAGS.FragmentsGroup): void;
351
- byStorey(group: FRAGS.FragmentsGroup): void;
352
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
353
- private saveItem;
354
- }
355
- import * as THREE from "three";
356
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
357
- center: THREE.Vector3;
358
- halfSizes: THREE.Vector3;
359
- rotation: THREE.Matrix3;
360
- transformation: THREE.Matrix4;
361
- };
362
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
363
- import * as THREE from "three";
364
- export declare class MaterialsUtils {
365
- static isTransparent(material: THREE.Material): boolean;
366
- }
367
- export declare class UUID {
368
- private static _pattern;
369
- private static _lut;
370
- static create(): string;
371
- static validate(uuid: string): void;
372
- }
373
- import * as THREE from "three";
374
- import { Component, Components, Event, World, Disposable } from "../core";
375
- export interface VertexPickerConfig {
376
- showOnlyVertex: boolean;
377
- snapDistance: number;
378
- previewElement: HTMLElement;
379
- }
380
- export declare class VertexPicker extends Component implements Disposable {
381
- onVertexFound: Event<THREE.Vector3>;
382
- onVertexLost: Event<THREE.Vector3>;
383
- components: Components;
384
- private _pickedPoint;
385
- private _config;
386
- private _enabled;
387
- private _workingPlane;
388
- /** {@link Disposable.onDisposed} */
389
- readonly onDisposed: Event<unknown>;
390
- set enabled(value: boolean);
391
- get enabled(): boolean;
392
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
393
- [Symbol.dispose](): void;
394
- set workingPlane(plane: THREE.Plane | null);
395
- get workingPlane(): THREE.Plane | null;
396
- set config(value: Partial<VertexPickerConfig>);
397
- get config(): Partial<VertexPickerConfig>;
398
- dispose(): void;
399
- get(world: World): THREE.Vector3 | null;
400
- private getClosestVertex;
401
- private getVertices;
402
- private getVertex;
403
324
  }
404
325
  import * as THREE from "three";
405
326
  import * as FRAGS from "@thatopen/fragments";
@@ -438,6 +359,51 @@ export declare class FragmentBoundingBox extends Component implements Disposable
438
359
  private static getFragmentBounds;
439
360
  }
440
361
  import * as FRAGS from "@thatopen/fragments";
362
+ import { Disposable, Component, Event, Components } from "../../core";
363
+ export interface Classification {
364
+ [system: string]: {
365
+ [className: string]: FRAGS.FragmentIdMap;
366
+ };
367
+ }
368
+ export declare class FragmentClassifier extends Component implements Disposable {
369
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
370
+ /** {@link Component.enabled} */
371
+ enabled: boolean;
372
+ private _groupSystems;
373
+ /** {@link Disposable.onDisposed} */
374
+ readonly onDisposed: Event<unknown>;
375
+ constructor(components: Components);
376
+ private onFragmentsDisposed;
377
+ /** {@link Component.get} */
378
+ get(): Classification;
379
+ dispose(): void;
380
+ remove(guid: string): void;
381
+ find(filter?: {
382
+ [name: string]: string[];
383
+ }): FRAGS.FragmentIdMap;
384
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
385
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
386
+ byEntity(group: FRAGS.FragmentsGroup): void;
387
+ byStorey(group: FRAGS.FragmentsGroup): void;
388
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
389
+ private saveItem;
390
+ }
391
+ import { Component, Disposable, Event, Components } from "../../core";
392
+ export declare class FragmentExploder extends Component implements Disposable {
393
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
394
+ enabled: boolean;
395
+ height: number;
396
+ groupName: string;
397
+ /** {@link Disposable.onDisposed} */
398
+ readonly onDisposed: Event<string>;
399
+ list: Set<string>;
400
+ constructor(components: Components);
401
+ dispose(): void;
402
+ explode(): void;
403
+ reset(): void;
404
+ update(): void;
405
+ }
406
+ import * as FRAGS from "@thatopen/fragments";
441
407
  import { Components, Component } from "../../core";
442
408
  export declare class FragmentHider extends Component {
443
409
  static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
@@ -447,26 +413,6 @@ export declare class FragmentHider extends Component {
447
413
  isolate(items: FRAGS.FragmentIdMap): void;
448
414
  private updateCulledVisibility;
449
415
  }
450
- import * as THREE from "three";
451
- export interface MeasureEdge {
452
- distance: number;
453
- points: THREE.Vector3[];
454
- }
455
- export declare class MeasurementUtils {
456
- static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
457
- edges: MeasureEdge[];
458
- indices: Set<number>;
459
- } | null;
460
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
461
- private static getFaceData;
462
- static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
463
- p1: THREE.Vector3;
464
- p2: THREE.Vector3;
465
- p3: THREE.Vector3;
466
- faceNormal: THREE.Vector3;
467
- };
468
- private static round;
469
- }
470
416
  import * as WEBIFC from "web-ifc";
471
417
  import * as FRAGS from "@thatopen/fragments";
472
418
  import { IfcFragmentSettings } from "./src";
@@ -499,21 +445,6 @@ export declare class FragmentIfcLoader extends Component implements Disposable {
499
445
  private getGeometry;
500
446
  private autoSetWasm;
501
447
  }
502
- import { Component, Disposable, Event, Components } from "../../core";
503
- export declare class FragmentExploder extends Component implements Disposable {
504
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
505
- enabled: boolean;
506
- height: number;
507
- groupName: string;
508
- /** {@link Disposable.onDisposed} */
509
- readonly onDisposed: Event<string>;
510
- list: Set<string>;
511
- constructor(components: Components);
512
- dispose(): void;
513
- explode(): void;
514
- reset(): void;
515
- update(): void;
516
- }
517
448
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
518
449
  import * as THREE from "three";
519
450
  import { Component, Components, Event, Disposable } from "../../core";
@@ -607,6 +538,55 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
607
538
  private newOrthoCamera;
608
539
  private setOrthoCameraAspect;
609
540
  }
541
+ import * as THREE from "three";
542
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
543
+ center: THREE.Vector3;
544
+ halfSizes: THREE.Vector3;
545
+ rotation: THREE.Matrix3;
546
+ transformation: THREE.Matrix4;
547
+ };
548
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
549
+ export declare class UUID {
550
+ private static _pattern;
551
+ private static _lut;
552
+ static create(): string;
553
+ static validate(uuid: string): void;
554
+ }
555
+ import * as THREE from "three";
556
+ export declare class MaterialsUtils {
557
+ static isTransparent(material: THREE.Material): boolean;
558
+ }
559
+ import * as THREE from "three";
560
+ import { Component, Components, Event, World, Disposable } from "../core";
561
+ export interface VertexPickerConfig {
562
+ showOnlyVertex: boolean;
563
+ snapDistance: number;
564
+ previewElement: HTMLElement;
565
+ }
566
+ export declare class VertexPicker extends Component implements Disposable {
567
+ onVertexFound: Event<THREE.Vector3>;
568
+ onVertexLost: Event<THREE.Vector3>;
569
+ components: Components;
570
+ private _pickedPoint;
571
+ private _config;
572
+ private _enabled;
573
+ private _workingPlane;
574
+ /** {@link Disposable.onDisposed} */
575
+ readonly onDisposed: Event<unknown>;
576
+ set enabled(value: boolean);
577
+ get enabled(): boolean;
578
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
579
+ [Symbol.dispose](): void;
580
+ set workingPlane(plane: THREE.Plane | null);
581
+ get workingPlane(): THREE.Plane | null;
582
+ set config(value: Partial<VertexPickerConfig>);
583
+ get config(): Partial<VertexPickerConfig>;
584
+ dispose(): void;
585
+ get(world: World): THREE.Vector3 | null;
586
+ private getClosestVertex;
587
+ private getVertices;
588
+ private getVertex;
589
+ }
610
590
  import * as WEBIFC from "web-ifc";
611
591
  import * as FRAG from "@thatopen/fragments";
612
592
  /**
@@ -625,35 +605,147 @@ export declare class IfcJsonExporter {
625
605
  }
626
606
  import { FragmentsGroup } from "@thatopen/fragments";
627
607
  import { Disposable, Event, Component, Components } from "../../core";
628
- import { IfcPropertiesManager } from "../IfcPropertiesManager";
629
- interface IndexMap {
630
- [modelID: string]: {
631
- [expressID: string]: Set<number>;
632
- };
608
+ interface RelationMap {
609
+ [modelID: string]: Map<number, Map<number, number[]>>;
633
610
  }
634
- export declare class IfcPropertiesIndexer extends Component implements Disposable {
611
+ /**
612
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
613
+ * 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.
614
+ */
615
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
635
616
  static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
636
617
  /** {@link Disposable.onDisposed} */
637
618
  readonly onDisposed: Event<string>;
638
619
  enabled: boolean;
639
- relationsToProcess: number[];
640
- indexMap: IndexMap;
641
- private _propertiesManager;
642
- readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
643
- set propertiesManager(manager: IfcPropertiesManager | null);
644
- get propertiesManager(): IfcPropertiesManager | null;
620
+ /**
621
+ * All the inverse attributes this component can processes.
622
+ */
623
+ readonly inverseAttributes: string[];
624
+ inverseAttributesToProcess: string[];
625
+ private _relToAttributesMap;
626
+ /**
627
+ * Holds the relationship mappings for each model processed by the indexer.
628
+ * The structure is a map where each key is a model's UUID, and the value is another map.
629
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
630
+ * representing a specific relation type, and the value is an array of expressIDs of entities
631
+ * that are related through that relation type. This structure allows for efficient querying
632
+ * of entity relationships within a model.
633
+ */
634
+ readonly relationMaps: RelationMap;
645
635
  constructor(components: Components);
646
636
  private onFragmentsDisposed;
647
- dispose(): Promise<void>;
648
- getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
649
- private getNestedPsets;
650
- private getPsetProperties;
651
- process(model: FragmentsGroup): Promise<void>;
652
- private setEntityIndex;
653
- private cloneProperty;
654
- private clonePropertyArray;
637
+ private getAttributeRels;
638
+ private setRelMap;
639
+ /**
640
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
641
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
642
+ * and maps them in a structured way to facilitate quick access to related entities.
643
+ *
644
+ * The process involves querying the model for each relation type associated with the inverse attributes
645
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
646
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
647
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
648
+ * of entities that are related through that attribute.
649
+ *
650
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
651
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
652
+ * representation of the relations indexed by entity expressIDs and relation types.
653
+ * @throws An error if the model does not have properties loaded.
654
+ */
655
+ process(model: FragmentsGroup): Promise<Map<number, Map<number, number[]>>>;
656
+ /**
657
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
658
+ * This method searches the indexed relation maps for the specified model and entity,
659
+ * returning the IDs of related entities if a match is found.
660
+ *
661
+ * @param model The 'FragmentsGroup' model containing the entity.
662
+ * @param expressID The unique identifier of the entity within the model.
663
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
664
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
665
+ * or the specified relation name is not indexed.
666
+ */
667
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: string): number[] | null;
668
+ /**
669
+ * Serializes the relations of a specific model into a JSON string.
670
+ * This method iterates through the relations indexed for the given model,
671
+ * organizing them into a structured object where each key is an expressID of an entity,
672
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
673
+ * The resulting object is then serialized into a JSON string.
674
+ *
675
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
676
+ * @returns A JSON string representing the serialized relations of the specified model.
677
+ * If the model has no indexed relations, 'null' is returned.
678
+ */
679
+ serializeModelRelations(model: FragmentsGroup): string | null;
680
+ /**
681
+ * Serializes all relations of every model processed by the indexer into a JSON string.
682
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
683
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
684
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
685
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
686
+ *
687
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
688
+ * If no relations have been indexed, an empty object is returned as a JSON string.
689
+ */
690
+ serializeRelations(): string;
691
+ /**
692
+ * Converts a JSON string representing relations between entities into a structured map.
693
+ * This method parses the JSON string to reconstruct the relations map that indexes
694
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
695
+ * and the values are maps where each key is a relation type ID and its value is an array
696
+ * of express IDs of entities related through that relation type.
697
+ *
698
+ * @param json The JSON string to be parsed into the relations map.
699
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
700
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
701
+ * is an array of express IDs (as numbers) of entities related through that relation type.
702
+ */
703
+ getRelationsMapFromJSON(json: string): Map<number, Map<number, number[]>>;
704
+ /**
705
+ * Disposes the component, cleaning up resources and detaching event listeners.
706
+ * This ensures that the component is properly cleaned up and does not leave behind any
707
+ * references that could prevent garbage collection.
708
+ */
709
+ dispose(): void;
655
710
  }
656
711
  export {};
712
+ import * as FRAGS from "@thatopen/fragments";
713
+ import { FragmentsGroup } from "@thatopen/fragments";
714
+ import { Disposable, Event, Component, Components } from "../../core";
715
+ import { QueryGroup } from "./src/types";
716
+ export interface QueryResult {
717
+ [modelID: string]: {
718
+ modelEntities: Set<number>;
719
+ otherEntities: Set<number>;
720
+ };
721
+ }
722
+ export interface IndexedModels {
723
+ [modelID: string]: {
724
+ [expressID: number]: Set<number>;
725
+ };
726
+ }
727
+ export declare class IfcPropertiesFinder extends Component implements Disposable {
728
+ readonly onFound: Event<FRAGS.FragmentIdMap>;
729
+ /** {@link Disposable.onDisposed} */
730
+ readonly onDisposed: Event<unknown>;
731
+ enabled: boolean;
732
+ indexedModels: IndexedModels;
733
+ private readonly _conditionFunctions;
734
+ private _noHandleAttributes;
735
+ constructor(components: Components);
736
+ private onFragmentsDisposed;
737
+ dispose(): void;
738
+ private indexEntityRelations;
739
+ find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
740
+ private toFragmentMap;
741
+ private simpleQuery;
742
+ private getMatchingEntities;
743
+ private combineArrays;
744
+ private getCommonElements;
745
+ private arrayIntersection;
746
+ private arrayUnion;
747
+ private getConditionFunctions;
748
+ }
657
749
  import * as WEBIFC from "web-ifc";
658
750
  import { FragmentsGroup } from "@thatopen/fragments";
659
751
  import { Component, Disposable, Event, Components } from "../../core";
@@ -727,42 +819,33 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
727
819
  setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
728
820
  }
729
821
  export {};
730
- import * as FRAGS from "@thatopen/fragments";
731
- import { FragmentsGroup } from "@thatopen/fragments";
732
- import { Disposable, Event, Component, Components } from "../../core";
733
- import { QueryGroup } from "./src/types";
734
- export interface QueryResult {
735
- [modelID: string]: {
736
- modelEntities: Set<number>;
737
- otherEntities: Set<number>;
738
- };
822
+ import * as THREE from "three";
823
+ export interface MeasureEdge {
824
+ distance: number;
825
+ points: THREE.Vector3[];
739
826
  }
740
- export interface IndexedModels {
741
- [modelID: string]: {
742
- [expressID: number]: Set<number>;
743
- };
827
+ export declare class MeasurementUtils {
828
+ static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
829
+ edges: MeasureEdge[];
830
+ indices: Set<number>;
831
+ } | null;
832
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
833
+ private static getFaceData;
834
+ static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
835
+ p1: THREE.Vector3;
836
+ p2: THREE.Vector3;
837
+ p3: THREE.Vector3;
838
+ faceNormal: THREE.Vector3;
839
+ };
840
+ private static round;
744
841
  }
745
- export declare class IfcPropertiesFinder extends Component implements Disposable {
746
- readonly onFound: Event<FRAGS.FragmentIdMap>;
747
- /** {@link Disposable.onDisposed} */
748
- readonly onDisposed: Event<unknown>;
749
- enabled: boolean;
750
- indexedModels: IndexedModels;
751
- private readonly _conditionFunctions;
752
- private _noHandleAttributes;
753
- constructor(components: Components);
754
- private onFragmentsDisposed;
755
- dispose(): void;
756
- private indexEntityRelations;
757
- find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
758
- private toFragmentMap;
759
- private simpleQuery;
760
- private getMatchingEntities;
761
- private combineArrays;
762
- private getCommonElements;
763
- private arrayIntersection;
764
- private arrayUnion;
765
- private getConditionFunctions;
842
+ export declare const GeometryTypes: Set<number>;
843
+ import * as WEBIFC from "web-ifc";
844
+ export interface IfcItemsCategories {
845
+ [itemID: number]: number;
846
+ }
847
+ export declare class IfcCategories {
848
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
766
849
  }
767
850
  import * as WEBIFC from "web-ifc";
768
851
  import { IfcItemsCategories } from "../../../ifc";
@@ -772,14 +855,6 @@ export declare class SpatialStructure {
772
855
  setUp(webIfc: WEBIFC.IfcAPI): void;
773
856
  cleanUp(): void;
774
857
  }
775
- export declare const GeometryTypes: Set<number>;
776
- import * as WEBIFC from "web-ifc";
777
- export interface IfcItemsCategories {
778
- [itemID: number]: number;
779
- }
780
- export declare class IfcCategories {
781
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
782
- }
783
858
  export declare const IfcElements: {
784
859
  [key: number]: string;
785
860
  };
@@ -811,187 +886,57 @@ export declare class IfcPropertiesUtils {
811
886
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
812
887
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
813
888
  }
814
- import * as THREE from "three";
815
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
816
- import { Components } from "../../Components";
817
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
818
- /**
819
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
820
- */
821
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
822
- readonly onAfterUpdate: Event<unknown>;
823
- readonly onBeforeUpdate: Event<unknown>;
824
- enabled: boolean;
825
- uuid: string;
826
- readonly onDisposed: Event<unknown>;
827
- private _scene?;
828
- private _camera?;
829
- private _renderer;
830
- get scene(): T;
831
- set scene(scene: T);
832
- get camera(): U;
833
- set camera(camera: U);
834
- get renderer(): S | null;
835
- set renderer(renderer: S | null);
836
- constructor(components: Components);
837
- update(delta?: number): void;
838
- dispose(disposeResources?: boolean): void;
839
- }
840
- /// <reference types="node" />
841
- import * as THREE from "three";
842
- import { Hideable, Event, World } from "../../Types";
843
- import { Components } from "../../Components";
844
- export interface GridConfig {
845
- color: THREE.Color;
846
- size1: number;
847
- size2: number;
848
- distance: number;
849
- }
850
889
  /**
851
- * An infinite grid. Created by
852
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
853
- * and translated to typescript by
854
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
890
+ * Simple event handler by
891
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
892
+ * Keep in mind that:
893
+ * - If you want to remove it later, you might want to declare the callback as
894
+ * an object.
895
+ * - If you want to maintain the reference to 'this', you will need to declare
896
+ * the callback as an arrow function.
855
897
  */
856
- export declare class SimpleGrid implements Hideable, Disposable {
857
- /** {@link Disposable.onDisposed} */
858
- readonly onDisposed: Event<unknown>;
859
- world: World;
860
- components: Components;
861
- /** {@link Hideable.visible} */
862
- get visible(): boolean;
863
- /** {@link Hideable.visible} */
864
- set visible(visible: boolean);
865
- /** The material of the grid. */
866
- get material(): THREE.ShaderMaterial;
898
+ export declare class Event<T> {
867
899
  /**
868
- * Whether the grid should fade away with distance. Recommended to be true for
869
- * perspective cameras and false for orthographic cameras.
900
+ * Add a callback to this event instance.
901
+ * @param handler - the callback to be added to this event.
870
902
  */
871
- get fade(): boolean;
903
+ add(handler: T extends void ? {
904
+ (): void;
905
+ } : {
906
+ (data: T): void;
907
+ }): void;
872
908
  /**
873
- * Whether the grid should fade away with distance. Recommended to be true for
874
- * perspective cameras and false for orthographic cameras.
909
+ * Removes a callback from this event instance.
910
+ * @param handler - the callback to be removed from this event.
875
911
  */
876
- set fade(active: boolean);
877
- private readonly _grid;
878
- private _fade;
879
- constructor(components: Components, world: World, config: GridConfig);
880
- [Symbol.dispose](): void;
881
- /** {@link Component.get} */
882
- get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
883
- /** {@link Disposable.dispose} */
884
- dispose(): void;
885
- private setupEvents;
886
- private updateZoom;
887
- }
888
- import * as THREE from "three";
889
- import { BaseScene, Configurable, Event } from "../../Types";
890
- import { Components } from "../../Components";
891
- export interface SimpleSceneConfig {
892
- directionalLight: {
893
- color: THREE.Color;
894
- intensity: number;
895
- position: THREE.Vector3;
896
- };
897
- ambientLight: {
898
- color: THREE.Color;
899
- intensity: number;
900
- };
901
- }
902
- /**
903
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
904
- * objects hierarchically, and easily dispose them when you are finished with it.
905
- * @noInheritDoc
906
- */
907
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
908
- /** {@link Configurable.isSetup} */
909
- isSetup: boolean;
910
- three: THREE.Scene;
911
- /** {@link Configurable.onSetup} */
912
- readonly onSetup: Event<SimpleScene>;
913
- config: Required<SimpleSceneConfig>;
914
- constructor(components: Components);
915
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
916
- setup(config?: Partial<SimpleSceneConfig>): void;
912
+ remove(handler: T extends void ? {
913
+ (): void;
914
+ } : {
915
+ (data: T): void;
916
+ }): void;
917
+ /** Triggers all the callbacks assigned to this event. */
918
+ trigger: (data?: T) => void;
919
+ /** Gets rid of all the suscribed events. */
920
+ reset(): void;
921
+ private handlers;
917
922
  }
918
- import * as THREE from "three";
919
- import CameraControls from "camera-controls";
920
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
921
- import { Components } from "../../Components";
923
+ import { Base } from "./base";
922
924
  /**
923
- * A basic camera that uses
924
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
925
- * easily control the camera in 2D and 3D. Check out it's API to find out
926
- * what features it offers.
925
+ * Components are the building blocks of this library. Components are singleton
926
+ * elements that contain specific functionality. For instance, the SimpleClipper
927
+ * Component can create, delete and handle 3D clipping planes. Components must be
928
+ * unique (they can't be instanced more than once), and have a static UUID that
929
+ * identifies them uniquely. The can be accessed globally using the {@link Components}
930
+ * instance.
927
931
  */
928
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
929
- /** {@link Updateable.onBeforeUpdate} */
930
- readonly onBeforeUpdate: Event<SimpleCamera>;
931
- /** {@link Updateable.onAfterUpdate} */
932
- readonly onAfterUpdate: Event<SimpleCamera>;
933
- readonly onAspectUpdated: Event<unknown>;
934
- /** {@link Disposable.onDisposed} */
935
- readonly onDisposed: Event<string>;
936
- readonly three: THREE.PerspectiveCamera;
937
- private _allControls;
938
- /**
939
- * The object that controls the camera. An instance of
940
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
941
- * Transforming the camera directly will have no effect: you need to use this
942
- * object to move, rotate, look at objects, etc.
943
- */
944
- get controls(): CameraControls;
945
- /** {@link Component.enabled} */
946
- get enabled(): boolean;
947
- /** {@link Component.enabled} */
948
- set enabled(enabled: boolean);
949
- constructor(components: Components);
950
- /** {@link Disposable.dispose} */
951
- dispose(): void;
952
- /** {@link Updateable.update} */
953
- update(_delta: number): void;
932
+ export declare abstract class Component extends Base {
954
933
  /**
955
- * Updates the aspect of the camera to match the size of the
956
- * {@link Components.renderer}.
934
+ * Whether this component is active or not. The behaviour can vary depending
935
+ * on the type of component. E.g. a disabled dimension tool will stop creating
936
+ * dimensions, while a disabled camera will stop moving. A disabled component
937
+ * will not be updated automatically each frame.
957
938
  */
958
- updateAspect: () => void;
959
- private setupCamera;
960
- private newCameraControls;
961
- private setupEvents;
962
- private static getSubsetOfThree;
963
- }
964
- import * as THREE from "three";
965
- import { BaseRenderer, Event } from "../../Types";
966
- import { Components } from "../../Components";
967
- /**
968
- * A basic renderer capable of rendering
969
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
970
- */
971
- export declare class SimpleRenderer extends BaseRenderer {
972
- /** {@link Component.enabled} */
973
- enabled: boolean;
974
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
975
- container: HTMLElement | null;
976
- three: THREE.WebGLRenderer;
977
- protected _canvas: HTMLCanvasElement;
978
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
979
- protected onContainerUpdated: Event<HTMLElement>;
980
- constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
981
- /** {@link Updateable.update} */
982
- update(): void;
983
- /** {@link Disposable.dispose} */
984
- dispose(): void;
985
- /** {@link Resizeable.getSize}. */
986
- getSize(): THREE.Vector2;
987
- /** {@link Resizeable.resize} */
988
- resize: (size?: THREE.Vector2) => void;
989
- setupEvents(active: boolean): void;
990
- private resizeEvent;
991
- private setupRenderer;
992
- private onContextLost;
993
- private onContextBack;
994
- private updateContainer;
939
+ abstract enabled: boolean;
995
940
  }
996
941
  /**
997
942
  * Simple event handler by
@@ -1002,31 +947,48 @@ export declare class SimpleRenderer extends BaseRenderer {
1002
947
  * - If you want to maintain the reference to 'this', you will need to declare
1003
948
  * the callback as an arrow function.
1004
949
  */
1005
- export declare class Event<T> {
950
+ export declare class AsyncEvent<T> {
1006
951
  /**
1007
952
  * Add a callback to this event instance.
1008
953
  * @param handler - the callback to be added to this event.
1009
954
  */
1010
955
  add(handler: T extends void ? {
1011
- (): void;
956
+ (): Promise<void>;
1012
957
  } : {
1013
- (data: T): void;
958
+ (data: T): Promise<void>;
1014
959
  }): void;
1015
960
  /**
1016
961
  * Removes a callback from this event instance.
1017
962
  * @param handler - the callback to be removed from this event.
1018
963
  */
1019
964
  remove(handler: T extends void ? {
1020
- (): void;
965
+ (): Promise<void>;
1021
966
  } : {
1022
- (data: T): void;
967
+ (data: T): Promise<void>;
1023
968
  }): void;
1024
969
  /** Triggers all the callbacks assigned to this event. */
1025
- trigger: (data?: T) => void;
970
+ trigger: (data?: T) => Promise<void>;
1026
971
  /** Gets rid of all the suscribed events. */
1027
972
  reset(): void;
1028
973
  private handlers;
1029
974
  }
975
+ import { Base } from "./base";
976
+ import { World } from "./world";
977
+ import { Event } from "./event";
978
+ import { Components } from "../../Components";
979
+ /**
980
+ * One of the elements that make a world. It can be either a scene, a camera
981
+ * or a renderer.
982
+ */
983
+ export declare abstract class BaseWorldItem extends Base {
984
+ readonly worlds: Map<string, World>;
985
+ readonly onWorldChanged: Event<{
986
+ world: World;
987
+ action: "added" | "removed";
988
+ }>;
989
+ currentWorld: World | null;
990
+ protected constructor(components: Components);
991
+ }
1030
992
  import * as THREE from "three";
1031
993
  import CameraControls from "camera-controls";
1032
994
  import { Event } from "./event";
@@ -1150,24 +1112,6 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1150
1112
  export interface CameraControllable {
1151
1113
  controls: CameraControls;
1152
1114
  }
1153
- import { Base } from "./base";
1154
- /**
1155
- * Components are the building blocks of this library. Components are singleton
1156
- * elements that contain specific functionality. For instance, the SimpleClipper
1157
- * Component can create, delete and handle 3D clipping planes. Components must be
1158
- * unique (they can't be instanced more than once), and have a static UUID that
1159
- * identifies them uniquely. The can be accessed globally using the {@link Components}
1160
- * instance.
1161
- */
1162
- export declare abstract class Component extends Base {
1163
- /**
1164
- * Whether this component is active or not. The behaviour can vary depending
1165
- * on the type of component. E.g. a disabled dimension tool will stop creating
1166
- * dimensions, while a disabled camera will stop moving. A disabled component
1167
- * will not be updated automatically each frame.
1168
- */
1169
- abstract enabled: boolean;
1170
- }
1171
1115
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1172
1116
  import { Components } from "../../Components";
1173
1117
  /**
@@ -1187,23 +1131,6 @@ export declare abstract class Base {
1187
1131
  /** Whether is component is {@link Configurable}. */
1188
1132
  isConfigurable: () => this is Configurable<any>;
1189
1133
  }
1190
- import { Base } from "./base";
1191
- import { World } from "./world";
1192
- import { Event } from "./event";
1193
- import { Components } from "../../Components";
1194
- /**
1195
- * One of the elements that make a world. It can be either a scene, a camera
1196
- * or a renderer.
1197
- */
1198
- export declare abstract class BaseWorldItem extends Base {
1199
- readonly worlds: Map<string, World>;
1200
- readonly onWorldChanged: Event<{
1201
- world: World;
1202
- action: "added" | "removed";
1203
- }>;
1204
- currentWorld: World | null;
1205
- protected constructor(components: Components);
1206
- }
1207
1134
  import * as THREE from "three";
1208
1135
  import CameraControls from "camera-controls";
1209
1136
  import { BaseWorldItem } from "./base-world-item";
@@ -1256,6 +1183,19 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1256
1183
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1257
1184
  }
1258
1185
  import * as THREE from "three";
1186
+ import { Disposable } from "./interfaces";
1187
+ import { Event } from "./event";
1188
+ import { Components } from "../../Components";
1189
+ import { BaseWorldItem } from "./base-world-item";
1190
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1191
+ /** {@link Disposable.onDisposed} */
1192
+ readonly onDisposed: Event<unknown>;
1193
+ abstract three: THREE.Object3D;
1194
+ protected constructor(components: Components);
1195
+ /** {@link Disposable.dispose} */
1196
+ dispose(): void;
1197
+ }
1198
+ import * as THREE from "three";
1259
1199
  import { BaseScene } from "./base-scene";
1260
1200
  import { BaseCamera } from "./base-camera";
1261
1201
  import { BaseRenderer } from "./base-renderer";
@@ -1267,64 +1207,159 @@ export interface World extends Disposable, Updateable {
1267
1207
  renderer: BaseRenderer | null;
1268
1208
  uuid: string;
1269
1209
  }
1270
- import * as THREE from "three";
1271
- import { Disposable } from "./interfaces";
1272
- import { Event } from "./event";
1273
- import { Components } from "../../Components";
1274
- import { BaseWorldItem } from "./base-world-item";
1275
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1210
+ import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1211
+ /** Configuration of the IFC-fragment streaming. */
1212
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1213
+ minGeometrySize: number;
1214
+ minAssetsSize: number;
1215
+ }
1216
+ /** Configuration of the IFC-fragment streaming. */
1217
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1218
+ propertiesSize: number;
1219
+ }
1220
+ import * as WEBIFC from "web-ifc";
1221
+ import { Components, Disposable, Event, Component } from "../../../core";
1222
+ import { IfcStreamingSettings } from "./streaming-settings";
1223
+ import { StreamedGeometries, StreamedAsset } from "./base-types";
1224
+ export declare class FragmentIfcStreamConverter extends Component implements Disposable {
1225
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1226
+ onGeometryStreamed: Event<{
1227
+ buffer: Uint8Array;
1228
+ data: StreamedGeometries;
1229
+ }>;
1230
+ onAssetStreamed: Event<StreamedAsset[]>;
1231
+ onProgress: Event<number>;
1232
+ onIfcLoaded: Event<Uint8Array>;
1276
1233
  /** {@link Disposable.onDisposed} */
1277
1234
  readonly onDisposed: Event<unknown>;
1278
- abstract three: THREE.Object3D;
1279
- protected constructor(components: Components);
1280
- /** {@link Disposable.dispose} */
1235
+ settings: IfcStreamingSettings;
1236
+ enabled: boolean;
1237
+ webIfc: WEBIFC.IfcAPI;
1238
+ private _spatialTree;
1239
+ private _metaData;
1240
+ private _visitedGeometries;
1241
+ private _streamSerializer;
1242
+ private _geometries;
1243
+ private _geometryCount;
1244
+ private _civil;
1245
+ private _groupSerializer;
1246
+ private _assets;
1247
+ private _meshesWithHoles;
1248
+ constructor(components: Components);
1281
1249
  dispose(): void;
1250
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1251
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1252
+ private readIfcFile;
1253
+ private streamIfcFile;
1254
+ private streamAllGeometries;
1255
+ private cleanUp;
1256
+ private getMesh;
1257
+ private getGeometry;
1258
+ private streamAssets;
1259
+ private streamGeometries;
1282
1260
  }
1283
1261
  import * as WEBIFC from "web-ifc";
1284
- /** Configuration of the IFC-fragment conversion. */
1285
- export declare class IfcFragmentSettings {
1286
- /** Whether to extract the IFC properties into a JSON. */
1287
- includeProperties: boolean;
1288
- /**
1289
- * Generate the geometry for categories that are not included by default,
1290
- * like IFCSPACE.
1291
- */
1292
- optionalCategories: number[];
1293
- /** Whether to use the coordination data coming from the IFC files. */
1294
- coordinate: boolean;
1295
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1296
- wasm: {
1297
- path: string;
1298
- absolute: boolean;
1299
- logLevel?: WEBIFC.LogLevel;
1262
+ import { Component, Disposable, Event } from "../../../core";
1263
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1264
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1265
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1266
+ onPropertiesStreamed: Event<{
1267
+ type: number;
1268
+ data: {
1269
+ [id: number]: any;
1270
+ };
1271
+ }>;
1272
+ onProgress: Event<number>;
1273
+ onIndicesStreamed: Event<number[][]>;
1274
+ /** {@link Disposable.onDisposed} */
1275
+ readonly onDisposed: Event<string>;
1276
+ enabled: boolean;
1277
+ settings: PropertiesStreamingSettings;
1278
+ webIfc: WEBIFC.IfcAPI;
1279
+ dispose(): Promise<void>;
1280
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1281
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1282
+ private readIfcFile;
1283
+ private streamIfcFile;
1284
+ private streamAllProperties;
1285
+ private getIndices;
1286
+ private cleanUp;
1287
+ }
1288
+ export interface StreamedGeometries {
1289
+ [id: number]: {
1290
+ boundingBox: Float32Array;
1291
+ hasHoles: boolean;
1292
+ geometryFile?: string;
1300
1293
  };
1301
- /** List of categories that won't be converted to fragments. */
1302
- excludedCategories: Set<number>;
1303
- /** Whether to save the absolute location of all IFC items. */
1304
- saveLocations: boolean;
1305
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1306
- webIfc: WEBIFC.LoaderSettings;
1307
- autoSetWasm: boolean;
1308
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1294
+ }
1295
+ export interface StreamedAsset {
1296
+ id: number;
1297
+ geometries: {
1298
+ geometryID: number;
1299
+ transformation: number[];
1300
+ color: number[];
1301
+ }[];
1309
1302
  }
1310
1303
  import * as THREE from "three";
1311
- import * as WEBIFC from "web-ifc";
1312
- import * as FRAGS from "@thatopen/fragments";
1313
- export declare class CivilReader {
1314
- defLineMat: THREE.LineBasicMaterial;
1315
- read(webIfc: WEBIFC.IfcAPI): {
1316
- alignments: Map<number, FRAGS.Alignment>;
1317
- coordinationMatrix: THREE.Matrix4;
1318
- } | undefined;
1319
- get(civilItems: any): {
1320
- alignments: Map<number, FRAGS.Alignment>;
1321
- coordinationMatrix: THREE.Matrix4;
1322
- } | undefined;
1323
- private getCurves;
1324
- }
1325
- import * as WEBIFC from "web-ifc";
1326
- export declare class IfcMetadataReader {
1327
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1304
+ import { Hideable, Disposable, Event, World } from "../../Types";
1305
+ import { Components } from "../../Components";
1306
+ /**
1307
+ * Each of the planes created by {@link SimpleClipper}.
1308
+ */
1309
+ export declare class SimplePlane implements Disposable, Hideable {
1310
+ /** Event that fires when the user starts dragging a clipping plane. */
1311
+ readonly onDraggingStarted: Event<unknown>;
1312
+ /** Event that fires when the user stops dragging a clipping plane. */
1313
+ readonly onDraggingEnded: Event<unknown>;
1314
+ /** {@link Disposable.onDisposed} */
1315
+ readonly onDisposed: Event<unknown>;
1316
+ readonly normal: THREE.Vector3;
1317
+ readonly origin: THREE.Vector3;
1318
+ readonly three: THREE.Plane;
1319
+ protected readonly _helper: THREE.Object3D;
1320
+ protected _visible: boolean;
1321
+ protected _enabled: boolean;
1322
+ components: Components;
1323
+ world: World;
1324
+ private _controlsActive;
1325
+ private readonly _arrowBoundBox;
1326
+ private readonly _planeMesh;
1327
+ private readonly _controls;
1328
+ private readonly _hiddenMaterial;
1329
+ get enabled(): boolean;
1330
+ /** {@link Component.enabled} */
1331
+ set enabled(state: boolean);
1332
+ /** {@link Hideable.visible } */
1333
+ get visible(): boolean;
1334
+ /** {@link Hideable.visible } */
1335
+ set visible(state: boolean);
1336
+ /** The meshes used for raycasting */
1337
+ get meshes(): THREE.Mesh[];
1338
+ /** The material of the clipping plane representation. */
1339
+ get planeMaterial(): THREE.Material | THREE.Material[];
1340
+ /** The material of the clipping plane representation. */
1341
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
1342
+ /** The size of the clipping plane representation. */
1343
+ get size(): number;
1344
+ /** Sets the size of the clipping plane representation. */
1345
+ set size(size: number);
1346
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1347
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1348
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
1349
+ /** {@link Updateable.update} */
1350
+ update: () => Promise<void>;
1351
+ /** {@link Disposable.dispose} */
1352
+ dispose(): void;
1353
+ private reset;
1354
+ protected toggleControls(state: boolean): void;
1355
+ private newTransformControls;
1356
+ private initializeControls;
1357
+ private createArrowBoundingBox;
1358
+ private changeDrag;
1359
+ private notifyDraggingChanged;
1360
+ private preventCameraMovement;
1361
+ private newHelper;
1362
+ private static newPlaneMesh;
1328
1363
  }
1329
1364
  import * as THREE from "three";
1330
1365
  import { Disposable, Event } from "../../Types";
@@ -1390,7 +1425,7 @@ export declare class SimpleRaycaster implements Disposable {
1390
1425
  }
1391
1426
  import * as THREE from "three";
1392
1427
  import { Components } from "../../Components";
1393
- import { Event, World } from "../../Types";
1428
+ import { AsyncEvent, Event, World } from "../../Types";
1394
1429
  export interface CullerRendererSettings {
1395
1430
  updateInterval?: number;
1396
1431
  width?: number;
@@ -1408,7 +1443,7 @@ export declare class CullerRenderer {
1408
1443
  * meshes that are currently visible, and the ones that were visible
1409
1444
  * just before but not anymore.
1410
1445
  */
1411
- readonly onViewUpdated: Event<any>;
1446
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1412
1447
  /** {@link Component.enabled} */
1413
1448
  enabled: boolean;
1414
1449
  /**
@@ -1434,6 +1469,7 @@ export declare class CullerRenderer {
1434
1469
  private readonly renderTarget;
1435
1470
  private readonly bufferSize;
1436
1471
  private readonly _buffer;
1472
+ protected _isWorkerBusy: boolean;
1437
1473
  constructor(components: Components, world: World, settings?: CullerRendererSettings);
1438
1474
  /** {@link Disposable.dispose} */
1439
1475
  dispose(): void;
@@ -1473,6 +1509,7 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1473
1509
  private _meshIDColorCodeMap;
1474
1510
  private _currentVisibleMeshes;
1475
1511
  private _recentlyHiddenMeshes;
1512
+ private _intervalID;
1476
1513
  private readonly _transparentMat;
1477
1514
  constructor(components: Components, world: World, settings?: CullerRendererSettings);
1478
1515
  dispose(): void;
@@ -1481,170 +1518,188 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1481
1518
  private handleWorkerMessage;
1482
1519
  private getAvailableMaterial;
1483
1520
  }
1484
- import * as WEBIFC from "web-ifc";
1521
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1485
1522
  import * as THREE from "three";
1486
- export declare class Units {
1487
- factor: number;
1488
- complement: number;
1489
- apply(matrix: THREE.Matrix4): void;
1490
- setUp(webIfc: WEBIFC.IfcAPI): void;
1491
- private getLengthUnits;
1492
- private getScaleMatrix;
1523
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1524
+ import { Components } from "../../Components";
1525
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1526
+ /**
1527
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1528
+ */
1529
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1530
+ readonly onAfterUpdate: Event<unknown>;
1531
+ readonly onBeforeUpdate: Event<unknown>;
1532
+ enabled: boolean;
1533
+ uuid: string;
1534
+ readonly onDisposed: Event<unknown>;
1535
+ private _scene?;
1536
+ private _camera?;
1537
+ private _renderer;
1538
+ get scene(): T;
1539
+ set scene(scene: T);
1540
+ get camera(): U;
1541
+ set camera(camera: U);
1542
+ get renderer(): S | null;
1543
+ set renderer(renderer: S | null);
1544
+ constructor(components: Components);
1545
+ update(delta?: number): void;
1546
+ dispose(disposeResources?: boolean): void;
1493
1547
  }
1494
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1495
- import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1496
- /** Configuration of the IFC-fragment streaming. */
1497
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1498
- minGeometrySize: number;
1499
- minAssetsSize: number;
1548
+ import * as THREE from "three";
1549
+ import { BaseScene, Configurable, Event } from "../../Types";
1550
+ import { Components } from "../../Components";
1551
+ export interface SimpleSceneConfig {
1552
+ directionalLight: {
1553
+ color: THREE.Color;
1554
+ intensity: number;
1555
+ position: THREE.Vector3;
1556
+ };
1557
+ ambientLight: {
1558
+ color: THREE.Color;
1559
+ intensity: number;
1560
+ };
1500
1561
  }
1501
- /** Configuration of the IFC-fragment streaming. */
1502
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1503
- propertiesSize: number;
1562
+ /**
1563
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1564
+ * objects hierarchically, and easily dispose them when you are finished with it.
1565
+ * @noInheritDoc
1566
+ */
1567
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1568
+ /** {@link Configurable.isSetup} */
1569
+ isSetup: boolean;
1570
+ three: THREE.Scene;
1571
+ /** {@link Configurable.onSetup} */
1572
+ readonly onSetup: Event<SimpleScene>;
1573
+ config: Required<SimpleSceneConfig>;
1574
+ constructor(components: Components);
1575
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1576
+ setup(config?: Partial<SimpleSceneConfig>): void;
1504
1577
  }
1505
- import * as WEBIFC from "web-ifc";
1506
- import { Component, Disposable, Event } from "../../../core";
1507
- import { PropertiesStreamingSettings } from "./streaming-settings";
1508
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1509
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1510
- onPropertiesStreamed: Event<{
1511
- type: number;
1512
- data: {
1513
- [id: number]: any;
1514
- };
1515
- }>;
1516
- onProgress: Event<number>;
1517
- onIndicesStreamed: Event<number[][]>;
1518
- /** {@link Disposable.onDisposed} */
1519
- readonly onDisposed: Event<string>;
1578
+ import * as THREE from "three";
1579
+ import { BaseRenderer, Event } from "../../Types";
1580
+ import { Components } from "../../Components";
1581
+ /**
1582
+ * A basic renderer capable of rendering
1583
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1584
+ */
1585
+ export declare class SimpleRenderer extends BaseRenderer {
1586
+ /** {@link Component.enabled} */
1520
1587
  enabled: boolean;
1521
- settings: PropertiesStreamingSettings;
1522
- webIfc: WEBIFC.IfcAPI;
1523
- dispose(): Promise<void>;
1524
- streamFromBuffer(data: Uint8Array): Promise<void>;
1525
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1526
- private readIfcFile;
1527
- private streamIfcFile;
1528
- private streamAllProperties;
1529
- private getIndices;
1530
- private cleanUp;
1588
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1589
+ container: HTMLElement | null;
1590
+ three: THREE.WebGLRenderer;
1591
+ protected _canvas: HTMLCanvasElement;
1592
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1593
+ protected onContainerUpdated: Event<HTMLElement>;
1594
+ constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1595
+ /** {@link Updateable.update} */
1596
+ update(): void;
1597
+ /** {@link Disposable.dispose} */
1598
+ dispose(): void;
1599
+ /** {@link Resizeable.getSize}. */
1600
+ getSize(): THREE.Vector2;
1601
+ /** {@link Resizeable.resize} */
1602
+ resize: (size?: THREE.Vector2) => void;
1603
+ setupEvents(active: boolean): void;
1604
+ private resizeEvent;
1605
+ private setupRenderer;
1606
+ private onContextLost;
1607
+ private onContextBack;
1608
+ private updateContainer;
1531
1609
  }
1532
- import * as WEBIFC from "web-ifc";
1533
- import { Components, Disposable, Event, Component } from "../../../core";
1534
- import { IfcStreamingSettings } from "./streaming-settings";
1535
- import { StreamedGeometries, StreamedAsset } from "./base-types";
1536
- export declare class FragmentIfcStreamConverter extends Component implements Disposable {
1537
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1538
- onGeometryStreamed: Event<{
1539
- buffer: Uint8Array;
1540
- data: StreamedGeometries;
1541
- }>;
1542
- onAssetStreamed: Event<StreamedAsset[]>;
1543
- onProgress: Event<number>;
1544
- onIfcLoaded: Event<Uint8Array>;
1610
+ import * as THREE from "three";
1611
+ import CameraControls from "camera-controls";
1612
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1613
+ import { Components } from "../../Components";
1614
+ /**
1615
+ * A basic camera that uses
1616
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1617
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1618
+ * what features it offers.
1619
+ */
1620
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1621
+ /** {@link Updateable.onBeforeUpdate} */
1622
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1623
+ /** {@link Updateable.onAfterUpdate} */
1624
+ readonly onAfterUpdate: Event<SimpleCamera>;
1625
+ readonly onAspectUpdated: Event<unknown>;
1545
1626
  /** {@link Disposable.onDisposed} */
1546
- readonly onDisposed: Event<unknown>;
1547
- settings: IfcStreamingSettings;
1548
- enabled: boolean;
1549
- webIfc: WEBIFC.IfcAPI;
1550
- private _spatialTree;
1551
- private _metaData;
1552
- private _visitedGeometries;
1553
- private _streamSerializer;
1554
- private _geometries;
1555
- private _geometryCount;
1556
- private _civil;
1557
- private _groupSerializer;
1558
- private _assets;
1559
- private _meshesWithHoles;
1627
+ readonly onDisposed: Event<string>;
1628
+ readonly three: THREE.PerspectiveCamera;
1629
+ private _allControls;
1630
+ /**
1631
+ * The object that controls the camera. An instance of
1632
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1633
+ * Transforming the camera directly will have no effect: you need to use this
1634
+ * object to move, rotate, look at objects, etc.
1635
+ */
1636
+ get controls(): CameraControls;
1637
+ /** {@link Component.enabled} */
1638
+ get enabled(): boolean;
1639
+ /** {@link Component.enabled} */
1640
+ set enabled(enabled: boolean);
1560
1641
  constructor(components: Components);
1642
+ /** {@link Disposable.dispose} */
1561
1643
  dispose(): void;
1562
- streamFromBuffer(data: Uint8Array): Promise<void>;
1563
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1564
- private readIfcFile;
1565
- private streamIfcFile;
1566
- private streamAllGeometries;
1567
- private cleanUp;
1568
- private getMesh;
1569
- private getGeometry;
1570
- private streamAssets;
1571
- private streamGeometries;
1572
- }
1573
- export interface StreamedGeometries {
1574
- [id: number]: {
1575
- boundingBox: Float32Array;
1576
- hasHoles: boolean;
1577
- geometryFile?: string;
1578
- };
1579
- }
1580
- export interface StreamedAsset {
1581
- id: number;
1582
- geometries: {
1583
- geometryID: number;
1584
- transformation: number[];
1585
- color: number[];
1586
- }[];
1644
+ /** {@link Updateable.update} */
1645
+ update(_delta: number): void;
1646
+ /**
1647
+ * Updates the aspect of the camera to match the size of the
1648
+ * {@link Components.renderer}.
1649
+ */
1650
+ updateAspect: () => void;
1651
+ private setupCamera;
1652
+ private newCameraControls;
1653
+ private setupEvents;
1654
+ private static getSubsetOfThree;
1587
1655
  }
1656
+ /// <reference types="node" />
1588
1657
  import * as THREE from "three";
1589
- import { Hideable, Disposable, Event, World } from "../../Types";
1658
+ import { Hideable, Event, World } from "../../Types";
1590
1659
  import { Components } from "../../Components";
1660
+ export interface GridConfig {
1661
+ color: THREE.Color;
1662
+ size1: number;
1663
+ size2: number;
1664
+ distance: number;
1665
+ }
1591
1666
  /**
1592
- * Each of the planes created by {@link SimpleClipper}.
1667
+ * An infinite grid. Created by
1668
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1669
+ * and translated to typescript by
1670
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1593
1671
  */
1594
- export declare class SimplePlane implements Disposable, Hideable {
1595
- /** Event that fires when the user starts dragging a clipping plane. */
1596
- readonly onDraggingStarted: Event<unknown>;
1597
- /** Event that fires when the user stops dragging a clipping plane. */
1598
- readonly onDraggingEnded: Event<unknown>;
1672
+ export declare class SimpleGrid implements Hideable, Disposable {
1599
1673
  /** {@link Disposable.onDisposed} */
1600
1674
  readonly onDisposed: Event<unknown>;
1601
- readonly normal: THREE.Vector3;
1602
- readonly origin: THREE.Vector3;
1603
- readonly three: THREE.Plane;
1604
- protected readonly _helper: THREE.Object3D;
1605
- protected _visible: boolean;
1606
- protected _enabled: boolean;
1607
- components: Components;
1608
1675
  world: World;
1609
- private _controlsActive;
1610
- private readonly _arrowBoundBox;
1611
- private readonly _planeMesh;
1612
- private readonly _controls;
1613
- private readonly _hiddenMaterial;
1614
- get enabled(): boolean;
1615
- /** {@link Component.enabled} */
1616
- set enabled(state: boolean);
1617
- /** {@link Hideable.visible } */
1676
+ components: Components;
1677
+ /** {@link Hideable.visible} */
1618
1678
  get visible(): boolean;
1619
- /** {@link Hideable.visible } */
1620
- set visible(state: boolean);
1621
- /** The meshes used for raycasting */
1622
- get meshes(): THREE.Mesh[];
1623
- /** The material of the clipping plane representation. */
1624
- get planeMaterial(): THREE.Material | THREE.Material[];
1625
- /** The material of the clipping plane representation. */
1626
- set planeMaterial(material: THREE.Material | THREE.Material[]);
1627
- /** The size of the clipping plane representation. */
1628
- get size(): number;
1629
- /** Sets the size of the clipping plane representation. */
1630
- set size(size: number);
1631
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1632
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1633
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
1634
- /** {@link Updateable.update} */
1635
- update: () => Promise<void>;
1679
+ /** {@link Hideable.visible} */
1680
+ set visible(visible: boolean);
1681
+ /** The material of the grid. */
1682
+ get material(): THREE.ShaderMaterial;
1683
+ /**
1684
+ * Whether the grid should fade away with distance. Recommended to be true for
1685
+ * perspective cameras and false for orthographic cameras.
1686
+ */
1687
+ get fade(): boolean;
1688
+ /**
1689
+ * Whether the grid should fade away with distance. Recommended to be true for
1690
+ * perspective cameras and false for orthographic cameras.
1691
+ */
1692
+ set fade(active: boolean);
1693
+ private readonly _grid;
1694
+ private _fade;
1695
+ constructor(components: Components, world: World, config: GridConfig);
1696
+ [Symbol.dispose](): void;
1697
+ /** {@link Component.get} */
1698
+ get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
1636
1699
  /** {@link Disposable.dispose} */
1637
1700
  dispose(): void;
1638
- private reset;
1639
- protected toggleControls(state: boolean): void;
1640
- private newTransformControls;
1641
- private initializeControls;
1642
- private createArrowBoundingBox;
1643
- private changeDrag;
1644
- private notifyDraggingChanged;
1645
- private preventCameraMovement;
1646
- private newHelper;
1647
- private static newPlaneMesh;
1701
+ private setupEvents;
1702
+ private updateZoom;
1648
1703
  }
1649
1704
  import { NavigationMode } from "./types";
1650
1705
  /**
@@ -1662,6 +1717,42 @@ export declare class OrbitMode implements NavigationMode {
1662
1717
  set(active: boolean): void;
1663
1718
  private activateOrbitControls;
1664
1719
  }
1720
+ import { NavigationMode } from "./types";
1721
+ /**
1722
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1723
+ * like many BIM tools.
1724
+ */
1725
+ export declare class PlanMode implements NavigationMode {
1726
+ private camera;
1727
+ /** {@link NavigationMode.enabled} */
1728
+ enabled: boolean;
1729
+ /** {@link NavigationMode.id} */
1730
+ readonly id = "Plan";
1731
+ private mouseAction1?;
1732
+ private mouseAction2?;
1733
+ private mouseInitialized;
1734
+ private readonly defaultAzimuthSpeed;
1735
+ private readonly defaultPolarSpeed;
1736
+ constructor(camera: any);
1737
+ /** {@link NavigationMode.set} */
1738
+ set(active: boolean): void;
1739
+ }
1740
+ import { NavigationMode } from "./types";
1741
+ /**
1742
+ * A {@link NavigationMode} that allows first person navigation,
1743
+ * simulating FPS video games.
1744
+ */
1745
+ export declare class FirstPersonMode implements NavigationMode {
1746
+ private camera;
1747
+ /** {@link NavigationMode.enabled} */
1748
+ enabled: boolean;
1749
+ /** {@link NavigationMode.id} */
1750
+ readonly id = "FirstPerson";
1751
+ constructor(camera: any);
1752
+ /** {@link NavigationMode.set} */
1753
+ set(active: boolean): void;
1754
+ private setupFirstPersonCamera;
1755
+ }
1665
1756
  import * as THREE from "three";
1666
1757
  import { CameraProjection } from "./types";
1667
1758
  import { Event } from "../../../core";
@@ -1699,26 +1790,6 @@ export declare class ProjectionManager {
1699
1790
  private getDistance;
1700
1791
  private setPerspectiveCamera;
1701
1792
  }
1702
- import { NavigationMode } from "./types";
1703
- /**
1704
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1705
- * like many BIM tools.
1706
- */
1707
- export declare class PlanMode implements NavigationMode {
1708
- private camera;
1709
- /** {@link NavigationMode.enabled} */
1710
- enabled: boolean;
1711
- /** {@link NavigationMode.id} */
1712
- readonly id = "Plan";
1713
- private mouseAction1?;
1714
- private mouseAction2?;
1715
- private mouseInitialized;
1716
- private readonly defaultAzimuthSpeed;
1717
- private readonly defaultPolarSpeed;
1718
- constructor(camera: any);
1719
- /** {@link NavigationMode.set} */
1720
- set(active: boolean): void;
1721
- }
1722
1793
  /**
1723
1794
  * The projection system of the camera.
1724
1795
  */
@@ -1746,21 +1817,61 @@ export interface NavigationMode {
1746
1817
  /** Whether this navigation mode is active or not. */
1747
1818
  enabled: boolean;
1748
1819
  }
1749
- import { NavigationMode } from "./types";
1750
- /**
1751
- * A {@link NavigationMode} that allows first person navigation,
1752
- * simulating FPS video games.
1753
- */
1754
- export declare class FirstPersonMode implements NavigationMode {
1755
- private camera;
1756
- /** {@link NavigationMode.enabled} */
1757
- enabled: boolean;
1758
- /** {@link NavigationMode.id} */
1759
- readonly id = "FirstPerson";
1760
- constructor(camera: any);
1761
- /** {@link NavigationMode.set} */
1762
- set(active: boolean): void;
1763
- private setupFirstPersonCamera;
1820
+ import * as WEBIFC from "web-ifc";
1821
+ /** Configuration of the IFC-fragment conversion. */
1822
+ export declare class IfcFragmentSettings {
1823
+ /** Whether to extract the IFC properties into a JSON. */
1824
+ includeProperties: boolean;
1825
+ /**
1826
+ * Generate the geometry for categories that are not included by default,
1827
+ * like IFCSPACE.
1828
+ */
1829
+ optionalCategories: number[];
1830
+ /** Whether to use the coordination data coming from the IFC files. */
1831
+ coordinate: boolean;
1832
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1833
+ wasm: {
1834
+ path: string;
1835
+ absolute: boolean;
1836
+ logLevel?: WEBIFC.LogLevel;
1837
+ };
1838
+ /** List of categories that won't be converted to fragments. */
1839
+ excludedCategories: Set<number>;
1840
+ /** Whether to save the absolute location of all IFC items. */
1841
+ saveLocations: boolean;
1842
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1843
+ webIfc: WEBIFC.LoaderSettings;
1844
+ autoSetWasm: boolean;
1845
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1846
+ }
1847
+ import * as WEBIFC from "web-ifc";
1848
+ export declare class IfcMetadataReader {
1849
+ get(webIfc: WEBIFC.IfcAPI, type: number): string;
1850
+ }
1851
+ import * as THREE from "three";
1852
+ import * as WEBIFC from "web-ifc";
1853
+ import * as FRAGS from "@thatopen/fragments";
1854
+ export declare class CivilReader {
1855
+ defLineMat: THREE.LineBasicMaterial;
1856
+ read(webIfc: WEBIFC.IfcAPI): {
1857
+ alignments: Map<number, FRAGS.Alignment>;
1858
+ coordinationMatrix: THREE.Matrix4;
1859
+ } | undefined;
1860
+ get(civilItems: any): {
1861
+ alignments: Map<number, FRAGS.Alignment>;
1862
+ coordinationMatrix: THREE.Matrix4;
1863
+ } | undefined;
1864
+ private getCurves;
1865
+ }
1866
+ import * as WEBIFC from "web-ifc";
1867
+ import * as THREE from "three";
1868
+ export declare class Units {
1869
+ factor: number;
1870
+ complement: number;
1871
+ apply(matrix: THREE.Matrix4): void;
1872
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1873
+ private getLengthUnits;
1874
+ private getScaleMatrix;
1764
1875
  }
1765
1876
  import { BufferGeometry } from "three";
1766
1877
  import * as THREE from "three";