@thatopen/components 2.1.7 → 2.1.8
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 +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/namespace.d.ts +866 -866
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,4 +1,80 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
+
import { Component, Disposable, Event } from "../Types";
|
|
3
|
+
/**
|
|
4
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Components implements Disposable {
|
|
7
|
+
/**
|
|
8
|
+
* The version of the @thatopen/components library.
|
|
9
|
+
*/
|
|
10
|
+
static readonly release = "2.1.8";
|
|
11
|
+
/** {@link Disposable.onDisposed} */
|
|
12
|
+
readonly onDisposed: Event<void>;
|
|
13
|
+
/**
|
|
14
|
+
* The list of components created in this app.
|
|
15
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
16
|
+
*/
|
|
17
|
+
readonly list: Map<string, Component>;
|
|
18
|
+
/**
|
|
19
|
+
* If disabled, the animation loop will be stopped.
|
|
20
|
+
* Default value is false.
|
|
21
|
+
*/
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
private _clock;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a component to the list of components.
|
|
26
|
+
* Throws an error if a component with the same UUID already exists.
|
|
27
|
+
*
|
|
28
|
+
* @param uuid - The unique identifier of the component.
|
|
29
|
+
* @param instance - The instance of the component to be added.
|
|
30
|
+
*
|
|
31
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
add(uuid: string, instance: Component): void;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a component instance by its constructor function.
|
|
38
|
+
* If the component does not exist in the list, it will be created and added.
|
|
39
|
+
*
|
|
40
|
+
* @template U - The type of the component to retrieve.
|
|
41
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
42
|
+
*
|
|
43
|
+
* @returns The instance of the requested component.
|
|
44
|
+
*
|
|
45
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
50
|
+
constructor();
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the Components instance.
|
|
53
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
54
|
+
* and calls the update method.
|
|
55
|
+
*
|
|
56
|
+
* @returns {void}
|
|
57
|
+
*/
|
|
58
|
+
init(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
61
|
+
* the library. A memory leak will be created if:
|
|
62
|
+
*
|
|
63
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
64
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
65
|
+
* Angular, Vue, etc).
|
|
66
|
+
*
|
|
67
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
68
|
+
* referenced by a reference type (object or array).
|
|
69
|
+
*
|
|
70
|
+
* You can learn more about how Three.js handles memory leaks
|
|
71
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
dispose(): void;
|
|
75
|
+
private update;
|
|
76
|
+
private static setupBVH;
|
|
77
|
+
}
|
|
2
78
|
import * as THREE from "three";
|
|
3
79
|
import { Components } from "../Components";
|
|
4
80
|
import { Component } from "../Types";
|
|
@@ -86,82 +162,6 @@ export declare class Raycasters extends Component implements Disposable {
|
|
|
86
162
|
/** {@link Disposable.dispose} */
|
|
87
163
|
dispose(): void;
|
|
88
164
|
}
|
|
89
|
-
import { Component, Disposable, Event } from "../Types";
|
|
90
|
-
/**
|
|
91
|
-
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
92
|
-
*/
|
|
93
|
-
export declare class Components implements Disposable {
|
|
94
|
-
/**
|
|
95
|
-
* The version of the @thatopen/components library.
|
|
96
|
-
*/
|
|
97
|
-
static readonly release = "2.1.7";
|
|
98
|
-
/** {@link Disposable.onDisposed} */
|
|
99
|
-
readonly onDisposed: Event<void>;
|
|
100
|
-
/**
|
|
101
|
-
* The list of components created in this app.
|
|
102
|
-
* The keys are UUIDs and the values are instances of the components.
|
|
103
|
-
*/
|
|
104
|
-
readonly list: Map<string, Component>;
|
|
105
|
-
/**
|
|
106
|
-
* If disabled, the animation loop will be stopped.
|
|
107
|
-
* Default value is false.
|
|
108
|
-
*/
|
|
109
|
-
enabled: boolean;
|
|
110
|
-
private _clock;
|
|
111
|
-
/**
|
|
112
|
-
* Adds a component to the list of components.
|
|
113
|
-
* Throws an error if a component with the same UUID already exists.
|
|
114
|
-
*
|
|
115
|
-
* @param uuid - The unique identifier of the component.
|
|
116
|
-
* @param instance - The instance of the component to be added.
|
|
117
|
-
*
|
|
118
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
119
|
-
*
|
|
120
|
-
* @internal
|
|
121
|
-
*/
|
|
122
|
-
add(uuid: string, instance: Component): void;
|
|
123
|
-
/**
|
|
124
|
-
* Retrieves a component instance by its constructor function.
|
|
125
|
-
* If the component does not exist in the list, it will be created and added.
|
|
126
|
-
*
|
|
127
|
-
* @template U - The type of the component to retrieve.
|
|
128
|
-
* @param Component - The constructor function of the component to retrieve.
|
|
129
|
-
*
|
|
130
|
-
* @returns The instance of the requested component.
|
|
131
|
-
*
|
|
132
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
133
|
-
*
|
|
134
|
-
* @internal
|
|
135
|
-
*/
|
|
136
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
137
|
-
constructor();
|
|
138
|
-
/**
|
|
139
|
-
* Initializes the Components instance.
|
|
140
|
-
* This method starts the animation loop, sets the enabled flag to true,
|
|
141
|
-
* and calls the update method.
|
|
142
|
-
*
|
|
143
|
-
* @returns {void}
|
|
144
|
-
*/
|
|
145
|
-
init(): void;
|
|
146
|
-
/**
|
|
147
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
148
|
-
* the library. A memory leak will be created if:
|
|
149
|
-
*
|
|
150
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
151
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
152
|
-
* Angular, Vue, etc).
|
|
153
|
-
*
|
|
154
|
-
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
155
|
-
* referenced by a reference type (object or array).
|
|
156
|
-
*
|
|
157
|
-
* You can learn more about how Three.js handles memory leaks
|
|
158
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
159
|
-
*
|
|
160
|
-
*/
|
|
161
|
-
dispose(): void;
|
|
162
|
-
private update;
|
|
163
|
-
private static setupBVH;
|
|
164
|
-
}
|
|
165
165
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
166
166
|
import { Components } from "../Components";
|
|
167
167
|
import { SimpleWorld } from "./src";
|
|
@@ -409,183 +409,49 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
409
409
|
private _onStartDragging;
|
|
410
410
|
private _onEndDragging;
|
|
411
411
|
}
|
|
412
|
-
import
|
|
413
|
-
|
|
414
|
-
|
|
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";
|
|
412
|
+
import { Components } from "../Components";
|
|
413
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
414
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
432
415
|
/**
|
|
433
|
-
*
|
|
416
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
434
417
|
*/
|
|
435
|
-
export
|
|
436
|
-
/**
|
|
437
|
-
* If true, only vertices will be picked, not the closest point on the face.
|
|
438
|
-
*/
|
|
439
|
-
showOnlyVertex: boolean;
|
|
418
|
+
export declare class Cullers extends Component implements Disposable {
|
|
440
419
|
/**
|
|
441
|
-
*
|
|
420
|
+
* A unique identifier for the component.
|
|
421
|
+
* This UUID is used to register the component within the Components system.
|
|
442
422
|
*/
|
|
443
|
-
|
|
423
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
444
424
|
/**
|
|
445
|
-
*
|
|
425
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
446
426
|
*/
|
|
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 {
|
|
453
|
-
/** {@link Disposable.onDisposed} */
|
|
454
427
|
readonly onDisposed: Event<unknown>;
|
|
455
|
-
/**
|
|
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.
|
|
458
|
-
*/
|
|
459
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
460
|
-
/**
|
|
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
428
|
private _enabled;
|
|
482
429
|
/**
|
|
483
|
-
*
|
|
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.
|
|
486
|
-
*
|
|
487
|
-
* @param value - The new enabled state.
|
|
430
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
488
431
|
*/
|
|
432
|
+
list: Map<string, MeshCullerRenderer>;
|
|
433
|
+
/** {@link Component.enabled} */
|
|
434
|
+
get enabled(): boolean;
|
|
435
|
+
/** {@link Component.enabled} */
|
|
489
436
|
set enabled(value: boolean);
|
|
437
|
+
constructor(components: Components);
|
|
490
438
|
/**
|
|
491
|
-
*
|
|
439
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
440
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
492
441
|
*
|
|
493
|
-
* @
|
|
442
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
443
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
444
|
+
*
|
|
445
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
494
446
|
*/
|
|
495
|
-
|
|
447
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
496
448
|
/**
|
|
497
|
-
*
|
|
449
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
450
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
498
451
|
*
|
|
499
|
-
* @param
|
|
500
|
-
* The properties not provided in the value object will retain their current values.
|
|
452
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
501
453
|
*
|
|
502
|
-
* @
|
|
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>);
|
|
524
|
-
/** {@link Disposable.dispose} */
|
|
525
|
-
dispose(): void;
|
|
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;
|
|
545
|
-
}
|
|
546
|
-
import { Components } from "../Components";
|
|
547
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
548
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
549
|
-
/**
|
|
550
|
-
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
551
|
-
*/
|
|
552
|
-
export declare class Cullers extends Component implements Disposable {
|
|
553
|
-
/**
|
|
554
|
-
* A unique identifier for the component.
|
|
555
|
-
* This UUID is used to register the component within the Components system.
|
|
556
|
-
*/
|
|
557
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
558
|
-
/**
|
|
559
|
-
* An event that is triggered when the Cullers component is disposed.
|
|
560
|
-
*/
|
|
561
|
-
readonly onDisposed: Event<unknown>;
|
|
562
|
-
private _enabled;
|
|
563
|
-
/**
|
|
564
|
-
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
565
|
-
*/
|
|
566
|
-
list: Map<string, MeshCullerRenderer>;
|
|
567
|
-
/** {@link Component.enabled} */
|
|
568
|
-
get enabled(): boolean;
|
|
569
|
-
/** {@link Component.enabled} */
|
|
570
|
-
set enabled(value: boolean);
|
|
571
|
-
constructor(components: Components);
|
|
572
|
-
/**
|
|
573
|
-
* Creates a new MeshCullerRenderer for the given world.
|
|
574
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
575
|
-
*
|
|
576
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
577
|
-
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
578
|
-
*
|
|
579
|
-
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
580
|
-
*/
|
|
581
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
582
|
-
/**
|
|
583
|
-
* Deletes the MeshCullerRenderer associated with the given world.
|
|
584
|
-
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
585
|
-
*
|
|
586
|
-
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
587
|
-
*
|
|
588
|
-
* @returns {void}
|
|
454
|
+
* @returns {void}
|
|
589
455
|
*/
|
|
590
456
|
delete(world: World): void;
|
|
591
457
|
/** {@link Disposable.dispose} */
|
|
@@ -704,177 +570,6 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
704
570
|
}
|
|
705
571
|
import * as THREE from "three";
|
|
706
572
|
import * as FRAGS from "@thatopen/fragments";
|
|
707
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
708
|
-
/**
|
|
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.
|
|
710
|
-
*/
|
|
711
|
-
export interface Classification {
|
|
712
|
-
/**
|
|
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.
|
|
715
|
-
*/
|
|
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
|
-
};
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
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).
|
|
730
|
-
*/
|
|
731
|
-
export declare class Classifier extends Component implements Disposable {
|
|
732
|
-
/**
|
|
733
|
-
* A unique identifier for the component.
|
|
734
|
-
* This UUID is used to register the component within the Components system.
|
|
735
|
-
*/
|
|
736
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
737
|
-
/** {@link Component.enabled} */
|
|
738
|
-
enabled: boolean;
|
|
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>;
|
|
746
|
-
constructor(components: Components);
|
|
747
|
-
private onFragmentsDisposed;
|
|
748
|
-
/** {@link Disposable.dispose} */
|
|
749
|
-
dispose(): void;
|
|
750
|
-
/**
|
|
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.
|
|
753
|
-
*
|
|
754
|
-
* @param guid - The unique identifier of the fragment to be removed.
|
|
755
|
-
*/
|
|
756
|
-
remove(guid: string): void;
|
|
757
|
-
/**
|
|
758
|
-
* Finds and returns fragments based on the provided filter criteria.
|
|
759
|
-
* If no filter is provided, it returns all fragments.
|
|
760
|
-
*
|
|
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.
|
|
764
|
-
*
|
|
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.
|
|
769
|
-
*/
|
|
770
|
-
find(filter?: {
|
|
771
|
-
[name: string]: string[];
|
|
772
|
-
}): FRAGS.FragmentIdMap;
|
|
773
|
-
/**
|
|
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.
|
|
784
|
-
*
|
|
785
|
-
*/
|
|
786
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
787
|
-
/**
|
|
788
|
-
* Classifies fragments based on their PredefinedType property.
|
|
789
|
-
*
|
|
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.
|
|
799
|
-
*/
|
|
800
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
801
|
-
/**
|
|
802
|
-
* Classifies fragments based on their entity type.
|
|
803
|
-
*
|
|
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.
|
|
813
|
-
*/
|
|
814
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
815
|
-
/**
|
|
816
|
-
* Classifies fragments based on a specific IFC relationship.
|
|
817
|
-
*
|
|
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.
|
|
829
|
-
*/
|
|
830
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
831
|
-
/**
|
|
832
|
-
* Classifies fragments based on their spatial structure in the IFC model.
|
|
833
|
-
*
|
|
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)
|
|
836
|
-
*
|
|
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.
|
|
844
|
-
*/
|
|
845
|
-
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
846
|
-
useProperties: boolean;
|
|
847
|
-
}): Promise<void>;
|
|
848
|
-
/**
|
|
849
|
-
* Sets the color of the specified fragments.
|
|
850
|
-
*
|
|
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.
|
|
854
|
-
*
|
|
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.
|
|
860
|
-
*/
|
|
861
|
-
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
862
|
-
/**
|
|
863
|
-
* Resets the color of the specified fragments to their original color.
|
|
864
|
-
*
|
|
865
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
866
|
-
*
|
|
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.
|
|
872
|
-
*/
|
|
873
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
874
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
875
|
-
}
|
|
876
|
-
import * as THREE from "three";
|
|
877
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
878
573
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
879
574
|
import { Component, Components, Disposable, Event } from "../../core";
|
|
880
575
|
/**
|
|
@@ -1081,9 +776,180 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
1081
776
|
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
1082
777
|
private static getFragmentBounds;
|
|
1083
778
|
}
|
|
1084
|
-
import
|
|
779
|
+
import * as THREE from "three";
|
|
780
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
781
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
1085
782
|
/**
|
|
1086
|
-
* The
|
|
783
|
+
* 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.
|
|
784
|
+
*/
|
|
785
|
+
export interface Classification {
|
|
786
|
+
/**
|
|
787
|
+
* A system within the classification.
|
|
788
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
789
|
+
*/
|
|
790
|
+
[system: string]: {
|
|
791
|
+
/**
|
|
792
|
+
* A class within the system.
|
|
793
|
+
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
794
|
+
*/
|
|
795
|
+
[className: string]: {
|
|
796
|
+
map: FRAGS.FragmentIdMap;
|
|
797
|
+
name: string;
|
|
798
|
+
id: number | null;
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* 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).
|
|
804
|
+
*/
|
|
805
|
+
export declare class Classifier extends Component implements Disposable {
|
|
806
|
+
/**
|
|
807
|
+
* A unique identifier for the component.
|
|
808
|
+
* This UUID is used to register the component within the Components system.
|
|
809
|
+
*/
|
|
810
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
811
|
+
/** {@link Component.enabled} */
|
|
812
|
+
enabled: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* A map representing the classification systems.
|
|
815
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
816
|
+
*/
|
|
817
|
+
list: Classification;
|
|
818
|
+
/** {@link Disposable.onDisposed} */
|
|
819
|
+
readonly onDisposed: Event<unknown>;
|
|
820
|
+
constructor(components: Components);
|
|
821
|
+
private onFragmentsDisposed;
|
|
822
|
+
/** {@link Disposable.dispose} */
|
|
823
|
+
dispose(): void;
|
|
824
|
+
/**
|
|
825
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
826
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
827
|
+
*
|
|
828
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
829
|
+
*/
|
|
830
|
+
remove(guid: string): void;
|
|
831
|
+
/**
|
|
832
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
833
|
+
* If no filter is provided, it returns all fragments.
|
|
834
|
+
*
|
|
835
|
+
* @param filter - An optional object containing filter criteria.
|
|
836
|
+
* The keys of the object represent the classification system names,
|
|
837
|
+
* and the values are arrays of class names to match.
|
|
838
|
+
*
|
|
839
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
840
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
841
|
+
*
|
|
842
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
843
|
+
*/
|
|
844
|
+
find(filter?: {
|
|
845
|
+
[name: string]: string[];
|
|
846
|
+
}): FRAGS.FragmentIdMap;
|
|
847
|
+
/**
|
|
848
|
+
* Classifies fragments based on their modelID.
|
|
849
|
+
*
|
|
850
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
851
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
852
|
+
*
|
|
853
|
+
* @remarks
|
|
854
|
+
* This method iterates through the fragments in the provided group,
|
|
855
|
+
* and classifies them based on their modelID.
|
|
856
|
+
* The classification is stored in the 'list.models' property,
|
|
857
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
858
|
+
*
|
|
859
|
+
*/
|
|
860
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
861
|
+
/**
|
|
862
|
+
* Classifies fragments based on their PredefinedType property.
|
|
863
|
+
*
|
|
864
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
865
|
+
*
|
|
866
|
+
* @remarks
|
|
867
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
868
|
+
* and classifies them based on their PredefinedType property.
|
|
869
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
870
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
871
|
+
*
|
|
872
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
873
|
+
*/
|
|
874
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
875
|
+
/**
|
|
876
|
+
* Classifies fragments based on their entity type.
|
|
877
|
+
*
|
|
878
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
879
|
+
*
|
|
880
|
+
* @remarks
|
|
881
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
882
|
+
* and classifies them based on their entity type.
|
|
883
|
+
* The classification is stored in the 'list.entities' property,
|
|
884
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
885
|
+
*
|
|
886
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
887
|
+
*/
|
|
888
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
889
|
+
/**
|
|
890
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
891
|
+
*
|
|
892
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
893
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
894
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
895
|
+
*
|
|
896
|
+
* @remarks
|
|
897
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
898
|
+
* and classifies them based on the specified IFC relationship.
|
|
899
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
900
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
901
|
+
*
|
|
902
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
903
|
+
*/
|
|
904
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
905
|
+
/**
|
|
906
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
907
|
+
*
|
|
908
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
909
|
+
* @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
|
|
910
|
+
*
|
|
911
|
+
* @remarks
|
|
912
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
913
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
914
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
915
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
916
|
+
*
|
|
917
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
918
|
+
*/
|
|
919
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
920
|
+
useProperties: boolean;
|
|
921
|
+
}): Promise<void>;
|
|
922
|
+
/**
|
|
923
|
+
* Sets the color of the specified fragments.
|
|
924
|
+
*
|
|
925
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
926
|
+
* @param color - The color to set for the fragments.
|
|
927
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
928
|
+
*
|
|
929
|
+
* @remarks
|
|
930
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
931
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
932
|
+
*
|
|
933
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
934
|
+
*/
|
|
935
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
936
|
+
/**
|
|
937
|
+
* Resets the color of the specified fragments to their original color.
|
|
938
|
+
*
|
|
939
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
940
|
+
*
|
|
941
|
+
* @remarks
|
|
942
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
943
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
944
|
+
*
|
|
945
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
946
|
+
*/
|
|
947
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
948
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
949
|
+
}
|
|
950
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
951
|
+
/**
|
|
952
|
+
* 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).
|
|
1087
953
|
*/
|
|
1088
954
|
export declare class Exploder extends Component implements Disposable {
|
|
1089
955
|
/**
|
|
@@ -1408,7 +1274,7 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
1408
1274
|
* @param originalCoordinateSystem - The original coordinate system of the object.
|
|
1409
1275
|
* This should be a THREE.Matrix4 representing the object's transformation matrix.
|
|
1410
1276
|
*/
|
|
1411
|
-
applyBaseCoordinateSystem(object: THREE.Object3D, originalCoordinateSystem: THREE.Matrix4): void;
|
|
1277
|
+
applyBaseCoordinateSystem(object: THREE.Object3D | THREE.Vector3, originalCoordinateSystem: THREE.Matrix4): void;
|
|
1412
1278
|
}
|
|
1413
1279
|
import * as WEBIFC from "web-ifc";
|
|
1414
1280
|
import { Components, Disposable, Event, Component } from "../../core";
|
|
@@ -1573,6 +1439,24 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
1573
1439
|
private streamAllProperties;
|
|
1574
1440
|
private cleanUp;
|
|
1575
1441
|
}
|
|
1442
|
+
import * as THREE from "three";
|
|
1443
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1444
|
+
center: THREE.Vector3;
|
|
1445
|
+
halfSizes: THREE.Vector3;
|
|
1446
|
+
rotation: THREE.Matrix3;
|
|
1447
|
+
transformation: THREE.Matrix4;
|
|
1448
|
+
};
|
|
1449
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1450
|
+
import * as THREE from "three";
|
|
1451
|
+
export declare class MaterialsUtils {
|
|
1452
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
1453
|
+
}
|
|
1454
|
+
export declare class UUID {
|
|
1455
|
+
private static _pattern;
|
|
1456
|
+
private static _lut;
|
|
1457
|
+
static create(): string;
|
|
1458
|
+
static validate(uuid: string): void;
|
|
1459
|
+
}
|
|
1576
1460
|
import * as WEBIFC from "web-ifc";
|
|
1577
1461
|
import * as FRAG from "@thatopen/fragments";
|
|
1578
1462
|
import { Component, Components } from "../../core";
|
|
@@ -1598,65 +1482,181 @@ export declare class IfcJsonExporter extends Component {
|
|
|
1598
1482
|
*/
|
|
1599
1483
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1600
1484
|
}
|
|
1601
|
-
import * as
|
|
1602
|
-
import {
|
|
1603
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
1604
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1605
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1485
|
+
import * as THREE from "three";
|
|
1486
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1606
1487
|
/**
|
|
1607
|
-
*
|
|
1488
|
+
* Configuration interface for the VertexPicker component.
|
|
1608
1489
|
*/
|
|
1609
|
-
export
|
|
1490
|
+
export interface VertexPickerConfig {
|
|
1610
1491
|
/**
|
|
1611
|
-
*
|
|
1612
|
-
* This UUID is used to register the component within the Components system.
|
|
1492
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
1613
1493
|
*/
|
|
1614
|
-
|
|
1615
|
-
/** {@link Disposable.onDisposed} */
|
|
1616
|
-
readonly onDisposed: Event<string>;
|
|
1494
|
+
showOnlyVertex: boolean;
|
|
1617
1495
|
/**
|
|
1618
|
-
*
|
|
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.
|
|
1496
|
+
* The maximum distance for snapping to a vertex.
|
|
1624
1497
|
*/
|
|
1625
|
-
|
|
1626
|
-
modelID: string;
|
|
1627
|
-
relationsMap: RelationsMap;
|
|
1628
|
-
}>;
|
|
1498
|
+
snapDistance: number;
|
|
1629
1499
|
/**
|
|
1630
|
-
*
|
|
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.
|
|
1500
|
+
* The HTML element to use for previewing the picked vertex.
|
|
1636
1501
|
*/
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
private indexRelations;
|
|
1646
|
-
private getAttributeIndex;
|
|
1502
|
+
previewElement: HTMLElement;
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1506
|
+
*/
|
|
1507
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
1508
|
+
/** {@link Disposable.onDisposed} */
|
|
1509
|
+
readonly onDisposed: Event<unknown>;
|
|
1647
1510
|
/**
|
|
1648
|
-
*
|
|
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.
|
|
1511
|
+
* An event that is triggered when a vertex is found.
|
|
1512
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1654
1513
|
*/
|
|
1655
|
-
|
|
1514
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1656
1515
|
/**
|
|
1657
|
-
*
|
|
1658
|
-
*
|
|
1659
|
-
|
|
1516
|
+
* An event that is triggered when a vertex is lost.
|
|
1517
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1518
|
+
*/
|
|
1519
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1520
|
+
/**
|
|
1521
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
1522
|
+
*/
|
|
1523
|
+
readonly onEnabled: Event<boolean>;
|
|
1524
|
+
/**
|
|
1525
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
1526
|
+
*/
|
|
1527
|
+
components: Components;
|
|
1528
|
+
/**
|
|
1529
|
+
* A reference to the working plane used for vertex picking.
|
|
1530
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
1531
|
+
* If this value is null, all vertices are considered valid.
|
|
1532
|
+
*/
|
|
1533
|
+
workingPlane: THREE.Plane | null;
|
|
1534
|
+
private _pickedPoint;
|
|
1535
|
+
private _config;
|
|
1536
|
+
private _enabled;
|
|
1537
|
+
/**
|
|
1538
|
+
* Sets the enabled state of the VertexPicker.
|
|
1539
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1540
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1541
|
+
*
|
|
1542
|
+
* @param value - The new enabled state.
|
|
1543
|
+
*/
|
|
1544
|
+
set enabled(value: boolean);
|
|
1545
|
+
/**
|
|
1546
|
+
* Gets the current enabled state of the VertexPicker.
|
|
1547
|
+
*
|
|
1548
|
+
* @returns The current enabled state.
|
|
1549
|
+
*/
|
|
1550
|
+
get enabled(): boolean;
|
|
1551
|
+
/**
|
|
1552
|
+
* Sets the configuration for the VertexPicker component.
|
|
1553
|
+
*
|
|
1554
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
1555
|
+
* The properties not provided in the value object will retain their current values.
|
|
1556
|
+
*
|
|
1557
|
+
* @example
|
|
1558
|
+
* '''typescript
|
|
1559
|
+
* vertexPicker.config = {
|
|
1560
|
+
* snapDistance: 0.5,
|
|
1561
|
+
* showOnlyVertex: true,
|
|
1562
|
+
* };
|
|
1563
|
+
* '''
|
|
1564
|
+
*/
|
|
1565
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
1566
|
+
/**
|
|
1567
|
+
* Gets the current configuration for the VertexPicker component.
|
|
1568
|
+
*
|
|
1569
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
1570
|
+
*
|
|
1571
|
+
* @example
|
|
1572
|
+
* '''typescript
|
|
1573
|
+
* const currentConfig = vertexPicker.config;
|
|
1574
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1575
|
+
* '''
|
|
1576
|
+
*/
|
|
1577
|
+
get config(): Partial<VertexPickerConfig>;
|
|
1578
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
1579
|
+
/** {@link Disposable.dispose} */
|
|
1580
|
+
dispose(): void;
|
|
1581
|
+
/**
|
|
1582
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
1583
|
+
*
|
|
1584
|
+
* @param world - The World instance to use for raycasting.
|
|
1585
|
+
*
|
|
1586
|
+
* @returns The current picked point, or null if no point is picked.
|
|
1587
|
+
*
|
|
1588
|
+
* @remarks
|
|
1589
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
1590
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
1591
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
1592
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
1593
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
1594
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1595
|
+
*/
|
|
1596
|
+
get(world: World): THREE.Vector3 | null;
|
|
1597
|
+
private getClosestVertex;
|
|
1598
|
+
private getVertices;
|
|
1599
|
+
private getVertex;
|
|
1600
|
+
}
|
|
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";
|
|
1606
|
+
/**
|
|
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).
|
|
1608
|
+
*/
|
|
1609
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1610
|
+
/**
|
|
1611
|
+
* A unique identifier for the component.
|
|
1612
|
+
* This UUID is used to register the component within the Components system.
|
|
1613
|
+
*/
|
|
1614
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1615
|
+
/** {@link Disposable.onDisposed} */
|
|
1616
|
+
readonly onDisposed: Event<string>;
|
|
1617
|
+
/**
|
|
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.
|
|
1624
|
+
*/
|
|
1625
|
+
readonly onRelationsIndexed: Event<{
|
|
1626
|
+
modelID: string;
|
|
1627
|
+
relationsMap: RelationsMap;
|
|
1628
|
+
}>;
|
|
1629
|
+
/**
|
|
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.
|
|
1636
|
+
*/
|
|
1637
|
+
readonly relationMaps: ModelsRelationMap;
|
|
1638
|
+
/** {@link Component.enabled} */
|
|
1639
|
+
enabled: boolean;
|
|
1640
|
+
private _relToAttributesMap;
|
|
1641
|
+
private _inverseAttributes;
|
|
1642
|
+
private _ifcRels;
|
|
1643
|
+
constructor(components: Components);
|
|
1644
|
+
private onFragmentsDisposed;
|
|
1645
|
+
private indexRelations;
|
|
1646
|
+
private getAttributeIndex;
|
|
1647
|
+
/**
|
|
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.
|
|
1654
|
+
*/
|
|
1655
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
1656
|
+
/**
|
|
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.
|
|
1660
1660
|
*
|
|
1661
1661
|
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
1662
1662
|
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
@@ -2122,47 +2122,6 @@ export declare class MeasurementUtils extends Component {
|
|
|
2122
2122
|
private getVolumeOfMesh;
|
|
2123
2123
|
private getSignedVolumeOfTriangle;
|
|
2124
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;
|
|
2156
|
-
/**
|
|
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.
|
|
2160
|
-
*
|
|
2161
|
-
* @param url - The URL of the file to locate.
|
|
2162
|
-
* @returns The absolute path of the file.
|
|
2163
|
-
*/
|
|
2164
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2165
|
-
}
|
|
2166
2125
|
import * as THREE from "three";
|
|
2167
2126
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2168
2127
|
/**
|
|
@@ -2252,12 +2211,50 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2252
2211
|
resize(size?: THREE.Vector2): void;
|
|
2253
2212
|
private updatePlanes;
|
|
2254
2213
|
}
|
|
2214
|
+
/**
|
|
2215
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2216
|
+
*/
|
|
2217
|
+
export declare const GeometryTypes: Set<number>;
|
|
2255
2218
|
import * as WEBIFC from "web-ifc";
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2219
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2220
|
+
export declare class IfcFragmentSettings {
|
|
2221
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2222
|
+
includeProperties: boolean;
|
|
2223
|
+
/**
|
|
2224
|
+
* Generate the geometry for categories that are not included by default,
|
|
2225
|
+
* like IFCSPACE.
|
|
2226
|
+
*/
|
|
2227
|
+
optionalCategories: number[];
|
|
2228
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2229
|
+
coordinate: boolean;
|
|
2230
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2231
|
+
wasm: {
|
|
2232
|
+
path: string;
|
|
2233
|
+
absolute: boolean;
|
|
2234
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2235
|
+
};
|
|
2236
|
+
/** List of categories that won't be converted to fragments. */
|
|
2237
|
+
excludedCategories: Set<number>;
|
|
2238
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2239
|
+
saveLocations: boolean;
|
|
2240
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2241
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2242
|
+
/**
|
|
2243
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2244
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2245
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2246
|
+
* Default value is true.
|
|
2247
|
+
*/
|
|
2248
|
+
autoSetWasm: boolean;
|
|
2249
|
+
/**
|
|
2250
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2251
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2252
|
+
* If set to null, the default file location handler will be used.
|
|
2253
|
+
*
|
|
2254
|
+
* @param url - The URL of the file to locate.
|
|
2255
|
+
* @returns The absolute path of the file.
|
|
2256
|
+
*/
|
|
2257
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2261
2258
|
}
|
|
2262
2259
|
import * as WEBIFC from "web-ifc";
|
|
2263
2260
|
import { IfcItemsCategories } from "../../../ifc";
|
|
@@ -2267,6 +2264,24 @@ export declare class SpatialStructure {
|
|
|
2267
2264
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2268
2265
|
cleanUp(): void;
|
|
2269
2266
|
}
|
|
2267
|
+
import * as WEBIFC from "web-ifc";
|
|
2268
|
+
export interface IfcItemsCategories {
|
|
2269
|
+
[itemID: number]: number;
|
|
2270
|
+
}
|
|
2271
|
+
export declare class IfcCategories {
|
|
2272
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* 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.
|
|
2276
|
+
*
|
|
2277
|
+
* @remarks
|
|
2278
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2279
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2280
|
+
*
|
|
2281
|
+
*/
|
|
2282
|
+
export declare const IfcElements: {
|
|
2283
|
+
[key: number]: string;
|
|
2284
|
+
};
|
|
2270
2285
|
/**
|
|
2271
2286
|
* 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
2287
|
*/
|
|
@@ -2298,100 +2313,30 @@ export declare class IfcPropertiesUtils {
|
|
|
2298
2313
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2299
2314
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2300
2315
|
}
|
|
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
|
-
}
|
|
2371
2316
|
/**
|
|
2372
2317
|
* 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.
|
|
2373
2318
|
*/
|
|
2374
|
-
export declare class
|
|
2319
|
+
export declare class Event<T> {
|
|
2375
2320
|
/**
|
|
2376
2321
|
* Add a callback to this event instance.
|
|
2377
2322
|
* @param handler - the callback to be added to this event.
|
|
2378
2323
|
*/
|
|
2379
2324
|
add(handler: T extends void ? {
|
|
2380
|
-
():
|
|
2325
|
+
(): void;
|
|
2381
2326
|
} : {
|
|
2382
|
-
(data: T):
|
|
2327
|
+
(data: T): void;
|
|
2383
2328
|
}): void;
|
|
2384
2329
|
/**
|
|
2385
2330
|
* Removes a callback from this event instance.
|
|
2386
2331
|
* @param handler - the callback to be removed from this event.
|
|
2387
2332
|
*/
|
|
2388
2333
|
remove(handler: T extends void ? {
|
|
2389
|
-
():
|
|
2334
|
+
(): void;
|
|
2390
2335
|
} : {
|
|
2391
|
-
(data: T):
|
|
2336
|
+
(data: T): void;
|
|
2392
2337
|
}): void;
|
|
2393
2338
|
/** Triggers all the callbacks assigned to this event. */
|
|
2394
|
-
trigger: (data?: T) =>
|
|
2339
|
+
trigger: (data?: T) => void;
|
|
2395
2340
|
/** Gets rid of all the suscribed events. */
|
|
2396
2341
|
reset(): void;
|
|
2397
2342
|
private handlers;
|
|
@@ -2399,27 +2344,27 @@ export declare class AsyncEvent<T> {
|
|
|
2399
2344
|
/**
|
|
2400
2345
|
* 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
2346
|
*/
|
|
2402
|
-
export declare class
|
|
2347
|
+
export declare class AsyncEvent<T> {
|
|
2403
2348
|
/**
|
|
2404
2349
|
* Add a callback to this event instance.
|
|
2405
2350
|
* @param handler - the callback to be added to this event.
|
|
2406
2351
|
*/
|
|
2407
2352
|
add(handler: T extends void ? {
|
|
2408
|
-
(): void
|
|
2353
|
+
(): Promise<void>;
|
|
2409
2354
|
} : {
|
|
2410
|
-
(data: T): void
|
|
2355
|
+
(data: T): Promise<void>;
|
|
2411
2356
|
}): void;
|
|
2412
2357
|
/**
|
|
2413
2358
|
* Removes a callback from this event instance.
|
|
2414
2359
|
* @param handler - the callback to be removed from this event.
|
|
2415
2360
|
*/
|
|
2416
2361
|
remove(handler: T extends void ? {
|
|
2417
|
-
(): void
|
|
2362
|
+
(): Promise<void>;
|
|
2418
2363
|
} : {
|
|
2419
|
-
(data: T): void
|
|
2364
|
+
(data: T): Promise<void>;
|
|
2420
2365
|
}): void;
|
|
2421
2366
|
/** Triggers all the callbacks assigned to this event. */
|
|
2422
|
-
trigger: (data?: T) => void
|
|
2367
|
+
trigger: (data?: T) => Promise<void>;
|
|
2423
2368
|
/** Gets rid of all the suscribed events. */
|
|
2424
2369
|
reset(): void;
|
|
2425
2370
|
private handlers;
|
|
@@ -2545,10 +2490,11 @@ export declare abstract class Component extends Base {
|
|
|
2545
2490
|
*/
|
|
2546
2491
|
abstract enabled: boolean;
|
|
2547
2492
|
}
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2493
|
+
import { InverseAttribute } from "./types";
|
|
2494
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2495
|
+
forRelating: InverseAttribute;
|
|
2496
|
+
forRelated: InverseAttribute;
|
|
2497
|
+
}>;
|
|
2552
2498
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2553
2499
|
import { Components } from "../../Components";
|
|
2554
2500
|
/**
|
|
@@ -2568,11 +2514,6 @@ export declare abstract class Base {
|
|
|
2568
2514
|
/** Whether is component is {@link Configurable}. */
|
|
2569
2515
|
isConfigurable: () => this is Configurable<any>;
|
|
2570
2516
|
}
|
|
2571
|
-
import { InverseAttribute } from "./types";
|
|
2572
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2573
|
-
forRelating: InverseAttribute;
|
|
2574
|
-
forRelated: InverseAttribute;
|
|
2575
|
-
}>;
|
|
2576
2517
|
import { Base } from "./base";
|
|
2577
2518
|
import { World } from "./world";
|
|
2578
2519
|
import { Event } from "./event";
|
|
@@ -2744,6 +2685,82 @@ export interface World extends Disposable, Updateable {
|
|
|
2744
2685
|
isDisposing: boolean;
|
|
2745
2686
|
}
|
|
2746
2687
|
import * as THREE from "three";
|
|
2688
|
+
import { Disposable, Event } from "../../Types";
|
|
2689
|
+
/**
|
|
2690
|
+
* 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.
|
|
2691
|
+
*/
|
|
2692
|
+
export declare class Mouse implements Disposable {
|
|
2693
|
+
dom: HTMLCanvasElement;
|
|
2694
|
+
private _event?;
|
|
2695
|
+
private _position;
|
|
2696
|
+
/** {@link Disposable.onDisposed} */
|
|
2697
|
+
readonly onDisposed: Event<unknown>;
|
|
2698
|
+
constructor(dom: HTMLCanvasElement);
|
|
2699
|
+
/**
|
|
2700
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2701
|
+
*/
|
|
2702
|
+
get position(): THREE.Vector2;
|
|
2703
|
+
/** {@link Disposable.dispose} */
|
|
2704
|
+
dispose(): void;
|
|
2705
|
+
private getPositionY;
|
|
2706
|
+
private getPositionX;
|
|
2707
|
+
private updateMouseInfo;
|
|
2708
|
+
private setupEvents;
|
|
2709
|
+
}
|
|
2710
|
+
import * as THREE from "three";
|
|
2711
|
+
import { Components } from "../../Components";
|
|
2712
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2713
|
+
import { Mouse } from "./mouse";
|
|
2714
|
+
/**
|
|
2715
|
+
* 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.
|
|
2716
|
+
*/
|
|
2717
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2718
|
+
/** {@link Component.enabled} */
|
|
2719
|
+
enabled: boolean;
|
|
2720
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2721
|
+
components: Components;
|
|
2722
|
+
/** {@link Disposable.onDisposed} */
|
|
2723
|
+
readonly onDisposed: Event<unknown>;
|
|
2724
|
+
/** The position of the mouse in the screen. */
|
|
2725
|
+
readonly mouse: Mouse;
|
|
2726
|
+
/**
|
|
2727
|
+
* A reference to the Three.js Raycaster instance.
|
|
2728
|
+
* This is used for raycasting operations.
|
|
2729
|
+
*/
|
|
2730
|
+
readonly three: THREE.Raycaster;
|
|
2731
|
+
/**
|
|
2732
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2733
|
+
* This is used to access the camera and meshes.
|
|
2734
|
+
*/
|
|
2735
|
+
world: World;
|
|
2736
|
+
constructor(components: Components, world: World);
|
|
2737
|
+
/** {@link Disposable.dispose} */
|
|
2738
|
+
dispose(): void;
|
|
2739
|
+
/**
|
|
2740
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2741
|
+
* the first item found. This also takes into account the clipping planes
|
|
2742
|
+
* used by the renderer.
|
|
2743
|
+
*
|
|
2744
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2745
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2746
|
+
* {@link Components.meshes}.
|
|
2747
|
+
*/
|
|
2748
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2749
|
+
/**
|
|
2750
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2751
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2752
|
+
*
|
|
2753
|
+
* @param origin - The origin of the ray.
|
|
2754
|
+
* @param direction - The direction of the ray.
|
|
2755
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2756
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2757
|
+
*/
|
|
2758
|
+
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;
|
|
2759
|
+
private intersect;
|
|
2760
|
+
private filterClippingPlanes;
|
|
2761
|
+
}
|
|
2762
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2763
|
+
import * as THREE from "three";
|
|
2747
2764
|
import { Components } from "../../Components";
|
|
2748
2765
|
import { AsyncEvent, Event, World } from "../../Types";
|
|
2749
2766
|
/**
|
|
@@ -2890,70 +2907,169 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
2890
2907
|
private handleWorkerMessage;
|
|
2891
2908
|
private getAvailableMaterial;
|
|
2892
2909
|
}
|
|
2893
|
-
|
|
2894
|
-
import
|
|
2895
|
-
import { Disposable, Event } from "../../Types";
|
|
2910
|
+
import { NavigationMode } from "./types";
|
|
2911
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2896
2912
|
/**
|
|
2897
|
-
* A
|
|
2913
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
2898
2914
|
*/
|
|
2899
|
-
export declare class
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
/** {@link
|
|
2904
|
-
readonly
|
|
2905
|
-
constructor(
|
|
2906
|
-
/**
|
|
2907
|
-
|
|
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;
|
|
2915
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
2916
|
+
private camera;
|
|
2917
|
+
/** {@link NavigationMode.enabled} */
|
|
2918
|
+
enabled: boolean;
|
|
2919
|
+
/** {@link NavigationMode.id} */
|
|
2920
|
+
readonly id = "FirstPerson";
|
|
2921
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2922
|
+
/** {@link NavigationMode.set} */
|
|
2923
|
+
set(active: boolean): void;
|
|
2924
|
+
private setupFirstPersonCamera;
|
|
2916
2925
|
}
|
|
2917
|
-
import
|
|
2918
|
-
import {
|
|
2926
|
+
import { NavigationMode } from "./types";
|
|
2927
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2919
2928
|
/**
|
|
2920
|
-
* A
|
|
2921
|
-
*
|
|
2922
|
-
* @template T - The type of the scene. Default is BaseScene.
|
|
2923
|
-
* @template U - The type of the camera. Default is BaseCamera.
|
|
2924
|
-
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2929
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2925
2930
|
*/
|
|
2926
|
-
export declare class
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
*/
|
|
2930
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2931
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2932
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2933
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2934
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2935
|
-
/** {@link Disposable.onDisposed} */
|
|
2936
|
-
readonly onDisposed: Event<unknown>;
|
|
2937
|
-
/**
|
|
2938
|
-
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
2939
|
-
*/
|
|
2940
|
-
isDisposing: boolean;
|
|
2941
|
-
/**
|
|
2942
|
-
* Indicates whether the world is currently enabled.
|
|
2943
|
-
* When disabled, the world will not be updated.
|
|
2944
|
-
*/
|
|
2931
|
+
export declare class OrbitMode implements NavigationMode {
|
|
2932
|
+
camera: OrthoPerspectiveCamera;
|
|
2933
|
+
/** {@link NavigationMode.enabled} */
|
|
2945
2934
|
enabled: boolean;
|
|
2946
|
-
/**
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2935
|
+
/** {@link NavigationMode.id} */
|
|
2936
|
+
readonly id = "Orbit";
|
|
2937
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2938
|
+
/** {@link NavigationMode.set} */
|
|
2939
|
+
set(active: boolean): void;
|
|
2940
|
+
private activateOrbitControls;
|
|
2941
|
+
}
|
|
2942
|
+
import { NavigationMode } from "./types";
|
|
2943
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2944
|
+
/**
|
|
2945
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
2946
|
+
*/
|
|
2947
|
+
export declare class PlanMode implements NavigationMode {
|
|
2948
|
+
private camera;
|
|
2949
|
+
/** {@link NavigationMode.enabled} */
|
|
2950
|
+
enabled: boolean;
|
|
2951
|
+
/** {@link NavigationMode.id} */
|
|
2952
|
+
readonly id = "Plan";
|
|
2953
|
+
private mouseAction1?;
|
|
2954
|
+
private mouseAction2?;
|
|
2955
|
+
private mouseInitialized;
|
|
2956
|
+
private readonly defaultAzimuthSpeed;
|
|
2957
|
+
private readonly defaultPolarSpeed;
|
|
2958
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2959
|
+
/** {@link NavigationMode.set} */
|
|
2960
|
+
set(active: boolean): void;
|
|
2961
|
+
}
|
|
2962
|
+
import * as THREE from "three";
|
|
2963
|
+
import { CameraProjection } from "./types";
|
|
2964
|
+
import { Event } from "../../Types";
|
|
2965
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2966
|
+
/**
|
|
2967
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2968
|
+
*/
|
|
2969
|
+
export declare class ProjectionManager {
|
|
2970
|
+
/**
|
|
2971
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
2972
|
+
*/
|
|
2973
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2974
|
+
/**
|
|
2975
|
+
* Current projection mode of the camera.
|
|
2976
|
+
* Default is "Perspective".
|
|
2977
|
+
*/
|
|
2978
|
+
current: CameraProjection;
|
|
2979
|
+
/**
|
|
2980
|
+
* The camera controlled by this ProjectionManager.
|
|
2981
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2982
|
+
*/
|
|
2983
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2984
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
2985
|
+
matchOrthoDistanceEnabled: boolean;
|
|
2986
|
+
private _component;
|
|
2987
|
+
private _previousDistance;
|
|
2988
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2989
|
+
/**
|
|
2990
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2991
|
+
*
|
|
2992
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
2993
|
+
* it will have no effect.
|
|
2994
|
+
*/
|
|
2995
|
+
set(projection: CameraProjection): Promise<void>;
|
|
2996
|
+
/**
|
|
2997
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
2998
|
+
* and vice versa.
|
|
2999
|
+
*/
|
|
3000
|
+
toggle(): Promise<void>;
|
|
3001
|
+
private setOrthoCamera;
|
|
3002
|
+
private getPerspectiveDims;
|
|
3003
|
+
private setupOrthoCamera;
|
|
3004
|
+
private getDistance;
|
|
3005
|
+
private setPerspectiveCamera;
|
|
3006
|
+
}
|
|
3007
|
+
/**
|
|
3008
|
+
* The projection system of the camera.
|
|
3009
|
+
*/
|
|
3010
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3011
|
+
/**
|
|
3012
|
+
* The extensible list of supported navigation modes.
|
|
3013
|
+
*/
|
|
3014
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3015
|
+
/**
|
|
3016
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3017
|
+
*/
|
|
3018
|
+
export interface NavigationMode {
|
|
3019
|
+
/** The unique ID of this navigation mode. */
|
|
3020
|
+
id: NavModeID;
|
|
3021
|
+
/**
|
|
3022
|
+
* Enable or disable this navigation mode.
|
|
3023
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3024
|
+
* must be disabled.
|
|
3025
|
+
*
|
|
3026
|
+
* @param active - whether to enable or disable this mode.
|
|
3027
|
+
* @param options - any additional data required to enable or disable it.
|
|
3028
|
+
* */
|
|
3029
|
+
set: (active: boolean, options?: any) => void;
|
|
3030
|
+
/** Whether this navigation mode is active or not. */
|
|
3031
|
+
enabled: boolean;
|
|
3032
|
+
}
|
|
3033
|
+
import * as THREE from "three";
|
|
3034
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
3035
|
+
/**
|
|
3036
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
3037
|
+
*
|
|
3038
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
3039
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
3040
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
3041
|
+
*/
|
|
3042
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
3043
|
+
/**
|
|
3044
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
3045
|
+
*/
|
|
3046
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
3047
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3048
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
3049
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3050
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
3051
|
+
/** {@link Disposable.onDisposed} */
|
|
3052
|
+
readonly onDisposed: Event<unknown>;
|
|
3053
|
+
/**
|
|
3054
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
3055
|
+
*/
|
|
3056
|
+
isDisposing: boolean;
|
|
3057
|
+
/**
|
|
3058
|
+
* Indicates whether the world is currently enabled.
|
|
3059
|
+
* When disabled, the world will not be updated.
|
|
3060
|
+
*/
|
|
3061
|
+
enabled: boolean;
|
|
3062
|
+
/**
|
|
3063
|
+
* A unique identifier for the world.
|
|
3064
|
+
*/
|
|
3065
|
+
uuid: string;
|
|
3066
|
+
/**
|
|
3067
|
+
* An optional name for the world.
|
|
3068
|
+
*/
|
|
3069
|
+
name?: string;
|
|
3070
|
+
private _scene?;
|
|
3071
|
+
private _camera?;
|
|
3072
|
+
private _renderer;
|
|
2957
3073
|
/**
|
|
2958
3074
|
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
2959
3075
|
* @returns The current scene.
|
|
@@ -2994,58 +3110,6 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
2994
3110
|
dispose(disposeResources?: boolean): void;
|
|
2995
3111
|
}
|
|
2996
3112
|
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";
|
|
3049
3113
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3050
3114
|
import { Components } from "../../Components";
|
|
3051
3115
|
/**
|
|
@@ -3200,21 +3264,105 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
3200
3264
|
private setupEvents;
|
|
3201
3265
|
private static getSubsetOfThree;
|
|
3202
3266
|
}
|
|
3203
|
-
import
|
|
3204
|
-
import
|
|
3267
|
+
import * as THREE from "three";
|
|
3268
|
+
import * as WEBIFC from "web-ifc";
|
|
3269
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3270
|
+
export declare class CivilReader {
|
|
3271
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3272
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3273
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3274
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3275
|
+
} | undefined;
|
|
3276
|
+
get(civilItems: any): {
|
|
3277
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3278
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3279
|
+
} | undefined;
|
|
3280
|
+
private getCurves;
|
|
3281
|
+
}
|
|
3282
|
+
import * as THREE from "three";
|
|
3283
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3284
|
+
import { Components } from "../../Components";
|
|
3205
3285
|
/**
|
|
3206
|
-
*
|
|
3286
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
3207
3287
|
*/
|
|
3208
|
-
export
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3288
|
+
export interface GridConfig {
|
|
3289
|
+
/**
|
|
3290
|
+
* The color of the grid lines.
|
|
3291
|
+
*/
|
|
3292
|
+
color: THREE.Color;
|
|
3293
|
+
/**
|
|
3294
|
+
* The size of the primary grid lines.
|
|
3295
|
+
*/
|
|
3296
|
+
size1: number;
|
|
3297
|
+
/**
|
|
3298
|
+
* The size of the secondary grid lines.
|
|
3299
|
+
*/
|
|
3300
|
+
size2: number;
|
|
3301
|
+
/**
|
|
3302
|
+
* The distance at which the grid lines start to fade away.
|
|
3303
|
+
*/
|
|
3304
|
+
distance: number;
|
|
3305
|
+
}
|
|
3306
|
+
/**
|
|
3307
|
+
* 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).
|
|
3308
|
+
*/
|
|
3309
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3310
|
+
/** {@link Disposable.onDisposed} */
|
|
3311
|
+
readonly onDisposed: Event<unknown>;
|
|
3312
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3313
|
+
world: World;
|
|
3314
|
+
/** The components instance to which this grid belongs. */
|
|
3315
|
+
components: Components;
|
|
3316
|
+
/** {@link Hideable.visible} */
|
|
3317
|
+
get visible(): boolean;
|
|
3318
|
+
/** {@link Hideable.visible} */
|
|
3319
|
+
set visible(visible: boolean);
|
|
3320
|
+
/** The material of the grid. */
|
|
3321
|
+
get material(): THREE.ShaderMaterial;
|
|
3322
|
+
/**
|
|
3323
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3324
|
+
* perspective cameras and false for orthographic cameras.
|
|
3325
|
+
*/
|
|
3326
|
+
get fade(): boolean;
|
|
3327
|
+
/**
|
|
3328
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3329
|
+
* perspective cameras and false for orthographic cameras.
|
|
3330
|
+
*/
|
|
3331
|
+
set fade(active: boolean);
|
|
3332
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3333
|
+
readonly three: THREE.Mesh;
|
|
3334
|
+
private _fade;
|
|
3335
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
3336
|
+
/** {@link Disposable.dispose} */
|
|
3337
|
+
dispose(): void;
|
|
3338
|
+
private setupEvents;
|
|
3339
|
+
private updateZoom;
|
|
3340
|
+
}
|
|
3341
|
+
import * as WEBIFC from "web-ifc";
|
|
3342
|
+
export declare class IfcMetadataReader {
|
|
3343
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3344
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3345
|
+
}
|
|
3346
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3347
|
+
/**
|
|
3348
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3349
|
+
*/
|
|
3350
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3351
|
+
/**
|
|
3352
|
+
* Amount of properties to be streamed.
|
|
3353
|
+
* Defaults to 100 properties.
|
|
3354
|
+
*/
|
|
3355
|
+
propertiesSize: number;
|
|
3356
|
+
}
|
|
3357
|
+
import * as WEBIFC from "web-ifc";
|
|
3358
|
+
import * as THREE from "three";
|
|
3359
|
+
export declare class Units {
|
|
3360
|
+
factor: number;
|
|
3361
|
+
complement: number;
|
|
3362
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3363
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3364
|
+
private getLengthUnits;
|
|
3365
|
+
private getScaleMatrix;
|
|
3218
3366
|
}
|
|
3219
3367
|
import * as THREE from "three";
|
|
3220
3368
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3315,154 +3463,6 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3315
3463
|
private newHelper;
|
|
3316
3464
|
private static newPlaneMesh;
|
|
3317
3465
|
}
|
|
3318
|
-
import { NavigationMode } from "./types";
|
|
3319
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3320
|
-
/**
|
|
3321
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3322
|
-
*/
|
|
3323
|
-
export declare class PlanMode implements NavigationMode {
|
|
3324
|
-
private camera;
|
|
3325
|
-
/** {@link NavigationMode.enabled} */
|
|
3326
|
-
enabled: boolean;
|
|
3327
|
-
/** {@link NavigationMode.id} */
|
|
3328
|
-
readonly id = "Plan";
|
|
3329
|
-
private mouseAction1?;
|
|
3330
|
-
private mouseAction2?;
|
|
3331
|
-
private mouseInitialized;
|
|
3332
|
-
private readonly defaultAzimuthSpeed;
|
|
3333
|
-
private readonly defaultPolarSpeed;
|
|
3334
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3335
|
-
/** {@link NavigationMode.set} */
|
|
3336
|
-
set(active: boolean): void;
|
|
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
|
-
}
|
|
3354
|
-
/**
|
|
3355
|
-
* The projection system of the camera.
|
|
3356
|
-
*/
|
|
3357
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3358
|
-
/**
|
|
3359
|
-
* The extensible list of supported navigation modes.
|
|
3360
|
-
*/
|
|
3361
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3362
|
-
/**
|
|
3363
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3364
|
-
*/
|
|
3365
|
-
export interface NavigationMode {
|
|
3366
|
-
/** The unique ID of this navigation mode. */
|
|
3367
|
-
id: NavModeID;
|
|
3368
|
-
/**
|
|
3369
|
-
* Enable or disable this navigation mode.
|
|
3370
|
-
* When a new navigation mode is enabled, the previous navigation mode
|
|
3371
|
-
* must be disabled.
|
|
3372
|
-
*
|
|
3373
|
-
* @param active - whether to enable or disable this mode.
|
|
3374
|
-
* @param options - any additional data required to enable or disable it.
|
|
3375
|
-
* */
|
|
3376
|
-
set: (active: boolean, options?: any) => void;
|
|
3377
|
-
/** Whether this navigation mode is active or not. */
|
|
3378
|
-
enabled: boolean;
|
|
3379
|
-
}
|
|
3380
|
-
import * as THREE from "three";
|
|
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;
|
|
3424
|
-
}
|
|
3425
|
-
import * as THREE from "three";
|
|
3426
|
-
import * as WEBIFC from "web-ifc";
|
|
3427
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
3428
|
-
export declare class CivilReader {
|
|
3429
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
3430
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
3431
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
3432
|
-
coordinationMatrix: THREE.Matrix4;
|
|
3433
|
-
} | undefined;
|
|
3434
|
-
get(civilItems: any): {
|
|
3435
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
3436
|
-
coordinationMatrix: THREE.Matrix4;
|
|
3437
|
-
} | undefined;
|
|
3438
|
-
private getCurves;
|
|
3439
|
-
}
|
|
3440
|
-
import * as WEBIFC from "web-ifc";
|
|
3441
|
-
export declare class IfcMetadataReader {
|
|
3442
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3443
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
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
|
-
}
|
|
3455
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3456
|
-
/**
|
|
3457
|
-
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3458
|
-
*/
|
|
3459
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3460
|
-
/**
|
|
3461
|
-
* Amount of properties to be streamed.
|
|
3462
|
-
* Defaults to 100 properties.
|
|
3463
|
-
*/
|
|
3464
|
-
propertiesSize: number;
|
|
3465
|
-
}
|
|
3466
3466
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3467
3467
|
/**
|
|
3468
3468
|
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|