@thatopen/components 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/namespace.d.ts +1182 -1182
  2. package/package.json +3 -3
@@ -1,55 +1,4 @@
1
1
  declare namespace OBC {
2
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
3
- import { Components } from "../Components";
4
- import { SimpleWorld } from "./src";
5
- export declare class Worlds extends Component implements Updateable, Disposable {
6
- /**
7
- * A unique identifier for the component.
8
- * This UUID is used to register the component within the Components system.
9
- */
10
- static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
11
- /**
12
- * Event triggered after the update process of all worlds.
13
- * Subscribers can listen to this event to perform actions post-update.
14
- */
15
- readonly onAfterUpdate: Event<unknown>;
16
- /**
17
- * Event triggered before the update process of all worlds.
18
- * Subscribers can listen to this event to perform actions pre-update.
19
- */
20
- readonly onBeforeUpdate: Event<unknown>;
21
- /**
22
- * Event triggered when the Worlds component is disposed.
23
- * Subscribers can listen to this event to perform cleanup actions.
24
- */
25
- readonly onDisposed: Event<unknown>;
26
- readonly onWorldCreated: Event<World>;
27
- readonly onWorldDeleted: Event<string>;
28
- /**
29
- * A collection of worlds managed by this component.
30
- * The key is the unique identifier (UUID) of the world, and the value is the World instance.
31
- */
32
- list: Map<string, World>;
33
- /**
34
- * A flag indicating whether the Worlds component is enabled.
35
- * If false, the update process will be skipped.
36
- */
37
- enabled: boolean;
38
- constructor(components: Components);
39
- /**
40
- * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
41
- *
42
- * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
43
- * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
44
- * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
45
- *
46
- * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
47
- */
48
- create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
49
- delete(world: World): void;
50
- dispose(): void;
51
- update(delta?: number): void | Promise<void>;
52
- }
53
2
  import { Component, Disposable, World, Event } from "../Types";
54
3
  import { SimpleRaycaster } from "./src";
55
4
  import { Components } from "../Components";
@@ -63,6 +12,21 @@ export declare class Raycasters extends Component implements Disposable {
63
12
  delete(world: World): void;
64
13
  dispose(): void;
65
14
  }
15
+ import { Component, Disposable, World, Event } from "../Types";
16
+ import { GridConfig, SimpleGrid } from "./src";
17
+ import { Components } from "../Components";
18
+ export declare class Grids extends Component implements Disposable {
19
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
20
+ list: Map<string, SimpleGrid>;
21
+ readonly onDisposed: Event<unknown>;
22
+ config: Required<GridConfig>;
23
+ /** {@link Component.enabled} */
24
+ enabled: boolean;
25
+ constructor(components: Components);
26
+ create(world: World): SimpleGrid;
27
+ delete(world: World): void;
28
+ dispose(): void;
29
+ }
66
30
  import { Component, Disposable, Event } from "../Types";
67
31
  /**
68
32
  * The entry point of the Components library.
@@ -115,72 +79,72 @@ export declare class Components implements Disposable {
115
79
  private update;
116
80
  private static setupBVH;
117
81
  }
118
- import { Component, Disposable, World, Event } from "../Types";
119
- import { GridConfig, SimpleGrid } from "./src";
82
+ import { MiniMap } from "./src";
83
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
120
84
  import { Components } from "../Components";
121
- export declare class Grids extends Component implements Disposable {
122
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
123
- list: Map<string, SimpleGrid>;
85
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
86
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
87
+ readonly onAfterUpdate: Event<unknown>;
88
+ readonly onBeforeUpdate: Event<unknown>;
124
89
  readonly onDisposed: Event<unknown>;
125
- config: Required<GridConfig>;
126
- /** {@link Component.enabled} */
127
90
  enabled: boolean;
91
+ list: Map<string, MiniMap>;
128
92
  constructor(components: Components);
129
- create(world: World): SimpleGrid;
130
- delete(world: World): void;
93
+ create(world: World): MiniMap;
94
+ delete(id: string): void;
131
95
  dispose(): void;
96
+ update(): void;
132
97
  }
98
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
133
99
  import { Components } from "../Components";
134
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
135
- import { Component, Event, Disposable, World } from "../Types";
136
- /**
137
- * A tool to handle big scenes efficiently by automatically hiding the objects
138
- * that are not visible to the camera.
139
- */
140
- export declare class Cullers extends Component implements Disposable {
100
+ import { SimpleWorld } from "./src";
101
+ export declare class Worlds extends Component implements Updateable, Disposable {
141
102
  /**
142
- * A unique identifier for the Cullers component.
103
+ * A unique identifier for the component.
104
+ * This UUID is used to register the component within the Components system.
143
105
  */
144
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
106
+ static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
145
107
  /**
146
- * Indicates whether the Cullers component is enabled.
108
+ * Event triggered after the update process of all worlds.
109
+ * Subscribers can listen to this event to perform actions post-update.
147
110
  */
148
- private _enabled;
111
+ readonly onAfterUpdate: Event<unknown>;
149
112
  /**
150
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
113
+ * Event triggered before the update process of all worlds.
114
+ * Subscribers can listen to this event to perform actions pre-update.
151
115
  */
152
- list: Map<string, MeshCullerRenderer>;
116
+ readonly onBeforeUpdate: Event<unknown>;
153
117
  /**
154
- * An event that is triggered when the Cullers component is disposed.
118
+ * Event triggered when the Worlds component is disposed.
119
+ * Subscribers can listen to this event to perform cleanup actions.
155
120
  */
156
121
  readonly onDisposed: Event<unknown>;
122
+ readonly onWorldCreated: Event<World>;
123
+ readonly onWorldDeleted: Event<string>;
157
124
  /**
158
- * Gets the enabled state of the Cullers component.
159
- *
160
- * @returns The current enabled state.
125
+ * A collection of worlds managed by this component.
126
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
161
127
  */
162
- get enabled(): boolean;
128
+ list: Map<string, World>;
163
129
  /**
164
- * Sets the enabled state of the Cullers component.
165
- * Also sets the enabled state of all MeshCullerRenderer instances.
166
- *
167
- * @param value - The new enabled state.
130
+ * A flag indicating whether the Worlds component is enabled.
131
+ * If false, the update process will be skipped.
168
132
  */
169
- set enabled(value: boolean);
133
+ enabled: boolean;
170
134
  constructor(components: Components);
171
135
  /**
172
- * Creates a new MeshCullerRenderer for the given world.
173
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
174
- *
175
- * @param world - The world for which to create the MeshCullerRenderer.
176
- * @param config - Optional configuration settings for the MeshCullerRenderer.
177
- *
178
- * @returns The newly created or existing MeshCullerRenderer for the given world.
179
- */
180
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
136
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
137
+ *
138
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
139
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
140
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
141
+ *
142
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
143
+ */
144
+ create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
181
145
  delete(world: World): void;
182
- /** {@link Disposable.dispose} */
183
146
  dispose(): void;
147
+ update(delta?: number): void | Promise<void>;
184
148
  }
185
149
  import * as THREE from "three";
186
150
  import { Components } from "../Components";
@@ -276,6 +240,65 @@ export declare class Disposer extends Component {
276
240
  private disposeChildren;
277
241
  private static disposeMaterial;
278
242
  }
243
+ import { Components } from "../Components";
244
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
245
+ import { Component, Event, Disposable, World } from "../Types";
246
+ /**
247
+ * A tool to handle big scenes efficiently by automatically hiding the objects
248
+ * that are not visible to the camera.
249
+ */
250
+ export declare class Cullers extends Component implements Disposable {
251
+ /**
252
+ * A unique identifier for the Cullers component.
253
+ */
254
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
255
+ /**
256
+ * Indicates whether the Cullers component is enabled.
257
+ */
258
+ private _enabled;
259
+ /**
260
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
261
+ */
262
+ list: Map<string, MeshCullerRenderer>;
263
+ /**
264
+ * An event that is triggered when the Cullers component is disposed.
265
+ */
266
+ readonly onDisposed: Event<unknown>;
267
+ /**
268
+ * Gets the enabled state of the Cullers component.
269
+ *
270
+ * @returns The current enabled state.
271
+ */
272
+ get enabled(): boolean;
273
+ /**
274
+ * Sets the enabled state of the Cullers component.
275
+ * Also sets the enabled state of all MeshCullerRenderer instances.
276
+ *
277
+ * @param value - The new enabled state.
278
+ */
279
+ set enabled(value: boolean);
280
+ constructor(components: Components);
281
+ /**
282
+ * Creates a new MeshCullerRenderer for the given world.
283
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
284
+ *
285
+ * @param world - The world for which to create the MeshCullerRenderer.
286
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
287
+ *
288
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
289
+ */
290
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
291
+ delete(world: World): void;
292
+ /** {@link Disposable.dispose} */
293
+ dispose(): void;
294
+ }
295
+ import * as THREE from "three";
296
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
297
+ center: THREE.Vector3;
298
+ halfSizes: THREE.Vector3;
299
+ rotation: THREE.Matrix3;
300
+ transformation: THREE.Matrix4;
301
+ };
279
302
  import * as THREE from "three";
280
303
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
281
304
  import { SimplePlane } from "./src";
@@ -375,45 +398,217 @@ export declare class Clipper extends Component implements Createable, Disposable
375
398
  private _onStartDragging;
376
399
  private _onEndDragging;
377
400
  }
378
- import { MiniMap } from "./src";
379
- import { Component, Updateable, World, Event, Disposable } from "../Types";
380
- import { Components } from "../Components";
381
- export declare class MiniMaps extends Component implements Updateable, Disposable {
382
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
383
- readonly onAfterUpdate: Event<unknown>;
384
- readonly onBeforeUpdate: Event<unknown>;
385
- readonly onDisposed: Event<unknown>;
386
- enabled: boolean;
387
- list: Map<string, MiniMap>;
388
- constructor(components: Components);
389
- create(world: World): MiniMap;
390
- delete(id: string): void;
391
- dispose(): void;
392
- update(): void;
401
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
402
+ import * as THREE from "three";
403
+ export declare class MaterialsUtils {
404
+ static isTransparent(material: THREE.Material): boolean;
393
405
  }
394
- import * as WEBIFC from "web-ifc";
395
- import * as FRAG from "@thatopen/fragments";
396
- import { Component, Components } from "../../core";
397
- /**
398
- * Object to export all the properties from an IFC to a JS object.
399
- */
400
- export declare class IfcJsonExporter extends Component {
401
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
402
- /** {@link Component.enabled} */
403
- enabled: boolean;
404
- constructor(components: Components);
405
- /**
406
- * Exports all the properties of an IFC into an array of JS objects.
407
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
408
- * @param modelID ID of the IFC model whose properties to extract.
409
- * @param indirect whether to get the indirect relationships as well.
410
- * @param recursiveSpatial whether to get the properties of spatial items recursively
411
- * to make the location data available (e.g. absolute position of building).
412
- */
413
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
406
+ import * as THREE from "three";
407
+ import { Component, Components, Event, World } from "../core";
408
+ export interface VertexPickerConfig {
409
+ showOnlyVertex: boolean;
410
+ snapDistance: number;
411
+ previewElement: HTMLElement;
414
412
  }
415
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
416
- import * as WEBIFC from "web-ifc";
413
+ export declare class VertexPicker extends Component {
414
+ onVertexFound: Event<THREE.Vector3>;
415
+ onVertexLost: Event<THREE.Vector3>;
416
+ components: Components;
417
+ private _pickedPoint;
418
+ private _config;
419
+ private _enabled;
420
+ private _workingPlane;
421
+ set enabled(value: boolean);
422
+ get enabled(): boolean;
423
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
424
+ set workingPlane(plane: THREE.Plane | null);
425
+ get workingPlane(): THREE.Plane | null;
426
+ set config(value: Partial<VertexPickerConfig>);
427
+ get config(): Partial<VertexPickerConfig>;
428
+ dispose(): void;
429
+ get(world: World): THREE.Vector3 | null;
430
+ private getClosestVertex;
431
+ private getVertices;
432
+ private getVertex;
433
+ }
434
+ import * as THREE from "three";
435
+ import { Component, Components } from "../../core";
436
+ export interface MeasureEdge {
437
+ distance: number;
438
+ points: THREE.Vector3[];
439
+ }
440
+ export declare class MeasurementUtils extends Component {
441
+ enabled: boolean;
442
+ static uuid: string;
443
+ constructor(components: Components);
444
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
445
+ edges: MeasureEdge[];
446
+ indices: Set<number>;
447
+ } | null;
448
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
449
+ private getFaceData;
450
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
451
+ p1: THREE.Vector3;
452
+ p2: THREE.Vector3;
453
+ p3: THREE.Vector3;
454
+ faceNormal: THREE.Vector3;
455
+ };
456
+ private round;
457
+ }
458
+ import * as WEBIFC from "web-ifc";
459
+ import * as FRAG from "@thatopen/fragments";
460
+ import { Component, Components } from "../../core";
461
+ /**
462
+ * Object to export all the properties from an IFC to a JS object.
463
+ */
464
+ export declare class IfcJsonExporter extends Component {
465
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
466
+ /** {@link Component.enabled} */
467
+ enabled: boolean;
468
+ constructor(components: Components);
469
+ /**
470
+ * Exports all the properties of an IFC into an array of JS objects.
471
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
472
+ * @param modelID ID of the IFC model whose properties to extract.
473
+ * @param indirect whether to get the indirect relationships as well.
474
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
475
+ * to make the location data available (e.g. absolute position of building).
476
+ */
477
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
478
+ }
479
+ import * as WEBIFC from "web-ifc";
480
+ import { FragmentsGroup } from "@thatopen/fragments";
481
+ import { Disposable, Event, Component, Components } from "../../core";
482
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
483
+ /**
484
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
485
+ * It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
486
+ */
487
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
488
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
489
+ /** {@link Disposable.onDisposed} */
490
+ readonly onDisposed: Event<string>;
491
+ enabled: boolean;
492
+ readonly onRelationsIndexed: Event<{
493
+ modelID: string;
494
+ relationsMap: RelationsMap;
495
+ }>;
496
+ private _relToAttributesMap;
497
+ private _inverseAttributes;
498
+ private _ifcRels;
499
+ /**
500
+ * Holds the relationship mappings for each model processed by the indexer.
501
+ * The structure is a map where each key is a model's UUID, and the value is another map.
502
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
503
+ * representing a specific relation type, and the value is an array of expressIDs of entities
504
+ * that are related through that relation type. This structure allows for efficient querying
505
+ * of entity relationships within a model.
506
+ */
507
+ readonly relationMaps: ModelsRelationMap;
508
+ constructor(components: Components);
509
+ private onFragmentsDisposed;
510
+ /**
511
+ * Adds a relation map to the model's relations map.
512
+ *
513
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
514
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
515
+ *
516
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
517
+ */
518
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
519
+ /**
520
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
521
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
522
+ * and maps them in a structured way to facilitate quick access to related entities.
523
+ *
524
+ * The process involves querying the model for each relation type associated with the inverse attributes
525
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
526
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
527
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
528
+ * of entities that are related through that attribute.
529
+ *
530
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
531
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
532
+ * representation of the relations indexed by entity expressIDs and relation types.
533
+ * @throws An error if the model does not have properties loaded.
534
+ */
535
+ process(model: FragmentsGroup): Promise<RelationsMap>;
536
+ /**
537
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
538
+ *
539
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
540
+ * @param modelID - The unique identifier of the model within the WebIfc API.
541
+ * @returns A promise that resolves to the relations map for the processed model.
542
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
543
+ */
544
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
545
+ /**
546
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
547
+ * This method searches the indexed relation maps for the specified model and entity,
548
+ * returning the IDs of related entities if a match is found.
549
+ *
550
+ * @param model The 'FragmentsGroup' model containing the entity.
551
+ * @param expressID The unique identifier of the entity within the model.
552
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
553
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
554
+ * or the specified relation name is not indexed.
555
+ */
556
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
557
+ /**
558
+ * Serializes the relations of a given relation map into a JSON string.
559
+ * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
560
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
561
+ * The resulting object is then serialized into a JSON string.
562
+ *
563
+ * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
564
+ * @returns A JSON string representing the serialized relations of the given relation map.
565
+ */
566
+ serializeRelations(relationMap: RelationsMap): string;
567
+ /**
568
+ * Serializes the relations of a specific model into a JSON string.
569
+ * This method iterates through the relations indexed for the given model,
570
+ * organizing them into a structured object where each key is an expressID of an entity,
571
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
572
+ * The resulting object is then serialized into a JSON string.
573
+ *
574
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
575
+ * @returns A JSON string representing the serialized relations of the specified model.
576
+ * If the model has no indexed relations, 'null' is returned.
577
+ */
578
+ serializeModelRelations(model: FragmentsGroup): string | null;
579
+ /**
580
+ * Serializes all relations of every model processed by the indexer into a JSON string.
581
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
582
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
583
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
584
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
585
+ *
586
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
587
+ * If no relations have been indexed, an empty object is returned as a JSON string.
588
+ */
589
+ serializeAllRelations(): string;
590
+ /**
591
+ * Converts a JSON string representing relations between entities into a structured map.
592
+ * This method parses the JSON string to reconstruct the relations map that indexes
593
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
594
+ * and the values are maps where each key is a relation type ID and its value is an array
595
+ * of express IDs of entities related through that relation type.
596
+ *
597
+ * @param json The JSON string to be parsed into the relations map.
598
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
599
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
600
+ * is an array of express IDs (as numbers) of entities related through that relation type.
601
+ */
602
+ getRelationsMapFromJSON(json: string): RelationsMap;
603
+ /**
604
+ * Disposes the component, cleaning up resources and detaching event listeners.
605
+ * This ensures that the component is properly cleaned up and does not leave behind any
606
+ * references that could prevent garbage collection.
607
+ */
608
+ dispose(): void;
609
+ }
610
+ export type { InverseAttribute } from "./src/types";
611
+ import * as WEBIFC from "web-ifc";
417
612
  import { FragmentsGroup } from "@thatopen/fragments";
418
613
  import { Component, Disposable, Event, Components } from "../../core";
419
614
  type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
@@ -485,20 +680,6 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
485
680
  setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
486
681
  }
487
682
  export {};
488
- import * as FRAGS from "@thatopen/fragments";
489
- import { Components, Component } from "../../core";
490
- export declare class Hider extends Component {
491
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
492
- enabled: boolean;
493
- constructor(components: Components);
494
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
495
- isolate(items: FRAGS.FragmentIdMap): void;
496
- private updateCulledVisibility;
497
- }
498
- import * as THREE from "three";
499
- export declare class MaterialsUtils {
500
- static isTransparent(material: THREE.Material): boolean;
501
- }
502
683
  import * as THREE from "three";
503
684
  import * as FRAGS from "@thatopen/fragments";
504
685
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -566,43 +747,91 @@ export declare class Classifier extends Component implements Disposable {
566
747
  resetColor(items: FRAGS.FragmentIdMap): void;
567
748
  protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
568
749
  }
569
- import * as THREE from "three";
570
- import { Component, Components } from "../../core";
571
- export interface MeasureEdge {
572
- distance: number;
573
- points: THREE.Vector3[];
574
- }
575
- export declare class MeasurementUtils extends Component {
750
+ import { Component, Disposable, Event, Components } from "../../core";
751
+ export declare class Exploder extends Component implements Disposable {
752
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
576
753
  enabled: boolean;
577
- static uuid: string;
754
+ height: number;
755
+ groupName: string;
756
+ /** {@link Disposable.onDisposed} */
757
+ readonly onDisposed: Event<unknown>;
758
+ list: Set<string>;
578
759
  constructor(components: Components);
579
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
580
- edges: MeasureEdge[];
581
- indices: Set<number>;
582
- } | null;
583
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
584
- private getFaceData;
585
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
586
- p1: THREE.Vector3;
587
- p2: THREE.Vector3;
588
- p3: THREE.Vector3;
589
- faceNormal: THREE.Vector3;
590
- };
591
- private round;
760
+ dispose(): void;
761
+ set(active: boolean): void;
592
762
  }
593
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
594
- import * as THREE from "three";
595
763
  import * as FRAGS from "@thatopen/fragments";
596
- import { Component, Components, Event, Disposable } from "../../core";
597
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
598
- /**
599
- * Object that can efficiently load binary files that contain
600
- * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
601
- */
602
- export declare class FragmentsManager extends Component implements Disposable {
603
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
604
- /** {@link Disposable.onDisposed} */
605
- readonly onDisposed: Event<unknown>;
764
+ import { Components, Component } from "../../core";
765
+ export declare class Hider extends Component {
766
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
767
+ enabled: boolean;
768
+ constructor(components: Components);
769
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
770
+ isolate(items: FRAGS.FragmentIdMap): void;
771
+ private updateCulledVisibility;
772
+ }
773
+ export declare class UUID {
774
+ private static _pattern;
775
+ private static _lut;
776
+ static create(): string;
777
+ static validate(uuid: string): void;
778
+ }
779
+ import * as WEBIFC from "web-ifc";
780
+ import { Components, Disposable, Event, Component } from "../../core";
781
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
782
+ export declare class IfcGeometryTiler extends Component implements Disposable {
783
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
784
+ onGeometryStreamed: Event<{
785
+ buffer: Uint8Array;
786
+ data: StreamedGeometries;
787
+ }>;
788
+ onAssetStreamed: Event<StreamedAsset[]>;
789
+ onProgress: Event<number>;
790
+ onIfcLoaded: Event<Uint8Array>;
791
+ /** {@link Disposable.onDisposed} */
792
+ readonly onDisposed: Event<unknown>;
793
+ settings: IfcStreamingSettings;
794
+ enabled: boolean;
795
+ webIfc: WEBIFC.IfcAPI;
796
+ private _spatialTree;
797
+ private _metaData;
798
+ private _visitedGeometries;
799
+ private _streamSerializer;
800
+ private _geometries;
801
+ private _geometryCount;
802
+ private _civil;
803
+ private _groupSerializer;
804
+ private _assets;
805
+ private _meshesWithHoles;
806
+ constructor(components: Components);
807
+ dispose(): void;
808
+ streamFromBuffer(data: Uint8Array): Promise<void>;
809
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
810
+ private readIfcFile;
811
+ private streamIfcFile;
812
+ private streamAllGeometries;
813
+ private cleanUp;
814
+ private getMesh;
815
+ private getGeometry;
816
+ private streamAssets;
817
+ private streamGeometries;
818
+ }
819
+ export declare const IfcCategoryMap: {
820
+ [key: number]: string;
821
+ };
822
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
823
+ import * as THREE from "three";
824
+ import * as FRAGS from "@thatopen/fragments";
825
+ import { Component, Components, Event, Disposable } from "../../core";
826
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
827
+ /**
828
+ * Object that can efficiently load binary files that contain
829
+ * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
830
+ */
831
+ export declare class FragmentsManager extends Component implements Disposable {
832
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
833
+ /** {@link Disposable.onDisposed} */
834
+ readonly onDisposed: Event<unknown>;
606
835
  readonly onFragmentsLoaded: Event<FragmentsGroup>;
607
836
  readonly onFragmentsDisposed: Event<{
608
837
  groupID: string;
@@ -643,6 +872,67 @@ export declare class FragmentsManager extends Component implements Disposable {
643
872
  coordinate(models?: FragmentsGroup[]): void;
644
873
  }
645
874
  import * as WEBIFC from "web-ifc";
875
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
876
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
877
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
878
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
879
+ onPropertiesStreamed: AsyncEvent<{
880
+ type: number;
881
+ data: {
882
+ [id: number]: any;
883
+ };
884
+ }>;
885
+ onProgress: AsyncEvent<number>;
886
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
887
+ /** {@link Disposable.onDisposed} */
888
+ readonly onDisposed: Event<string>;
889
+ enabled: boolean;
890
+ settings: PropertiesStreamingSettings;
891
+ webIfc: WEBIFC.IfcAPI;
892
+ dispose(): Promise<void>;
893
+ streamFromBuffer(data: Uint8Array): Promise<void>;
894
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
895
+ private readIfcFile;
896
+ private streamIfcFile;
897
+ private streamAllProperties;
898
+ private cleanUp;
899
+ }
900
+ export declare const IfcElements: {
901
+ [key: number]: string;
902
+ };
903
+ import * as WEBIFC from "web-ifc";
904
+ export interface IfcItemsCategories {
905
+ [itemID: number]: number;
906
+ }
907
+ export declare class IfcCategories {
908
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
909
+ }
910
+ import * as FRAGS from "@thatopen/fragments";
911
+ export declare class IfcPropertiesUtils {
912
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
913
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
914
+ [attribute: string]: any;
915
+ } | null>;
916
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
917
+ [relatingID: number]: number[];
918
+ }>;
919
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
920
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
921
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
922
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
923
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
924
+ key: string | null;
925
+ name: string | null;
926
+ }>;
927
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
928
+ key: string | null;
929
+ value: number | null;
930
+ }>;
931
+ static isRel(expressID: number): boolean;
932
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
933
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
934
+ }
935
+ import * as WEBIFC from "web-ifc";
646
936
  import * as FRAGS from "@thatopen/fragments";
647
937
  import { IfcFragmentSettings } from "./src";
648
938
  import { Component, Components, Event, Disposable } from "../../core";
@@ -673,439 +963,557 @@ export declare class IfcLoader extends Component implements Disposable {
673
963
  private getGeometry;
674
964
  private autoSetWasm;
675
965
  }
676
- import { Component, Disposable, Event, Components } from "../../core";
677
- export declare class Exploder extends Component implements Disposable {
678
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
679
- enabled: boolean;
680
- height: number;
681
- groupName: string;
966
+ export declare const GeometryTypes: Set<number>;
967
+ import { InverseAttribute } from "./types";
968
+ export declare const relToAttributesMap: Map<number, {
969
+ forRelating: InverseAttribute;
970
+ forRelated: InverseAttribute;
971
+ }>;
972
+ import * as THREE from "three";
973
+ import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
974
+ export declare class MiniMap implements Resizeable, Updateable, Disposable {
682
975
  /** {@link Disposable.onDisposed} */
683
976
  readonly onDisposed: Event<unknown>;
684
- list: Set<string>;
685
- constructor(components: Components);
977
+ readonly onAfterUpdate: Event<unknown>;
978
+ readonly onBeforeUpdate: Event<unknown>;
979
+ readonly onResize: Event<THREE.Vector2>;
980
+ frontOffset: number;
981
+ overrideMaterial: THREE.MeshDepthMaterial;
982
+ backgroundColor: THREE.Color;
983
+ renderer: THREE.WebGLRenderer;
984
+ enabled: boolean;
985
+ world: World;
986
+ private _lockRotation;
987
+ private _camera;
988
+ private _plane;
989
+ private _size;
990
+ private _tempVector1;
991
+ private _tempVector2;
992
+ private _tempTarget;
993
+ private readonly down;
994
+ get lockRotation(): boolean;
995
+ set lockRotation(active: boolean);
996
+ get zoom(): number;
997
+ set zoom(value: number);
998
+ constructor(world: World);
686
999
  dispose(): void;
687
- set(active: boolean): void;
1000
+ get(): THREE.OrthographicCamera;
1001
+ update(): void;
1002
+ getSize(): THREE.Vector2;
1003
+ resize(size?: THREE.Vector2): void;
1004
+ private updatePlanes;
688
1005
  }
689
1006
  import * as WEBIFC from "web-ifc";
690
- import { FragmentsGroup } from "@thatopen/fragments";
691
- import { Disposable, Event, Component, Components } from "../../core";
692
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
1007
+ import { IfcItemsCategories } from "../../../ifc";
1008
+ export declare class SpatialStructure {
1009
+ itemsByFloor: IfcItemsCategories;
1010
+ private _units;
1011
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1012
+ cleanUp(): void;
1013
+ }
1014
+ /// <reference types="node" />
1015
+ import * as THREE from "three";
1016
+ import { Hideable, Event, World } from "../../Types";
1017
+ import { Components } from "../../Components";
1018
+ export interface GridConfig {
1019
+ color: THREE.Color;
1020
+ size1: number;
1021
+ size2: number;
1022
+ distance: number;
1023
+ }
693
1024
  /**
694
- * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
695
- * 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.
1025
+ * An infinite grid. Created by
1026
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1027
+ * and translated to typescript by
1028
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
696
1029
  */
697
- export declare class IfcRelationsIndexer extends Component implements Disposable {
698
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
1030
+ export declare class SimpleGrid implements Hideable, Disposable {
699
1031
  /** {@link Disposable.onDisposed} */
700
- readonly onDisposed: Event<string>;
701
- enabled: boolean;
702
- readonly onRelationsIndexed: Event<{
703
- modelID: string;
704
- relationsMap: RelationsMap;
705
- }>;
706
- private _relToAttributesMap;
707
- private _inverseAttributes;
708
- private _ifcRels;
1032
+ readonly onDisposed: Event<unknown>;
1033
+ world: World;
1034
+ components: Components;
1035
+ /** {@link Hideable.visible} */
1036
+ get visible(): boolean;
1037
+ /** {@link Hideable.visible} */
1038
+ set visible(visible: boolean);
1039
+ /** The material of the grid. */
1040
+ get material(): THREE.ShaderMaterial;
709
1041
  /**
710
- * Holds the relationship mappings for each model processed by the indexer.
711
- * The structure is a map where each key is a model's UUID, and the value is another map.
712
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
713
- * representing a specific relation type, and the value is an array of expressIDs of entities
714
- * that are related through that relation type. This structure allows for efficient querying
715
- * of entity relationships within a model.
1042
+ * Whether the grid should fade away with distance. Recommended to be true for
1043
+ * perspective cameras and false for orthographic cameras.
716
1044
  */
717
- readonly relationMaps: ModelsRelationMap;
718
- constructor(components: Components);
719
- private onFragmentsDisposed;
1045
+ get fade(): boolean;
720
1046
  /**
721
- * Adds a relation map to the model's relations map.
722
- *
723
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
724
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
725
- *
726
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
1047
+ * Whether the grid should fade away with distance. Recommended to be true for
1048
+ * perspective cameras and false for orthographic cameras.
727
1049
  */
728
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
729
- /**
730
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
731
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
732
- * and maps them in a structured way to facilitate quick access to related entities.
733
- *
734
- * The process involves querying the model for each relation type associated with the inverse attributes
735
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
736
- * and contains a nested map where each key is an entity's expressID and its value is another map.
737
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
738
- * of entities that are related through that attribute.
739
- *
740
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
741
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
742
- * representation of the relations indexed by entity expressIDs and relation types.
743
- * @throws An error if the model does not have properties loaded.
1050
+ set fade(active: boolean);
1051
+ readonly three: THREE.Mesh;
1052
+ private _fade;
1053
+ constructor(components: Components, world: World, config: GridConfig);
1054
+ [Symbol.dispose](): void;
1055
+ /** {@link Disposable.dispose} */
1056
+ dispose(): void;
1057
+ private setupEvents;
1058
+ private updateZoom;
1059
+ }
1060
+ import * as THREE from "three";
1061
+ import { Disposable, Event } from "../../Types";
1062
+ /**
1063
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1064
+ * to work with tools like the
1065
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1066
+ * been transformed through CSS or doesn't occupy the whole screen.
1067
+ */
1068
+ export declare class Mouse implements Disposable {
1069
+ dom: HTMLCanvasElement;
1070
+ private _event?;
1071
+ private _position;
1072
+ /** {@link Disposable.onDisposed} */
1073
+ readonly onDisposed: Event<unknown>;
1074
+ constructor(dom: HTMLCanvasElement);
1075
+ /**
1076
+ * The real position of the mouse of the Three.js canvas.
744
1077
  */
745
- process(model: FragmentsGroup): Promise<RelationsMap>;
1078
+ get position(): THREE.Vector2;
1079
+ /** {@link Disposable.dispose} */
1080
+ dispose(): void;
1081
+ private getPositionY;
1082
+ private getPositionX;
1083
+ private updateMouseInfo;
1084
+ private setupEvents;
1085
+ }
1086
+ /**
1087
+ * Simple event handler by
1088
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1089
+ * Keep in mind that:
1090
+ * - If you want to remove it later, you might want to declare the callback as
1091
+ * an object.
1092
+ * - If you want to maintain the reference to 'this', you will need to declare
1093
+ * the callback as an arrow function.
1094
+ */
1095
+ export declare class AsyncEvent<T> {
746
1096
  /**
747
- * Processes a given model from a WebIfc API to index its IFC entities relations.
748
- *
749
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
750
- * @param modelID - The unique identifier of the model within the WebIfc API.
751
- * @returns A promise that resolves to the relations map for the processed model.
752
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
1097
+ * Add a callback to this event instance.
1098
+ * @param handler - the callback to be added to this event.
753
1099
  */
754
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
1100
+ add(handler: T extends void ? {
1101
+ (): Promise<void>;
1102
+ } : {
1103
+ (data: T): Promise<void>;
1104
+ }): void;
755
1105
  /**
756
- * Retrieves the relations of a specific entity within a model based on the given relation name.
757
- * This method searches the indexed relation maps for the specified model and entity,
758
- * returning the IDs of related entities if a match is found.
759
- *
760
- * @param model The 'FragmentsGroup' model containing the entity.
761
- * @param expressID The unique identifier of the entity within the model.
762
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
763
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
764
- * or the specified relation name is not indexed.
1106
+ * Removes a callback from this event instance.
1107
+ * @param handler - the callback to be removed from this event.
765
1108
  */
766
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
1109
+ remove(handler: T extends void ? {
1110
+ (): Promise<void>;
1111
+ } : {
1112
+ (data: T): Promise<void>;
1113
+ }): void;
1114
+ /** Triggers all the callbacks assigned to this event. */
1115
+ trigger: (data?: T) => Promise<void>;
1116
+ /** Gets rid of all the suscribed events. */
1117
+ reset(): void;
1118
+ private handlers;
1119
+ }
1120
+ import * as THREE from "three";
1121
+ import { Components } from "../../Components";
1122
+ import { Event, World, Disposable } from "../../Types";
1123
+ import { Mouse } from "./mouse";
1124
+ /**
1125
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1126
+ * that allows to easily get items from the scene using the mouse and touch
1127
+ * events.
1128
+ */
1129
+ export declare class SimpleRaycaster implements Disposable {
1130
+ /** {@link Component.enabled} */
1131
+ enabled: boolean;
1132
+ components: Components;
1133
+ /** {@link Disposable.onDisposed} */
1134
+ readonly onDisposed: Event<unknown>;
1135
+ /** The position of the mouse in the screen. */
1136
+ readonly mouse: Mouse;
1137
+ readonly three: THREE.Raycaster;
1138
+ world: World;
1139
+ constructor(components: Components, world: World);
1140
+ /** {@link Disposable.dispose} */
1141
+ dispose(): void;
767
1142
  /**
768
- * Serializes the relations of a given relation map into a JSON string.
769
- * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
770
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
771
- * The resulting object is then serialized into a JSON string.
1143
+ * Throws a ray from the camera to the mouse or touch event point and returns
1144
+ * the first item found. This also takes into account the clipping planes
1145
+ * used by the renderer.
772
1146
  *
773
- * @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
774
- * @returns A JSON string representing the serialized relations of the given relation map.
1147
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1148
+ * to query. If not provided, it will query all the meshes stored in
1149
+ * {@link Components.meshes}.
775
1150
  */
776
- serializeRelations(relationMap: RelationsMap): string;
1151
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1152
+ castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
1153
+ private intersect;
1154
+ private filterClippingPlanes;
1155
+ }
1156
+ import * as THREE from "three";
1157
+ import CameraControls from "camera-controls";
1158
+ import { Event } from "./event";
1159
+ /**
1160
+ * Whether this component has to be manually destroyed once you are done with
1161
+ * it to prevent
1162
+ * [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1163
+ * This also ensures that the DOM events created by that component will be
1164
+ * cleaned up.
1165
+ */
1166
+ export interface Disposable {
777
1167
  /**
778
- * Serializes the relations of a specific model into a JSON string.
779
- * This method iterates through the relations indexed for the given model,
780
- * organizing them into a structured object where each key is an expressID of an entity,
781
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
782
- * The resulting object is then serialized into a JSON string.
783
- *
784
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
785
- * @returns A JSON string representing the serialized relations of the specified model.
786
- * If the model has no indexed relations, 'null' is returned.
1168
+ * Destroys the object from memory to prevent a
1169
+ * [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
787
1170
  */
788
- serializeModelRelations(model: FragmentsGroup): string | null;
1171
+ dispose: () => void | Promise<void>;
1172
+ /** Fired after the tool has been {@link Disposable.dispose()} */
1173
+ readonly onDisposed: Event<any>;
1174
+ }
1175
+ /**
1176
+ * Whether the geometric representation of this component can be
1177
+ * hidden or shown in the
1178
+ * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
1179
+ */
1180
+ export interface Hideable {
789
1181
  /**
790
- * Serializes all relations of every model processed by the indexer into a JSON string.
791
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
792
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
793
- * and its value is another object mapping entity expressIDs to their related entities, categorized
794
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
795
- *
796
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
797
- * If no relations have been indexed, an empty object is returned as a JSON string.
1182
+ * Whether the geometric representation of this component is
1183
+ * currently visible or not in the
1184
+ * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
798
1185
  */
799
- serializeAllRelations(): string;
1186
+ visible: boolean;
1187
+ }
1188
+ /**
1189
+ * Whether this component can be resized. The meaning of this can vary depending
1190
+ * on the component: resizing a
1191
+ * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
1192
+ * component could mean changing its resolution, whereas resizing a
1193
+ * [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
1194
+ */
1195
+ export interface Resizeable {
800
1196
  /**
801
- * Converts a JSON string representing relations between entities into a structured map.
802
- * This method parses the JSON string to reconstruct the relations map that indexes
803
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
804
- * and the values are maps where each key is a relation type ID and its value is an array
805
- * of express IDs of entities related through that relation type.
806
- *
807
- * @param json The JSON string to be parsed into the relations map.
808
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
809
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
810
- * is an array of express IDs (as numbers) of entities related through that relation type.
1197
+ * Sets size of this component (e.g. the resolution of a
1198
+ * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
1199
+ * component.
811
1200
  */
812
- getRelationsMapFromJSON(json: string): RelationsMap;
1201
+ resize: (size?: THREE.Vector2) => void;
1202
+ /** Event that fires when the component has been resized. */
1203
+ onResize: Event<THREE.Vector2>;
813
1204
  /**
814
- * Disposes the component, cleaning up resources and detaching event listeners.
815
- * This ensures that the component is properly cleaned up and does not leave behind any
816
- * references that could prevent garbage collection.
1205
+ * Gets the current size of this component (e.g. the resolution of a
1206
+ * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
1207
+ * component.
817
1208
  */
818
- dispose(): void;
1209
+ getSize: () => THREE.Vector2;
819
1210
  }
820
- export type { InverseAttribute } from "./src/types";
821
- import * as THREE from "three";
822
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
823
- center: THREE.Vector3;
824
- halfSizes: THREE.Vector3;
825
- rotation: THREE.Matrix3;
826
- transformation: THREE.Matrix4;
827
- };
828
- import * as WEBIFC from "web-ifc";
829
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
830
- import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
831
- export declare class IfcPropertiesTiler extends Component implements Disposable {
832
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
833
- onPropertiesStreamed: AsyncEvent<{
834
- type: number;
835
- data: {
836
- [id: number]: any;
837
- };
838
- }>;
839
- onProgress: AsyncEvent<number>;
840
- onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
841
- /** {@link Disposable.onDisposed} */
842
- readonly onDisposed: Event<string>;
843
- enabled: boolean;
844
- settings: PropertiesStreamingSettings;
845
- webIfc: WEBIFC.IfcAPI;
846
- dispose(): Promise<void>;
847
- streamFromBuffer(data: Uint8Array): Promise<void>;
848
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
849
- private readIfcFile;
850
- private streamIfcFile;
851
- private streamAllProperties;
852
- private cleanUp;
1211
+ /** Whether this component should be updated each frame. */
1212
+ export interface Updateable {
1213
+ /** Actions that should be executed after updating the component. */
1214
+ onAfterUpdate: Event<any>;
1215
+ /** Actions that should be executed before updating the component. */
1216
+ onBeforeUpdate: Event<any>;
1217
+ /**
1218
+ * Function used to update the state of this component each frame. For
1219
+ * instance, a renderer component will make a render each frame.
1220
+ */
1221
+ update(delta?: number): void;
853
1222
  }
854
- import * as WEBIFC from "web-ifc";
855
- import { Components, Disposable, Event, Component } from "../../core";
856
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
857
- export declare class IfcGeometryTiler extends Component implements Disposable {
858
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
859
- onGeometryStreamed: Event<{
860
- buffer: Uint8Array;
861
- data: StreamedGeometries;
862
- }>;
863
- onAssetStreamed: Event<StreamedAsset[]>;
864
- onProgress: Event<number>;
865
- onIfcLoaded: Event<Uint8Array>;
866
- /** {@link Disposable.onDisposed} */
867
- readonly onDisposed: Event<unknown>;
868
- settings: IfcStreamingSettings;
869
- enabled: boolean;
870
- webIfc: WEBIFC.IfcAPI;
871
- private _spatialTree;
872
- private _metaData;
873
- private _visitedGeometries;
874
- private _streamSerializer;
875
- private _geometries;
876
- private _geometryCount;
877
- private _civil;
878
- private _groupSerializer;
879
- private _assets;
880
- private _meshesWithHoles;
881
- constructor(components: Components);
882
- dispose(): void;
883
- streamFromBuffer(data: Uint8Array): Promise<void>;
884
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
885
- private readIfcFile;
886
- private streamIfcFile;
887
- private streamAllGeometries;
888
- private cleanUp;
889
- private getMesh;
890
- private getGeometry;
891
- private streamAssets;
892
- private streamGeometries;
1223
+ /** Basic type to describe the progress of any kind of process. */
1224
+ export interface Progress {
1225
+ /** The amount of things that have been done already. */
1226
+ current: number;
1227
+ /** The total amount of things to be done by the process. */
1228
+ total: number;
893
1229
  }
894
- import * as THREE from "three";
895
- import { Component, Components, Event, World } from "../core";
896
- export interface VertexPickerConfig {
897
- showOnlyVertex: boolean;
898
- snapDistance: number;
899
- previewElement: HTMLElement;
1230
+ /**
1231
+ * Whether this component supports create and destroy operations. This generally
1232
+ * applies for components that work with instances, such as clipping planes or
1233
+ * dimensions.
1234
+ */
1235
+ export interface Createable {
1236
+ /** Creates a new instance of an element (e.g. a new Dimension). */
1237
+ create: (data: any) => void;
1238
+ /**
1239
+ * Finish the creation process of the component, successfully creating an
1240
+ * instance of whatever the component creates.
1241
+ */
1242
+ endCreation?: (data: any) => void;
1243
+ /**
1244
+ * Cancels the creation process of the component, going back to the state
1245
+ * before starting to create.
1246
+ */
1247
+ cancelCreation?: (data: any) => void;
1248
+ /** Deletes an existing instance of an element (e.g. a Dimension). */
1249
+ delete: (data: any) => void;
900
1250
  }
901
- export declare class VertexPicker extends Component {
902
- onVertexFound: Event<THREE.Vector3>;
903
- onVertexLost: Event<THREE.Vector3>;
904
- components: Components;
905
- private _pickedPoint;
906
- private _config;
907
- private _enabled;
908
- private _workingPlane;
909
- set enabled(value: boolean);
910
- get enabled(): boolean;
911
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
912
- set workingPlane(plane: THREE.Plane | null);
913
- get workingPlane(): THREE.Plane | null;
914
- set config(value: Partial<VertexPickerConfig>);
915
- get config(): Partial<VertexPickerConfig>;
916
- dispose(): void;
917
- get(world: World): THREE.Vector3 | null;
918
- private getClosestVertex;
919
- private getVertices;
920
- private getVertex;
1251
+ /**
1252
+ * Whether this component supports to be configured.
1253
+ */
1254
+ export interface Configurable<T extends Record<string, any>> {
1255
+ /** Wether this components has been already configured. */
1256
+ isSetup: boolean;
1257
+ /** Use the provided configuration to setup the tool. */
1258
+ setup: (config?: Partial<T>) => void | Promise<void>;
1259
+ /** Fired after successfully calling {@link Configurable.setup()} */
1260
+ readonly onSetup: Event<any>;
1261
+ /** Object holding the tool configuration. Is not meant to be edited directly, if you need
1262
+ * to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
1263
+ */
1264
+ config: Required<T>;
921
1265
  }
922
- export declare const IfcElements: {
923
- [key: number]: string;
924
- };
925
- export declare class UUID {
926
- private static _pattern;
927
- private static _lut;
928
- static create(): string;
929
- static validate(uuid: string): void;
1266
+ /**
1267
+ * An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
1268
+ */
1269
+ export interface BVHGeometry extends THREE.BufferGeometry {
1270
+ boundsTree: Object | undefined;
1271
+ disposeBoundsTree: () => void;
930
1272
  }
931
- import * as THREE from "three";
932
- import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
933
- export declare class MiniMap implements Resizeable, Updateable, Disposable {
934
- /** {@link Disposable.onDisposed} */
935
- readonly onDisposed: Event<unknown>;
936
- readonly onAfterUpdate: Event<unknown>;
937
- readonly onBeforeUpdate: Event<unknown>;
938
- readonly onResize: Event<THREE.Vector2>;
939
- frontOffset: number;
940
- overrideMaterial: THREE.MeshDepthMaterial;
941
- backgroundColor: THREE.Color;
942
- renderer: THREE.WebGLRenderer;
943
- enabled: boolean;
944
- world: World;
945
- private _lockRotation;
946
- private _camera;
947
- private _plane;
948
- private _size;
949
- private _tempVector1;
950
- private _tempVector2;
951
- private _tempTarget;
952
- private readonly down;
953
- get lockRotation(): boolean;
954
- set lockRotation(active: boolean);
955
- get zoom(): number;
956
- set zoom(value: number);
957
- constructor(world: World);
958
- dispose(): void;
959
- get(): THREE.OrthographicCamera;
960
- update(): void;
961
- getSize(): THREE.Vector2;
962
- resize(size?: THREE.Vector2): void;
963
- private updatePlanes;
1273
+ /**
1274
+ * Whether a camera uses the Camera Controls library.
1275
+ */
1276
+ export interface CameraControllable {
1277
+ controls: CameraControls;
964
1278
  }
965
- export declare const GeometryTypes: Set<number>;
966
- import * as WEBIFC from "web-ifc";
967
- export interface IfcItemsCategories {
968
- [itemID: number]: number;
1279
+ /**
1280
+ * Simple event handler by
1281
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1282
+ * Keep in mind that:
1283
+ * - If you want to remove it later, you might want to declare the callback as
1284
+ * an object.
1285
+ * - If you want to maintain the reference to 'this', you will need to declare
1286
+ * the callback as an arrow function.
1287
+ */
1288
+ export declare class Event<T> {
1289
+ /**
1290
+ * Add a callback to this event instance.
1291
+ * @param handler - the callback to be added to this event.
1292
+ */
1293
+ add(handler: T extends void ? {
1294
+ (): void;
1295
+ } : {
1296
+ (data: T): void;
1297
+ }): void;
1298
+ /**
1299
+ * Removes a callback from this event instance.
1300
+ * @param handler - the callback to be removed from this event.
1301
+ */
1302
+ remove(handler: T extends void ? {
1303
+ (): void;
1304
+ } : {
1305
+ (data: T): void;
1306
+ }): void;
1307
+ /** Triggers all the callbacks assigned to this event. */
1308
+ trigger: (data?: T) => void;
1309
+ /** Gets rid of all the suscribed events. */
1310
+ reset(): void;
1311
+ private handlers;
969
1312
  }
970
- export declare class IfcCategories {
971
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
1313
+ import { Base } from "./base";
1314
+ /**
1315
+ * Components are the building blocks of this library. Components are singleton
1316
+ * elements that contain specific functionality. For instance, the SimpleClipper
1317
+ * Component can create, delete and handle 3D clipping planes. Components must be
1318
+ * unique (they can't be instanced more than once), and have a static UUID that
1319
+ * identifies them uniquely. The can be accessed globally using the {@link Components}
1320
+ * instance.
1321
+ */
1322
+ export declare abstract class Component extends Base {
1323
+ /**
1324
+ * Whether this component is active or not. The behaviour can vary depending
1325
+ * on the type of component. E.g. a disabled dimension tool will stop creating
1326
+ * dimensions, while a disabled camera will stop moving. A disabled component
1327
+ * will not be updated automatically each frame.
1328
+ */
1329
+ abstract enabled: boolean;
972
1330
  }
973
- import * as FRAGS from "@thatopen/fragments";
974
- export declare class IfcPropertiesUtils {
975
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
976
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
977
- [attribute: string]: any;
978
- } | null>;
979
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
980
- [relatingID: number]: number[];
981
- }>;
982
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
983
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
984
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
985
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
986
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
987
- key: string | null;
988
- name: string | null;
989
- }>;
990
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
991
- key: string | null;
992
- value: number | null;
1331
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1332
+ import { Components } from "../../Components";
1333
+ /**
1334
+ * Base class of the library. Useful for finding out the interfaces it implements.
1335
+ */
1336
+ export declare abstract class Base {
1337
+ components: Components;
1338
+ constructor(components: Components);
1339
+ /** Whether is component is {@link Disposable}. */
1340
+ isDisposeable: () => this is Disposable;
1341
+ /** Whether is component is {@link Resizeable}. */
1342
+ isResizeable: () => this is Resizeable;
1343
+ /** Whether is component is {@link Updateable}. */
1344
+ isUpdateable: () => this is Updateable;
1345
+ /** Whether is component is {@link Hideable}. */
1346
+ isHideable: () => this is Hideable;
1347
+ /** Whether is component is {@link Configurable}. */
1348
+ isConfigurable: () => this is Configurable<any>;
1349
+ }
1350
+ import { Base } from "./base";
1351
+ import { World } from "./world";
1352
+ import { Event } from "./event";
1353
+ import { Components } from "../../Components";
1354
+ /**
1355
+ * One of the elements that make a world. It can be either a scene, a camera
1356
+ * or a renderer.
1357
+ */
1358
+ export declare abstract class BaseWorldItem extends Base {
1359
+ readonly worlds: Map<string, World>;
1360
+ readonly onWorldChanged: Event<{
1361
+ world: World;
1362
+ action: "added" | "removed";
993
1363
  }>;
994
- static isRel(expressID: number): boolean;
995
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
996
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
1364
+ currentWorld: World | null;
1365
+ protected constructor(components: Components);
997
1366
  }
998
- export declare const IfcCategoryMap: {
999
- [key: number]: string;
1000
- };
1001
- import * as WEBIFC from "web-ifc";
1002
- import { IfcItemsCategories } from "../../../ifc";
1003
- export declare class SpatialStructure {
1004
- itemsByFloor: IfcItemsCategories;
1005
- private _units;
1006
- setUp(webIfc: WEBIFC.IfcAPI): void;
1007
- cleanUp(): void;
1367
+ import * as THREE from "three";
1368
+ import CameraControls from "camera-controls";
1369
+ import { BaseWorldItem } from "./base-world-item";
1370
+ import { CameraControllable } from "./interfaces";
1371
+ export declare abstract class BaseCamera extends BaseWorldItem {
1372
+ abstract enabled: boolean;
1373
+ abstract three: THREE.Camera;
1374
+ abstract controls?: CameraControls;
1375
+ /** Whether is instance is {@link CameraControllable}. */
1376
+ hasCameraControls: () => this is CameraControllable;
1377
+ }
1378
+ import * as THREE from "three";
1379
+ import { Vector2 } from "three";
1380
+ import { Event } from "./event";
1381
+ import { BaseWorldItem } from "./base-world-item";
1382
+ import { Disposable, Resizeable, Updateable } from "./interfaces";
1383
+ export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
1384
+ abstract three: THREE.WebGLRenderer;
1385
+ /** {@link Updateable.onBeforeUpdate} */
1386
+ onAfterUpdate: Event<unknown>;
1387
+ /** {@link Updateable.onAfterUpdate} */
1388
+ onBeforeUpdate: Event<unknown>;
1389
+ /** {@link Disposable.onDisposed} */
1390
+ readonly onDisposed: Event<undefined>;
1391
+ readonly onResize: Event<THREE.Vector2>;
1392
+ /**
1393
+ * Event that fires when there has been a change to the list of clipping
1394
+ * planes used by the active renderer.
1395
+ */
1396
+ readonly onClippingPlanesUpdated: Event<unknown>;
1397
+ abstract update(delta?: number): void | Promise<void>;
1398
+ abstract dispose(): void;
1399
+ abstract getSize(): Vector2;
1400
+ abstract resize(size: Vector2 | undefined): void;
1401
+ /**
1402
+ * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
1403
+ * instance of the renderer.
1404
+ */
1405
+ clippingPlanes: THREE.Plane[];
1406
+ /**
1407
+ * Forces the update of the clipping planes and all components that depend
1408
+ * on them that are subscribed to 'onClippingPlanesUpdated'.
1409
+ */
1410
+ updateClippingPlanes(): void;
1411
+ /**
1412
+ * Adds or removes a
1413
+ * [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
1414
+ * to the renderer.
1415
+ */
1416
+ setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1008
1417
  }
1009
1418
  import * as THREE from "three";
1010
- import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1419
+ import { Disposable } from "./interfaces";
1420
+ import { Event } from "./event";
1011
1421
  import { Components } from "../../Components";
1012
- import { Event, World } from "../../Types";
1013
- /**
1014
- * A renderer to determine a mesh visibility on screen
1015
- */
1016
- export declare class MeshCullerRenderer extends CullerRenderer {
1017
- threshold: number;
1018
- readonly onViewUpdated: Event<{
1019
- seen: Set<THREE.Mesh>;
1020
- unseen: Set<THREE.Mesh>;
1021
- }>;
1022
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1023
- isProcessing: boolean;
1024
- private _colorCodeMeshMap;
1025
- private _meshIDColorCodeMap;
1026
- private _currentVisibleMeshes;
1027
- private _recentlyHiddenMeshes;
1028
- private _intervalID;
1029
- private readonly _transparentMat;
1030
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1422
+ import { BaseWorldItem } from "./base-world-item";
1423
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1424
+ /** {@link Disposable.onDisposed} */
1425
+ readonly onDisposed: Event<unknown>;
1426
+ abstract three: THREE.Object3D;
1427
+ protected constructor(components: Components);
1428
+ /** {@link Disposable.dispose} */
1031
1429
  dispose(): void;
1032
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1033
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1034
- private handleWorkerMessage;
1035
- private getAvailableMaterial;
1036
1430
  }
1037
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1038
- /// <reference types="node" />
1039
1431
  import * as THREE from "three";
1040
- import { Hideable, Event, World } from "../../Types";
1041
- import { Components } from "../../Components";
1042
- export interface GridConfig {
1043
- color: THREE.Color;
1044
- size1: number;
1045
- size2: number;
1046
- distance: number;
1432
+ import { BaseScene } from "./base-scene";
1433
+ import { BaseCamera } from "./base-camera";
1434
+ import { BaseRenderer } from "./base-renderer";
1435
+ import { Updateable, Disposable } from "./interfaces";
1436
+ export interface World extends Disposable, Updateable {
1437
+ meshes: Set<THREE.Mesh>;
1438
+ scene: BaseScene;
1439
+ camera: BaseCamera;
1440
+ renderer: BaseRenderer | null;
1441
+ uuid: string;
1442
+ isDisposing: boolean;
1047
1443
  }
1048
- /**
1049
- * An infinite grid. Created by
1050
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1051
- * and translated to typescript by
1052
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1053
- */
1054
- export declare class SimpleGrid implements Hideable, Disposable {
1055
- /** {@link Disposable.onDisposed} */
1056
- readonly onDisposed: Event<unknown>;
1057
- world: World;
1058
- components: Components;
1059
- /** {@link Hideable.visible} */
1060
- get visible(): boolean;
1061
- /** {@link Hideable.visible} */
1062
- set visible(visible: boolean);
1063
- /** The material of the grid. */
1064
- get material(): THREE.ShaderMaterial;
1065
- /**
1066
- * Whether the grid should fade away with distance. Recommended to be true for
1067
- * perspective cameras and false for orthographic cameras.
1068
- */
1069
- get fade(): boolean;
1444
+ import * as THREE from "three";
1445
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1446
+ import { Components } from "../../Components";
1447
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1070
1448
  /**
1071
- * Whether the grid should fade away with distance. Recommended to be true for
1072
- * perspective cameras and false for orthographic cameras.
1449
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1073
1450
  */
1074
- set fade(active: boolean);
1075
- readonly three: THREE.Mesh;
1076
- private _fade;
1077
- constructor(components: Components, world: World, config: GridConfig);
1078
- [Symbol.dispose](): void;
1079
- /** {@link Disposable.dispose} */
1080
- dispose(): void;
1081
- private setupEvents;
1082
- private updateZoom;
1451
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1452
+ readonly onAfterUpdate: Event<unknown>;
1453
+ readonly onBeforeUpdate: Event<unknown>;
1454
+ isDisposing: boolean;
1455
+ enabled: boolean;
1456
+ uuid: string;
1457
+ name?: string;
1458
+ readonly onDisposed: Event<unknown>;
1459
+ private _scene?;
1460
+ private _camera?;
1461
+ private _renderer;
1462
+ get scene(): T;
1463
+ set scene(scene: T);
1464
+ get camera(): U;
1465
+ set camera(camera: U);
1466
+ get renderer(): S | null;
1467
+ set renderer(renderer: S | null);
1468
+ constructor(components: Components);
1469
+ update(delta?: number): void;
1470
+ dispose(disposeResources?: boolean): void;
1083
1471
  }
1084
1472
  import * as THREE from "three";
1085
- import { Disposable, Event } from "../../Types";
1473
+ import CameraControls from "camera-controls";
1474
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1475
+ import { Components } from "../../Components";
1086
1476
  /**
1087
- * A helper to easily get the real position of the mouse in the Three.js canvas
1088
- * to work with tools like the
1089
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1090
- * been transformed through CSS or doesn't occupy the whole screen.
1477
+ * A basic camera that uses
1478
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1479
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1480
+ * what features it offers.
1091
1481
  */
1092
- export declare class Mouse implements Disposable {
1093
- dom: HTMLCanvasElement;
1094
- private _event?;
1095
- private _position;
1482
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1483
+ /** {@link Updateable.onBeforeUpdate} */
1484
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1485
+ /** {@link Updateable.onAfterUpdate} */
1486
+ readonly onAfterUpdate: Event<SimpleCamera>;
1487
+ readonly onAspectUpdated: Event<unknown>;
1096
1488
  /** {@link Disposable.onDisposed} */
1097
- readonly onDisposed: Event<unknown>;
1098
- constructor(dom: HTMLCanvasElement);
1489
+ readonly onDisposed: Event<string>;
1490
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1491
+ private _allControls;
1099
1492
  /**
1100
- * The real position of the mouse of the Three.js canvas.
1493
+ * The object that controls the camera. An instance of
1494
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1495
+ * Transforming the camera directly will have no effect: you need to use this
1496
+ * object to move, rotate, look at objects, etc.
1101
1497
  */
1102
- get position(): THREE.Vector2;
1498
+ get controls(): CameraControls;
1499
+ /** {@link Component.enabled} */
1500
+ get enabled(): boolean;
1501
+ /** {@link Component.enabled} */
1502
+ set enabled(enabled: boolean);
1503
+ constructor(components: Components);
1103
1504
  /** {@link Disposable.dispose} */
1104
1505
  dispose(): void;
1105
- private getPositionY;
1106
- private getPositionX;
1107
- private updateMouseInfo;
1506
+ /** {@link Updateable.update} */
1507
+ update(_delta: number): void;
1508
+ /**
1509
+ * Updates the aspect of the camera to match the size of the
1510
+ * {@link Components.renderer}.
1511
+ */
1512
+ updateAspect: () => void;
1513
+ private setupCamera;
1514
+ private newCameraControls;
1108
1515
  private setupEvents;
1516
+ private static getSubsetOfThree;
1109
1517
  }
1110
1518
  import * as THREE from "three";
1111
1519
  import { Components } from "../../Components";
@@ -1174,74 +1582,37 @@ export declare class CullerRenderer {
1174
1582
  protected decreaseColor(): void;
1175
1583
  private applySettings;
1176
1584
  }
1177
- import { InverseAttribute } from "./types";
1178
- export declare const relToAttributesMap: Map<number, {
1179
- forRelating: InverseAttribute;
1180
- forRelated: InverseAttribute;
1181
- }>;
1182
- import * as THREE from "three";
1183
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1184
- import { Components } from "../../Components";
1185
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1186
- /**
1187
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1188
- */
1189
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1190
- readonly onAfterUpdate: Event<unknown>;
1191
- readonly onBeforeUpdate: Event<unknown>;
1192
- isDisposing: boolean;
1193
- enabled: boolean;
1194
- uuid: string;
1195
- name?: string;
1196
- readonly onDisposed: Event<unknown>;
1197
- private _scene?;
1198
- private _camera?;
1199
- private _renderer;
1200
- get scene(): T;
1201
- set scene(scene: T);
1202
- get camera(): U;
1203
- set camera(camera: U);
1204
- get renderer(): S | null;
1205
- set renderer(renderer: S | null);
1206
- constructor(components: Components);
1207
- update(delta?: number): void;
1208
- dispose(disposeResources?: boolean): void;
1209
- }
1210
1585
  import * as THREE from "three";
1586
+ import { BaseRenderer, Event } from "../../Types";
1211
1587
  import { Components } from "../../Components";
1212
- import { Event, World, Disposable } from "../../Types";
1213
- import { Mouse } from "./mouse";
1214
1588
  /**
1215
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1216
- * that allows to easily get items from the scene using the mouse and touch
1217
- * events.
1589
+ * A basic renderer capable of rendering
1590
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1218
1591
  */
1219
- export declare class SimpleRaycaster implements Disposable {
1220
- /** {@link Component.enabled} */
1592
+ export declare class SimpleRenderer extends BaseRenderer {
1221
1593
  enabled: boolean;
1222
- components: Components;
1223
- /** {@link Disposable.onDisposed} */
1224
- readonly onDisposed: Event<unknown>;
1225
- /** The position of the mouse in the screen. */
1226
- readonly mouse: Mouse;
1227
- readonly three: THREE.Raycaster;
1228
- world: World;
1229
- constructor(components: Components, world: World);
1594
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1595
+ container: HTMLElement;
1596
+ three: THREE.WebGLRenderer;
1597
+ protected _canvas: HTMLCanvasElement;
1598
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1599
+ protected _resizeObserver: ResizeObserver | null;
1600
+ protected onContainerUpdated: Event<unknown>;
1601
+ private _resizing;
1602
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1603
+ /** {@link Updateable.update} */
1604
+ update(): void;
1230
1605
  /** {@link Disposable.dispose} */
1231
1606
  dispose(): void;
1232
- /**
1233
- * Throws a ray from the camera to the mouse or touch event point and returns
1234
- * the first item found. This also takes into account the clipping planes
1235
- * used by the renderer.
1236
- *
1237
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1238
- * to query. If not provided, it will query all the meshes stored in
1239
- * {@link Components.meshes}.
1240
- */
1241
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1242
- 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;
1243
- private intersect;
1244
- private filterClippingPlanes;
1607
+ /** {@link Resizeable.getSize}. */
1608
+ getSize(): THREE.Vector2;
1609
+ /** {@link Resizeable.resize} */
1610
+ resize: (size?: THREE.Vector2) => void;
1611
+ setupEvents(active: boolean): void;
1612
+ private resizeEvent;
1613
+ private setupRenderer;
1614
+ private onContextLost;
1615
+ private onContextBack;
1245
1616
  }
1246
1617
  import * as THREE from "three";
1247
1618
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -1305,6 +1676,35 @@ export declare class SimplePlane implements Disposable, Hideable {
1305
1676
  private static newPlaneMesh;
1306
1677
  }
1307
1678
  import * as THREE from "three";
1679
+ import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1680
+ import { Components } from "../../Components";
1681
+ import { Event, World } from "../../Types";
1682
+ /**
1683
+ * A renderer to determine a mesh visibility on screen
1684
+ */
1685
+ export declare class MeshCullerRenderer extends CullerRenderer {
1686
+ threshold: number;
1687
+ readonly onViewUpdated: Event<{
1688
+ seen: Set<THREE.Mesh>;
1689
+ unseen: Set<THREE.Mesh>;
1690
+ }>;
1691
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1692
+ isProcessing: boolean;
1693
+ private _colorCodeMeshMap;
1694
+ private _meshIDColorCodeMap;
1695
+ private _currentVisibleMeshes;
1696
+ private _recentlyHiddenMeshes;
1697
+ private _intervalID;
1698
+ private readonly _transparentMat;
1699
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1700
+ dispose(): void;
1701
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1702
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1703
+ private handleWorkerMessage;
1704
+ private getAvailableMaterial;
1705
+ }
1706
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1707
+ import * as THREE from "three";
1308
1708
  import { BaseScene, Configurable, Event } from "../../Types";
1309
1709
  import { Components } from "../../Components";
1310
1710
  export interface SimpleSceneConfig {
@@ -1321,232 +1721,18 @@ export interface SimpleSceneConfig {
1321
1721
  /**
1322
1722
  * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1323
1723
  * objects hierarchically, and easily dispose them when you are finished with it.
1324
- * @noInheritDoc
1325
- */
1326
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1327
- /** {@link Configurable.isSetup} */
1328
- isSetup: boolean;
1329
- three: THREE.Scene;
1330
- /** {@link Configurable.onSetup} */
1331
- readonly onSetup: Event<SimpleScene>;
1332
- config: Required<SimpleSceneConfig>;
1333
- constructor(components: Components);
1334
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1335
- setup(config?: Partial<SimpleSceneConfig>): void;
1336
- }
1337
- import { NavigationMode } from "./types";
1338
- import { OrthoPerspectiveCamera } from "../index";
1339
- /**
1340
- * A {@link NavigationMode} that allows first person navigation,
1341
- * simulating FPS video games.
1342
- */
1343
- export declare class FirstPersonMode implements NavigationMode {
1344
- private camera;
1345
- /** {@link NavigationMode.enabled} */
1346
- enabled: boolean;
1347
- /** {@link NavigationMode.id} */
1348
- readonly id = "FirstPerson";
1349
- constructor(camera: OrthoPerspectiveCamera);
1350
- /** {@link NavigationMode.set} */
1351
- set(active: boolean): void;
1352
- private setupFirstPersonCamera;
1353
- }
1354
- import * as THREE from "three";
1355
- import CameraControls from "camera-controls";
1356
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1357
- import { Components } from "../../Components";
1358
- /**
1359
- * A basic camera that uses
1360
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1361
- * easily control the camera in 2D and 3D. Check out it's API to find out
1362
- * what features it offers.
1363
- */
1364
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1365
- /** {@link Updateable.onBeforeUpdate} */
1366
- readonly onBeforeUpdate: Event<SimpleCamera>;
1367
- /** {@link Updateable.onAfterUpdate} */
1368
- readonly onAfterUpdate: Event<SimpleCamera>;
1369
- readonly onAspectUpdated: Event<unknown>;
1370
- /** {@link Disposable.onDisposed} */
1371
- readonly onDisposed: Event<string>;
1372
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1373
- private _allControls;
1374
- /**
1375
- * The object that controls the camera. An instance of
1376
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1377
- * Transforming the camera directly will have no effect: you need to use this
1378
- * object to move, rotate, look at objects, etc.
1379
- */
1380
- get controls(): CameraControls;
1381
- /** {@link Component.enabled} */
1382
- get enabled(): boolean;
1383
- /** {@link Component.enabled} */
1384
- set enabled(enabled: boolean);
1385
- constructor(components: Components);
1386
- /** {@link Disposable.dispose} */
1387
- dispose(): void;
1388
- /** {@link Updateable.update} */
1389
- update(_delta: number): void;
1390
- /**
1391
- * Updates the aspect of the camera to match the size of the
1392
- * {@link Components.renderer}.
1393
- */
1394
- updateAspect: () => void;
1395
- private setupCamera;
1396
- private newCameraControls;
1397
- private setupEvents;
1398
- private static getSubsetOfThree;
1399
- }
1400
- import * as THREE from "three";
1401
- import { CameraProjection } from "./types";
1402
- import { Event } from "../../Types";
1403
- import { OrthoPerspectiveCamera } from "../index";
1404
- /**
1405
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1406
- */
1407
- export declare class ProjectionManager {
1408
- /**
1409
- * Event that fires when the {@link CameraProjection} changes.
1410
- */
1411
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1412
- current: CameraProjection;
1413
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1414
- private _component;
1415
- private _previousDistance;
1416
- /** Match Ortho zoom with Perspective distance when changing projection mode */
1417
- matchOrthoDistanceEnabled: boolean;
1418
- constructor(camera: OrthoPerspectiveCamera);
1419
- /**
1420
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1421
- *
1422
- * @param projection - the new projection to set. If it is the current projection,
1423
- * it will have no effect.
1424
- */
1425
- set(projection: CameraProjection): Promise<void>;
1426
- /**
1427
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
1428
- * and vice versa.
1429
- */
1430
- toggle(): Promise<void>;
1431
- private setOrthoCamera;
1432
- private getPerspectiveDims;
1433
- private setupOrthoCamera;
1434
- private getDistance;
1435
- private setPerspectiveCamera;
1436
- }
1437
- import { NavigationMode } from "./types";
1438
- import { OrthoPerspectiveCamera } from "../index";
1439
- /**
1440
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1441
- * like many BIM tools.
1442
- */
1443
- export declare class PlanMode implements NavigationMode {
1444
- private camera;
1445
- /** {@link NavigationMode.enabled} */
1446
- enabled: boolean;
1447
- /** {@link NavigationMode.id} */
1448
- readonly id = "Plan";
1449
- private mouseAction1?;
1450
- private mouseAction2?;
1451
- private mouseInitialized;
1452
- private readonly defaultAzimuthSpeed;
1453
- private readonly defaultPolarSpeed;
1454
- constructor(camera: OrthoPerspectiveCamera);
1455
- /** {@link NavigationMode.set} */
1456
- set(active: boolean): void;
1457
- }
1458
- /**
1459
- * The projection system of the camera.
1460
- */
1461
- export type CameraProjection = "Perspective" | "Orthographic";
1462
- /**
1463
- * The extensible list of supported navigation modes.
1464
- */
1465
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1466
- /**
1467
- * An object that determines the behavior of the camera controls
1468
- * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1469
- */
1470
- export interface NavigationMode {
1471
- /** The unique ID of this navigation mode. */
1472
- id: NavModeID;
1473
- /**
1474
- * Enable or disable this navigation mode.
1475
- * When a new navigation mode is enabled, the previous navigation mode
1476
- * must be disabled.
1477
- *
1478
- * @param active - whether to enable or disable this mode.
1479
- * @param options - any additional data required to enable or disable it.
1480
- * */
1481
- set: (active: boolean, options?: any) => void;
1482
- /** Whether this navigation mode is active or not. */
1483
- enabled: boolean;
1484
- }
1485
- import * as THREE from "three";
1486
- import { BaseRenderer, Event } from "../../Types";
1487
- import { Components } from "../../Components";
1488
- /**
1489
- * A basic renderer capable of rendering
1490
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1491
- */
1492
- export declare class SimpleRenderer extends BaseRenderer {
1493
- enabled: boolean;
1494
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
1495
- container: HTMLElement;
1496
- three: THREE.WebGLRenderer;
1497
- protected _canvas: HTMLCanvasElement;
1498
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1499
- protected _resizeObserver: ResizeObserver | null;
1500
- protected onContainerUpdated: Event<unknown>;
1501
- private _resizing;
1502
- constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1503
- /** {@link Updateable.update} */
1504
- update(): void;
1505
- /** {@link Disposable.dispose} */
1506
- dispose(): void;
1507
- /** {@link Resizeable.getSize}. */
1508
- getSize(): THREE.Vector2;
1509
- /** {@link Resizeable.resize} */
1510
- resize: (size?: THREE.Vector2) => void;
1511
- setupEvents(active: boolean): void;
1512
- private resizeEvent;
1513
- private setupRenderer;
1514
- private onContextLost;
1515
- private onContextBack;
1516
- }
1517
- /**
1518
- * Simple event handler by
1519
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1520
- * Keep in mind that:
1521
- * - If you want to remove it later, you might want to declare the callback as
1522
- * an object.
1523
- * - If you want to maintain the reference to 'this', you will need to declare
1524
- * the callback as an arrow function.
1525
- */
1526
- export declare class Event<T> {
1527
- /**
1528
- * Add a callback to this event instance.
1529
- * @param handler - the callback to be added to this event.
1530
- */
1531
- add(handler: T extends void ? {
1532
- (): void;
1533
- } : {
1534
- (data: T): void;
1535
- }): void;
1536
- /**
1537
- * Removes a callback from this event instance.
1538
- * @param handler - the callback to be removed from this event.
1539
- */
1540
- remove(handler: T extends void ? {
1541
- (): void;
1542
- } : {
1543
- (data: T): void;
1544
- }): void;
1545
- /** Triggers all the callbacks assigned to this event. */
1546
- trigger: (data?: T) => void;
1547
- /** Gets rid of all the suscribed events. */
1548
- reset(): void;
1549
- private handlers;
1724
+ * @noInheritDoc
1725
+ */
1726
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1727
+ /** {@link Configurable.isSetup} */
1728
+ isSetup: boolean;
1729
+ three: THREE.Scene;
1730
+ /** {@link Configurable.onSetup} */
1731
+ readonly onSetup: Event<SimpleScene>;
1732
+ config: Required<SimpleSceneConfig>;
1733
+ constructor(components: Components);
1734
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1735
+ setup(config?: Partial<SimpleSceneConfig>): void;
1550
1736
  }
1551
1737
  import { NavigationMode } from "./types";
1552
1738
  import { OrthoPerspectiveCamera } from "../index";
@@ -1565,339 +1751,132 @@ export declare class OrbitMode implements NavigationMode {
1565
1751
  set(active: boolean): void;
1566
1752
  private activateOrbitControls;
1567
1753
  }
1754
+ import { NavigationMode } from "./types";
1755
+ import { OrthoPerspectiveCamera } from "../index";
1568
1756
  /**
1569
- * Simple event handler by
1570
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1571
- * Keep in mind that:
1572
- * - If you want to remove it later, you might want to declare the callback as
1573
- * an object.
1574
- * - If you want to maintain the reference to 'this', you will need to declare
1575
- * the callback as an arrow function.
1576
- */
1577
- export declare class AsyncEvent<T> {
1578
- /**
1579
- * Add a callback to this event instance.
1580
- * @param handler - the callback to be added to this event.
1581
- */
1582
- add(handler: T extends void ? {
1583
- (): Promise<void>;
1584
- } : {
1585
- (data: T): Promise<void>;
1586
- }): void;
1587
- /**
1588
- * Removes a callback from this event instance.
1589
- * @param handler - the callback to be removed from this event.
1590
- */
1591
- remove(handler: T extends void ? {
1592
- (): Promise<void>;
1593
- } : {
1594
- (data: T): Promise<void>;
1595
- }): void;
1596
- /** Triggers all the callbacks assigned to this event. */
1597
- trigger: (data?: T) => Promise<void>;
1598
- /** Gets rid of all the suscribed events. */
1599
- reset(): void;
1600
- private handlers;
1601
- }
1602
- import { Base } from "./base";
1603
- /**
1604
- * Components are the building blocks of this library. Components are singleton
1605
- * elements that contain specific functionality. For instance, the SimpleClipper
1606
- * Component can create, delete and handle 3D clipping planes. Components must be
1607
- * unique (they can't be instanced more than once), and have a static UUID that
1608
- * identifies them uniquely. The can be accessed globally using the {@link Components}
1609
- * instance.
1610
- */
1611
- export declare abstract class Component extends Base {
1612
- /**
1613
- * Whether this component is active or not. The behaviour can vary depending
1614
- * on the type of component. E.g. a disabled dimension tool will stop creating
1615
- * dimensions, while a disabled camera will stop moving. A disabled component
1616
- * will not be updated automatically each frame.
1617
- */
1618
- abstract enabled: boolean;
1619
- }
1620
- import * as THREE from "three";
1621
- import CameraControls from "camera-controls";
1622
- import { Event } from "./event";
1623
- /**
1624
- * Whether this component has to be manually destroyed once you are done with
1625
- * it to prevent
1626
- * [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1627
- * This also ensures that the DOM events created by that component will be
1628
- * cleaned up.
1629
- */
1630
- export interface Disposable {
1631
- /**
1632
- * Destroys the object from memory to prevent a
1633
- * [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
1634
- */
1635
- dispose: () => void | Promise<void>;
1636
- /** Fired after the tool has been {@link Disposable.dispose()} */
1637
- readonly onDisposed: Event<any>;
1638
- }
1639
- /**
1640
- * Whether the geometric representation of this component can be
1641
- * hidden or shown in the
1642
- * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
1643
- */
1644
- export interface Hideable {
1645
- /**
1646
- * Whether the geometric representation of this component is
1647
- * currently visible or not in the
1648
- * [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
1649
- */
1650
- visible: boolean;
1651
- }
1652
- /**
1653
- * Whether this component can be resized. The meaning of this can vary depending
1654
- * on the component: resizing a
1655
- * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
1656
- * component could mean changing its resolution, whereas resizing a
1657
- * [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
1658
- */
1659
- export interface Resizeable {
1660
- /**
1661
- * Sets size of this component (e.g. the resolution of a
1662
- * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
1663
- * component.
1664
- */
1665
- resize: (size?: THREE.Vector2) => void;
1666
- /** Event that fires when the component has been resized. */
1667
- onResize: Event<THREE.Vector2>;
1668
- /**
1669
- * Gets the current size of this component (e.g. the resolution of a
1670
- * [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
1671
- * component.
1672
- */
1673
- getSize: () => THREE.Vector2;
1674
- }
1675
- /** Whether this component should be updated each frame. */
1676
- export interface Updateable {
1677
- /** Actions that should be executed after updating the component. */
1678
- onAfterUpdate: Event<any>;
1679
- /** Actions that should be executed before updating the component. */
1680
- onBeforeUpdate: Event<any>;
1681
- /**
1682
- * Function used to update the state of this component each frame. For
1683
- * instance, a renderer component will make a render each frame.
1684
- */
1685
- update(delta?: number): void;
1686
- }
1687
- /** Basic type to describe the progress of any kind of process. */
1688
- export interface Progress {
1689
- /** The amount of things that have been done already. */
1690
- current: number;
1691
- /** The total amount of things to be done by the process. */
1692
- total: number;
1693
- }
1694
- /**
1695
- * Whether this component supports create and destroy operations. This generally
1696
- * applies for components that work with instances, such as clipping planes or
1697
- * dimensions.
1698
- */
1699
- export interface Createable {
1700
- /** Creates a new instance of an element (e.g. a new Dimension). */
1701
- create: (data: any) => void;
1702
- /**
1703
- * Finish the creation process of the component, successfully creating an
1704
- * instance of whatever the component creates.
1705
- */
1706
- endCreation?: (data: any) => void;
1707
- /**
1708
- * Cancels the creation process of the component, going back to the state
1709
- * before starting to create.
1710
- */
1711
- cancelCreation?: (data: any) => void;
1712
- /** Deletes an existing instance of an element (e.g. a Dimension). */
1713
- delete: (data: any) => void;
1714
- }
1715
- /**
1716
- * Whether this component supports to be configured.
1717
- */
1718
- export interface Configurable<T extends Record<string, any>> {
1719
- /** Wether this components has been already configured. */
1720
- isSetup: boolean;
1721
- /** Use the provided configuration to setup the tool. */
1722
- setup: (config?: Partial<T>) => void | Promise<void>;
1723
- /** Fired after successfully calling {@link Configurable.setup()} */
1724
- readonly onSetup: Event<any>;
1725
- /** Object holding the tool configuration. Is not meant to be edited directly, if you need
1726
- * to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
1727
- */
1728
- config: Required<T>;
1729
- }
1730
- /**
1731
- * An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
1732
- */
1733
- export interface BVHGeometry extends THREE.BufferGeometry {
1734
- boundsTree: Object | undefined;
1735
- disposeBoundsTree: () => void;
1736
- }
1737
- /**
1738
- * Whether a camera uses the Camera Controls library.
1739
- */
1740
- export interface CameraControllable {
1741
- controls: CameraControls;
1742
- }
1743
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1744
- import { Components } from "../../Components";
1745
- /**
1746
- * Base class of the library. Useful for finding out the interfaces it implements.
1757
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1758
+ * like many BIM tools.
1747
1759
  */
1748
- export declare abstract class Base {
1749
- components: Components;
1750
- constructor(components: Components);
1751
- /** Whether is component is {@link Disposable}. */
1752
- isDisposeable: () => this is Disposable;
1753
- /** Whether is component is {@link Resizeable}. */
1754
- isResizeable: () => this is Resizeable;
1755
- /** Whether is component is {@link Updateable}. */
1756
- isUpdateable: () => this is Updateable;
1757
- /** Whether is component is {@link Hideable}. */
1758
- isHideable: () => this is Hideable;
1759
- /** Whether is component is {@link Configurable}. */
1760
- isConfigurable: () => this is Configurable<any>;
1760
+ export declare class PlanMode implements NavigationMode {
1761
+ private camera;
1762
+ /** {@link NavigationMode.enabled} */
1763
+ enabled: boolean;
1764
+ /** {@link NavigationMode.id} */
1765
+ readonly id = "Plan";
1766
+ private mouseAction1?;
1767
+ private mouseAction2?;
1768
+ private mouseInitialized;
1769
+ private readonly defaultAzimuthSpeed;
1770
+ private readonly defaultPolarSpeed;
1771
+ constructor(camera: OrthoPerspectiveCamera);
1772
+ /** {@link NavigationMode.set} */
1773
+ set(active: boolean): void;
1761
1774
  }
1762
- import { Base } from "./base";
1763
- import { World } from "./world";
1764
- import { Event } from "./event";
1765
- import { Components } from "../../Components";
1775
+ import { NavigationMode } from "./types";
1776
+ import { OrthoPerspectiveCamera } from "../index";
1766
1777
  /**
1767
- * One of the elements that make a world. It can be either a scene, a camera
1768
- * or a renderer.
1778
+ * A {@link NavigationMode} that allows first person navigation,
1779
+ * simulating FPS video games.
1769
1780
  */
1770
- export declare abstract class BaseWorldItem extends Base {
1771
- readonly worlds: Map<string, World>;
1772
- readonly onWorldChanged: Event<{
1773
- world: World;
1774
- action: "added" | "removed";
1775
- }>;
1776
- currentWorld: World | null;
1777
- protected constructor(components: Components);
1778
- }
1779
- import * as THREE from "three";
1780
- import CameraControls from "camera-controls";
1781
- import { BaseWorldItem } from "./base-world-item";
1782
- import { CameraControllable } from "./interfaces";
1783
- export declare abstract class BaseCamera extends BaseWorldItem {
1784
- abstract enabled: boolean;
1785
- abstract three: THREE.Camera;
1786
- abstract controls?: CameraControls;
1787
- /** Whether is instance is {@link CameraControllable}. */
1788
- hasCameraControls: () => this is CameraControllable;
1781
+ export declare class FirstPersonMode implements NavigationMode {
1782
+ private camera;
1783
+ /** {@link NavigationMode.enabled} */
1784
+ enabled: boolean;
1785
+ /** {@link NavigationMode.id} */
1786
+ readonly id = "FirstPerson";
1787
+ constructor(camera: OrthoPerspectiveCamera);
1788
+ /** {@link NavigationMode.set} */
1789
+ set(active: boolean): void;
1790
+ private setupFirstPersonCamera;
1789
1791
  }
1790
1792
  import * as THREE from "three";
1791
- import { Vector2 } from "three";
1792
- import { Event } from "./event";
1793
- import { BaseWorldItem } from "./base-world-item";
1794
- import { Disposable, Resizeable, Updateable } from "./interfaces";
1795
- export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
1796
- abstract three: THREE.WebGLRenderer;
1797
- /** {@link Updateable.onBeforeUpdate} */
1798
- onAfterUpdate: Event<unknown>;
1799
- /** {@link Updateable.onAfterUpdate} */
1800
- onBeforeUpdate: Event<unknown>;
1801
- /** {@link Disposable.onDisposed} */
1802
- readonly onDisposed: Event<undefined>;
1803
- readonly onResize: Event<THREE.Vector2>;
1804
- /**
1805
- * Event that fires when there has been a change to the list of clipping
1806
- * planes used by the active renderer.
1807
- */
1808
- readonly onClippingPlanesUpdated: Event<unknown>;
1809
- abstract update(delta?: number): void | Promise<void>;
1810
- abstract dispose(): void;
1811
- abstract getSize(): Vector2;
1812
- abstract resize(size: Vector2 | undefined): void;
1793
+ import { CameraProjection } from "./types";
1794
+ import { Event } from "../../Types";
1795
+ import { OrthoPerspectiveCamera } from "../index";
1796
+ /**
1797
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1798
+ */
1799
+ export declare class ProjectionManager {
1813
1800
  /**
1814
- * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
1815
- * instance of the renderer.
1801
+ * Event that fires when the {@link CameraProjection} changes.
1816
1802
  */
1817
- clippingPlanes: THREE.Plane[];
1803
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1804
+ current: CameraProjection;
1805
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1806
+ private _component;
1807
+ private _previousDistance;
1808
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
1809
+ matchOrthoDistanceEnabled: boolean;
1810
+ constructor(camera: OrthoPerspectiveCamera);
1818
1811
  /**
1819
- * Forces the update of the clipping planes and all components that depend
1820
- * on them that are subscribed to 'onClippingPlanesUpdated'.
1812
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1813
+ *
1814
+ * @param projection - the new projection to set. If it is the current projection,
1815
+ * it will have no effect.
1821
1816
  */
1822
- updateClippingPlanes(): void;
1817
+ set(projection: CameraProjection): Promise<void>;
1823
1818
  /**
1824
- * Adds or removes a
1825
- * [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
1826
- * to the renderer.
1819
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
1820
+ * and vice versa.
1827
1821
  */
1828
- setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1822
+ toggle(): Promise<void>;
1823
+ private setOrthoCamera;
1824
+ private getPerspectiveDims;
1825
+ private setupOrthoCamera;
1826
+ private getDistance;
1827
+ private setPerspectiveCamera;
1829
1828
  }
1830
- import * as THREE from "three";
1831
- import { Disposable } from "./interfaces";
1832
- import { Event } from "./event";
1833
- import { Components } from "../../Components";
1834
- import { BaseWorldItem } from "./base-world-item";
1835
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1836
- /** {@link Disposable.onDisposed} */
1837
- readonly onDisposed: Event<unknown>;
1838
- abstract three: THREE.Object3D;
1839
- protected constructor(components: Components);
1840
- /** {@link Disposable.dispose} */
1841
- dispose(): void;
1829
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
1830
+ /** Configuration of the IFC-fragment streaming. */
1831
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1832
+ minGeometrySize: number;
1833
+ minAssetsSize: number;
1842
1834
  }
1843
- import * as THREE from "three";
1844
- import { BaseScene } from "./base-scene";
1845
- import { BaseCamera } from "./base-camera";
1846
- import { BaseRenderer } from "./base-renderer";
1847
- import { Updateable, Disposable } from "./interfaces";
1848
- export interface World extends Disposable, Updateable {
1849
- meshes: Set<THREE.Mesh>;
1850
- scene: BaseScene;
1851
- camera: BaseCamera;
1852
- renderer: BaseRenderer | null;
1853
- uuid: string;
1854
- isDisposing: boolean;
1835
+ /** Configuration of the IFC-fragment streaming. */
1836
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1837
+ propertiesSize: number;
1855
1838
  }
1856
- import * as WEBIFC from "web-ifc";
1857
- /** Configuration of the IFC-fragment conversion. */
1858
- export declare class IfcFragmentSettings {
1859
- /** Whether to extract the IFC properties into a JSON. */
1860
- includeProperties: boolean;
1839
+ /**
1840
+ * The projection system of the camera.
1841
+ */
1842
+ export type CameraProjection = "Perspective" | "Orthographic";
1843
+ /**
1844
+ * The extensible list of supported navigation modes.
1845
+ */
1846
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1847
+ /**
1848
+ * An object that determines the behavior of the camera controls
1849
+ * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1850
+ */
1851
+ export interface NavigationMode {
1852
+ /** The unique ID of this navigation mode. */
1853
+ id: NavModeID;
1861
1854
  /**
1862
- * Generate the geometry for categories that are not included by default,
1863
- * like IFCSPACE.
1864
- */
1865
- optionalCategories: number[];
1866
- /** Whether to use the coordination data coming from the IFC files. */
1867
- coordinate: boolean;
1868
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1869
- wasm: {
1870
- path: string;
1871
- absolute: boolean;
1872
- logLevel?: WEBIFC.LogLevel;
1873
- };
1874
- /** List of categories that won't be converted to fragments. */
1875
- excludedCategories: Set<number>;
1876
- /** Whether to save the absolute location of all IFC items. */
1877
- saveLocations: boolean;
1878
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1879
- webIfc: WEBIFC.LoaderSettings;
1880
- autoSetWasm: boolean;
1881
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1855
+ * Enable or disable this navigation mode.
1856
+ * When a new navigation mode is enabled, the previous navigation mode
1857
+ * must be disabled.
1858
+ *
1859
+ * @param active - whether to enable or disable this mode.
1860
+ * @param options - any additional data required to enable or disable it.
1861
+ * */
1862
+ set: (active: boolean, options?: any) => void;
1863
+ /** Whether this navigation mode is active or not. */
1864
+ enabled: boolean;
1882
1865
  }
1883
- import * as THREE from "three";
1884
- import * as WEBIFC from "web-ifc";
1885
- import * as FRAGS from "@thatopen/fragments";
1886
- export declare class CivilReader {
1887
- defLineMat: THREE.LineBasicMaterial;
1888
- read(webIfc: WEBIFC.IfcAPI): {
1889
- alignments: Map<number, FRAGS.Alignment>;
1890
- coordinationMatrix: THREE.Matrix4;
1891
- } | undefined;
1892
- get(civilItems: any): {
1893
- alignments: Map<number, FRAGS.Alignment>;
1894
- coordinationMatrix: THREE.Matrix4;
1895
- } | undefined;
1896
- private getCurves;
1866
+ export interface StreamedGeometries {
1867
+ [id: number]: {
1868
+ boundingBox: Float32Array;
1869
+ hasHoles: boolean;
1870
+ geometryFile?: string;
1871
+ };
1897
1872
  }
1898
- import * as WEBIFC from "web-ifc";
1899
- export declare class IfcMetadataReader {
1900
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1873
+ export interface StreamedAsset {
1874
+ id: number;
1875
+ geometries: {
1876
+ geometryID: number;
1877
+ transformation: number[];
1878
+ color: number[];
1879
+ }[];
1901
1880
  }
1902
1881
  import * as WEBIFC from "web-ifc";
1903
1882
  import { AsyncEvent, Component, Disposable, Event } from "../../../core";
@@ -1926,30 +1905,46 @@ export declare class FragmentPropsStreamConverter extends Component implements D
1926
1905
  private getIndices;
1927
1906
  private cleanUp;
1928
1907
  }
1929
- export interface StreamedGeometries {
1930
- [id: number]: {
1931
- boundingBox: Float32Array;
1932
- hasHoles: boolean;
1933
- geometryFile?: string;
1908
+ import * as WEBIFC from "web-ifc";
1909
+ /** Configuration of the IFC-fragment conversion. */
1910
+ export declare class IfcFragmentSettings {
1911
+ /** Whether to extract the IFC properties into a JSON. */
1912
+ includeProperties: boolean;
1913
+ /**
1914
+ * Generate the geometry for categories that are not included by default,
1915
+ * like IFCSPACE.
1916
+ */
1917
+ optionalCategories: number[];
1918
+ /** Whether to use the coordination data coming from the IFC files. */
1919
+ coordinate: boolean;
1920
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1921
+ wasm: {
1922
+ path: string;
1923
+ absolute: boolean;
1924
+ logLevel?: WEBIFC.LogLevel;
1934
1925
  };
1926
+ /** List of categories that won't be converted to fragments. */
1927
+ excludedCategories: Set<number>;
1928
+ /** Whether to save the absolute location of all IFC items. */
1929
+ saveLocations: boolean;
1930
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1931
+ webIfc: WEBIFC.LoaderSettings;
1932
+ autoSetWasm: boolean;
1933
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1935
1934
  }
1936
- export interface StreamedAsset {
1937
- id: number;
1938
- geometries: {
1939
- geometryID: number;
1940
- transformation: number[];
1941
- color: number[];
1942
- }[];
1943
- }
1944
- import { IfcFragmentSettings } from "../../IfcLoader/src";
1945
- /** Configuration of the IFC-fragment streaming. */
1946
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1947
- minGeometrySize: number;
1948
- minAssetsSize: number;
1935
+ import * as WEBIFC from "web-ifc";
1936
+ import * as THREE from "three";
1937
+ export declare class Units {
1938
+ factor: number;
1939
+ complement: number;
1940
+ apply(matrix: THREE.Matrix4): void;
1941
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1942
+ private getLengthUnits;
1943
+ private getScaleMatrix;
1949
1944
  }
1950
- /** Configuration of the IFC-fragment streaming. */
1951
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1952
- propertiesSize: number;
1945
+ import * as WEBIFC from "web-ifc";
1946
+ export declare class IfcMetadataReader {
1947
+ get(webIfc: WEBIFC.IfcAPI, type: number): string;
1953
1948
  }
1954
1949
  export type RelationsMap = Map<number, Map<number, number[]>>;
1955
1950
  export interface ModelsRelationMap {
@@ -1980,15 +1975,20 @@ import * as THREE from "three";
1980
1975
  export declare class TransformHelper {
1981
1976
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
1982
1977
  }
1983
- import * as WEBIFC from "web-ifc";
1984
1978
  import * as THREE from "three";
1985
- export declare class Units {
1986
- factor: number;
1987
- complement: number;
1988
- apply(matrix: THREE.Matrix4): void;
1989
- setUp(webIfc: WEBIFC.IfcAPI): void;
1990
- private getLengthUnits;
1991
- private getScaleMatrix;
1979
+ import * as WEBIFC from "web-ifc";
1980
+ import * as FRAGS from "@thatopen/fragments";
1981
+ export declare class CivilReader {
1982
+ defLineMat: THREE.LineBasicMaterial;
1983
+ read(webIfc: WEBIFC.IfcAPI): {
1984
+ alignments: Map<number, FRAGS.Alignment>;
1985
+ coordinationMatrix: THREE.Matrix4;
1986
+ } | undefined;
1987
+ get(civilItems: any): {
1988
+ alignments: Map<number, FRAGS.Alignment>;
1989
+ coordinationMatrix: THREE.Matrix4;
1990
+ } | undefined;
1991
+ private getCurves;
1992
1992
  }
1993
1993
 
1994
1994
  }