@thatopen/components 2.1.6 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Components/index.d.ts +1 -1
- package/dist/fragments/FragmentsManager/index.d.ts +15 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +226 -209
- package/dist/namespace.d.ts +1430 -1415
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ export declare class Components implements Disposable {
|
|
|
94
94
|
/**
|
|
95
95
|
* The version of the @thatopen/components library.
|
|
96
96
|
*/
|
|
97
|
-
static readonly release = "2.1.
|
|
97
|
+
static readonly release = "2.1.7";
|
|
98
98
|
/** {@link Disposable.onDisposed} */
|
|
99
99
|
readonly onDisposed: Event<void>;
|
|
100
100
|
/**
|
|
@@ -162,55 +162,6 @@ export declare class Components implements Disposable {
|
|
|
162
162
|
private update;
|
|
163
163
|
private static setupBVH;
|
|
164
164
|
}
|
|
165
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
166
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
167
|
-
import { Components } from "../Components";
|
|
168
|
-
/**
|
|
169
|
-
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
170
|
-
*/
|
|
171
|
-
export declare class Grids extends Component implements Disposable {
|
|
172
|
-
/**
|
|
173
|
-
* A unique identifier for the component.
|
|
174
|
-
* This UUID is used to register the component within the Components system.
|
|
175
|
-
*/
|
|
176
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
177
|
-
/**
|
|
178
|
-
* A map of world UUIDs to their corresponding grid instances.
|
|
179
|
-
*/
|
|
180
|
-
list: Map<string, SimpleGrid>;
|
|
181
|
-
/**
|
|
182
|
-
* The default configuration for grid creation.
|
|
183
|
-
*/
|
|
184
|
-
config: Required<GridConfig>;
|
|
185
|
-
/** {@link Disposable.onDisposed} */
|
|
186
|
-
readonly onDisposed: Event<unknown>;
|
|
187
|
-
/** {@link Component.enabled} */
|
|
188
|
-
enabled: boolean;
|
|
189
|
-
constructor(components: Components);
|
|
190
|
-
/**
|
|
191
|
-
* Creates a new grid for the given world.
|
|
192
|
-
* Throws an error if a grid already exists for the world.
|
|
193
|
-
*
|
|
194
|
-
* @param world - The world to create the grid for.
|
|
195
|
-
* @returns The newly created grid.
|
|
196
|
-
*
|
|
197
|
-
* @throws Will throw an error if a grid already exists for the given world.
|
|
198
|
-
*/
|
|
199
|
-
create(world: World): SimpleGrid;
|
|
200
|
-
/**
|
|
201
|
-
* Deletes the grid associated with the given world.
|
|
202
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
203
|
-
*
|
|
204
|
-
* @param world - The world for which to delete the grid.
|
|
205
|
-
*
|
|
206
|
-
* @remarks
|
|
207
|
-
* This method will dispose of the grid and remove it from the internal list.
|
|
208
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
209
|
-
*/
|
|
210
|
-
delete(world: World): void;
|
|
211
|
-
/** {@link Disposable.dispose} */
|
|
212
|
-
dispose(): void;
|
|
213
|
-
}
|
|
214
165
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
215
166
|
import { Components } from "../Components";
|
|
216
167
|
import { SimpleWorld } from "./src";
|
|
@@ -278,6 +229,55 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
278
229
|
/** {@link Updateable.update} */
|
|
279
230
|
update(delta?: number): void | Promise<void>;
|
|
280
231
|
}
|
|
232
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
233
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
234
|
+
import { Components } from "../Components";
|
|
235
|
+
/**
|
|
236
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
237
|
+
*/
|
|
238
|
+
export declare class Grids extends Component implements Disposable {
|
|
239
|
+
/**
|
|
240
|
+
* A unique identifier for the component.
|
|
241
|
+
* This UUID is used to register the component within the Components system.
|
|
242
|
+
*/
|
|
243
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
244
|
+
/**
|
|
245
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
246
|
+
*/
|
|
247
|
+
list: Map<string, SimpleGrid>;
|
|
248
|
+
/**
|
|
249
|
+
* The default configuration for grid creation.
|
|
250
|
+
*/
|
|
251
|
+
config: Required<GridConfig>;
|
|
252
|
+
/** {@link Disposable.onDisposed} */
|
|
253
|
+
readonly onDisposed: Event<unknown>;
|
|
254
|
+
/** {@link Component.enabled} */
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
constructor(components: Components);
|
|
257
|
+
/**
|
|
258
|
+
* Creates a new grid for the given world.
|
|
259
|
+
* Throws an error if a grid already exists for the world.
|
|
260
|
+
*
|
|
261
|
+
* @param world - The world to create the grid for.
|
|
262
|
+
* @returns The newly created grid.
|
|
263
|
+
*
|
|
264
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
265
|
+
*/
|
|
266
|
+
create(world: World): SimpleGrid;
|
|
267
|
+
/**
|
|
268
|
+
* Deletes the grid associated with the given world.
|
|
269
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
270
|
+
*
|
|
271
|
+
* @param world - The world for which to delete the grid.
|
|
272
|
+
*
|
|
273
|
+
* @remarks
|
|
274
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
275
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
276
|
+
*/
|
|
277
|
+
delete(world: World): void;
|
|
278
|
+
/** {@link Disposable.dispose} */
|
|
279
|
+
dispose(): void;
|
|
280
|
+
}
|
|
281
281
|
import * as THREE from "three";
|
|
282
282
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
283
283
|
import { SimplePlane } from "./src";
|
|
@@ -409,52 +409,139 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
409
409
|
private _onStartDragging;
|
|
410
410
|
private _onEndDragging;
|
|
411
411
|
}
|
|
412
|
-
import
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
import * as THREE from "three";
|
|
413
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
414
|
+
center: THREE.Vector3;
|
|
415
|
+
halfSizes: THREE.Vector3;
|
|
416
|
+
rotation: THREE.Matrix3;
|
|
417
|
+
transformation: THREE.Matrix4;
|
|
418
|
+
};
|
|
419
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
420
|
+
import * as THREE from "three";
|
|
421
|
+
export declare class MaterialsUtils {
|
|
422
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
423
|
+
}
|
|
424
|
+
export declare class UUID {
|
|
425
|
+
private static _pattern;
|
|
426
|
+
private static _lut;
|
|
427
|
+
static create(): string;
|
|
428
|
+
static validate(uuid: string): void;
|
|
429
|
+
}
|
|
430
|
+
import * as THREE from "three";
|
|
431
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
415
432
|
/**
|
|
416
|
-
*
|
|
433
|
+
* Configuration interface for the VertexPicker component.
|
|
417
434
|
*/
|
|
418
|
-
export
|
|
435
|
+
export interface VertexPickerConfig {
|
|
419
436
|
/**
|
|
420
|
-
*
|
|
421
|
-
* This UUID is used to register the component within the Components system.
|
|
437
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
422
438
|
*/
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
439
|
+
showOnlyVertex: boolean;
|
|
440
|
+
/**
|
|
441
|
+
* The maximum distance for snapping to a vertex.
|
|
442
|
+
*/
|
|
443
|
+
snapDistance: number;
|
|
444
|
+
/**
|
|
445
|
+
* The HTML element to use for previewing the picked vertex.
|
|
446
|
+
*/
|
|
447
|
+
previewElement: HTMLElement;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
451
|
+
*/
|
|
452
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
428
453
|
/** {@link Disposable.onDisposed} */
|
|
429
454
|
readonly onDisposed: Event<unknown>;
|
|
430
|
-
/** {@link Component.enabled} */
|
|
431
|
-
enabled: boolean;
|
|
432
455
|
/**
|
|
433
|
-
*
|
|
456
|
+
* An event that is triggered when a vertex is found.
|
|
457
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
434
458
|
*/
|
|
435
|
-
|
|
436
|
-
constructor(components: Components);
|
|
459
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
437
460
|
/**
|
|
438
|
-
*
|
|
439
|
-
*
|
|
461
|
+
* An event that is triggered when a vertex is lost.
|
|
462
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
463
|
+
*/
|
|
464
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
465
|
+
/**
|
|
466
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
467
|
+
*/
|
|
468
|
+
readonly onEnabled: Event<boolean>;
|
|
469
|
+
/**
|
|
470
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
471
|
+
*/
|
|
472
|
+
components: Components;
|
|
473
|
+
/**
|
|
474
|
+
* A reference to the working plane used for vertex picking.
|
|
475
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
476
|
+
* If this value is null, all vertices are considered valid.
|
|
477
|
+
*/
|
|
478
|
+
workingPlane: THREE.Plane | null;
|
|
479
|
+
private _pickedPoint;
|
|
480
|
+
private _config;
|
|
481
|
+
private _enabled;
|
|
482
|
+
/**
|
|
483
|
+
* Sets the enabled state of the VertexPicker.
|
|
484
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
485
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
440
486
|
*
|
|
441
|
-
* @param
|
|
442
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
443
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
487
|
+
* @param value - The new enabled state.
|
|
444
488
|
*/
|
|
445
|
-
|
|
489
|
+
set enabled(value: boolean);
|
|
446
490
|
/**
|
|
447
|
-
*
|
|
448
|
-
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
491
|
+
* Gets the current enabled state of the VertexPicker.
|
|
449
492
|
*
|
|
450
|
-
* @
|
|
451
|
-
* @returns {void}
|
|
493
|
+
* @returns The current enabled state.
|
|
452
494
|
*/
|
|
453
|
-
|
|
495
|
+
get enabled(): boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Sets the configuration for the VertexPicker component.
|
|
498
|
+
*
|
|
499
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
500
|
+
* The properties not provided in the value object will retain their current values.
|
|
501
|
+
*
|
|
502
|
+
* @example
|
|
503
|
+
* '''typescript
|
|
504
|
+
* vertexPicker.config = {
|
|
505
|
+
* snapDistance: 0.5,
|
|
506
|
+
* showOnlyVertex: true,
|
|
507
|
+
* };
|
|
508
|
+
* '''
|
|
509
|
+
*/
|
|
510
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
511
|
+
/**
|
|
512
|
+
* Gets the current configuration for the VertexPicker component.
|
|
513
|
+
*
|
|
514
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* '''typescript
|
|
518
|
+
* const currentConfig = vertexPicker.config;
|
|
519
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
520
|
+
* '''
|
|
521
|
+
*/
|
|
522
|
+
get config(): Partial<VertexPickerConfig>;
|
|
523
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
454
524
|
/** {@link Disposable.dispose} */
|
|
455
525
|
dispose(): void;
|
|
456
|
-
/**
|
|
457
|
-
|
|
526
|
+
/**
|
|
527
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
528
|
+
*
|
|
529
|
+
* @param world - The World instance to use for raycasting.
|
|
530
|
+
*
|
|
531
|
+
* @returns The current picked point, or null if no point is picked.
|
|
532
|
+
*
|
|
533
|
+
* @remarks
|
|
534
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
535
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
536
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
537
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
538
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
539
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
540
|
+
*/
|
|
541
|
+
get(world: World): THREE.Vector3 | null;
|
|
542
|
+
private getClosestVertex;
|
|
543
|
+
private getVertices;
|
|
544
|
+
private getVertex;
|
|
458
545
|
}
|
|
459
546
|
import { Components } from "../Components";
|
|
460
547
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
@@ -504,17 +591,64 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
504
591
|
/** {@link Disposable.dispose} */
|
|
505
592
|
dispose(): void;
|
|
506
593
|
}
|
|
507
|
-
import
|
|
594
|
+
import { MiniMap } from "./src";
|
|
595
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
508
596
|
import { Components } from "../Components";
|
|
509
|
-
import { SimpleCamera } from "..";
|
|
510
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
511
597
|
/**
|
|
512
|
-
* A
|
|
598
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
513
599
|
*/
|
|
514
|
-
export declare class
|
|
600
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
515
601
|
/**
|
|
516
|
-
* A
|
|
517
|
-
|
|
602
|
+
* A unique identifier for the component.
|
|
603
|
+
* This UUID is used to register the component within the Components system.
|
|
604
|
+
*/
|
|
605
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
606
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
607
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
608
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
609
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
610
|
+
/** {@link Disposable.onDisposed} */
|
|
611
|
+
readonly onDisposed: Event<unknown>;
|
|
612
|
+
/** {@link Component.enabled} */
|
|
613
|
+
enabled: boolean;
|
|
614
|
+
/**
|
|
615
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
616
|
+
*/
|
|
617
|
+
list: Map<string, MiniMap>;
|
|
618
|
+
constructor(components: Components);
|
|
619
|
+
/**
|
|
620
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
621
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
622
|
+
*
|
|
623
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
624
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
625
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
626
|
+
*/
|
|
627
|
+
create(world: World): MiniMap;
|
|
628
|
+
/**
|
|
629
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
630
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
631
|
+
*
|
|
632
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
633
|
+
* @returns {void}
|
|
634
|
+
*/
|
|
635
|
+
delete(id: string): void;
|
|
636
|
+
/** {@link Disposable.dispose} */
|
|
637
|
+
dispose(): void;
|
|
638
|
+
/** {@link Updateable.update} */
|
|
639
|
+
update(): void;
|
|
640
|
+
}
|
|
641
|
+
import * as THREE from "three";
|
|
642
|
+
import { Components } from "../Components";
|
|
643
|
+
import { SimpleCamera } from "..";
|
|
644
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
645
|
+
/**
|
|
646
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
647
|
+
*/
|
|
648
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
649
|
+
/**
|
|
650
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
651
|
+
*/
|
|
518
652
|
readonly projection: ProjectionManager;
|
|
519
653
|
/**
|
|
520
654
|
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
@@ -568,193 +702,176 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
568
702
|
private newOrthoCamera;
|
|
569
703
|
private setOrthoPerspCameraAspect;
|
|
570
704
|
}
|
|
571
|
-
import * as
|
|
572
|
-
import * as
|
|
573
|
-
import { Component, Components } from "../../core";
|
|
705
|
+
import * as THREE from "three";
|
|
706
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
707
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
574
708
|
/**
|
|
575
|
-
*
|
|
709
|
+
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
|
|
576
710
|
*/
|
|
577
|
-
export
|
|
578
|
-
/**
|
|
579
|
-
* A unique identifier for the component.
|
|
580
|
-
* This UUID is used to register the component within the Components system.
|
|
581
|
-
*/
|
|
582
|
-
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
583
|
-
/** {@link Component.enabled} */
|
|
584
|
-
enabled: boolean;
|
|
585
|
-
constructor(components: Components);
|
|
711
|
+
export interface Classification {
|
|
586
712
|
/**
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
590
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
591
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
592
|
-
* to make the location data available (e.g. absolute position of building).
|
|
713
|
+
* A system within the classification.
|
|
714
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
593
715
|
*/
|
|
594
|
-
|
|
716
|
+
[system: string]: {
|
|
717
|
+
/**
|
|
718
|
+
* A class within the system.
|
|
719
|
+
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
720
|
+
*/
|
|
721
|
+
[className: string]: {
|
|
722
|
+
map: FRAGS.FragmentIdMap;
|
|
723
|
+
name: string;
|
|
724
|
+
id: number | null;
|
|
725
|
+
};
|
|
726
|
+
};
|
|
595
727
|
}
|
|
596
|
-
import * as WEBIFC from "web-ifc";
|
|
597
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
598
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
599
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
600
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
601
728
|
/**
|
|
602
|
-
*
|
|
729
|
+
* The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
603
730
|
*/
|
|
604
|
-
export declare class
|
|
731
|
+
export declare class Classifier extends Component implements Disposable {
|
|
605
732
|
/**
|
|
606
733
|
* A unique identifier for the component.
|
|
607
734
|
* This UUID is used to register the component within the Components system.
|
|
608
735
|
*/
|
|
609
|
-
static readonly uuid: "
|
|
610
|
-
/** {@link Disposable.onDisposed} */
|
|
611
|
-
readonly onDisposed: Event<string>;
|
|
612
|
-
/**
|
|
613
|
-
* Event triggered when relations for a model have been indexed.
|
|
614
|
-
* This event provides the model's UUID and the relations map generated for that model.
|
|
615
|
-
*
|
|
616
|
-
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
617
|
-
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
618
|
-
* 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.
|
|
619
|
-
*/
|
|
620
|
-
readonly onRelationsIndexed: Event<{
|
|
621
|
-
modelID: string;
|
|
622
|
-
relationsMap: RelationsMap;
|
|
623
|
-
}>;
|
|
624
|
-
/**
|
|
625
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
626
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
627
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
628
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
629
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
630
|
-
* of entity relationships within a model.
|
|
631
|
-
*/
|
|
632
|
-
readonly relationMaps: ModelsRelationMap;
|
|
736
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
633
737
|
/** {@link Component.enabled} */
|
|
634
738
|
enabled: boolean;
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
739
|
+
/**
|
|
740
|
+
* A map representing the classification systems.
|
|
741
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
742
|
+
*/
|
|
743
|
+
list: Classification;
|
|
744
|
+
/** {@link Disposable.onDisposed} */
|
|
745
|
+
readonly onDisposed: Event<unknown>;
|
|
638
746
|
constructor(components: Components);
|
|
639
747
|
private onFragmentsDisposed;
|
|
640
|
-
|
|
641
|
-
|
|
748
|
+
/** {@link Disposable.dispose} */
|
|
749
|
+
dispose(): void;
|
|
642
750
|
/**
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
646
|
-
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
751
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
752
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
647
753
|
*
|
|
648
|
-
* @
|
|
754
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
649
755
|
*/
|
|
650
|
-
|
|
756
|
+
remove(guid: string): void;
|
|
651
757
|
/**
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
758
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
759
|
+
* If no filter is provided, it returns all fragments.
|
|
655
760
|
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
* and
|
|
659
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
660
|
-
* of entities that are related through that attribute.
|
|
761
|
+
* @param filter - An optional object containing filter criteria.
|
|
762
|
+
* The keys of the object represent the classification system names,
|
|
763
|
+
* and the values are arrays of class names to match.
|
|
661
764
|
*
|
|
662
|
-
* @
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
* @throws
|
|
765
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
766
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
767
|
+
*
|
|
768
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
666
769
|
*/
|
|
667
|
-
|
|
770
|
+
find(filter?: {
|
|
771
|
+
[name: string]: string[];
|
|
772
|
+
}): FRAGS.FragmentIdMap;
|
|
668
773
|
/**
|
|
669
|
-
*
|
|
774
|
+
* Classifies fragments based on their modelID.
|
|
775
|
+
*
|
|
776
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
777
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
778
|
+
*
|
|
779
|
+
* @remarks
|
|
780
|
+
* This method iterates through the fragments in the provided group,
|
|
781
|
+
* and classifies them based on their modelID.
|
|
782
|
+
* The classification is stored in the 'list.models' property,
|
|
783
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
670
784
|
*
|
|
671
|
-
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
672
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
673
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
674
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
675
785
|
*/
|
|
676
|
-
|
|
786
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
677
787
|
/**
|
|
678
|
-
*
|
|
679
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
680
|
-
* returning the IDs of related entities if a match is found.
|
|
788
|
+
* Classifies fragments based on their PredefinedType property.
|
|
681
789
|
*
|
|
682
|
-
* @param
|
|
683
|
-
*
|
|
684
|
-
* @
|
|
685
|
-
*
|
|
686
|
-
*
|
|
790
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
791
|
+
*
|
|
792
|
+
* @remarks
|
|
793
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
794
|
+
* and classifies them based on their PredefinedType property.
|
|
795
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
796
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
797
|
+
*
|
|
798
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
687
799
|
*/
|
|
688
|
-
|
|
800
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
689
801
|
/**
|
|
690
|
-
*
|
|
691
|
-
* 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,
|
|
692
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
693
|
-
* The resulting object is then serialized into a JSON string.
|
|
802
|
+
* Classifies fragments based on their entity type.
|
|
694
803
|
*
|
|
695
|
-
* @param
|
|
696
|
-
*
|
|
804
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
805
|
+
*
|
|
806
|
+
* @remarks
|
|
807
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
808
|
+
* and classifies them based on their entity type.
|
|
809
|
+
* The classification is stored in the 'list.entities' property,
|
|
810
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
811
|
+
*
|
|
812
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
697
813
|
*/
|
|
698
|
-
|
|
814
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
699
815
|
/**
|
|
700
|
-
*
|
|
701
|
-
* This method iterates through the relations indexed for the given model,
|
|
702
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
703
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
704
|
-
* The resulting object is then serialized into a JSON string.
|
|
816
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
705
817
|
*
|
|
706
|
-
* @param
|
|
707
|
-
* @
|
|
708
|
-
*
|
|
818
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
819
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
820
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
821
|
+
*
|
|
822
|
+
* @remarks
|
|
823
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
824
|
+
* and classifies them based on the specified IFC relationship.
|
|
825
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
826
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
827
|
+
*
|
|
828
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
709
829
|
*/
|
|
710
|
-
|
|
830
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
711
831
|
/**
|
|
712
|
-
*
|
|
713
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
714
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
715
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
716
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
832
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
717
833
|
*
|
|
718
|
-
* @
|
|
719
|
-
*
|
|
720
|
-
*/
|
|
721
|
-
serializeAllRelations(): string;
|
|
722
|
-
/**
|
|
723
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
724
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
725
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
726
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
727
|
-
* of express IDs of entities related through that relation type.
|
|
834
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
835
|
+
* @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
|
|
728
836
|
*
|
|
729
|
-
* @
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
837
|
+
* @remarks
|
|
838
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
839
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
840
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
841
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
842
|
+
*
|
|
843
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
733
844
|
*/
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
845
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
846
|
+
useProperties: boolean;
|
|
847
|
+
}): Promise<void>;
|
|
737
848
|
/**
|
|
738
|
-
*
|
|
849
|
+
* Sets the color of the specified fragments.
|
|
739
850
|
*
|
|
740
|
-
* @param
|
|
741
|
-
* @param
|
|
742
|
-
* @param
|
|
743
|
-
* @param relIDs - The expressIDs of the related entities within the model.
|
|
851
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
852
|
+
* @param color - The color to set for the fragments.
|
|
853
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
744
854
|
*
|
|
745
|
-
* @
|
|
855
|
+
* @remarks
|
|
856
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
857
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
858
|
+
*
|
|
859
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
746
860
|
*/
|
|
747
|
-
|
|
861
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
748
862
|
/**
|
|
749
|
-
*
|
|
863
|
+
* Resets the color of the specified fragments to their original color.
|
|
750
864
|
*
|
|
751
|
-
* @param
|
|
752
|
-
* @param expressID The expressID of the item whose children to get.
|
|
753
|
-
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
865
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
754
866
|
*
|
|
755
|
-
* @
|
|
867
|
+
* @remarks
|
|
868
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
869
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
870
|
+
*
|
|
871
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
756
872
|
*/
|
|
757
|
-
|
|
873
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
874
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
758
875
|
}
|
|
759
876
|
import * as THREE from "three";
|
|
760
877
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -964,1043 +1081,941 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
964
1081
|
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
965
1082
|
private static getFragmentBounds;
|
|
966
1083
|
}
|
|
967
|
-
import * as WEBIFC from "web-ifc";
|
|
968
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
969
1084
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
970
1085
|
/**
|
|
971
|
-
*
|
|
972
|
-
*/
|
|
973
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
974
|
-
/**
|
|
975
|
-
* Types for string properties in IFC schema.
|
|
976
|
-
*/
|
|
977
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
978
|
-
/**
|
|
979
|
-
* Types for numeric properties in IFC schema.
|
|
980
|
-
*/
|
|
981
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
982
|
-
/**
|
|
983
|
-
* 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.
|
|
984
|
-
*/
|
|
985
|
-
export interface ChangeMap {
|
|
986
|
-
[modelID: string]: Set<number>;
|
|
987
|
-
}
|
|
988
|
-
/**
|
|
989
|
-
* 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.
|
|
990
|
-
*/
|
|
991
|
-
export interface AttributeListener {
|
|
992
|
-
[modelID: string]: {
|
|
993
|
-
[expressID: number]: {
|
|
994
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
995
|
-
};
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
/**
|
|
999
|
-
* Component to manage and edit properties and Psets in IFC files.
|
|
1086
|
+
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
1000
1087
|
*/
|
|
1001
|
-
export declare class
|
|
1088
|
+
export declare class Exploder extends Component implements Disposable {
|
|
1002
1089
|
/**
|
|
1003
1090
|
* A unique identifier for the component.
|
|
1004
1091
|
* This UUID is used to register the component within the Components system.
|
|
1005
1092
|
*/
|
|
1006
|
-
static readonly uuid: "
|
|
1093
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1007
1094
|
/** {@link Disposable.onDisposed} */
|
|
1008
|
-
readonly onDisposed: Event<
|
|
1009
|
-
/**
|
|
1010
|
-
* Event triggered when a file is requested for export.
|
|
1011
|
-
*/
|
|
1012
|
-
readonly onRequestFile: Event<unknown>;
|
|
1013
|
-
/**
|
|
1014
|
-
* ArrayBuffer containing the IFC data to be exported.
|
|
1015
|
-
*/
|
|
1016
|
-
ifcToExport: ArrayBuffer | null;
|
|
1017
|
-
/**
|
|
1018
|
-
* Event triggered when an element is added to a Pset.
|
|
1019
|
-
*/
|
|
1020
|
-
readonly onElementToPset: Event<{
|
|
1021
|
-
model: FragmentsGroup;
|
|
1022
|
-
psetID: number;
|
|
1023
|
-
elementID: number;
|
|
1024
|
-
}>;
|
|
1025
|
-
/**
|
|
1026
|
-
* Event triggered when a property is added to a Pset.
|
|
1027
|
-
*/
|
|
1028
|
-
readonly onPropToPset: Event<{
|
|
1029
|
-
model: FragmentsGroup;
|
|
1030
|
-
psetID: number;
|
|
1031
|
-
propID: number;
|
|
1032
|
-
}>;
|
|
1033
|
-
/**
|
|
1034
|
-
* Event triggered when a Pset is removed.
|
|
1035
|
-
*/
|
|
1036
|
-
readonly onPsetRemoved: Event<{
|
|
1037
|
-
model: FragmentsGroup;
|
|
1038
|
-
psetID: number;
|
|
1039
|
-
}>;
|
|
1040
|
-
/**
|
|
1041
|
-
* Event triggered when data in the model changes.
|
|
1042
|
-
*/
|
|
1043
|
-
readonly onDataChanged: Event<{
|
|
1044
|
-
model: FragmentsGroup;
|
|
1045
|
-
expressID: number;
|
|
1046
|
-
}>;
|
|
1047
|
-
/**
|
|
1048
|
-
* Configuration for the WebAssembly module.
|
|
1049
|
-
*/
|
|
1050
|
-
wasm: {
|
|
1051
|
-
path: string;
|
|
1052
|
-
absolute: boolean;
|
|
1053
|
-
};
|
|
1095
|
+
readonly onDisposed: Event<unknown>;
|
|
1054
1096
|
/** {@link Component.enabled} */
|
|
1055
1097
|
enabled: boolean;
|
|
1056
1098
|
/**
|
|
1057
|
-
*
|
|
1099
|
+
* The height of the explosion animation.
|
|
1100
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1101
|
+
* Default value is 10.
|
|
1058
1102
|
*/
|
|
1059
|
-
|
|
1103
|
+
height: number;
|
|
1060
1104
|
/**
|
|
1061
|
-
* The
|
|
1105
|
+
* The group name used for the explosion animation.
|
|
1106
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1107
|
+
* Default value is "storeys".
|
|
1062
1108
|
*/
|
|
1063
|
-
|
|
1109
|
+
groupName: string;
|
|
1064
1110
|
/**
|
|
1065
|
-
*
|
|
1111
|
+
* A set of strings representing the exploded items.
|
|
1112
|
+
* This set is used to keep track of which items have been exploded.
|
|
1066
1113
|
*/
|
|
1067
|
-
|
|
1114
|
+
list: Set<string>;
|
|
1068
1115
|
constructor(components: Components);
|
|
1069
1116
|
/** {@link Disposable.dispose} */
|
|
1070
1117
|
dispose(): void;
|
|
1071
1118
|
/**
|
|
1072
|
-
*
|
|
1119
|
+
* Sets the explosion state of the fragments.
|
|
1073
1120
|
*
|
|
1074
|
-
* @param
|
|
1075
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1076
|
-
* @returns The IFC schema associated with the given model.
|
|
1077
|
-
*/
|
|
1078
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1079
|
-
/**
|
|
1080
|
-
* Method to set properties data in the model.
|
|
1121
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1081
1122
|
*
|
|
1082
|
-
* @
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
*
|
|
1123
|
+
* @remarks
|
|
1124
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1125
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1126
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1086
1127
|
*
|
|
1087
|
-
*
|
|
1128
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1088
1129
|
*
|
|
1089
|
-
* @throws Will throw an error if
|
|
1130
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1090
1131
|
*/
|
|
1091
|
-
|
|
1132
|
+
set(active: boolean): void;
|
|
1133
|
+
}
|
|
1134
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1135
|
+
import { Components, Component } from "../../core";
|
|
1136
|
+
/**
|
|
1137
|
+
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1138
|
+
*/
|
|
1139
|
+
export declare class Hider extends Component {
|
|
1092
1140
|
/**
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1095
|
-
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
1096
|
-
* @param name - The name of the Pset.
|
|
1097
|
-
* @param description - (Optional) The description of the Pset.
|
|
1098
|
-
*
|
|
1099
|
-
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
1100
|
-
*
|
|
1101
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1102
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1141
|
+
* A unique identifier for the component.
|
|
1142
|
+
* This UUID is used to register the component within the Components system.
|
|
1103
1143
|
*/
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1144
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1145
|
+
/** {@link Component.enabled} */
|
|
1146
|
+
enabled: boolean;
|
|
1147
|
+
constructor(components: Components);
|
|
1108
1148
|
/**
|
|
1109
|
-
*
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
1112
|
-
* @param psetID - The express IDs of the Psets to be removed.
|
|
1149
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1150
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1151
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1113
1152
|
*
|
|
1114
|
-
* @
|
|
1153
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1154
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1155
|
+
* If not provided, all fragments will be affected.
|
|
1115
1156
|
*
|
|
1116
|
-
* @
|
|
1117
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1118
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1157
|
+
* @returns {void}
|
|
1119
1158
|
*/
|
|
1120
|
-
|
|
1159
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1121
1160
|
/**
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1125
|
-
* @param type - The type of the property value. Must be a string property type.
|
|
1126
|
-
* @param name - The name of the property.
|
|
1127
|
-
* @param value - The value of the property. Must be a string.
|
|
1161
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1162
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1128
1163
|
*
|
|
1129
|
-
* @
|
|
1164
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1165
|
+
* If not provided, all fragments will be isolated.
|
|
1130
1166
|
*
|
|
1131
|
-
* @
|
|
1132
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1167
|
+
* @returns {void}
|
|
1133
1168
|
*/
|
|
1134
|
-
|
|
1169
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1170
|
+
private updateCulledVisibility;
|
|
1171
|
+
}
|
|
1172
|
+
import * as WEBIFC from "web-ifc";
|
|
1173
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1174
|
+
import { IfcFragmentSettings } from "./src";
|
|
1175
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1176
|
+
/**
|
|
1177
|
+
* 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).
|
|
1178
|
+
*/
|
|
1179
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1135
1180
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1139
|
-
* @param type - The type of the property value. Must be a numeric property type.
|
|
1140
|
-
* @param name - The name of the property.
|
|
1141
|
-
* @param value - The value of the property. Must be a number.
|
|
1142
|
-
*
|
|
1143
|
-
* @returns The newly created single-value property.
|
|
1144
|
-
*
|
|
1145
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1146
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1181
|
+
* A unique identifier for the component.
|
|
1182
|
+
* This UUID is used to register the component within the Components system.
|
|
1147
1183
|
*/
|
|
1148
|
-
|
|
1184
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1185
|
+
/** {@link Disposable.onDisposed} */
|
|
1186
|
+
readonly onDisposed: Event<string>;
|
|
1149
1187
|
/**
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1153
|
-
* @param type - The type of the property value. Must be a boolean property type.
|
|
1154
|
-
* @param name - The name of the property.
|
|
1155
|
-
* @param value - The value of the property. Must be a boolean.
|
|
1156
|
-
*
|
|
1157
|
-
* @returns The newly created single-value property.
|
|
1158
|
-
*
|
|
1159
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1160
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1188
|
+
* An event triggered when the IFC file starts loading.
|
|
1161
1189
|
*/
|
|
1162
|
-
|
|
1190
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1163
1191
|
/**
|
|
1164
|
-
*
|
|
1192
|
+
* An event triggered when the setup process is completed.
|
|
1193
|
+
*/
|
|
1194
|
+
readonly onSetup: Event<void>;
|
|
1195
|
+
/**
|
|
1196
|
+
* The settings for the IfcLoader.
|
|
1197
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1198
|
+
*/
|
|
1199
|
+
settings: IfcFragmentSettings;
|
|
1200
|
+
/**
|
|
1201
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1202
|
+
*/
|
|
1203
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1204
|
+
/** {@link Component.enabled} */
|
|
1205
|
+
enabled: boolean;
|
|
1206
|
+
private _material;
|
|
1207
|
+
private _spatialTree;
|
|
1208
|
+
private _metaData;
|
|
1209
|
+
private _fragmentInstances;
|
|
1210
|
+
private _civil;
|
|
1211
|
+
private _visitedFragments;
|
|
1212
|
+
private _materialT;
|
|
1213
|
+
constructor(components: Components);
|
|
1214
|
+
/** {@link Disposable.dispose} */
|
|
1215
|
+
dispose(): void;
|
|
1216
|
+
/**
|
|
1217
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1165
1218
|
*
|
|
1166
|
-
* @param
|
|
1167
|
-
*
|
|
1168
|
-
* @param propID - The express ID of the property to be removed.
|
|
1219
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
1220
|
+
* If not provided, the existing settings will be used.
|
|
1169
1221
|
*
|
|
1170
|
-
* @returns A
|
|
1222
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
1171
1223
|
*
|
|
1172
|
-
* @
|
|
1173
|
-
*
|
|
1224
|
+
* @remarks
|
|
1225
|
+
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1226
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1227
|
+
*
|
|
1228
|
+
* @example
|
|
1229
|
+
* '''typescript
|
|
1230
|
+
* const ifcLoader = new IfcLoader(components);
|
|
1231
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1232
|
+
* '''
|
|
1174
1233
|
*/
|
|
1175
|
-
|
|
1176
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
1234
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1177
1235
|
/**
|
|
1178
|
-
*
|
|
1236
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
1179
1237
|
*
|
|
1180
|
-
* @param
|
|
1181
|
-
* @param
|
|
1182
|
-
* @param elementID - The express IDs of the elements to be added.
|
|
1238
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1239
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1183
1240
|
*
|
|
1184
|
-
* @returns A
|
|
1241
|
+
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1185
1242
|
*
|
|
1186
|
-
* @
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1243
|
+
* @example
|
|
1244
|
+
* '''typescript
|
|
1245
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1246
|
+
* const group = await ifcLoader.load(ifcData);
|
|
1247
|
+
* '''
|
|
1189
1248
|
*/
|
|
1190
|
-
|
|
1249
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1191
1250
|
/**
|
|
1192
|
-
*
|
|
1251
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
1193
1252
|
*
|
|
1194
|
-
* @param
|
|
1195
|
-
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1253
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1196
1254
|
*
|
|
1197
|
-
* @returns A
|
|
1255
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1198
1256
|
*
|
|
1199
|
-
* @
|
|
1257
|
+
* @remarks
|
|
1258
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1259
|
+
* It also opens the IFC model using the provided data and settings.
|
|
1260
|
+
*
|
|
1261
|
+
* @example
|
|
1262
|
+
* '''typescript
|
|
1263
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1264
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
1265
|
+
* '''
|
|
1200
1266
|
*/
|
|
1201
|
-
|
|
1267
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1202
1268
|
/**
|
|
1203
|
-
*
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1207
|
-
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1208
|
-
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1269
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1270
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1209
1271
|
*
|
|
1210
|
-
* @
|
|
1272
|
+
* @remarks
|
|
1273
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1211
1274
|
*
|
|
1212
|
-
* @
|
|
1213
|
-
*
|
|
1214
|
-
*
|
|
1275
|
+
* @example
|
|
1276
|
+
* '''typescript
|
|
1277
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1278
|
+
* ifcLoader.cleanUp();
|
|
1279
|
+
* '''
|
|
1215
1280
|
*/
|
|
1216
|
-
|
|
1217
|
-
private
|
|
1218
|
-
private
|
|
1219
|
-
private
|
|
1220
|
-
private
|
|
1221
|
-
private newSingleProperty;
|
|
1281
|
+
cleanUp(): void;
|
|
1282
|
+
private getAllGeometries;
|
|
1283
|
+
private getMesh;
|
|
1284
|
+
private getGeometry;
|
|
1285
|
+
private autoSetWasm;
|
|
1222
1286
|
}
|
|
1223
|
-
import {
|
|
1287
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1288
|
+
import * as THREE from "three";
|
|
1289
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1290
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1291
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1224
1292
|
/**
|
|
1225
|
-
*
|
|
1293
|
+
* 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).
|
|
1226
1294
|
*/
|
|
1227
|
-
export declare class
|
|
1295
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
1228
1296
|
/**
|
|
1229
1297
|
* A unique identifier for the component.
|
|
1230
1298
|
* This UUID is used to register the component within the Components system.
|
|
1231
1299
|
*/
|
|
1232
|
-
static readonly uuid: "
|
|
1300
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
1233
1301
|
/** {@link Disposable.onDisposed} */
|
|
1234
1302
|
readonly onDisposed: Event<unknown>;
|
|
1235
|
-
/** {@link Component.enabled} */
|
|
1236
|
-
enabled: boolean;
|
|
1237
|
-
/**
|
|
1238
|
-
* The height of the explosion animation.
|
|
1239
|
-
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1240
|
-
* Default value is 10.
|
|
1241
|
-
*/
|
|
1242
|
-
height: number;
|
|
1243
|
-
/**
|
|
1244
|
-
* The group name used for the explosion animation.
|
|
1245
|
-
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1246
|
-
* Default value is "storeys".
|
|
1247
|
-
*/
|
|
1248
|
-
groupName: string;
|
|
1249
1303
|
/**
|
|
1250
|
-
*
|
|
1251
|
-
* This set is used to keep track of which items have been exploded.
|
|
1304
|
+
* Event triggered when fragments are loaded.
|
|
1252
1305
|
*/
|
|
1253
|
-
|
|
1254
|
-
constructor(components: Components);
|
|
1255
|
-
/** {@link Disposable.dispose} */
|
|
1256
|
-
dispose(): void;
|
|
1306
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1257
1307
|
/**
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1261
|
-
*
|
|
1262
|
-
* @remarks
|
|
1263
|
-
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1264
|
-
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1265
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
1266
|
-
*
|
|
1267
|
-
* The method also keeps track of the exploded items using the 'list' set.
|
|
1268
|
-
*
|
|
1269
|
-
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1308
|
+
* Event triggered when fragments are disposed.
|
|
1270
1309
|
*/
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
1276
|
-
/**
|
|
1277
|
-
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
|
|
1278
|
-
*/
|
|
1279
|
-
export interface Classification {
|
|
1310
|
+
readonly onFragmentsDisposed: Event<{
|
|
1311
|
+
groupID: string;
|
|
1312
|
+
fragmentIDs: string[];
|
|
1313
|
+
}>;
|
|
1280
1314
|
/**
|
|
1281
|
-
*
|
|
1282
|
-
* The key is the
|
|
1315
|
+
* Map containing all loaded fragments.
|
|
1316
|
+
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
1283
1317
|
*/
|
|
1284
|
-
|
|
1285
|
-
/**
|
|
1286
|
-
* A class within the system.
|
|
1287
|
-
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
1288
|
-
*/
|
|
1289
|
-
[className: string]: {
|
|
1290
|
-
map: FRAGS.FragmentIdMap;
|
|
1291
|
-
name: string;
|
|
1292
|
-
id: number | null;
|
|
1293
|
-
};
|
|
1294
|
-
};
|
|
1295
|
-
}
|
|
1296
|
-
/**
|
|
1297
|
-
* The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
1298
|
-
*/
|
|
1299
|
-
export declare class Classifier extends Component implements Disposable {
|
|
1318
|
+
readonly list: Map<string, Fragment>;
|
|
1300
1319
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1320
|
+
* Map containing all loaded fragment groups.
|
|
1321
|
+
* The key is the group's unique identifier, and the value is the group itself.
|
|
1303
1322
|
*/
|
|
1304
|
-
|
|
1323
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
1324
|
+
baseCoordinationModel: string;
|
|
1325
|
+
baseCoordinationMatrix: THREE.Matrix4;
|
|
1305
1326
|
/** {@link Component.enabled} */
|
|
1306
1327
|
enabled: boolean;
|
|
1328
|
+
private _loader;
|
|
1307
1329
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1330
|
+
* Getter for the meshes of all fragments in the FragmentsManager.
|
|
1331
|
+
* It iterates over the fragments in the list and pushes their meshes into an array.
|
|
1332
|
+
* @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
|
|
1310
1333
|
*/
|
|
1311
|
-
|
|
1312
|
-
/** {@link Disposable.onDisposed} */
|
|
1313
|
-
readonly onDisposed: Event<unknown>;
|
|
1334
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
1314
1335
|
constructor(components: Components);
|
|
1315
|
-
private onFragmentsDisposed;
|
|
1316
1336
|
/** {@link Disposable.dispose} */
|
|
1317
1337
|
dispose(): void;
|
|
1318
1338
|
/**
|
|
1319
|
-
*
|
|
1320
|
-
* This method
|
|
1339
|
+
* Dispose of a specific fragment group.
|
|
1340
|
+
* This method removes the group from the groups map, deletes all fragments within the group from the list,
|
|
1341
|
+
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
1321
1342
|
*
|
|
1322
|
-
* @param
|
|
1343
|
+
* @param group - The fragment group to be disposed.
|
|
1323
1344
|
*/
|
|
1324
|
-
|
|
1345
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
1325
1346
|
/**
|
|
1326
|
-
*
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
* @param
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1333
|
-
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
1334
|
-
* where the express IDs are filtered based on the provided filter criteria.
|
|
1335
|
-
*
|
|
1336
|
-
* @throws Will throw an error if the fragments map is malformed.
|
|
1337
|
-
*/
|
|
1338
|
-
find(filter?: {
|
|
1339
|
-
[name: string]: string[];
|
|
1340
|
-
}): FRAGS.FragmentIdMap;
|
|
1341
|
-
/**
|
|
1342
|
-
* Classifies fragments based on their modelID.
|
|
1343
|
-
*
|
|
1344
|
-
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
1345
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1346
|
-
*
|
|
1347
|
-
* @remarks
|
|
1348
|
-
* This method iterates through the fragments in the provided group,
|
|
1349
|
-
* and classifies them based on their modelID.
|
|
1350
|
-
* The classification is stored in the 'list.models' property,
|
|
1351
|
-
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1352
|
-
*
|
|
1353
|
-
*/
|
|
1354
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
1355
|
-
/**
|
|
1356
|
-
* Classifies fragments based on their PredefinedType property.
|
|
1357
|
-
*
|
|
1358
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1359
|
-
*
|
|
1360
|
-
* @remarks
|
|
1361
|
-
* This method iterates through the properties of the fragments in the provided group,
|
|
1362
|
-
* and classifies them based on their PredefinedType property.
|
|
1363
|
-
* The classification is stored in the 'list.predefinedTypes' property,
|
|
1364
|
-
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1365
|
-
*
|
|
1366
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
1347
|
+
* Loads a binary file that contain fragment geometry.
|
|
1348
|
+
* @param data - The binary data to load.
|
|
1349
|
+
* @param config - Optional configuration for loading.
|
|
1350
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
1351
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
1352
|
+
* @returns The loaded FragmentsGroup.
|
|
1367
1353
|
*/
|
|
1368
|
-
|
|
1354
|
+
load(data: Uint8Array, config?: Partial<{
|
|
1355
|
+
coordinate: boolean;
|
|
1356
|
+
name: string;
|
|
1357
|
+
properties: FRAGS.IfcProperties;
|
|
1358
|
+
relationsMap: RelationsMap;
|
|
1359
|
+
}>): FragmentsGroup;
|
|
1369
1360
|
/**
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1372
|
-
* @
|
|
1373
|
-
*
|
|
1374
|
-
* @remarks
|
|
1375
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
1376
|
-
* and classifies them based on their entity type.
|
|
1377
|
-
* The classification is stored in the 'list.entities' property,
|
|
1378
|
-
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1379
|
-
*
|
|
1380
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
1361
|
+
* Export the specified fragmentsgroup to binary data.
|
|
1362
|
+
* @param group - the fragments group to be exported.
|
|
1363
|
+
* @returns the exported data as binary buffer.
|
|
1381
1364
|
*/
|
|
1382
|
-
|
|
1365
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
1383
1366
|
/**
|
|
1384
|
-
*
|
|
1385
|
-
*
|
|
1386
|
-
* @
|
|
1387
|
-
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
1388
|
-
* @param systemName - The name of the classification system to store the classification.
|
|
1389
|
-
*
|
|
1390
|
-
* @remarks
|
|
1391
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
1392
|
-
* and classifies them based on the specified IFC relationship.
|
|
1393
|
-
* The classification is stored in the 'list' property under the specified system name,
|
|
1394
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1395
|
-
*
|
|
1396
|
-
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
1367
|
+
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
1368
|
+
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
1369
|
+
* @returns A map of model IDs to sets of express IDs.
|
|
1397
1370
|
*/
|
|
1398
|
-
|
|
1371
|
+
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
1372
|
+
[modelID: string]: Set<number>;
|
|
1373
|
+
};
|
|
1399
1374
|
/**
|
|
1400
|
-
*
|
|
1401
|
-
*
|
|
1402
|
-
* @
|
|
1403
|
-
* @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
|
|
1404
|
-
*
|
|
1375
|
+
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
1376
|
+
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
1377
|
+
* @returns A fragment ID map.
|
|
1405
1378
|
* @remarks
|
|
1406
|
-
* This method iterates through the
|
|
1407
|
-
* and
|
|
1408
|
-
* The
|
|
1409
|
-
* with
|
|
1410
|
-
*
|
|
1411
|
-
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
1379
|
+
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
1380
|
+
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
1381
|
+
* The fragment ID maps are then merged into a single map and returned.
|
|
1382
|
+
* If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
|
|
1412
1383
|
*/
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
}):
|
|
1384
|
+
modelIdToFragmentIdMap(modelIdMap: {
|
|
1385
|
+
[modelID: string]: Set<number>;
|
|
1386
|
+
}): FRAGS.FragmentIdMap;
|
|
1416
1387
|
/**
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
1419
|
-
*
|
|
1420
|
-
*
|
|
1421
|
-
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
1422
|
-
*
|
|
1423
|
-
* @remarks
|
|
1424
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1425
|
-
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
1388
|
+
* Applies coordinate transformation to the provided models.
|
|
1389
|
+
* If no models are provided, all groups are used.
|
|
1390
|
+
* The first model in the list becomes the base model for coordinate transformation.
|
|
1391
|
+
* All other models are then transformed to match the base model's coordinate system.
|
|
1426
1392
|
*
|
|
1427
|
-
* @
|
|
1393
|
+
* @param models - The models to apply coordinate transformation to.
|
|
1394
|
+
* If not provided, all models are used.
|
|
1428
1395
|
*/
|
|
1429
|
-
|
|
1396
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
1430
1397
|
/**
|
|
1431
|
-
*
|
|
1398
|
+
* Applies the base coordinate system to the provided object.
|
|
1432
1399
|
*
|
|
1433
|
-
*
|
|
1400
|
+
* This function takes an object and its original coordinate system as input.
|
|
1401
|
+
* It then inverts the original coordinate system and applies the base coordinate system
|
|
1402
|
+
* to the object. This ensures that the object's position, rotation, and scale are
|
|
1403
|
+
* transformed to match the base coordinate system (which is taken from the first model loaded).
|
|
1434
1404
|
*
|
|
1435
|
-
* @
|
|
1436
|
-
* This
|
|
1437
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
1405
|
+
* @param object - The object to which the base coordinate system will be applied.
|
|
1406
|
+
* This should be an instance of THREE.Object3D.
|
|
1438
1407
|
*
|
|
1439
|
-
* @
|
|
1408
|
+
* @param originalCoordinateSystem - The original coordinate system of the object.
|
|
1409
|
+
* This should be a THREE.Matrix4 representing the object's transformation matrix.
|
|
1440
1410
|
*/
|
|
1441
|
-
|
|
1442
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
1411
|
+
applyBaseCoordinateSystem(object: THREE.Object3D, originalCoordinateSystem: THREE.Matrix4): void;
|
|
1443
1412
|
}
|
|
1444
|
-
import * as
|
|
1445
|
-
import { Components, Component } from "../../core";
|
|
1413
|
+
import * as WEBIFC from "web-ifc";
|
|
1414
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1415
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1446
1416
|
/**
|
|
1447
|
-
* A component that
|
|
1417
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1448
1418
|
*/
|
|
1449
|
-
export declare class
|
|
1419
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1450
1420
|
/**
|
|
1451
1421
|
* A unique identifier for the component.
|
|
1452
1422
|
* This UUID is used to register the component within the Components system.
|
|
1453
1423
|
*/
|
|
1454
|
-
static readonly uuid: "
|
|
1455
|
-
/** {@link Component.enabled} */
|
|
1456
|
-
enabled: boolean;
|
|
1457
|
-
constructor(components: Components);
|
|
1458
|
-
/**
|
|
1459
|
-
* Sets the visibility of fragments within the 3D scene.
|
|
1460
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1461
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1462
|
-
*
|
|
1463
|
-
* @param visible - The visibility state to set for the fragments.
|
|
1464
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1465
|
-
* If not provided, all fragments will be affected.
|
|
1466
|
-
*
|
|
1467
|
-
* @returns {void}
|
|
1468
|
-
*/
|
|
1469
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1424
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1470
1425
|
/**
|
|
1471
|
-
*
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
1474
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1475
|
-
* If not provided, all fragments will be isolated.
|
|
1476
|
-
*
|
|
1477
|
-
* @returns {void}
|
|
1426
|
+
* Event triggered when geometry is streamed.
|
|
1427
|
+
* Contains the streamed geometry data and its buffer.
|
|
1478
1428
|
*/
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1484
|
-
center: THREE.Vector3;
|
|
1485
|
-
halfSizes: THREE.Vector3;
|
|
1486
|
-
rotation: THREE.Matrix3;
|
|
1487
|
-
transformation: THREE.Matrix4;
|
|
1488
|
-
};
|
|
1489
|
-
import * as WEBIFC from "web-ifc";
|
|
1490
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1491
|
-
import { IfcFragmentSettings } from "./src";
|
|
1492
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
1493
|
-
/**
|
|
1494
|
-
* 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).
|
|
1495
|
-
*/
|
|
1496
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
1429
|
+
readonly onGeometryStreamed: Event<{
|
|
1430
|
+
buffer: Uint8Array;
|
|
1431
|
+
data: StreamedGeometries;
|
|
1432
|
+
}>;
|
|
1497
1433
|
/**
|
|
1498
|
-
*
|
|
1499
|
-
*
|
|
1434
|
+
* Event triggered when assets are streamed.
|
|
1435
|
+
* Contains the streamed assets.
|
|
1500
1436
|
*/
|
|
1501
|
-
|
|
1502
|
-
/** {@link Disposable.onDisposed} */
|
|
1503
|
-
readonly onDisposed: Event<string>;
|
|
1437
|
+
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1504
1438
|
/**
|
|
1505
|
-
*
|
|
1439
|
+
* Event triggered to indicate the progress of the streaming process.
|
|
1440
|
+
* Contains the progress percentage.
|
|
1506
1441
|
*/
|
|
1507
|
-
readonly
|
|
1442
|
+
readonly onProgress: Event<number>;
|
|
1508
1443
|
/**
|
|
1509
|
-
*
|
|
1444
|
+
* Event triggered when the IFC file is loaded.
|
|
1445
|
+
* Contains the loaded IFC file data.
|
|
1510
1446
|
*/
|
|
1511
|
-
readonly
|
|
1447
|
+
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1448
|
+
/** {@link Disposable.onDisposed} */
|
|
1449
|
+
readonly onDisposed: Event<unknown>;
|
|
1512
1450
|
/**
|
|
1513
|
-
*
|
|
1514
|
-
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1451
|
+
* Settings for the IfcGeometryTiler.
|
|
1515
1452
|
*/
|
|
1516
|
-
settings:
|
|
1453
|
+
settings: IfcStreamingSettings;
|
|
1454
|
+
/** {@link Component.enabled} */
|
|
1455
|
+
enabled: boolean;
|
|
1517
1456
|
/**
|
|
1518
|
-
* The
|
|
1457
|
+
* The WebIFC API instance used for IFC file processing.
|
|
1519
1458
|
*/
|
|
1520
1459
|
webIfc: WEBIFC.IfcAPI;
|
|
1521
|
-
/** {@link Component.enabled} */
|
|
1522
|
-
enabled: boolean;
|
|
1523
|
-
private _material;
|
|
1524
1460
|
private _spatialTree;
|
|
1525
1461
|
private _metaData;
|
|
1526
|
-
private
|
|
1462
|
+
private _visitedGeometries;
|
|
1463
|
+
private _streamSerializer;
|
|
1464
|
+
private _geometries;
|
|
1465
|
+
private _geometryCount;
|
|
1527
1466
|
private _civil;
|
|
1528
|
-
private
|
|
1529
|
-
private
|
|
1467
|
+
private _groupSerializer;
|
|
1468
|
+
private _assets;
|
|
1469
|
+
private _meshesWithHoles;
|
|
1530
1470
|
constructor(components: Components);
|
|
1531
1471
|
/** {@link Disposable.dispose} */
|
|
1532
1472
|
dispose(): void;
|
|
1533
1473
|
/**
|
|
1534
|
-
*
|
|
1535
|
-
*
|
|
1536
|
-
* @param config - Optional configuration settings for the IfcLoader.
|
|
1537
|
-
* If not provided, the existing settings will be used.
|
|
1474
|
+
* This method streams the IFC file from a given buffer.
|
|
1538
1475
|
*
|
|
1539
|
-
* @
|
|
1476
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1477
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1540
1478
|
*
|
|
1541
1479
|
* @remarks
|
|
1542
|
-
*
|
|
1543
|
-
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1480
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1544
1481
|
*
|
|
1545
1482
|
* @example
|
|
1546
1483
|
* '''typescript
|
|
1547
|
-
* const
|
|
1548
|
-
* await
|
|
1484
|
+
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1485
|
+
* const rawBuffer = await response.arrayBuffer();
|
|
1486
|
+
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1487
|
+
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1549
1488
|
* '''
|
|
1550
1489
|
*/
|
|
1551
|
-
|
|
1490
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1552
1491
|
/**
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1556
|
-
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1557
|
-
*
|
|
1558
|
-
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1559
|
-
*
|
|
1560
|
-
* @example
|
|
1561
|
-
* '''typescript
|
|
1562
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1563
|
-
* const group = await ifcLoader.load(ifcData);
|
|
1564
|
-
* '''
|
|
1565
|
-
*/
|
|
1566
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1567
|
-
/**
|
|
1568
|
-
* Reads an IFC file and initializes the Web-IFC library.
|
|
1569
|
-
*
|
|
1570
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1571
|
-
*
|
|
1572
|
-
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1573
|
-
*
|
|
1574
|
-
* @remarks
|
|
1575
|
-
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1576
|
-
* It also opens the IFC model using the provided data and settings.
|
|
1492
|
+
* This method streams the IFC file from a given callback.
|
|
1577
1493
|
*
|
|
1578
|
-
* @
|
|
1579
|
-
*
|
|
1580
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1581
|
-
* await ifcLoader.readIfcFile(ifcData);
|
|
1582
|
-
* '''
|
|
1583
|
-
*/
|
|
1584
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1585
|
-
/**
|
|
1586
|
-
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1587
|
-
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1494
|
+
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1495
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1588
1496
|
*
|
|
1589
1497
|
* @remarks
|
|
1590
|
-
* This method
|
|
1498
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1591
1499
|
*
|
|
1592
|
-
* @example
|
|
1593
|
-
* '''typescript
|
|
1594
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1595
|
-
* ifcLoader.cleanUp();
|
|
1596
|
-
* '''
|
|
1597
1500
|
*/
|
|
1598
|
-
|
|
1599
|
-
private
|
|
1501
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1502
|
+
private readIfcFile;
|
|
1503
|
+
private streamIfcFile;
|
|
1504
|
+
private streamAllGeometries;
|
|
1505
|
+
private cleanUp;
|
|
1600
1506
|
private getMesh;
|
|
1601
1507
|
private getGeometry;
|
|
1602
|
-
private
|
|
1603
|
-
|
|
1604
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1605
|
-
import * as THREE from "three";
|
|
1606
|
-
export declare class MaterialsUtils {
|
|
1607
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
1608
|
-
}
|
|
1609
|
-
export declare class UUID {
|
|
1610
|
-
private static _pattern;
|
|
1611
|
-
private static _lut;
|
|
1612
|
-
static create(): string;
|
|
1613
|
-
static validate(uuid: string): void;
|
|
1614
|
-
}
|
|
1615
|
-
import * as THREE from "three";
|
|
1616
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1617
|
-
/**
|
|
1618
|
-
* Configuration interface for the VertexPicker component.
|
|
1619
|
-
*/
|
|
1620
|
-
export interface VertexPickerConfig {
|
|
1621
|
-
/**
|
|
1622
|
-
* If true, only vertices will be picked, not the closest point on the face.
|
|
1623
|
-
*/
|
|
1624
|
-
showOnlyVertex: boolean;
|
|
1625
|
-
/**
|
|
1626
|
-
* The maximum distance for snapping to a vertex.
|
|
1627
|
-
*/
|
|
1628
|
-
snapDistance: number;
|
|
1629
|
-
/**
|
|
1630
|
-
* The HTML element to use for previewing the picked vertex.
|
|
1631
|
-
*/
|
|
1632
|
-
previewElement: HTMLElement;
|
|
1508
|
+
private streamAssets;
|
|
1509
|
+
private streamGeometries;
|
|
1633
1510
|
}
|
|
1511
|
+
import * as WEBIFC from "web-ifc";
|
|
1512
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1513
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1634
1514
|
/**
|
|
1635
|
-
* A
|
|
1515
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1636
1516
|
*/
|
|
1637
|
-
export declare class
|
|
1638
|
-
/** {@link Disposable.onDisposed} */
|
|
1639
|
-
readonly onDisposed: Event<unknown>;
|
|
1517
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1640
1518
|
/**
|
|
1641
|
-
*
|
|
1642
|
-
*
|
|
1519
|
+
* A unique identifier for the component.
|
|
1520
|
+
* This UUID is used to register the component within the Components system.
|
|
1643
1521
|
*/
|
|
1644
|
-
readonly
|
|
1522
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1645
1523
|
/**
|
|
1646
|
-
* An event that is triggered when
|
|
1647
|
-
* The event
|
|
1524
|
+
* An event that is triggered when properties are streamed from the IFC file.
|
|
1525
|
+
* The event provides the type of the IFC entity and the corresponding data.
|
|
1648
1526
|
*/
|
|
1649
|
-
readonly
|
|
1527
|
+
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1528
|
+
type: number;
|
|
1529
|
+
data: {
|
|
1530
|
+
[id: number]: any;
|
|
1531
|
+
};
|
|
1532
|
+
}>;
|
|
1650
1533
|
/**
|
|
1651
|
-
* An event that is triggered
|
|
1534
|
+
* An event that is triggered to indicate the progress of the streaming process.
|
|
1535
|
+
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1652
1536
|
*/
|
|
1653
|
-
readonly
|
|
1537
|
+
readonly onProgress: AsyncEvent<number>;
|
|
1654
1538
|
/**
|
|
1655
|
-
*
|
|
1539
|
+
* An event that is triggered when indices are streamed from the IFC file.
|
|
1540
|
+
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1656
1541
|
*/
|
|
1657
|
-
|
|
1542
|
+
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1543
|
+
/** {@link Disposable.onDisposed} */
|
|
1544
|
+
readonly onDisposed: Event<string>;
|
|
1545
|
+
/** {@link Component.enabled} */
|
|
1546
|
+
enabled: boolean;
|
|
1658
1547
|
/**
|
|
1659
|
-
*
|
|
1660
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
1661
|
-
* If this value is null, all vertices are considered valid.
|
|
1548
|
+
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1662
1549
|
*/
|
|
1663
|
-
|
|
1664
|
-
private _pickedPoint;
|
|
1665
|
-
private _config;
|
|
1666
|
-
private _enabled;
|
|
1550
|
+
settings: PropertiesStreamingSettings;
|
|
1667
1551
|
/**
|
|
1668
|
-
*
|
|
1669
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1670
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1671
|
-
*
|
|
1672
|
-
* @param value - The new enabled state.
|
|
1552
|
+
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1673
1553
|
*/
|
|
1674
|
-
|
|
1554
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1555
|
+
/** {@link Disposable.dispose} */
|
|
1556
|
+
dispose(): Promise<void>;
|
|
1675
1557
|
/**
|
|
1676
|
-
*
|
|
1558
|
+
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1677
1559
|
*
|
|
1678
|
-
* @
|
|
1560
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1561
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1679
1562
|
*/
|
|
1680
|
-
|
|
1563
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1681
1564
|
/**
|
|
1682
|
-
*
|
|
1683
|
-
*
|
|
1684
|
-
* @param value - A Partial object containing the configuration properties to update.
|
|
1685
|
-
* The properties not provided in the value object will retain their current values.
|
|
1565
|
+
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1686
1566
|
*
|
|
1687
|
-
* @
|
|
1688
|
-
*
|
|
1689
|
-
* vertexPicker.config = {
|
|
1690
|
-
* snapDistance: 0.5,
|
|
1691
|
-
* showOnlyVertex: true,
|
|
1692
|
-
* };
|
|
1693
|
-
* '''
|
|
1567
|
+
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1568
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1694
1569
|
*/
|
|
1695
|
-
|
|
1570
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1571
|
+
private readIfcFile;
|
|
1572
|
+
private streamIfcFile;
|
|
1573
|
+
private streamAllProperties;
|
|
1574
|
+
private cleanUp;
|
|
1575
|
+
}
|
|
1576
|
+
import * as WEBIFC from "web-ifc";
|
|
1577
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1578
|
+
import { Component, Components } from "../../core";
|
|
1579
|
+
/**
|
|
1580
|
+
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1581
|
+
*/
|
|
1582
|
+
export declare class IfcJsonExporter extends Component {
|
|
1696
1583
|
/**
|
|
1697
|
-
*
|
|
1698
|
-
*
|
|
1699
|
-
* @returns A copy of the current VertexPickerConfig object.
|
|
1700
|
-
*
|
|
1701
|
-
* @example
|
|
1702
|
-
* '''typescript
|
|
1703
|
-
* const currentConfig = vertexPicker.config;
|
|
1704
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1705
|
-
* '''
|
|
1584
|
+
* A unique identifier for the component.
|
|
1585
|
+
* This UUID is used to register the component within the Components system.
|
|
1706
1586
|
*/
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1587
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1588
|
+
/** {@link Component.enabled} */
|
|
1589
|
+
enabled: boolean;
|
|
1590
|
+
constructor(components: Components);
|
|
1711
1591
|
/**
|
|
1712
|
-
*
|
|
1713
|
-
*
|
|
1714
|
-
* @param
|
|
1715
|
-
*
|
|
1716
|
-
* @
|
|
1717
|
-
*
|
|
1718
|
-
* @remarks
|
|
1719
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
1720
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
1721
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
1722
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
1723
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
1724
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1592
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1593
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1594
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1595
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1596
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1597
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1725
1598
|
*/
|
|
1726
|
-
|
|
1727
|
-
private getClosestVertex;
|
|
1728
|
-
private getVertices;
|
|
1729
|
-
private getVertex;
|
|
1599
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1730
1600
|
}
|
|
1731
|
-
import
|
|
1732
|
-
import
|
|
1733
|
-
import
|
|
1734
|
-
import {
|
|
1735
|
-
|
|
1601
|
+
import * as WEBIFC from "web-ifc";
|
|
1602
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1603
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
1604
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1605
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1736
1606
|
/**
|
|
1737
|
-
*
|
|
1607
|
+
* 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).
|
|
1738
1608
|
*/
|
|
1739
|
-
export declare class
|
|
1609
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1740
1610
|
/**
|
|
1741
1611
|
* A unique identifier for the component.
|
|
1742
1612
|
* This UUID is used to register the component within the Components system.
|
|
1743
1613
|
*/
|
|
1744
|
-
static readonly uuid: "
|
|
1614
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1745
1615
|
/** {@link Disposable.onDisposed} */
|
|
1746
|
-
readonly onDisposed: Event<
|
|
1747
|
-
/**
|
|
1748
|
-
* Event triggered when fragments are loaded.
|
|
1749
|
-
*/
|
|
1750
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1616
|
+
readonly onDisposed: Event<string>;
|
|
1751
1617
|
/**
|
|
1752
|
-
* Event triggered when
|
|
1618
|
+
* Event triggered when relations for a model have been indexed.
|
|
1619
|
+
* This event provides the model's UUID and the relations map generated for that model.
|
|
1620
|
+
*
|
|
1621
|
+
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
1622
|
+
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
1623
|
+
* 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.
|
|
1753
1624
|
*/
|
|
1754
|
-
readonly
|
|
1755
|
-
|
|
1756
|
-
|
|
1625
|
+
readonly onRelationsIndexed: Event<{
|
|
1626
|
+
modelID: string;
|
|
1627
|
+
relationsMap: RelationsMap;
|
|
1757
1628
|
}>;
|
|
1758
1629
|
/**
|
|
1759
|
-
*
|
|
1760
|
-
* The key is
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
*
|
|
1765
|
-
* The key is the group's unique identifier, and the value is the group itself.
|
|
1630
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
1631
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
1632
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
1633
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
1634
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
1635
|
+
* of entity relationships within a model.
|
|
1766
1636
|
*/
|
|
1767
|
-
readonly
|
|
1768
|
-
baseCoordinationModel: string;
|
|
1769
|
-
baseCoordinationMatrix: THREE.Matrix4;
|
|
1637
|
+
readonly relationMaps: ModelsRelationMap;
|
|
1770
1638
|
/** {@link Component.enabled} */
|
|
1771
1639
|
enabled: boolean;
|
|
1772
|
-
private
|
|
1640
|
+
private _relToAttributesMap;
|
|
1641
|
+
private _inverseAttributes;
|
|
1642
|
+
private _ifcRels;
|
|
1643
|
+
constructor(components: Components);
|
|
1644
|
+
private onFragmentsDisposed;
|
|
1645
|
+
private indexRelations;
|
|
1646
|
+
private getAttributeIndex;
|
|
1773
1647
|
/**
|
|
1774
|
-
*
|
|
1775
|
-
*
|
|
1776
|
-
* @
|
|
1648
|
+
* Adds a relation map to the model's relations map.
|
|
1649
|
+
*
|
|
1650
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
1651
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
1652
|
+
*
|
|
1653
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
1777
1654
|
*/
|
|
1778
|
-
|
|
1779
|
-
constructor(components: Components);
|
|
1780
|
-
/** {@link Disposable.dispose} */
|
|
1781
|
-
dispose(): void;
|
|
1655
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
1782
1656
|
/**
|
|
1783
|
-
*
|
|
1784
|
-
* This method
|
|
1785
|
-
*
|
|
1657
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
1658
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
1659
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
1786
1660
|
*
|
|
1787
|
-
*
|
|
1661
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
1662
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
1663
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
1664
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
1665
|
+
* of entities that are related through that attribute.
|
|
1666
|
+
*
|
|
1667
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
1668
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
1669
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
1670
|
+
* @throws An error if the model does not have properties loaded.
|
|
1788
1671
|
*/
|
|
1789
|
-
|
|
1672
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
1790
1673
|
/**
|
|
1791
|
-
*
|
|
1792
|
-
*
|
|
1793
|
-
* @param
|
|
1794
|
-
* @param
|
|
1795
|
-
* @
|
|
1796
|
-
*
|
|
1674
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
1675
|
+
*
|
|
1676
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
1677
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
1678
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
1679
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
1797
1680
|
*/
|
|
1798
|
-
|
|
1799
|
-
coordinate: boolean;
|
|
1800
|
-
name: string;
|
|
1801
|
-
properties: FRAGS.IfcProperties;
|
|
1802
|
-
relationsMap: RelationsMap;
|
|
1803
|
-
}>): FragmentsGroup;
|
|
1681
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
1804
1682
|
/**
|
|
1805
|
-
*
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
1683
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
1684
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
1685
|
+
* returning the IDs of related entities if a match is found.
|
|
1686
|
+
*
|
|
1687
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
1688
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
1689
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
1690
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
1691
|
+
* or the specified relation name is not indexed.
|
|
1808
1692
|
*/
|
|
1809
|
-
|
|
1693
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
1810
1694
|
/**
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1813
|
-
*
|
|
1695
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
1696
|
+
* 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,
|
|
1697
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1698
|
+
* The resulting object is then serialized into a JSON string.
|
|
1699
|
+
*
|
|
1700
|
+
* @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.
|
|
1701
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
1814
1702
|
*/
|
|
1815
|
-
|
|
1816
|
-
[modelID: string]: Set<number>;
|
|
1817
|
-
};
|
|
1703
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
1818
1704
|
/**
|
|
1819
|
-
*
|
|
1820
|
-
*
|
|
1821
|
-
*
|
|
1822
|
-
*
|
|
1823
|
-
*
|
|
1824
|
-
*
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
1705
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
1706
|
+
* This method iterates through the relations indexed for the given model,
|
|
1707
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
1708
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1709
|
+
* The resulting object is then serialized into a JSON string.
|
|
1710
|
+
*
|
|
1711
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
1712
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
1713
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
1827
1714
|
*/
|
|
1828
|
-
|
|
1829
|
-
[modelID: string]: Set<number>;
|
|
1830
|
-
}): FRAGS.FragmentIdMap;
|
|
1715
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
1831
1716
|
/**
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1834
|
-
*
|
|
1835
|
-
*
|
|
1717
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
1718
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
1719
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
1720
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
1721
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
1836
1722
|
*
|
|
1837
|
-
* @
|
|
1838
|
-
*
|
|
1723
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
1724
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
1839
1725
|
*/
|
|
1840
|
-
|
|
1726
|
+
serializeAllRelations(): string;
|
|
1727
|
+
/**
|
|
1728
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
1729
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
1730
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
1731
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
1732
|
+
* of express IDs of entities related through that relation type.
|
|
1733
|
+
*
|
|
1734
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
1735
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
1736
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
1737
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
1738
|
+
*/
|
|
1739
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
1740
|
+
/** {@link Disposable.dispose} */
|
|
1741
|
+
dispose(): void;
|
|
1742
|
+
/**
|
|
1743
|
+
* Adds relations between an entity and other entities in a BIM model.
|
|
1744
|
+
*
|
|
1745
|
+
* @param model - The BIM model to which the relations will be added.
|
|
1746
|
+
* @param expressID - The expressID of the entity within the model.
|
|
1747
|
+
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
1748
|
+
* @param relIDs - The expressIDs of the related entities within the model.
|
|
1749
|
+
*
|
|
1750
|
+
* @throws An error if the relation name is not a valid relation name.
|
|
1751
|
+
*/
|
|
1752
|
+
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
1753
|
+
/**
|
|
1754
|
+
* 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.
|
|
1755
|
+
*
|
|
1756
|
+
* @param model The BIM model whose children to get.
|
|
1757
|
+
* @param expressID The expressID of the item whose children to get.
|
|
1758
|
+
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
1759
|
+
*
|
|
1760
|
+
* @returns A 'Set' with the expressIDs of the found items.
|
|
1761
|
+
*/
|
|
1762
|
+
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
1841
1763
|
}
|
|
1842
1764
|
import * as WEBIFC from "web-ifc";
|
|
1843
|
-
import {
|
|
1844
|
-
import {
|
|
1765
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1766
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1845
1767
|
/**
|
|
1846
|
-
*
|
|
1768
|
+
* Types for boolean properties in IFC schema.
|
|
1847
1769
|
*/
|
|
1848
|
-
export
|
|
1770
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1771
|
+
/**
|
|
1772
|
+
* Types for string properties in IFC schema.
|
|
1773
|
+
*/
|
|
1774
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1775
|
+
/**
|
|
1776
|
+
* Types for numeric properties in IFC schema.
|
|
1777
|
+
*/
|
|
1778
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1779
|
+
/**
|
|
1780
|
+
* 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.
|
|
1781
|
+
*/
|
|
1782
|
+
export interface ChangeMap {
|
|
1783
|
+
[modelID: string]: Set<number>;
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* 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.
|
|
1787
|
+
*/
|
|
1788
|
+
export interface AttributeListener {
|
|
1789
|
+
[modelID: string]: {
|
|
1790
|
+
[expressID: number]: {
|
|
1791
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1792
|
+
};
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1797
|
+
*/
|
|
1798
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1849
1799
|
/**
|
|
1850
1800
|
* A unique identifier for the component.
|
|
1851
1801
|
* This UUID is used to register the component within the Components system.
|
|
1852
1802
|
*/
|
|
1853
|
-
static readonly uuid: "
|
|
1803
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1804
|
+
/** {@link Disposable.onDisposed} */
|
|
1805
|
+
readonly onDisposed: Event<string>;
|
|
1854
1806
|
/**
|
|
1855
|
-
* Event triggered when
|
|
1856
|
-
* Contains the streamed geometry data and its buffer.
|
|
1807
|
+
* Event triggered when a file is requested for export.
|
|
1857
1808
|
*/
|
|
1858
|
-
readonly
|
|
1859
|
-
|
|
1860
|
-
|
|
1809
|
+
readonly onRequestFile: Event<unknown>;
|
|
1810
|
+
/**
|
|
1811
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1812
|
+
*/
|
|
1813
|
+
ifcToExport: ArrayBuffer | null;
|
|
1814
|
+
/**
|
|
1815
|
+
* Event triggered when an element is added to a Pset.
|
|
1816
|
+
*/
|
|
1817
|
+
readonly onElementToPset: Event<{
|
|
1818
|
+
model: FragmentsGroup;
|
|
1819
|
+
psetID: number;
|
|
1820
|
+
elementID: number;
|
|
1861
1821
|
}>;
|
|
1862
1822
|
/**
|
|
1863
|
-
* Event triggered when
|
|
1864
|
-
* Contains the streamed assets.
|
|
1823
|
+
* Event triggered when a property is added to a Pset.
|
|
1865
1824
|
*/
|
|
1866
|
-
readonly
|
|
1825
|
+
readonly onPropToPset: Event<{
|
|
1826
|
+
model: FragmentsGroup;
|
|
1827
|
+
psetID: number;
|
|
1828
|
+
propID: number;
|
|
1829
|
+
}>;
|
|
1867
1830
|
/**
|
|
1868
|
-
* Event triggered
|
|
1869
|
-
* Contains the progress percentage.
|
|
1831
|
+
* Event triggered when a Pset is removed.
|
|
1870
1832
|
*/
|
|
1871
|
-
readonly
|
|
1833
|
+
readonly onPsetRemoved: Event<{
|
|
1834
|
+
model: FragmentsGroup;
|
|
1835
|
+
psetID: number;
|
|
1836
|
+
}>;
|
|
1872
1837
|
/**
|
|
1873
|
-
* Event triggered when
|
|
1874
|
-
* Contains the loaded IFC file data.
|
|
1838
|
+
* Event triggered when data in the model changes.
|
|
1875
1839
|
*/
|
|
1876
|
-
readonly
|
|
1877
|
-
|
|
1878
|
-
|
|
1840
|
+
readonly onDataChanged: Event<{
|
|
1841
|
+
model: FragmentsGroup;
|
|
1842
|
+
expressID: number;
|
|
1843
|
+
}>;
|
|
1879
1844
|
/**
|
|
1880
|
-
*
|
|
1845
|
+
* Configuration for the WebAssembly module.
|
|
1881
1846
|
*/
|
|
1882
|
-
|
|
1847
|
+
wasm: {
|
|
1848
|
+
path: string;
|
|
1849
|
+
absolute: boolean;
|
|
1850
|
+
};
|
|
1883
1851
|
/** {@link Component.enabled} */
|
|
1884
1852
|
enabled: boolean;
|
|
1885
1853
|
/**
|
|
1886
|
-
*
|
|
1854
|
+
* Map of attribute listeners.
|
|
1855
|
+
*/
|
|
1856
|
+
attributeListeners: AttributeListener;
|
|
1857
|
+
/**
|
|
1858
|
+
* The currently selected model.
|
|
1859
|
+
*/
|
|
1860
|
+
selectedModel?: FragmentsGroup;
|
|
1861
|
+
/**
|
|
1862
|
+
* Map of changed entities in the model.
|
|
1887
1863
|
*/
|
|
1888
|
-
|
|
1889
|
-
private _spatialTree;
|
|
1890
|
-
private _metaData;
|
|
1891
|
-
private _visitedGeometries;
|
|
1892
|
-
private _streamSerializer;
|
|
1893
|
-
private _geometries;
|
|
1894
|
-
private _geometryCount;
|
|
1895
|
-
private _civil;
|
|
1896
|
-
private _groupSerializer;
|
|
1897
|
-
private _assets;
|
|
1898
|
-
private _meshesWithHoles;
|
|
1864
|
+
changeMap: ChangeMap;
|
|
1899
1865
|
constructor(components: Components);
|
|
1900
1866
|
/** {@link Disposable.dispose} */
|
|
1901
1867
|
dispose(): void;
|
|
1902
1868
|
/**
|
|
1903
|
-
*
|
|
1869
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
1904
1870
|
*
|
|
1905
|
-
* @param
|
|
1906
|
-
* @
|
|
1871
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1872
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1873
|
+
* @returns The IFC schema associated with the given model.
|
|
1874
|
+
*/
|
|
1875
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1876
|
+
/**
|
|
1877
|
+
* Method to set properties data in the model.
|
|
1907
1878
|
*
|
|
1908
|
-
* @
|
|
1909
|
-
*
|
|
1879
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1880
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1881
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1882
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
1910
1883
|
*
|
|
1911
|
-
* @
|
|
1912
|
-
*
|
|
1913
|
-
*
|
|
1914
|
-
* const rawBuffer = await response.arrayBuffer();
|
|
1915
|
-
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1916
|
-
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1917
|
-
* '''
|
|
1884
|
+
* @returns A promise that resolves when all the properties have been set.
|
|
1885
|
+
*
|
|
1886
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
1918
1887
|
*/
|
|
1919
|
-
|
|
1888
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
1920
1889
|
/**
|
|
1921
|
-
*
|
|
1890
|
+
* Creates a new Property Set (Pset) in the given model.
|
|
1922
1891
|
*
|
|
1923
|
-
* @param
|
|
1924
|
-
* @
|
|
1892
|
+
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
1893
|
+
* @param name - The name of the Pset.
|
|
1894
|
+
* @param description - (Optional) The description of the Pset.
|
|
1925
1895
|
*
|
|
1926
|
-
* @
|
|
1927
|
-
* This method cleans up any resources after the streaming process is complete.
|
|
1896
|
+
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
1928
1897
|
*
|
|
1898
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1899
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1929
1900
|
*/
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
private cleanUp;
|
|
1935
|
-
private getMesh;
|
|
1936
|
-
private getGeometry;
|
|
1937
|
-
private streamAssets;
|
|
1938
|
-
private streamGeometries;
|
|
1939
|
-
}
|
|
1940
|
-
import * as WEBIFC from "web-ifc";
|
|
1941
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1942
|
-
import { PropertiesStreamingSettings } from "./src";
|
|
1943
|
-
/**
|
|
1944
|
-
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1945
|
-
*/
|
|
1946
|
-
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1901
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
1902
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
1903
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
1904
|
+
}>;
|
|
1947
1905
|
/**
|
|
1948
|
-
*
|
|
1949
|
-
*
|
|
1906
|
+
* Removes a Property Set (Pset) from the given model.
|
|
1907
|
+
*
|
|
1908
|
+
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1909
|
+
* @param psetID - The express IDs of the Psets to be removed.
|
|
1910
|
+
*
|
|
1911
|
+
* @returns A promise that resolves when all the Psets have been removed.
|
|
1912
|
+
*
|
|
1913
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1914
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1915
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1950
1916
|
*/
|
|
1951
|
-
|
|
1917
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
1952
1918
|
/**
|
|
1953
|
-
*
|
|
1954
|
-
*
|
|
1919
|
+
* Creates a new single-value property of type string in the given model.
|
|
1920
|
+
*
|
|
1921
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1922
|
+
* @param type - The type of the property value. Must be a string property type.
|
|
1923
|
+
* @param name - The name of the property.
|
|
1924
|
+
* @param value - The value of the property. Must be a string.
|
|
1925
|
+
*
|
|
1926
|
+
* @returns The newly created single-value property.
|
|
1927
|
+
*
|
|
1928
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1929
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1955
1930
|
*/
|
|
1956
|
-
|
|
1957
|
-
type: number;
|
|
1958
|
-
data: {
|
|
1959
|
-
[id: number]: any;
|
|
1960
|
-
};
|
|
1961
|
-
}>;
|
|
1931
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1962
1932
|
/**
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1933
|
+
* Creates a new single-value property of type numeric in the given model.
|
|
1934
|
+
*
|
|
1935
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1936
|
+
* @param type - The type of the property value. Must be a numeric property type.
|
|
1937
|
+
* @param name - The name of the property.
|
|
1938
|
+
* @param value - The value of the property. Must be a number.
|
|
1939
|
+
*
|
|
1940
|
+
* @returns The newly created single-value property.
|
|
1941
|
+
*
|
|
1942
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1943
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1965
1944
|
*/
|
|
1966
|
-
|
|
1945
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1967
1946
|
/**
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1947
|
+
* Creates a new single-value property of type boolean in the given model.
|
|
1948
|
+
*
|
|
1949
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1950
|
+
* @param type - The type of the property value. Must be a boolean property type.
|
|
1951
|
+
* @param name - The name of the property.
|
|
1952
|
+
* @param value - The value of the property. Must be a boolean.
|
|
1953
|
+
*
|
|
1954
|
+
* @returns The newly created single-value property.
|
|
1955
|
+
*
|
|
1956
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1957
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1970
1958
|
*/
|
|
1971
|
-
|
|
1972
|
-
/** {@link Disposable.onDisposed} */
|
|
1973
|
-
readonly onDisposed: Event<string>;
|
|
1974
|
-
/** {@link Component.enabled} */
|
|
1975
|
-
enabled: boolean;
|
|
1959
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1976
1960
|
/**
|
|
1977
|
-
*
|
|
1961
|
+
* Removes a property from a Property Set (Pset) in the given model.
|
|
1962
|
+
*
|
|
1963
|
+
* @param model - The FragmentsGroup model from which to remove the property.
|
|
1964
|
+
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1965
|
+
* @param propID - The express ID of the property to be removed.
|
|
1966
|
+
*
|
|
1967
|
+
* @returns A promise that resolves when the property has been removed.
|
|
1968
|
+
*
|
|
1969
|
+
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
1970
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1978
1971
|
*/
|
|
1979
|
-
|
|
1972
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
1973
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
1980
1974
|
/**
|
|
1981
|
-
*
|
|
1975
|
+
* Adds elements to a Property Set (Pset) in the given model.
|
|
1976
|
+
*
|
|
1977
|
+
* @param model - The FragmentsGroup model in which to add the elements.
|
|
1978
|
+
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
1979
|
+
* @param elementID - The express IDs of the elements to be added.
|
|
1980
|
+
*
|
|
1981
|
+
* @returns A promise that resolves when all the elements have been added.
|
|
1982
|
+
*
|
|
1983
|
+
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
1984
|
+
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
1985
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1982
1986
|
*/
|
|
1983
|
-
|
|
1984
|
-
/** {@link Disposable.dispose} */
|
|
1985
|
-
dispose(): Promise<void>;
|
|
1987
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
1986
1988
|
/**
|
|
1987
|
-
*
|
|
1989
|
+
* Saves the changes made to the model to a new IFC file.
|
|
1988
1990
|
*
|
|
1989
|
-
* @param
|
|
1990
|
-
* @
|
|
1991
|
+
* @param model - The FragmentsGroup model from which to save the changes.
|
|
1992
|
+
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1993
|
+
*
|
|
1994
|
+
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1995
|
+
*
|
|
1996
|
+
* @throws Will throw an error if any issues occur during the saving process.
|
|
1991
1997
|
*/
|
|
1992
|
-
|
|
1998
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
1993
1999
|
/**
|
|
1994
|
-
*
|
|
2000
|
+
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
2001
|
+
* The listener will trigger an event whenever the attribute's value changes.
|
|
1995
2002
|
*
|
|
1996
|
-
* @param
|
|
1997
|
-
* @
|
|
2003
|
+
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
2004
|
+
* @param expressID - The express ID of the entity for which to set the listener.
|
|
2005
|
+
* @param attributeName - The name of the attribute for which to set the listener.
|
|
2006
|
+
*
|
|
2007
|
+
* @returns The event that will be triggered when the attribute's value changes.
|
|
2008
|
+
*
|
|
2009
|
+
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
2010
|
+
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
2011
|
+
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1998
2012
|
*/
|
|
1999
|
-
|
|
2000
|
-
private
|
|
2001
|
-
private
|
|
2002
|
-
private
|
|
2003
|
-
private
|
|
2013
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
2014
|
+
private increaseMaxID;
|
|
2015
|
+
private newGUID;
|
|
2016
|
+
private getOwnerHistory;
|
|
2017
|
+
private registerChange;
|
|
2018
|
+
private newSingleProperty;
|
|
2004
2019
|
}
|
|
2005
2020
|
import * as THREE from "three";
|
|
2006
2021
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -2090,76 +2105,64 @@ export declare class MeasurementUtils extends Component {
|
|
|
2090
2105
|
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
2091
2106
|
* @throws Will throw an error if the fragment manager is not available.
|
|
2092
2107
|
*/
|
|
2093
|
-
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
2108
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
2109
|
+
/**
|
|
2110
|
+
* Calculates the total volume of a set of meshes.
|
|
2111
|
+
*
|
|
2112
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
2113
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
2114
|
+
*
|
|
2115
|
+
* @remarks
|
|
2116
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
2117
|
+
* and its bounding sphere.
|
|
2118
|
+
*
|
|
2119
|
+
*/
|
|
2120
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
2121
|
+
private getFaceData;
|
|
2122
|
+
private getVolumeOfMesh;
|
|
2123
|
+
private getSignedVolumeOfTriangle;
|
|
2124
|
+
}
|
|
2125
|
+
import * as WEBIFC from "web-ifc";
|
|
2126
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2127
|
+
export declare class IfcFragmentSettings {
|
|
2128
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2129
|
+
includeProperties: boolean;
|
|
2130
|
+
/**
|
|
2131
|
+
* Generate the geometry for categories that are not included by default,
|
|
2132
|
+
* like IFCSPACE.
|
|
2133
|
+
*/
|
|
2134
|
+
optionalCategories: number[];
|
|
2135
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2136
|
+
coordinate: boolean;
|
|
2137
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2138
|
+
wasm: {
|
|
2139
|
+
path: string;
|
|
2140
|
+
absolute: boolean;
|
|
2141
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2142
|
+
};
|
|
2143
|
+
/** List of categories that won't be converted to fragments. */
|
|
2144
|
+
excludedCategories: Set<number>;
|
|
2145
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2146
|
+
saveLocations: boolean;
|
|
2147
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2148
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2149
|
+
/**
|
|
2150
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2151
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2152
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2153
|
+
* Default value is true.
|
|
2154
|
+
*/
|
|
2155
|
+
autoSetWasm: boolean;
|
|
2094
2156
|
/**
|
|
2095
|
-
*
|
|
2096
|
-
*
|
|
2097
|
-
*
|
|
2098
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
2099
|
-
*
|
|
2100
|
-
* @remarks
|
|
2101
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
2102
|
-
* and its bounding sphere.
|
|
2157
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2158
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2159
|
+
* If set to null, the default file location handler will be used.
|
|
2103
2160
|
*
|
|
2161
|
+
* @param url - The URL of the file to locate.
|
|
2162
|
+
* @returns The absolute path of the file.
|
|
2104
2163
|
*/
|
|
2105
|
-
|
|
2106
|
-
private getFaceData;
|
|
2107
|
-
private getVolumeOfMesh;
|
|
2108
|
-
private getSignedVolumeOfTriangle;
|
|
2109
|
-
}
|
|
2110
|
-
import * as WEBIFC from "web-ifc";
|
|
2111
|
-
export interface IfcItemsCategories {
|
|
2112
|
-
[itemID: number]: number;
|
|
2113
|
-
}
|
|
2114
|
-
export declare class IfcCategories {
|
|
2115
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2116
|
-
}
|
|
2117
|
-
/**
|
|
2118
|
-
* 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.
|
|
2119
|
-
*
|
|
2120
|
-
* @remarks
|
|
2121
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2122
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2123
|
-
*
|
|
2124
|
-
*/
|
|
2125
|
-
export declare const IfcElements: {
|
|
2126
|
-
[key: number]: string;
|
|
2127
|
-
};
|
|
2128
|
-
/**
|
|
2129
|
-
* 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.
|
|
2130
|
-
*/
|
|
2131
|
-
export declare const IfcCategoryMap: {
|
|
2132
|
-
[key: number]: string;
|
|
2133
|
-
};
|
|
2134
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2135
|
-
export declare class IfcPropertiesUtils {
|
|
2136
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2137
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2138
|
-
[attribute: string]: any;
|
|
2139
|
-
} | null>;
|
|
2140
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2141
|
-
[relatingID: number]: number[];
|
|
2142
|
-
}>;
|
|
2143
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2144
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2145
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2146
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2147
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2148
|
-
key: string | null;
|
|
2149
|
-
name: string | null;
|
|
2150
|
-
}>;
|
|
2151
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2152
|
-
key: string | null;
|
|
2153
|
-
value: number | null;
|
|
2154
|
-
}>;
|
|
2155
|
-
static isRel(expressID: number): boolean;
|
|
2156
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2157
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2164
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2158
2165
|
}
|
|
2159
|
-
/**
|
|
2160
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2161
|
-
*/
|
|
2162
|
-
export declare const GeometryTypes: Set<number>;
|
|
2163
2166
|
import * as THREE from "three";
|
|
2164
2167
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2165
2168
|
/**
|
|
@@ -2249,51 +2252,12 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2249
2252
|
resize(size?: THREE.Vector2): void;
|
|
2250
2253
|
private updatePlanes;
|
|
2251
2254
|
}
|
|
2252
|
-
import { InverseAttribute } from "./types";
|
|
2253
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2254
|
-
forRelating: InverseAttribute;
|
|
2255
|
-
forRelated: InverseAttribute;
|
|
2256
|
-
}>;
|
|
2257
2255
|
import * as WEBIFC from "web-ifc";
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
* Generate the geometry for categories that are not included by default,
|
|
2264
|
-
* like IFCSPACE.
|
|
2265
|
-
*/
|
|
2266
|
-
optionalCategories: number[];
|
|
2267
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
2268
|
-
coordinate: boolean;
|
|
2269
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2270
|
-
wasm: {
|
|
2271
|
-
path: string;
|
|
2272
|
-
absolute: boolean;
|
|
2273
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2274
|
-
};
|
|
2275
|
-
/** List of categories that won't be converted to fragments. */
|
|
2276
|
-
excludedCategories: Set<number>;
|
|
2277
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
2278
|
-
saveLocations: boolean;
|
|
2279
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2280
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
2281
|
-
/**
|
|
2282
|
-
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2283
|
-
* If set to true, the path will be set to the default path of the WASM file.
|
|
2284
|
-
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2285
|
-
* Default value is true.
|
|
2286
|
-
*/
|
|
2287
|
-
autoSetWasm: boolean;
|
|
2288
|
-
/**
|
|
2289
|
-
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2290
|
-
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2291
|
-
* If set to null, the default file location handler will be used.
|
|
2292
|
-
*
|
|
2293
|
-
* @param url - The URL of the file to locate.
|
|
2294
|
-
* @returns The absolute path of the file.
|
|
2295
|
-
*/
|
|
2296
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2256
|
+
export interface IfcItemsCategories {
|
|
2257
|
+
[itemID: number]: number;
|
|
2258
|
+
}
|
|
2259
|
+
export declare class IfcCategories {
|
|
2260
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2297
2261
|
}
|
|
2298
2262
|
import * as WEBIFC from "web-ifc";
|
|
2299
2263
|
import { IfcItemsCategories } from "../../../ifc";
|
|
@@ -2303,6 +2267,107 @@ export declare class SpatialStructure {
|
|
|
2303
2267
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2304
2268
|
cleanUp(): void;
|
|
2305
2269
|
}
|
|
2270
|
+
/**
|
|
2271
|
+
* 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.
|
|
2272
|
+
*/
|
|
2273
|
+
export declare const IfcCategoryMap: {
|
|
2274
|
+
[key: number]: string;
|
|
2275
|
+
};
|
|
2276
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2277
|
+
export declare class IfcPropertiesUtils {
|
|
2278
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2279
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2280
|
+
[attribute: string]: any;
|
|
2281
|
+
} | null>;
|
|
2282
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2283
|
+
[relatingID: number]: number[];
|
|
2284
|
+
}>;
|
|
2285
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2286
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2287
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2288
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2289
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2290
|
+
key: string | null;
|
|
2291
|
+
name: string | null;
|
|
2292
|
+
}>;
|
|
2293
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2294
|
+
key: string | null;
|
|
2295
|
+
value: number | null;
|
|
2296
|
+
}>;
|
|
2297
|
+
static isRel(expressID: number): boolean;
|
|
2298
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2299
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* 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.
|
|
2303
|
+
*
|
|
2304
|
+
* @remarks
|
|
2305
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2306
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2307
|
+
*
|
|
2308
|
+
*/
|
|
2309
|
+
export declare const IfcElements: {
|
|
2310
|
+
[key: number]: string;
|
|
2311
|
+
};
|
|
2312
|
+
import * as THREE from "three";
|
|
2313
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2314
|
+
import { Components } from "../../Components";
|
|
2315
|
+
/**
|
|
2316
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
2317
|
+
*/
|
|
2318
|
+
export interface GridConfig {
|
|
2319
|
+
/**
|
|
2320
|
+
* The color of the grid lines.
|
|
2321
|
+
*/
|
|
2322
|
+
color: THREE.Color;
|
|
2323
|
+
/**
|
|
2324
|
+
* The size of the primary grid lines.
|
|
2325
|
+
*/
|
|
2326
|
+
size1: number;
|
|
2327
|
+
/**
|
|
2328
|
+
* The size of the secondary grid lines.
|
|
2329
|
+
*/
|
|
2330
|
+
size2: number;
|
|
2331
|
+
/**
|
|
2332
|
+
* The distance at which the grid lines start to fade away.
|
|
2333
|
+
*/
|
|
2334
|
+
distance: number;
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* 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).
|
|
2338
|
+
*/
|
|
2339
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2340
|
+
/** {@link Disposable.onDisposed} */
|
|
2341
|
+
readonly onDisposed: Event<unknown>;
|
|
2342
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2343
|
+
world: World;
|
|
2344
|
+
/** The components instance to which this grid belongs. */
|
|
2345
|
+
components: Components;
|
|
2346
|
+
/** {@link Hideable.visible} */
|
|
2347
|
+
get visible(): boolean;
|
|
2348
|
+
/** {@link Hideable.visible} */
|
|
2349
|
+
set visible(visible: boolean);
|
|
2350
|
+
/** The material of the grid. */
|
|
2351
|
+
get material(): THREE.ShaderMaterial;
|
|
2352
|
+
/**
|
|
2353
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2354
|
+
* perspective cameras and false for orthographic cameras.
|
|
2355
|
+
*/
|
|
2356
|
+
get fade(): boolean;
|
|
2357
|
+
/**
|
|
2358
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2359
|
+
* perspective cameras and false for orthographic cameras.
|
|
2360
|
+
*/
|
|
2361
|
+
set fade(active: boolean);
|
|
2362
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2363
|
+
readonly three: THREE.Mesh;
|
|
2364
|
+
private _fade;
|
|
2365
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2366
|
+
/** {@link Disposable.dispose} */
|
|
2367
|
+
dispose(): void;
|
|
2368
|
+
private setupEvents;
|
|
2369
|
+
private updateZoom;
|
|
2370
|
+
}
|
|
2306
2371
|
/**
|
|
2307
2372
|
* 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.
|
|
2308
2373
|
*/
|
|
@@ -2314,19 +2379,47 @@ export declare class AsyncEvent<T> {
|
|
|
2314
2379
|
add(handler: T extends void ? {
|
|
2315
2380
|
(): Promise<void>;
|
|
2316
2381
|
} : {
|
|
2317
|
-
(data: T): Promise<void>;
|
|
2382
|
+
(data: T): Promise<void>;
|
|
2383
|
+
}): void;
|
|
2384
|
+
/**
|
|
2385
|
+
* Removes a callback from this event instance.
|
|
2386
|
+
* @param handler - the callback to be removed from this event.
|
|
2387
|
+
*/
|
|
2388
|
+
remove(handler: T extends void ? {
|
|
2389
|
+
(): Promise<void>;
|
|
2390
|
+
} : {
|
|
2391
|
+
(data: T): Promise<void>;
|
|
2392
|
+
}): void;
|
|
2393
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2394
|
+
trigger: (data?: T) => Promise<void>;
|
|
2395
|
+
/** Gets rid of all the suscribed events. */
|
|
2396
|
+
reset(): void;
|
|
2397
|
+
private handlers;
|
|
2398
|
+
}
|
|
2399
|
+
/**
|
|
2400
|
+
* 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.
|
|
2401
|
+
*/
|
|
2402
|
+
export declare class Event<T> {
|
|
2403
|
+
/**
|
|
2404
|
+
* Add a callback to this event instance.
|
|
2405
|
+
* @param handler - the callback to be added to this event.
|
|
2406
|
+
*/
|
|
2407
|
+
add(handler: T extends void ? {
|
|
2408
|
+
(): void;
|
|
2409
|
+
} : {
|
|
2410
|
+
(data: T): void;
|
|
2318
2411
|
}): void;
|
|
2319
2412
|
/**
|
|
2320
2413
|
* Removes a callback from this event instance.
|
|
2321
2414
|
* @param handler - the callback to be removed from this event.
|
|
2322
2415
|
*/
|
|
2323
2416
|
remove(handler: T extends void ? {
|
|
2324
|
-
():
|
|
2417
|
+
(): void;
|
|
2325
2418
|
} : {
|
|
2326
|
-
(data: T):
|
|
2419
|
+
(data: T): void;
|
|
2327
2420
|
}): void;
|
|
2328
2421
|
/** Triggers all the callbacks assigned to this event. */
|
|
2329
|
-
trigger: (data?: T) =>
|
|
2422
|
+
trigger: (data?: T) => void;
|
|
2330
2423
|
/** Gets rid of all the suscribed events. */
|
|
2331
2424
|
reset(): void;
|
|
2332
2425
|
private handlers;
|
|
@@ -2452,6 +2545,10 @@ export declare abstract class Component extends Base {
|
|
|
2452
2545
|
*/
|
|
2453
2546
|
abstract enabled: boolean;
|
|
2454
2547
|
}
|
|
2548
|
+
/**
|
|
2549
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2550
|
+
*/
|
|
2551
|
+
export declare const GeometryTypes: Set<number>;
|
|
2455
2552
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2456
2553
|
import { Components } from "../../Components";
|
|
2457
2554
|
/**
|
|
@@ -2471,6 +2568,11 @@ export declare abstract class Base {
|
|
|
2471
2568
|
/** Whether is component is {@link Configurable}. */
|
|
2472
2569
|
isConfigurable: () => this is Configurable<any>;
|
|
2473
2570
|
}
|
|
2571
|
+
import { InverseAttribute } from "./types";
|
|
2572
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2573
|
+
forRelating: InverseAttribute;
|
|
2574
|
+
forRelated: InverseAttribute;
|
|
2575
|
+
}>;
|
|
2474
2576
|
import { Base } from "./base";
|
|
2475
2577
|
import { World } from "./world";
|
|
2476
2578
|
import { Event } from "./event";
|
|
@@ -2732,7 +2834,6 @@ export declare class CullerRenderer {
|
|
|
2732
2834
|
protected decreaseColor(): void;
|
|
2733
2835
|
private applySettings;
|
|
2734
2836
|
}
|
|
2735
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2736
2837
|
import * as THREE from "three";
|
|
2737
2838
|
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2738
2839
|
import { Components } from "../../Components";
|
|
@@ -2789,6 +2890,30 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
2789
2890
|
private handleWorkerMessage;
|
|
2790
2891
|
private getAvailableMaterial;
|
|
2791
2892
|
}
|
|
2893
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2894
|
+
import * as THREE from "three";
|
|
2895
|
+
import { Disposable, Event } from "../../Types";
|
|
2896
|
+
/**
|
|
2897
|
+
* 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.
|
|
2898
|
+
*/
|
|
2899
|
+
export declare class Mouse implements Disposable {
|
|
2900
|
+
dom: HTMLCanvasElement;
|
|
2901
|
+
private _event?;
|
|
2902
|
+
private _position;
|
|
2903
|
+
/** {@link Disposable.onDisposed} */
|
|
2904
|
+
readonly onDisposed: Event<unknown>;
|
|
2905
|
+
constructor(dom: HTMLCanvasElement);
|
|
2906
|
+
/**
|
|
2907
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2908
|
+
*/
|
|
2909
|
+
get position(): THREE.Vector2;
|
|
2910
|
+
/** {@link Disposable.dispose} */
|
|
2911
|
+
dispose(): void;
|
|
2912
|
+
private getPositionY;
|
|
2913
|
+
private getPositionX;
|
|
2914
|
+
private updateMouseInfo;
|
|
2915
|
+
private setupEvents;
|
|
2916
|
+
}
|
|
2792
2917
|
import * as THREE from "three";
|
|
2793
2918
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2794
2919
|
/**
|
|
@@ -2869,6 +2994,58 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
2869
2994
|
dispose(disposeResources?: boolean): void;
|
|
2870
2995
|
}
|
|
2871
2996
|
import * as THREE from "three";
|
|
2997
|
+
import { Components } from "../../Components";
|
|
2998
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2999
|
+
import { Mouse } from "./mouse";
|
|
3000
|
+
/**
|
|
3001
|
+
* 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.
|
|
3002
|
+
*/
|
|
3003
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
3004
|
+
/** {@link Component.enabled} */
|
|
3005
|
+
enabled: boolean;
|
|
3006
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3007
|
+
components: Components;
|
|
3008
|
+
/** {@link Disposable.onDisposed} */
|
|
3009
|
+
readonly onDisposed: Event<unknown>;
|
|
3010
|
+
/** The position of the mouse in the screen. */
|
|
3011
|
+
readonly mouse: Mouse;
|
|
3012
|
+
/**
|
|
3013
|
+
* A reference to the Three.js Raycaster instance.
|
|
3014
|
+
* This is used for raycasting operations.
|
|
3015
|
+
*/
|
|
3016
|
+
readonly three: THREE.Raycaster;
|
|
3017
|
+
/**
|
|
3018
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3019
|
+
* This is used to access the camera and meshes.
|
|
3020
|
+
*/
|
|
3021
|
+
world: World;
|
|
3022
|
+
constructor(components: Components, world: World);
|
|
3023
|
+
/** {@link Disposable.dispose} */
|
|
3024
|
+
dispose(): void;
|
|
3025
|
+
/**
|
|
3026
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3027
|
+
* the first item found. This also takes into account the clipping planes
|
|
3028
|
+
* used by the renderer.
|
|
3029
|
+
*
|
|
3030
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3031
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3032
|
+
* {@link Components.meshes}.
|
|
3033
|
+
*/
|
|
3034
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3035
|
+
/**
|
|
3036
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3037
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
3038
|
+
*
|
|
3039
|
+
* @param origin - The origin of the ray.
|
|
3040
|
+
* @param direction - The direction of the ray.
|
|
3041
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3042
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3043
|
+
*/
|
|
3044
|
+
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;
|
|
3045
|
+
private intersect;
|
|
3046
|
+
private filterClippingPlanes;
|
|
3047
|
+
}
|
|
3048
|
+
import * as THREE from "three";
|
|
2872
3049
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2873
3050
|
import { Components } from "../../Components";
|
|
2874
3051
|
/**
|
|
@@ -2939,267 +3116,89 @@ export declare class SimpleRenderer extends BaseRenderer {
|
|
|
2939
3116
|
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2940
3117
|
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2941
3118
|
*/
|
|
2942
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2943
|
-
/** {@link Updateable.update} */
|
|
2944
|
-
update(): void;
|
|
2945
|
-
/** {@link Disposable.dispose} */
|
|
2946
|
-
dispose(): void;
|
|
2947
|
-
/** {@link Resizeable.getSize}. */
|
|
2948
|
-
getSize(): THREE.Vector2;
|
|
2949
|
-
/** {@link Resizeable.resize} */
|
|
2950
|
-
resize: (size?: THREE.Vector2) => void;
|
|
2951
|
-
/**
|
|
2952
|
-
* Sets up and manages the event listeners for the renderer.
|
|
2953
|
-
*
|
|
2954
|
-
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2955
|
-
*
|
|
2956
|
-
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2957
|
-
*/
|
|
2958
|
-
setupEvents(active: boolean): void;
|
|
2959
|
-
private resizeEvent;
|
|
2960
|
-
private setupRenderer;
|
|
2961
|
-
private onContextLost;
|
|
2962
|
-
private onContextBack;
|
|
2963
|
-
}
|
|
2964
|
-
/**
|
|
2965
|
-
* 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.
|
|
2966
|
-
*/
|
|
2967
|
-
export declare class Event<T> {
|
|
2968
|
-
/**
|
|
2969
|
-
* Add a callback to this event instance.
|
|
2970
|
-
* @param handler - the callback to be added to this event.
|
|
2971
|
-
*/
|
|
2972
|
-
add(handler: T extends void ? {
|
|
2973
|
-
(): void;
|
|
2974
|
-
} : {
|
|
2975
|
-
(data: T): void;
|
|
2976
|
-
}): void;
|
|
2977
|
-
/**
|
|
2978
|
-
* Removes a callback from this event instance.
|
|
2979
|
-
* @param handler - the callback to be removed from this event.
|
|
2980
|
-
*/
|
|
2981
|
-
remove(handler: T extends void ? {
|
|
2982
|
-
(): void;
|
|
2983
|
-
} : {
|
|
2984
|
-
(data: T): void;
|
|
2985
|
-
}): void;
|
|
2986
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2987
|
-
trigger: (data?: T) => void;
|
|
2988
|
-
/** Gets rid of all the suscribed events. */
|
|
2989
|
-
reset(): void;
|
|
2990
|
-
private handlers;
|
|
2991
|
-
}
|
|
2992
|
-
import * as THREE from "three";
|
|
2993
|
-
import CameraControls from "camera-controls";
|
|
2994
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2995
|
-
import { Components } from "../../Components";
|
|
2996
|
-
/**
|
|
2997
|
-
* 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.
|
|
2998
|
-
*/
|
|
2999
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3000
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
3001
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3002
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
3003
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3004
|
-
/**
|
|
3005
|
-
* Event that is triggered when the aspect of the camera has been updated.
|
|
3006
|
-
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3007
|
-
*/
|
|
3008
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
3009
|
-
/** {@link Disposable.onDisposed} */
|
|
3010
|
-
readonly onDisposed: Event<string>;
|
|
3011
|
-
/**
|
|
3012
|
-
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3013
|
-
* This camera is used for rendering the scene.
|
|
3014
|
-
*/
|
|
3015
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3016
|
-
private _allControls;
|
|
3017
|
-
/**
|
|
3018
|
-
* The object that controls the camera. An instance of
|
|
3019
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3020
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
3021
|
-
* object to move, rotate, look at objects, etc.
|
|
3022
|
-
*/
|
|
3023
|
-
get controls(): CameraControls;
|
|
3024
|
-
/**
|
|
3025
|
-
* Getter for the enabled state of the camera controls.
|
|
3026
|
-
* If the current world is null, it returns false.
|
|
3027
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
3028
|
-
*
|
|
3029
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
3030
|
-
*/
|
|
3031
|
-
get enabled(): boolean;
|
|
3032
|
-
/**
|
|
3033
|
-
* Setter for the enabled state of the camera controls.
|
|
3034
|
-
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3035
|
-
*
|
|
3036
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3037
|
-
*/
|
|
3038
|
-
set enabled(enabled: boolean);
|
|
3039
|
-
constructor(components: Components);
|
|
3040
|
-
/** {@link Disposable.dispose} */
|
|
3041
|
-
dispose(): void;
|
|
3042
|
-
/** {@link Updateable.update} */
|
|
3043
|
-
update(_delta: number): void;
|
|
3044
|
-
/**
|
|
3045
|
-
* Updates the aspect of the camera to match the size of the
|
|
3046
|
-
* {@link Components.renderer}.
|
|
3047
|
-
*/
|
|
3048
|
-
updateAspect: () => void;
|
|
3049
|
-
private setupCamera;
|
|
3050
|
-
private newCameraControls;
|
|
3051
|
-
private setupEvents;
|
|
3052
|
-
private static getSubsetOfThree;
|
|
3053
|
-
}
|
|
3054
|
-
import * as THREE from "three";
|
|
3055
|
-
import { Disposable, Event } from "../../Types";
|
|
3056
|
-
/**
|
|
3057
|
-
* 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.
|
|
3058
|
-
*/
|
|
3059
|
-
export declare class Mouse implements Disposable {
|
|
3060
|
-
dom: HTMLCanvasElement;
|
|
3061
|
-
private _event?;
|
|
3062
|
-
private _position;
|
|
3063
|
-
/** {@link Disposable.onDisposed} */
|
|
3064
|
-
readonly onDisposed: Event<unknown>;
|
|
3065
|
-
constructor(dom: HTMLCanvasElement);
|
|
3066
|
-
/**
|
|
3067
|
-
* The real position of the mouse of the Three.js canvas.
|
|
3068
|
-
*/
|
|
3069
|
-
get position(): THREE.Vector2;
|
|
3070
|
-
/** {@link Disposable.dispose} */
|
|
3071
|
-
dispose(): void;
|
|
3072
|
-
private getPositionY;
|
|
3073
|
-
private getPositionX;
|
|
3074
|
-
private updateMouseInfo;
|
|
3075
|
-
private setupEvents;
|
|
3076
|
-
}
|
|
3077
|
-
import * as THREE from "three";
|
|
3078
|
-
import { Components } from "../../Components";
|
|
3079
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3080
|
-
import { Mouse } from "./mouse";
|
|
3081
|
-
/**
|
|
3082
|
-
* 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.
|
|
3083
|
-
*/
|
|
3084
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
3085
|
-
/** {@link Component.enabled} */
|
|
3086
|
-
enabled: boolean;
|
|
3087
|
-
/** The components instance to which this Raycaster belongs. */
|
|
3088
|
-
components: Components;
|
|
3089
|
-
/** {@link Disposable.onDisposed} */
|
|
3090
|
-
readonly onDisposed: Event<unknown>;
|
|
3091
|
-
/** The position of the mouse in the screen. */
|
|
3092
|
-
readonly mouse: Mouse;
|
|
3093
|
-
/**
|
|
3094
|
-
* A reference to the Three.js Raycaster instance.
|
|
3095
|
-
* This is used for raycasting operations.
|
|
3096
|
-
*/
|
|
3097
|
-
readonly three: THREE.Raycaster;
|
|
3098
|
-
/**
|
|
3099
|
-
* A reference to the world instance to which this Raycaster belongs.
|
|
3100
|
-
* This is used to access the camera and meshes.
|
|
3101
|
-
*/
|
|
3102
|
-
world: World;
|
|
3103
|
-
constructor(components: Components, world: World);
|
|
3119
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3120
|
+
/** {@link Updateable.update} */
|
|
3121
|
+
update(): void;
|
|
3104
3122
|
/** {@link Disposable.dispose} */
|
|
3105
3123
|
dispose(): void;
|
|
3124
|
+
/** {@link Resizeable.getSize}. */
|
|
3125
|
+
getSize(): THREE.Vector2;
|
|
3126
|
+
/** {@link Resizeable.resize} */
|
|
3127
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3106
3128
|
/**
|
|
3107
|
-
*
|
|
3108
|
-
* the first item found. This also takes into account the clipping planes
|
|
3109
|
-
* used by the renderer.
|
|
3129
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3110
3130
|
*
|
|
3111
|
-
* @param
|
|
3112
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
3113
|
-
* {@link Components.meshes}.
|
|
3114
|
-
*/
|
|
3115
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3116
|
-
/**
|
|
3117
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3118
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
3131
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3119
3132
|
*
|
|
3120
|
-
* @
|
|
3121
|
-
* @param direction - The direction of the ray.
|
|
3122
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3123
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3133
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3124
3134
|
*/
|
|
3125
|
-
|
|
3126
|
-
private
|
|
3127
|
-
private
|
|
3135
|
+
setupEvents(active: boolean): void;
|
|
3136
|
+
private resizeEvent;
|
|
3137
|
+
private setupRenderer;
|
|
3138
|
+
private onContextLost;
|
|
3139
|
+
private onContextBack;
|
|
3128
3140
|
}
|
|
3129
3141
|
import * as THREE from "three";
|
|
3130
|
-
import
|
|
3142
|
+
import CameraControls from "camera-controls";
|
|
3143
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3131
3144
|
import { Components } from "../../Components";
|
|
3132
3145
|
/**
|
|
3133
|
-
*
|
|
3146
|
+
* 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.
|
|
3134
3147
|
*/
|
|
3135
|
-
export
|
|
3136
|
-
/**
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3148
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3149
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3150
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3151
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3152
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3140
3153
|
/**
|
|
3141
|
-
*
|
|
3154
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3155
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3142
3156
|
*/
|
|
3143
|
-
|
|
3157
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
3158
|
+
/** {@link Disposable.onDisposed} */
|
|
3159
|
+
readonly onDisposed: Event<string>;
|
|
3144
3160
|
/**
|
|
3145
|
-
*
|
|
3161
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3162
|
+
* This camera is used for rendering the scene.
|
|
3146
3163
|
*/
|
|
3147
|
-
|
|
3164
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3165
|
+
private _allControls;
|
|
3148
3166
|
/**
|
|
3149
|
-
* The
|
|
3167
|
+
* The object that controls the camera. An instance of
|
|
3168
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3169
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3170
|
+
* object to move, rotate, look at objects, etc.
|
|
3150
3171
|
*/
|
|
3151
|
-
|
|
3152
|
-
}
|
|
3153
|
-
/**
|
|
3154
|
-
* 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).
|
|
3155
|
-
*/
|
|
3156
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3157
|
-
/** {@link Disposable.onDisposed} */
|
|
3158
|
-
readonly onDisposed: Event<unknown>;
|
|
3159
|
-
/** The world instance to which this Raycaster belongs. */
|
|
3160
|
-
world: World;
|
|
3161
|
-
/** The components instance to which this grid belongs. */
|
|
3162
|
-
components: Components;
|
|
3163
|
-
/** {@link Hideable.visible} */
|
|
3164
|
-
get visible(): boolean;
|
|
3165
|
-
/** {@link Hideable.visible} */
|
|
3166
|
-
set visible(visible: boolean);
|
|
3167
|
-
/** The material of the grid. */
|
|
3168
|
-
get material(): THREE.ShaderMaterial;
|
|
3172
|
+
get controls(): CameraControls;
|
|
3169
3173
|
/**
|
|
3170
|
-
*
|
|
3171
|
-
*
|
|
3174
|
+
* Getter for the enabled state of the camera controls.
|
|
3175
|
+
* If the current world is null, it returns false.
|
|
3176
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3177
|
+
*
|
|
3178
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3172
3179
|
*/
|
|
3173
|
-
get
|
|
3180
|
+
get enabled(): boolean;
|
|
3174
3181
|
/**
|
|
3175
|
-
*
|
|
3176
|
-
*
|
|
3182
|
+
* Setter for the enabled state of the camera controls.
|
|
3183
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3184
|
+
*
|
|
3185
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3177
3186
|
*/
|
|
3178
|
-
set
|
|
3179
|
-
|
|
3180
|
-
readonly three: THREE.Mesh;
|
|
3181
|
-
private _fade;
|
|
3182
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
3187
|
+
set enabled(enabled: boolean);
|
|
3188
|
+
constructor(components: Components);
|
|
3183
3189
|
/** {@link Disposable.dispose} */
|
|
3184
3190
|
dispose(): void;
|
|
3191
|
+
/** {@link Updateable.update} */
|
|
3192
|
+
update(_delta: number): void;
|
|
3193
|
+
/**
|
|
3194
|
+
* Updates the aspect of the camera to match the size of the
|
|
3195
|
+
* {@link Components.renderer}.
|
|
3196
|
+
*/
|
|
3197
|
+
updateAspect: () => void;
|
|
3198
|
+
private setupCamera;
|
|
3199
|
+
private newCameraControls;
|
|
3185
3200
|
private setupEvents;
|
|
3186
|
-
private
|
|
3187
|
-
}
|
|
3188
|
-
import { NavigationMode } from "./types";
|
|
3189
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3190
|
-
/**
|
|
3191
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3192
|
-
*/
|
|
3193
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3194
|
-
camera: OrthoPerspectiveCamera;
|
|
3195
|
-
/** {@link NavigationMode.enabled} */
|
|
3196
|
-
enabled: boolean;
|
|
3197
|
-
/** {@link NavigationMode.id} */
|
|
3198
|
-
readonly id = "Orbit";
|
|
3199
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3200
|
-
/** {@link NavigationMode.set} */
|
|
3201
|
-
set(active: boolean): void;
|
|
3202
|
-
private activateOrbitControls;
|
|
3201
|
+
private static getSubsetOfThree;
|
|
3203
3202
|
}
|
|
3204
3203
|
import { NavigationMode } from "./types";
|
|
3205
3204
|
import { OrthoPerspectiveCamera } from "../index";
|
|
@@ -3316,51 +3315,6 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3316
3315
|
private newHelper;
|
|
3317
3316
|
private static newPlaneMesh;
|
|
3318
3317
|
}
|
|
3319
|
-
import * as THREE from "three";
|
|
3320
|
-
import { CameraProjection } from "./types";
|
|
3321
|
-
import { Event } from "../../Types";
|
|
3322
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3323
|
-
/**
|
|
3324
|
-
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3325
|
-
*/
|
|
3326
|
-
export declare class ProjectionManager {
|
|
3327
|
-
/**
|
|
3328
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
3329
|
-
*/
|
|
3330
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3331
|
-
/**
|
|
3332
|
-
* Current projection mode of the camera.
|
|
3333
|
-
* Default is "Perspective".
|
|
3334
|
-
*/
|
|
3335
|
-
current: CameraProjection;
|
|
3336
|
-
/**
|
|
3337
|
-
* The camera controlled by this ProjectionManager.
|
|
3338
|
-
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3339
|
-
*/
|
|
3340
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3341
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3342
|
-
matchOrthoDistanceEnabled: boolean;
|
|
3343
|
-
private _component;
|
|
3344
|
-
private _previousDistance;
|
|
3345
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3346
|
-
/**
|
|
3347
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3348
|
-
*
|
|
3349
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
3350
|
-
* it will have no effect.
|
|
3351
|
-
*/
|
|
3352
|
-
set(projection: CameraProjection): Promise<void>;
|
|
3353
|
-
/**
|
|
3354
|
-
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3355
|
-
* and vice versa.
|
|
3356
|
-
*/
|
|
3357
|
-
toggle(): Promise<void>;
|
|
3358
|
-
private setOrthoCamera;
|
|
3359
|
-
private getPerspectiveDims;
|
|
3360
|
-
private setupOrthoCamera;
|
|
3361
|
-
private getDistance;
|
|
3362
|
-
private setPerspectiveCamera;
|
|
3363
|
-
}
|
|
3364
3318
|
import { NavigationMode } from "./types";
|
|
3365
3319
|
import { OrthoPerspectiveCamera } from "../index";
|
|
3366
3320
|
/**
|
|
@@ -3381,6 +3335,22 @@ export declare class PlanMode implements NavigationMode {
|
|
|
3381
3335
|
/** {@link NavigationMode.set} */
|
|
3382
3336
|
set(active: boolean): void;
|
|
3383
3337
|
}
|
|
3338
|
+
import { NavigationMode } from "./types";
|
|
3339
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3340
|
+
/**
|
|
3341
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3342
|
+
*/
|
|
3343
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3344
|
+
camera: OrthoPerspectiveCamera;
|
|
3345
|
+
/** {@link NavigationMode.enabled} */
|
|
3346
|
+
enabled: boolean;
|
|
3347
|
+
/** {@link NavigationMode.id} */
|
|
3348
|
+
readonly id = "Orbit";
|
|
3349
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3350
|
+
/** {@link NavigationMode.set} */
|
|
3351
|
+
set(active: boolean): void;
|
|
3352
|
+
private activateOrbitControls;
|
|
3353
|
+
}
|
|
3384
3354
|
/**
|
|
3385
3355
|
* The projection system of the camera.
|
|
3386
3356
|
*/
|
|
@@ -3407,15 +3377,50 @@ export interface NavigationMode {
|
|
|
3407
3377
|
/** Whether this navigation mode is active or not. */
|
|
3408
3378
|
enabled: boolean;
|
|
3409
3379
|
}
|
|
3410
|
-
import * as WEBIFC from "web-ifc";
|
|
3411
3380
|
import * as THREE from "three";
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3381
|
+
import { CameraProjection } from "./types";
|
|
3382
|
+
import { Event } from "../../Types";
|
|
3383
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3384
|
+
/**
|
|
3385
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3386
|
+
*/
|
|
3387
|
+
export declare class ProjectionManager {
|
|
3388
|
+
/**
|
|
3389
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
3390
|
+
*/
|
|
3391
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3392
|
+
/**
|
|
3393
|
+
* Current projection mode of the camera.
|
|
3394
|
+
* Default is "Perspective".
|
|
3395
|
+
*/
|
|
3396
|
+
current: CameraProjection;
|
|
3397
|
+
/**
|
|
3398
|
+
* The camera controlled by this ProjectionManager.
|
|
3399
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3400
|
+
*/
|
|
3401
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3402
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3403
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3404
|
+
private _component;
|
|
3405
|
+
private _previousDistance;
|
|
3406
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3407
|
+
/**
|
|
3408
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3409
|
+
*
|
|
3410
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3411
|
+
* it will have no effect.
|
|
3412
|
+
*/
|
|
3413
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3414
|
+
/**
|
|
3415
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3416
|
+
* and vice versa.
|
|
3417
|
+
*/
|
|
3418
|
+
toggle(): Promise<void>;
|
|
3419
|
+
private setOrthoCamera;
|
|
3420
|
+
private getPerspectiveDims;
|
|
3421
|
+
private setupOrthoCamera;
|
|
3422
|
+
private getDistance;
|
|
3423
|
+
private setPerspectiveCamera;
|
|
3419
3424
|
}
|
|
3420
3425
|
import * as THREE from "three";
|
|
3421
3426
|
import * as WEBIFC from "web-ifc";
|
|
@@ -3437,6 +3442,16 @@ export declare class IfcMetadataReader {
|
|
|
3437
3442
|
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3438
3443
|
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3439
3444
|
}
|
|
3445
|
+
import * as WEBIFC from "web-ifc";
|
|
3446
|
+
import * as THREE from "three";
|
|
3447
|
+
export declare class Units {
|
|
3448
|
+
factor: number;
|
|
3449
|
+
complement: number;
|
|
3450
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3451
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3452
|
+
private getLengthUnits;
|
|
3453
|
+
private getScaleMatrix;
|
|
3454
|
+
}
|
|
3440
3455
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3441
3456
|
/**
|
|
3442
3457
|
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|