@thatopen/components 2.1.26 → 2.1.27
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.
- package/dist/core/Components/index.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +12 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +28 -1
- package/dist/namespace.d.ts +1482 -1470
- package/package.json +2 -2
package/dist/namespace.d.ts
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
import { Components } from "../Components";
|
|
4
|
-
import { Component } from "../Types";
|
|
5
|
-
/**
|
|
6
|
-
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
7
|
-
*/
|
|
8
|
-
export declare class Disposer extends Component {
|
|
9
|
-
private _disposedComponents;
|
|
10
|
-
/** {@link Component.enabled} */
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* A unique identifier for the component.
|
|
14
|
-
* This UUID is used to register the component within the Components system.
|
|
15
|
-
*/
|
|
16
|
-
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
17
|
-
constructor(components: Components);
|
|
18
|
-
/**
|
|
19
|
-
* Return the UUIDs of all disposed components.
|
|
20
|
-
*/
|
|
21
|
-
get(): Set<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
24
|
-
* using any of these in other parts of the application, make sure that you
|
|
25
|
-
* remove them from the mesh before disposing it.
|
|
26
|
-
*
|
|
27
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
28
|
-
* to remove.
|
|
29
|
-
*
|
|
30
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
31
|
-
*
|
|
32
|
-
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
33
|
-
*/
|
|
34
|
-
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
35
|
-
/**
|
|
36
|
-
* Disposes a geometry from memory.
|
|
37
|
-
*
|
|
38
|
-
* @param geometry - the
|
|
39
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
40
|
-
* to remove.
|
|
41
|
-
*/
|
|
42
|
-
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
43
|
-
private disposeGeometryAndMaterials;
|
|
44
|
-
private disposeChildren;
|
|
45
|
-
private static disposeMaterial;
|
|
46
|
-
}
|
|
47
2
|
import { Component, Disposable, Event } from "../Types";
|
|
48
3
|
/**
|
|
49
4
|
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
@@ -52,7 +7,7 @@ export declare class Components implements Disposable {
|
|
|
52
7
|
/**
|
|
53
8
|
* The version of the @thatopen/components library.
|
|
54
9
|
*/
|
|
55
|
-
static readonly release = "2.1.
|
|
10
|
+
static readonly release = "2.1.27";
|
|
56
11
|
/** {@link Disposable.onDisposed} */
|
|
57
12
|
readonly onDisposed: Event<void>;
|
|
58
13
|
/**
|
|
@@ -179,6 +134,93 @@ export declare class ShadowedScene extends SimpleScene implements Disposable {
|
|
|
179
134
|
updateShadows(): Promise<void>;
|
|
180
135
|
private recomputeShadows;
|
|
181
136
|
}
|
|
137
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
138
|
+
import { SimpleRaycaster } from "./src";
|
|
139
|
+
import { Components } from "../Components";
|
|
140
|
+
/**
|
|
141
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
142
|
+
*/
|
|
143
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
144
|
+
/**
|
|
145
|
+
* A unique identifier for the component.
|
|
146
|
+
* This UUID is used to register the component within the Components system.
|
|
147
|
+
*/
|
|
148
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
149
|
+
/** {@link Component.enabled} */
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* A Map that stores raycasters for each world.
|
|
153
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
154
|
+
*/
|
|
155
|
+
list: Map<string, SimpleRaycaster>;
|
|
156
|
+
/** {@link Disposable.onDisposed} */
|
|
157
|
+
onDisposed: Event<unknown>;
|
|
158
|
+
constructor(components: Components);
|
|
159
|
+
/**
|
|
160
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
161
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
162
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
163
|
+
*
|
|
164
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
165
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
166
|
+
*/
|
|
167
|
+
get(world: World): SimpleRaycaster;
|
|
168
|
+
/**
|
|
169
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
170
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
171
|
+
*
|
|
172
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
173
|
+
* @returns {void}
|
|
174
|
+
*/
|
|
175
|
+
delete(world: World): void;
|
|
176
|
+
/** {@link Disposable.dispose} */
|
|
177
|
+
dispose(): void;
|
|
178
|
+
}
|
|
179
|
+
import * as THREE from "three";
|
|
180
|
+
import { Components } from "../Components";
|
|
181
|
+
import { Component } from "../Types";
|
|
182
|
+
/**
|
|
183
|
+
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
184
|
+
*/
|
|
185
|
+
export declare class Disposer extends Component {
|
|
186
|
+
private _disposedComponents;
|
|
187
|
+
/** {@link Component.enabled} */
|
|
188
|
+
enabled: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* A unique identifier for the component.
|
|
191
|
+
* This UUID is used to register the component within the Components system.
|
|
192
|
+
*/
|
|
193
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
194
|
+
constructor(components: Components);
|
|
195
|
+
/**
|
|
196
|
+
* Return the UUIDs of all disposed components.
|
|
197
|
+
*/
|
|
198
|
+
get(): Set<string>;
|
|
199
|
+
/**
|
|
200
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
201
|
+
* using any of these in other parts of the application, make sure that you
|
|
202
|
+
* remove them from the mesh before disposing it.
|
|
203
|
+
*
|
|
204
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
205
|
+
* to remove.
|
|
206
|
+
*
|
|
207
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
208
|
+
*
|
|
209
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
210
|
+
*/
|
|
211
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
212
|
+
/**
|
|
213
|
+
* Disposes a geometry from memory.
|
|
214
|
+
*
|
|
215
|
+
* @param geometry - the
|
|
216
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
217
|
+
* to remove.
|
|
218
|
+
*/
|
|
219
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
220
|
+
private disposeGeometryAndMaterials;
|
|
221
|
+
private disposeChildren;
|
|
222
|
+
private static disposeMaterial;
|
|
223
|
+
}
|
|
182
224
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
183
225
|
import { Components } from "../Components";
|
|
184
226
|
import { SimpleWorld } from "./src";
|
|
@@ -295,96 +337,188 @@ export declare class Grids extends Component implements Disposable {
|
|
|
295
337
|
/** {@link Disposable.dispose} */
|
|
296
338
|
dispose(): void;
|
|
297
339
|
}
|
|
298
|
-
import
|
|
299
|
-
|
|
300
|
-
|
|
340
|
+
import * as THREE from "three";
|
|
341
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
342
|
+
center: THREE.Vector3;
|
|
343
|
+
halfSizes: THREE.Vector3;
|
|
344
|
+
rotation: THREE.Matrix3;
|
|
345
|
+
transformation: THREE.Matrix4;
|
|
346
|
+
};
|
|
347
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
348
|
+
export declare class UUID {
|
|
349
|
+
private static _pattern;
|
|
350
|
+
private static _lut;
|
|
351
|
+
static create(): string;
|
|
352
|
+
static validate(uuid: string): void;
|
|
353
|
+
}
|
|
354
|
+
import * as THREE from "three";
|
|
355
|
+
export declare class MaterialsUtils {
|
|
356
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
357
|
+
}
|
|
358
|
+
import * as THREE from "three";
|
|
359
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
301
360
|
/**
|
|
302
|
-
*
|
|
361
|
+
* Configuration interface for the VertexPicker component.
|
|
303
362
|
*/
|
|
304
|
-
export
|
|
305
|
-
/**
|
|
306
|
-
* A unique identifier for the component.
|
|
307
|
-
* This UUID is used to register the component within the Components system.
|
|
308
|
-
*/
|
|
309
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
310
|
-
/** {@link Component.enabled} */
|
|
311
|
-
enabled: boolean;
|
|
363
|
+
export interface VertexPickerConfig {
|
|
312
364
|
/**
|
|
313
|
-
*
|
|
314
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
365
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
315
366
|
*/
|
|
316
|
-
|
|
317
|
-
/** {@link Disposable.onDisposed} */
|
|
318
|
-
onDisposed: Event<unknown>;
|
|
319
|
-
constructor(components: Components);
|
|
367
|
+
showOnlyVertex: boolean;
|
|
320
368
|
/**
|
|
321
|
-
*
|
|
322
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
323
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
324
|
-
*
|
|
325
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
326
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
369
|
+
* The maximum distance for snapping to a vertex.
|
|
327
370
|
*/
|
|
328
|
-
|
|
371
|
+
snapDistance: number;
|
|
329
372
|
/**
|
|
330
|
-
*
|
|
331
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
332
|
-
*
|
|
333
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
334
|
-
* @returns {void}
|
|
373
|
+
* The HTML element to use for previewing the picked vertex.
|
|
335
374
|
*/
|
|
336
|
-
|
|
337
|
-
/** {@link Disposable.dispose} */
|
|
338
|
-
dispose(): void;
|
|
375
|
+
previewElement: HTMLElement;
|
|
339
376
|
}
|
|
340
|
-
import * as THREE from "three";
|
|
341
|
-
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
342
|
-
import { SimplePlane } from "./src";
|
|
343
|
-
import { Components } from "../Components";
|
|
344
377
|
/**
|
|
345
|
-
* A
|
|
346
|
-
*
|
|
347
|
-
* @param components - the instance of {@link Components} used.
|
|
348
|
-
* E.g. {@link SimplePlane}.
|
|
378
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
349
379
|
*/
|
|
350
|
-
export declare class
|
|
380
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
381
|
+
/** {@link Disposable.onDisposed} */
|
|
382
|
+
readonly onDisposed: Event<unknown>;
|
|
351
383
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
384
|
+
* An event that is triggered when a vertex is found.
|
|
385
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
354
386
|
*/
|
|
355
|
-
|
|
356
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
357
|
-
readonly onBeforeDrag: Event<void>;
|
|
358
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
359
|
-
readonly onAfterDrag: Event<void>;
|
|
387
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
360
388
|
/**
|
|
361
|
-
*
|
|
389
|
+
* An event that is triggered when a vertex is lost.
|
|
390
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
362
391
|
*/
|
|
363
|
-
readonly
|
|
392
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
364
393
|
/**
|
|
365
|
-
*
|
|
394
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
366
395
|
*/
|
|
367
|
-
readonly
|
|
396
|
+
readonly onEnabled: Event<boolean>;
|
|
368
397
|
/**
|
|
369
|
-
*
|
|
398
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
370
399
|
*/
|
|
371
|
-
|
|
400
|
+
components: Components;
|
|
372
401
|
/**
|
|
373
|
-
*
|
|
402
|
+
* A reference to the working plane used for vertex picking.
|
|
403
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
404
|
+
* If this value is null, all vertices are considered valid.
|
|
374
405
|
*/
|
|
375
|
-
|
|
406
|
+
workingPlane: THREE.Plane | null;
|
|
407
|
+
private _pickedPoint;
|
|
408
|
+
private _config;
|
|
409
|
+
private _enabled;
|
|
376
410
|
/**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
411
|
+
* Sets the enabled state of the VertexPicker.
|
|
412
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
413
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
414
|
+
*
|
|
415
|
+
* @param value - The new enabled state.
|
|
379
416
|
*/
|
|
380
|
-
|
|
417
|
+
set enabled(value: boolean);
|
|
381
418
|
/**
|
|
382
|
-
*
|
|
383
|
-
*
|
|
419
|
+
* Gets the current enabled state of the VertexPicker.
|
|
420
|
+
*
|
|
421
|
+
* @returns The current enabled state.
|
|
384
422
|
*/
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
|
|
423
|
+
get enabled(): boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Sets the configuration for the VertexPicker component.
|
|
426
|
+
*
|
|
427
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
428
|
+
* The properties not provided in the value object will retain their current values.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* '''typescript
|
|
432
|
+
* vertexPicker.config = {
|
|
433
|
+
* snapDistance: 0.5,
|
|
434
|
+
* showOnlyVertex: true,
|
|
435
|
+
* };
|
|
436
|
+
* '''
|
|
437
|
+
*/
|
|
438
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
439
|
+
/**
|
|
440
|
+
* Gets the current configuration for the VertexPicker component.
|
|
441
|
+
*
|
|
442
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
443
|
+
*
|
|
444
|
+
* @example
|
|
445
|
+
* '''typescript
|
|
446
|
+
* const currentConfig = vertexPicker.config;
|
|
447
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
448
|
+
* '''
|
|
449
|
+
*/
|
|
450
|
+
get config(): Partial<VertexPickerConfig>;
|
|
451
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
452
|
+
/** {@link Disposable.dispose} */
|
|
453
|
+
dispose(): void;
|
|
454
|
+
/**
|
|
455
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
456
|
+
*
|
|
457
|
+
* @param world - The World instance to use for raycasting.
|
|
458
|
+
*
|
|
459
|
+
* @returns The current picked point, or null if no point is picked.
|
|
460
|
+
*
|
|
461
|
+
* @remarks
|
|
462
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
463
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
464
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
465
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
466
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
467
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
468
|
+
*/
|
|
469
|
+
get(world: World): THREE.Vector3 | null;
|
|
470
|
+
private getClosestVertex;
|
|
471
|
+
private getVertices;
|
|
472
|
+
private getVertex;
|
|
473
|
+
}
|
|
474
|
+
import * as THREE from "three";
|
|
475
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
476
|
+
import { SimplePlane } from "./src";
|
|
477
|
+
import { Components } from "../Components";
|
|
478
|
+
/**
|
|
479
|
+
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
480
|
+
*
|
|
481
|
+
* @param components - the instance of {@link Components} used.
|
|
482
|
+
* E.g. {@link SimplePlane}.
|
|
483
|
+
*/
|
|
484
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
485
|
+
/**
|
|
486
|
+
* A unique identifier for the component.
|
|
487
|
+
* This UUID is used to register the component within the Components system.
|
|
488
|
+
*/
|
|
489
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
490
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
491
|
+
readonly onBeforeDrag: Event<void>;
|
|
492
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
493
|
+
readonly onAfterDrag: Event<void>;
|
|
494
|
+
/**
|
|
495
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
496
|
+
*/
|
|
497
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
498
|
+
/**
|
|
499
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
500
|
+
*/
|
|
501
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
502
|
+
/**
|
|
503
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
504
|
+
*/
|
|
505
|
+
readonly onAfterCancel: Event<unknown>;
|
|
506
|
+
/**
|
|
507
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
508
|
+
*/
|
|
509
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
510
|
+
/**
|
|
511
|
+
* Event that fires after a clipping plane has been created.
|
|
512
|
+
* @param plane - The newly created clipping plane.
|
|
513
|
+
*/
|
|
514
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
515
|
+
/**
|
|
516
|
+
* Event that fires after a clipping plane has been deleted.
|
|
517
|
+
* @param plane - The deleted clipping plane.
|
|
518
|
+
*/
|
|
519
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
520
|
+
/** {@link Disposable.onDisposed} */
|
|
521
|
+
readonly onDisposed: Event<string>;
|
|
388
522
|
/**
|
|
389
523
|
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
390
524
|
* (up). This is desirable when clipping a building horizontally and a
|
|
@@ -637,12 +771,110 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
637
771
|
private setOrthoPerspCameraAspect;
|
|
638
772
|
}
|
|
639
773
|
import * as THREE from "three";
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
774
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
775
|
+
import { Component, Components } from "../../core";
|
|
776
|
+
/**
|
|
777
|
+
* Represents an edge measurement result.
|
|
778
|
+
*/
|
|
779
|
+
export interface MeasureEdge {
|
|
780
|
+
/**
|
|
781
|
+
* The distance between the two points of the edge.
|
|
782
|
+
*/
|
|
783
|
+
distance: number;
|
|
784
|
+
/**
|
|
785
|
+
* The two points that define the edge.
|
|
786
|
+
*/
|
|
787
|
+
points: THREE.Vector3[];
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
791
|
+
*/
|
|
792
|
+
export declare class MeasurementUtils extends Component {
|
|
793
|
+
/**
|
|
794
|
+
* A unique identifier for the component.
|
|
795
|
+
* This UUID is used to register the component within the Components system.
|
|
796
|
+
*/
|
|
797
|
+
static uuid: string;
|
|
798
|
+
/** {@link Component.enabled} */
|
|
799
|
+
enabled: boolean;
|
|
800
|
+
constructor(components: Components);
|
|
801
|
+
/**
|
|
802
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
803
|
+
*
|
|
804
|
+
* @param point - The point from which to calculate the distance.
|
|
805
|
+
* @param lineStart - The start point of the line segment.
|
|
806
|
+
* @param lineEnd - The end point of the line segment.
|
|
807
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
808
|
+
* @returns The distance from the point to the line segment.
|
|
809
|
+
*/
|
|
810
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
811
|
+
/**
|
|
812
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
813
|
+
* It also returns the edges of the found face and their indices.
|
|
814
|
+
*
|
|
815
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
816
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
817
|
+
* @param instance - The instance of the mesh (optional).
|
|
818
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
819
|
+
*/
|
|
820
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
821
|
+
edges: MeasureEdge[];
|
|
822
|
+
indices: Set<number>;
|
|
823
|
+
} | null;
|
|
824
|
+
/**
|
|
825
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
826
|
+
* It also applies instance transformation if provided.
|
|
827
|
+
*
|
|
828
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
829
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
830
|
+
* @param instance - The instance of the mesh (optional).
|
|
831
|
+
* @returns An object containing the vertices and normal of the face.
|
|
832
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
833
|
+
*/
|
|
834
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
835
|
+
p1: THREE.Vector3;
|
|
836
|
+
p2: THREE.Vector3;
|
|
837
|
+
p3: THREE.Vector3;
|
|
838
|
+
faceNormal: THREE.Vector3;
|
|
839
|
+
};
|
|
840
|
+
/**
|
|
841
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
842
|
+
* This is used to ensure numerical precision in edge detection.
|
|
843
|
+
*
|
|
844
|
+
* @param vector - The vector to round.
|
|
845
|
+
* @returns The vector with rounded components.
|
|
846
|
+
*/
|
|
847
|
+
round(vector: THREE.Vector3): void;
|
|
848
|
+
/**
|
|
849
|
+
* Calculates the volume of a set of fragments.
|
|
850
|
+
*
|
|
851
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
852
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
853
|
+
*
|
|
854
|
+
* @remarks
|
|
855
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
856
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
857
|
+
*
|
|
858
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
859
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
860
|
+
*/
|
|
861
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
862
|
+
/**
|
|
863
|
+
* Calculates the total volume of a set of meshes.
|
|
864
|
+
*
|
|
865
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
866
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
867
|
+
*
|
|
868
|
+
* @remarks
|
|
869
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
870
|
+
* and its bounding sphere.
|
|
871
|
+
*
|
|
872
|
+
*/
|
|
873
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
874
|
+
private getFaceData;
|
|
875
|
+
private getVolumeOfMesh;
|
|
876
|
+
private getSignedVolumeOfTriangle;
|
|
877
|
+
}
|
|
646
878
|
import * as WEBIFC from "web-ifc";
|
|
647
879
|
import * as FRAG from "@thatopen/fragments";
|
|
648
880
|
import { Component, Components } from "../../core";
|
|
@@ -668,54 +900,228 @@ export declare class IfcJsonExporter extends Component {
|
|
|
668
900
|
*/
|
|
669
901
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
670
902
|
}
|
|
671
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
672
903
|
import * as WEBIFC from "web-ifc";
|
|
673
904
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
674
|
-
import {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
*/
|
|
678
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
679
|
-
/**
|
|
680
|
-
* Types for string properties in IFC schema.
|
|
681
|
-
*/
|
|
682
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
683
|
-
/**
|
|
684
|
-
* Types for numeric properties in IFC schema.
|
|
685
|
-
*/
|
|
686
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
687
|
-
/**
|
|
688
|
-
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
689
|
-
*/
|
|
690
|
-
export interface ChangeMap {
|
|
691
|
-
[modelID: string]: Set<number>;
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
695
|
-
*/
|
|
696
|
-
export interface AttributeListener {
|
|
697
|
-
[modelID: string]: {
|
|
698
|
-
[expressID: number]: {
|
|
699
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
700
|
-
};
|
|
701
|
-
};
|
|
702
|
-
}
|
|
905
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
906
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
907
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
703
908
|
/**
|
|
704
|
-
*
|
|
909
|
+
* Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. 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. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
|
|
705
910
|
*/
|
|
706
|
-
export declare class
|
|
911
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
707
912
|
/**
|
|
708
913
|
* A unique identifier for the component.
|
|
709
914
|
* This UUID is used to register the component within the Components system.
|
|
710
915
|
*/
|
|
711
|
-
static readonly uuid: "
|
|
916
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
712
917
|
/** {@link Disposable.onDisposed} */
|
|
713
918
|
readonly onDisposed: Event<string>;
|
|
714
919
|
/**
|
|
715
|
-
* Event triggered when a
|
|
920
|
+
* Event triggered when relations for a model have been indexed.
|
|
921
|
+
* This event provides the model's UUID and the relations map generated for that model.
|
|
922
|
+
*
|
|
923
|
+
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
924
|
+
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
925
|
+
* 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.
|
|
716
926
|
*/
|
|
717
|
-
readonly
|
|
718
|
-
|
|
927
|
+
readonly onRelationsIndexed: Event<{
|
|
928
|
+
modelID: string;
|
|
929
|
+
relationsMap: RelationsMap;
|
|
930
|
+
}>;
|
|
931
|
+
/**
|
|
932
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
933
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
934
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
935
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
936
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
937
|
+
* of entity relationships within a model.
|
|
938
|
+
*/
|
|
939
|
+
readonly relationMaps: ModelsRelationMap;
|
|
940
|
+
/** {@link Component.enabled} */
|
|
941
|
+
enabled: boolean;
|
|
942
|
+
private _relToAttributesMap;
|
|
943
|
+
private _inverseAttributes;
|
|
944
|
+
private _ifcRels;
|
|
945
|
+
constructor(components: Components);
|
|
946
|
+
private onFragmentsDisposed;
|
|
947
|
+
private indexRelations;
|
|
948
|
+
private getAttributeIndex;
|
|
949
|
+
/**
|
|
950
|
+
* Adds a relation map to the model's relations map.
|
|
951
|
+
*
|
|
952
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
953
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
954
|
+
*
|
|
955
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
956
|
+
*/
|
|
957
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
958
|
+
/**
|
|
959
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
960
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
961
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
962
|
+
*
|
|
963
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
964
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
965
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
966
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
967
|
+
* of entities that are related through that attribute.
|
|
968
|
+
*
|
|
969
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
970
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
971
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
972
|
+
* @throws An error if the model does not have properties loaded.
|
|
973
|
+
*/
|
|
974
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
975
|
+
/**
|
|
976
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
977
|
+
*
|
|
978
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
979
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
980
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
981
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
982
|
+
*/
|
|
983
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
984
|
+
/**
|
|
985
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
986
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
987
|
+
* returning the IDs of related entities if a match is found.
|
|
988
|
+
*
|
|
989
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
990
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
991
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
992
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
993
|
+
* or the specified relation name is not indexed.
|
|
994
|
+
*/
|
|
995
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
996
|
+
/**
|
|
997
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
998
|
+
* 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,
|
|
999
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1000
|
+
* The resulting object is then serialized into a JSON string.
|
|
1001
|
+
*
|
|
1002
|
+
* @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.
|
|
1003
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
1004
|
+
*/
|
|
1005
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
1006
|
+
/**
|
|
1007
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
1008
|
+
* This method iterates through the relations indexed for the given model,
|
|
1009
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
1010
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1011
|
+
* The resulting object is then serialized into a JSON string.
|
|
1012
|
+
*
|
|
1013
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
1014
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
1015
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
1016
|
+
*/
|
|
1017
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
1018
|
+
/**
|
|
1019
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
1020
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
1021
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
1022
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
1023
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
1024
|
+
*
|
|
1025
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
1026
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
1027
|
+
*/
|
|
1028
|
+
serializeAllRelations(): string;
|
|
1029
|
+
/**
|
|
1030
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
1031
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
1032
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
1033
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
1034
|
+
* of express IDs of entities related through that relation type.
|
|
1035
|
+
*
|
|
1036
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
1037
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
1038
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
1039
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
1040
|
+
*/
|
|
1041
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
1042
|
+
/** {@link Disposable.dispose} */
|
|
1043
|
+
dispose(): void;
|
|
1044
|
+
/**
|
|
1045
|
+
* Retrieves the entities within a given model that have a specific relation with a given entity.
|
|
1046
|
+
*
|
|
1047
|
+
* @param model - The BIM model to search for related entities.
|
|
1048
|
+
* @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
1049
|
+
* @param expressID - The expressID of the entity within the model.
|
|
1050
|
+
*
|
|
1051
|
+
* @returns A 'Set' with the expressIDs of the entities that have the specified relation with the given entity.
|
|
1052
|
+
*
|
|
1053
|
+
* @throws An error if the model relations are not indexed or if the inverse attribute name is invalid.
|
|
1054
|
+
*/
|
|
1055
|
+
getEntitiesWithRelation(model: FragmentsGroup, inv: InverseAttribute, expressID: number): Set<number>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Adds relations between an entity and other entities in a BIM model.
|
|
1058
|
+
*
|
|
1059
|
+
* @param model - The BIM model to which the relations will be added.
|
|
1060
|
+
* @param expressID - The expressID of the entity within the model.
|
|
1061
|
+
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
1062
|
+
* @param relIDs - The expressIDs of the related entities within the model.
|
|
1063
|
+
*
|
|
1064
|
+
* @throws An error if the relation name is not a valid relation name.
|
|
1065
|
+
*/
|
|
1066
|
+
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
1067
|
+
/**
|
|
1068
|
+
* Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
|
|
1069
|
+
*
|
|
1070
|
+
* @param model The BIM model whose children to get.
|
|
1071
|
+
* @param expressID The expressID of the item whose children to get.
|
|
1072
|
+
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
1073
|
+
*
|
|
1074
|
+
* @returns A 'Set' with the expressIDs of the found items.
|
|
1075
|
+
*/
|
|
1076
|
+
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
1077
|
+
}
|
|
1078
|
+
import * as WEBIFC from "web-ifc";
|
|
1079
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1080
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1081
|
+
/**
|
|
1082
|
+
* Types for boolean properties in IFC schema.
|
|
1083
|
+
*/
|
|
1084
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1085
|
+
/**
|
|
1086
|
+
* Types for string properties in IFC schema.
|
|
1087
|
+
*/
|
|
1088
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1089
|
+
/**
|
|
1090
|
+
* Types for numeric properties in IFC schema.
|
|
1091
|
+
*/
|
|
1092
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1093
|
+
/**
|
|
1094
|
+
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1095
|
+
*/
|
|
1096
|
+
export interface ChangeMap {
|
|
1097
|
+
[modelID: string]: Set<number>;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1101
|
+
*/
|
|
1102
|
+
export interface AttributeListener {
|
|
1103
|
+
[modelID: string]: {
|
|
1104
|
+
[expressID: number]: {
|
|
1105
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1106
|
+
};
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1111
|
+
*/
|
|
1112
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1113
|
+
/**
|
|
1114
|
+
* A unique identifier for the component.
|
|
1115
|
+
* This UUID is used to register the component within the Components system.
|
|
1116
|
+
*/
|
|
1117
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1118
|
+
/** {@link Disposable.onDisposed} */
|
|
1119
|
+
readonly onDisposed: Event<string>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Event triggered when a file is requested for export.
|
|
1122
|
+
*/
|
|
1123
|
+
readonly onRequestFile: Event<unknown>;
|
|
1124
|
+
/**
|
|
719
1125
|
* ArrayBuffer containing the IFC data to be exported.
|
|
720
1126
|
*/
|
|
721
1127
|
ifcToExport: ArrayBuffer | null;
|
|
@@ -925,296 +1331,28 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
925
1331
|
private registerChange;
|
|
926
1332
|
private newSingleProperty;
|
|
927
1333
|
}
|
|
928
|
-
import * as
|
|
1334
|
+
import * as THREE from "three";
|
|
1335
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
929
1336
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
930
|
-
import {
|
|
931
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
932
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1337
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
933
1338
|
/**
|
|
934
|
-
*
|
|
1339
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
935
1340
|
*/
|
|
936
|
-
export declare class
|
|
937
|
-
|
|
938
|
-
* A unique identifier for the component.
|
|
939
|
-
* This UUID is used to register the component within the Components system.
|
|
940
|
-
*/
|
|
941
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
942
|
-
/** {@link Disposable.onDisposed} */
|
|
943
|
-
readonly onDisposed: Event<string>;
|
|
944
|
-
/**
|
|
945
|
-
* Event triggered when relations for a model have been indexed.
|
|
946
|
-
* This event provides the model's UUID and the relations map generated for that model.
|
|
947
|
-
*
|
|
948
|
-
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
949
|
-
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
950
|
-
* 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.
|
|
951
|
-
*/
|
|
952
|
-
readonly onRelationsIndexed: Event<{
|
|
953
|
-
modelID: string;
|
|
954
|
-
relationsMap: RelationsMap;
|
|
955
|
-
}>;
|
|
956
|
-
/**
|
|
957
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
958
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
959
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
960
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
961
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
962
|
-
* of entity relationships within a model.
|
|
963
|
-
*/
|
|
964
|
-
readonly relationMaps: ModelsRelationMap;
|
|
1341
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
1342
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
965
1343
|
/** {@link Component.enabled} */
|
|
966
1344
|
enabled: boolean;
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
private
|
|
1345
|
+
/** {@link Disposable.onDisposed} */
|
|
1346
|
+
readonly onDisposed: Event<unknown>;
|
|
1347
|
+
private _absoluteMin;
|
|
1348
|
+
private _absoluteMax;
|
|
1349
|
+
private _meshes;
|
|
970
1350
|
constructor(components: Components);
|
|
971
|
-
private onFragmentsDisposed;
|
|
972
|
-
private indexRelations;
|
|
973
|
-
private getAttributeIndex;
|
|
974
1351
|
/**
|
|
975
|
-
*
|
|
976
|
-
*
|
|
977
|
-
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
978
|
-
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
1352
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
979
1353
|
*
|
|
980
|
-
* @
|
|
981
|
-
|
|
982
|
-
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
983
|
-
/**
|
|
984
|
-
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
985
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
986
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
987
|
-
*
|
|
988
|
-
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
989
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
990
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
991
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
992
|
-
* of entities that are related through that attribute.
|
|
993
|
-
*
|
|
994
|
-
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
995
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
996
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
997
|
-
* @throws An error if the model does not have properties loaded.
|
|
998
|
-
*/
|
|
999
|
-
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
1000
|
-
/**
|
|
1001
|
-
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
1002
|
-
*
|
|
1003
|
-
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
1004
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
1005
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
1006
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
1007
|
-
*/
|
|
1008
|
-
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
1009
|
-
/**
|
|
1010
|
-
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
1011
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
1012
|
-
* returning the IDs of related entities if a match is found.
|
|
1013
|
-
*
|
|
1014
|
-
* @param model The 'FragmentsGroup' model containing the entity.
|
|
1015
|
-
* @param expressID The unique identifier of the entity within the model.
|
|
1016
|
-
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
1017
|
-
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
1018
|
-
* or the specified relation name is not indexed.
|
|
1019
|
-
*/
|
|
1020
|
-
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
1021
|
-
/**
|
|
1022
|
-
* Serializes the relations of a given relation map into a JSON string.
|
|
1023
|
-
* 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,
|
|
1024
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1025
|
-
* The resulting object is then serialized into a JSON string.
|
|
1026
|
-
*
|
|
1027
|
-
* @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.
|
|
1028
|
-
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
1029
|
-
*/
|
|
1030
|
-
serializeRelations(relationMap: RelationsMap): string;
|
|
1031
|
-
/**
|
|
1032
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
1033
|
-
* This method iterates through the relations indexed for the given model,
|
|
1034
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
1035
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1036
|
-
* The resulting object is then serialized into a JSON string.
|
|
1037
|
-
*
|
|
1038
|
-
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
1039
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
1040
|
-
* If the model has no indexed relations, 'null' is returned.
|
|
1041
|
-
*/
|
|
1042
|
-
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
1043
|
-
/**
|
|
1044
|
-
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
1045
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
1046
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
1047
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
1048
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
1049
|
-
*
|
|
1050
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
1051
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
1052
|
-
*/
|
|
1053
|
-
serializeAllRelations(): string;
|
|
1054
|
-
/**
|
|
1055
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
1056
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
1057
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
1058
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
1059
|
-
* of express IDs of entities related through that relation type.
|
|
1060
|
-
*
|
|
1061
|
-
* @param json The JSON string to be parsed into the relations map.
|
|
1062
|
-
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
1063
|
-
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
1064
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
1065
|
-
*/
|
|
1066
|
-
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
1067
|
-
/** {@link Disposable.dispose} */
|
|
1068
|
-
dispose(): void;
|
|
1069
|
-
/**
|
|
1070
|
-
* Adds relations between an entity and other entities in a BIM model.
|
|
1071
|
-
*
|
|
1072
|
-
* @param model - The BIM model to which the relations will be added.
|
|
1073
|
-
* @param expressID - The expressID of the entity within the model.
|
|
1074
|
-
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
1075
|
-
* @param relIDs - The expressIDs of the related entities within the model.
|
|
1076
|
-
*
|
|
1077
|
-
* @throws An error if the relation name is not a valid relation name.
|
|
1078
|
-
*/
|
|
1079
|
-
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
1080
|
-
/**
|
|
1081
|
-
* Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
|
|
1082
|
-
*
|
|
1083
|
-
* @param model The BIM model whose children to get.
|
|
1084
|
-
* @param expressID The expressID of the item whose children to get.
|
|
1085
|
-
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
1086
|
-
*
|
|
1087
|
-
* @returns A 'Set' with the expressIDs of the found items.
|
|
1088
|
-
*/
|
|
1089
|
-
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
1090
|
-
}
|
|
1091
|
-
import * as THREE from "three";
|
|
1092
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1093
|
-
import { Component, Components } from "../../core";
|
|
1094
|
-
/**
|
|
1095
|
-
* Represents an edge measurement result.
|
|
1096
|
-
*/
|
|
1097
|
-
export interface MeasureEdge {
|
|
1098
|
-
/**
|
|
1099
|
-
* The distance between the two points of the edge.
|
|
1100
|
-
*/
|
|
1101
|
-
distance: number;
|
|
1102
|
-
/**
|
|
1103
|
-
* The two points that define the edge.
|
|
1104
|
-
*/
|
|
1105
|
-
points: THREE.Vector3[];
|
|
1106
|
-
}
|
|
1107
|
-
/**
|
|
1108
|
-
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
1109
|
-
*/
|
|
1110
|
-
export declare class MeasurementUtils extends Component {
|
|
1111
|
-
/**
|
|
1112
|
-
* A unique identifier for the component.
|
|
1113
|
-
* This UUID is used to register the component within the Components system.
|
|
1114
|
-
*/
|
|
1115
|
-
static uuid: string;
|
|
1116
|
-
/** {@link Component.enabled} */
|
|
1117
|
-
enabled: boolean;
|
|
1118
|
-
constructor(components: Components);
|
|
1119
|
-
/**
|
|
1120
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
1121
|
-
*
|
|
1122
|
-
* @param point - The point from which to calculate the distance.
|
|
1123
|
-
* @param lineStart - The start point of the line segment.
|
|
1124
|
-
* @param lineEnd - The end point of the line segment.
|
|
1125
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1126
|
-
* @returns The distance from the point to the line segment.
|
|
1127
|
-
*/
|
|
1128
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1129
|
-
/**
|
|
1130
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
1131
|
-
* It also returns the edges of the found face and their indices.
|
|
1132
|
-
*
|
|
1133
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1134
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1135
|
-
* @param instance - The instance of the mesh (optional).
|
|
1136
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1137
|
-
*/
|
|
1138
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1139
|
-
edges: MeasureEdge[];
|
|
1140
|
-
indices: Set<number>;
|
|
1141
|
-
} | null;
|
|
1142
|
-
/**
|
|
1143
|
-
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1144
|
-
* It also applies instance transformation if provided.
|
|
1145
|
-
*
|
|
1146
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1147
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
1148
|
-
* @param instance - The instance of the mesh (optional).
|
|
1149
|
-
* @returns An object containing the vertices and normal of the face.
|
|
1150
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
1151
|
-
*/
|
|
1152
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1153
|
-
p1: THREE.Vector3;
|
|
1154
|
-
p2: THREE.Vector3;
|
|
1155
|
-
p3: THREE.Vector3;
|
|
1156
|
-
faceNormal: THREE.Vector3;
|
|
1157
|
-
};
|
|
1158
|
-
/**
|
|
1159
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
1160
|
-
* This is used to ensure numerical precision in edge detection.
|
|
1161
|
-
*
|
|
1162
|
-
* @param vector - The vector to round.
|
|
1163
|
-
* @returns The vector with rounded components.
|
|
1164
|
-
*/
|
|
1165
|
-
round(vector: THREE.Vector3): void;
|
|
1166
|
-
/**
|
|
1167
|
-
* Calculates the volume of a set of fragments.
|
|
1168
|
-
*
|
|
1169
|
-
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1170
|
-
* @returns The total volume of the fragments and the bounding sphere.
|
|
1171
|
-
*
|
|
1172
|
-
* @remarks
|
|
1173
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1174
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1175
|
-
*
|
|
1176
|
-
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1177
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
1178
|
-
*/
|
|
1179
|
-
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
1180
|
-
/**
|
|
1181
|
-
* Calculates the total volume of a set of meshes.
|
|
1182
|
-
*
|
|
1183
|
-
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1184
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
1185
|
-
*
|
|
1186
|
-
* @remarks
|
|
1187
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1188
|
-
* and its bounding sphere.
|
|
1189
|
-
*
|
|
1190
|
-
*/
|
|
1191
|
-
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
1192
|
-
private getFaceData;
|
|
1193
|
-
private getVolumeOfMesh;
|
|
1194
|
-
private getSignedVolumeOfTriangle;
|
|
1195
|
-
}
|
|
1196
|
-
import * as THREE from "three";
|
|
1197
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1198
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1199
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
1200
|
-
/**
|
|
1201
|
-
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
1202
|
-
*/
|
|
1203
|
-
export declare class BoundingBoxer extends Component implements Disposable {
|
|
1204
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
1205
|
-
/** {@link Component.enabled} */
|
|
1206
|
-
enabled: boolean;
|
|
1207
|
-
/** {@link Disposable.onDisposed} */
|
|
1208
|
-
readonly onDisposed: Event<unknown>;
|
|
1209
|
-
private _absoluteMin;
|
|
1210
|
-
private _absoluteMax;
|
|
1211
|
-
private _meshes;
|
|
1212
|
-
constructor(components: Components);
|
|
1213
|
-
/**
|
|
1214
|
-
* A static method to calculate the dimensions of a given bounding box.
|
|
1215
|
-
*
|
|
1216
|
-
* @param bbox - The bounding box to calculate the dimensions for.
|
|
1217
|
-
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
1354
|
+
* @param bbox - The bounding box to calculate the dimensions for.
|
|
1355
|
+
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
1218
1356
|
*/
|
|
1219
1357
|
static getDimensions(bbox: THREE.Box3): {
|
|
1220
1358
|
width: number;
|
|
@@ -1663,32 +1801,147 @@ export declare class Hider extends Component {
|
|
|
1663
1801
|
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1664
1802
|
private updateCulledVisibility;
|
|
1665
1803
|
}
|
|
1666
|
-
import
|
|
1667
|
-
import * as THREE from "three";
|
|
1804
|
+
import * as WEBIFC from "web-ifc";
|
|
1668
1805
|
import * as FRAGS from "@thatopen/fragments";
|
|
1669
|
-
import {
|
|
1670
|
-
import {
|
|
1806
|
+
import { IfcFragmentSettings } from "./src";
|
|
1807
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1671
1808
|
/**
|
|
1672
|
-
*
|
|
1809
|
+
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1673
1810
|
*/
|
|
1674
|
-
export declare class
|
|
1811
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1675
1812
|
/**
|
|
1676
1813
|
* A unique identifier for the component.
|
|
1677
1814
|
* This UUID is used to register the component within the Components system.
|
|
1678
1815
|
*/
|
|
1679
|
-
static readonly uuid: "
|
|
1816
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1680
1817
|
/** {@link Disposable.onDisposed} */
|
|
1681
|
-
readonly onDisposed: Event<
|
|
1818
|
+
readonly onDisposed: Event<string>;
|
|
1682
1819
|
/**
|
|
1683
|
-
*
|
|
1820
|
+
* An event triggered when the IFC file starts loading.
|
|
1684
1821
|
*/
|
|
1685
|
-
readonly
|
|
1822
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1686
1823
|
/**
|
|
1687
|
-
*
|
|
1824
|
+
* An event triggered when the setup process is completed.
|
|
1688
1825
|
*/
|
|
1689
|
-
readonly
|
|
1690
|
-
|
|
1691
|
-
|
|
1826
|
+
readonly onSetup: Event<void>;
|
|
1827
|
+
/**
|
|
1828
|
+
* The settings for the IfcLoader.
|
|
1829
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1830
|
+
*/
|
|
1831
|
+
settings: IfcFragmentSettings;
|
|
1832
|
+
/**
|
|
1833
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1834
|
+
*/
|
|
1835
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1836
|
+
/** {@link Component.enabled} */
|
|
1837
|
+
enabled: boolean;
|
|
1838
|
+
private _material;
|
|
1839
|
+
private _spatialTree;
|
|
1840
|
+
private _metaData;
|
|
1841
|
+
private _fragmentInstances;
|
|
1842
|
+
private _civil;
|
|
1843
|
+
private _visitedFragments;
|
|
1844
|
+
private _materialT;
|
|
1845
|
+
constructor(components: Components);
|
|
1846
|
+
/** {@link Disposable.dispose} */
|
|
1847
|
+
dispose(): void;
|
|
1848
|
+
/**
|
|
1849
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1850
|
+
*
|
|
1851
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
1852
|
+
* If not provided, the existing settings will be used.
|
|
1853
|
+
*
|
|
1854
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
1855
|
+
*
|
|
1856
|
+
* @remarks
|
|
1857
|
+
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1858
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1859
|
+
*
|
|
1860
|
+
* @example
|
|
1861
|
+
* '''typescript
|
|
1862
|
+
* const ifcLoader = new IfcLoader(components);
|
|
1863
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1864
|
+
* '''
|
|
1865
|
+
*/
|
|
1866
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1867
|
+
/**
|
|
1868
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
1869
|
+
*
|
|
1870
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1871
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1872
|
+
*
|
|
1873
|
+
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1874
|
+
*
|
|
1875
|
+
* @example
|
|
1876
|
+
* '''typescript
|
|
1877
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1878
|
+
* const group = await ifcLoader.load(ifcData);
|
|
1879
|
+
* '''
|
|
1880
|
+
*/
|
|
1881
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
1884
|
+
*
|
|
1885
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1886
|
+
*
|
|
1887
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1888
|
+
*
|
|
1889
|
+
* @remarks
|
|
1890
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1891
|
+
* It also opens the IFC model using the provided data and settings.
|
|
1892
|
+
*
|
|
1893
|
+
* @example
|
|
1894
|
+
* '''typescript
|
|
1895
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1896
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
1897
|
+
* '''
|
|
1898
|
+
*/
|
|
1899
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1900
|
+
/**
|
|
1901
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1902
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1903
|
+
*
|
|
1904
|
+
* @remarks
|
|
1905
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1906
|
+
*
|
|
1907
|
+
* @example
|
|
1908
|
+
* '''typescript
|
|
1909
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1910
|
+
* ifcLoader.cleanUp();
|
|
1911
|
+
* '''
|
|
1912
|
+
*/
|
|
1913
|
+
cleanUp(): void;
|
|
1914
|
+
private getAllGeometries;
|
|
1915
|
+
private getMesh;
|
|
1916
|
+
private getGeometry;
|
|
1917
|
+
private autoSetWasm;
|
|
1918
|
+
}
|
|
1919
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1920
|
+
import * as THREE from "three";
|
|
1921
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1922
|
+
import { Component, Components, Event, Disposable, DataMap } from "../../core";
|
|
1923
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1924
|
+
/**
|
|
1925
|
+
* Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
|
|
1926
|
+
*/
|
|
1927
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
1928
|
+
/**
|
|
1929
|
+
* A unique identifier for the component.
|
|
1930
|
+
* This UUID is used to register the component within the Components system.
|
|
1931
|
+
*/
|
|
1932
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
1933
|
+
/** {@link Disposable.onDisposed} */
|
|
1934
|
+
readonly onDisposed: Event<unknown>;
|
|
1935
|
+
/**
|
|
1936
|
+
* Event triggered when fragments are loaded.
|
|
1937
|
+
*/
|
|
1938
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1939
|
+
/**
|
|
1940
|
+
* Event triggered when fragments are disposed.
|
|
1941
|
+
*/
|
|
1942
|
+
readonly onFragmentsDisposed: Event<{
|
|
1943
|
+
groupID: string;
|
|
1944
|
+
fragmentIDs: string[];
|
|
1692
1945
|
}>;
|
|
1693
1946
|
/**
|
|
1694
1947
|
* DataMap containing all loaded fragments.
|
|
@@ -1800,121 +2053,6 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
1800
2053
|
clone(model: FRAGS.FragmentsGroup, items?: FRAGS.FragmentIdMap): FragmentsGroup;
|
|
1801
2054
|
}
|
|
1802
2055
|
import * as WEBIFC from "web-ifc";
|
|
1803
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1804
|
-
import { IfcFragmentSettings } from "./src";
|
|
1805
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
1806
|
-
/**
|
|
1807
|
-
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1808
|
-
*/
|
|
1809
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
1810
|
-
/**
|
|
1811
|
-
* A unique identifier for the component.
|
|
1812
|
-
* This UUID is used to register the component within the Components system.
|
|
1813
|
-
*/
|
|
1814
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1815
|
-
/** {@link Disposable.onDisposed} */
|
|
1816
|
-
readonly onDisposed: Event<string>;
|
|
1817
|
-
/**
|
|
1818
|
-
* An event triggered when the IFC file starts loading.
|
|
1819
|
-
*/
|
|
1820
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
1821
|
-
/**
|
|
1822
|
-
* An event triggered when the setup process is completed.
|
|
1823
|
-
*/
|
|
1824
|
-
readonly onSetup: Event<void>;
|
|
1825
|
-
/**
|
|
1826
|
-
* The settings for the IfcLoader.
|
|
1827
|
-
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1828
|
-
*/
|
|
1829
|
-
settings: IfcFragmentSettings;
|
|
1830
|
-
/**
|
|
1831
|
-
* The instance of the Web-IFC library used for handling IFC data.
|
|
1832
|
-
*/
|
|
1833
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1834
|
-
/** {@link Component.enabled} */
|
|
1835
|
-
enabled: boolean;
|
|
1836
|
-
private _material;
|
|
1837
|
-
private _spatialTree;
|
|
1838
|
-
private _metaData;
|
|
1839
|
-
private _fragmentInstances;
|
|
1840
|
-
private _civil;
|
|
1841
|
-
private _visitedFragments;
|
|
1842
|
-
private _materialT;
|
|
1843
|
-
constructor(components: Components);
|
|
1844
|
-
/** {@link Disposable.dispose} */
|
|
1845
|
-
dispose(): void;
|
|
1846
|
-
/**
|
|
1847
|
-
* Sets up the IfcLoader component with the provided configuration.
|
|
1848
|
-
*
|
|
1849
|
-
* @param config - Optional configuration settings for the IfcLoader.
|
|
1850
|
-
* If not provided, the existing settings will be used.
|
|
1851
|
-
*
|
|
1852
|
-
* @returns A Promise that resolves when the setup process is completed.
|
|
1853
|
-
*
|
|
1854
|
-
* @remarks
|
|
1855
|
-
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1856
|
-
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1857
|
-
*
|
|
1858
|
-
* @example
|
|
1859
|
-
* '''typescript
|
|
1860
|
-
* const ifcLoader = new IfcLoader(components);
|
|
1861
|
-
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1862
|
-
* '''
|
|
1863
|
-
*/
|
|
1864
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1865
|
-
/**
|
|
1866
|
-
* Loads an IFC file and processes it for 3D visualization.
|
|
1867
|
-
*
|
|
1868
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1869
|
-
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1870
|
-
*
|
|
1871
|
-
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1872
|
-
*
|
|
1873
|
-
* @example
|
|
1874
|
-
* '''typescript
|
|
1875
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1876
|
-
* const group = await ifcLoader.load(ifcData);
|
|
1877
|
-
* '''
|
|
1878
|
-
*/
|
|
1879
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1880
|
-
/**
|
|
1881
|
-
* Reads an IFC file and initializes the Web-IFC library.
|
|
1882
|
-
*
|
|
1883
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1884
|
-
*
|
|
1885
|
-
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1886
|
-
*
|
|
1887
|
-
* @remarks
|
|
1888
|
-
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1889
|
-
* It also opens the IFC model using the provided data and settings.
|
|
1890
|
-
*
|
|
1891
|
-
* @example
|
|
1892
|
-
* '''typescript
|
|
1893
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1894
|
-
* await ifcLoader.readIfcFile(ifcData);
|
|
1895
|
-
* '''
|
|
1896
|
-
*/
|
|
1897
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1898
|
-
/**
|
|
1899
|
-
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1900
|
-
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1901
|
-
*
|
|
1902
|
-
* @remarks
|
|
1903
|
-
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1904
|
-
*
|
|
1905
|
-
* @example
|
|
1906
|
-
* '''typescript
|
|
1907
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1908
|
-
* ifcLoader.cleanUp();
|
|
1909
|
-
* '''
|
|
1910
|
-
*/
|
|
1911
|
-
cleanUp(): void;
|
|
1912
|
-
private getAllGeometries;
|
|
1913
|
-
private getMesh;
|
|
1914
|
-
private getGeometry;
|
|
1915
|
-
private autoSetWasm;
|
|
1916
|
-
}
|
|
1917
|
-
import * as WEBIFC from "web-ifc";
|
|
1918
2056
|
import { Components, Disposable, Event, Component } from "../../core";
|
|
1919
2057
|
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1920
2058
|
/**
|
|
@@ -2078,202 +2216,23 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
2078
2216
|
private cleanUp;
|
|
2079
2217
|
}
|
|
2080
2218
|
import * as THREE from "three";
|
|
2081
|
-
|
|
2082
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
2083
|
-
}
|
|
2084
|
-
import * as THREE from "three";
|
|
2085
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
2219
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2086
2220
|
/**
|
|
2087
|
-
*
|
|
2221
|
+
* A class representing a 2D minimap of a 3D world.
|
|
2088
2222
|
*/
|
|
2089
|
-
export
|
|
2223
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
2224
|
+
/** {@link Disposable.onDisposed} */
|
|
2225
|
+
readonly onDisposed: Event<unknown>;
|
|
2226
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2227
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
2228
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2229
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
2230
|
+
/** {@link Resizeable.onResize} */
|
|
2231
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
2090
2232
|
/**
|
|
2091
|
-
*
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
/**
|
|
2095
|
-
* The maximum distance for snapping to a vertex.
|
|
2096
|
-
*/
|
|
2097
|
-
snapDistance: number;
|
|
2098
|
-
/**
|
|
2099
|
-
* The HTML element to use for previewing the picked vertex.
|
|
2100
|
-
*/
|
|
2101
|
-
previewElement: HTMLElement;
|
|
2102
|
-
}
|
|
2103
|
-
/**
|
|
2104
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
2105
|
-
*/
|
|
2106
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
2107
|
-
/** {@link Disposable.onDisposed} */
|
|
2108
|
-
readonly onDisposed: Event<unknown>;
|
|
2109
|
-
/**
|
|
2110
|
-
* An event that is triggered when a vertex is found.
|
|
2111
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
2112
|
-
*/
|
|
2113
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
2114
|
-
/**
|
|
2115
|
-
* An event that is triggered when a vertex is lost.
|
|
2116
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
2117
|
-
*/
|
|
2118
|
-
readonly onVertexLost: Event<THREE.Vector3>;
|
|
2119
|
-
/**
|
|
2120
|
-
* An event that is triggered when the picker is enabled or disabled
|
|
2121
|
-
*/
|
|
2122
|
-
readonly onEnabled: Event<boolean>;
|
|
2123
|
-
/**
|
|
2124
|
-
* A reference to the Components instance associated with this VertexPicker.
|
|
2125
|
-
*/
|
|
2126
|
-
components: Components;
|
|
2127
|
-
/**
|
|
2128
|
-
* A reference to the working plane used for vertex picking.
|
|
2129
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
2130
|
-
* If this value is null, all vertices are considered valid.
|
|
2131
|
-
*/
|
|
2132
|
-
workingPlane: THREE.Plane | null;
|
|
2133
|
-
private _pickedPoint;
|
|
2134
|
-
private _config;
|
|
2135
|
-
private _enabled;
|
|
2136
|
-
/**
|
|
2137
|
-
* Sets the enabled state of the VertexPicker.
|
|
2138
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
2139
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
2140
|
-
*
|
|
2141
|
-
* @param value - The new enabled state.
|
|
2142
|
-
*/
|
|
2143
|
-
set enabled(value: boolean);
|
|
2144
|
-
/**
|
|
2145
|
-
* Gets the current enabled state of the VertexPicker.
|
|
2146
|
-
*
|
|
2147
|
-
* @returns The current enabled state.
|
|
2148
|
-
*/
|
|
2149
|
-
get enabled(): boolean;
|
|
2150
|
-
/**
|
|
2151
|
-
* Sets the configuration for the VertexPicker component.
|
|
2152
|
-
*
|
|
2153
|
-
* @param value - A Partial object containing the configuration properties to update.
|
|
2154
|
-
* The properties not provided in the value object will retain their current values.
|
|
2155
|
-
*
|
|
2156
|
-
* @example
|
|
2157
|
-
* '''typescript
|
|
2158
|
-
* vertexPicker.config = {
|
|
2159
|
-
* snapDistance: 0.5,
|
|
2160
|
-
* showOnlyVertex: true,
|
|
2161
|
-
* };
|
|
2162
|
-
* '''
|
|
2163
|
-
*/
|
|
2164
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
2165
|
-
/**
|
|
2166
|
-
* Gets the current configuration for the VertexPicker component.
|
|
2167
|
-
*
|
|
2168
|
-
* @returns A copy of the current VertexPickerConfig object.
|
|
2169
|
-
*
|
|
2170
|
-
* @example
|
|
2171
|
-
* '''typescript
|
|
2172
|
-
* const currentConfig = vertexPicker.config;
|
|
2173
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
2174
|
-
* '''
|
|
2175
|
-
*/
|
|
2176
|
-
get config(): Partial<VertexPickerConfig>;
|
|
2177
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
2178
|
-
/** {@link Disposable.dispose} */
|
|
2179
|
-
dispose(): void;
|
|
2180
|
-
/**
|
|
2181
|
-
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
2182
|
-
*
|
|
2183
|
-
* @param world - The World instance to use for raycasting.
|
|
2184
|
-
*
|
|
2185
|
-
* @returns The current picked point, or null if no point is picked.
|
|
2186
|
-
*
|
|
2187
|
-
* @remarks
|
|
2188
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
2189
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
2190
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
2191
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
2192
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
2193
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
2194
|
-
*/
|
|
2195
|
-
get(world: World): THREE.Vector3 | null;
|
|
2196
|
-
private getClosestVertex;
|
|
2197
|
-
private getVertices;
|
|
2198
|
-
private getVertex;
|
|
2199
|
-
}
|
|
2200
|
-
export declare class UUID {
|
|
2201
|
-
private static _pattern;
|
|
2202
|
-
private static _lut;
|
|
2203
|
-
static create(): string;
|
|
2204
|
-
static validate(uuid: string): void;
|
|
2205
|
-
}
|
|
2206
|
-
import * as WEBIFC from "web-ifc";
|
|
2207
|
-
export interface IfcItemsCategories {
|
|
2208
|
-
[itemID: number]: number;
|
|
2209
|
-
}
|
|
2210
|
-
export declare class IfcCategories {
|
|
2211
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2212
|
-
}
|
|
2213
|
-
/**
|
|
2214
|
-
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2215
|
-
*
|
|
2216
|
-
* @remarks
|
|
2217
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2218
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2219
|
-
*
|
|
2220
|
-
*/
|
|
2221
|
-
export declare const IfcElements: {
|
|
2222
|
-
[key: number]: string;
|
|
2223
|
-
};
|
|
2224
|
-
/**
|
|
2225
|
-
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2226
|
-
*/
|
|
2227
|
-
export declare const IfcCategoryMap: {
|
|
2228
|
-
[key: number]: string;
|
|
2229
|
-
};
|
|
2230
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2231
|
-
export declare class IfcPropertiesUtils {
|
|
2232
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2233
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2234
|
-
[attribute: string]: any;
|
|
2235
|
-
} | null>;
|
|
2236
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2237
|
-
[relatingID: number]: number[];
|
|
2238
|
-
}>;
|
|
2239
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2240
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2241
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2242
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2243
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2244
|
-
key: string | null;
|
|
2245
|
-
name: string | null;
|
|
2246
|
-
}>;
|
|
2247
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2248
|
-
key: string | null;
|
|
2249
|
-
value: number | null;
|
|
2250
|
-
}>;
|
|
2251
|
-
static isRel(expressID: number): boolean;
|
|
2252
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2253
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2254
|
-
}
|
|
2255
|
-
/**
|
|
2256
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2257
|
-
*/
|
|
2258
|
-
export declare const GeometryTypes: Set<number>;
|
|
2259
|
-
import * as THREE from "three";
|
|
2260
|
-
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2261
|
-
/**
|
|
2262
|
-
* A class representing a 2D minimap of a 3D world.
|
|
2263
|
-
*/
|
|
2264
|
-
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
2265
|
-
/** {@link Disposable.onDisposed} */
|
|
2266
|
-
readonly onDisposed: Event<unknown>;
|
|
2267
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2268
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2269
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2270
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2271
|
-
/** {@link Resizeable.onResize} */
|
|
2272
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
2273
|
-
/**
|
|
2274
|
-
* The front offset of the minimap.
|
|
2275
|
-
* It determines how much the minimap's view is offset from the camera's view.
|
|
2276
|
-
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
2233
|
+
* The front offset of the minimap.
|
|
2234
|
+
* It determines how much the minimap's view is offset from the camera's view.
|
|
2235
|
+
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
2277
2236
|
*/
|
|
2278
2237
|
frontOffset: number;
|
|
2279
2238
|
/**
|
|
@@ -2345,11 +2304,77 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2345
2304
|
resize(size?: THREE.Vector2): void;
|
|
2346
2305
|
private updatePlanes;
|
|
2347
2306
|
}
|
|
2307
|
+
import * as WEBIFC from "web-ifc";
|
|
2308
|
+
export interface IfcItemsCategories {
|
|
2309
|
+
[itemID: number]: number;
|
|
2310
|
+
}
|
|
2311
|
+
export declare class IfcCategories {
|
|
2312
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2313
|
+
}
|
|
2314
|
+
/**
|
|
2315
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2316
|
+
*/
|
|
2317
|
+
export declare const GeometryTypes: Set<number>;
|
|
2348
2318
|
import { InverseAttribute } from "./types";
|
|
2349
2319
|
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585, {
|
|
2350
2320
|
forRelating: InverseAttribute;
|
|
2351
2321
|
forRelated: InverseAttribute;
|
|
2352
2322
|
}>;
|
|
2323
|
+
/**
|
|
2324
|
+
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2325
|
+
*
|
|
2326
|
+
* @remarks
|
|
2327
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2328
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2329
|
+
*
|
|
2330
|
+
*/
|
|
2331
|
+
export declare const IfcElements: {
|
|
2332
|
+
[key: number]: string;
|
|
2333
|
+
};
|
|
2334
|
+
/**
|
|
2335
|
+
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2336
|
+
*/
|
|
2337
|
+
export declare const IfcCategoryMap: {
|
|
2338
|
+
[key: number]: string;
|
|
2339
|
+
};
|
|
2340
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2341
|
+
export declare class IfcPropertiesUtils {
|
|
2342
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2343
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2344
|
+
[attribute: string]: any;
|
|
2345
|
+
} | null>;
|
|
2346
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2347
|
+
[relatingID: number]: number[];
|
|
2348
|
+
}>;
|
|
2349
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2350
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2351
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2352
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2353
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2354
|
+
key: string | null;
|
|
2355
|
+
name: string | null;
|
|
2356
|
+
}>;
|
|
2357
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2358
|
+
key: string | null;
|
|
2359
|
+
value: number | null;
|
|
2360
|
+
}>;
|
|
2361
|
+
static isRel(expressID: number): boolean;
|
|
2362
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2363
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2364
|
+
}
|
|
2365
|
+
import * as WEBIFC from "web-ifc";
|
|
2366
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2367
|
+
export declare class SpatialStructure {
|
|
2368
|
+
itemsByFloor: IfcItemsCategories;
|
|
2369
|
+
private _units;
|
|
2370
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2371
|
+
cleanUp(): void;
|
|
2372
|
+
}
|
|
2373
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2374
|
+
import * as WEBIFC from "web-ifc";
|
|
2375
|
+
export declare class SpatialIdsFinder {
|
|
2376
|
+
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2377
|
+
}
|
|
2353
2378
|
import * as WEBIFC from "web-ifc";
|
|
2354
2379
|
/** Configuration of the IFC-fragment conversion. */
|
|
2355
2380
|
export declare class IfcFragmentSettings {
|
|
@@ -2393,152 +2418,6 @@ export declare class IfcFragmentSettings {
|
|
|
2393
2418
|
*/
|
|
2394
2419
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2395
2420
|
}
|
|
2396
|
-
import * as THREE from "three";
|
|
2397
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2398
|
-
/**
|
|
2399
|
-
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
2400
|
-
*
|
|
2401
|
-
* @template T - The type of the scene. Default is BaseScene.
|
|
2402
|
-
* @template U - The type of the camera. Default is BaseCamera.
|
|
2403
|
-
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2404
|
-
*/
|
|
2405
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
2406
|
-
/**
|
|
2407
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
2408
|
-
*/
|
|
2409
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2410
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2411
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2412
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2413
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2414
|
-
/** {@link Disposable.onDisposed} */
|
|
2415
|
-
readonly onDisposed: Event<unknown>;
|
|
2416
|
-
/**
|
|
2417
|
-
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
2418
|
-
*/
|
|
2419
|
-
isDisposing: boolean;
|
|
2420
|
-
/**
|
|
2421
|
-
* Indicates whether the world is currently enabled.
|
|
2422
|
-
* When disabled, the world will not be updated.
|
|
2423
|
-
*/
|
|
2424
|
-
enabled: boolean;
|
|
2425
|
-
/**
|
|
2426
|
-
* A unique identifier for the world.
|
|
2427
|
-
*/
|
|
2428
|
-
uuid: string;
|
|
2429
|
-
/**
|
|
2430
|
-
* An optional name for the world.
|
|
2431
|
-
*/
|
|
2432
|
-
name?: string;
|
|
2433
|
-
private _scene?;
|
|
2434
|
-
private _camera?;
|
|
2435
|
-
private _renderer;
|
|
2436
|
-
/**
|
|
2437
|
-
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
2438
|
-
* @returns The current scene.
|
|
2439
|
-
*/
|
|
2440
|
-
get scene(): T;
|
|
2441
|
-
/**
|
|
2442
|
-
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
2443
|
-
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
2444
|
-
* @param scene - The new scene to be set.
|
|
2445
|
-
*/
|
|
2446
|
-
set scene(scene: T);
|
|
2447
|
-
/**
|
|
2448
|
-
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
2449
|
-
* @returns The current camera.
|
|
2450
|
-
*/
|
|
2451
|
-
get camera(): U;
|
|
2452
|
-
/**
|
|
2453
|
-
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
2454
|
-
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
2455
|
-
* @param camera - The new camera to be set.
|
|
2456
|
-
*/
|
|
2457
|
-
set camera(camera: U);
|
|
2458
|
-
/**
|
|
2459
|
-
* Getter for the renderer.
|
|
2460
|
-
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
2461
|
-
*/
|
|
2462
|
-
get renderer(): S | null;
|
|
2463
|
-
/**
|
|
2464
|
-
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
2465
|
-
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
2466
|
-
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
2467
|
-
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
2468
|
-
*/
|
|
2469
|
-
set renderer(renderer: S | null);
|
|
2470
|
-
/** {@link Updateable.update} */
|
|
2471
|
-
update(delta?: number): void;
|
|
2472
|
-
/** {@link Disposable.dispose} */
|
|
2473
|
-
dispose(disposeResources?: boolean): void;
|
|
2474
|
-
}
|
|
2475
|
-
import * as THREE from "three";
|
|
2476
|
-
import { Event, World } from "../../Types";
|
|
2477
|
-
import { Components } from "../../Components";
|
|
2478
|
-
/**
|
|
2479
|
-
* A base renderer to determine visibility on screen.
|
|
2480
|
-
*/
|
|
2481
|
-
export declare class DistanceRenderer {
|
|
2482
|
-
/** {@link Disposable.onDisposed} */
|
|
2483
|
-
readonly onDisposed: Event<string>;
|
|
2484
|
-
/**
|
|
2485
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
2486
|
-
* meshes that are currently visible, and the ones that were visible
|
|
2487
|
-
* just before but not anymore.
|
|
2488
|
-
*/
|
|
2489
|
-
readonly onDistanceComputed: Event<number>;
|
|
2490
|
-
/**
|
|
2491
|
-
* Objects that won't be taken into account in the distance check.
|
|
2492
|
-
*/
|
|
2493
|
-
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
2494
|
-
/**
|
|
2495
|
-
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2496
|
-
*/
|
|
2497
|
-
enabled: boolean;
|
|
2498
|
-
/**
|
|
2499
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
2500
|
-
* for debugging purposes.
|
|
2501
|
-
*/
|
|
2502
|
-
renderDebugFrame: boolean;
|
|
2503
|
-
/** The components instance to which this renderer belongs. */
|
|
2504
|
-
components: Components;
|
|
2505
|
-
/**
|
|
2506
|
-
* The scene where the distance is computed.
|
|
2507
|
-
*/
|
|
2508
|
-
scene: THREE.Scene;
|
|
2509
|
-
/**
|
|
2510
|
-
* The camera used to compute the distance.
|
|
2511
|
-
*/
|
|
2512
|
-
camera: THREE.OrthographicCamera;
|
|
2513
|
-
/**
|
|
2514
|
-
* The material used to compute the distance.
|
|
2515
|
-
*/
|
|
2516
|
-
depthMaterial: THREE.ShaderMaterial;
|
|
2517
|
-
/** The world instance to which this renderer belongs. */
|
|
2518
|
-
readonly world: World;
|
|
2519
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
2520
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
2521
|
-
protected readonly worker: Worker;
|
|
2522
|
-
private _width;
|
|
2523
|
-
private _height;
|
|
2524
|
-
private readonly _postQuad;
|
|
2525
|
-
private readonly tempRT;
|
|
2526
|
-
private readonly resultRT;
|
|
2527
|
-
private readonly bufferSize;
|
|
2528
|
-
private readonly _buffer;
|
|
2529
|
-
protected _isWorkerBusy: boolean;
|
|
2530
|
-
constructor(components: Components, world: World);
|
|
2531
|
-
/** {@link Disposable.dispose} */
|
|
2532
|
-
dispose(): void;
|
|
2533
|
-
/**
|
|
2534
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2535
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
2536
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2537
|
-
* not true.
|
|
2538
|
-
*/
|
|
2539
|
-
compute: () => Promise<void>;
|
|
2540
|
-
private handleWorkerMessage;
|
|
2541
|
-
}
|
|
2542
2421
|
/**
|
|
2543
2422
|
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2544
2423
|
*/
|
|
@@ -2567,99 +2446,6 @@ export declare class Event<T> {
|
|
|
2567
2446
|
reset(): void;
|
|
2568
2447
|
private handlers;
|
|
2569
2448
|
}
|
|
2570
|
-
import * as THREE from "three";
|
|
2571
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2572
|
-
import { Components } from "../../Components";
|
|
2573
|
-
/**
|
|
2574
|
-
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
2575
|
-
*/
|
|
2576
|
-
export interface SimpleSceneConfig {
|
|
2577
|
-
directionalLight: {
|
|
2578
|
-
color: THREE.Color;
|
|
2579
|
-
intensity: number;
|
|
2580
|
-
position: THREE.Vector3;
|
|
2581
|
-
};
|
|
2582
|
-
ambientLight: {
|
|
2583
|
-
color: THREE.Color;
|
|
2584
|
-
intensity: number;
|
|
2585
|
-
};
|
|
2586
|
-
}
|
|
2587
|
-
/**
|
|
2588
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
2589
|
-
*/
|
|
2590
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2591
|
-
/** {@link Configurable.isSetup} */
|
|
2592
|
-
isSetup: boolean;
|
|
2593
|
-
/**
|
|
2594
|
-
* The underlying Three.js scene object.
|
|
2595
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2596
|
-
*/
|
|
2597
|
-
three: THREE.Scene;
|
|
2598
|
-
/** {@link Configurable.onSetup} */
|
|
2599
|
-
readonly onSetup: Event<SimpleScene>;
|
|
2600
|
-
/**
|
|
2601
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
2602
|
-
* Defines properties for directional and ambient lights.
|
|
2603
|
-
*/
|
|
2604
|
-
config: Required<SimpleSceneConfig>;
|
|
2605
|
-
constructor(components: Components);
|
|
2606
|
-
/** {@link Configurable.setup} */
|
|
2607
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2608
|
-
}
|
|
2609
|
-
import * as THREE from "three";
|
|
2610
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
2611
|
-
import { Components } from "../../Components";
|
|
2612
|
-
/**
|
|
2613
|
-
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2614
|
-
*/
|
|
2615
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
2616
|
-
/**
|
|
2617
|
-
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2618
|
-
* Default is 'true'.
|
|
2619
|
-
*/
|
|
2620
|
-
enabled: boolean;
|
|
2621
|
-
/**
|
|
2622
|
-
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2623
|
-
*/
|
|
2624
|
-
container: HTMLElement;
|
|
2625
|
-
/**
|
|
2626
|
-
* The THREE.js WebGLRenderer instance.
|
|
2627
|
-
*/
|
|
2628
|
-
three: THREE.WebGLRenderer;
|
|
2629
|
-
protected _canvas: HTMLCanvasElement;
|
|
2630
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2631
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
2632
|
-
protected onContainerUpdated: Event<unknown>;
|
|
2633
|
-
private _resizing;
|
|
2634
|
-
/**
|
|
2635
|
-
* Constructor for the SimpleRenderer class.
|
|
2636
|
-
*
|
|
2637
|
-
* @param components - The components instance.
|
|
2638
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2639
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2640
|
-
*/
|
|
2641
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2642
|
-
/** {@link Updateable.update} */
|
|
2643
|
-
update(): void;
|
|
2644
|
-
/** {@link Disposable.dispose} */
|
|
2645
|
-
dispose(): void;
|
|
2646
|
-
/** {@link Resizeable.getSize}. */
|
|
2647
|
-
getSize(): THREE.Vector2;
|
|
2648
|
-
/** {@link Resizeable.resize} */
|
|
2649
|
-
resize: (size?: THREE.Vector2) => void;
|
|
2650
|
-
/**
|
|
2651
|
-
* Sets up and manages the event listeners for the renderer.
|
|
2652
|
-
*
|
|
2653
|
-
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2654
|
-
*
|
|
2655
|
-
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2656
|
-
*/
|
|
2657
|
-
setupEvents(active: boolean): void;
|
|
2658
|
-
private resizeEvent;
|
|
2659
|
-
private setupRenderer;
|
|
2660
|
-
private onContextLost;
|
|
2661
|
-
private onContextBack;
|
|
2662
|
-
}
|
|
2663
2449
|
/**
|
|
2664
2450
|
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2665
2451
|
*/
|
|
@@ -2688,80 +2474,18 @@ export declare class AsyncEvent<T> {
|
|
|
2688
2474
|
reset(): void;
|
|
2689
2475
|
private handlers;
|
|
2690
2476
|
}
|
|
2691
|
-
import
|
|
2692
|
-
import CameraControls from "camera-controls";
|
|
2693
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2694
|
-
import { Components } from "../../Components";
|
|
2477
|
+
import { Base } from "./base";
|
|
2695
2478
|
/**
|
|
2696
|
-
*
|
|
2479
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
2697
2480
|
*/
|
|
2698
|
-
export declare class
|
|
2699
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2700
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2701
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2702
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2481
|
+
export declare abstract class Component extends Base {
|
|
2703
2482
|
/**
|
|
2704
|
-
*
|
|
2705
|
-
*
|
|
2483
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
2484
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2485
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2486
|
+
* will not be updated automatically each frame.
|
|
2706
2487
|
*/
|
|
2707
|
-
|
|
2708
|
-
/** {@link Disposable.onDisposed} */
|
|
2709
|
-
readonly onDisposed: Event<string>;
|
|
2710
|
-
/**
|
|
2711
|
-
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
2712
|
-
* This camera is used for rendering the scene.
|
|
2713
|
-
*/
|
|
2714
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2715
|
-
private _allControls;
|
|
2716
|
-
/**
|
|
2717
|
-
* The object that controls the camera. An instance of
|
|
2718
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
2719
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
2720
|
-
* object to move, rotate, look at objects, etc.
|
|
2721
|
-
*/
|
|
2722
|
-
get controls(): CameraControls;
|
|
2723
|
-
/**
|
|
2724
|
-
* Getter for the enabled state of the camera controls.
|
|
2725
|
-
* If the current world is null, it returns false.
|
|
2726
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
2727
|
-
*
|
|
2728
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
2729
|
-
*/
|
|
2730
|
-
get enabled(): boolean;
|
|
2731
|
-
/**
|
|
2732
|
-
* Setter for the enabled state of the camera controls.
|
|
2733
|
-
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
2734
|
-
*
|
|
2735
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
2736
|
-
*/
|
|
2737
|
-
set enabled(enabled: boolean);
|
|
2738
|
-
constructor(components: Components);
|
|
2739
|
-
/** {@link Disposable.dispose} */
|
|
2740
|
-
dispose(): void;
|
|
2741
|
-
/** {@link Updateable.update} */
|
|
2742
|
-
update(_delta: number): void;
|
|
2743
|
-
/**
|
|
2744
|
-
* Updates the aspect of the camera to match the size of the
|
|
2745
|
-
* {@link Components.renderer}.
|
|
2746
|
-
*/
|
|
2747
|
-
updateAspect: () => void;
|
|
2748
|
-
private setupCamera;
|
|
2749
|
-
private newCameraControls;
|
|
2750
|
-
private setupEvents;
|
|
2751
|
-
private static getSubsetOfThree;
|
|
2752
|
-
}
|
|
2753
|
-
import * as WEBIFC from "web-ifc";
|
|
2754
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
2755
|
-
export declare class SpatialStructure {
|
|
2756
|
-
itemsByFloor: IfcItemsCategories;
|
|
2757
|
-
private _units;
|
|
2758
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2759
|
-
cleanUp(): void;
|
|
2760
|
-
}
|
|
2761
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2762
|
-
import * as WEBIFC from "web-ifc";
|
|
2763
|
-
export declare class SpatialIdsFinder {
|
|
2764
|
-
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2488
|
+
abstract enabled: boolean;
|
|
2765
2489
|
}
|
|
2766
2490
|
import * as THREE from "three";
|
|
2767
2491
|
import CameraControls from "camera-controls";
|
|
@@ -2891,19 +2615,6 @@ export declare abstract class Base {
|
|
|
2891
2615
|
isConfigurable: () => this is Configurable<any>;
|
|
2892
2616
|
}
|
|
2893
2617
|
import { Base } from "./base";
|
|
2894
|
-
/**
|
|
2895
|
-
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
2896
|
-
*/
|
|
2897
|
-
export declare abstract class Component extends Base {
|
|
2898
|
-
/**
|
|
2899
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
2900
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2901
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2902
|
-
* will not be updated automatically each frame.
|
|
2903
|
-
*/
|
|
2904
|
-
abstract enabled: boolean;
|
|
2905
|
-
}
|
|
2906
|
-
import { Base } from "./base";
|
|
2907
2618
|
import { World } from "./world";
|
|
2908
2619
|
import { Event } from "./event";
|
|
2909
2620
|
import { Components } from "../../Components";
|
|
@@ -3017,140 +2728,483 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
3017
2728
|
* The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
|
|
3018
2729
|
* excluding any planes marked as local.
|
|
3019
2730
|
*/
|
|
3020
|
-
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2731
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2732
|
+
}
|
|
2733
|
+
import * as THREE from "three";
|
|
2734
|
+
import { Disposable } from "./interfaces";
|
|
2735
|
+
import { Event } from "./event";
|
|
2736
|
+
import { Components } from "../../Components";
|
|
2737
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2738
|
+
/**
|
|
2739
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
2740
|
+
*/
|
|
2741
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2742
|
+
/** {@link Disposable.onDisposed} */
|
|
2743
|
+
readonly onDisposed: Event<unknown>;
|
|
2744
|
+
/**
|
|
2745
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
2746
|
+
* It should be implemented by subclasses.
|
|
2747
|
+
*/
|
|
2748
|
+
abstract three: THREE.Object3D;
|
|
2749
|
+
/** The set of directional lights managed by this scene component. */
|
|
2750
|
+
directionalLights: Map<string, THREE.DirectionalLight>;
|
|
2751
|
+
/** The set of ambient lights managed by this scene component. */
|
|
2752
|
+
ambientLights: Map<string, THREE.AmbientLight>;
|
|
2753
|
+
protected constructor(components: Components);
|
|
2754
|
+
/** {@link Disposable.dispose} */
|
|
2755
|
+
dispose(): void;
|
|
2756
|
+
}
|
|
2757
|
+
import * as THREE from "three";
|
|
2758
|
+
import { BaseScene } from "./base-scene";
|
|
2759
|
+
import { BaseCamera } from "./base-camera";
|
|
2760
|
+
import { BaseRenderer } from "./base-renderer";
|
|
2761
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
2762
|
+
/**
|
|
2763
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2764
|
+
*/
|
|
2765
|
+
export interface World extends Disposable, Updateable {
|
|
2766
|
+
/**
|
|
2767
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2768
|
+
*/
|
|
2769
|
+
meshes: Set<THREE.Mesh>;
|
|
2770
|
+
/**
|
|
2771
|
+
* The base scene of the world.
|
|
2772
|
+
*/
|
|
2773
|
+
scene: BaseScene;
|
|
2774
|
+
/**
|
|
2775
|
+
* The base camera of the world.
|
|
2776
|
+
*/
|
|
2777
|
+
camera: BaseCamera;
|
|
2778
|
+
/**
|
|
2779
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2780
|
+
*/
|
|
2781
|
+
renderer: BaseRenderer | null;
|
|
2782
|
+
/**
|
|
2783
|
+
* A unique identifier for the world.
|
|
2784
|
+
*/
|
|
2785
|
+
uuid: string;
|
|
2786
|
+
/**
|
|
2787
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2788
|
+
*/
|
|
2789
|
+
isDisposing: boolean;
|
|
2790
|
+
}
|
|
2791
|
+
import { Event } from "./event";
|
|
2792
|
+
/**
|
|
2793
|
+
* A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations.
|
|
2794
|
+
*
|
|
2795
|
+
* @template K - The type of keys in the map.
|
|
2796
|
+
* @template V - The type of values in the map.
|
|
2797
|
+
*/
|
|
2798
|
+
export declare class DataMap<K, V> extends Map<K, V> {
|
|
2799
|
+
/**
|
|
2800
|
+
* An event triggered when a new item is set in the map.
|
|
2801
|
+
*/
|
|
2802
|
+
readonly onItemSet: Event<{
|
|
2803
|
+
key: K;
|
|
2804
|
+
value: V;
|
|
2805
|
+
}>;
|
|
2806
|
+
/**
|
|
2807
|
+
* An event triggered when an existing item in the map is updated.
|
|
2808
|
+
*/
|
|
2809
|
+
readonly onItemUpdated: Event<{
|
|
2810
|
+
key: K;
|
|
2811
|
+
value: V;
|
|
2812
|
+
}>;
|
|
2813
|
+
/**
|
|
2814
|
+
* An event triggered when an item is deleted from the map.
|
|
2815
|
+
*/
|
|
2816
|
+
readonly onItemDeleted: Event<unknown>;
|
|
2817
|
+
/**
|
|
2818
|
+
* An event triggered when the map is cleared.
|
|
2819
|
+
*/
|
|
2820
|
+
readonly onCleared: Event<unknown>;
|
|
2821
|
+
/**
|
|
2822
|
+
* Constructs a new DataMap instance.
|
|
2823
|
+
*
|
|
2824
|
+
* @param iterable - An iterable object containing key-value pairs to populate the map.
|
|
2825
|
+
*/
|
|
2826
|
+
constructor(iterable?: Iterable<readonly [K, V]> | null | undefined);
|
|
2827
|
+
/**
|
|
2828
|
+
* Clears the map and triggers the onCleared event.
|
|
2829
|
+
*/
|
|
2830
|
+
clear(): void;
|
|
2831
|
+
/**
|
|
2832
|
+
* Sets the value for the specified key in the map and triggers the appropriate event (onItemSet or onItemUpdated).
|
|
2833
|
+
*
|
|
2834
|
+
* @param key - The key of the item to set.
|
|
2835
|
+
* @param value - The value of the item to set.
|
|
2836
|
+
* @returns The DataMap instance.
|
|
2837
|
+
*/
|
|
2838
|
+
set(key: K, value: V): this;
|
|
2839
|
+
/**
|
|
2840
|
+
* Deletes the specified key from the map and triggers the onItemDeleted event if the key was found.
|
|
2841
|
+
*
|
|
2842
|
+
* @param key - The key of the item to delete.
|
|
2843
|
+
* @returns True if the key was found and deleted; otherwise, false.
|
|
2844
|
+
*/
|
|
2845
|
+
delete(key: K): boolean;
|
|
2846
|
+
/**
|
|
2847
|
+
* Clears the map and resets the events.
|
|
2848
|
+
*/
|
|
2849
|
+
dispose(): void;
|
|
2850
|
+
}
|
|
2851
|
+
import { Event } from "./event";
|
|
2852
|
+
/**
|
|
2853
|
+
* A class that extends the built-in Set class and provides additional functionality.
|
|
2854
|
+
* It triggers events when items are added, deleted, or the set is cleared.
|
|
2855
|
+
*
|
|
2856
|
+
* @template T - The type of elements in the set.
|
|
2857
|
+
*/
|
|
2858
|
+
export declare class DataSet<T> extends Set<T> {
|
|
2859
|
+
/**
|
|
2860
|
+
* An event that is triggered when a new item is added to the set.
|
|
2861
|
+
*/
|
|
2862
|
+
readonly onItemAdded: Event<T>;
|
|
2863
|
+
/**
|
|
2864
|
+
* An event that is triggered when an item is deleted from the set.
|
|
2865
|
+
*/
|
|
2866
|
+
readonly onItemDeleted: Event<unknown>;
|
|
2867
|
+
/**
|
|
2868
|
+
* An event that is triggered when the set is cleared.
|
|
2869
|
+
*/
|
|
2870
|
+
readonly onCleared: Event<unknown>;
|
|
2871
|
+
/**
|
|
2872
|
+
* Constructs a new instance of the DataSet class.
|
|
2873
|
+
*
|
|
2874
|
+
* @param iterable - An optional iterable object to initialize the set with.
|
|
2875
|
+
*/
|
|
2876
|
+
constructor(iterable?: Iterable<T> | null);
|
|
2877
|
+
/**
|
|
2878
|
+
* Clears the set and triggers the onCleared event.
|
|
2879
|
+
*/
|
|
2880
|
+
clear(): void;
|
|
2881
|
+
/**
|
|
2882
|
+
* Adds a value to the set and triggers the onItemAdded event.
|
|
2883
|
+
*
|
|
2884
|
+
* @param value - The value to add to the set.
|
|
2885
|
+
* @returns - The set instance.
|
|
2886
|
+
*/
|
|
2887
|
+
add(value: T): this;
|
|
2888
|
+
/**
|
|
2889
|
+
* Deletes a value from the set and triggers the onItemDeleted event.
|
|
2890
|
+
*
|
|
2891
|
+
* @param value - The value to delete from the set.
|
|
2892
|
+
* @returns - True if the value was successfully deleted, false otherwise.
|
|
2893
|
+
*/
|
|
2894
|
+
delete(value: T): boolean;
|
|
2895
|
+
/**
|
|
2896
|
+
* Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
|
|
2897
|
+
*/
|
|
2898
|
+
dispose(): void;
|
|
2899
|
+
}
|
|
2900
|
+
import * as THREE from "three";
|
|
2901
|
+
import { Disposable, Event } from "../../Types";
|
|
2902
|
+
/**
|
|
2903
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
2904
|
+
*/
|
|
2905
|
+
export declare class Mouse implements Disposable {
|
|
2906
|
+
dom: HTMLCanvasElement;
|
|
2907
|
+
private _event?;
|
|
2908
|
+
private _position;
|
|
2909
|
+
/** {@link Disposable.onDisposed} */
|
|
2910
|
+
readonly onDisposed: Event<unknown>;
|
|
2911
|
+
constructor(dom: HTMLCanvasElement);
|
|
2912
|
+
/**
|
|
2913
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2914
|
+
*/
|
|
2915
|
+
get position(): THREE.Vector2;
|
|
2916
|
+
/** {@link Disposable.dispose} */
|
|
2917
|
+
dispose(): void;
|
|
2918
|
+
private getPositionY;
|
|
2919
|
+
private getPositionX;
|
|
2920
|
+
private updateMouseInfo;
|
|
2921
|
+
private setupEvents;
|
|
2922
|
+
}
|
|
2923
|
+
import * as THREE from "three";
|
|
2924
|
+
import { Components } from "../../Components";
|
|
2925
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2926
|
+
import { Mouse } from "./mouse";
|
|
2927
|
+
/**
|
|
2928
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
2929
|
+
*/
|
|
2930
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2931
|
+
/** {@link Component.enabled} */
|
|
2932
|
+
enabled: boolean;
|
|
2933
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2934
|
+
components: Components;
|
|
2935
|
+
/** {@link Disposable.onDisposed} */
|
|
2936
|
+
readonly onDisposed: Event<unknown>;
|
|
2937
|
+
/** The position of the mouse in the screen. */
|
|
2938
|
+
readonly mouse: Mouse;
|
|
2939
|
+
/**
|
|
2940
|
+
* A reference to the Three.js Raycaster instance.
|
|
2941
|
+
* This is used for raycasting operations.
|
|
2942
|
+
*/
|
|
2943
|
+
readonly three: THREE.Raycaster;
|
|
2944
|
+
/**
|
|
2945
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2946
|
+
* This is used to access the camera and meshes.
|
|
2947
|
+
*/
|
|
2948
|
+
world: World;
|
|
2949
|
+
constructor(components: Components, world: World);
|
|
2950
|
+
/** {@link Disposable.dispose} */
|
|
2951
|
+
dispose(): void;
|
|
2952
|
+
/**
|
|
2953
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2954
|
+
* the first item found. This also takes into account the clipping planes
|
|
2955
|
+
* used by the renderer.
|
|
2956
|
+
*
|
|
2957
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2958
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2959
|
+
* {@link Components.meshes}.
|
|
2960
|
+
*/
|
|
2961
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2962
|
+
/**
|
|
2963
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2964
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2965
|
+
*
|
|
2966
|
+
* @param origin - The origin of the ray.
|
|
2967
|
+
* @param direction - The direction of the ray.
|
|
2968
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2969
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2970
|
+
*/
|
|
2971
|
+
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;
|
|
2972
|
+
private intersect;
|
|
2973
|
+
private filterClippingPlanes;
|
|
2974
|
+
}
|
|
2975
|
+
import * as THREE from "three";
|
|
2976
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2977
|
+
/**
|
|
2978
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
2979
|
+
*
|
|
2980
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
2981
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
2982
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2983
|
+
*/
|
|
2984
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
2985
|
+
/**
|
|
2986
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
2987
|
+
*/
|
|
2988
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2989
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2990
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
2991
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2992
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
2993
|
+
/** {@link Disposable.onDisposed} */
|
|
2994
|
+
readonly onDisposed: Event<unknown>;
|
|
2995
|
+
/**
|
|
2996
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
2997
|
+
*/
|
|
2998
|
+
isDisposing: boolean;
|
|
2999
|
+
/**
|
|
3000
|
+
* Indicates whether the world is currently enabled.
|
|
3001
|
+
* When disabled, the world will not be updated.
|
|
3002
|
+
*/
|
|
3003
|
+
enabled: boolean;
|
|
3004
|
+
/**
|
|
3005
|
+
* A unique identifier for the world.
|
|
3006
|
+
*/
|
|
3007
|
+
uuid: string;
|
|
3008
|
+
/**
|
|
3009
|
+
* An optional name for the world.
|
|
3010
|
+
*/
|
|
3011
|
+
name?: string;
|
|
3012
|
+
private _scene?;
|
|
3013
|
+
private _camera?;
|
|
3014
|
+
private _renderer;
|
|
3015
|
+
/**
|
|
3016
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
3017
|
+
* @returns The current scene.
|
|
3018
|
+
*/
|
|
3019
|
+
get scene(): T;
|
|
3020
|
+
/**
|
|
3021
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
3022
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
3023
|
+
* @param scene - The new scene to be set.
|
|
3024
|
+
*/
|
|
3025
|
+
set scene(scene: T);
|
|
3026
|
+
/**
|
|
3027
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
3028
|
+
* @returns The current camera.
|
|
3029
|
+
*/
|
|
3030
|
+
get camera(): U;
|
|
3031
|
+
/**
|
|
3032
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
3033
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
3034
|
+
* @param camera - The new camera to be set.
|
|
3035
|
+
*/
|
|
3036
|
+
set camera(camera: U);
|
|
3037
|
+
/**
|
|
3038
|
+
* Getter for the renderer.
|
|
3039
|
+
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
3040
|
+
*/
|
|
3041
|
+
get renderer(): S | null;
|
|
3042
|
+
/**
|
|
3043
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
3044
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
3045
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
3046
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
3047
|
+
*/
|
|
3048
|
+
set renderer(renderer: S | null);
|
|
3049
|
+
/** {@link Updateable.update} */
|
|
3050
|
+
update(delta?: number): void;
|
|
3051
|
+
/** {@link Disposable.dispose} */
|
|
3052
|
+
dispose(disposeResources?: boolean): void;
|
|
3021
3053
|
}
|
|
3022
3054
|
import * as THREE from "three";
|
|
3023
|
-
import {
|
|
3024
|
-
import { Event } from "./event";
|
|
3055
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3025
3056
|
import { Components } from "../../Components";
|
|
3026
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
3027
3057
|
/**
|
|
3028
|
-
*
|
|
3058
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
3029
3059
|
*/
|
|
3030
|
-
export
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
/** The set of ambient lights managed by this scene component. */
|
|
3041
|
-
ambientLights: Map<string, THREE.AmbientLight>;
|
|
3042
|
-
protected constructor(components: Components);
|
|
3043
|
-
/** {@link Disposable.dispose} */
|
|
3044
|
-
dispose(): void;
|
|
3060
|
+
export interface SimpleSceneConfig {
|
|
3061
|
+
directionalLight: {
|
|
3062
|
+
color: THREE.Color;
|
|
3063
|
+
intensity: number;
|
|
3064
|
+
position: THREE.Vector3;
|
|
3065
|
+
};
|
|
3066
|
+
ambientLight: {
|
|
3067
|
+
color: THREE.Color;
|
|
3068
|
+
intensity: number;
|
|
3069
|
+
};
|
|
3045
3070
|
}
|
|
3046
|
-
import { Event } from "./event";
|
|
3047
3071
|
/**
|
|
3048
|
-
* A
|
|
3049
|
-
*
|
|
3050
|
-
* @template K - The type of keys in the map.
|
|
3051
|
-
* @template V - The type of values in the map.
|
|
3072
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
3052
3073
|
*/
|
|
3053
|
-
export declare class
|
|
3054
|
-
/**
|
|
3055
|
-
|
|
3056
|
-
*/
|
|
3057
|
-
readonly onItemSet: Event<{
|
|
3058
|
-
key: K;
|
|
3059
|
-
value: V;
|
|
3060
|
-
}>;
|
|
3074
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3075
|
+
/** {@link Configurable.isSetup} */
|
|
3076
|
+
isSetup: boolean;
|
|
3061
3077
|
/**
|
|
3062
|
-
*
|
|
3078
|
+
* The underlying Three.js scene object.
|
|
3079
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3063
3080
|
*/
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
}>;
|
|
3081
|
+
three: THREE.Scene;
|
|
3082
|
+
/** {@link Configurable.onSetup} */
|
|
3083
|
+
readonly onSetup: Event<SimpleScene>;
|
|
3068
3084
|
/**
|
|
3069
|
-
*
|
|
3085
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3086
|
+
* Defines properties for directional and ambient lights.
|
|
3070
3087
|
*/
|
|
3071
|
-
|
|
3088
|
+
config: Required<SimpleSceneConfig>;
|
|
3089
|
+
constructor(components: Components);
|
|
3090
|
+
/** {@link Configurable.setup} */
|
|
3091
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3092
|
+
}
|
|
3093
|
+
import * as THREE from "three";
|
|
3094
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
3095
|
+
import { Components } from "../../Components";
|
|
3096
|
+
/**
|
|
3097
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3098
|
+
*/
|
|
3099
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
3072
3100
|
/**
|
|
3073
|
-
*
|
|
3101
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3102
|
+
* Default is 'true'.
|
|
3074
3103
|
*/
|
|
3075
|
-
|
|
3104
|
+
enabled: boolean;
|
|
3076
3105
|
/**
|
|
3077
|
-
*
|
|
3078
|
-
*
|
|
3079
|
-
* @param iterable - An iterable object containing key-value pairs to populate the map.
|
|
3106
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
3080
3107
|
*/
|
|
3081
|
-
|
|
3108
|
+
container: HTMLElement;
|
|
3082
3109
|
/**
|
|
3083
|
-
*
|
|
3110
|
+
* The THREE.js WebGLRenderer instance.
|
|
3084
3111
|
*/
|
|
3085
|
-
|
|
3112
|
+
three: THREE.WebGLRenderer;
|
|
3113
|
+
protected _canvas: HTMLCanvasElement;
|
|
3114
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3115
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
3116
|
+
protected onContainerUpdated: Event<unknown>;
|
|
3117
|
+
private _resizing;
|
|
3086
3118
|
/**
|
|
3087
|
-
*
|
|
3119
|
+
* Constructor for the SimpleRenderer class.
|
|
3088
3120
|
*
|
|
3089
|
-
* @param
|
|
3090
|
-
* @param
|
|
3091
|
-
* @
|
|
3121
|
+
* @param components - The components instance.
|
|
3122
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3123
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3092
3124
|
*/
|
|
3093
|
-
|
|
3125
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3126
|
+
/** {@link Updateable.update} */
|
|
3127
|
+
update(): void;
|
|
3128
|
+
/** {@link Disposable.dispose} */
|
|
3129
|
+
dispose(): void;
|
|
3130
|
+
/** {@link Resizeable.getSize}. */
|
|
3131
|
+
getSize(): THREE.Vector2;
|
|
3132
|
+
/** {@link Resizeable.resize} */
|
|
3133
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3094
3134
|
/**
|
|
3095
|
-
*
|
|
3135
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3096
3136
|
*
|
|
3097
|
-
* @param
|
|
3098
|
-
*
|
|
3099
|
-
|
|
3100
|
-
delete(key: K): boolean;
|
|
3101
|
-
/**
|
|
3102
|
-
* Clears the map and resets the events.
|
|
3137
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3138
|
+
*
|
|
3139
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3103
3140
|
*/
|
|
3104
|
-
|
|
3141
|
+
setupEvents(active: boolean): void;
|
|
3142
|
+
private resizeEvent;
|
|
3143
|
+
private setupRenderer;
|
|
3144
|
+
private onContextLost;
|
|
3145
|
+
private onContextBack;
|
|
3105
3146
|
}
|
|
3106
|
-
import
|
|
3147
|
+
import * as THREE from "three";
|
|
3148
|
+
import CameraControls from "camera-controls";
|
|
3149
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3150
|
+
import { Components } from "../../Components";
|
|
3107
3151
|
/**
|
|
3108
|
-
* A
|
|
3109
|
-
* It triggers events when items are added, deleted, or the set is cleared.
|
|
3110
|
-
*
|
|
3111
|
-
* @template T - The type of elements in the set.
|
|
3152
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
3112
3153
|
*/
|
|
3113
|
-
export declare class
|
|
3114
|
-
/**
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
readonly
|
|
3118
|
-
/**
|
|
3119
|
-
* An event that is triggered when an item is deleted from the set.
|
|
3120
|
-
*/
|
|
3121
|
-
readonly onItemDeleted: Event<unknown>;
|
|
3154
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3155
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3156
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3157
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3158
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3122
3159
|
/**
|
|
3123
|
-
*
|
|
3160
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3161
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3124
3162
|
*/
|
|
3125
|
-
readonly
|
|
3163
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
3164
|
+
/** {@link Disposable.onDisposed} */
|
|
3165
|
+
readonly onDisposed: Event<string>;
|
|
3126
3166
|
/**
|
|
3127
|
-
*
|
|
3128
|
-
*
|
|
3129
|
-
* @param iterable - An optional iterable object to initialize the set with.
|
|
3167
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3168
|
+
* This camera is used for rendering the scene.
|
|
3130
3169
|
*/
|
|
3131
|
-
|
|
3170
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3171
|
+
private _allControls;
|
|
3132
3172
|
/**
|
|
3133
|
-
*
|
|
3173
|
+
* The object that controls the camera. An instance of
|
|
3174
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3175
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3176
|
+
* object to move, rotate, look at objects, etc.
|
|
3134
3177
|
*/
|
|
3135
|
-
|
|
3178
|
+
get controls(): CameraControls;
|
|
3136
3179
|
/**
|
|
3137
|
-
*
|
|
3180
|
+
* Getter for the enabled state of the camera controls.
|
|
3181
|
+
* If the current world is null, it returns false.
|
|
3182
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3138
3183
|
*
|
|
3139
|
-
* @
|
|
3140
|
-
* @returns - The set instance.
|
|
3184
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3141
3185
|
*/
|
|
3142
|
-
|
|
3186
|
+
get enabled(): boolean;
|
|
3143
3187
|
/**
|
|
3144
|
-
*
|
|
3188
|
+
* Setter for the enabled state of the camera controls.
|
|
3189
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3145
3190
|
*
|
|
3146
|
-
* @param
|
|
3147
|
-
* @returns - True if the value was successfully deleted, false otherwise.
|
|
3191
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3148
3192
|
*/
|
|
3149
|
-
|
|
3193
|
+
set enabled(enabled: boolean);
|
|
3194
|
+
constructor(components: Components);
|
|
3195
|
+
/** {@link Disposable.dispose} */
|
|
3196
|
+
dispose(): void;
|
|
3197
|
+
/** {@link Updateable.update} */
|
|
3198
|
+
update(_delta: number): void;
|
|
3150
3199
|
/**
|
|
3151
|
-
*
|
|
3200
|
+
* Updates the aspect of the camera to match the size of the
|
|
3201
|
+
* {@link Components.renderer}.
|
|
3152
3202
|
*/
|
|
3153
|
-
|
|
3203
|
+
updateAspect: () => void;
|
|
3204
|
+
private setupCamera;
|
|
3205
|
+
private newCameraControls;
|
|
3206
|
+
private setupEvents;
|
|
3207
|
+
private static getSubsetOfThree;
|
|
3154
3208
|
}
|
|
3155
3209
|
import * as THREE from "three";
|
|
3156
3210
|
import { Components } from "../../Components";
|
|
@@ -3235,48 +3289,13 @@ export declare class CullerRenderer {
|
|
|
3235
3289
|
updateVisibility: (force?: boolean) => Promise<void>;
|
|
3236
3290
|
protected getAvailableColor(): {
|
|
3237
3291
|
r: number;
|
|
3238
|
-
g: number;
|
|
3239
|
-
b: number;
|
|
3240
|
-
code: string;
|
|
3241
|
-
};
|
|
3242
|
-
protected increaseColor(): void;
|
|
3243
|
-
protected decreaseColor(): void;
|
|
3244
|
-
private applySettings;
|
|
3245
|
-
}
|
|
3246
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3247
|
-
import * as THREE from "three";
|
|
3248
|
-
import { BaseScene } from "./base-scene";
|
|
3249
|
-
import { BaseCamera } from "./base-camera";
|
|
3250
|
-
import { BaseRenderer } from "./base-renderer";
|
|
3251
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
3252
|
-
/**
|
|
3253
|
-
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
3254
|
-
*/
|
|
3255
|
-
export interface World extends Disposable, Updateable {
|
|
3256
|
-
/**
|
|
3257
|
-
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
3258
|
-
*/
|
|
3259
|
-
meshes: Set<THREE.Mesh>;
|
|
3260
|
-
/**
|
|
3261
|
-
* The base scene of the world.
|
|
3262
|
-
*/
|
|
3263
|
-
scene: BaseScene;
|
|
3264
|
-
/**
|
|
3265
|
-
* The base camera of the world.
|
|
3266
|
-
*/
|
|
3267
|
-
camera: BaseCamera;
|
|
3268
|
-
/**
|
|
3269
|
-
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
3270
|
-
*/
|
|
3271
|
-
renderer: BaseRenderer | null;
|
|
3272
|
-
/**
|
|
3273
|
-
* A unique identifier for the world.
|
|
3274
|
-
*/
|
|
3275
|
-
uuid: string;
|
|
3276
|
-
/**
|
|
3277
|
-
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
3278
|
-
*/
|
|
3279
|
-
isDisposing: boolean;
|
|
3292
|
+
g: number;
|
|
3293
|
+
b: number;
|
|
3294
|
+
code: string;
|
|
3295
|
+
};
|
|
3296
|
+
protected increaseColor(): void;
|
|
3297
|
+
protected decreaseColor(): void;
|
|
3298
|
+
private applySettings;
|
|
3280
3299
|
}
|
|
3281
3300
|
import * as THREE from "three";
|
|
3282
3301
|
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
@@ -3342,80 +3361,255 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
3342
3361
|
private handleWorkerMessage;
|
|
3343
3362
|
private getAvailableMaterial;
|
|
3344
3363
|
}
|
|
3364
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3345
3365
|
import * as THREE from "three";
|
|
3366
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3346
3367
|
import { Components } from "../../Components";
|
|
3347
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3348
|
-
import { Mouse } from "./mouse";
|
|
3349
3368
|
/**
|
|
3350
|
-
*
|
|
3369
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
3351
3370
|
*/
|
|
3352
|
-
export
|
|
3353
|
-
/**
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3371
|
+
export interface GridConfig {
|
|
3372
|
+
/**
|
|
3373
|
+
* The color of the grid lines.
|
|
3374
|
+
*/
|
|
3375
|
+
color: THREE.Color;
|
|
3376
|
+
/**
|
|
3377
|
+
* The size of the primary grid lines.
|
|
3378
|
+
*/
|
|
3379
|
+
size1: number;
|
|
3380
|
+
/**
|
|
3381
|
+
* The size of the secondary grid lines.
|
|
3382
|
+
*/
|
|
3383
|
+
size2: number;
|
|
3384
|
+
/**
|
|
3385
|
+
* The distance at which the grid lines start to fade away.
|
|
3386
|
+
*/
|
|
3387
|
+
distance: number;
|
|
3388
|
+
}
|
|
3389
|
+
/**
|
|
3390
|
+
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
3391
|
+
*/
|
|
3392
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3357
3393
|
/** {@link Disposable.onDisposed} */
|
|
3358
3394
|
readonly onDisposed: Event<unknown>;
|
|
3359
|
-
/** The
|
|
3360
|
-
|
|
3395
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3396
|
+
world: World;
|
|
3397
|
+
/** The components instance to which this grid belongs. */
|
|
3398
|
+
components: Components;
|
|
3399
|
+
/** {@link Hideable.visible} */
|
|
3400
|
+
get visible(): boolean;
|
|
3401
|
+
/** {@link Hideable.visible} */
|
|
3402
|
+
set visible(visible: boolean);
|
|
3403
|
+
/** The material of the grid. */
|
|
3404
|
+
get material(): THREE.ShaderMaterial;
|
|
3361
3405
|
/**
|
|
3362
|
-
*
|
|
3363
|
-
*
|
|
3406
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3407
|
+
* perspective cameras and false for orthographic cameras.
|
|
3364
3408
|
*/
|
|
3365
|
-
|
|
3409
|
+
get fade(): boolean;
|
|
3366
3410
|
/**
|
|
3367
|
-
*
|
|
3368
|
-
*
|
|
3411
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3412
|
+
* perspective cameras and false for orthographic cameras.
|
|
3369
3413
|
*/
|
|
3370
|
-
|
|
3371
|
-
|
|
3414
|
+
set fade(active: boolean);
|
|
3415
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3416
|
+
readonly three: THREE.Mesh;
|
|
3417
|
+
private _fade;
|
|
3418
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
3372
3419
|
/** {@link Disposable.dispose} */
|
|
3373
3420
|
dispose(): void;
|
|
3421
|
+
private setupEvents;
|
|
3422
|
+
private updateZoom;
|
|
3423
|
+
}
|
|
3424
|
+
import { NavigationMode } from "./types";
|
|
3425
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3426
|
+
/**
|
|
3427
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3428
|
+
*/
|
|
3429
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3430
|
+
private camera;
|
|
3431
|
+
/** {@link NavigationMode.enabled} */
|
|
3432
|
+
enabled: boolean;
|
|
3433
|
+
/** {@link NavigationMode.id} */
|
|
3434
|
+
readonly id = "FirstPerson";
|
|
3435
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3436
|
+
/** {@link NavigationMode.set} */
|
|
3437
|
+
set(active: boolean): void;
|
|
3438
|
+
private setupFirstPersonCamera;
|
|
3439
|
+
}
|
|
3440
|
+
import { NavigationMode } from "./types";
|
|
3441
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3442
|
+
/**
|
|
3443
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3444
|
+
*/
|
|
3445
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3446
|
+
camera: OrthoPerspectiveCamera;
|
|
3447
|
+
/** {@link NavigationMode.enabled} */
|
|
3448
|
+
enabled: boolean;
|
|
3449
|
+
/** {@link NavigationMode.id} */
|
|
3450
|
+
readonly id = "Orbit";
|
|
3451
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3452
|
+
/** {@link NavigationMode.set} */
|
|
3453
|
+
set(active: boolean): void;
|
|
3454
|
+
private activateOrbitControls;
|
|
3455
|
+
}
|
|
3456
|
+
import { NavigationMode } from "./types";
|
|
3457
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3458
|
+
/**
|
|
3459
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3460
|
+
*/
|
|
3461
|
+
export declare class PlanMode implements NavigationMode {
|
|
3462
|
+
private camera;
|
|
3463
|
+
/** {@link NavigationMode.enabled} */
|
|
3464
|
+
enabled: boolean;
|
|
3465
|
+
/** {@link NavigationMode.id} */
|
|
3466
|
+
readonly id = "Plan";
|
|
3467
|
+
private mouseAction1?;
|
|
3468
|
+
private mouseAction2?;
|
|
3469
|
+
private mouseInitialized;
|
|
3470
|
+
private readonly defaultAzimuthSpeed;
|
|
3471
|
+
private readonly defaultPolarSpeed;
|
|
3472
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3473
|
+
/** {@link NavigationMode.set} */
|
|
3474
|
+
set(active: boolean): void;
|
|
3475
|
+
}
|
|
3476
|
+
import * as THREE from "three";
|
|
3477
|
+
import { CameraProjection } from "./types";
|
|
3478
|
+
import { Event } from "../../Types";
|
|
3479
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3480
|
+
/**
|
|
3481
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3482
|
+
*/
|
|
3483
|
+
export declare class ProjectionManager {
|
|
3374
3484
|
/**
|
|
3375
|
-
*
|
|
3376
|
-
* the first item found. This also takes into account the clipping planes
|
|
3377
|
-
* used by the renderer.
|
|
3378
|
-
*
|
|
3379
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3380
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
3381
|
-
* {@link Components.meshes}.
|
|
3485
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
3382
3486
|
*/
|
|
3383
|
-
|
|
3487
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3384
3488
|
/**
|
|
3385
|
-
*
|
|
3386
|
-
*
|
|
3489
|
+
* Current projection mode of the camera.
|
|
3490
|
+
* Default is "Perspective".
|
|
3491
|
+
*/
|
|
3492
|
+
current: CameraProjection;
|
|
3493
|
+
/**
|
|
3494
|
+
* The camera controlled by this ProjectionManager.
|
|
3495
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3496
|
+
*/
|
|
3497
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3498
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3499
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3500
|
+
private _component;
|
|
3501
|
+
private _previousDistance;
|
|
3502
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3503
|
+
/**
|
|
3504
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3387
3505
|
*
|
|
3388
|
-
* @param
|
|
3389
|
-
*
|
|
3390
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3391
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3506
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3507
|
+
* it will have no effect.
|
|
3392
3508
|
*/
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3509
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3510
|
+
/**
|
|
3511
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3512
|
+
* and vice versa.
|
|
3513
|
+
*/
|
|
3514
|
+
toggle(): Promise<void>;
|
|
3515
|
+
private setOrthoCamera;
|
|
3516
|
+
private getPerspectiveDims;
|
|
3517
|
+
private setupOrthoCamera;
|
|
3518
|
+
private getDistance;
|
|
3519
|
+
private setPerspectiveCamera;
|
|
3520
|
+
}
|
|
3521
|
+
/**
|
|
3522
|
+
* The projection system of the camera.
|
|
3523
|
+
*/
|
|
3524
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3525
|
+
/**
|
|
3526
|
+
* The extensible list of supported navigation modes.
|
|
3527
|
+
*/
|
|
3528
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3529
|
+
/**
|
|
3530
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3531
|
+
*/
|
|
3532
|
+
export interface NavigationMode {
|
|
3533
|
+
/** The unique ID of this navigation mode. */
|
|
3534
|
+
id: NavModeID;
|
|
3535
|
+
/**
|
|
3536
|
+
* Enable or disable this navigation mode.
|
|
3537
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3538
|
+
* must be disabled.
|
|
3539
|
+
*
|
|
3540
|
+
* @param active - whether to enable or disable this mode.
|
|
3541
|
+
* @param options - any additional data required to enable or disable it.
|
|
3542
|
+
* */
|
|
3543
|
+
set: (active: boolean, options?: any) => void;
|
|
3544
|
+
/** Whether this navigation mode is active or not. */
|
|
3545
|
+
enabled: boolean;
|
|
3396
3546
|
}
|
|
3397
3547
|
import * as THREE from "three";
|
|
3398
|
-
import {
|
|
3548
|
+
import { Event, World } from "../../Types";
|
|
3549
|
+
import { Components } from "../../Components";
|
|
3399
3550
|
/**
|
|
3400
|
-
* A
|
|
3551
|
+
* A base renderer to determine visibility on screen.
|
|
3401
3552
|
*/
|
|
3402
|
-
export declare class
|
|
3403
|
-
dom: HTMLCanvasElement;
|
|
3404
|
-
private _event?;
|
|
3405
|
-
private _position;
|
|
3553
|
+
export declare class DistanceRenderer {
|
|
3406
3554
|
/** {@link Disposable.onDisposed} */
|
|
3407
|
-
readonly onDisposed: Event<
|
|
3408
|
-
constructor(dom: HTMLCanvasElement);
|
|
3555
|
+
readonly onDisposed: Event<string>;
|
|
3409
3556
|
/**
|
|
3410
|
-
*
|
|
3557
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
3558
|
+
* meshes that are currently visible, and the ones that were visible
|
|
3559
|
+
* just before but not anymore.
|
|
3411
3560
|
*/
|
|
3412
|
-
|
|
3561
|
+
readonly onDistanceComputed: Event<number>;
|
|
3562
|
+
/**
|
|
3563
|
+
* Objects that won't be taken into account in the distance check.
|
|
3564
|
+
*/
|
|
3565
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
3566
|
+
/**
|
|
3567
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3568
|
+
*/
|
|
3569
|
+
enabled: boolean;
|
|
3570
|
+
/**
|
|
3571
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
3572
|
+
* for debugging purposes.
|
|
3573
|
+
*/
|
|
3574
|
+
renderDebugFrame: boolean;
|
|
3575
|
+
/** The components instance to which this renderer belongs. */
|
|
3576
|
+
components: Components;
|
|
3577
|
+
/**
|
|
3578
|
+
* The scene where the distance is computed.
|
|
3579
|
+
*/
|
|
3580
|
+
scene: THREE.Scene;
|
|
3581
|
+
/**
|
|
3582
|
+
* The camera used to compute the distance.
|
|
3583
|
+
*/
|
|
3584
|
+
camera: THREE.OrthographicCamera;
|
|
3585
|
+
/**
|
|
3586
|
+
* The material used to compute the distance.
|
|
3587
|
+
*/
|
|
3588
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
3589
|
+
/** The world instance to which this renderer belongs. */
|
|
3590
|
+
readonly world: World;
|
|
3591
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
3592
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
3593
|
+
protected readonly worker: Worker;
|
|
3594
|
+
private _width;
|
|
3595
|
+
private _height;
|
|
3596
|
+
private readonly _postQuad;
|
|
3597
|
+
private readonly tempRT;
|
|
3598
|
+
private readonly resultRT;
|
|
3599
|
+
private readonly bufferSize;
|
|
3600
|
+
private readonly _buffer;
|
|
3601
|
+
protected _isWorkerBusy: boolean;
|
|
3602
|
+
constructor(components: Components, world: World);
|
|
3413
3603
|
/** {@link Disposable.dispose} */
|
|
3414
3604
|
dispose(): void;
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3605
|
+
/**
|
|
3606
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
3607
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
3608
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3609
|
+
* not true.
|
|
3610
|
+
*/
|
|
3611
|
+
compute: () => Promise<void>;
|
|
3612
|
+
private handleWorkerMessage;
|
|
3419
3613
|
}
|
|
3420
3614
|
import * as THREE from "three";
|
|
3421
3615
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3516,82 +3710,16 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3516
3710
|
private newHelper;
|
|
3517
3711
|
private static newPlaneMesh;
|
|
3518
3712
|
}
|
|
3519
|
-
import {
|
|
3520
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3521
|
-
/**
|
|
3522
|
-
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3523
|
-
*/
|
|
3524
|
-
export declare class FirstPersonMode implements NavigationMode {
|
|
3525
|
-
private camera;
|
|
3526
|
-
/** {@link NavigationMode.enabled} */
|
|
3527
|
-
enabled: boolean;
|
|
3528
|
-
/** {@link NavigationMode.id} */
|
|
3529
|
-
readonly id = "FirstPerson";
|
|
3530
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3531
|
-
/** {@link NavigationMode.set} */
|
|
3532
|
-
set(active: boolean): void;
|
|
3533
|
-
private setupFirstPersonCamera;
|
|
3534
|
-
}
|
|
3535
|
-
import { NavigationMode } from "./types";
|
|
3536
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3537
|
-
/**
|
|
3538
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3539
|
-
*/
|
|
3540
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3541
|
-
camera: OrthoPerspectiveCamera;
|
|
3542
|
-
/** {@link NavigationMode.enabled} */
|
|
3543
|
-
enabled: boolean;
|
|
3544
|
-
/** {@link NavigationMode.id} */
|
|
3545
|
-
readonly id = "Orbit";
|
|
3546
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3547
|
-
/** {@link NavigationMode.set} */
|
|
3548
|
-
set(active: boolean): void;
|
|
3549
|
-
private activateOrbitControls;
|
|
3550
|
-
}
|
|
3551
|
-
import * as THREE from "three";
|
|
3552
|
-
import { CameraProjection } from "./types";
|
|
3553
|
-
import { Event } from "../../Types";
|
|
3554
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3713
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3555
3714
|
/**
|
|
3556
|
-
*
|
|
3715
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3557
3716
|
*/
|
|
3558
|
-
export declare class
|
|
3559
|
-
/**
|
|
3560
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
3561
|
-
*/
|
|
3562
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3563
|
-
/**
|
|
3564
|
-
* Current projection mode of the camera.
|
|
3565
|
-
* Default is "Perspective".
|
|
3566
|
-
*/
|
|
3567
|
-
current: CameraProjection;
|
|
3568
|
-
/**
|
|
3569
|
-
* The camera controlled by this ProjectionManager.
|
|
3570
|
-
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3571
|
-
*/
|
|
3572
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3573
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3574
|
-
matchOrthoDistanceEnabled: boolean;
|
|
3575
|
-
private _component;
|
|
3576
|
-
private _previousDistance;
|
|
3577
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3578
|
-
/**
|
|
3579
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3580
|
-
*
|
|
3581
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
3582
|
-
* it will have no effect.
|
|
3583
|
-
*/
|
|
3584
|
-
set(projection: CameraProjection): Promise<void>;
|
|
3717
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3585
3718
|
/**
|
|
3586
|
-
*
|
|
3587
|
-
*
|
|
3719
|
+
* Amount of properties to be streamed.
|
|
3720
|
+
* Defaults to 100 properties.
|
|
3588
3721
|
*/
|
|
3589
|
-
|
|
3590
|
-
private setOrthoCamera;
|
|
3591
|
-
private getPerspectiveDims;
|
|
3592
|
-
private setupOrthoCamera;
|
|
3593
|
-
private getDistance;
|
|
3594
|
-
private setPerspectiveCamera;
|
|
3722
|
+
propertiesSize: number;
|
|
3595
3723
|
}
|
|
3596
3724
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3597
3725
|
/**
|
|
@@ -3610,65 +3738,6 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
|
3610
3738
|
minAssetsSize: number;
|
|
3611
3739
|
}
|
|
3612
3740
|
import * as THREE from "three";
|
|
3613
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3614
|
-
import { Components } from "../../Components";
|
|
3615
|
-
/**
|
|
3616
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
3617
|
-
*/
|
|
3618
|
-
export interface GridConfig {
|
|
3619
|
-
/**
|
|
3620
|
-
* The color of the grid lines.
|
|
3621
|
-
*/
|
|
3622
|
-
color: THREE.Color;
|
|
3623
|
-
/**
|
|
3624
|
-
* The size of the primary grid lines.
|
|
3625
|
-
*/
|
|
3626
|
-
size1: number;
|
|
3627
|
-
/**
|
|
3628
|
-
* The size of the secondary grid lines.
|
|
3629
|
-
*/
|
|
3630
|
-
size2: number;
|
|
3631
|
-
/**
|
|
3632
|
-
* The distance at which the grid lines start to fade away.
|
|
3633
|
-
*/
|
|
3634
|
-
distance: number;
|
|
3635
|
-
}
|
|
3636
|
-
/**
|
|
3637
|
-
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
3638
|
-
*/
|
|
3639
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3640
|
-
/** {@link Disposable.onDisposed} */
|
|
3641
|
-
readonly onDisposed: Event<unknown>;
|
|
3642
|
-
/** The world instance to which this Raycaster belongs. */
|
|
3643
|
-
world: World;
|
|
3644
|
-
/** The components instance to which this grid belongs. */
|
|
3645
|
-
components: Components;
|
|
3646
|
-
/** {@link Hideable.visible} */
|
|
3647
|
-
get visible(): boolean;
|
|
3648
|
-
/** {@link Hideable.visible} */
|
|
3649
|
-
set visible(visible: boolean);
|
|
3650
|
-
/** The material of the grid. */
|
|
3651
|
-
get material(): THREE.ShaderMaterial;
|
|
3652
|
-
/**
|
|
3653
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3654
|
-
* perspective cameras and false for orthographic cameras.
|
|
3655
|
-
*/
|
|
3656
|
-
get fade(): boolean;
|
|
3657
|
-
/**
|
|
3658
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3659
|
-
* perspective cameras and false for orthographic cameras.
|
|
3660
|
-
*/
|
|
3661
|
-
set fade(active: boolean);
|
|
3662
|
-
/** The Three.js mesh that contains the infinite grid. */
|
|
3663
|
-
readonly three: THREE.Mesh;
|
|
3664
|
-
private _fade;
|
|
3665
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
3666
|
-
/** {@link Disposable.dispose} */
|
|
3667
|
-
dispose(): void;
|
|
3668
|
-
private setupEvents;
|
|
3669
|
-
private updateZoom;
|
|
3670
|
-
}
|
|
3671
|
-
import * as THREE from "three";
|
|
3672
3741
|
import * as WEBIFC from "web-ifc";
|
|
3673
3742
|
import * as FRAGS from "@thatopen/fragments";
|
|
3674
3743
|
export declare class CivilReader {
|
|
@@ -3683,78 +3752,6 @@ export declare class CivilReader {
|
|
|
3683
3752
|
} | undefined;
|
|
3684
3753
|
private getCurves;
|
|
3685
3754
|
}
|
|
3686
|
-
/**
|
|
3687
|
-
* The projection system of the camera.
|
|
3688
|
-
*/
|
|
3689
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3690
|
-
/**
|
|
3691
|
-
* The extensible list of supported navigation modes.
|
|
3692
|
-
*/
|
|
3693
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3694
|
-
/**
|
|
3695
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3696
|
-
*/
|
|
3697
|
-
export interface NavigationMode {
|
|
3698
|
-
/** The unique ID of this navigation mode. */
|
|
3699
|
-
id: NavModeID;
|
|
3700
|
-
/**
|
|
3701
|
-
* Enable or disable this navigation mode.
|
|
3702
|
-
* When a new navigation mode is enabled, the previous navigation mode
|
|
3703
|
-
* must be disabled.
|
|
3704
|
-
*
|
|
3705
|
-
* @param active - whether to enable or disable this mode.
|
|
3706
|
-
* @param options - any additional data required to enable or disable it.
|
|
3707
|
-
* */
|
|
3708
|
-
set: (active: boolean, options?: any) => void;
|
|
3709
|
-
/** Whether this navigation mode is active or not. */
|
|
3710
|
-
enabled: boolean;
|
|
3711
|
-
}
|
|
3712
|
-
import { NavigationMode } from "./types";
|
|
3713
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3714
|
-
/**
|
|
3715
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3716
|
-
*/
|
|
3717
|
-
export declare class PlanMode implements NavigationMode {
|
|
3718
|
-
private camera;
|
|
3719
|
-
/** {@link NavigationMode.enabled} */
|
|
3720
|
-
enabled: boolean;
|
|
3721
|
-
/** {@link NavigationMode.id} */
|
|
3722
|
-
readonly id = "Plan";
|
|
3723
|
-
private mouseAction1?;
|
|
3724
|
-
private mouseAction2?;
|
|
3725
|
-
private mouseInitialized;
|
|
3726
|
-
private readonly defaultAzimuthSpeed;
|
|
3727
|
-
private readonly defaultPolarSpeed;
|
|
3728
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3729
|
-
/** {@link NavigationMode.set} */
|
|
3730
|
-
set(active: boolean): void;
|
|
3731
|
-
}
|
|
3732
|
-
import * as WEBIFC from "web-ifc";
|
|
3733
|
-
export declare class IfcMetadataReader {
|
|
3734
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3735
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3736
|
-
}
|
|
3737
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3738
|
-
/**
|
|
3739
|
-
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3740
|
-
*/
|
|
3741
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3742
|
-
/**
|
|
3743
|
-
* Amount of properties to be streamed.
|
|
3744
|
-
* Defaults to 100 properties.
|
|
3745
|
-
*/
|
|
3746
|
-
propertiesSize: number;
|
|
3747
|
-
}
|
|
3748
|
-
import * as WEBIFC from "web-ifc";
|
|
3749
|
-
import * as THREE from "three";
|
|
3750
|
-
export declare class Units {
|
|
3751
|
-
factor: number;
|
|
3752
|
-
complement: number;
|
|
3753
|
-
apply(matrix: THREE.Matrix4): void;
|
|
3754
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3755
|
-
private getLengthUnits;
|
|
3756
|
-
private getScaleMatrix;
|
|
3757
|
-
}
|
|
3758
3755
|
/**
|
|
3759
3756
|
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3760
3757
|
*/
|
|
@@ -3785,6 +3782,26 @@ export interface StreamedAsset {
|
|
|
3785
3782
|
}[];
|
|
3786
3783
|
}
|
|
3787
3784
|
import * as WEBIFC from "web-ifc";
|
|
3785
|
+
export declare class IfcMetadataReader {
|
|
3786
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3787
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3788
|
+
}
|
|
3789
|
+
import * as WEBIFC from "web-ifc";
|
|
3790
|
+
import * as THREE from "three";
|
|
3791
|
+
export declare class Units {
|
|
3792
|
+
factor: number;
|
|
3793
|
+
complement: number;
|
|
3794
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3795
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3796
|
+
private getLengthUnits;
|
|
3797
|
+
private getScaleMatrix;
|
|
3798
|
+
}
|
|
3799
|
+
import { BufferGeometry } from "three";
|
|
3800
|
+
import * as THREE from "three";
|
|
3801
|
+
export declare class TransformHelper {
|
|
3802
|
+
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3803
|
+
}
|
|
3804
|
+
import * as WEBIFC from "web-ifc";
|
|
3788
3805
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3789
3806
|
export interface ModelsRelationMap {
|
|
3790
3807
|
[modelID: string]: RelationsMap;
|
|
@@ -3839,10 +3856,5 @@ export type IfcRelations = [
|
|
|
3839
3856
|
typeof WEBIFC.IFCRELNESTS
|
|
3840
3857
|
];
|
|
3841
3858
|
export type IfcRelation = IfcRelations[number];
|
|
3842
|
-
import { BufferGeometry } from "three";
|
|
3843
|
-
import * as THREE from "three";
|
|
3844
|
-
export declare class TransformHelper {
|
|
3845
|
-
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3846
|
-
}
|
|
3847
3859
|
|
|
3848
3860
|
}
|