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

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 (44) hide show
  1. package/dist/core/Clipper/index.d.ts +8 -12
  2. package/dist/core/Clipper/src/simple-plane.d.ts +2 -2
  3. package/dist/core/Cullers/index.d.ts +32 -2
  4. package/dist/core/Grids/index.d.ts +1 -1
  5. package/dist/core/Grids/src/simple-grid.d.ts +1 -3
  6. package/dist/core/MiniMap/index.d.ts +3 -2
  7. package/dist/core/MiniMap/src/index.d.ts +1 -1
  8. package/dist/core/OrthoPerspectiveCamera/index.d.ts +5 -4
  9. package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +2 -1
  10. package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +3 -2
  11. package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +2 -1
  12. package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +3 -3
  13. package/dist/core/Raycasters/src/simple-raycaster.d.ts +1 -1
  14. package/dist/core/Worlds/index.d.ts +35 -0
  15. package/dist/core/Worlds/src/simple-camera.d.ts +1 -1
  16. package/dist/core/Worlds/src/simple-renderer.d.ts +1 -1
  17. package/dist/core/index.d.ts +0 -1
  18. package/dist/fragments/{BoundingBoxes → BoundingBoxer}/index.d.ts +1 -1
  19. package/dist/fragments/{FragmentClassifier → Classifier}/index.d.ts +1 -1
  20. package/dist/fragments/{FragmentExploder → Exploder}/index.d.ts +3 -5
  21. package/dist/fragments/{FragmentManager → FragmentsManager}/index.d.ts +1 -1
  22. package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +1 -1
  23. package/dist/fragments/{FragmentIfcLoader → IfcLoader}/index.d.ts +1 -2
  24. package/dist/fragments/index.d.ts +6 -6
  25. package/dist/ifc/IfcJsonExporter/index.d.ts +6 -1
  26. package/dist/ifc/IfcPropertiesManager/index.d.ts +1 -2
  27. package/dist/ifc/index.d.ts +0 -1
  28. package/dist/index.cjs +5 -5
  29. package/dist/index.mjs +1903 -2088
  30. package/dist/measurement/Utils/index.d.ts +9 -5
  31. package/dist/namespace.d.ts +802 -845
  32. package/dist/utils/vertex-picker.d.ts +2 -5
  33. package/package.json +3 -4
  34. package/dist/core/Materials/index.d.ts +0 -49
  35. package/dist/ifc/IfcPropertiesFinder/index.d.ts +0 -37
  36. package/dist/ifc/IfcPropertiesFinder/src/types.d.ts +0 -23
  37. /package/dist/fragments/{FragmentHider → Hider}/index.d.ts +0 -0
  38. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/civil-reader.d.ts +0 -0
  39. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/ifc-fragment-settings.d.ts +0 -0
  40. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/ifc-metadata-reader.d.ts +0 -0
  41. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/index.d.ts +0 -0
  42. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/spatial-structure.d.ts +0 -0
  43. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/transform-helper.d.ts +0 -0
  44. /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/units.d.ts +0 -0
@@ -1,82 +1,4 @@
1
1
  declare namespace OBC {
2
- import { Component, Disposable, World, Event } from "../Types";
3
- import { SimpleRaycaster } from "./src";
4
- import { Components } from "../Components";
5
- export declare class Raycasters extends Component implements Disposable {
6
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
7
- enabled: boolean;
8
- list: Map<string, SimpleRaycaster>;
9
- onDisposed: Event<unknown>;
10
- constructor(components: Components);
11
- get(world: World): SimpleRaycaster;
12
- delete(world: World): void;
13
- dispose(): void;
14
- }
15
- import { Component, Disposable, Event } from "../Types";
16
- /**
17
- * The entry point of the Components library.
18
- * It can:
19
- * - Create and access all the components of the library.
20
- * - Update all the updatable components automatically.
21
- * - Dispose all the components, preventing memory leaks.
22
- */
23
- export declare class Components implements Disposable {
24
- static readonly release = "1.4.21";
25
- /** {@link Disposable.onDisposed} */
26
- readonly onDisposed: Event<void>;
27
- /** The list of components created in this app. */
28
- readonly list: Map<string, Component>;
29
- /** If disabled, the animation loop will be stopped. */
30
- enabled: boolean;
31
- private _clock;
32
- add(uuid: string, instance: Component): void;
33
- /**
34
- * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
35
- * doesn't exist, it will instance it automatically.
36
- *
37
- * @param Component - The component to get or create.
38
- */
39
- get<U extends Component>(Component: new (components: Components) => U): U;
40
- constructor();
41
- /**
42
- * Initializes the library. It should be called at the start of the app after
43
- * initializing the scene, the renderer and the
44
- * camera. Additionally, if any component that need a raycaster is
45
- * used, the {@link raycaster} will need to be initialized.
46
- */
47
- init(): void;
48
- /**
49
- * Disposes the memory of all the components and tools of this instance of
50
- * the library. A memory leak will be created if:
51
- *
52
- * - An instance of the library ends up out of scope and this function isn't
53
- * called. This is especially relevant in Single Page Applications (React,
54
- * Angular, Vue, etc).
55
- *
56
- * - Any of the objects of this instance (meshes, geometries, etc) is
57
- * referenced by a reference type (object or array).
58
- *
59
- * You can learn more about how Three.js handles memory leaks
60
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
61
- *
62
- */
63
- dispose(): void;
64
- private update;
65
- private static setupBVH;
66
- }
67
- import { Component, Disposable, World, Event } from "../Types";
68
- import { GridConfig, SimpleGrid } from "./src";
69
- export declare class Grids extends Component implements Disposable {
70
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
71
- list: Map<string, SimpleGrid>;
72
- onDisposed: Event<unknown>;
73
- config: Required<GridConfig>;
74
- /** {@link Component.enabled} */
75
- enabled: boolean;
76
- create(world: World): void;
77
- delete(world: World): void;
78
- dispose(): void;
79
- }
80
2
  import * as THREE from "three";
81
3
  import { Components } from "../Components";
82
4
  import { Component } from "../Types";
@@ -120,22 +42,99 @@ export declare class Disposer extends Component {
120
42
  private disposeChildren;
121
43
  private static disposeMaterial;
122
44
  }
45
+ import { Component, Disposable, World, Event } from "../Types";
46
+ import { SimpleRaycaster } from "./src";
47
+ import { Components } from "../Components";
48
+ export declare class Raycasters extends Component implements Disposable {
49
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
50
+ enabled: boolean;
51
+ list: Map<string, SimpleRaycaster>;
52
+ onDisposed: Event<unknown>;
53
+ constructor(components: Components);
54
+ get(world: World): SimpleRaycaster;
55
+ delete(world: World): void;
56
+ dispose(): void;
57
+ }
123
58
  import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
124
59
  import { Components } from "../Components";
125
60
  import { SimpleWorld } from "./src";
126
61
  export declare class Worlds extends Component implements Updateable, Disposable {
62
+ /**
63
+ * A unique identifier for the component.
64
+ * This UUID is used to register the component within the Components system.
65
+ */
127
66
  static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
67
+ /**
68
+ * Event triggered after the update process of all worlds.
69
+ * Subscribers can listen to this event to perform actions post-update.
70
+ */
128
71
  readonly onAfterUpdate: Event<unknown>;
72
+ /**
73
+ * Event triggered before the update process of all worlds.
74
+ * Subscribers can listen to this event to perform actions pre-update.
75
+ */
129
76
  readonly onBeforeUpdate: Event<unknown>;
77
+ /**
78
+ * Event triggered when the Worlds component is disposed.
79
+ * Subscribers can listen to this event to perform cleanup actions.
80
+ */
130
81
  readonly onDisposed: Event<unknown>;
82
+ /**
83
+ * A collection of worlds managed by this component.
84
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
85
+ */
131
86
  list: Map<string, World>;
87
+ /**
88
+ * A flag indicating whether the Worlds component is enabled.
89
+ * If false, the update process will be skipped.
90
+ */
132
91
  enabled: boolean;
133
92
  constructor(components: Components);
93
+ /**
94
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
95
+ *
96
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
97
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
98
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
99
+ *
100
+ * @returns {SimpleWorld<T, U, S>} - The newly created SimpleWorld instance.
101
+ *
102
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
103
+ */
134
104
  create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
135
105
  delete(world: World): void;
136
106
  dispose(): void;
137
107
  update(delta?: number): void | Promise<void>;
138
108
  }
109
+ import { MiniMap } from "./src";
110
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
111
+ import { Components } from "../Components";
112
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
113
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
114
+ readonly onAfterUpdate: Event<unknown>;
115
+ readonly onBeforeUpdate: Event<unknown>;
116
+ readonly onDisposed: Event<unknown>;
117
+ enabled: boolean;
118
+ list: Map<string, MiniMap>;
119
+ constructor(components: Components);
120
+ create(world: World): MiniMap;
121
+ delete(id: string): void;
122
+ dispose(): void;
123
+ update(): void;
124
+ }
125
+ import { Component, Disposable, World, Event } from "../Types";
126
+ import { GridConfig, SimpleGrid } from "./src";
127
+ export declare class Grids extends Component implements Disposable {
128
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
129
+ list: Map<string, SimpleGrid>;
130
+ onDisposed: Event<unknown>;
131
+ config: Required<GridConfig>;
132
+ /** {@link Component.enabled} */
133
+ enabled: boolean;
134
+ create(world: World): SimpleGrid;
135
+ delete(world: World): void;
136
+ dispose(): void;
137
+ }
139
138
  import * as THREE from "three";
140
139
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
141
140
  import { SimplePlane } from "./src";
@@ -145,15 +144,14 @@ import { Components } from "../Components";
145
144
  * [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
146
145
  *
147
146
  * @param components - the instance of {@link Components} used.
148
- * @param planeType - the type of plane to be used by the clipper.
149
147
  * E.g. {@link SimplePlane}.
150
148
  */
151
- export declare class Clipper<T extends SimplePlane> extends Component implements Createable, Disposable, Hideable {
149
+ export declare class Clipper extends Component implements Createable, Disposable, Hideable {
152
150
  static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
153
151
  /** {@link Createable.onAfterCreate} */
154
- readonly onAfterCreate: Event<T>;
152
+ readonly onAfterCreate: Event<SimplePlane>;
155
153
  /** {@link Createable.onAfterDelete} */
156
- readonly onAfterDelete: Event<T>;
154
+ readonly onAfterDelete: Event<SimplePlane>;
157
155
  /** Event that fires when the user starts dragging a clipping plane. */
158
156
  readonly onBeforeDrag: Event<void>;
159
157
  /** Event that fires when the user stops dragging a clipping plane. */
@@ -177,10 +175,10 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
177
175
  * has to be 'true' for this to apply.
178
176
  */
179
177
  toleranceOrthogonalY: number;
180
- list: T[];
181
- protected PlaneType: new (...args: any) => SimplePlane | T;
178
+ Type: new (...args: any) => SimplePlane;
179
+ list: SimplePlane[];
182
180
  /** The material used in all the clipping planes. */
183
- protected _material: THREE.MeshBasicMaterial;
181
+ private _material;
184
182
  private _size;
185
183
  private _enabled;
186
184
  private _visible;
@@ -201,8 +199,6 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
201
199
  /** The size of the geometric representation of the clippings planes. */
202
200
  set size(size: number);
203
201
  constructor(components: Components);
204
- endCreation(): void;
205
- cancelCreation(): void;
206
202
  /** {@link Disposable.dispose} */
207
203
  dispose(): void;
208
204
  /** {@link Createable.create} */
@@ -216,7 +212,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
216
212
  * @param point - the position of the clipping plane.
217
213
  * navigation.
218
214
  */
219
- createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): T;
215
+ createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
220
216
  /**
221
217
  * {@link Createable.delete}
222
218
  *
@@ -224,7 +220,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
224
220
  * @param plane - the plane to delete. If undefined, the first plane
225
221
  * found under the cursor will be deleted.
226
222
  */
227
- delete(world: World, plane?: T): void;
223
+ delete(world: World, plane?: SimplePlane): void;
228
224
  /** Deletes all the existing clipping planes. */
229
225
  deleteAll(): void;
230
226
  private deletePlane;
@@ -234,74 +230,61 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
234
230
  private getWorldNormal;
235
231
  private normalizePlaneDirectionY;
236
232
  private newPlane;
237
- protected newPlaneInstance(world: World, point: THREE.Vector3, normal: THREE.Vector3): T;
238
233
  private updateMaterialsAndPlanes;
239
234
  private _onStartDragging;
240
235
  private _onEndDragging;
241
236
  }
242
- import * as THREE from "three";
243
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
244
- center: THREE.Vector3;
245
- halfSizes: THREE.Vector3;
246
- rotation: THREE.Matrix3;
247
- transformation: THREE.Matrix4;
248
- };
249
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
250
- import * as THREE from "three";
251
- export declare class MaterialsUtils {
252
- static isTransparent(material: THREE.Material): boolean;
253
- }
254
- import * as THREE from "three";
255
- import { Component, Components, Event, World, Disposable } from "../core";
256
- export interface VertexPickerConfig {
257
- showOnlyVertex: boolean;
258
- snapDistance: number;
259
- previewElement: HTMLElement;
260
- }
261
- export declare class VertexPicker extends Component implements Disposable {
262
- onVertexFound: Event<THREE.Vector3>;
263
- onVertexLost: Event<THREE.Vector3>;
264
- components: Components;
265
- private _pickedPoint;
266
- private _config;
267
- private _enabled;
268
- private _workingPlane;
237
+ import { Component, Disposable, Event } from "../Types";
238
+ /**
239
+ * The entry point of the Components library.
240
+ * It can:
241
+ * - Create and access all the components of the library.
242
+ * - Update all the updatable components automatically.
243
+ * - Dispose all the components, preventing memory leaks.
244
+ */
245
+ export declare class Components implements Disposable {
246
+ static readonly release = "1.4.21";
269
247
  /** {@link Disposable.onDisposed} */
270
- readonly onDisposed: Event<unknown>;
271
- set enabled(value: boolean);
272
- get enabled(): boolean;
273
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
274
- [Symbol.dispose](): void;
275
- set workingPlane(plane: THREE.Plane | null);
276
- get workingPlane(): THREE.Plane | null;
277
- set config(value: Partial<VertexPickerConfig>);
278
- get config(): Partial<VertexPickerConfig>;
279
- dispose(): void;
280
- get(world: World): THREE.Vector3 | null;
281
- private getClosestVertex;
282
- private getVertices;
283
- private getVertex;
284
- }
285
- export declare class UUID {
286
- private static _pattern;
287
- private static _lut;
288
- static create(): string;
289
- static validate(uuid: string): void;
290
- }
291
- import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
292
- import { MiniMap } from "./src";
293
- export declare class MiniMaps extends Component implements Updateable, Disposable {
294
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
295
- readonly onAfterUpdate: Event<unknown>;
296
- readonly onBeforeUpdate: Event<unknown>;
297
- readonly onDisposed: Event<unknown>;
248
+ readonly onDisposed: Event<void>;
249
+ /** The list of components created in this app. */
250
+ readonly list: Map<string, Component>;
251
+ /** If disabled, the animation loop will be stopped. */
298
252
  enabled: boolean;
299
- list: Map<string, MiniMap>;
300
- constructor(components: Components);
301
- create(world: World): MiniMap;
302
- delete(id: string): void;
303
- dispose(): void | Promise<void>;
304
- update(): void;
253
+ private _clock;
254
+ add(uuid: string, instance: Component): void;
255
+ /**
256
+ * Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
257
+ * doesn't exist, it will instance it automatically.
258
+ *
259
+ * @param Component - The component to get or create.
260
+ */
261
+ get<U extends Component>(Component: new (components: Components) => U): U;
262
+ constructor();
263
+ /**
264
+ * Initializes the library. It should be called at the start of the app after
265
+ * initializing the scene, the renderer and the
266
+ * camera. Additionally, if any component that need a raycaster is
267
+ * used, the {@link raycaster} will need to be initialized.
268
+ */
269
+ init(): void;
270
+ /**
271
+ * Disposes the memory of all the components and tools of this instance of
272
+ * the library. A memory leak will be created if:
273
+ *
274
+ * - An instance of the library ends up out of scope and this function isn't
275
+ * called. This is especially relevant in Single Page Applications (React,
276
+ * Angular, Vue, etc).
277
+ *
278
+ * - Any of the objects of this instance (meshes, geometries, etc) is
279
+ * referenced by a reference type (object or array).
280
+ *
281
+ * You can learn more about how Three.js handles memory leaks
282
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
283
+ *
284
+ */
285
+ dispose(): void;
286
+ private update;
287
+ private static setupBVH;
305
288
  }
306
289
  import { Components } from "../Components";
307
290
  import { MeshCullerRenderer, CullerRendererSettings } from "./src";
@@ -311,23 +294,53 @@ import { Component, Event, Disposable, World } from "../Types";
311
294
  * that are not visible to the camera.
312
295
  */
313
296
  export declare class Cullers extends Component implements Disposable {
297
+ /**
298
+ * A unique identifier for the Cullers component.
299
+ */
314
300
  static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
301
+ /**
302
+ * Indicates whether the Cullers component is enabled.
303
+ */
315
304
  private _enabled;
305
+ /**
306
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
307
+ */
316
308
  list: Map<string, MeshCullerRenderer>;
317
- /** {@link Disposable.onDisposed} */
309
+ /**
310
+ * An event that is triggered when the Cullers component is disposed.
311
+ */
318
312
  readonly onDisposed: Event<unknown>;
319
- /** {@link Component.enabled} */
313
+ /**
314
+ * Gets the enabled state of the Cullers component.
315
+ *
316
+ * @returns The current enabled state.
317
+ */
320
318
  get enabled(): boolean;
319
+ /**
320
+ * Sets the enabled state of the Cullers component.
321
+ * Also sets the enabled state of all MeshCullerRenderer instances.
322
+ *
323
+ * @param value - The new enabled state.
324
+ */
321
325
  set enabled(value: boolean);
322
326
  constructor(components: Components);
327
+ /**
328
+ * Creates a new MeshCullerRenderer for the given world.
329
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
330
+ *
331
+ * @param world - The world for which to create the MeshCullerRenderer.
332
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
333
+ *
334
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
335
+ */
323
336
  create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
324
337
  delete(world: World): void;
325
338
  /** {@link Disposable.dispose} */
326
339
  dispose(): void;
327
340
  }
328
341
  import * as THREE from "three";
329
- import { Components } from "../../core/Components";
330
- import { SimpleCamera } from "../../core";
342
+ import { Components } from "../Components";
343
+ import { SimpleCamera } from "..";
331
344
  import { NavigationMode, NavModeID, ProjectionManager } from "./src";
332
345
  /**
333
346
  * A flexible camera that uses
@@ -339,13 +352,14 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
339
352
  /**
340
353
  * The current {@link NavigationMode}.
341
354
  */
342
- mode: NavigationMode;
355
+ _mode: NavigationMode | null;
343
356
  readonly projection: ProjectionManager;
344
357
  readonly threeOrtho: THREE.OrthographicCamera;
358
+ readonly threePersp: THREE.PerspectiveCamera;
345
359
  protected readonly _userInputButtons: any;
346
360
  protected readonly _frustumSize = 50;
347
361
  protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
348
- get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
362
+ get mode(): NavigationMode;
349
363
  constructor(components: Components);
350
364
  /** {@link Disposable.dispose} */
351
365
  dispose(): void;
@@ -375,75 +389,6 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
375
389
  private setOrthoCameraAspect;
376
390
  }
377
391
  import * as THREE from "three";
378
- import { Component, Disposable, Event } from "../Types";
379
- import { Components } from "../Components";
380
- /**
381
- * A tool to easily handle the materials of massive amounts of
382
- * objects and scene background easily.
383
- */
384
- export declare class Materials extends Component implements Disposable {
385
- static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
386
- /** {@link Component.enabled} */
387
- enabled: boolean;
388
- /** {@link Disposable.onDisposed} */
389
- readonly onDisposed: Event<string>;
390
- list: {
391
- [id: string]: {
392
- material: THREE.Material;
393
- meshes: Set<THREE.Mesh | THREE.InstancedMesh>;
394
- };
395
- };
396
- private _originals;
397
- constructor(components: Components);
398
- /** {@link Disposable.dispose} */
399
- dispose(): void;
400
- /**
401
- * Turns the specified material styles on or off.
402
- *
403
- * @param active whether to turn it on or off.
404
- * @param ids the ids of the style to turn on or off.
405
- */
406
- set(active: boolean, ids?: string[]): void;
407
- /**
408
- * Creates a new material style.
409
- * @param id the identifier of the style to create.
410
- * @param material the material of the style.
411
- */
412
- addMaterial(id: string, material: THREE.Material): void;
413
- /**
414
- * Assign meshes to a certain style.
415
- * @param id the identifier of the style.
416
- * @param meshes the meshes to assign to the style.
417
- */
418
- addMeshes(id: string, meshes: THREE.Mesh[]): void;
419
- /**
420
- * Remove meshes from a certain style.
421
- * @param id the identifier of the style.
422
- * @param meshes the meshes to assign to the style.
423
- */
424
- removeMeshes(id: string, meshes: THREE.Mesh[]): void;
425
- }
426
- import * as THREE from "three";
427
- export interface MeasureEdge {
428
- distance: number;
429
- points: THREE.Vector3[];
430
- }
431
- export declare class MeasurementUtils {
432
- static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
433
- edges: MeasureEdge[];
434
- indices: Set<number>;
435
- } | null;
436
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
437
- private static getFaceData;
438
- static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
439
- p1: THREE.Vector3;
440
- p2: THREE.Vector3;
441
- p3: THREE.Vector3;
442
- faceNormal: THREE.Vector3;
443
- };
444
- private static round;
445
- }
446
- import * as THREE from "three";
447
392
  import * as FRAGS from "@thatopen/fragments";
448
393
  import { FragmentsGroup } from "@thatopen/fragments";
449
394
  import { Component, Components, Disposable, Event } from "../../core";
@@ -451,7 +396,7 @@ import { Component, Components, Disposable, Event } from "../../core";
451
396
  * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
452
397
  * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
453
398
  */
454
- export declare class BoundingBoxes extends Component implements Disposable {
399
+ export declare class BoundingBoxer extends Component implements Disposable {
455
400
  static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
456
401
  /** {@link Component.enabled} */
457
402
  enabled: boolean;
@@ -480,6 +425,28 @@ export declare class BoundingBoxes extends Component implements Disposable {
480
425
  private static getFragmentBounds;
481
426
  }
482
427
  import * as THREE from "three";
428
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
429
+ center: THREE.Vector3;
430
+ halfSizes: THREE.Vector3;
431
+ rotation: THREE.Matrix3;
432
+ transformation: THREE.Matrix4;
433
+ };
434
+ import * as FRAGS from "@thatopen/fragments";
435
+ import { Components, Component } from "../../core";
436
+ export declare class FragmentHider extends Component {
437
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
438
+ enabled: boolean;
439
+ constructor(components: Components);
440
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
441
+ isolate(items: FRAGS.FragmentIdMap): void;
442
+ private updateCulledVisibility;
443
+ }
444
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
445
+ import * as THREE from "three";
446
+ export declare class MaterialsUtils {
447
+ static isTransparent(material: THREE.Material): boolean;
448
+ }
449
+ import * as THREE from "three";
483
450
  import * as FRAGS from "@thatopen/fragments";
484
451
  import { Disposable, Component, Event, Components } from "../../core";
485
452
  export interface Classification {
@@ -487,7 +454,7 @@ export interface Classification {
487
454
  [className: string]: FRAGS.FragmentIdMap;
488
455
  };
489
456
  }
490
- export declare class FragmentClassifier extends Component implements Disposable {
457
+ export declare class Classifier extends Component implements Disposable {
491
458
  static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
492
459
  /** {@link Component.enabled} */
493
460
  enabled: boolean;
@@ -510,63 +477,6 @@ export declare class FragmentClassifier extends Component implements Disposable
510
477
  resetColor(items: FRAGS.FragmentIdMap): void;
511
478
  private saveItem;
512
479
  }
513
- import { Component, Disposable, Event, Components } from "../../core";
514
- export declare class FragmentExploder extends Component implements Disposable {
515
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
516
- enabled: boolean;
517
- height: number;
518
- groupName: string;
519
- /** {@link Disposable.onDisposed} */
520
- readonly onDisposed: Event<string>;
521
- list: Set<string>;
522
- constructor(components: Components);
523
- dispose(): void;
524
- explode(): void;
525
- reset(): void;
526
- update(): void;
527
- }
528
- import * as FRAGS from "@thatopen/fragments";
529
- import { Components, Component } from "../../core";
530
- export declare class FragmentHider extends Component {
531
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
532
- enabled: boolean;
533
- constructor(components: Components);
534
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
535
- isolate(items: FRAGS.FragmentIdMap): void;
536
- private updateCulledVisibility;
537
- }
538
- import * as WEBIFC from "web-ifc";
539
- import * as FRAGS from "@thatopen/fragments";
540
- import { IfcFragmentSettings } from "./src";
541
- import { Component, Components, Event, Disposable } from "../../core";
542
- export declare class FragmentIfcLoader extends Component implements Disposable {
543
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
544
- readonly onIfcStartedLoading: Event<void>;
545
- readonly onSetup: Event<void>;
546
- /** {@link Disposable.onDisposed} */
547
- readonly onDisposed: Event<string>;
548
- settings: IfcFragmentSettings;
549
- enabled: boolean;
550
- webIfc: WEBIFC.IfcAPI;
551
- private _material;
552
- private _spatialTree;
553
- private _metaData;
554
- private _fragmentInstances;
555
- private _civil;
556
- private _propertyExporter;
557
- private _visitedFragments;
558
- private _materialT;
559
- constructor(components: Components);
560
- dispose(): void;
561
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
562
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
563
- readIfcFile(data: Uint8Array): Promise<number>;
564
- private getAllGeometries;
565
- cleanUp(): void;
566
- private getMesh;
567
- private getGeometry;
568
- private autoSetWasm;
569
- }
570
480
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
571
481
  import * as THREE from "three";
572
482
  import * as FRAGS from "@thatopen/fragments";
@@ -576,7 +486,7 @@ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
576
486
  * Object that can efficiently load binary files that contain
577
487
  * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
578
488
  */
579
- export declare class FragmentManager extends Component implements Disposable {
489
+ export declare class FragmentsManager extends Component implements Disposable {
580
490
  static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
581
491
  /** {@link Disposable.onDisposed} */
582
492
  readonly onDisposed: Event<unknown>;
@@ -619,45 +529,18 @@ export declare class FragmentManager extends Component implements Disposable {
619
529
  export(group: FragmentsGroup): Uint8Array;
620
530
  coordinate(models?: FragmentsGroup[]): void;
621
531
  }
622
- import * as WEBIFC from "web-ifc";
623
- import { Components, Disposable, Event, Component } from "../../core";
624
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
625
- export declare class IfcGeometryTiler extends Component implements Disposable {
626
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
627
- onGeometryStreamed: Event<{
628
- buffer: Uint8Array;
629
- data: StreamedGeometries;
630
- }>;
631
- onAssetStreamed: Event<StreamedAsset[]>;
632
- onProgress: Event<number>;
633
- onIfcLoaded: Event<Uint8Array>;
532
+ import { Component, Disposable, Event, Components } from "../../core";
533
+ export declare class Exploder extends Component implements Disposable {
534
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
535
+ enabled: boolean;
536
+ height: number;
537
+ groupName: string;
634
538
  /** {@link Disposable.onDisposed} */
635
539
  readonly onDisposed: Event<unknown>;
636
- settings: IfcStreamingSettings;
637
- enabled: boolean;
638
- webIfc: WEBIFC.IfcAPI;
639
- private _spatialTree;
640
- private _metaData;
641
- private _visitedGeometries;
642
- private _streamSerializer;
643
- private _geometries;
644
- private _geometryCount;
645
- private _civil;
646
- private _groupSerializer;
647
- private _assets;
648
- private _meshesWithHoles;
540
+ list: Set<string>;
649
541
  constructor(components: Components);
650
542
  dispose(): void;
651
- streamFromBuffer(data: Uint8Array): Promise<void>;
652
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
653
- private readIfcFile;
654
- private streamIfcFile;
655
- private streamAllGeometries;
656
- private cleanUp;
657
- private getMesh;
658
- private getGeometry;
659
- private streamAssets;
660
- private streamGeometries;
543
+ set(active: boolean): void;
661
544
  }
662
545
  import * as WEBIFC from "web-ifc";
663
546
  import { AsyncEvent, Component, Disposable, Event } from "../../core";
@@ -686,57 +569,75 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
686
569
  private cleanUp;
687
570
  }
688
571
  import * as WEBIFC from "web-ifc";
689
- import * as FRAG from "@thatopen/fragments";
690
- /**
691
- * Object to export all the properties from an IFC to a JS object.
692
- */
693
- export declare class IfcJsonExporter {
694
- /**
695
- * Exports all the properties of an IFC into an array of JS objects.
696
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
697
- * @param modelID ID of the IFC model whose properties to extract.
698
- * @param indirect whether to get the indirect relationships as well.
699
- * @param recursiveSpatial whether to get the properties of spatial items recursively
700
- * to make the location data available (e.g. absolute position of building).
701
- */
702
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
703
- }
704
572
  import * as FRAGS from "@thatopen/fragments";
705
- import { FragmentsGroup } from "@thatopen/fragments";
706
- import { Disposable, Event, Component, Components } from "../../core";
707
- import { QueryGroup } from "./src/types";
708
- export interface QueryResult {
709
- [modelID: string]: {
710
- modelEntities: Set<number>;
711
- otherEntities: Set<number>;
712
- };
713
- }
714
- export interface IndexedModels {
715
- [modelID: string]: {
716
- [expressID: number]: Set<number>;
717
- };
573
+ import { IfcFragmentSettings } from "./src";
574
+ import { Component, Components, Event, Disposable } from "../../core";
575
+ export declare class IfcLoader extends Component implements Disposable {
576
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
577
+ readonly onIfcStartedLoading: Event<void>;
578
+ readonly onSetup: Event<void>;
579
+ /** {@link Disposable.onDisposed} */
580
+ readonly onDisposed: Event<string>;
581
+ settings: IfcFragmentSettings;
582
+ enabled: boolean;
583
+ webIfc: WEBIFC.IfcAPI;
584
+ private _material;
585
+ private _spatialTree;
586
+ private _metaData;
587
+ private _fragmentInstances;
588
+ private _civil;
589
+ private _visitedFragments;
590
+ private _materialT;
591
+ constructor(components: Components);
592
+ dispose(): void;
593
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
594
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
595
+ readIfcFile(data: Uint8Array): Promise<number>;
596
+ private getAllGeometries;
597
+ cleanUp(): void;
598
+ private getMesh;
599
+ private getGeometry;
600
+ private autoSetWasm;
718
601
  }
719
- export declare class IfcPropertiesFinder extends Component implements Disposable {
720
- readonly onFound: Event<FRAGS.FragmentIdMap>;
602
+ import * as WEBIFC from "web-ifc";
603
+ import { Components, Disposable, Event, Component } from "../../core";
604
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
605
+ export declare class IfcGeometryTiler extends Component implements Disposable {
606
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
607
+ onGeometryStreamed: Event<{
608
+ buffer: Uint8Array;
609
+ data: StreamedGeometries;
610
+ }>;
611
+ onAssetStreamed: Event<StreamedAsset[]>;
612
+ onProgress: Event<number>;
613
+ onIfcLoaded: Event<Uint8Array>;
721
614
  /** {@link Disposable.onDisposed} */
722
615
  readonly onDisposed: Event<unknown>;
616
+ settings: IfcStreamingSettings;
723
617
  enabled: boolean;
724
- indexedModels: IndexedModels;
725
- private readonly _conditionFunctions;
726
- private _noHandleAttributes;
618
+ webIfc: WEBIFC.IfcAPI;
619
+ private _spatialTree;
620
+ private _metaData;
621
+ private _visitedGeometries;
622
+ private _streamSerializer;
623
+ private _geometries;
624
+ private _geometryCount;
625
+ private _civil;
626
+ private _groupSerializer;
627
+ private _assets;
628
+ private _meshesWithHoles;
727
629
  constructor(components: Components);
728
- private onFragmentsDisposed;
729
630
  dispose(): void;
730
- private indexEntityRelations;
731
- find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
732
- private toFragmentMap;
733
- private simpleQuery;
734
- private getMatchingEntities;
735
- private combineArrays;
736
- private getCommonElements;
737
- private arrayIntersection;
738
- private arrayUnion;
739
- private getConditionFunctions;
631
+ streamFromBuffer(data: Uint8Array): Promise<void>;
632
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
633
+ private readIfcFile;
634
+ private streamIfcFile;
635
+ private streamAllGeometries;
636
+ private cleanUp;
637
+ private getMesh;
638
+ private getGeometry;
639
+ private streamAssets;
640
+ private streamGeometries;
740
641
  }
741
642
  import * as WEBIFC from "web-ifc";
742
643
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -870,20 +771,65 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
870
771
  dispose(): void;
871
772
  }
872
773
  export type { InverseAttribute } from "./src/types";
873
- import * as WEBIFC from "web-ifc";
874
- import { FragmentsGroup } from "@thatopen/fragments";
875
- import { Component, Disposable, Event, Components } from "../../core";
876
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
877
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
878
- type NumericPropTypes = "IfcInteger" | "IfcReal";
879
- interface ChangeMap {
880
- [modelID: string]: Set<number>;
774
+ import * as THREE from "three";
775
+ import { Component, Components } from "../../core";
776
+ export interface MeasureEdge {
777
+ distance: number;
778
+ points: THREE.Vector3[];
881
779
  }
882
- interface AttributeListener {
883
- [modelID: string]: {
884
- [expressID: number]: {
885
- [attributeName: string]: Event<String | Boolean | Number>;
886
- };
780
+ export declare class MeasurementUtils extends Component {
781
+ enabled: boolean;
782
+ static uuid: string;
783
+ constructor(components: Components);
784
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
785
+ edges: MeasureEdge[];
786
+ indices: Set<number>;
787
+ } | null;
788
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
789
+ private getFaceData;
790
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
791
+ p1: THREE.Vector3;
792
+ p2: THREE.Vector3;
793
+ p3: THREE.Vector3;
794
+ faceNormal: THREE.Vector3;
795
+ };
796
+ private round;
797
+ }
798
+ import * as WEBIFC from "web-ifc";
799
+ import * as FRAG from "@thatopen/fragments";
800
+ import { Component, Components } from "../../core";
801
+ /**
802
+ * Object to export all the properties from an IFC to a JS object.
803
+ */
804
+ export declare class IfcJsonExporter extends Component {
805
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
806
+ /** {@link Component.enabled} */
807
+ enabled: boolean;
808
+ constructor(components: Components);
809
+ /**
810
+ * Exports all the properties of an IFC into an array of JS objects.
811
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
812
+ * @param modelID ID of the IFC model whose properties to extract.
813
+ * @param indirect whether to get the indirect relationships as well.
814
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
815
+ * to make the location data available (e.g. absolute position of building).
816
+ */
817
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
818
+ }
819
+ import * as WEBIFC from "web-ifc";
820
+ import { FragmentsGroup } from "@thatopen/fragments";
821
+ import { Component, Disposable, Event, Components } from "../../core";
822
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
823
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
824
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
825
+ interface ChangeMap {
826
+ [modelID: string]: Set<number>;
827
+ }
828
+ interface AttributeListener {
829
+ [modelID: string]: {
830
+ [expressID: number]: {
831
+ [attributeName: string]: Event<String | Boolean | Number>;
832
+ };
887
833
  };
888
834
  }
889
835
  export declare class IfcPropertiesManager extends Component implements Disposable {
@@ -917,9 +863,8 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
917
863
  enabled: boolean;
918
864
  attributeListeners: AttributeListener;
919
865
  selectedModel?: FragmentsGroup;
920
- private _changeMap;
866
+ changeMap: ChangeMap;
921
867
  constructor(components: Components);
922
- get(): ChangeMap;
923
868
  dispose(): void;
924
869
  private increaseMaxID;
925
870
  static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
@@ -943,6 +888,43 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
943
888
  setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
944
889
  }
945
890
  export {};
891
+ export declare class UUID {
892
+ private static _pattern;
893
+ private static _lut;
894
+ static create(): string;
895
+ static validate(uuid: string): void;
896
+ }
897
+ import * as THREE from "three";
898
+ import { Component, Components, Event, World } from "../core";
899
+ export interface VertexPickerConfig {
900
+ showOnlyVertex: boolean;
901
+ snapDistance: number;
902
+ previewElement: HTMLElement;
903
+ }
904
+ export declare class VertexPicker extends Component {
905
+ onVertexFound: Event<THREE.Vector3>;
906
+ onVertexLost: Event<THREE.Vector3>;
907
+ components: Components;
908
+ private _pickedPoint;
909
+ private _config;
910
+ private _enabled;
911
+ private _workingPlane;
912
+ set enabled(value: boolean);
913
+ get enabled(): boolean;
914
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
915
+ set workingPlane(plane: THREE.Plane | null);
916
+ get workingPlane(): THREE.Plane | null;
917
+ set config(value: Partial<VertexPickerConfig>);
918
+ get config(): Partial<VertexPickerConfig>;
919
+ dispose(): void;
920
+ get(world: World): THREE.Vector3 | null;
921
+ private getClosestVertex;
922
+ private getVertices;
923
+ private getVertex;
924
+ }
925
+ export declare const IfcElements: {
926
+ [key: number]: string;
927
+ };
946
928
  import * as WEBIFC from "web-ifc";
947
929
  export interface IfcItemsCategories {
948
930
  [itemID: number]: number;
@@ -950,14 +932,8 @@ export interface IfcItemsCategories {
950
932
  export declare class IfcCategories {
951
933
  getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
952
934
  }
953
- export declare const IfcCategoryMap: {
954
- [key: number]: string;
955
- };
956
- export declare const IfcElements: {
957
- [key: number]: string;
958
- };
959
935
  import * as THREE from "three";
960
- import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
936
+ import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
961
937
  export declare class MiniMap implements Resizeable, Updateable, Disposable {
962
938
  /** {@link Disposable.onDisposed} */
963
939
  readonly onDisposed: Event<unknown>;
@@ -990,6 +966,18 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
990
966
  resize(size?: THREE.Vector2): void;
991
967
  private updatePlanes;
992
968
  }
969
+ export declare const GeometryTypes: Set<number>;
970
+ import * as WEBIFC from "web-ifc";
971
+ import { IfcItemsCategories } from "../../../ifc";
972
+ export declare class SpatialStructure {
973
+ itemsByFloor: IfcItemsCategories;
974
+ private _units;
975
+ setUp(webIfc: WEBIFC.IfcAPI): void;
976
+ cleanUp(): void;
977
+ }
978
+ export declare const IfcCategoryMap: {
979
+ [key: number]: string;
980
+ };
993
981
  import * as FRAGS from "@thatopen/fragments";
994
982
  export declare class IfcPropertiesUtils {
995
983
  static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
@@ -1049,6 +1037,40 @@ export declare class Event<T> {
1049
1037
  reset(): void;
1050
1038
  private handlers;
1051
1039
  }
1040
+ /**
1041
+ * Simple event handler by
1042
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1043
+ * Keep in mind that:
1044
+ * - If you want to remove it later, you might want to declare the callback as
1045
+ * an object.
1046
+ * - If you want to maintain the reference to 'this', you will need to declare
1047
+ * the callback as an arrow function.
1048
+ */
1049
+ export declare class AsyncEvent<T> {
1050
+ /**
1051
+ * Add a callback to this event instance.
1052
+ * @param handler - the callback to be added to this event.
1053
+ */
1054
+ add(handler: T extends void ? {
1055
+ (): Promise<void>;
1056
+ } : {
1057
+ (data: T): Promise<void>;
1058
+ }): void;
1059
+ /**
1060
+ * Removes a callback from this event instance.
1061
+ * @param handler - the callback to be removed from this event.
1062
+ */
1063
+ remove(handler: T extends void ? {
1064
+ (): Promise<void>;
1065
+ } : {
1066
+ (data: T): Promise<void>;
1067
+ }): void;
1068
+ /** Triggers all the callbacks assigned to this event. */
1069
+ trigger: (data?: T) => Promise<void>;
1070
+ /** Gets rid of all the suscribed events. */
1071
+ reset(): void;
1072
+ private handlers;
1073
+ }
1052
1074
  import * as THREE from "three";
1053
1075
  import CameraControls from "camera-controls";
1054
1076
  import { Event } from "./event";
@@ -1172,39 +1194,24 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1172
1194
  export interface CameraControllable {
1173
1195
  controls: CameraControls;
1174
1196
  }
1197
+ import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1198
+ import { Components } from "../../Components";
1175
1199
  /**
1176
- * Simple event handler by
1177
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1178
- * Keep in mind that:
1179
- * - If you want to remove it later, you might want to declare the callback as
1180
- * an object.
1181
- * - If you want to maintain the reference to 'this', you will need to declare
1182
- * the callback as an arrow function.
1200
+ * Base class of the library. Useful for finding out the interfaces it implements.
1183
1201
  */
1184
- export declare class AsyncEvent<T> {
1185
- /**
1186
- * Add a callback to this event instance.
1187
- * @param handler - the callback to be added to this event.
1188
- */
1189
- add(handler: T extends void ? {
1190
- (): Promise<void>;
1191
- } : {
1192
- (data: T): Promise<void>;
1193
- }): void;
1194
- /**
1195
- * Removes a callback from this event instance.
1196
- * @param handler - the callback to be removed from this event.
1197
- */
1198
- remove(handler: T extends void ? {
1199
- (): Promise<void>;
1200
- } : {
1201
- (data: T): Promise<void>;
1202
- }): void;
1203
- /** Triggers all the callbacks assigned to this event. */
1204
- trigger: (data?: T) => Promise<void>;
1205
- /** Gets rid of all the suscribed events. */
1206
- reset(): void;
1207
- private handlers;
1202
+ export declare abstract class Base {
1203
+ components: Components;
1204
+ constructor(components: Components);
1205
+ /** Whether is component is {@link Disposable}. */
1206
+ isDisposeable: () => this is Disposable;
1207
+ /** Whether is component is {@link Resizeable}. */
1208
+ isResizeable: () => this is Resizeable;
1209
+ /** Whether is component is {@link Updateable}. */
1210
+ isUpdateable: () => this is Updateable;
1211
+ /** Whether is component is {@link Hideable}. */
1212
+ isHideable: () => this is Hideable;
1213
+ /** Whether is component is {@link Configurable}. */
1214
+ isConfigurable: () => this is Configurable<any>;
1208
1215
  }
1209
1216
  import { Base } from "./base";
1210
1217
  /**
@@ -1224,26 +1231,6 @@ export declare abstract class Component extends Base {
1224
1231
  */
1225
1232
  abstract enabled: boolean;
1226
1233
  }
1227
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1228
- import { Components } from "../../Components";
1229
- /**
1230
- * Base class of the library. Useful for finding out the interfaces it implements.
1231
- */
1232
- export declare abstract class Base {
1233
- components: Components;
1234
- constructor(components: Components);
1235
- /** Whether is component is {@link Disposable}. */
1236
- isDisposeable: () => this is Disposable;
1237
- /** Whether is component is {@link Resizeable}. */
1238
- isResizeable: () => this is Resizeable;
1239
- /** Whether is component is {@link Updateable}. */
1240
- isUpdateable: () => this is Updateable;
1241
- /** Whether is component is {@link Hideable}. */
1242
- isHideable: () => this is Hideable;
1243
- /** Whether is component is {@link Configurable}. */
1244
- isConfigurable: () => this is Configurable<any>;
1245
- }
1246
- export declare const GeometryTypes: Set<number>;
1247
1234
  import { Base } from "./base";
1248
1235
  import { World } from "./world";
1249
1236
  import { Event } from "./event";
@@ -1261,19 +1248,30 @@ export declare abstract class BaseWorldItem extends Base {
1261
1248
  currentWorld: World | null;
1262
1249
  protected constructor(components: Components);
1263
1250
  }
1264
- import * as WEBIFC from "web-ifc";
1265
- import { IfcItemsCategories } from "../../../ifc";
1266
- export declare class SpatialStructure {
1267
- itemsByFloor: IfcItemsCategories;
1268
- private _units;
1269
- setUp(webIfc: WEBIFC.IfcAPI): void;
1270
- cleanUp(): void;
1251
+ import * as THREE from "three";
1252
+ import { Disposable } from "./interfaces";
1253
+ import { Event } from "./event";
1254
+ import { Components } from "../../Components";
1255
+ import { BaseWorldItem } from "./base-world-item";
1256
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1257
+ /** {@link Disposable.onDisposed} */
1258
+ readonly onDisposed: Event<unknown>;
1259
+ abstract three: THREE.Object3D;
1260
+ protected constructor(components: Components);
1261
+ /** {@link Disposable.dispose} */
1262
+ dispose(): void;
1263
+ }
1264
+ import * as THREE from "three";
1265
+ import CameraControls from "camera-controls";
1266
+ import { BaseWorldItem } from "./base-world-item";
1267
+ import { CameraControllable } from "./interfaces";
1268
+ export declare abstract class BaseCamera extends BaseWorldItem {
1269
+ abstract enabled: boolean;
1270
+ abstract three: THREE.Camera;
1271
+ abstract controls?: CameraControls;
1272
+ /** Whether is instance is {@link CameraControllable}. */
1273
+ hasCameraControls: () => this is CameraControllable;
1271
1274
  }
1272
- import { InverseAttribute } from "./types";
1273
- export declare const relToAttributesMap: Map<number, {
1274
- forRelating: InverseAttribute;
1275
- forRelated: InverseAttribute;
1276
- }>;
1277
1275
  import * as THREE from "three";
1278
1276
  import { Vector2 } from "three";
1279
1277
  import { Event } from "./event";
@@ -1315,128 +1313,46 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1315
1313
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1316
1314
  }
1317
1315
  import * as THREE from "three";
1318
- import CameraControls from "camera-controls";
1319
- import { BaseWorldItem } from "./base-world-item";
1320
- import { CameraControllable } from "./interfaces";
1321
- export declare abstract class BaseCamera extends BaseWorldItem {
1322
- abstract enabled: boolean;
1323
- abstract three: THREE.Camera;
1324
- abstract controls?: CameraControls;
1325
- /** Whether is instance is {@link CameraControllable}. */
1326
- hasCameraControls: () => this is CameraControllable;
1316
+ import { BaseScene } from "./base-scene";
1317
+ import { BaseCamera } from "./base-camera";
1318
+ import { BaseRenderer } from "./base-renderer";
1319
+ import { Updateable, Disposable } from "./interfaces";
1320
+ export interface World extends Disposable, Updateable {
1321
+ meshes: Set<THREE.Mesh>;
1322
+ scene: BaseScene;
1323
+ camera: BaseCamera;
1324
+ renderer: BaseRenderer | null;
1325
+ uuid: string;
1327
1326
  }
1328
1327
  import * as THREE from "three";
1329
- import { Disposable } from "./interfaces";
1330
- import { Event } from "./event";
1328
+ import { BaseScene, Configurable, Event } from "../../Types";
1331
1329
  import { Components } from "../../Components";
1332
- import { BaseWorldItem } from "./base-world-item";
1333
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1334
- /** {@link Disposable.onDisposed} */
1335
- readonly onDisposed: Event<unknown>;
1336
- abstract three: THREE.Object3D;
1337
- protected constructor(components: Components);
1338
- /** {@link Disposable.dispose} */
1339
- dispose(): void;
1340
- }
1341
- import * as THREE from "three";
1342
- import { BaseScene } from "./base-scene";
1343
- import { BaseCamera } from "./base-camera";
1344
- import { BaseRenderer } from "./base-renderer";
1345
- import { Updateable, Disposable } from "./interfaces";
1346
- export interface World extends Disposable, Updateable {
1347
- meshes: Set<THREE.Mesh>;
1348
- scene: BaseScene;
1349
- camera: BaseCamera;
1350
- renderer: BaseRenderer | null;
1351
- uuid: string;
1330
+ export interface SimpleSceneConfig {
1331
+ directionalLight: {
1332
+ color: THREE.Color;
1333
+ intensity: number;
1334
+ position: THREE.Vector3;
1335
+ };
1336
+ ambientLight: {
1337
+ color: THREE.Color;
1338
+ intensity: number;
1339
+ };
1352
1340
  }
1353
- import * as THREE from "three";
1354
- import { Components } from "../../Components";
1355
- import { Event, World, Disposable } from "../../Types";
1356
- import { Mouse } from "./mouse";
1357
1341
  /**
1358
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1359
- * that allows to easily get items from the scene using the mouse and touch
1360
- * events.
1342
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1343
+ * objects hierarchically, and easily dispose them when you are finished with it.
1344
+ * @noInheritDoc
1361
1345
  */
1362
- export declare class SimpleRaycaster implements Disposable {
1363
- /** {@link Component.enabled} */
1364
- enabled: boolean;
1365
- components: Components;
1366
- /** {@link Disposable.onDisposed} */
1367
- readonly onDisposed: Event<unknown>;
1368
- /** The position of the mouse in the screen. */
1369
- readonly mouse: Mouse;
1370
- readonly three: THREE.Raycaster;
1371
- world: World;
1372
- constructor(components: Components, world: World);
1373
- /** {@link Disposable.dispose} */
1374
- dispose(): void;
1375
- /**
1376
- * Throws a ray from the camera to the mouse or touch event point and returns
1377
- * the first item found. This also takes into account the clipping planes
1378
- * used by the renderer.
1379
- *
1380
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1381
- * to query. If not provided, it will query all the meshes stored in
1382
- * {@link Components.meshes}.
1383
- */
1384
- castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
1385
- 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;
1386
- private intersect;
1387
- private filterClippingPlanes;
1388
- }
1389
- import * as THREE from "three";
1390
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1391
- import { Components } from "../../Components";
1392
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1393
- /**
1394
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1395
- */
1396
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1397
- readonly onAfterUpdate: Event<unknown>;
1398
- readonly onBeforeUpdate: Event<unknown>;
1399
- enabled: boolean;
1400
- uuid: string;
1401
- readonly onDisposed: Event<unknown>;
1402
- private _scene?;
1403
- private _camera?;
1404
- private _renderer;
1405
- get scene(): T;
1406
- set scene(scene: T);
1407
- get camera(): U;
1408
- set camera(camera: U);
1409
- get renderer(): S | null;
1410
- set renderer(renderer: S | null);
1346
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1347
+ /** {@link Configurable.isSetup} */
1348
+ isSetup: boolean;
1349
+ three: THREE.Scene;
1350
+ /** {@link Configurable.onSetup} */
1351
+ readonly onSetup: Event<SimpleScene>;
1352
+ config: Required<SimpleSceneConfig>;
1411
1353
  constructor(components: Components);
1412
- update(delta?: number): void;
1413
- dispose(disposeResources?: boolean): void;
1414
- }
1415
- import * as THREE from "three";
1416
- import { Disposable, Event } from "../../Types";
1417
- /**
1418
- * A helper to easily get the real position of the mouse in the Three.js canvas
1419
- * to work with tools like the
1420
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1421
- * been transformed through CSS or doesn't occupy the whole screen.
1422
- */
1423
- export declare class Mouse implements Disposable {
1424
- dom: HTMLCanvasElement;
1425
- private _event?;
1426
- private _position;
1427
- /** {@link Disposable.onDisposed} */
1428
- readonly onDisposed: Event<unknown>;
1429
- constructor(dom: HTMLCanvasElement);
1430
- /**
1431
- * The real position of the mouse of the Three.js canvas.
1432
- */
1433
- get position(): THREE.Vector2;
1434
- /** {@link Disposable.dispose} */
1435
- dispose(): void;
1436
- private getPositionY;
1437
- private getPositionX;
1438
- private updateMouseInfo;
1439
- private setupEvents;
1354
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1355
+ setup(config?: Partial<SimpleSceneConfig>): void;
1440
1356
  }
1441
1357
  import * as THREE from "three";
1442
1358
  import { BaseRenderer, Event } from "../../Types";
@@ -1453,7 +1369,7 @@ export declare class SimpleRenderer extends BaseRenderer {
1453
1369
  protected _canvas: HTMLCanvasElement;
1454
1370
  protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1455
1371
  protected _resizeObserver: ResizeObserver | null;
1456
- protected onContainerUpdated: Event<HTMLElement>;
1372
+ protected onContainerUpdated: Event<unknown>;
1457
1373
  constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1458
1374
  /** {@link Updateable.update} */
1459
1375
  update(): void;
@@ -1469,35 +1385,82 @@ export declare class SimpleRenderer extends BaseRenderer {
1469
1385
  private onContextLost;
1470
1386
  private onContextBack;
1471
1387
  }
1388
+ import { InverseAttribute } from "./types";
1389
+ export declare const relToAttributesMap: Map<number, {
1390
+ forRelating: InverseAttribute;
1391
+ forRelated: InverseAttribute;
1392
+ }>;
1393
+ /// <reference types="node" />
1472
1394
  import * as THREE from "three";
1473
- import { BaseScene, Configurable, Event } from "../../Types";
1395
+ import { Hideable, Event, World } from "../../Types";
1474
1396
  import { Components } from "../../Components";
1475
- export interface SimpleSceneConfig {
1476
- directionalLight: {
1477
- color: THREE.Color;
1478
- intensity: number;
1479
- position: THREE.Vector3;
1480
- };
1481
- ambientLight: {
1482
- color: THREE.Color;
1483
- intensity: number;
1484
- };
1397
+ export interface GridConfig {
1398
+ color: THREE.Color;
1399
+ size1: number;
1400
+ size2: number;
1401
+ distance: number;
1485
1402
  }
1486
1403
  /**
1487
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1488
- * objects hierarchically, and easily dispose them when you are finished with it.
1489
- * @noInheritDoc
1404
+ * An infinite grid. Created by
1405
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1406
+ * and translated to typescript by
1407
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1490
1408
  */
1491
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1492
- /** {@link Configurable.isSetup} */
1493
- isSetup: boolean;
1494
- three: THREE.Scene;
1495
- /** {@link Configurable.onSetup} */
1496
- readonly onSetup: Event<SimpleScene>;
1497
- config: Required<SimpleSceneConfig>;
1409
+ export declare class SimpleGrid implements Hideable, Disposable {
1410
+ /** {@link Disposable.onDisposed} */
1411
+ readonly onDisposed: Event<unknown>;
1412
+ world: World;
1413
+ components: Components;
1414
+ /** {@link Hideable.visible} */
1415
+ get visible(): boolean;
1416
+ /** {@link Hideable.visible} */
1417
+ set visible(visible: boolean);
1418
+ /** The material of the grid. */
1419
+ get material(): THREE.ShaderMaterial;
1420
+ /**
1421
+ * Whether the grid should fade away with distance. Recommended to be true for
1422
+ * perspective cameras and false for orthographic cameras.
1423
+ */
1424
+ get fade(): boolean;
1425
+ /**
1426
+ * Whether the grid should fade away with distance. Recommended to be true for
1427
+ * perspective cameras and false for orthographic cameras.
1428
+ */
1429
+ set fade(active: boolean);
1430
+ readonly three: THREE.Mesh;
1431
+ private _fade;
1432
+ constructor(components: Components, world: World, config: GridConfig);
1433
+ [Symbol.dispose](): void;
1434
+ /** {@link Disposable.dispose} */
1435
+ dispose(): void;
1436
+ private setupEvents;
1437
+ private updateZoom;
1438
+ }
1439
+ import * as THREE from "three";
1440
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1441
+ import { Components } from "../../Components";
1442
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1443
+ /**
1444
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1445
+ */
1446
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1447
+ readonly onAfterUpdate: Event<unknown>;
1448
+ readonly onBeforeUpdate: Event<unknown>;
1449
+ enabled: boolean;
1450
+ uuid: string;
1451
+ readonly onDisposed: Event<unknown>;
1452
+ private _scene?;
1453
+ private _camera?;
1454
+ private _renderer;
1455
+ get scene(): T;
1456
+ set scene(scene: T);
1457
+ get camera(): U;
1458
+ set camera(camera: U);
1459
+ get renderer(): S | null;
1460
+ set renderer(renderer: S | null);
1498
1461
  constructor(components: Components);
1499
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1500
- setup(config?: Partial<SimpleSceneConfig>): void;
1462
+ update(delta?: number): void;
1463
+ dispose(disposeResources?: boolean): void;
1501
1464
  }
1502
1465
  import * as THREE from "three";
1503
1466
  import CameraControls from "camera-controls";
@@ -1517,7 +1480,7 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
1517
1480
  readonly onAspectUpdated: Event<unknown>;
1518
1481
  /** {@link Disposable.onDisposed} */
1519
1482
  readonly onDisposed: Event<string>;
1520
- readonly three: THREE.PerspectiveCamera;
1483
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1521
1484
  private _allControls;
1522
1485
  /**
1523
1486
  * The object that controls the camera. An instance of
@@ -1547,6 +1510,42 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
1547
1510
  }
1548
1511
  import * as THREE from "three";
1549
1512
  import { Components } from "../../Components";
1513
+ import { Event, World, Disposable } from "../../Types";
1514
+ import { Mouse } from "./mouse";
1515
+ /**
1516
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1517
+ * that allows to easily get items from the scene using the mouse and touch
1518
+ * events.
1519
+ */
1520
+ export declare class SimpleRaycaster implements Disposable {
1521
+ /** {@link Component.enabled} */
1522
+ enabled: boolean;
1523
+ components: Components;
1524
+ /** {@link Disposable.onDisposed} */
1525
+ readonly onDisposed: Event<unknown>;
1526
+ /** The position of the mouse in the screen. */
1527
+ readonly mouse: Mouse;
1528
+ readonly three: THREE.Raycaster;
1529
+ world: World;
1530
+ constructor(components: Components, world: World);
1531
+ /** {@link Disposable.dispose} */
1532
+ dispose(): void;
1533
+ /**
1534
+ * Throws a ray from the camera to the mouse or touch event point and returns
1535
+ * the first item found. This also takes into account the clipping planes
1536
+ * used by the renderer.
1537
+ *
1538
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1539
+ * to query. If not provided, it will query all the meshes stored in
1540
+ * {@link Components.meshes}.
1541
+ */
1542
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1543
+ castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
1544
+ private intersect;
1545
+ private filterClippingPlanes;
1546
+ }
1547
+ import * as THREE from "three";
1548
+ import { Components } from "../../Components";
1550
1549
  import { AsyncEvent, Event, World } from "../../Types";
1551
1550
  export interface CullerRendererSettings {
1552
1551
  updateInterval?: number;
@@ -1555,91 +1554,218 @@ export interface CullerRendererSettings {
1555
1554
  autoUpdate?: boolean;
1556
1555
  }
1557
1556
  /**
1558
- * A base renderer to determine visibility on screen
1557
+ * A base renderer to determine visibility on screen
1558
+ */
1559
+ export declare class CullerRenderer {
1560
+ /** {@link Disposable.onDisposed} */
1561
+ readonly onDisposed: Event<string>;
1562
+ /**
1563
+ * Fires after making the visibility check to the meshes. It lists the
1564
+ * meshes that are currently visible, and the ones that were visible
1565
+ * just before but not anymore.
1566
+ */
1567
+ readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1568
+ /** {@link Component.enabled} */
1569
+ enabled: boolean;
1570
+ /**
1571
+ * Needs to check whether there are objects that need to be hidden or shown.
1572
+ * You can bind this to the camera movement, to a certain interval, etc.
1573
+ */
1574
+ needsUpdate: boolean;
1575
+ /**
1576
+ * Render the internal scene used to determine the object visibility. Used
1577
+ * for debugging purposes.
1578
+ */
1579
+ renderDebugFrame: boolean;
1580
+ components: Components;
1581
+ readonly world: World;
1582
+ readonly renderer: THREE.WebGLRenderer;
1583
+ protected autoUpdate: boolean;
1584
+ protected updateInterval: number;
1585
+ protected readonly worker: Worker;
1586
+ protected readonly scene: THREE.Scene;
1587
+ private _width;
1588
+ private _height;
1589
+ private _availableColor;
1590
+ private readonly renderTarget;
1591
+ private readonly bufferSize;
1592
+ private readonly _buffer;
1593
+ protected _isWorkerBusy: boolean;
1594
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1595
+ /** {@link Disposable.dispose} */
1596
+ dispose(): void;
1597
+ /**
1598
+ * The function that the culler uses to reprocess the scene. Generally it's
1599
+ * better to call needsUpdate, but you can also call this to force it.
1600
+ * @param force if true, it will refresh the scene even if needsUpdate is
1601
+ * not true.
1602
+ */
1603
+ updateVisibility: (force?: boolean) => Promise<void>;
1604
+ protected getAvailableColor(): {
1605
+ r: number;
1606
+ g: number;
1607
+ b: number;
1608
+ code: string;
1609
+ };
1610
+ protected increaseColor(): void;
1611
+ protected decreaseColor(): void;
1612
+ private applySettings;
1613
+ }
1614
+ import * as THREE from "three";
1615
+ import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1616
+ import { Components } from "../../Components";
1617
+ import { Event, World } from "../../Types";
1618
+ /**
1619
+ * A renderer to determine a mesh visibility on screen
1620
+ */
1621
+ export declare class MeshCullerRenderer extends CullerRenderer {
1622
+ threshold: number;
1623
+ readonly onViewUpdated: Event<{
1624
+ seen: Set<THREE.Mesh>;
1625
+ unseen: Set<THREE.Mesh>;
1626
+ }>;
1627
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1628
+ isProcessing: boolean;
1629
+ private _colorCodeMeshMap;
1630
+ private _meshIDColorCodeMap;
1631
+ private _currentVisibleMeshes;
1632
+ private _recentlyHiddenMeshes;
1633
+ private _intervalID;
1634
+ private readonly _transparentMat;
1635
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1636
+ dispose(): void;
1637
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1638
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1639
+ private handleWorkerMessage;
1640
+ private getAvailableMaterial;
1641
+ }
1642
+ import * as THREE from "three";
1643
+ import { Disposable, Event } from "../../Types";
1644
+ /**
1645
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1646
+ * to work with tools like the
1647
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1648
+ * been transformed through CSS or doesn't occupy the whole screen.
1649
+ */
1650
+ export declare class Mouse implements Disposable {
1651
+ dom: HTMLCanvasElement;
1652
+ private _event?;
1653
+ private _position;
1654
+ /** {@link Disposable.onDisposed} */
1655
+ readonly onDisposed: Event<unknown>;
1656
+ constructor(dom: HTMLCanvasElement);
1657
+ /**
1658
+ * The real position of the mouse of the Three.js canvas.
1659
+ */
1660
+ get position(): THREE.Vector2;
1661
+ /** {@link Disposable.dispose} */
1662
+ dispose(): void;
1663
+ private getPositionY;
1664
+ private getPositionX;
1665
+ private updateMouseInfo;
1666
+ private setupEvents;
1667
+ }
1668
+ import * as WEBIFC from "web-ifc";
1669
+ export declare class IfcMetadataReader {
1670
+ get(webIfc: WEBIFC.IfcAPI, type: number): string;
1671
+ }
1672
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1673
+ import * as THREE from "three";
1674
+ import * as WEBIFC from "web-ifc";
1675
+ import * as FRAGS from "@thatopen/fragments";
1676
+ export declare class CivilReader {
1677
+ defLineMat: THREE.LineBasicMaterial;
1678
+ read(webIfc: WEBIFC.IfcAPI): {
1679
+ alignments: Map<number, FRAGS.Alignment>;
1680
+ coordinationMatrix: THREE.Matrix4;
1681
+ } | undefined;
1682
+ get(civilItems: any): {
1683
+ alignments: Map<number, FRAGS.Alignment>;
1684
+ coordinationMatrix: THREE.Matrix4;
1685
+ } | undefined;
1686
+ private getCurves;
1687
+ }
1688
+ import * as WEBIFC from "web-ifc";
1689
+ /** Configuration of the IFC-fragment conversion. */
1690
+ export declare class IfcFragmentSettings {
1691
+ /** Whether to extract the IFC properties into a JSON. */
1692
+ includeProperties: boolean;
1693
+ /**
1694
+ * Generate the geometry for categories that are not included by default,
1695
+ * like IFCSPACE.
1696
+ */
1697
+ optionalCategories: number[];
1698
+ /** Whether to use the coordination data coming from the IFC files. */
1699
+ coordinate: boolean;
1700
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1701
+ wasm: {
1702
+ path: string;
1703
+ absolute: boolean;
1704
+ logLevel?: WEBIFC.LogLevel;
1705
+ };
1706
+ /** List of categories that won't be converted to fragments. */
1707
+ excludedCategories: Set<number>;
1708
+ /** Whether to save the absolute location of all IFC items. */
1709
+ saveLocations: boolean;
1710
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1711
+ webIfc: WEBIFC.LoaderSettings;
1712
+ autoSetWasm: boolean;
1713
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1714
+ }
1715
+ import { NavigationMode } from "./types";
1716
+ import { OrthoPerspectiveCamera } from "../index";
1717
+ /**
1718
+ * A {@link NavigationMode} that allows first person navigation,
1719
+ * simulating FPS video games.
1720
+ */
1721
+ export declare class FirstPersonMode implements NavigationMode {
1722
+ private camera;
1723
+ /** {@link NavigationMode.enabled} */
1724
+ enabled: boolean;
1725
+ /** {@link NavigationMode.id} */
1726
+ readonly id = "FirstPerson";
1727
+ constructor(camera: OrthoPerspectiveCamera);
1728
+ /** {@link NavigationMode.set} */
1729
+ set(active: boolean): void;
1730
+ private setupFirstPersonCamera;
1731
+ }
1732
+ import { NavigationMode } from "./types";
1733
+ import { OrthoPerspectiveCamera } from "../index";
1734
+ /**
1735
+ * A {@link NavigationMode} that allows 3D navigation and panning
1736
+ * like in many 3D and CAD softwares.
1559
1737
  */
1560
- export declare class CullerRenderer {
1561
- /** {@link Disposable.onDisposed} */
1562
- readonly onDisposed: Event<string>;
1563
- /**
1564
- * Fires after making the visibility check to the meshes. It lists the
1565
- * meshes that are currently visible, and the ones that were visible
1566
- * just before but not anymore.
1567
- */
1568
- readonly onViewUpdated: Event<any> | AsyncEvent<any>;
1569
- /** {@link Component.enabled} */
1738
+ export declare class OrbitMode implements NavigationMode {
1739
+ camera: OrthoPerspectiveCamera;
1740
+ /** {@link NavigationMode.enabled} */
1570
1741
  enabled: boolean;
1571
- /**
1572
- * Needs to check whether there are objects that need to be hidden or shown.
1573
- * You can bind this to the camera movement, to a certain interval, etc.
1574
- */
1575
- needsUpdate: boolean;
1576
- /**
1577
- * Render the internal scene used to determine the object visibility. Used
1578
- * for debugging purposes.
1579
- */
1580
- renderDebugFrame: boolean;
1581
- components: Components;
1582
- readonly world: World;
1583
- readonly renderer: THREE.WebGLRenderer;
1584
- protected autoUpdate: boolean;
1585
- protected updateInterval: number;
1586
- protected readonly worker: Worker;
1587
- protected readonly scene: THREE.Scene;
1588
- private _width;
1589
- private _height;
1590
- private _availableColor;
1591
- private readonly renderTarget;
1592
- private readonly bufferSize;
1593
- private readonly _buffer;
1594
- protected _isWorkerBusy: boolean;
1595
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1596
- /** {@link Disposable.dispose} */
1597
- dispose(): void;
1598
- /**
1599
- * The function that the culler uses to reprocess the scene. Generally it's
1600
- * better to call needsUpdate, but you can also call this to force it.
1601
- * @param force if true, it will refresh the scene even if needsUpdate is
1602
- * not true.
1603
- */
1604
- updateVisibility: (force?: boolean) => Promise<void>;
1605
- protected getAvailableColor(): {
1606
- r: number;
1607
- g: number;
1608
- b: number;
1609
- code: string;
1610
- };
1611
- protected increaseColor(): void;
1612
- protected decreaseColor(): void;
1613
- private applySettings;
1742
+ /** {@link NavigationMode.id} */
1743
+ readonly id = "Orbit";
1744
+ constructor(camera: OrthoPerspectiveCamera);
1745
+ /** {@link NavigationMode.set} */
1746
+ set(active: boolean): void;
1747
+ private activateOrbitControls;
1614
1748
  }
1615
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1616
- import * as THREE from "three";
1617
- import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1618
- import { Components } from "../../Components";
1619
- import { Event, World } from "../../Types";
1749
+ import { NavigationMode } from "./types";
1750
+ import { OrthoPerspectiveCamera } from "../index";
1620
1751
  /**
1621
- * A renderer to determine a mesh visibility on screen
1752
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1753
+ * like many BIM tools.
1622
1754
  */
1623
- export declare class MeshCullerRenderer extends CullerRenderer {
1624
- threshold: number;
1625
- readonly onViewUpdated: Event<{
1626
- seen: Set<THREE.Mesh>;
1627
- unseen: Set<THREE.Mesh>;
1628
- }>;
1629
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1630
- isProcessing: boolean;
1631
- private _colorCodeMeshMap;
1632
- private _meshIDColorCodeMap;
1633
- private _currentVisibleMeshes;
1634
- private _recentlyHiddenMeshes;
1635
- private _intervalID;
1636
- private readonly _transparentMat;
1637
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1638
- dispose(): void;
1639
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1640
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1641
- private handleWorkerMessage;
1642
- private getAvailableMaterial;
1755
+ export declare class PlanMode implements NavigationMode {
1756
+ private camera;
1757
+ /** {@link NavigationMode.enabled} */
1758
+ enabled: boolean;
1759
+ /** {@link NavigationMode.id} */
1760
+ readonly id = "Plan";
1761
+ private mouseAction1?;
1762
+ private mouseAction2?;
1763
+ private mouseInitialized;
1764
+ private readonly defaultAzimuthSpeed;
1765
+ private readonly defaultPolarSpeed;
1766
+ constructor(camera: OrthoPerspectiveCamera);
1767
+ /** {@link NavigationMode.set} */
1768
+ set(active: boolean): void;
1643
1769
  }
1644
1770
  import * as THREE from "three";
1645
1771
  import { Hideable, Disposable, Event, World } from "../../Types";
@@ -1686,9 +1812,9 @@ export declare class SimplePlane implements Disposable, Hideable {
1686
1812
  set size(size: number);
1687
1813
  get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1688
1814
  constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1689
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
1815
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
1690
1816
  /** {@link Updateable.update} */
1691
- update: () => Promise<void>;
1817
+ update: () => void;
1692
1818
  /** {@link Disposable.dispose} */
1693
1819
  dispose(): void;
1694
1820
  private reset;
@@ -1702,109 +1828,9 @@ export declare class SimplePlane implements Disposable, Hideable {
1702
1828
  private newHelper;
1703
1829
  private static newPlaneMesh;
1704
1830
  }
1705
- /// <reference types="node" />
1706
- import * as THREE from "three";
1707
- import { Hideable, Event, World } from "../../Types";
1708
- import { Components } from "../../Components";
1709
- export interface GridConfig {
1710
- color: THREE.Color;
1711
- size1: number;
1712
- size2: number;
1713
- distance: number;
1714
- }
1715
- /**
1716
- * An infinite grid. Created by
1717
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1718
- * and translated to typescript by
1719
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1720
- */
1721
- export declare class SimpleGrid implements Hideable, Disposable {
1722
- /** {@link Disposable.onDisposed} */
1723
- readonly onDisposed: Event<unknown>;
1724
- world: World;
1725
- components: Components;
1726
- /** {@link Hideable.visible} */
1727
- get visible(): boolean;
1728
- /** {@link Hideable.visible} */
1729
- set visible(visible: boolean);
1730
- /** The material of the grid. */
1731
- get material(): THREE.ShaderMaterial;
1732
- /**
1733
- * Whether the grid should fade away with distance. Recommended to be true for
1734
- * perspective cameras and false for orthographic cameras.
1735
- */
1736
- get fade(): boolean;
1737
- /**
1738
- * Whether the grid should fade away with distance. Recommended to be true for
1739
- * perspective cameras and false for orthographic cameras.
1740
- */
1741
- set fade(active: boolean);
1742
- private readonly _grid;
1743
- private _fade;
1744
- constructor(components: Components, world: World, config: GridConfig);
1745
- [Symbol.dispose](): void;
1746
- /** {@link Component.get} */
1747
- get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
1748
- /** {@link Disposable.dispose} */
1749
- dispose(): void;
1750
- private setupEvents;
1751
- private updateZoom;
1752
- }
1753
- import { NavigationMode } from "./types";
1754
- /**
1755
- * A {@link NavigationMode} that allows first person navigation,
1756
- * simulating FPS video games.
1757
- */
1758
- export declare class FirstPersonMode implements NavigationMode {
1759
- private camera;
1760
- /** {@link NavigationMode.enabled} */
1761
- enabled: boolean;
1762
- /** {@link NavigationMode.id} */
1763
- readonly id = "FirstPerson";
1764
- constructor(camera: any);
1765
- /** {@link NavigationMode.set} */
1766
- set(active: boolean): void;
1767
- private setupFirstPersonCamera;
1768
- }
1769
- import { NavigationMode } from "./types";
1770
- /**
1771
- * A {@link NavigationMode} that allows 3D navigation and panning
1772
- * like in many 3D and CAD softwares.
1773
- */
1774
- export declare class OrbitMode implements NavigationMode {
1775
- camera: any;
1776
- /** {@link NavigationMode.enabled} */
1777
- enabled: boolean;
1778
- /** {@link NavigationMode.id} */
1779
- readonly id = "Orbit";
1780
- constructor(camera: any);
1781
- /** {@link NavigationMode.set} */
1782
- set(active: boolean): void;
1783
- private activateOrbitControls;
1784
- }
1785
- import { NavigationMode } from "./types";
1786
- /**
1787
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1788
- * like many BIM tools.
1789
- */
1790
- export declare class PlanMode implements NavigationMode {
1791
- private camera;
1792
- /** {@link NavigationMode.enabled} */
1793
- enabled: boolean;
1794
- /** {@link NavigationMode.id} */
1795
- readonly id = "Plan";
1796
- private mouseAction1?;
1797
- private mouseAction2?;
1798
- private mouseInitialized;
1799
- private readonly defaultAzimuthSpeed;
1800
- private readonly defaultPolarSpeed;
1801
- constructor(camera: any);
1802
- /** {@link NavigationMode.set} */
1803
- set(active: boolean): void;
1804
- }
1805
1831
  import * as THREE from "three";
1806
1832
  import { CameraProjection } from "./types";
1807
- import { Event } from "../../../core";
1833
+ import { Event } from "../../Types";
1808
1834
  import { OrthoPerspectiveCamera } from "../index";
1809
1835
  /**
1810
1836
  * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
@@ -1813,7 +1839,7 @@ export declare class ProjectionManager {
1813
1839
  /**
1814
1840
  * Event that fires when the {@link CameraProjection} changes.
1815
1841
  */
1816
- readonly onChanged: Event<THREE.Camera>;
1842
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1817
1843
  current: CameraProjection;
1818
1844
  camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1819
1845
  private _component;
@@ -1834,7 +1860,7 @@ export declare class ProjectionManager {
1834
1860
  */
1835
1861
  toggle(): Promise<void>;
1836
1862
  private setOrthoCamera;
1837
- private getDims;
1863
+ private getPerspectiveDims;
1838
1864
  private setupOrthoCamera;
1839
1865
  private getDistance;
1840
1866
  private setPerspectiveCamera;
@@ -1867,52 +1893,6 @@ export interface NavigationMode {
1867
1893
  enabled: boolean;
1868
1894
  }
1869
1895
  import * as WEBIFC from "web-ifc";
1870
- /** Configuration of the IFC-fragment conversion. */
1871
- export declare class IfcFragmentSettings {
1872
- /** Whether to extract the IFC properties into a JSON. */
1873
- includeProperties: boolean;
1874
- /**
1875
- * Generate the geometry for categories that are not included by default,
1876
- * like IFCSPACE.
1877
- */
1878
- optionalCategories: number[];
1879
- /** Whether to use the coordination data coming from the IFC files. */
1880
- coordinate: boolean;
1881
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1882
- wasm: {
1883
- path: string;
1884
- absolute: boolean;
1885
- logLevel?: WEBIFC.LogLevel;
1886
- };
1887
- /** List of categories that won't be converted to fragments. */
1888
- excludedCategories: Set<number>;
1889
- /** Whether to save the absolute location of all IFC items. */
1890
- saveLocations: boolean;
1891
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1892
- webIfc: WEBIFC.LoaderSettings;
1893
- autoSetWasm: boolean;
1894
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1895
- }
1896
- import * as THREE from "three";
1897
- import * as WEBIFC from "web-ifc";
1898
- import * as FRAGS from "@thatopen/fragments";
1899
- export declare class CivilReader {
1900
- defLineMat: THREE.LineBasicMaterial;
1901
- read(webIfc: WEBIFC.IfcAPI): {
1902
- alignments: Map<number, FRAGS.Alignment>;
1903
- coordinationMatrix: THREE.Matrix4;
1904
- } | undefined;
1905
- get(civilItems: any): {
1906
- alignments: Map<number, FRAGS.Alignment>;
1907
- coordinationMatrix: THREE.Matrix4;
1908
- } | undefined;
1909
- private getCurves;
1910
- }
1911
- import * as WEBIFC from "web-ifc";
1912
- export declare class IfcMetadataReader {
1913
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1914
- }
1915
- import * as WEBIFC from "web-ifc";
1916
1896
  import * as THREE from "three";
1917
1897
  export declare class Units {
1918
1898
  factor: number;
@@ -1922,7 +1902,7 @@ export declare class Units {
1922
1902
  private getLengthUnits;
1923
1903
  private getScaleMatrix;
1924
1904
  }
1925
- import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1905
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
1926
1906
  /** Configuration of the IFC-fragment streaming. */
1927
1907
  export declare class IfcStreamingSettings extends IfcFragmentSettings {
1928
1908
  minGeometrySize: number;
@@ -2003,28 +1983,5 @@ import * as THREE from "three";
2003
1983
  export declare class TransformHelper {
2004
1984
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
2005
1985
  }
2006
- export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
2007
- export type ConditionFunctions = {
2008
- [queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
2009
- };
2010
- export type QueryOperators = "AND" | "OR";
2011
- export interface AttributeQuery {
2012
- operator?: QueryOperators;
2013
- attribute: string;
2014
- condition: QueryConditions;
2015
- value: string | number | boolean;
2016
- negateResult?: boolean;
2017
- caseSensitive?: boolean;
2018
- }
2019
- export interface QueryGroup {
2020
- operator?: QueryOperators;
2021
- description?: string;
2022
- queries: (AttributeQuery | QueryGroup)[];
2023
- }
2024
- export interface Query {
2025
- name: string;
2026
- description?: string;
2027
- groups: QueryGroup;
2028
- }
2029
1986
 
2030
1987
  }