@thatopen/components 2.1.9 → 2.1.10
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/Classifier/index.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +4 -4
- package/dist/namespace.d.ts +2035 -2035
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,571 +1,706 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
2
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
3
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
4
|
+
import { Components } from "../Components";
|
|
6
5
|
/**
|
|
7
|
-
* A
|
|
6
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
8
7
|
*/
|
|
9
|
-
export declare class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export declare class Grids extends Component implements Disposable {
|
|
9
|
+
/**
|
|
10
|
+
* A unique identifier for the component.
|
|
11
|
+
* This UUID is used to register the component within the Components system.
|
|
12
|
+
*/
|
|
13
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
14
|
+
/**
|
|
15
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
16
|
+
*/
|
|
17
|
+
list: Map<string, SimpleGrid>;
|
|
18
|
+
/**
|
|
19
|
+
* The default configuration for grid creation.
|
|
20
|
+
*/
|
|
21
|
+
config: Required<GridConfig>;
|
|
13
22
|
/** {@link Disposable.onDisposed} */
|
|
14
23
|
readonly onDisposed: Event<unknown>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
private _meshes;
|
|
24
|
+
/** {@link Component.enabled} */
|
|
25
|
+
enabled: boolean;
|
|
18
26
|
constructor(components: Components);
|
|
19
27
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param bbox - The bounding box to calculate the dimensions for.
|
|
23
|
-
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
24
|
-
*/
|
|
25
|
-
static getDimensions(bbox: THREE.Box3): {
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
depth: number;
|
|
29
|
-
center: THREE.Vector3;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* A static method to create a new bounding box boundary.
|
|
33
|
-
*
|
|
34
|
-
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
35
|
-
* @returns A new THREE.Vector3 representing the boundary.
|
|
36
|
-
*
|
|
37
|
-
* @remarks
|
|
38
|
-
* This method is used to create a new boundary for calculating bounding boxes.
|
|
39
|
-
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
40
|
-
* depending on the value of the 'positive' parameter.
|
|
28
|
+
* Creates a new grid for the given world.
|
|
29
|
+
* Throws an error if a grid already exists for the world.
|
|
41
30
|
*
|
|
42
|
-
* @
|
|
43
|
-
*
|
|
44
|
-
* const positiveBound = BoundingBoxer.newBound(true);
|
|
45
|
-
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
31
|
+
* @param world - The world to create the grid for.
|
|
32
|
+
* @returns The newly created grid.
|
|
46
33
|
*
|
|
47
|
-
*
|
|
48
|
-
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
49
|
-
* '''
|
|
34
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
50
35
|
*/
|
|
51
|
-
|
|
36
|
+
create(world: World): SimpleGrid;
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
38
|
+
* Deletes the grid associated with the given world.
|
|
39
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
54
40
|
*
|
|
55
|
-
* @param
|
|
56
|
-
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
57
|
-
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
58
|
-
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
41
|
+
* @param world - The world for which to delete the grid.
|
|
59
42
|
*
|
|
60
43
|
* @remarks
|
|
61
|
-
* This method
|
|
62
|
-
* If the
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* '''typescript
|
|
66
|
-
* const points = [
|
|
67
|
-
* new THREE.Vector3(1, 2, 3),
|
|
68
|
-
* new THREE.Vector3(4, 5, 6),
|
|
69
|
-
* new THREE.Vector3(7, 8, 9),
|
|
70
|
-
* ];
|
|
71
|
-
*
|
|
72
|
-
* const bbox = BoundingBoxer.getBounds(points);
|
|
73
|
-
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
74
|
-
* '''
|
|
44
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
45
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
75
46
|
*/
|
|
76
|
-
|
|
47
|
+
delete(world: World): void;
|
|
77
48
|
/** {@link Disposable.dispose} */
|
|
78
49
|
dispose(): void;
|
|
50
|
+
}
|
|
51
|
+
import { Component, Disposable, Event } from "../Types";
|
|
52
|
+
/**
|
|
53
|
+
* 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.
|
|
54
|
+
*/
|
|
55
|
+
export declare class Components implements Disposable {
|
|
79
56
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
86
|
-
* The returned box represents the bounding box of the calculated fragments.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* '''typescript
|
|
90
|
-
* const boundingBox = boundingBoxer.get();
|
|
91
|
-
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
92
|
-
* '''
|
|
57
|
+
* The version of the @thatopen/components library.
|
|
93
58
|
*/
|
|
94
|
-
|
|
59
|
+
static readonly release = "2.1.10";
|
|
60
|
+
/** {@link Disposable.onDisposed} */
|
|
61
|
+
readonly onDisposed: Event<void>;
|
|
95
62
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* @returns A new THREE.Sphere instance representing the calculated sphere.
|
|
99
|
-
*
|
|
100
|
-
* @remarks
|
|
101
|
-
* This method calculates the center and radius of a sphere that encompasses the entire bounding box.
|
|
102
|
-
* The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
|
|
103
|
-
* The radius is calculated as the distance from the center to the minimum bound.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* '''typescript
|
|
107
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
108
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
109
|
-
* const boundingSphere = boundingBoxer.getSphere();
|
|
110
|
-
* console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
|
|
111
|
-
* '''
|
|
63
|
+
* The list of components created in this app.
|
|
64
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
112
65
|
*/
|
|
113
|
-
|
|
66
|
+
readonly list: Map<string, Component>;
|
|
114
67
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @returns A new THREE.Mesh instance representing the bounding box.
|
|
118
|
-
*
|
|
119
|
-
* @remarks
|
|
120
|
-
* This method calculates the dimensions of the bounding box using the 'getDimensions' method.
|
|
121
|
-
* It then creates a new THREE.BoxGeometry with the calculated dimensions.
|
|
122
|
-
* A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
|
|
123
|
-
* The position of the mesh is set to the center of the bounding box.
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* '''typescript
|
|
127
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
128
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
129
|
-
* const boundingBoxMesh = boundingBoxer.getMesh();
|
|
130
|
-
* scene.add(boundingBoxMesh);
|
|
131
|
-
* '''
|
|
68
|
+
* If disabled, the animation loop will be stopped.
|
|
69
|
+
* Default value is false.
|
|
132
70
|
*/
|
|
133
|
-
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
private _clock;
|
|
134
73
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
74
|
+
* Adds a component to the list of components.
|
|
75
|
+
* Throws an error if a component with the same UUID already exists.
|
|
137
76
|
*
|
|
138
|
-
* @
|
|
139
|
-
*
|
|
140
|
-
* It ensures that the bounding box calculations are accurate and up-to-date.
|
|
77
|
+
* @param uuid - The unique identifier of the component.
|
|
78
|
+
* @param instance - The instance of the component to be added.
|
|
141
79
|
*
|
|
142
|
-
* @
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
146
|
-
* // ...
|
|
147
|
-
* boundingBoxer.reset();
|
|
148
|
-
* '''
|
|
80
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
149
83
|
*/
|
|
150
|
-
|
|
84
|
+
add(uuid: string, instance: Component): void;
|
|
151
85
|
/**
|
|
152
|
-
*
|
|
86
|
+
* Retrieves a component instance by its constructor function.
|
|
87
|
+
* If the component does not exist in the list, it will be created and added.
|
|
153
88
|
*
|
|
154
|
-
* @
|
|
89
|
+
* @template U - The type of the component to retrieve.
|
|
90
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
155
91
|
*
|
|
156
|
-
* @
|
|
157
|
-
* This method iterates through each fragment in the provided FragmentsGroup,
|
|
158
|
-
* and calls the 'addMesh' method for each fragment's mesh.
|
|
92
|
+
* @returns The instance of the requested component.
|
|
159
93
|
*
|
|
160
|
-
* @
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
164
|
-
* '''
|
|
94
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
95
|
+
*
|
|
96
|
+
* @internal
|
|
165
97
|
*/
|
|
166
|
-
|
|
98
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
99
|
+
constructor();
|
|
167
100
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* @param itemIDs - An optional iterable of numbers representing the item IDs.
|
|
172
|
-
*
|
|
173
|
-
* @remarks
|
|
174
|
-
* This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
|
|
175
|
-
* If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
|
|
176
|
-
* If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
|
|
101
|
+
* Initializes the Components instance.
|
|
102
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
103
|
+
* and calls the update method.
|
|
177
104
|
*
|
|
178
|
-
* @
|
|
179
|
-
* '''typescript
|
|
180
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
181
|
-
* boundingBoxer.addMesh(mesh);
|
|
182
|
-
* '''
|
|
105
|
+
* @returns {void}
|
|
183
106
|
*/
|
|
184
|
-
|
|
107
|
+
init(): void;
|
|
185
108
|
/**
|
|
186
|
-
*
|
|
109
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
110
|
+
* the library. A memory leak will be created if:
|
|
187
111
|
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
112
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
113
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
114
|
+
* Angular, Vue, etc).
|
|
190
115
|
*
|
|
191
|
-
*
|
|
116
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
117
|
+
* referenced by a reference type (object or array).
|
|
192
118
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* It ensures that the bounding box calculations are accurate and up-to-date by updating the internal minimum and maximum vectors.
|
|
119
|
+
* You can learn more about how Three.js handles memory leaks
|
|
120
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
196
121
|
*
|
|
197
|
-
* @example
|
|
198
|
-
* '''typescript
|
|
199
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
200
|
-
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
201
|
-
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
202
|
-
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
203
|
-
* };
|
|
204
|
-
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
205
|
-
* '''
|
|
206
122
|
*/
|
|
207
|
-
|
|
208
|
-
private
|
|
123
|
+
dispose(): void;
|
|
124
|
+
private update;
|
|
125
|
+
private static setupBVH;
|
|
209
126
|
}
|
|
210
|
-
import
|
|
127
|
+
import * as THREE from "three";
|
|
128
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
129
|
+
import { SimplePlane } from "./src";
|
|
130
|
+
import { Components } from "../Components";
|
|
211
131
|
/**
|
|
212
|
-
*
|
|
132
|
+
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
133
|
+
*
|
|
134
|
+
* @param components - the instance of {@link Components} used.
|
|
135
|
+
* E.g. {@link SimplePlane}.
|
|
213
136
|
*/
|
|
214
|
-
export declare class
|
|
137
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
215
138
|
/**
|
|
216
139
|
* A unique identifier for the component.
|
|
217
140
|
* This UUID is used to register the component within the Components system.
|
|
218
141
|
*/
|
|
219
|
-
static readonly uuid: "
|
|
142
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
143
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
144
|
+
readonly onBeforeDrag: Event<void>;
|
|
145
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
146
|
+
readonly onAfterDrag: Event<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
149
|
+
*/
|
|
150
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
151
|
+
/**
|
|
152
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
153
|
+
*/
|
|
154
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
155
|
+
/**
|
|
156
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
157
|
+
*/
|
|
158
|
+
readonly onAfterCancel: Event<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
161
|
+
*/
|
|
162
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
163
|
+
/**
|
|
164
|
+
* Event that fires after a clipping plane has been created.
|
|
165
|
+
* @param plane - The newly created clipping plane.
|
|
166
|
+
*/
|
|
167
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
168
|
+
/**
|
|
169
|
+
* Event that fires after a clipping plane has been deleted.
|
|
170
|
+
* @param plane - The deleted clipping plane.
|
|
171
|
+
*/
|
|
172
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
220
173
|
/** {@link Disposable.onDisposed} */
|
|
221
|
-
readonly onDisposed: Event<
|
|
222
|
-
/** {@link Component.enabled} */
|
|
223
|
-
enabled: boolean;
|
|
174
|
+
readonly onDisposed: Event<string>;
|
|
224
175
|
/**
|
|
225
|
-
*
|
|
226
|
-
* This
|
|
227
|
-
*
|
|
176
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
177
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
178
|
+
* clipping plane is created in its roof, which might have a slight
|
|
179
|
+
* slope for draining purposes.
|
|
228
180
|
*/
|
|
229
|
-
|
|
181
|
+
orthogonalY: boolean;
|
|
230
182
|
/**
|
|
231
|
-
* The
|
|
232
|
-
*
|
|
233
|
-
*
|
|
183
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
184
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
185
|
+
* has to be 'true' for this to apply.
|
|
234
186
|
*/
|
|
235
|
-
|
|
187
|
+
toleranceOrthogonalY: number;
|
|
236
188
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
189
|
+
* The type of clipping plane to be created.
|
|
190
|
+
* Default is {@link SimplePlane}.
|
|
239
191
|
*/
|
|
240
|
-
|
|
192
|
+
Type: new (...args: any) => SimplePlane;
|
|
193
|
+
/**
|
|
194
|
+
* A list of all the clipping planes created by this component.
|
|
195
|
+
*/
|
|
196
|
+
list: SimplePlane[];
|
|
197
|
+
/** The material used in all the clipping planes. */
|
|
198
|
+
private _material;
|
|
199
|
+
private _size;
|
|
200
|
+
private _enabled;
|
|
201
|
+
private _visible;
|
|
202
|
+
/** {@link Component.enabled} */
|
|
203
|
+
get enabled(): boolean;
|
|
204
|
+
/** {@link Component.enabled} */
|
|
205
|
+
set enabled(state: boolean);
|
|
206
|
+
/** {@link Hideable.visible } */
|
|
207
|
+
get visible(): boolean;
|
|
208
|
+
/** {@link Hideable.visible } */
|
|
209
|
+
set visible(state: boolean);
|
|
210
|
+
/** The material of the clipping plane representation. */
|
|
211
|
+
get material(): THREE.MeshBasicMaterial;
|
|
212
|
+
/** The material of the clipping plane representation. */
|
|
213
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
214
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
215
|
+
get size(): number;
|
|
216
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
217
|
+
set size(size: number);
|
|
241
218
|
constructor(components: Components);
|
|
242
219
|
/** {@link Disposable.dispose} */
|
|
243
220
|
dispose(): void;
|
|
221
|
+
/** {@link Createable.create} */
|
|
222
|
+
create(world: World): SimplePlane | null;
|
|
244
223
|
/**
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
224
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
225
|
+
* without the need of the mouse.
|
|
248
226
|
*
|
|
249
|
-
* @
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
227
|
+
* @param world - the world where this plane should be created.
|
|
228
|
+
* @param normal - the orientation of the clipping plane.
|
|
229
|
+
* @param point - the position of the clipping plane.
|
|
230
|
+
* navigation.
|
|
231
|
+
*/
|
|
232
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
233
|
+
/**
|
|
234
|
+
* {@link Createable.delete}
|
|
253
235
|
*
|
|
254
|
-
*
|
|
236
|
+
* @param world - the world where the plane to delete is.
|
|
237
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
238
|
+
* found under the cursor will be deleted.
|
|
239
|
+
*/
|
|
240
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
241
|
+
/**
|
|
242
|
+
* Deletes all the existing clipping planes.
|
|
255
243
|
*
|
|
256
|
-
* @
|
|
244
|
+
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
257
245
|
*/
|
|
258
|
-
|
|
246
|
+
deleteAll(types?: Set<string>): void;
|
|
247
|
+
private deletePlane;
|
|
248
|
+
private pickPlane;
|
|
249
|
+
private getAllPlaneMeshes;
|
|
250
|
+
private createPlaneFromIntersection;
|
|
251
|
+
private getWorldNormal;
|
|
252
|
+
private normalizePlaneDirectionY;
|
|
253
|
+
private newPlane;
|
|
254
|
+
private updateMaterialsAndPlanes;
|
|
255
|
+
private _onStartDragging;
|
|
256
|
+
private _onEndDragging;
|
|
259
257
|
}
|
|
260
258
|
import * as THREE from "three";
|
|
261
|
-
import
|
|
262
|
-
import {
|
|
259
|
+
import { Components } from "../Components";
|
|
260
|
+
import { Component } from "../Types";
|
|
263
261
|
/**
|
|
264
|
-
*
|
|
262
|
+
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
265
263
|
*/
|
|
266
|
-
export
|
|
264
|
+
export declare class Disposer extends Component {
|
|
265
|
+
private _disposedComponents;
|
|
266
|
+
/** {@link Component.enabled} */
|
|
267
|
+
enabled: boolean;
|
|
267
268
|
/**
|
|
268
|
-
* A
|
|
269
|
-
*
|
|
269
|
+
* A unique identifier for the component.
|
|
270
|
+
* This UUID is used to register the component within the Components system.
|
|
270
271
|
*/
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
272
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
273
|
+
constructor(components: Components);
|
|
274
|
+
/**
|
|
275
|
+
* Return the UUIDs of all disposed components.
|
|
276
|
+
*/
|
|
277
|
+
get(): Set<string>;
|
|
278
|
+
/**
|
|
279
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
280
|
+
* using any of these in other parts of the application, make sure that you
|
|
281
|
+
* remove them from the mesh before disposing it.
|
|
282
|
+
*
|
|
283
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
284
|
+
* to remove.
|
|
285
|
+
*
|
|
286
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
287
|
+
*
|
|
288
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
289
|
+
*/
|
|
290
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
291
|
+
/**
|
|
292
|
+
* Disposes a geometry from memory.
|
|
293
|
+
*
|
|
294
|
+
* @param geometry - the
|
|
295
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
296
|
+
* to remove.
|
|
297
|
+
*/
|
|
298
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
299
|
+
private disposeGeometryAndMaterials;
|
|
300
|
+
private disposeChildren;
|
|
301
|
+
private static disposeMaterial;
|
|
282
302
|
}
|
|
303
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
304
|
+
import { Components } from "../Components";
|
|
305
|
+
import { SimpleWorld } from "./src";
|
|
283
306
|
/**
|
|
284
|
-
*
|
|
307
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
285
308
|
*/
|
|
286
|
-
export declare class
|
|
309
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
287
310
|
/**
|
|
288
311
|
* A unique identifier for the component.
|
|
289
312
|
* This UUID is used to register the component within the Components system.
|
|
290
313
|
*/
|
|
291
|
-
static readonly uuid: "
|
|
292
|
-
/** {@link
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
|
|
296
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
297
|
-
*/
|
|
298
|
-
list: Classification;
|
|
314
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
315
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
316
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
317
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
318
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
299
319
|
/** {@link Disposable.onDisposed} */
|
|
300
320
|
readonly onDisposed: Event<unknown>;
|
|
321
|
+
/**
|
|
322
|
+
* An event that is triggered when a new world is created.
|
|
323
|
+
* The event passes the newly created world as a parameter.
|
|
324
|
+
*/
|
|
325
|
+
readonly onWorldCreated: Event<World>;
|
|
326
|
+
/**
|
|
327
|
+
* An event that is triggered when a world is deleted.
|
|
328
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
329
|
+
*/
|
|
330
|
+
readonly onWorldDeleted: Event<string>;
|
|
331
|
+
/**
|
|
332
|
+
* A collection of worlds managed by this component.
|
|
333
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
334
|
+
*/
|
|
335
|
+
list: Map<string, World>;
|
|
336
|
+
/** {@link Component.enabled} */
|
|
337
|
+
enabled: boolean;
|
|
301
338
|
constructor(components: Components);
|
|
302
|
-
private onFragmentsDisposed;
|
|
303
|
-
/** {@link Disposable.dispose} */
|
|
304
|
-
dispose(): void;
|
|
305
339
|
/**
|
|
306
|
-
*
|
|
307
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
340
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
308
341
|
*
|
|
309
|
-
* @
|
|
342
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
343
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
344
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
345
|
+
*
|
|
346
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
310
347
|
*/
|
|
311
|
-
|
|
348
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
312
349
|
/**
|
|
313
|
-
*
|
|
314
|
-
* If no filter is provided, it returns all fragments.
|
|
350
|
+
* Deletes a world from the list of worlds.
|
|
315
351
|
*
|
|
316
|
-
* @param
|
|
317
|
-
* The keys of the object represent the classification system names,
|
|
318
|
-
* and the values are arrays of class names to match.
|
|
352
|
+
* @param {World} world - The world to be deleted.
|
|
319
353
|
*
|
|
320
|
-
* @
|
|
321
|
-
* where the express IDs are filtered based on the provided filter criteria.
|
|
354
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
322
355
|
*
|
|
323
|
-
* @
|
|
356
|
+
* @returns {void}
|
|
324
357
|
*/
|
|
325
|
-
|
|
326
|
-
[name: string]: string[];
|
|
327
|
-
}): FRAGS.FragmentIdMap;
|
|
358
|
+
delete(world: World): void;
|
|
328
359
|
/**
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
333
|
-
*
|
|
334
|
-
* @remarks
|
|
335
|
-
* This method iterates through the fragments in the provided group,
|
|
336
|
-
* and classifies them based on their modelID.
|
|
337
|
-
* The classification is stored in the 'list.models' property,
|
|
338
|
-
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
339
|
-
*
|
|
340
|
-
*/
|
|
341
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
342
|
-
/**
|
|
343
|
-
* Classifies fragments based on their PredefinedType property.
|
|
344
|
-
*
|
|
345
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
346
|
-
*
|
|
347
|
-
* @remarks
|
|
348
|
-
* This method iterates through the properties of the fragments in the provided group,
|
|
349
|
-
* and classifies them based on their PredefinedType property.
|
|
350
|
-
* The classification is stored in the 'list.predefinedTypes' property,
|
|
351
|
-
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
352
|
-
*
|
|
353
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
354
|
-
*/
|
|
355
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
356
|
-
/**
|
|
357
|
-
* Classifies fragments based on their entity type.
|
|
358
|
-
*
|
|
359
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
360
|
-
*
|
|
361
|
-
* @remarks
|
|
362
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
363
|
-
* and classifies them based on their entity type.
|
|
364
|
-
* The classification is stored in the 'list.entities' property,
|
|
365
|
-
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
360
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
361
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
362
|
+
* and triggers the onDisposed event.
|
|
366
363
|
*
|
|
367
|
-
* @
|
|
364
|
+
* @returns {void}
|
|
368
365
|
*/
|
|
369
|
-
|
|
366
|
+
dispose(): void;
|
|
367
|
+
/** {@link Updateable.update} */
|
|
368
|
+
update(delta?: number): void | Promise<void>;
|
|
369
|
+
}
|
|
370
|
+
import { MiniMap } from "./src";
|
|
371
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
372
|
+
import { Components } from "../Components";
|
|
373
|
+
/**
|
|
374
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
375
|
+
*/
|
|
376
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
370
377
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
374
|
-
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
375
|
-
* @param systemName - The name of the classification system to store the classification.
|
|
376
|
-
*
|
|
377
|
-
* @remarks
|
|
378
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
379
|
-
* and classifies them based on the specified IFC relationship.
|
|
380
|
-
* The classification is stored in the 'list' property under the specified system name,
|
|
381
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
382
|
-
*
|
|
383
|
-
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
378
|
+
* A unique identifier for the component.
|
|
379
|
+
* This UUID is used to register the component within the Components system.
|
|
384
380
|
*/
|
|
385
|
-
|
|
381
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
382
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
383
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
384
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
385
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
386
|
+
/** {@link Disposable.onDisposed} */
|
|
387
|
+
readonly onDisposed: Event<unknown>;
|
|
388
|
+
/** {@link Component.enabled} */
|
|
389
|
+
enabled: boolean;
|
|
386
390
|
/**
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
390
|
-
* @param config - The configuration for the classifier. It includes "useProperties", which is true by default
|
|
391
|
-
* (if false, the classification will use the expressIDs instead of the names), and "isolate", which will make
|
|
392
|
-
* the classifier just pick the WEBIFC categories provided.
|
|
393
|
-
*
|
|
394
|
-
* @remarks
|
|
395
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
396
|
-
* and classifies them based on their spatial structure in the IFC model.
|
|
397
|
-
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
398
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
399
|
-
*
|
|
400
|
-
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
391
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
401
392
|
*/
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
isolate?: Set<number>;
|
|
405
|
-
}): Promise<void>;
|
|
393
|
+
list: Map<string, MiniMap>;
|
|
394
|
+
constructor(components: Components);
|
|
406
395
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
410
|
-
* @param color - The color to set for the fragments.
|
|
411
|
-
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
412
|
-
*
|
|
413
|
-
* @remarks
|
|
414
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
415
|
-
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
396
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
397
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
416
398
|
*
|
|
417
|
-
* @
|
|
399
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
400
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
401
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
418
402
|
*/
|
|
419
|
-
|
|
403
|
+
create(world: World): MiniMap;
|
|
420
404
|
/**
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
424
|
-
*
|
|
425
|
-
* @remarks
|
|
426
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
427
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
405
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
406
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
428
407
|
*
|
|
429
|
-
* @
|
|
408
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
409
|
+
* @returns {void}
|
|
430
410
|
*/
|
|
431
|
-
|
|
432
|
-
|
|
411
|
+
delete(id: string): void;
|
|
412
|
+
/** {@link Disposable.dispose} */
|
|
413
|
+
dispose(): void;
|
|
414
|
+
/** {@link Updateable.update} */
|
|
415
|
+
update(): void;
|
|
433
416
|
}
|
|
434
|
-
import
|
|
435
|
-
import {
|
|
417
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
418
|
+
import { SimpleRaycaster } from "./src";
|
|
419
|
+
import { Components } from "../Components";
|
|
436
420
|
/**
|
|
437
|
-
* A component that
|
|
421
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
438
422
|
*/
|
|
439
|
-
export declare class
|
|
423
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
440
424
|
/**
|
|
441
425
|
* A unique identifier for the component.
|
|
442
426
|
* This UUID is used to register the component within the Components system.
|
|
443
427
|
*/
|
|
444
|
-
static readonly uuid: "
|
|
428
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
445
429
|
/** {@link Component.enabled} */
|
|
446
430
|
enabled: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* A Map that stores raycasters for each world.
|
|
433
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
434
|
+
*/
|
|
435
|
+
list: Map<string, SimpleRaycaster>;
|
|
436
|
+
/** {@link Disposable.onDisposed} */
|
|
437
|
+
onDisposed: Event<unknown>;
|
|
447
438
|
constructor(components: Components);
|
|
448
439
|
/**
|
|
449
|
-
*
|
|
450
|
-
* If
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
* @param visible - The visibility state to set for the fragments.
|
|
454
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
455
|
-
* If not provided, all fragments will be affected.
|
|
440
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
441
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
442
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
456
443
|
*
|
|
457
|
-
* @
|
|
444
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
445
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
458
446
|
*/
|
|
459
|
-
|
|
447
|
+
get(world: World): SimpleRaycaster;
|
|
460
448
|
/**
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
465
|
-
* If not provided, all fragments will be isolated.
|
|
449
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
450
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
466
451
|
*
|
|
452
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
467
453
|
* @returns {void}
|
|
468
454
|
*/
|
|
469
|
-
|
|
470
|
-
|
|
455
|
+
delete(world: World): void;
|
|
456
|
+
/** {@link Disposable.dispose} */
|
|
457
|
+
dispose(): void;
|
|
471
458
|
}
|
|
472
|
-
import
|
|
473
|
-
import {
|
|
474
|
-
import {
|
|
459
|
+
import { Components } from "../Components";
|
|
460
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
461
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
475
462
|
/**
|
|
476
|
-
* A component that
|
|
463
|
+
* 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).
|
|
477
464
|
*/
|
|
478
|
-
export declare class
|
|
465
|
+
export declare class Cullers extends Component implements Disposable {
|
|
479
466
|
/**
|
|
480
467
|
* A unique identifier for the component.
|
|
481
468
|
* This UUID is used to register the component within the Components system.
|
|
482
469
|
*/
|
|
483
|
-
static readonly uuid: "
|
|
470
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
484
471
|
/**
|
|
485
|
-
*
|
|
486
|
-
* Contains the streamed geometry data and its buffer.
|
|
472
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
487
473
|
*/
|
|
488
|
-
readonly
|
|
489
|
-
|
|
490
|
-
data: StreamedGeometries;
|
|
491
|
-
}>;
|
|
474
|
+
readonly onDisposed: Event<unknown>;
|
|
475
|
+
private _enabled;
|
|
492
476
|
/**
|
|
493
|
-
*
|
|
494
|
-
* Contains the streamed assets.
|
|
477
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
495
478
|
*/
|
|
496
|
-
|
|
479
|
+
list: Map<string, MeshCullerRenderer>;
|
|
480
|
+
/** {@link Component.enabled} */
|
|
481
|
+
get enabled(): boolean;
|
|
482
|
+
/** {@link Component.enabled} */
|
|
483
|
+
set enabled(value: boolean);
|
|
484
|
+
constructor(components: Components);
|
|
497
485
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
486
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
487
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
488
|
+
*
|
|
489
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
490
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
491
|
+
*
|
|
492
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
500
493
|
*/
|
|
501
|
-
|
|
494
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
502
495
|
/**
|
|
503
|
-
*
|
|
504
|
-
*
|
|
496
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
497
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
498
|
+
*
|
|
499
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
500
|
+
*
|
|
501
|
+
* @returns {void}
|
|
505
502
|
*/
|
|
506
|
-
|
|
507
|
-
/** {@link Disposable.
|
|
508
|
-
|
|
503
|
+
delete(world: World): void;
|
|
504
|
+
/** {@link Disposable.dispose} */
|
|
505
|
+
dispose(): void;
|
|
506
|
+
}
|
|
507
|
+
import * as THREE from "three";
|
|
508
|
+
import { Components } from "../Components";
|
|
509
|
+
import { SimpleCamera } from "..";
|
|
510
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
511
|
+
/**
|
|
512
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
513
|
+
*/
|
|
514
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
509
515
|
/**
|
|
510
|
-
*
|
|
516
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
511
517
|
*/
|
|
512
|
-
|
|
513
|
-
/** {@link Component.enabled} */
|
|
514
|
-
enabled: boolean;
|
|
518
|
+
readonly projection: ProjectionManager;
|
|
515
519
|
/**
|
|
516
|
-
*
|
|
520
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
521
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
517
522
|
*/
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
private
|
|
523
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
524
|
+
/**
|
|
525
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
526
|
+
* This camera is used when the projection mode is set to perspective.
|
|
527
|
+
*/
|
|
528
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
529
|
+
protected readonly _userInputButtons: any;
|
|
530
|
+
protected readonly _frustumSize = 50;
|
|
531
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
532
|
+
protected _mode: NavigationMode | null;
|
|
533
|
+
private previousSize;
|
|
534
|
+
/**
|
|
535
|
+
* Getter for the current navigation mode.
|
|
536
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
537
|
+
*
|
|
538
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
539
|
+
*
|
|
540
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
541
|
+
*/
|
|
542
|
+
get mode(): NavigationMode;
|
|
529
543
|
constructor(components: Components);
|
|
530
544
|
/** {@link Disposable.dispose} */
|
|
531
545
|
dispose(): void;
|
|
532
546
|
/**
|
|
533
|
-
*
|
|
547
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
534
548
|
*
|
|
535
|
-
* @param
|
|
536
|
-
|
|
549
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
550
|
+
*/
|
|
551
|
+
set(mode: NavModeID): void;
|
|
552
|
+
/**
|
|
553
|
+
* Make the camera view fit all the specified meshes.
|
|
537
554
|
*
|
|
538
|
-
* @
|
|
539
|
-
*
|
|
555
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
556
|
+
* evaluate {@link Components.meshes}.
|
|
557
|
+
* @param offset the distance to the fit object
|
|
558
|
+
*/
|
|
559
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Allows or prevents all user input.
|
|
562
|
+
*
|
|
563
|
+
* @param active - whether to enable or disable user inputs.
|
|
564
|
+
*/
|
|
565
|
+
setUserInput(active: boolean): void;
|
|
566
|
+
private disableUserInput;
|
|
567
|
+
private enableUserInput;
|
|
568
|
+
private newOrthoCamera;
|
|
569
|
+
private setOrthoPerspCameraAspect;
|
|
570
|
+
}
|
|
571
|
+
export declare class UUID {
|
|
572
|
+
private static _pattern;
|
|
573
|
+
private static _lut;
|
|
574
|
+
static create(): string;
|
|
575
|
+
static validate(uuid: string): void;
|
|
576
|
+
}
|
|
577
|
+
import * as THREE from "three";
|
|
578
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
579
|
+
center: THREE.Vector3;
|
|
580
|
+
halfSizes: THREE.Vector3;
|
|
581
|
+
rotation: THREE.Matrix3;
|
|
582
|
+
transformation: THREE.Matrix4;
|
|
583
|
+
};
|
|
584
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
585
|
+
import * as THREE from "three";
|
|
586
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
587
|
+
/**
|
|
588
|
+
* Configuration interface for the VertexPicker component.
|
|
589
|
+
*/
|
|
590
|
+
export interface VertexPickerConfig {
|
|
591
|
+
/**
|
|
592
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
593
|
+
*/
|
|
594
|
+
showOnlyVertex: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* The maximum distance for snapping to a vertex.
|
|
597
|
+
*/
|
|
598
|
+
snapDistance: number;
|
|
599
|
+
/**
|
|
600
|
+
* The HTML element to use for previewing the picked vertex.
|
|
601
|
+
*/
|
|
602
|
+
previewElement: HTMLElement;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
606
|
+
*/
|
|
607
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
608
|
+
/** {@link Disposable.onDisposed} */
|
|
609
|
+
readonly onDisposed: Event<unknown>;
|
|
610
|
+
/**
|
|
611
|
+
* An event that is triggered when a vertex is found.
|
|
612
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
613
|
+
*/
|
|
614
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
615
|
+
/**
|
|
616
|
+
* An event that is triggered when a vertex is lost.
|
|
617
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
618
|
+
*/
|
|
619
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
620
|
+
/**
|
|
621
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
622
|
+
*/
|
|
623
|
+
readonly onEnabled: Event<boolean>;
|
|
624
|
+
/**
|
|
625
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
626
|
+
*/
|
|
627
|
+
components: Components;
|
|
628
|
+
/**
|
|
629
|
+
* A reference to the working plane used for vertex picking.
|
|
630
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
631
|
+
* If this value is null, all vertices are considered valid.
|
|
632
|
+
*/
|
|
633
|
+
workingPlane: THREE.Plane | null;
|
|
634
|
+
private _pickedPoint;
|
|
635
|
+
private _config;
|
|
636
|
+
private _enabled;
|
|
637
|
+
/**
|
|
638
|
+
* Sets the enabled state of the VertexPicker.
|
|
639
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
640
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
641
|
+
*
|
|
642
|
+
* @param value - The new enabled state.
|
|
643
|
+
*/
|
|
644
|
+
set enabled(value: boolean);
|
|
645
|
+
/**
|
|
646
|
+
* Gets the current enabled state of the VertexPicker.
|
|
647
|
+
*
|
|
648
|
+
* @returns The current enabled state.
|
|
649
|
+
*/
|
|
650
|
+
get enabled(): boolean;
|
|
651
|
+
/**
|
|
652
|
+
* Sets the configuration for the VertexPicker component.
|
|
653
|
+
*
|
|
654
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
655
|
+
* The properties not provided in the value object will retain their current values.
|
|
540
656
|
*
|
|
541
657
|
* @example
|
|
542
658
|
* '''typescript
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
659
|
+
* vertexPicker.config = {
|
|
660
|
+
* snapDistance: 0.5,
|
|
661
|
+
* showOnlyVertex: true,
|
|
662
|
+
* };
|
|
547
663
|
* '''
|
|
548
664
|
*/
|
|
549
|
-
|
|
665
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
550
666
|
/**
|
|
551
|
-
*
|
|
667
|
+
* Gets the current configuration for the VertexPicker component.
|
|
552
668
|
*
|
|
553
|
-
* @
|
|
554
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
669
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
555
670
|
*
|
|
556
|
-
* @
|
|
557
|
-
*
|
|
671
|
+
* @example
|
|
672
|
+
* '''typescript
|
|
673
|
+
* const currentConfig = vertexPicker.config;
|
|
674
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
675
|
+
* '''
|
|
676
|
+
*/
|
|
677
|
+
get config(): Partial<VertexPickerConfig>;
|
|
678
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
679
|
+
/** {@link Disposable.dispose} */
|
|
680
|
+
dispose(): void;
|
|
681
|
+
/**
|
|
682
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
683
|
+
*
|
|
684
|
+
* @param world - The World instance to use for raycasting.
|
|
685
|
+
*
|
|
686
|
+
* @returns The current picked point, or null if no point is picked.
|
|
558
687
|
*
|
|
688
|
+
* @remarks
|
|
689
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
690
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
691
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
692
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
693
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
694
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
559
695
|
*/
|
|
560
|
-
|
|
561
|
-
private
|
|
562
|
-
private
|
|
563
|
-
private
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
private streamGeometries;
|
|
696
|
+
get(world: World): THREE.Vector3 | null;
|
|
697
|
+
private getClosestVertex;
|
|
698
|
+
private getVertices;
|
|
699
|
+
private getVertex;
|
|
700
|
+
}
|
|
701
|
+
import * as THREE from "three";
|
|
702
|
+
export declare class MaterialsUtils {
|
|
703
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
569
704
|
}
|
|
570
705
|
import * as THREE from "three";
|
|
571
706
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -672,180 +807,510 @@ export declare class MeasurementUtils extends Component {
|
|
|
672
807
|
private getVolumeOfMesh;
|
|
673
808
|
private getSignedVolumeOfTriangle;
|
|
674
809
|
}
|
|
675
|
-
import * as
|
|
676
|
-
import * as
|
|
677
|
-
import { Component, Components } from "../../core";
|
|
810
|
+
import * as THREE from "three";
|
|
811
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
812
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
678
813
|
/**
|
|
679
|
-
*
|
|
814
|
+
* 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.
|
|
680
815
|
*/
|
|
681
|
-
export
|
|
682
|
-
/**
|
|
683
|
-
* A unique identifier for the component.
|
|
684
|
-
* This UUID is used to register the component within the Components system.
|
|
685
|
-
*/
|
|
686
|
-
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
687
|
-
/** {@link Component.enabled} */
|
|
688
|
-
enabled: boolean;
|
|
689
|
-
constructor(components: Components);
|
|
816
|
+
export interface Classification {
|
|
690
817
|
/**
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
694
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
695
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
696
|
-
* to make the location data available (e.g. absolute position of building).
|
|
818
|
+
* A system within the classification.
|
|
819
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
697
820
|
*/
|
|
698
|
-
|
|
821
|
+
[system: string]: {
|
|
822
|
+
/**
|
|
823
|
+
* A class within the system.
|
|
824
|
+
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
825
|
+
*/
|
|
826
|
+
[className: string]: {
|
|
827
|
+
map: FRAGS.FragmentIdMap;
|
|
828
|
+
name: string;
|
|
829
|
+
id: number | null;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
699
832
|
}
|
|
700
|
-
import * as WEBIFC from "web-ifc";
|
|
701
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
702
|
-
import { IfcFragmentSettings } from "./src";
|
|
703
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
704
833
|
/**
|
|
705
|
-
* The
|
|
834
|
+
* 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).
|
|
706
835
|
*/
|
|
707
|
-
export declare class
|
|
836
|
+
export declare class Classifier extends Component implements Disposable {
|
|
708
837
|
/**
|
|
709
838
|
* A unique identifier for the component.
|
|
710
839
|
* This UUID is used to register the component within the Components system.
|
|
711
840
|
*/
|
|
712
|
-
static readonly uuid: "
|
|
713
|
-
/** {@link
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* An event triggered when the IFC file starts loading.
|
|
717
|
-
*/
|
|
718
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
841
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
842
|
+
/** {@link Component.enabled} */
|
|
843
|
+
enabled: boolean;
|
|
719
844
|
/**
|
|
720
|
-
*
|
|
845
|
+
* A map representing the classification systems.
|
|
846
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
721
847
|
*/
|
|
722
|
-
|
|
848
|
+
list: Classification;
|
|
849
|
+
/** {@link Disposable.onDisposed} */
|
|
850
|
+
readonly onDisposed: Event<unknown>;
|
|
851
|
+
constructor(components: Components);
|
|
852
|
+
private onFragmentsDisposed;
|
|
853
|
+
/** {@link Disposable.dispose} */
|
|
854
|
+
dispose(): void;
|
|
723
855
|
/**
|
|
724
|
-
*
|
|
725
|
-
*
|
|
856
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
857
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
858
|
+
*
|
|
859
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
726
860
|
*/
|
|
727
|
-
|
|
861
|
+
remove(guid: string): void;
|
|
728
862
|
/**
|
|
729
|
-
*
|
|
863
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
864
|
+
* If no filter is provided, it returns all fragments.
|
|
865
|
+
*
|
|
866
|
+
* @param filter - An optional object containing filter criteria.
|
|
867
|
+
* The keys of the object represent the classification system names,
|
|
868
|
+
* and the values are arrays of class names to match.
|
|
869
|
+
*
|
|
870
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
871
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
872
|
+
*
|
|
873
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
730
874
|
*/
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
private _material;
|
|
735
|
-
private _spatialTree;
|
|
736
|
-
private _metaData;
|
|
737
|
-
private _fragmentInstances;
|
|
738
|
-
private _civil;
|
|
739
|
-
private _visitedFragments;
|
|
740
|
-
private _materialT;
|
|
741
|
-
constructor(components: Components);
|
|
742
|
-
/** {@link Disposable.dispose} */
|
|
743
|
-
dispose(): void;
|
|
875
|
+
find(filter?: {
|
|
876
|
+
[name: string]: string[];
|
|
877
|
+
}): FRAGS.FragmentIdMap;
|
|
744
878
|
/**
|
|
745
|
-
*
|
|
879
|
+
* Classifies fragments based on their modelID.
|
|
746
880
|
*
|
|
747
|
-
* @param
|
|
748
|
-
*
|
|
881
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
882
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
749
883
|
*
|
|
750
|
-
* @
|
|
884
|
+
* @remarks
|
|
885
|
+
* This method iterates through the fragments in the provided group,
|
|
886
|
+
* and classifies them based on their modelID.
|
|
887
|
+
* The classification is stored in the 'list.models' property,
|
|
888
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
889
|
+
*
|
|
890
|
+
*/
|
|
891
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
892
|
+
/**
|
|
893
|
+
* Classifies fragments based on their PredefinedType property.
|
|
894
|
+
*
|
|
895
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
751
896
|
*
|
|
752
897
|
* @remarks
|
|
753
|
-
*
|
|
754
|
-
*
|
|
898
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
899
|
+
* and classifies them based on their PredefinedType property.
|
|
900
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
901
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
755
902
|
*
|
|
756
|
-
* @
|
|
757
|
-
* '''typescript
|
|
758
|
-
* const ifcLoader = new IfcLoader(components);
|
|
759
|
-
* await ifcLoader.setup({ autoSetWasm: true });
|
|
760
|
-
* '''
|
|
903
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
761
904
|
*/
|
|
762
|
-
|
|
905
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
763
906
|
/**
|
|
764
|
-
*
|
|
907
|
+
* Classifies fragments based on their entity type.
|
|
765
908
|
*
|
|
766
|
-
* @param
|
|
767
|
-
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
909
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
768
910
|
*
|
|
769
|
-
* @
|
|
911
|
+
* @remarks
|
|
912
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
913
|
+
* and classifies them based on their entity type.
|
|
914
|
+
* The classification is stored in the 'list.entities' property,
|
|
915
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
770
916
|
*
|
|
771
|
-
* @
|
|
772
|
-
* '''typescript
|
|
773
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
774
|
-
* const group = await ifcLoader.load(ifcData);
|
|
775
|
-
* '''
|
|
917
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
776
918
|
*/
|
|
777
|
-
|
|
919
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
778
920
|
/**
|
|
779
|
-
*
|
|
921
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
780
922
|
*
|
|
781
|
-
* @param
|
|
923
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
924
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
925
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
782
926
|
*
|
|
783
|
-
* @
|
|
927
|
+
* @remarks
|
|
928
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
929
|
+
* and classifies them based on the specified IFC relationship.
|
|
930
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
931
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
932
|
+
*
|
|
933
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
934
|
+
*/
|
|
935
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
938
|
+
*
|
|
939
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
940
|
+
* @param config - The configuration for the classifier. It includes "useProperties", which is true by default
|
|
941
|
+
* (if false, the classification will use the expressIDs instead of the names), and "isolate", which will make
|
|
942
|
+
* the classifier just pick the WEBIFC categories provided.
|
|
784
943
|
*
|
|
785
944
|
* @remarks
|
|
786
|
-
* This method
|
|
787
|
-
*
|
|
945
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
946
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
947
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
948
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
788
949
|
*
|
|
789
|
-
* @
|
|
790
|
-
* '''typescript
|
|
791
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
792
|
-
* await ifcLoader.readIfcFile(ifcData);
|
|
793
|
-
* '''
|
|
950
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
794
951
|
*/
|
|
795
|
-
|
|
952
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
953
|
+
useProperties?: boolean;
|
|
954
|
+
isolate?: Set<number>;
|
|
955
|
+
}): Promise<void>;
|
|
796
956
|
/**
|
|
797
|
-
*
|
|
798
|
-
*
|
|
957
|
+
* Sets the color of the specified fragments.
|
|
958
|
+
*
|
|
959
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
960
|
+
* @param color - The color to set for the fragments.
|
|
961
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
799
962
|
*
|
|
800
963
|
* @remarks
|
|
801
|
-
* This method
|
|
964
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
965
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
802
966
|
*
|
|
803
|
-
* @
|
|
804
|
-
* '''typescript
|
|
805
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
806
|
-
* ifcLoader.cleanUp();
|
|
807
|
-
* '''
|
|
967
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
808
968
|
*/
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
969
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
970
|
+
/**
|
|
971
|
+
* Resets the color of the specified fragments to their original color.
|
|
972
|
+
*
|
|
973
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
974
|
+
*
|
|
975
|
+
* @remarks
|
|
976
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
977
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
978
|
+
*
|
|
979
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
980
|
+
*/
|
|
981
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
982
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
814
983
|
}
|
|
815
|
-
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
816
984
|
import * as THREE from "three";
|
|
817
985
|
import * as FRAGS from "@thatopen/fragments";
|
|
818
|
-
import {
|
|
819
|
-
import {
|
|
986
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
987
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
820
988
|
/**
|
|
821
|
-
*
|
|
989
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
822
990
|
*/
|
|
823
|
-
export declare class
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
*/
|
|
828
|
-
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
991
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
992
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
993
|
+
/** {@link Component.enabled} */
|
|
994
|
+
enabled: boolean;
|
|
829
995
|
/** {@link Disposable.onDisposed} */
|
|
830
996
|
readonly onDisposed: Event<unknown>;
|
|
997
|
+
private _absoluteMin;
|
|
998
|
+
private _absoluteMax;
|
|
999
|
+
private _meshes;
|
|
1000
|
+
constructor(components: Components);
|
|
831
1001
|
/**
|
|
832
|
-
*
|
|
1002
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
1003
|
+
*
|
|
1004
|
+
* @param bbox - The bounding box to calculate the dimensions for.
|
|
1005
|
+
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
833
1006
|
*/
|
|
834
|
-
|
|
1007
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
1008
|
+
width: number;
|
|
1009
|
+
height: number;
|
|
1010
|
+
depth: number;
|
|
1011
|
+
center: THREE.Vector3;
|
|
1012
|
+
};
|
|
835
1013
|
/**
|
|
836
|
-
*
|
|
1014
|
+
* A static method to create a new bounding box boundary.
|
|
1015
|
+
*
|
|
1016
|
+
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
1017
|
+
* @returns A new THREE.Vector3 representing the boundary.
|
|
1018
|
+
*
|
|
1019
|
+
* @remarks
|
|
1020
|
+
* This method is used to create a new boundary for calculating bounding boxes.
|
|
1021
|
+
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
1022
|
+
* depending on the value of the 'positive' parameter.
|
|
1023
|
+
*
|
|
1024
|
+
* @example
|
|
1025
|
+
* '''typescript
|
|
1026
|
+
* const positiveBound = BoundingBoxer.newBound(true);
|
|
1027
|
+
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
1028
|
+
*
|
|
1029
|
+
* const negativeBound = BoundingBoxer.newBound(false);
|
|
1030
|
+
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
1031
|
+
* '''
|
|
837
1032
|
*/
|
|
838
|
-
|
|
839
|
-
groupID: string;
|
|
840
|
-
fragmentIDs: string[];
|
|
841
|
-
}>;
|
|
1033
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
842
1034
|
/**
|
|
843
|
-
*
|
|
844
|
-
*
|
|
1035
|
+
* A static method to calculate the bounding box of a set of points.
|
|
1036
|
+
*
|
|
1037
|
+
* @param points - An array of THREE.Vector3 representing the points.
|
|
1038
|
+
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
1039
|
+
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
1040
|
+
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
1041
|
+
*
|
|
1042
|
+
* @remarks
|
|
1043
|
+
* This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
|
|
1044
|
+
* If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
|
|
1045
|
+
*
|
|
1046
|
+
* @example
|
|
1047
|
+
* '''typescript
|
|
1048
|
+
* const points = [
|
|
1049
|
+
* new THREE.Vector3(1, 2, 3),
|
|
1050
|
+
* new THREE.Vector3(4, 5, 6),
|
|
1051
|
+
* new THREE.Vector3(7, 8, 9),
|
|
1052
|
+
* ];
|
|
1053
|
+
*
|
|
1054
|
+
* const bbox = BoundingBoxer.getBounds(points);
|
|
1055
|
+
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
1056
|
+
* '''
|
|
845
1057
|
*/
|
|
846
|
-
|
|
1058
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
1059
|
+
/** {@link Disposable.dispose} */
|
|
1060
|
+
dispose(): void;
|
|
847
1061
|
/**
|
|
848
|
-
*
|
|
1062
|
+
* Returns the bounding box of the calculated fragments.
|
|
1063
|
+
*
|
|
1064
|
+
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
1065
|
+
*
|
|
1066
|
+
* @remarks
|
|
1067
|
+
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
1068
|
+
* The returned box represents the bounding box of the calculated fragments.
|
|
1069
|
+
*
|
|
1070
|
+
* @example
|
|
1071
|
+
* '''typescript
|
|
1072
|
+
* const boundingBox = boundingBoxer.get();
|
|
1073
|
+
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
1074
|
+
* '''
|
|
1075
|
+
*/
|
|
1076
|
+
get(): THREE.Box3;
|
|
1077
|
+
/**
|
|
1078
|
+
* Calculates and returns a sphere that encompasses the entire bounding box.
|
|
1079
|
+
*
|
|
1080
|
+
* @returns A new THREE.Sphere instance representing the calculated sphere.
|
|
1081
|
+
*
|
|
1082
|
+
* @remarks
|
|
1083
|
+
* This method calculates the center and radius of a sphere that encompasses the entire bounding box.
|
|
1084
|
+
* The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
|
|
1085
|
+
* The radius is calculated as the distance from the center to the minimum bound.
|
|
1086
|
+
*
|
|
1087
|
+
* @example
|
|
1088
|
+
* '''typescript
|
|
1089
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1090
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1091
|
+
* const boundingSphere = boundingBoxer.getSphere();
|
|
1092
|
+
* console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
|
|
1093
|
+
* '''
|
|
1094
|
+
*/
|
|
1095
|
+
getSphere(): THREE.Sphere;
|
|
1096
|
+
/**
|
|
1097
|
+
* Returns a THREE.Mesh instance representing the bounding box.
|
|
1098
|
+
*
|
|
1099
|
+
* @returns A new THREE.Mesh instance representing the bounding box.
|
|
1100
|
+
*
|
|
1101
|
+
* @remarks
|
|
1102
|
+
* This method calculates the dimensions of the bounding box using the 'getDimensions' method.
|
|
1103
|
+
* It then creates a new THREE.BoxGeometry with the calculated dimensions.
|
|
1104
|
+
* A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
|
|
1105
|
+
* The position of the mesh is set to the center of the bounding box.
|
|
1106
|
+
*
|
|
1107
|
+
* @example
|
|
1108
|
+
* '''typescript
|
|
1109
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1110
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1111
|
+
* const boundingBoxMesh = boundingBoxer.getMesh();
|
|
1112
|
+
* scene.add(boundingBoxMesh);
|
|
1113
|
+
* '''
|
|
1114
|
+
*/
|
|
1115
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Resets the internal minimum and maximum vectors to positive and negative infinity, respectively.
|
|
1118
|
+
* This method is used to prepare the BoundingBoxer for a new set of fragments.
|
|
1119
|
+
*
|
|
1120
|
+
* @remarks
|
|
1121
|
+
* This method is called when a new set of fragments is added to the BoundingBoxer.
|
|
1122
|
+
* It ensures that the bounding box calculations are accurate and up-to-date.
|
|
1123
|
+
*
|
|
1124
|
+
* @example
|
|
1125
|
+
* '''typescript
|
|
1126
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1127
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1128
|
+
* // ...
|
|
1129
|
+
* boundingBoxer.reset();
|
|
1130
|
+
* '''
|
|
1131
|
+
*/
|
|
1132
|
+
reset(): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* Adds a FragmentsGroup to the BoundingBoxer.
|
|
1135
|
+
*
|
|
1136
|
+
* @param group - The FragmentsGroup to add.
|
|
1137
|
+
*
|
|
1138
|
+
* @remarks
|
|
1139
|
+
* This method iterates through each fragment in the provided FragmentsGroup,
|
|
1140
|
+
* and calls the 'addMesh' method for each fragment's mesh.
|
|
1141
|
+
*
|
|
1142
|
+
* @example
|
|
1143
|
+
* '''typescript
|
|
1144
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1145
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1146
|
+
* '''
|
|
1147
|
+
*/
|
|
1148
|
+
add(group: FragmentsGroup): void;
|
|
1149
|
+
/**
|
|
1150
|
+
* Adds a mesh to the BoundingBoxer and calculates the bounding box.
|
|
1151
|
+
*
|
|
1152
|
+
* @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
|
|
1153
|
+
* @param itemIDs - An optional iterable of numbers representing the item IDs.
|
|
1154
|
+
*
|
|
1155
|
+
* @remarks
|
|
1156
|
+
* This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
|
|
1157
|
+
* If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
|
|
1158
|
+
* If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
|
|
1159
|
+
*
|
|
1160
|
+
* @example
|
|
1161
|
+
* '''typescript
|
|
1162
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1163
|
+
* boundingBoxer.addMesh(mesh);
|
|
1164
|
+
* '''
|
|
1165
|
+
*/
|
|
1166
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
1167
|
+
/**
|
|
1168
|
+
* Uses a FragmentIdMap to add its meshes to the bb calculation.
|
|
1169
|
+
*
|
|
1170
|
+
* This method iterates through the provided 'fragmentIdMap', retrieves the corresponding fragment from the 'FragmentsManager',
|
|
1171
|
+
* and then calls the 'addMesh' method for each fragment's mesh, passing the expression IDs as the second parameter.
|
|
1172
|
+
*
|
|
1173
|
+
* @param fragmentIdMap - A mapping of fragment IDs to their corresponding expression IDs.
|
|
1174
|
+
*
|
|
1175
|
+
* @remarks
|
|
1176
|
+
* This method is used to add a mapping of fragment IDs to their corresponding expression IDs.
|
|
1177
|
+
* It ensures that the bounding box calculations are accurate and up-to-date by updating the internal minimum and maximum vectors.
|
|
1178
|
+
*
|
|
1179
|
+
* @example
|
|
1180
|
+
* '''typescript
|
|
1181
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1182
|
+
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
1183
|
+
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
1184
|
+
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
1185
|
+
* };
|
|
1186
|
+
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
1187
|
+
* '''
|
|
1188
|
+
*/
|
|
1189
|
+
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
1190
|
+
private static getFragmentBounds;
|
|
1191
|
+
}
|
|
1192
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1193
|
+
import { Components, Component } from "../../core";
|
|
1194
|
+
/**
|
|
1195
|
+
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1196
|
+
*/
|
|
1197
|
+
export declare class Hider extends Component {
|
|
1198
|
+
/**
|
|
1199
|
+
* A unique identifier for the component.
|
|
1200
|
+
* This UUID is used to register the component within the Components system.
|
|
1201
|
+
*/
|
|
1202
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1203
|
+
/** {@link Component.enabled} */
|
|
1204
|
+
enabled: boolean;
|
|
1205
|
+
constructor(components: Components);
|
|
1206
|
+
/**
|
|
1207
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1208
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1209
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1210
|
+
*
|
|
1211
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1212
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1213
|
+
* If not provided, all fragments will be affected.
|
|
1214
|
+
*
|
|
1215
|
+
* @returns {void}
|
|
1216
|
+
*/
|
|
1217
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1218
|
+
/**
|
|
1219
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1220
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1221
|
+
*
|
|
1222
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1223
|
+
* If not provided, all fragments will be isolated.
|
|
1224
|
+
*
|
|
1225
|
+
* @returns {void}
|
|
1226
|
+
*/
|
|
1227
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1228
|
+
private updateCulledVisibility;
|
|
1229
|
+
}
|
|
1230
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1231
|
+
/**
|
|
1232
|
+
* 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).
|
|
1233
|
+
*/
|
|
1234
|
+
export declare class Exploder extends Component implements Disposable {
|
|
1235
|
+
/**
|
|
1236
|
+
* A unique identifier for the component.
|
|
1237
|
+
* This UUID is used to register the component within the Components system.
|
|
1238
|
+
*/
|
|
1239
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1240
|
+
/** {@link Disposable.onDisposed} */
|
|
1241
|
+
readonly onDisposed: Event<unknown>;
|
|
1242
|
+
/** {@link Component.enabled} */
|
|
1243
|
+
enabled: boolean;
|
|
1244
|
+
/**
|
|
1245
|
+
* The height of the explosion animation.
|
|
1246
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1247
|
+
* Default value is 10.
|
|
1248
|
+
*/
|
|
1249
|
+
height: number;
|
|
1250
|
+
/**
|
|
1251
|
+
* The group name used for the explosion animation.
|
|
1252
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1253
|
+
* Default value is "storeys".
|
|
1254
|
+
*/
|
|
1255
|
+
groupName: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* A set of strings representing the exploded items.
|
|
1258
|
+
* This set is used to keep track of which items have been exploded.
|
|
1259
|
+
*/
|
|
1260
|
+
list: Set<string>;
|
|
1261
|
+
constructor(components: Components);
|
|
1262
|
+
/** {@link Disposable.dispose} */
|
|
1263
|
+
dispose(): void;
|
|
1264
|
+
/**
|
|
1265
|
+
* Sets the explosion state of the fragments.
|
|
1266
|
+
*
|
|
1267
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1268
|
+
*
|
|
1269
|
+
* @remarks
|
|
1270
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1271
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1272
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1273
|
+
*
|
|
1274
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1275
|
+
*
|
|
1276
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1277
|
+
*/
|
|
1278
|
+
set(active: boolean): void;
|
|
1279
|
+
}
|
|
1280
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1281
|
+
import * as THREE from "three";
|
|
1282
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1283
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1284
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1285
|
+
/**
|
|
1286
|
+
* Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
|
|
1287
|
+
*/
|
|
1288
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
1289
|
+
/**
|
|
1290
|
+
* A unique identifier for the component.
|
|
1291
|
+
* This UUID is used to register the component within the Components system.
|
|
1292
|
+
*/
|
|
1293
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
1294
|
+
/** {@link Disposable.onDisposed} */
|
|
1295
|
+
readonly onDisposed: Event<unknown>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Event triggered when fragments are loaded.
|
|
1298
|
+
*/
|
|
1299
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1300
|
+
/**
|
|
1301
|
+
* Event triggered when fragments are disposed.
|
|
1302
|
+
*/
|
|
1303
|
+
readonly onFragmentsDisposed: Event<{
|
|
1304
|
+
groupID: string;
|
|
1305
|
+
fragmentIDs: string[];
|
|
1306
|
+
}>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Map containing all loaded fragments.
|
|
1309
|
+
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
1310
|
+
*/
|
|
1311
|
+
readonly list: Map<string, Fragment>;
|
|
1312
|
+
/**
|
|
1313
|
+
* Map containing all loaded fragment groups.
|
|
849
1314
|
* The key is the group's unique identifier, and the value is the group itself.
|
|
850
1315
|
*/
|
|
851
1316
|
readonly groups: Map<string, FragmentsGroup>;
|
|
@@ -939,10 +1404,223 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
939
1404
|
applyBaseCoordinateSystem(object: THREE.Object3D | THREE.Vector3, originalCoordinateSystem: THREE.Matrix4): void;
|
|
940
1405
|
}
|
|
941
1406
|
import * as WEBIFC from "web-ifc";
|
|
942
|
-
import
|
|
943
|
-
import {
|
|
944
|
-
|
|
945
|
-
|
|
1407
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1408
|
+
import { IfcFragmentSettings } from "./src";
|
|
1409
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1410
|
+
/**
|
|
1411
|
+
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1412
|
+
*/
|
|
1413
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1414
|
+
/**
|
|
1415
|
+
* A unique identifier for the component.
|
|
1416
|
+
* This UUID is used to register the component within the Components system.
|
|
1417
|
+
*/
|
|
1418
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1419
|
+
/** {@link Disposable.onDisposed} */
|
|
1420
|
+
readonly onDisposed: Event<string>;
|
|
1421
|
+
/**
|
|
1422
|
+
* An event triggered when the IFC file starts loading.
|
|
1423
|
+
*/
|
|
1424
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1425
|
+
/**
|
|
1426
|
+
* An event triggered when the setup process is completed.
|
|
1427
|
+
*/
|
|
1428
|
+
readonly onSetup: Event<void>;
|
|
1429
|
+
/**
|
|
1430
|
+
* The settings for the IfcLoader.
|
|
1431
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1432
|
+
*/
|
|
1433
|
+
settings: IfcFragmentSettings;
|
|
1434
|
+
/**
|
|
1435
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1436
|
+
*/
|
|
1437
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1438
|
+
/** {@link Component.enabled} */
|
|
1439
|
+
enabled: boolean;
|
|
1440
|
+
private _material;
|
|
1441
|
+
private _spatialTree;
|
|
1442
|
+
private _metaData;
|
|
1443
|
+
private _fragmentInstances;
|
|
1444
|
+
private _civil;
|
|
1445
|
+
private _visitedFragments;
|
|
1446
|
+
private _materialT;
|
|
1447
|
+
constructor(components: Components);
|
|
1448
|
+
/** {@link Disposable.dispose} */
|
|
1449
|
+
dispose(): void;
|
|
1450
|
+
/**
|
|
1451
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1452
|
+
*
|
|
1453
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
1454
|
+
* If not provided, the existing settings will be used.
|
|
1455
|
+
*
|
|
1456
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
1457
|
+
*
|
|
1458
|
+
* @remarks
|
|
1459
|
+
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1460
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1461
|
+
*
|
|
1462
|
+
* @example
|
|
1463
|
+
* '''typescript
|
|
1464
|
+
* const ifcLoader = new IfcLoader(components);
|
|
1465
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1466
|
+
* '''
|
|
1467
|
+
*/
|
|
1468
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1469
|
+
/**
|
|
1470
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
1471
|
+
*
|
|
1472
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1473
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1474
|
+
*
|
|
1475
|
+
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1476
|
+
*
|
|
1477
|
+
* @example
|
|
1478
|
+
* '''typescript
|
|
1479
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1480
|
+
* const group = await ifcLoader.load(ifcData);
|
|
1481
|
+
* '''
|
|
1482
|
+
*/
|
|
1483
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
1486
|
+
*
|
|
1487
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1488
|
+
*
|
|
1489
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1490
|
+
*
|
|
1491
|
+
* @remarks
|
|
1492
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1493
|
+
* It also opens the IFC model using the provided data and settings.
|
|
1494
|
+
*
|
|
1495
|
+
* @example
|
|
1496
|
+
* '''typescript
|
|
1497
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1498
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
1499
|
+
* '''
|
|
1500
|
+
*/
|
|
1501
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1502
|
+
/**
|
|
1503
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1504
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1505
|
+
*
|
|
1506
|
+
* @remarks
|
|
1507
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1508
|
+
*
|
|
1509
|
+
* @example
|
|
1510
|
+
* '''typescript
|
|
1511
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1512
|
+
* ifcLoader.cleanUp();
|
|
1513
|
+
* '''
|
|
1514
|
+
*/
|
|
1515
|
+
cleanUp(): void;
|
|
1516
|
+
private getAllGeometries;
|
|
1517
|
+
private getMesh;
|
|
1518
|
+
private getGeometry;
|
|
1519
|
+
private autoSetWasm;
|
|
1520
|
+
}
|
|
1521
|
+
import * as WEBIFC from "web-ifc";
|
|
1522
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1523
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1524
|
+
/**
|
|
1525
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1526
|
+
*/
|
|
1527
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1528
|
+
/**
|
|
1529
|
+
* A unique identifier for the component.
|
|
1530
|
+
* This UUID is used to register the component within the Components system.
|
|
1531
|
+
*/
|
|
1532
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1533
|
+
/**
|
|
1534
|
+
* Event triggered when geometry is streamed.
|
|
1535
|
+
* Contains the streamed geometry data and its buffer.
|
|
1536
|
+
*/
|
|
1537
|
+
readonly onGeometryStreamed: Event<{
|
|
1538
|
+
buffer: Uint8Array;
|
|
1539
|
+
data: StreamedGeometries;
|
|
1540
|
+
}>;
|
|
1541
|
+
/**
|
|
1542
|
+
* Event triggered when assets are streamed.
|
|
1543
|
+
* Contains the streamed assets.
|
|
1544
|
+
*/
|
|
1545
|
+
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1546
|
+
/**
|
|
1547
|
+
* Event triggered to indicate the progress of the streaming process.
|
|
1548
|
+
* Contains the progress percentage.
|
|
1549
|
+
*/
|
|
1550
|
+
readonly onProgress: Event<number>;
|
|
1551
|
+
/**
|
|
1552
|
+
* Event triggered when the IFC file is loaded.
|
|
1553
|
+
* Contains the loaded IFC file data.
|
|
1554
|
+
*/
|
|
1555
|
+
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1556
|
+
/** {@link Disposable.onDisposed} */
|
|
1557
|
+
readonly onDisposed: Event<unknown>;
|
|
1558
|
+
/**
|
|
1559
|
+
* Settings for the IfcGeometryTiler.
|
|
1560
|
+
*/
|
|
1561
|
+
settings: IfcStreamingSettings;
|
|
1562
|
+
/** {@link Component.enabled} */
|
|
1563
|
+
enabled: boolean;
|
|
1564
|
+
/**
|
|
1565
|
+
* The WebIFC API instance used for IFC file processing.
|
|
1566
|
+
*/
|
|
1567
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1568
|
+
private _spatialTree;
|
|
1569
|
+
private _metaData;
|
|
1570
|
+
private _visitedGeometries;
|
|
1571
|
+
private _streamSerializer;
|
|
1572
|
+
private _geometries;
|
|
1573
|
+
private _geometryCount;
|
|
1574
|
+
private _civil;
|
|
1575
|
+
private _groupSerializer;
|
|
1576
|
+
private _assets;
|
|
1577
|
+
private _meshesWithHoles;
|
|
1578
|
+
constructor(components: Components);
|
|
1579
|
+
/** {@link Disposable.dispose} */
|
|
1580
|
+
dispose(): void;
|
|
1581
|
+
/**
|
|
1582
|
+
* This method streams the IFC file from a given buffer.
|
|
1583
|
+
*
|
|
1584
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1585
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1586
|
+
*
|
|
1587
|
+
* @remarks
|
|
1588
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1589
|
+
*
|
|
1590
|
+
* @example
|
|
1591
|
+
* '''typescript
|
|
1592
|
+
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1593
|
+
* const rawBuffer = await response.arrayBuffer();
|
|
1594
|
+
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1595
|
+
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1596
|
+
* '''
|
|
1597
|
+
*/
|
|
1598
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1599
|
+
/**
|
|
1600
|
+
* This method streams the IFC file from a given callback.
|
|
1601
|
+
*
|
|
1602
|
+
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1603
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1604
|
+
*
|
|
1605
|
+
* @remarks
|
|
1606
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1607
|
+
*
|
|
1608
|
+
*/
|
|
1609
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1610
|
+
private readIfcFile;
|
|
1611
|
+
private streamIfcFile;
|
|
1612
|
+
private streamAllGeometries;
|
|
1613
|
+
private cleanUp;
|
|
1614
|
+
private getMesh;
|
|
1615
|
+
private getGeometry;
|
|
1616
|
+
private streamAssets;
|
|
1617
|
+
private streamGeometries;
|
|
1618
|
+
}
|
|
1619
|
+
import * as WEBIFC from "web-ifc";
|
|
1620
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1621
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1622
|
+
/**
|
|
1623
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
946
1624
|
*/
|
|
947
1625
|
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
948
1626
|
/**
|
|
@@ -1003,275 +1681,36 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
1003
1681
|
private streamAllProperties;
|
|
1004
1682
|
private cleanUp;
|
|
1005
1683
|
}
|
|
1006
|
-
import * as THREE from "three";
|
|
1007
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1008
|
-
center: THREE.Vector3;
|
|
1009
|
-
halfSizes: THREE.Vector3;
|
|
1010
|
-
rotation: THREE.Matrix3;
|
|
1011
|
-
transformation: THREE.Matrix4;
|
|
1012
|
-
};
|
|
1013
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1014
1684
|
import * as WEBIFC from "web-ifc";
|
|
1015
|
-
import
|
|
1016
|
-
import { Component,
|
|
1685
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1686
|
+
import { Component, Components } from "../../core";
|
|
1017
1687
|
/**
|
|
1018
|
-
*
|
|
1688
|
+
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1019
1689
|
*/
|
|
1020
|
-
export
|
|
1021
|
-
/**
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* Component to manage and edit properties and Psets in IFC files.
|
|
1047
|
-
*/
|
|
1048
|
-
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1049
|
-
/**
|
|
1050
|
-
* A unique identifier for the component.
|
|
1051
|
-
* This UUID is used to register the component within the Components system.
|
|
1052
|
-
*/
|
|
1053
|
-
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1054
|
-
/** {@link Disposable.onDisposed} */
|
|
1055
|
-
readonly onDisposed: Event<string>;
|
|
1056
|
-
/**
|
|
1057
|
-
* Event triggered when a file is requested for export.
|
|
1058
|
-
*/
|
|
1059
|
-
readonly onRequestFile: Event<unknown>;
|
|
1060
|
-
/**
|
|
1061
|
-
* ArrayBuffer containing the IFC data to be exported.
|
|
1062
|
-
*/
|
|
1063
|
-
ifcToExport: ArrayBuffer | null;
|
|
1064
|
-
/**
|
|
1065
|
-
* Event triggered when an element is added to a Pset.
|
|
1066
|
-
*/
|
|
1067
|
-
readonly onElementToPset: Event<{
|
|
1068
|
-
model: FragmentsGroup;
|
|
1069
|
-
psetID: number;
|
|
1070
|
-
elementID: number;
|
|
1071
|
-
}>;
|
|
1072
|
-
/**
|
|
1073
|
-
* Event triggered when a property is added to a Pset.
|
|
1074
|
-
*/
|
|
1075
|
-
readonly onPropToPset: Event<{
|
|
1076
|
-
model: FragmentsGroup;
|
|
1077
|
-
psetID: number;
|
|
1078
|
-
propID: number;
|
|
1079
|
-
}>;
|
|
1080
|
-
/**
|
|
1081
|
-
* Event triggered when a Pset is removed.
|
|
1082
|
-
*/
|
|
1083
|
-
readonly onPsetRemoved: Event<{
|
|
1084
|
-
model: FragmentsGroup;
|
|
1085
|
-
psetID: number;
|
|
1086
|
-
}>;
|
|
1087
|
-
/**
|
|
1088
|
-
* Event triggered when data in the model changes.
|
|
1089
|
-
*/
|
|
1090
|
-
readonly onDataChanged: Event<{
|
|
1091
|
-
model: FragmentsGroup;
|
|
1092
|
-
expressID: number;
|
|
1093
|
-
}>;
|
|
1094
|
-
/**
|
|
1095
|
-
* Configuration for the WebAssembly module.
|
|
1096
|
-
*/
|
|
1097
|
-
wasm: {
|
|
1098
|
-
path: string;
|
|
1099
|
-
absolute: boolean;
|
|
1100
|
-
};
|
|
1101
|
-
/** {@link Component.enabled} */
|
|
1102
|
-
enabled: boolean;
|
|
1103
|
-
/**
|
|
1104
|
-
* Map of attribute listeners.
|
|
1105
|
-
*/
|
|
1106
|
-
attributeListeners: AttributeListener;
|
|
1107
|
-
/**
|
|
1108
|
-
* The currently selected model.
|
|
1109
|
-
*/
|
|
1110
|
-
selectedModel?: FragmentsGroup;
|
|
1111
|
-
/**
|
|
1112
|
-
* Map of changed entities in the model.
|
|
1113
|
-
*/
|
|
1114
|
-
changeMap: ChangeMap;
|
|
1115
|
-
constructor(components: Components);
|
|
1116
|
-
/** {@link Disposable.dispose} */
|
|
1117
|
-
dispose(): void;
|
|
1118
|
-
/**
|
|
1119
|
-
* Static method to retrieve the IFC schema from a given model.
|
|
1120
|
-
*
|
|
1121
|
-
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1122
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1123
|
-
* @returns The IFC schema associated with the given model.
|
|
1124
|
-
*/
|
|
1125
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1126
|
-
/**
|
|
1127
|
-
* Method to set properties data in the model.
|
|
1128
|
-
*
|
|
1129
|
-
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1130
|
-
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1131
|
-
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1132
|
-
* The rest of the properties will be set as the properties of the entity.
|
|
1133
|
-
*
|
|
1134
|
-
* @returns A promise that resolves when all the properties have been set.
|
|
1135
|
-
*
|
|
1136
|
-
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
1137
|
-
*/
|
|
1138
|
-
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
1139
|
-
/**
|
|
1140
|
-
* Creates a new Property Set (Pset) in the given model.
|
|
1141
|
-
*
|
|
1142
|
-
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
1143
|
-
* @param name - The name of the Pset.
|
|
1144
|
-
* @param description - (Optional) The description of the Pset.
|
|
1145
|
-
*
|
|
1146
|
-
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
1147
|
-
*
|
|
1148
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1149
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1150
|
-
*/
|
|
1151
|
-
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
1152
|
-
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
1153
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
1154
|
-
}>;
|
|
1155
|
-
/**
|
|
1156
|
-
* Removes a Property Set (Pset) from the given model.
|
|
1157
|
-
*
|
|
1158
|
-
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1159
|
-
* @param psetID - The express IDs of the Psets to be removed.
|
|
1160
|
-
*
|
|
1161
|
-
* @returns A promise that resolves when all the Psets have been removed.
|
|
1162
|
-
*
|
|
1163
|
-
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1164
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1165
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1166
|
-
*/
|
|
1167
|
-
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
1168
|
-
/**
|
|
1169
|
-
* Creates a new single-value property of type string in the given model.
|
|
1170
|
-
*
|
|
1171
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1172
|
-
* @param type - The type of the property value. Must be a string property type.
|
|
1173
|
-
* @param name - The name of the property.
|
|
1174
|
-
* @param value - The value of the property. Must be a string.
|
|
1175
|
-
*
|
|
1176
|
-
* @returns The newly created single-value property.
|
|
1177
|
-
*
|
|
1178
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1179
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1180
|
-
*/
|
|
1181
|
-
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1182
|
-
/**
|
|
1183
|
-
* Creates a new single-value property of type numeric in the given model.
|
|
1184
|
-
*
|
|
1185
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1186
|
-
* @param type - The type of the property value. Must be a numeric property type.
|
|
1187
|
-
* @param name - The name of the property.
|
|
1188
|
-
* @param value - The value of the property. Must be a number.
|
|
1189
|
-
*
|
|
1190
|
-
* @returns The newly created single-value property.
|
|
1191
|
-
*
|
|
1192
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1193
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1194
|
-
*/
|
|
1195
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1196
|
-
/**
|
|
1197
|
-
* Creates a new single-value property of type boolean in the given model.
|
|
1198
|
-
*
|
|
1199
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1200
|
-
* @param type - The type of the property value. Must be a boolean property type.
|
|
1201
|
-
* @param name - The name of the property.
|
|
1202
|
-
* @param value - The value of the property. Must be a boolean.
|
|
1203
|
-
*
|
|
1204
|
-
* @returns The newly created single-value property.
|
|
1205
|
-
*
|
|
1206
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1207
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1208
|
-
*/
|
|
1209
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Removes a property from a Property Set (Pset) in the given model.
|
|
1212
|
-
*
|
|
1213
|
-
* @param model - The FragmentsGroup model from which to remove the property.
|
|
1214
|
-
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1215
|
-
* @param propID - The express ID of the property to be removed.
|
|
1216
|
-
*
|
|
1217
|
-
* @returns A promise that resolves when the property has been removed.
|
|
1218
|
-
*
|
|
1219
|
-
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
1220
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1221
|
-
*/
|
|
1222
|
-
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
1223
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
1224
|
-
/**
|
|
1225
|
-
* Adds elements to a Property Set (Pset) in the given model.
|
|
1226
|
-
*
|
|
1227
|
-
* @param model - The FragmentsGroup model in which to add the elements.
|
|
1228
|
-
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
1229
|
-
* @param elementID - The express IDs of the elements to be added.
|
|
1230
|
-
*
|
|
1231
|
-
* @returns A promise that resolves when all the elements have been added.
|
|
1232
|
-
*
|
|
1233
|
-
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
1234
|
-
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
1235
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1236
|
-
*/
|
|
1237
|
-
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
1238
|
-
/**
|
|
1239
|
-
* Saves the changes made to the model to a new IFC file.
|
|
1240
|
-
*
|
|
1241
|
-
* @param model - The FragmentsGroup model from which to save the changes.
|
|
1242
|
-
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1243
|
-
*
|
|
1244
|
-
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1245
|
-
*
|
|
1246
|
-
* @throws Will throw an error if any issues occur during the saving process.
|
|
1247
|
-
*/
|
|
1248
|
-
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
1249
|
-
/**
|
|
1250
|
-
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
1251
|
-
* The listener will trigger an event whenever the attribute's value changes.
|
|
1252
|
-
*
|
|
1253
|
-
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1254
|
-
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1255
|
-
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1256
|
-
*
|
|
1257
|
-
* @returns The event that will be triggered when the attribute's value changes.
|
|
1258
|
-
*
|
|
1259
|
-
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
1260
|
-
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
1261
|
-
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1262
|
-
*/
|
|
1263
|
-
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
1264
|
-
private increaseMaxID;
|
|
1265
|
-
private newGUID;
|
|
1266
|
-
private getOwnerHistory;
|
|
1267
|
-
private registerChange;
|
|
1268
|
-
private newSingleProperty;
|
|
1269
|
-
}
|
|
1270
|
-
import * as WEBIFC from "web-ifc";
|
|
1271
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1272
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
1273
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1274
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1690
|
+
export declare class IfcJsonExporter extends Component {
|
|
1691
|
+
/**
|
|
1692
|
+
* A unique identifier for the component.
|
|
1693
|
+
* This UUID is used to register the component within the Components system.
|
|
1694
|
+
*/
|
|
1695
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1696
|
+
/** {@link Component.enabled} */
|
|
1697
|
+
enabled: boolean;
|
|
1698
|
+
constructor(components: Components);
|
|
1699
|
+
/**
|
|
1700
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1701
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1702
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1703
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1704
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1705
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1706
|
+
*/
|
|
1707
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1708
|
+
}
|
|
1709
|
+
import * as WEBIFC from "web-ifc";
|
|
1710
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1711
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
1712
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1713
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1275
1714
|
/**
|
|
1276
1715
|
* 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).
|
|
1277
1716
|
*/
|
|
@@ -1430,737 +1869,364 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
1430
1869
|
*/
|
|
1431
1870
|
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
1432
1871
|
}
|
|
1433
|
-
import
|
|
1434
|
-
|
|
1435
|
-
|
|
1872
|
+
import * as WEBIFC from "web-ifc";
|
|
1873
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1874
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1875
|
+
/**
|
|
1876
|
+
* Types for boolean properties in IFC schema.
|
|
1436
1877
|
*/
|
|
1437
|
-
export
|
|
1438
|
-
/**
|
|
1439
|
-
* The version of the @thatopen/components library.
|
|
1440
|
-
*/
|
|
1441
|
-
static readonly release = "2.1.9";
|
|
1442
|
-
/** {@link Disposable.onDisposed} */
|
|
1443
|
-
readonly onDisposed: Event<void>;
|
|
1444
|
-
/**
|
|
1445
|
-
* The list of components created in this app.
|
|
1446
|
-
* The keys are UUIDs and the values are instances of the components.
|
|
1447
|
-
*/
|
|
1448
|
-
readonly list: Map<string, Component>;
|
|
1449
|
-
/**
|
|
1450
|
-
* If disabled, the animation loop will be stopped.
|
|
1451
|
-
* Default value is false.
|
|
1452
|
-
*/
|
|
1453
|
-
enabled: boolean;
|
|
1454
|
-
private _clock;
|
|
1455
|
-
/**
|
|
1456
|
-
* Adds a component to the list of components.
|
|
1457
|
-
* Throws an error if a component with the same UUID already exists.
|
|
1458
|
-
*
|
|
1459
|
-
* @param uuid - The unique identifier of the component.
|
|
1460
|
-
* @param instance - The instance of the component to be added.
|
|
1461
|
-
*
|
|
1462
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
1463
|
-
*
|
|
1464
|
-
* @internal
|
|
1465
|
-
*/
|
|
1466
|
-
add(uuid: string, instance: Component): void;
|
|
1467
|
-
/**
|
|
1468
|
-
* Retrieves a component instance by its constructor function.
|
|
1469
|
-
* If the component does not exist in the list, it will be created and added.
|
|
1470
|
-
*
|
|
1471
|
-
* @template U - The type of the component to retrieve.
|
|
1472
|
-
* @param Component - The constructor function of the component to retrieve.
|
|
1473
|
-
*
|
|
1474
|
-
* @returns The instance of the requested component.
|
|
1475
|
-
*
|
|
1476
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
1477
|
-
*
|
|
1478
|
-
* @internal
|
|
1479
|
-
*/
|
|
1480
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
1481
|
-
constructor();
|
|
1482
|
-
/**
|
|
1483
|
-
* Initializes the Components instance.
|
|
1484
|
-
* This method starts the animation loop, sets the enabled flag to true,
|
|
1485
|
-
* and calls the update method.
|
|
1486
|
-
*
|
|
1487
|
-
* @returns {void}
|
|
1488
|
-
*/
|
|
1489
|
-
init(): void;
|
|
1490
|
-
/**
|
|
1491
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
1492
|
-
* the library. A memory leak will be created if:
|
|
1493
|
-
*
|
|
1494
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
1495
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
1496
|
-
* Angular, Vue, etc).
|
|
1497
|
-
*
|
|
1498
|
-
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
1499
|
-
* referenced by a reference type (object or array).
|
|
1500
|
-
*
|
|
1501
|
-
* You can learn more about how Three.js handles memory leaks
|
|
1502
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1503
|
-
*
|
|
1504
|
-
*/
|
|
1505
|
-
dispose(): void;
|
|
1506
|
-
private update;
|
|
1507
|
-
private static setupBVH;
|
|
1508
|
-
}
|
|
1509
|
-
import * as THREE from "three";
|
|
1510
|
-
import { Components } from "../Components";
|
|
1511
|
-
import { Component } from "../Types";
|
|
1878
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1512
1879
|
/**
|
|
1513
|
-
*
|
|
1880
|
+
* Types for string properties in IFC schema.
|
|
1514
1881
|
*/
|
|
1515
|
-
export
|
|
1516
|
-
private _disposedComponents;
|
|
1517
|
-
/** {@link Component.enabled} */
|
|
1518
|
-
enabled: boolean;
|
|
1519
|
-
/**
|
|
1520
|
-
* A unique identifier for the component.
|
|
1521
|
-
* This UUID is used to register the component within the Components system.
|
|
1522
|
-
*/
|
|
1523
|
-
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
1524
|
-
constructor(components: Components);
|
|
1525
|
-
/**
|
|
1526
|
-
* Return the UUIDs of all disposed components.
|
|
1527
|
-
*/
|
|
1528
|
-
get(): Set<string>;
|
|
1529
|
-
/**
|
|
1530
|
-
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
1531
|
-
* using any of these in other parts of the application, make sure that you
|
|
1532
|
-
* remove them from the mesh before disposing it.
|
|
1533
|
-
*
|
|
1534
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
1535
|
-
* to remove.
|
|
1536
|
-
*
|
|
1537
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
1538
|
-
*
|
|
1539
|
-
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
1540
|
-
*/
|
|
1541
|
-
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
1542
|
-
/**
|
|
1543
|
-
* Disposes a geometry from memory.
|
|
1544
|
-
*
|
|
1545
|
-
* @param geometry - the
|
|
1546
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
1547
|
-
* to remove.
|
|
1548
|
-
*/
|
|
1549
|
-
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
1550
|
-
private disposeGeometryAndMaterials;
|
|
1551
|
-
private disposeChildren;
|
|
1552
|
-
private static disposeMaterial;
|
|
1553
|
-
}
|
|
1554
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
1555
|
-
import { Components } from "../Components";
|
|
1556
|
-
import { SimpleWorld } from "./src";
|
|
1882
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1557
1883
|
/**
|
|
1558
|
-
*
|
|
1884
|
+
* Types for numeric properties in IFC schema.
|
|
1559
1885
|
*/
|
|
1560
|
-
export
|
|
1561
|
-
/**
|
|
1562
|
-
* A unique identifier for the component.
|
|
1563
|
-
* This UUID is used to register the component within the Components system.
|
|
1564
|
-
*/
|
|
1565
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
1566
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1567
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1568
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1569
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1570
|
-
/** {@link Disposable.onDisposed} */
|
|
1571
|
-
readonly onDisposed: Event<unknown>;
|
|
1572
|
-
/**
|
|
1573
|
-
* An event that is triggered when a new world is created.
|
|
1574
|
-
* The event passes the newly created world as a parameter.
|
|
1575
|
-
*/
|
|
1576
|
-
readonly onWorldCreated: Event<World>;
|
|
1577
|
-
/**
|
|
1578
|
-
* An event that is triggered when a world is deleted.
|
|
1579
|
-
* The event passes the UUID of the deleted world as a parameter.
|
|
1580
|
-
*/
|
|
1581
|
-
readonly onWorldDeleted: Event<string>;
|
|
1582
|
-
/**
|
|
1583
|
-
* A collection of worlds managed by this component.
|
|
1584
|
-
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
1585
|
-
*/
|
|
1586
|
-
list: Map<string, World>;
|
|
1587
|
-
/** {@link Component.enabled} */
|
|
1588
|
-
enabled: boolean;
|
|
1589
|
-
constructor(components: Components);
|
|
1590
|
-
/**
|
|
1591
|
-
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
1592
|
-
*
|
|
1593
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
1594
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
1595
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
1596
|
-
*
|
|
1597
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
1598
|
-
*/
|
|
1599
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
1600
|
-
/**
|
|
1601
|
-
* Deletes a world from the list of worlds.
|
|
1602
|
-
*
|
|
1603
|
-
* @param {World} world - The world to be deleted.
|
|
1604
|
-
*
|
|
1605
|
-
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
1606
|
-
*
|
|
1607
|
-
* @returns {void}
|
|
1608
|
-
*/
|
|
1609
|
-
delete(world: World): void;
|
|
1610
|
-
/**
|
|
1611
|
-
* Disposes of the Worlds component and all its managed worlds.
|
|
1612
|
-
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
1613
|
-
* and triggers the onDisposed event.
|
|
1614
|
-
*
|
|
1615
|
-
* @returns {void}
|
|
1616
|
-
*/
|
|
1617
|
-
dispose(): void;
|
|
1618
|
-
/** {@link Updateable.update} */
|
|
1619
|
-
update(delta?: number): void | Promise<void>;
|
|
1620
|
-
}
|
|
1621
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
1622
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
1623
|
-
import { Components } from "../Components";
|
|
1886
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1624
1887
|
/**
|
|
1625
|
-
*
|
|
1888
|
+
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1626
1889
|
*/
|
|
1627
|
-
export
|
|
1628
|
-
|
|
1629
|
-
* A unique identifier for the component.
|
|
1630
|
-
* This UUID is used to register the component within the Components system.
|
|
1631
|
-
*/
|
|
1632
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
1633
|
-
/**
|
|
1634
|
-
* A map of world UUIDs to their corresponding grid instances.
|
|
1635
|
-
*/
|
|
1636
|
-
list: Map<string, SimpleGrid>;
|
|
1637
|
-
/**
|
|
1638
|
-
* The default configuration for grid creation.
|
|
1639
|
-
*/
|
|
1640
|
-
config: Required<GridConfig>;
|
|
1641
|
-
/** {@link Disposable.onDisposed} */
|
|
1642
|
-
readonly onDisposed: Event<unknown>;
|
|
1643
|
-
/** {@link Component.enabled} */
|
|
1644
|
-
enabled: boolean;
|
|
1645
|
-
constructor(components: Components);
|
|
1646
|
-
/**
|
|
1647
|
-
* Creates a new grid for the given world.
|
|
1648
|
-
* Throws an error if a grid already exists for the world.
|
|
1649
|
-
*
|
|
1650
|
-
* @param world - The world to create the grid for.
|
|
1651
|
-
* @returns The newly created grid.
|
|
1652
|
-
*
|
|
1653
|
-
* @throws Will throw an error if a grid already exists for the given world.
|
|
1654
|
-
*/
|
|
1655
|
-
create(world: World): SimpleGrid;
|
|
1656
|
-
/**
|
|
1657
|
-
* Deletes the grid associated with the given world.
|
|
1658
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
1659
|
-
*
|
|
1660
|
-
* @param world - The world for which to delete the grid.
|
|
1661
|
-
*
|
|
1662
|
-
* @remarks
|
|
1663
|
-
* This method will dispose of the grid and remove it from the internal list.
|
|
1664
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
1665
|
-
*/
|
|
1666
|
-
delete(world: World): void;
|
|
1667
|
-
/** {@link Disposable.dispose} */
|
|
1668
|
-
dispose(): void;
|
|
1890
|
+
export interface ChangeMap {
|
|
1891
|
+
[modelID: string]: Set<number>;
|
|
1669
1892
|
}
|
|
1670
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
1671
|
-
import { SimpleRaycaster } from "./src";
|
|
1672
|
-
import { Components } from "../Components";
|
|
1673
1893
|
/**
|
|
1674
|
-
*
|
|
1894
|
+
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1675
1895
|
*/
|
|
1676
|
-
export
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
/** {@link Component.enabled} */
|
|
1683
|
-
enabled: boolean;
|
|
1684
|
-
/**
|
|
1685
|
-
* A Map that stores raycasters for each world.
|
|
1686
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
1687
|
-
*/
|
|
1688
|
-
list: Map<string, SimpleRaycaster>;
|
|
1689
|
-
/** {@link Disposable.onDisposed} */
|
|
1690
|
-
onDisposed: Event<unknown>;
|
|
1691
|
-
constructor(components: Components);
|
|
1692
|
-
/**
|
|
1693
|
-
* Retrieves a SimpleRaycaster instance for the given world.
|
|
1694
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
1695
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
1696
|
-
*
|
|
1697
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
1698
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
1699
|
-
*/
|
|
1700
|
-
get(world: World): SimpleRaycaster;
|
|
1701
|
-
/**
|
|
1702
|
-
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
1703
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
1704
|
-
*
|
|
1705
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
1706
|
-
* @returns {void}
|
|
1707
|
-
*/
|
|
1708
|
-
delete(world: World): void;
|
|
1709
|
-
/** {@link Disposable.dispose} */
|
|
1710
|
-
dispose(): void;
|
|
1896
|
+
export interface AttributeListener {
|
|
1897
|
+
[modelID: string]: {
|
|
1898
|
+
[expressID: number]: {
|
|
1899
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1900
|
+
};
|
|
1901
|
+
};
|
|
1711
1902
|
}
|
|
1712
|
-
import * as THREE from "three";
|
|
1713
|
-
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
1714
|
-
import { SimplePlane } from "./src";
|
|
1715
|
-
import { Components } from "../Components";
|
|
1716
1903
|
/**
|
|
1717
|
-
*
|
|
1718
|
-
*
|
|
1719
|
-
* @param components - the instance of {@link Components} used.
|
|
1720
|
-
* E.g. {@link SimplePlane}.
|
|
1904
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1721
1905
|
*/
|
|
1722
|
-
export declare class
|
|
1906
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1723
1907
|
/**
|
|
1724
1908
|
* A unique identifier for the component.
|
|
1725
1909
|
* This UUID is used to register the component within the Components system.
|
|
1726
1910
|
*/
|
|
1727
|
-
static readonly uuid: "
|
|
1728
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1729
|
-
readonly onBeforeDrag: Event<void>;
|
|
1730
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1731
|
-
readonly onAfterDrag: Event<void>;
|
|
1732
|
-
/**
|
|
1733
|
-
* Event that fires when the user starts creating a clipping plane.
|
|
1734
|
-
*/
|
|
1735
|
-
readonly onBeforeCreate: Event<unknown>;
|
|
1736
|
-
/**
|
|
1737
|
-
* Event that fires when the user cancels the creation of a clipping plane.
|
|
1738
|
-
*/
|
|
1739
|
-
readonly onBeforeCancel: Event<unknown>;
|
|
1740
|
-
/**
|
|
1741
|
-
* Event that fires after the user cancels the creation of a clipping plane.
|
|
1742
|
-
*/
|
|
1743
|
-
readonly onAfterCancel: Event<unknown>;
|
|
1744
|
-
/**
|
|
1745
|
-
* Event that fires when the user starts deleting a clipping plane.
|
|
1746
|
-
*/
|
|
1747
|
-
readonly onBeforeDelete: Event<unknown>;
|
|
1748
|
-
/**
|
|
1749
|
-
* Event that fires after a clipping plane has been created.
|
|
1750
|
-
* @param plane - The newly created clipping plane.
|
|
1751
|
-
*/
|
|
1752
|
-
readonly onAfterCreate: Event<SimplePlane>;
|
|
1753
|
-
/**
|
|
1754
|
-
* Event that fires after a clipping plane has been deleted.
|
|
1755
|
-
* @param plane - The deleted clipping plane.
|
|
1756
|
-
*/
|
|
1757
|
-
readonly onAfterDelete: Event<SimplePlane>;
|
|
1911
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1758
1912
|
/** {@link Disposable.onDisposed} */
|
|
1759
1913
|
readonly onDisposed: Event<string>;
|
|
1760
1914
|
/**
|
|
1761
|
-
*
|
|
1762
|
-
* (up). This is desirable when clipping a building horizontally and a
|
|
1763
|
-
* clipping plane is created in its roof, which might have a slight
|
|
1764
|
-
* slope for draining purposes.
|
|
1765
|
-
*/
|
|
1766
|
-
orthogonalY: boolean;
|
|
1767
|
-
/**
|
|
1768
|
-
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
1769
|
-
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
1770
|
-
* has to be 'true' for this to apply.
|
|
1771
|
-
*/
|
|
1772
|
-
toleranceOrthogonalY: number;
|
|
1773
|
-
/**
|
|
1774
|
-
* The type of clipping plane to be created.
|
|
1775
|
-
* Default is {@link SimplePlane}.
|
|
1776
|
-
*/
|
|
1777
|
-
Type: new (...args: any) => SimplePlane;
|
|
1778
|
-
/**
|
|
1779
|
-
* A list of all the clipping planes created by this component.
|
|
1780
|
-
*/
|
|
1781
|
-
list: SimplePlane[];
|
|
1782
|
-
/** The material used in all the clipping planes. */
|
|
1783
|
-
private _material;
|
|
1784
|
-
private _size;
|
|
1785
|
-
private _enabled;
|
|
1786
|
-
private _visible;
|
|
1787
|
-
/** {@link Component.enabled} */
|
|
1788
|
-
get enabled(): boolean;
|
|
1789
|
-
/** {@link Component.enabled} */
|
|
1790
|
-
set enabled(state: boolean);
|
|
1791
|
-
/** {@link Hideable.visible } */
|
|
1792
|
-
get visible(): boolean;
|
|
1793
|
-
/** {@link Hideable.visible } */
|
|
1794
|
-
set visible(state: boolean);
|
|
1795
|
-
/** The material of the clipping plane representation. */
|
|
1796
|
-
get material(): THREE.MeshBasicMaterial;
|
|
1797
|
-
/** The material of the clipping plane representation. */
|
|
1798
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
1799
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
1800
|
-
get size(): number;
|
|
1801
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
1802
|
-
set size(size: number);
|
|
1803
|
-
constructor(components: Components);
|
|
1804
|
-
/** {@link Disposable.dispose} */
|
|
1805
|
-
dispose(): void;
|
|
1806
|
-
/** {@link Createable.create} */
|
|
1807
|
-
create(world: World): SimplePlane | null;
|
|
1808
|
-
/**
|
|
1809
|
-
* Creates a plane in a certain place and with a certain orientation,
|
|
1810
|
-
* without the need of the mouse.
|
|
1811
|
-
*
|
|
1812
|
-
* @param world - the world where this plane should be created.
|
|
1813
|
-
* @param normal - the orientation of the clipping plane.
|
|
1814
|
-
* @param point - the position of the clipping plane.
|
|
1815
|
-
* navigation.
|
|
1816
|
-
*/
|
|
1817
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
1818
|
-
/**
|
|
1819
|
-
* {@link Createable.delete}
|
|
1820
|
-
*
|
|
1821
|
-
* @param world - the world where the plane to delete is.
|
|
1822
|
-
* @param plane - the plane to delete. If undefined, the first plane
|
|
1823
|
-
* found under the cursor will be deleted.
|
|
1915
|
+
* Event triggered when a file is requested for export.
|
|
1824
1916
|
*/
|
|
1825
|
-
|
|
1917
|
+
readonly onRequestFile: Event<unknown>;
|
|
1826
1918
|
/**
|
|
1827
|
-
*
|
|
1828
|
-
*
|
|
1829
|
-
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
1919
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1830
1920
|
*/
|
|
1831
|
-
|
|
1832
|
-
private deletePlane;
|
|
1833
|
-
private pickPlane;
|
|
1834
|
-
private getAllPlaneMeshes;
|
|
1835
|
-
private createPlaneFromIntersection;
|
|
1836
|
-
private getWorldNormal;
|
|
1837
|
-
private normalizePlaneDirectionY;
|
|
1838
|
-
private newPlane;
|
|
1839
|
-
private updateMaterialsAndPlanes;
|
|
1840
|
-
private _onStartDragging;
|
|
1841
|
-
private _onEndDragging;
|
|
1842
|
-
}
|
|
1843
|
-
import { MiniMap } from "./src";
|
|
1844
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
1845
|
-
import { Components } from "../Components";
|
|
1846
|
-
/**
|
|
1847
|
-
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
1848
|
-
*/
|
|
1849
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
1921
|
+
ifcToExport: ArrayBuffer | null;
|
|
1850
1922
|
/**
|
|
1851
|
-
*
|
|
1852
|
-
* This UUID is used to register the component within the Components system.
|
|
1923
|
+
* Event triggered when an element is added to a Pset.
|
|
1853
1924
|
*/
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
/** {@link Disposable.onDisposed} */
|
|
1860
|
-
readonly onDisposed: Event<unknown>;
|
|
1861
|
-
/** {@link Component.enabled} */
|
|
1862
|
-
enabled: boolean;
|
|
1925
|
+
readonly onElementToPset: Event<{
|
|
1926
|
+
model: FragmentsGroup;
|
|
1927
|
+
psetID: number;
|
|
1928
|
+
elementID: number;
|
|
1929
|
+
}>;
|
|
1863
1930
|
/**
|
|
1864
|
-
*
|
|
1931
|
+
* Event triggered when a property is added to a Pset.
|
|
1865
1932
|
*/
|
|
1866
|
-
|
|
1867
|
-
|
|
1933
|
+
readonly onPropToPset: Event<{
|
|
1934
|
+
model: FragmentsGroup;
|
|
1935
|
+
psetID: number;
|
|
1936
|
+
propID: number;
|
|
1937
|
+
}>;
|
|
1868
1938
|
/**
|
|
1869
|
-
*
|
|
1870
|
-
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
1871
|
-
*
|
|
1872
|
-
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
1873
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
1874
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
1939
|
+
* Event triggered when a Pset is removed.
|
|
1875
1940
|
*/
|
|
1876
|
-
|
|
1941
|
+
readonly onPsetRemoved: Event<{
|
|
1942
|
+
model: FragmentsGroup;
|
|
1943
|
+
psetID: number;
|
|
1944
|
+
}>;
|
|
1877
1945
|
/**
|
|
1878
|
-
*
|
|
1879
|
-
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
1880
|
-
*
|
|
1881
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
1882
|
-
* @returns {void}
|
|
1946
|
+
* Event triggered when data in the model changes.
|
|
1883
1947
|
*/
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
update(): void;
|
|
1889
|
-
}
|
|
1890
|
-
import * as THREE from "three";
|
|
1891
|
-
export declare class MaterialsUtils {
|
|
1892
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
1893
|
-
}
|
|
1894
|
-
import { Components } from "../Components";
|
|
1895
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
1896
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
1897
|
-
/**
|
|
1898
|
-
* 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).
|
|
1899
|
-
*/
|
|
1900
|
-
export declare class Cullers extends Component implements Disposable {
|
|
1948
|
+
readonly onDataChanged: Event<{
|
|
1949
|
+
model: FragmentsGroup;
|
|
1950
|
+
expressID: number;
|
|
1951
|
+
}>;
|
|
1901
1952
|
/**
|
|
1902
|
-
*
|
|
1903
|
-
* This UUID is used to register the component within the Components system.
|
|
1953
|
+
* Configuration for the WebAssembly module.
|
|
1904
1954
|
*/
|
|
1905
|
-
|
|
1955
|
+
wasm: {
|
|
1956
|
+
path: string;
|
|
1957
|
+
absolute: boolean;
|
|
1958
|
+
};
|
|
1959
|
+
/** {@link Component.enabled} */
|
|
1960
|
+
enabled: boolean;
|
|
1906
1961
|
/**
|
|
1907
|
-
*
|
|
1962
|
+
* Map of attribute listeners.
|
|
1908
1963
|
*/
|
|
1909
|
-
|
|
1910
|
-
private _enabled;
|
|
1964
|
+
attributeListeners: AttributeListener;
|
|
1911
1965
|
/**
|
|
1912
|
-
*
|
|
1966
|
+
* The currently selected model.
|
|
1913
1967
|
*/
|
|
1914
|
-
|
|
1915
|
-
/**
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1968
|
+
selectedModel?: FragmentsGroup;
|
|
1969
|
+
/**
|
|
1970
|
+
* Map of changed entities in the model.
|
|
1971
|
+
*/
|
|
1972
|
+
changeMap: ChangeMap;
|
|
1919
1973
|
constructor(components: Components);
|
|
1974
|
+
/** {@link Disposable.dispose} */
|
|
1975
|
+
dispose(): void;
|
|
1920
1976
|
/**
|
|
1921
|
-
*
|
|
1922
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
1923
|
-
*
|
|
1924
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
1925
|
-
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
1977
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
1926
1978
|
*
|
|
1927
|
-
* @
|
|
1979
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1980
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1981
|
+
* @returns The IFC schema associated with the given model.
|
|
1928
1982
|
*/
|
|
1929
|
-
|
|
1983
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1930
1984
|
/**
|
|
1931
|
-
*
|
|
1932
|
-
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
1985
|
+
* Method to set properties data in the model.
|
|
1933
1986
|
*
|
|
1934
|
-
* @param
|
|
1987
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1988
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1989
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1990
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
1935
1991
|
*
|
|
1936
|
-
* @returns
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
/** {@link Disposable.dispose} */
|
|
1940
|
-
dispose(): void;
|
|
1941
|
-
}
|
|
1942
|
-
import * as THREE from "three";
|
|
1943
|
-
import { Components } from "../Components";
|
|
1944
|
-
import { SimpleCamera } from "..";
|
|
1945
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
1946
|
-
/**
|
|
1947
|
-
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
1948
|
-
*/
|
|
1949
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
1950
|
-
/**
|
|
1951
|
-
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
1992
|
+
* @returns A promise that resolves when all the properties have been set.
|
|
1993
|
+
*
|
|
1994
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
1952
1995
|
*/
|
|
1953
|
-
|
|
1996
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
1954
1997
|
/**
|
|
1955
|
-
*
|
|
1956
|
-
*
|
|
1998
|
+
* Creates a new Property Set (Pset) in the given model.
|
|
1999
|
+
*
|
|
2000
|
+
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
2001
|
+
* @param name - The name of the Pset.
|
|
2002
|
+
* @param description - (Optional) The description of the Pset.
|
|
2003
|
+
*
|
|
2004
|
+
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
2005
|
+
*
|
|
2006
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2007
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1957
2008
|
*/
|
|
1958
|
-
|
|
2009
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
2010
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
2011
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
2012
|
+
}>;
|
|
1959
2013
|
/**
|
|
1960
|
-
*
|
|
1961
|
-
*
|
|
2014
|
+
* Removes a Property Set (Pset) from the given model.
|
|
2015
|
+
*
|
|
2016
|
+
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
2017
|
+
* @param psetID - The express IDs of the Psets to be removed.
|
|
2018
|
+
*
|
|
2019
|
+
* @returns A promise that resolves when all the Psets have been removed.
|
|
2020
|
+
*
|
|
2021
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
2022
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
2023
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1962
2024
|
*/
|
|
1963
|
-
|
|
1964
|
-
protected readonly _userInputButtons: any;
|
|
1965
|
-
protected readonly _frustumSize = 50;
|
|
1966
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
1967
|
-
protected _mode: NavigationMode | null;
|
|
1968
|
-
private previousSize;
|
|
2025
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
1969
2026
|
/**
|
|
1970
|
-
*
|
|
1971
|
-
* Throws an error if the mode is not found or the camera is not initialized.
|
|
2027
|
+
* Creates a new single-value property of type string in the given model.
|
|
1972
2028
|
*
|
|
1973
|
-
* @
|
|
2029
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
2030
|
+
* @param type - The type of the property value. Must be a string property type.
|
|
2031
|
+
* @param name - The name of the property.
|
|
2032
|
+
* @param value - The value of the property. Must be a string.
|
|
1974
2033
|
*
|
|
1975
|
-
* @
|
|
2034
|
+
* @returns The newly created single-value property.
|
|
2035
|
+
*
|
|
2036
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2037
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1976
2038
|
*/
|
|
1977
|
-
|
|
1978
|
-
constructor(components: Components);
|
|
1979
|
-
/** {@link Disposable.dispose} */
|
|
1980
|
-
dispose(): void;
|
|
2039
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1981
2040
|
/**
|
|
1982
|
-
*
|
|
2041
|
+
* Creates a new single-value property of type numeric in the given model.
|
|
1983
2042
|
*
|
|
1984
|
-
* @param
|
|
2043
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
2044
|
+
* @param type - The type of the property value. Must be a numeric property type.
|
|
2045
|
+
* @param name - The name of the property.
|
|
2046
|
+
* @param value - The value of the property. Must be a number.
|
|
2047
|
+
*
|
|
2048
|
+
* @returns The newly created single-value property.
|
|
2049
|
+
*
|
|
2050
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2051
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1985
2052
|
*/
|
|
1986
|
-
|
|
2053
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1987
2054
|
/**
|
|
1988
|
-
*
|
|
2055
|
+
* Creates a new single-value property of type boolean in the given model.
|
|
1989
2056
|
*
|
|
1990
|
-
* @param
|
|
1991
|
-
*
|
|
1992
|
-
* @param
|
|
2057
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
2058
|
+
* @param type - The type of the property value. Must be a boolean property type.
|
|
2059
|
+
* @param name - The name of the property.
|
|
2060
|
+
* @param value - The value of the property. Must be a boolean.
|
|
2061
|
+
*
|
|
2062
|
+
* @returns The newly created single-value property.
|
|
2063
|
+
*
|
|
2064
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2065
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1993
2066
|
*/
|
|
1994
|
-
|
|
2067
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1995
2068
|
/**
|
|
1996
|
-
*
|
|
2069
|
+
* Removes a property from a Property Set (Pset) in the given model.
|
|
1997
2070
|
*
|
|
1998
|
-
* @param
|
|
2071
|
+
* @param model - The FragmentsGroup model from which to remove the property.
|
|
2072
|
+
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
2073
|
+
* @param propID - The express ID of the property to be removed.
|
|
2074
|
+
*
|
|
2075
|
+
* @returns A promise that resolves when the property has been removed.
|
|
2076
|
+
*
|
|
2077
|
+
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
2078
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1999
2079
|
*/
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
private enableUserInput;
|
|
2003
|
-
private newOrthoCamera;
|
|
2004
|
-
private setOrthoPerspCameraAspect;
|
|
2005
|
-
}
|
|
2006
|
-
export declare class UUID {
|
|
2007
|
-
private static _pattern;
|
|
2008
|
-
private static _lut;
|
|
2009
|
-
static create(): string;
|
|
2010
|
-
static validate(uuid: string): void;
|
|
2011
|
-
}
|
|
2012
|
-
import * as THREE from "three";
|
|
2013
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
2014
|
-
/**
|
|
2015
|
-
* Configuration interface for the VertexPicker component.
|
|
2016
|
-
*/
|
|
2017
|
-
export interface VertexPickerConfig {
|
|
2080
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
2081
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
2018
2082
|
/**
|
|
2019
|
-
*
|
|
2083
|
+
* Adds elements to a Property Set (Pset) in the given model.
|
|
2084
|
+
*
|
|
2085
|
+
* @param model - The FragmentsGroup model in which to add the elements.
|
|
2086
|
+
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
2087
|
+
* @param elementID - The express IDs of the elements to be added.
|
|
2088
|
+
*
|
|
2089
|
+
* @returns A promise that resolves when all the elements have been added.
|
|
2090
|
+
*
|
|
2091
|
+
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
2092
|
+
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
2093
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
2020
2094
|
*/
|
|
2021
|
-
|
|
2095
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
2022
2096
|
/**
|
|
2023
|
-
*
|
|
2097
|
+
* Saves the changes made to the model to a new IFC file.
|
|
2098
|
+
*
|
|
2099
|
+
* @param model - The FragmentsGroup model from which to save the changes.
|
|
2100
|
+
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
2101
|
+
*
|
|
2102
|
+
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
2103
|
+
*
|
|
2104
|
+
* @throws Will throw an error if any issues occur during the saving process.
|
|
2024
2105
|
*/
|
|
2025
|
-
|
|
2106
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
2026
2107
|
/**
|
|
2027
|
-
*
|
|
2108
|
+
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
2109
|
+
* The listener will trigger an event whenever the attribute's value changes.
|
|
2110
|
+
*
|
|
2111
|
+
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
2112
|
+
* @param expressID - The express ID of the entity for which to set the listener.
|
|
2113
|
+
* @param attributeName - The name of the attribute for which to set the listener.
|
|
2114
|
+
*
|
|
2115
|
+
* @returns The event that will be triggered when the attribute's value changes.
|
|
2116
|
+
*
|
|
2117
|
+
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
2118
|
+
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
2119
|
+
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
2028
2120
|
*/
|
|
2029
|
-
|
|
2121
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
2122
|
+
private increaseMaxID;
|
|
2123
|
+
private newGUID;
|
|
2124
|
+
private getOwnerHistory;
|
|
2125
|
+
private registerChange;
|
|
2126
|
+
private newSingleProperty;
|
|
2030
2127
|
}
|
|
2128
|
+
import * as THREE from "three";
|
|
2129
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2031
2130
|
/**
|
|
2032
|
-
* A class
|
|
2131
|
+
* A class representing a 2D minimap of a 3D world.
|
|
2033
2132
|
*/
|
|
2034
|
-
export declare class
|
|
2133
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
2035
2134
|
/** {@link Disposable.onDisposed} */
|
|
2036
2135
|
readonly onDisposed: Event<unknown>;
|
|
2136
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2137
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
2138
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2139
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
2140
|
+
/** {@link Resizeable.onResize} */
|
|
2141
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
2037
2142
|
/**
|
|
2038
|
-
*
|
|
2039
|
-
*
|
|
2143
|
+
* The front offset of the minimap.
|
|
2144
|
+
* It determines how much the minimap's view is offset from the camera's view.
|
|
2145
|
+
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
2040
2146
|
*/
|
|
2041
|
-
|
|
2147
|
+
frontOffset: number;
|
|
2042
2148
|
/**
|
|
2043
|
-
*
|
|
2044
|
-
*
|
|
2149
|
+
* The override material for the minimap.
|
|
2150
|
+
* It is used to render the depth information of the world onto the minimap.
|
|
2151
|
+
*/
|
|
2152
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
2153
|
+
/**
|
|
2154
|
+
* The background color of the minimap.
|
|
2155
|
+
* It is used to set the background color of the minimap's renderer.
|
|
2045
2156
|
*/
|
|
2046
|
-
|
|
2157
|
+
backgroundColor: THREE.Color;
|
|
2047
2158
|
/**
|
|
2048
|
-
*
|
|
2159
|
+
* The WebGL renderer for the minimap.
|
|
2160
|
+
* It is used to render the minimap onto the screen.
|
|
2049
2161
|
*/
|
|
2050
|
-
|
|
2162
|
+
renderer: THREE.WebGLRenderer;
|
|
2051
2163
|
/**
|
|
2052
|
-
* A
|
|
2164
|
+
* A flag indicating whether the minimap is enabled.
|
|
2165
|
+
* If disabled, the minimap will not update or render.
|
|
2053
2166
|
*/
|
|
2054
|
-
|
|
2167
|
+
enabled: boolean;
|
|
2055
2168
|
/**
|
|
2056
|
-
*
|
|
2057
|
-
*
|
|
2058
|
-
* If this value is null, all vertices are considered valid.
|
|
2169
|
+
* The world in which the minimap is displayed.
|
|
2170
|
+
* It provides access to the 3D scene, camera, and other relevant world elements.
|
|
2059
2171
|
*/
|
|
2060
|
-
|
|
2061
|
-
private
|
|
2062
|
-
private
|
|
2063
|
-
private
|
|
2172
|
+
world: World;
|
|
2173
|
+
private _lockRotation;
|
|
2174
|
+
private _camera;
|
|
2175
|
+
private _plane;
|
|
2176
|
+
private _size;
|
|
2177
|
+
private _tempVector1;
|
|
2178
|
+
private _tempVector2;
|
|
2179
|
+
private _tempTarget;
|
|
2180
|
+
private readonly down;
|
|
2064
2181
|
/**
|
|
2065
|
-
*
|
|
2066
|
-
* When
|
|
2067
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
2068
|
-
*
|
|
2069
|
-
* @param value - The new enabled state.
|
|
2182
|
+
* Gets or sets whether the minimap rotation is locked.
|
|
2183
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
2070
2184
|
*/
|
|
2071
|
-
|
|
2185
|
+
get lockRotation(): boolean;
|
|
2072
2186
|
/**
|
|
2073
|
-
*
|
|
2074
|
-
*
|
|
2075
|
-
* @
|
|
2187
|
+
* Sets whether the minimap rotation is locked.
|
|
2188
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
2189
|
+
* @param active - If 'true', rotation is locked. If 'false', rotation is not locked.
|
|
2076
2190
|
*/
|
|
2077
|
-
|
|
2191
|
+
set lockRotation(active: boolean);
|
|
2078
2192
|
/**
|
|
2079
|
-
*
|
|
2080
|
-
*
|
|
2081
|
-
* @
|
|
2082
|
-
* The properties not provided in the value object will retain their current values.
|
|
2083
|
-
*
|
|
2084
|
-
* @example
|
|
2085
|
-
* '''typescript
|
|
2086
|
-
* vertexPicker.config = {
|
|
2087
|
-
* snapDistance: 0.5,
|
|
2088
|
-
* showOnlyVertex: true,
|
|
2089
|
-
* };
|
|
2090
|
-
* '''
|
|
2193
|
+
* Gets the current zoom level of the minimap.
|
|
2194
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
2195
|
+
* @returns The current zoom level of the minimap.
|
|
2091
2196
|
*/
|
|
2092
|
-
|
|
2197
|
+
get zoom(): number;
|
|
2093
2198
|
/**
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
2096
|
-
* @
|
|
2097
|
-
*
|
|
2098
|
-
* @example
|
|
2099
|
-
* '''typescript
|
|
2100
|
-
* const currentConfig = vertexPicker.config;
|
|
2101
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
2102
|
-
* '''
|
|
2199
|
+
* Sets the zoom level of the minimap.
|
|
2200
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
2201
|
+
* @param value - The new zoom level of the minimap.
|
|
2103
2202
|
*/
|
|
2104
|
-
|
|
2105
|
-
constructor(
|
|
2203
|
+
set zoom(value: number);
|
|
2204
|
+
constructor(world: World);
|
|
2106
2205
|
/** {@link Disposable.dispose} */
|
|
2107
2206
|
dispose(): void;
|
|
2108
|
-
/**
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
2118
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
2119
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
2120
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
2121
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
2122
|
-
*/
|
|
2123
|
-
get(world: World): THREE.Vector3 | null;
|
|
2124
|
-
private getClosestVertex;
|
|
2125
|
-
private getVertices;
|
|
2126
|
-
private getVertex;
|
|
2207
|
+
/** Returns the camera used by the MiniMap */
|
|
2208
|
+
get(): THREE.OrthographicCamera;
|
|
2209
|
+
/** {@link Updateable.update} */
|
|
2210
|
+
update(): void;
|
|
2211
|
+
/** {@link Resizeable.getSize} */
|
|
2212
|
+
getSize(): THREE.Vector2;
|
|
2213
|
+
/** {@link Resizeable.resize} */
|
|
2214
|
+
resize(size?: THREE.Vector2): void;
|
|
2215
|
+
private updatePlanes;
|
|
2127
2216
|
}
|
|
2128
2217
|
import * as FRAGS from "@thatopen/fragments";
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
static
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2141
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2142
|
-
key: string | null;
|
|
2143
|
-
name: string | null;
|
|
2144
|
-
}>;
|
|
2145
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2146
|
-
key: string | null;
|
|
2147
|
-
value: number | null;
|
|
2148
|
-
}>;
|
|
2149
|
-
static isRel(expressID: number): boolean;
|
|
2150
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2151
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2218
|
+
import * as WEBIFC from "web-ifc";
|
|
2219
|
+
export declare class SpatialIdsFinder {
|
|
2220
|
+
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2221
|
+
}
|
|
2222
|
+
import * as WEBIFC from "web-ifc";
|
|
2223
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2224
|
+
export declare class SpatialStructure {
|
|
2225
|
+
itemsByFloor: IfcItemsCategories;
|
|
2226
|
+
private _units;
|
|
2227
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2228
|
+
cleanUp(): void;
|
|
2152
2229
|
}
|
|
2153
|
-
/**
|
|
2154
|
-
* 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.
|
|
2155
|
-
*
|
|
2156
|
-
* @remarks
|
|
2157
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2158
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2159
|
-
*
|
|
2160
|
-
*/
|
|
2161
|
-
export declare const IfcElements: {
|
|
2162
|
-
[key: number]: string;
|
|
2163
|
-
};
|
|
2164
2230
|
/**
|
|
2165
2231
|
* 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.
|
|
2166
2232
|
*/
|
|
@@ -2215,94 +2281,246 @@ export declare class IfcFragmentSettings {
|
|
|
2215
2281
|
*/
|
|
2216
2282
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2217
2283
|
}
|
|
2284
|
+
/**
|
|
2285
|
+
* 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.
|
|
2286
|
+
*
|
|
2287
|
+
* @remarks
|
|
2288
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2289
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2290
|
+
*
|
|
2291
|
+
*/
|
|
2292
|
+
export declare const IfcElements: {
|
|
2293
|
+
[key: number]: string;
|
|
2294
|
+
};
|
|
2295
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2296
|
+
export declare class IfcPropertiesUtils {
|
|
2297
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2298
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2299
|
+
[attribute: string]: any;
|
|
2300
|
+
} | null>;
|
|
2301
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2302
|
+
[relatingID: number]: number[];
|
|
2303
|
+
}>;
|
|
2304
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2305
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2306
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2307
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2308
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2309
|
+
key: string | null;
|
|
2310
|
+
name: string | null;
|
|
2311
|
+
}>;
|
|
2312
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2313
|
+
key: string | null;
|
|
2314
|
+
value: number | null;
|
|
2315
|
+
}>;
|
|
2316
|
+
static isRel(expressID: number): boolean;
|
|
2317
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2318
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2319
|
+
}
|
|
2320
|
+
import * as THREE from "three";
|
|
2321
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2322
|
+
import { Components } from "../../Components";
|
|
2323
|
+
/**
|
|
2324
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
2325
|
+
*/
|
|
2326
|
+
export interface GridConfig {
|
|
2327
|
+
/**
|
|
2328
|
+
* The color of the grid lines.
|
|
2329
|
+
*/
|
|
2330
|
+
color: THREE.Color;
|
|
2331
|
+
/**
|
|
2332
|
+
* The size of the primary grid lines.
|
|
2333
|
+
*/
|
|
2334
|
+
size1: number;
|
|
2335
|
+
/**
|
|
2336
|
+
* The size of the secondary grid lines.
|
|
2337
|
+
*/
|
|
2338
|
+
size2: number;
|
|
2339
|
+
/**
|
|
2340
|
+
* The distance at which the grid lines start to fade away.
|
|
2341
|
+
*/
|
|
2342
|
+
distance: number;
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* 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).
|
|
2346
|
+
*/
|
|
2347
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2348
|
+
/** {@link Disposable.onDisposed} */
|
|
2349
|
+
readonly onDisposed: Event<unknown>;
|
|
2350
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2351
|
+
world: World;
|
|
2352
|
+
/** The components instance to which this grid belongs. */
|
|
2353
|
+
components: Components;
|
|
2354
|
+
/** {@link Hideable.visible} */
|
|
2355
|
+
get visible(): boolean;
|
|
2356
|
+
/** {@link Hideable.visible} */
|
|
2357
|
+
set visible(visible: boolean);
|
|
2358
|
+
/** The material of the grid. */
|
|
2359
|
+
get material(): THREE.ShaderMaterial;
|
|
2360
|
+
/**
|
|
2361
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2362
|
+
* perspective cameras and false for orthographic cameras.
|
|
2363
|
+
*/
|
|
2364
|
+
get fade(): boolean;
|
|
2365
|
+
/**
|
|
2366
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2367
|
+
* perspective cameras and false for orthographic cameras.
|
|
2368
|
+
*/
|
|
2369
|
+
set fade(active: boolean);
|
|
2370
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2371
|
+
readonly three: THREE.Mesh;
|
|
2372
|
+
private _fade;
|
|
2373
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2374
|
+
/** {@link Disposable.dispose} */
|
|
2375
|
+
dispose(): void;
|
|
2376
|
+
private setupEvents;
|
|
2377
|
+
private updateZoom;
|
|
2378
|
+
}
|
|
2379
|
+
import { NavigationMode } from "./types";
|
|
2380
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2381
|
+
/**
|
|
2382
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
2383
|
+
*/
|
|
2384
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
2385
|
+
private camera;
|
|
2386
|
+
/** {@link NavigationMode.enabled} */
|
|
2387
|
+
enabled: boolean;
|
|
2388
|
+
/** {@link NavigationMode.id} */
|
|
2389
|
+
readonly id = "FirstPerson";
|
|
2390
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2391
|
+
/** {@link NavigationMode.set} */
|
|
2392
|
+
set(active: boolean): void;
|
|
2393
|
+
private setupFirstPersonCamera;
|
|
2394
|
+
}
|
|
2395
|
+
import { NavigationMode } from "./types";
|
|
2396
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2397
|
+
/**
|
|
2398
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2399
|
+
*/
|
|
2400
|
+
export declare class OrbitMode implements NavigationMode {
|
|
2401
|
+
camera: OrthoPerspectiveCamera;
|
|
2402
|
+
/** {@link NavigationMode.enabled} */
|
|
2403
|
+
enabled: boolean;
|
|
2404
|
+
/** {@link NavigationMode.id} */
|
|
2405
|
+
readonly id = "Orbit";
|
|
2406
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2407
|
+
/** {@link NavigationMode.set} */
|
|
2408
|
+
set(active: boolean): void;
|
|
2409
|
+
private activateOrbitControls;
|
|
2410
|
+
}
|
|
2218
2411
|
/**
|
|
2219
2412
|
* A Set of unique numbers representing different types of IFC geometries.
|
|
2220
2413
|
*/
|
|
2221
2414
|
export declare const GeometryTypes: Set<number>;
|
|
2222
|
-
import {
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2415
|
+
import { NavigationMode } from "./types";
|
|
2416
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2417
|
+
/**
|
|
2418
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
2419
|
+
*/
|
|
2420
|
+
export declare class PlanMode implements NavigationMode {
|
|
2421
|
+
private camera;
|
|
2422
|
+
/** {@link NavigationMode.enabled} */
|
|
2423
|
+
enabled: boolean;
|
|
2424
|
+
/** {@link NavigationMode.id} */
|
|
2425
|
+
readonly id = "Plan";
|
|
2426
|
+
private mouseAction1?;
|
|
2427
|
+
private mouseAction2?;
|
|
2428
|
+
private mouseInitialized;
|
|
2429
|
+
private readonly defaultAzimuthSpeed;
|
|
2430
|
+
private readonly defaultPolarSpeed;
|
|
2431
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2432
|
+
/** {@link NavigationMode.set} */
|
|
2433
|
+
set(active: boolean): void;
|
|
2239
2434
|
}
|
|
2240
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2241
2435
|
/**
|
|
2242
|
-
*
|
|
2436
|
+
* The projection system of the camera.
|
|
2243
2437
|
*/
|
|
2244
|
-
export
|
|
2438
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
2439
|
+
/**
|
|
2440
|
+
* The extensible list of supported navigation modes.
|
|
2441
|
+
*/
|
|
2442
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
2443
|
+
/**
|
|
2444
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
2445
|
+
*/
|
|
2446
|
+
export interface NavigationMode {
|
|
2447
|
+
/** The unique ID of this navigation mode. */
|
|
2448
|
+
id: NavModeID;
|
|
2245
2449
|
/**
|
|
2246
|
-
*
|
|
2247
|
-
*
|
|
2248
|
-
|
|
2249
|
-
|
|
2450
|
+
* Enable or disable this navigation mode.
|
|
2451
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
2452
|
+
* must be disabled.
|
|
2453
|
+
*
|
|
2454
|
+
* @param active - whether to enable or disable this mode.
|
|
2455
|
+
* @param options - any additional data required to enable or disable it.
|
|
2456
|
+
* */
|
|
2457
|
+
set: (active: boolean, options?: any) => void;
|
|
2458
|
+
/** Whether this navigation mode is active or not. */
|
|
2459
|
+
enabled: boolean;
|
|
2250
2460
|
}
|
|
2461
|
+
import * as THREE from "three";
|
|
2462
|
+
import { CameraProjection } from "./types";
|
|
2463
|
+
import { Event } from "../../Types";
|
|
2464
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2251
2465
|
/**
|
|
2252
|
-
*
|
|
2466
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2253
2467
|
*/
|
|
2254
|
-
export declare class
|
|
2468
|
+
export declare class ProjectionManager {
|
|
2255
2469
|
/**
|
|
2256
|
-
*
|
|
2257
|
-
* @param handler - the callback to be added to this event.
|
|
2470
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
2258
2471
|
*/
|
|
2259
|
-
|
|
2260
|
-
(): void;
|
|
2261
|
-
} : {
|
|
2262
|
-
(data: T): void;
|
|
2263
|
-
}): void;
|
|
2472
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2264
2473
|
/**
|
|
2265
|
-
*
|
|
2266
|
-
*
|
|
2474
|
+
* Current projection mode of the camera.
|
|
2475
|
+
* Default is "Perspective".
|
|
2267
2476
|
*/
|
|
2268
|
-
|
|
2269
|
-
(): void;
|
|
2270
|
-
} : {
|
|
2271
|
-
(data: T): void;
|
|
2272
|
-
}): void;
|
|
2273
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2274
|
-
trigger: (data?: T) => void;
|
|
2275
|
-
/** Gets rid of all the suscribed events. */
|
|
2276
|
-
reset(): void;
|
|
2277
|
-
private handlers;
|
|
2278
|
-
}
|
|
2279
|
-
/**
|
|
2280
|
-
* 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.
|
|
2281
|
-
*/
|
|
2282
|
-
export declare class AsyncEvent<T> {
|
|
2477
|
+
current: CameraProjection;
|
|
2283
2478
|
/**
|
|
2284
|
-
*
|
|
2285
|
-
*
|
|
2479
|
+
* The camera controlled by this ProjectionManager.
|
|
2480
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2286
2481
|
*/
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2482
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2483
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
2484
|
+
matchOrthoDistanceEnabled: boolean;
|
|
2485
|
+
private _component;
|
|
2486
|
+
private _previousDistance;
|
|
2487
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2292
2488
|
/**
|
|
2293
|
-
*
|
|
2294
|
-
*
|
|
2489
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2490
|
+
*
|
|
2491
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
2492
|
+
* it will have no effect.
|
|
2295
2493
|
*/
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
private
|
|
2494
|
+
set(projection: CameraProjection): Promise<void>;
|
|
2495
|
+
/**
|
|
2496
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
2497
|
+
* and vice versa.
|
|
2498
|
+
*/
|
|
2499
|
+
toggle(): Promise<void>;
|
|
2500
|
+
private setOrthoCamera;
|
|
2501
|
+
private getPerspectiveDims;
|
|
2502
|
+
private setupOrthoCamera;
|
|
2503
|
+
private getDistance;
|
|
2504
|
+
private setPerspectiveCamera;
|
|
2505
|
+
}
|
|
2506
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2507
|
+
import { Components } from "../../Components";
|
|
2508
|
+
/**
|
|
2509
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2510
|
+
*/
|
|
2511
|
+
export declare abstract class Base {
|
|
2512
|
+
components: Components;
|
|
2513
|
+
constructor(components: Components);
|
|
2514
|
+
/** Whether is component is {@link Disposable}. */
|
|
2515
|
+
isDisposeable: () => this is Disposable;
|
|
2516
|
+
/** Whether is component is {@link Resizeable}. */
|
|
2517
|
+
isResizeable: () => this is Resizeable;
|
|
2518
|
+
/** Whether is component is {@link Updateable}. */
|
|
2519
|
+
isUpdateable: () => this is Updateable;
|
|
2520
|
+
/** Whether is component is {@link Hideable}. */
|
|
2521
|
+
isHideable: () => this is Hideable;
|
|
2522
|
+
/** Whether is component is {@link Configurable}. */
|
|
2523
|
+
isConfigurable: () => this is Configurable<any>;
|
|
2306
2524
|
}
|
|
2307
2525
|
import * as THREE from "three";
|
|
2308
2526
|
import CameraControls from "camera-controls";
|
|
@@ -2412,126 +2630,107 @@ export interface CameraControllable {
|
|
|
2412
2630
|
*/
|
|
2413
2631
|
controls: CameraControls;
|
|
2414
2632
|
}
|
|
2415
|
-
import {
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
/**
|
|
2421
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
2422
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2423
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2424
|
-
* will not be updated automatically each frame.
|
|
2425
|
-
*/
|
|
2426
|
-
abstract enabled: boolean;
|
|
2427
|
-
}
|
|
2428
|
-
import * as THREE from "three";
|
|
2429
|
-
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2633
|
+
import { InverseAttribute } from "./types";
|
|
2634
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2635
|
+
forRelating: InverseAttribute;
|
|
2636
|
+
forRelated: InverseAttribute;
|
|
2637
|
+
}>;
|
|
2430
2638
|
/**
|
|
2431
|
-
*
|
|
2639
|
+
* 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.
|
|
2432
2640
|
*/
|
|
2433
|
-
export declare class
|
|
2434
|
-
/** {@link Disposable.onDisposed} */
|
|
2435
|
-
readonly onDisposed: Event<unknown>;
|
|
2436
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2437
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2438
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2439
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2440
|
-
/** {@link Resizeable.onResize} */
|
|
2441
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
2442
|
-
/**
|
|
2443
|
-
* The front offset of the minimap.
|
|
2444
|
-
* It determines how much the minimap's view is offset from the camera's view.
|
|
2445
|
-
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
2446
|
-
*/
|
|
2447
|
-
frontOffset: number;
|
|
2641
|
+
export declare class Event<T> {
|
|
2448
2642
|
/**
|
|
2449
|
-
*
|
|
2450
|
-
*
|
|
2643
|
+
* Add a callback to this event instance.
|
|
2644
|
+
* @param handler - the callback to be added to this event.
|
|
2451
2645
|
*/
|
|
2452
|
-
|
|
2646
|
+
add(handler: T extends void ? {
|
|
2647
|
+
(): void;
|
|
2648
|
+
} : {
|
|
2649
|
+
(data: T): void;
|
|
2650
|
+
}): void;
|
|
2453
2651
|
/**
|
|
2454
|
-
*
|
|
2455
|
-
*
|
|
2652
|
+
* Removes a callback from this event instance.
|
|
2653
|
+
* @param handler - the callback to be removed from this event.
|
|
2456
2654
|
*/
|
|
2457
|
-
|
|
2655
|
+
remove(handler: T extends void ? {
|
|
2656
|
+
(): void;
|
|
2657
|
+
} : {
|
|
2658
|
+
(data: T): void;
|
|
2659
|
+
}): void;
|
|
2660
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2661
|
+
trigger: (data?: T) => void;
|
|
2662
|
+
/** Gets rid of all the suscribed events. */
|
|
2663
|
+
reset(): void;
|
|
2664
|
+
private handlers;
|
|
2665
|
+
}
|
|
2666
|
+
import * as THREE from "three";
|
|
2667
|
+
import CameraControls from "camera-controls";
|
|
2668
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2669
|
+
import { CameraControllable } from "./interfaces";
|
|
2670
|
+
/**
|
|
2671
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
2672
|
+
*/
|
|
2673
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
2458
2674
|
/**
|
|
2459
|
-
*
|
|
2460
|
-
* It is used to render the minimap onto the screen.
|
|
2675
|
+
* Whether the camera is enabled or not.
|
|
2461
2676
|
*/
|
|
2462
|
-
|
|
2677
|
+
abstract enabled: boolean;
|
|
2463
2678
|
/**
|
|
2464
|
-
*
|
|
2465
|
-
* If disabled, the minimap will not update or render.
|
|
2679
|
+
* The Three.js camera instance.
|
|
2466
2680
|
*/
|
|
2467
|
-
|
|
2681
|
+
abstract three: THREE.Camera;
|
|
2468
2682
|
/**
|
|
2469
|
-
*
|
|
2470
|
-
*
|
|
2683
|
+
* Optional CameraControls instance for controlling the camera.
|
|
2684
|
+
* This property is only available if the camera is controllable.
|
|
2471
2685
|
*/
|
|
2472
|
-
|
|
2473
|
-
private _lockRotation;
|
|
2474
|
-
private _camera;
|
|
2475
|
-
private _plane;
|
|
2476
|
-
private _size;
|
|
2477
|
-
private _tempVector1;
|
|
2478
|
-
private _tempVector2;
|
|
2479
|
-
private _tempTarget;
|
|
2480
|
-
private readonly down;
|
|
2686
|
+
abstract controls?: CameraControls;
|
|
2481
2687
|
/**
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2688
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
2689
|
+
*
|
|
2690
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
2484
2691
|
*/
|
|
2485
|
-
|
|
2692
|
+
hasCameraControls: () => this is CameraControllable;
|
|
2693
|
+
}
|
|
2694
|
+
import { Base } from "./base";
|
|
2695
|
+
/**
|
|
2696
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
2697
|
+
*/
|
|
2698
|
+
export declare abstract class Component extends Base {
|
|
2486
2699
|
/**
|
|
2487
|
-
*
|
|
2488
|
-
*
|
|
2489
|
-
*
|
|
2700
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
2701
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2702
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2703
|
+
* will not be updated automatically each frame.
|
|
2490
2704
|
*/
|
|
2491
|
-
|
|
2705
|
+
abstract enabled: boolean;
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2708
|
+
* 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.
|
|
2709
|
+
*/
|
|
2710
|
+
export declare class AsyncEvent<T> {
|
|
2492
2711
|
/**
|
|
2493
|
-
*
|
|
2494
|
-
*
|
|
2495
|
-
* @returns The current zoom level of the minimap.
|
|
2712
|
+
* Add a callback to this event instance.
|
|
2713
|
+
* @param handler - the callback to be added to this event.
|
|
2496
2714
|
*/
|
|
2497
|
-
|
|
2715
|
+
add(handler: T extends void ? {
|
|
2716
|
+
(): Promise<void>;
|
|
2717
|
+
} : {
|
|
2718
|
+
(data: T): Promise<void>;
|
|
2719
|
+
}): void;
|
|
2498
2720
|
/**
|
|
2499
|
-
*
|
|
2500
|
-
*
|
|
2501
|
-
* @param value - The new zoom level of the minimap.
|
|
2721
|
+
* Removes a callback from this event instance.
|
|
2722
|
+
* @param handler - the callback to be removed from this event.
|
|
2502
2723
|
*/
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
/** {@link Resizeable.resize} */
|
|
2514
|
-
resize(size?: THREE.Vector2): void;
|
|
2515
|
-
private updatePlanes;
|
|
2516
|
-
}
|
|
2517
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2518
|
-
import { Components } from "../../Components";
|
|
2519
|
-
/**
|
|
2520
|
-
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2521
|
-
*/
|
|
2522
|
-
export declare abstract class Base {
|
|
2523
|
-
components: Components;
|
|
2524
|
-
constructor(components: Components);
|
|
2525
|
-
/** Whether is component is {@link Disposable}. */
|
|
2526
|
-
isDisposeable: () => this is Disposable;
|
|
2527
|
-
/** Whether is component is {@link Resizeable}. */
|
|
2528
|
-
isResizeable: () => this is Resizeable;
|
|
2529
|
-
/** Whether is component is {@link Updateable}. */
|
|
2530
|
-
isUpdateable: () => this is Updateable;
|
|
2531
|
-
/** Whether is component is {@link Hideable}. */
|
|
2532
|
-
isHideable: () => this is Hideable;
|
|
2533
|
-
/** Whether is component is {@link Configurable}. */
|
|
2534
|
-
isConfigurable: () => this is Configurable<any>;
|
|
2724
|
+
remove(handler: T extends void ? {
|
|
2725
|
+
(): Promise<void>;
|
|
2726
|
+
} : {
|
|
2727
|
+
(data: T): Promise<void>;
|
|
2728
|
+
}): void;
|
|
2729
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2730
|
+
trigger: (data?: T) => Promise<void>;
|
|
2731
|
+
/** Gets rid of all the suscribed events. */
|
|
2732
|
+
reset(): void;
|
|
2733
|
+
private handlers;
|
|
2535
2734
|
}
|
|
2536
2735
|
import { Base } from "./base";
|
|
2537
2736
|
import { World } from "./world";
|
|
@@ -2622,34 +2821,6 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
2622
2821
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2623
2822
|
}
|
|
2624
2823
|
import * as THREE from "three";
|
|
2625
|
-
import CameraControls from "camera-controls";
|
|
2626
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2627
|
-
import { CameraControllable } from "./interfaces";
|
|
2628
|
-
/**
|
|
2629
|
-
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
2630
|
-
*/
|
|
2631
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
2632
|
-
/**
|
|
2633
|
-
* Whether the camera is enabled or not.
|
|
2634
|
-
*/
|
|
2635
|
-
abstract enabled: boolean;
|
|
2636
|
-
/**
|
|
2637
|
-
* The Three.js camera instance.
|
|
2638
|
-
*/
|
|
2639
|
-
abstract three: THREE.Camera;
|
|
2640
|
-
/**
|
|
2641
|
-
* Optional CameraControls instance for controlling the camera.
|
|
2642
|
-
* This property is only available if the camera is controllable.
|
|
2643
|
-
*/
|
|
2644
|
-
abstract controls?: CameraControls;
|
|
2645
|
-
/**
|
|
2646
|
-
* Checks whether the instance is {@link CameraControllable}.
|
|
2647
|
-
*
|
|
2648
|
-
* @returns True if the instance is controllable, false otherwise.
|
|
2649
|
-
*/
|
|
2650
|
-
hasCameraControls: () => this is CameraControllable;
|
|
2651
|
-
}
|
|
2652
|
-
import * as THREE from "three";
|
|
2653
2824
|
import { Disposable } from "./interfaces";
|
|
2654
2825
|
import { Event } from "./event";
|
|
2655
2826
|
import { Components } from "../../Components";
|
|
@@ -2670,40 +2841,6 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
|
|
|
2670
2841
|
dispose(): void;
|
|
2671
2842
|
}
|
|
2672
2843
|
import * as THREE from "three";
|
|
2673
|
-
import { BaseScene } from "./base-scene";
|
|
2674
|
-
import { BaseCamera } from "./base-camera";
|
|
2675
|
-
import { BaseRenderer } from "./base-renderer";
|
|
2676
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
2677
|
-
/**
|
|
2678
|
-
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2679
|
-
*/
|
|
2680
|
-
export interface World extends Disposable, Updateable {
|
|
2681
|
-
/**
|
|
2682
|
-
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2683
|
-
*/
|
|
2684
|
-
meshes: Set<THREE.Mesh>;
|
|
2685
|
-
/**
|
|
2686
|
-
* The base scene of the world.
|
|
2687
|
-
*/
|
|
2688
|
-
scene: BaseScene;
|
|
2689
|
-
/**
|
|
2690
|
-
* The base camera of the world.
|
|
2691
|
-
*/
|
|
2692
|
-
camera: BaseCamera;
|
|
2693
|
-
/**
|
|
2694
|
-
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2695
|
-
*/
|
|
2696
|
-
renderer: BaseRenderer | null;
|
|
2697
|
-
/**
|
|
2698
|
-
* A unique identifier for the world.
|
|
2699
|
-
*/
|
|
2700
|
-
uuid: string;
|
|
2701
|
-
/**
|
|
2702
|
-
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2703
|
-
*/
|
|
2704
|
-
isDisposing: boolean;
|
|
2705
|
-
}
|
|
2706
|
-
import * as THREE from "three";
|
|
2707
2844
|
import { Disposable, Event } from "../../Types";
|
|
2708
2845
|
/**
|
|
2709
2846
|
* 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.
|
|
@@ -2727,65 +2864,6 @@ export declare class Mouse implements Disposable {
|
|
|
2727
2864
|
private setupEvents;
|
|
2728
2865
|
}
|
|
2729
2866
|
import * as THREE from "three";
|
|
2730
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2731
|
-
import { Components } from "../../Components";
|
|
2732
|
-
/**
|
|
2733
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
2734
|
-
*/
|
|
2735
|
-
export interface GridConfig {
|
|
2736
|
-
/**
|
|
2737
|
-
* The color of the grid lines.
|
|
2738
|
-
*/
|
|
2739
|
-
color: THREE.Color;
|
|
2740
|
-
/**
|
|
2741
|
-
* The size of the primary grid lines.
|
|
2742
|
-
*/
|
|
2743
|
-
size1: number;
|
|
2744
|
-
/**
|
|
2745
|
-
* The size of the secondary grid lines.
|
|
2746
|
-
*/
|
|
2747
|
-
size2: number;
|
|
2748
|
-
/**
|
|
2749
|
-
* The distance at which the grid lines start to fade away.
|
|
2750
|
-
*/
|
|
2751
|
-
distance: number;
|
|
2752
|
-
}
|
|
2753
|
-
/**
|
|
2754
|
-
* 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).
|
|
2755
|
-
*/
|
|
2756
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2757
|
-
/** {@link Disposable.onDisposed} */
|
|
2758
|
-
readonly onDisposed: Event<unknown>;
|
|
2759
|
-
/** The world instance to which this Raycaster belongs. */
|
|
2760
|
-
world: World;
|
|
2761
|
-
/** The components instance to which this grid belongs. */
|
|
2762
|
-
components: Components;
|
|
2763
|
-
/** {@link Hideable.visible} */
|
|
2764
|
-
get visible(): boolean;
|
|
2765
|
-
/** {@link Hideable.visible} */
|
|
2766
|
-
set visible(visible: boolean);
|
|
2767
|
-
/** The material of the grid. */
|
|
2768
|
-
get material(): THREE.ShaderMaterial;
|
|
2769
|
-
/**
|
|
2770
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2771
|
-
* perspective cameras and false for orthographic cameras.
|
|
2772
|
-
*/
|
|
2773
|
-
get fade(): boolean;
|
|
2774
|
-
/**
|
|
2775
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2776
|
-
* perspective cameras and false for orthographic cameras.
|
|
2777
|
-
*/
|
|
2778
|
-
set fade(active: boolean);
|
|
2779
|
-
/** The Three.js mesh that contains the infinite grid. */
|
|
2780
|
-
readonly three: THREE.Mesh;
|
|
2781
|
-
private _fade;
|
|
2782
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
2783
|
-
/** {@link Disposable.dispose} */
|
|
2784
|
-
dispose(): void;
|
|
2785
|
-
private setupEvents;
|
|
2786
|
-
private updateZoom;
|
|
2787
|
-
}
|
|
2788
|
-
import * as THREE from "three";
|
|
2789
2867
|
import { Components } from "../../Components";
|
|
2790
2868
|
import { Event, World, Disposable } from "../../Types";
|
|
2791
2869
|
import { Mouse } from "./mouse";
|
|
@@ -2838,26 +2916,6 @@ export declare class SimpleRaycaster implements Disposable {
|
|
|
2838
2916
|
private filterClippingPlanes;
|
|
2839
2917
|
}
|
|
2840
2918
|
import * as THREE from "three";
|
|
2841
|
-
import * as WEBIFC from "web-ifc";
|
|
2842
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2843
|
-
export declare class CivilReader {
|
|
2844
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
2845
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
2846
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
2847
|
-
coordinationMatrix: THREE.Matrix4;
|
|
2848
|
-
} | undefined;
|
|
2849
|
-
get(civilItems: any): {
|
|
2850
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
2851
|
-
coordinationMatrix: THREE.Matrix4;
|
|
2852
|
-
} | undefined;
|
|
2853
|
-
private getCurves;
|
|
2854
|
-
}
|
|
2855
|
-
import * as WEBIFC from "web-ifc";
|
|
2856
|
-
export declare class IfcMetadataReader {
|
|
2857
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
2858
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
2859
|
-
}
|
|
2860
|
-
import * as THREE from "three";
|
|
2861
2919
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2862
2920
|
/**
|
|
2863
2921
|
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
@@ -2937,6 +2995,40 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
2937
2995
|
dispose(disposeResources?: boolean): void;
|
|
2938
2996
|
}
|
|
2939
2997
|
import * as THREE from "three";
|
|
2998
|
+
import { BaseScene } from "./base-scene";
|
|
2999
|
+
import { BaseCamera } from "./base-camera";
|
|
3000
|
+
import { BaseRenderer } from "./base-renderer";
|
|
3001
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
3002
|
+
/**
|
|
3003
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
3004
|
+
*/
|
|
3005
|
+
export interface World extends Disposable, Updateable {
|
|
3006
|
+
/**
|
|
3007
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
3008
|
+
*/
|
|
3009
|
+
meshes: Set<THREE.Mesh>;
|
|
3010
|
+
/**
|
|
3011
|
+
* The base scene of the world.
|
|
3012
|
+
*/
|
|
3013
|
+
scene: BaseScene;
|
|
3014
|
+
/**
|
|
3015
|
+
* The base camera of the world.
|
|
3016
|
+
*/
|
|
3017
|
+
camera: BaseCamera;
|
|
3018
|
+
/**
|
|
3019
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
3020
|
+
*/
|
|
3021
|
+
renderer: BaseRenderer | null;
|
|
3022
|
+
/**
|
|
3023
|
+
* A unique identifier for the world.
|
|
3024
|
+
*/
|
|
3025
|
+
uuid: string;
|
|
3026
|
+
/**
|
|
3027
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
3028
|
+
*/
|
|
3029
|
+
isDisposing: boolean;
|
|
3030
|
+
}
|
|
3031
|
+
import * as THREE from "three";
|
|
2940
3032
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2941
3033
|
import { Components } from "../../Components";
|
|
2942
3034
|
/**
|
|
@@ -3029,21 +3121,96 @@ export declare class SimpleRenderer extends BaseRenderer {
|
|
|
3029
3121
|
private onContextLost;
|
|
3030
3122
|
private onContextBack;
|
|
3031
3123
|
}
|
|
3032
|
-
import
|
|
3124
|
+
import * as THREE from "three";
|
|
3125
|
+
import { Components } from "../../Components";
|
|
3126
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
3033
3127
|
/**
|
|
3034
|
-
* Settings
|
|
3128
|
+
* Settings to configure the CullerRenderer.
|
|
3035
3129
|
*/
|
|
3036
|
-
export
|
|
3130
|
+
export interface CullerRendererSettings {
|
|
3037
3131
|
/**
|
|
3038
|
-
*
|
|
3039
|
-
*
|
|
3132
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
3133
|
+
* Default value is 1000.
|
|
3040
3134
|
*/
|
|
3041
|
-
|
|
3135
|
+
updateInterval?: number;
|
|
3042
3136
|
/**
|
|
3043
|
-
*
|
|
3044
|
-
*
|
|
3137
|
+
* Width of the render target used for visibility checks.
|
|
3138
|
+
* Default value is 512.
|
|
3045
3139
|
*/
|
|
3046
|
-
|
|
3140
|
+
width?: number;
|
|
3141
|
+
/**
|
|
3142
|
+
* Height of the render target used for visibility checks.
|
|
3143
|
+
* Default value is 512.
|
|
3144
|
+
*/
|
|
3145
|
+
height?: number;
|
|
3146
|
+
/**
|
|
3147
|
+
* Whether the visibility check should be performed automatically.
|
|
3148
|
+
* Default value is true.
|
|
3149
|
+
*/
|
|
3150
|
+
autoUpdate?: boolean;
|
|
3151
|
+
}
|
|
3152
|
+
/**
|
|
3153
|
+
* A base renderer to determine visibility on screen.
|
|
3154
|
+
*/
|
|
3155
|
+
export declare class CullerRenderer {
|
|
3156
|
+
/** {@link Disposable.onDisposed} */
|
|
3157
|
+
readonly onDisposed: Event<string>;
|
|
3158
|
+
/**
|
|
3159
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
3160
|
+
* meshes that are currently visible, and the ones that were visible
|
|
3161
|
+
* just before but not anymore.
|
|
3162
|
+
*/
|
|
3163
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
3164
|
+
/**
|
|
3165
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3166
|
+
*/
|
|
3167
|
+
enabled: boolean;
|
|
3168
|
+
/**
|
|
3169
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
3170
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3171
|
+
*/
|
|
3172
|
+
needsUpdate: boolean;
|
|
3173
|
+
/**
|
|
3174
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
3175
|
+
* for debugging purposes.
|
|
3176
|
+
*/
|
|
3177
|
+
renderDebugFrame: boolean;
|
|
3178
|
+
/** The components instance to which this renderer belongs. */
|
|
3179
|
+
components: Components;
|
|
3180
|
+
/** The world instance to which this renderer belongs. */
|
|
3181
|
+
readonly world: World;
|
|
3182
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
3183
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
3184
|
+
protected autoUpdate: boolean;
|
|
3185
|
+
protected updateInterval: number;
|
|
3186
|
+
protected readonly worker: Worker;
|
|
3187
|
+
protected readonly scene: THREE.Scene;
|
|
3188
|
+
private _width;
|
|
3189
|
+
private _height;
|
|
3190
|
+
private _availableColor;
|
|
3191
|
+
private readonly renderTarget;
|
|
3192
|
+
private readonly bufferSize;
|
|
3193
|
+
private readonly _buffer;
|
|
3194
|
+
protected _isWorkerBusy: boolean;
|
|
3195
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3196
|
+
/** {@link Disposable.dispose} */
|
|
3197
|
+
dispose(): void;
|
|
3198
|
+
/**
|
|
3199
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
3200
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
3201
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3202
|
+
* not true.
|
|
3203
|
+
*/
|
|
3204
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
3205
|
+
protected getAvailableColor(): {
|
|
3206
|
+
r: number;
|
|
3207
|
+
g: number;
|
|
3208
|
+
b: number;
|
|
3209
|
+
code: string;
|
|
3210
|
+
};
|
|
3211
|
+
protected increaseColor(): void;
|
|
3212
|
+
protected decreaseColor(): void;
|
|
3213
|
+
private applySettings;
|
|
3047
3214
|
}
|
|
3048
3215
|
import * as THREE from "three";
|
|
3049
3216
|
import CameraControls from "camera-controls";
|
|
@@ -3107,135 +3274,61 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
3107
3274
|
private setupEvents;
|
|
3108
3275
|
private static getSubsetOfThree;
|
|
3109
3276
|
}
|
|
3110
|
-
/**
|
|
3111
|
-
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3112
|
-
*/
|
|
3113
|
-
export interface StreamedGeometries {
|
|
3114
|
-
[id: number]: {
|
|
3115
|
-
/** The bounding box of the geometry as a Float32Array. */
|
|
3116
|
-
boundingBox: Float32Array;
|
|
3117
|
-
/** A boolean indicating whether the geometry has holes. */
|
|
3118
|
-
hasHoles: boolean;
|
|
3119
|
-
/** An optional file path for the geometry data. */
|
|
3120
|
-
geometryFile?: string;
|
|
3121
|
-
};
|
|
3122
|
-
}
|
|
3123
|
-
/**
|
|
3124
|
-
* A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
|
|
3125
|
-
*/
|
|
3126
|
-
export interface StreamedAsset {
|
|
3127
|
-
/** The unique identifier of the asset. */
|
|
3128
|
-
id: number;
|
|
3129
|
-
/** An array of geometries associated with the asset. */
|
|
3130
|
-
geometries: {
|
|
3131
|
-
/** The unique identifier of the geometry. */
|
|
3132
|
-
geometryID: number;
|
|
3133
|
-
/** The transformation matrix of the geometry as a number array. */
|
|
3134
|
-
transformation: number[];
|
|
3135
|
-
/** The color of the geometry as a number array. */
|
|
3136
|
-
color: number[];
|
|
3137
|
-
}[];
|
|
3138
|
-
}
|
|
3139
|
-
import * as WEBIFC from "web-ifc";
|
|
3140
|
-
import * as THREE from "three";
|
|
3141
|
-
export declare class Units {
|
|
3142
|
-
factor: number;
|
|
3143
|
-
complement: number;
|
|
3144
|
-
apply(matrix: THREE.Matrix4): void;
|
|
3145
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3146
|
-
private getLengthUnits;
|
|
3147
|
-
private getScaleMatrix;
|
|
3148
|
-
}
|
|
3149
3277
|
import * as THREE from "three";
|
|
3278
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
3150
3279
|
import { Components } from "../../Components";
|
|
3151
|
-
import {
|
|
3152
|
-
/**
|
|
3153
|
-
* Settings to configure the CullerRenderer.
|
|
3154
|
-
*/
|
|
3155
|
-
export interface CullerRendererSettings {
|
|
3156
|
-
/**
|
|
3157
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
3158
|
-
* Default value is 1000.
|
|
3159
|
-
*/
|
|
3160
|
-
updateInterval?: number;
|
|
3161
|
-
/**
|
|
3162
|
-
* Width of the render target used for visibility checks.
|
|
3163
|
-
* Default value is 512.
|
|
3164
|
-
*/
|
|
3165
|
-
width?: number;
|
|
3166
|
-
/**
|
|
3167
|
-
* Height of the render target used for visibility checks.
|
|
3168
|
-
* Default value is 512.
|
|
3169
|
-
*/
|
|
3170
|
-
height?: number;
|
|
3171
|
-
/**
|
|
3172
|
-
* Whether the visibility check should be performed automatically.
|
|
3173
|
-
* Default value is true.
|
|
3174
|
-
*/
|
|
3175
|
-
autoUpdate?: boolean;
|
|
3176
|
-
}
|
|
3280
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3177
3281
|
/**
|
|
3178
|
-
* A
|
|
3282
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
3179
3283
|
*/
|
|
3180
|
-
export declare class CullerRenderer {
|
|
3181
|
-
/** {@link Disposable.onDisposed} */
|
|
3182
|
-
readonly onDisposed: Event<string>;
|
|
3284
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3183
3285
|
/**
|
|
3184
|
-
*
|
|
3185
|
-
*
|
|
3186
|
-
* just before but not anymore.
|
|
3286
|
+
* Event triggered when the visibility of meshes is updated.
|
|
3287
|
+
* Contains two sets: seen and unseen.
|
|
3187
3288
|
*/
|
|
3188
|
-
readonly onViewUpdated: Event<
|
|
3289
|
+
readonly onViewUpdated: Event<{
|
|
3290
|
+
seen: Set<THREE.Mesh>;
|
|
3291
|
+
unseen: Set<THREE.Mesh>;
|
|
3292
|
+
}>;
|
|
3189
3293
|
/**
|
|
3190
|
-
*
|
|
3294
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
3295
|
+
* Default value is 100.
|
|
3191
3296
|
*/
|
|
3192
|
-
|
|
3297
|
+
threshold: number;
|
|
3193
3298
|
/**
|
|
3194
|
-
*
|
|
3195
|
-
*
|
|
3299
|
+
* Map of color code to THREE.InstancedMesh.
|
|
3300
|
+
* Used to keep track of color-coded meshes.
|
|
3196
3301
|
*/
|
|
3197
|
-
|
|
3302
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3198
3303
|
/**
|
|
3199
|
-
*
|
|
3200
|
-
*
|
|
3304
|
+
* Flag to indicate if the renderer is currently processing.
|
|
3305
|
+
* Used to prevent concurrent processing.
|
|
3201
3306
|
*/
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
readonly
|
|
3209
|
-
protected autoUpdate: boolean;
|
|
3210
|
-
protected updateInterval: number;
|
|
3211
|
-
protected readonly worker: Worker;
|
|
3212
|
-
protected readonly scene: THREE.Scene;
|
|
3213
|
-
private _width;
|
|
3214
|
-
private _height;
|
|
3215
|
-
private _availableColor;
|
|
3216
|
-
private readonly renderTarget;
|
|
3217
|
-
private readonly bufferSize;
|
|
3218
|
-
private readonly _buffer;
|
|
3219
|
-
protected _isWorkerBusy: boolean;
|
|
3307
|
+
isProcessing: boolean;
|
|
3308
|
+
private _colorCodeMeshMap;
|
|
3309
|
+
private _meshIDColorCodeMap;
|
|
3310
|
+
private _currentVisibleMeshes;
|
|
3311
|
+
private _recentlyHiddenMeshes;
|
|
3312
|
+
private _intervalID;
|
|
3313
|
+
private readonly _transparentMat;
|
|
3220
3314
|
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3221
3315
|
/** {@link Disposable.dispose} */
|
|
3222
3316
|
dispose(): void;
|
|
3223
3317
|
/**
|
|
3224
|
-
*
|
|
3225
|
-
*
|
|
3226
|
-
* @
|
|
3227
|
-
|
|
3318
|
+
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
3319
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3320
|
+
* @returns {void}
|
|
3321
|
+
*/
|
|
3322
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3323
|
+
/**
|
|
3324
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3325
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3326
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3327
|
+
* @returns {void}
|
|
3228
3328
|
*/
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
g: number;
|
|
3233
|
-
b: number;
|
|
3234
|
-
code: string;
|
|
3235
|
-
};
|
|
3236
|
-
protected increaseColor(): void;
|
|
3237
|
-
protected decreaseColor(): void;
|
|
3238
|
-
private applySettings;
|
|
3329
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3330
|
+
private handleWorkerMessage;
|
|
3331
|
+
private getAvailableMaterial;
|
|
3239
3332
|
}
|
|
3240
3333
|
import * as THREE from "three";
|
|
3241
3334
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3336,120 +3429,92 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3336
3429
|
private newHelper;
|
|
3337
3430
|
private static newPlaneMesh;
|
|
3338
3431
|
}
|
|
3339
|
-
|
|
3340
|
-
import
|
|
3341
|
-
|
|
3342
|
-
|
|
3432
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3433
|
+
import * as WEBIFC from "web-ifc";
|
|
3434
|
+
export declare class IfcMetadataReader {
|
|
3435
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3436
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3437
|
+
}
|
|
3438
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3343
3439
|
/**
|
|
3344
|
-
*
|
|
3440
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3345
3441
|
*/
|
|
3346
|
-
export declare class
|
|
3347
|
-
/**
|
|
3348
|
-
* Event triggered when the visibility of meshes is updated.
|
|
3349
|
-
* Contains two sets: seen and unseen.
|
|
3350
|
-
*/
|
|
3351
|
-
readonly onViewUpdated: Event<{
|
|
3352
|
-
seen: Set<THREE.Mesh>;
|
|
3353
|
-
unseen: Set<THREE.Mesh>;
|
|
3354
|
-
}>;
|
|
3355
|
-
/**
|
|
3356
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
3357
|
-
* Default value is 100.
|
|
3358
|
-
*/
|
|
3359
|
-
threshold: number;
|
|
3360
|
-
/**
|
|
3361
|
-
* Map of color code to THREE.InstancedMesh.
|
|
3362
|
-
* Used to keep track of color-coded meshes.
|
|
3363
|
-
*/
|
|
3364
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3365
|
-
/**
|
|
3366
|
-
* Flag to indicate if the renderer is currently processing.
|
|
3367
|
-
* Used to prevent concurrent processing.
|
|
3368
|
-
*/
|
|
3369
|
-
isProcessing: boolean;
|
|
3370
|
-
private _colorCodeMeshMap;
|
|
3371
|
-
private _meshIDColorCodeMap;
|
|
3372
|
-
private _currentVisibleMeshes;
|
|
3373
|
-
private _recentlyHiddenMeshes;
|
|
3374
|
-
private _intervalID;
|
|
3375
|
-
private readonly _transparentMat;
|
|
3376
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3377
|
-
/** {@link Disposable.dispose} */
|
|
3378
|
-
dispose(): void;
|
|
3442
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3379
3443
|
/**
|
|
3380
|
-
*
|
|
3381
|
-
*
|
|
3382
|
-
* @returns {void}
|
|
3444
|
+
* Minimum number of geometries to be streamed.
|
|
3445
|
+
* Defaults to 10 geometries.
|
|
3383
3446
|
*/
|
|
3384
|
-
|
|
3447
|
+
minGeometrySize: number;
|
|
3385
3448
|
/**
|
|
3386
|
-
*
|
|
3387
|
-
*
|
|
3388
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3389
|
-
* @returns {void}
|
|
3449
|
+
* Minimum amount of assets to be streamed.
|
|
3450
|
+
* Defaults to 1000 assets.
|
|
3390
3451
|
*/
|
|
3391
|
-
|
|
3392
|
-
private handleWorkerMessage;
|
|
3393
|
-
private getAvailableMaterial;
|
|
3452
|
+
minAssetsSize: number;
|
|
3394
3453
|
}
|
|
3395
|
-
|
|
3396
|
-
import { NavigationMode } from "./types";
|
|
3397
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3454
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3398
3455
|
/**
|
|
3399
|
-
*
|
|
3456
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3400
3457
|
*/
|
|
3401
|
-
export declare class
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3408
|
-
/** {@link NavigationMode.set} */
|
|
3409
|
-
set(active: boolean): void;
|
|
3410
|
-
private setupFirstPersonCamera;
|
|
3458
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3459
|
+
/**
|
|
3460
|
+
* Amount of properties to be streamed.
|
|
3461
|
+
* Defaults to 100 properties.
|
|
3462
|
+
*/
|
|
3463
|
+
propertiesSize: number;
|
|
3411
3464
|
}
|
|
3412
|
-
import { NavigationMode } from "./types";
|
|
3413
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3414
3465
|
/**
|
|
3415
|
-
* A
|
|
3466
|
+
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3416
3467
|
*/
|
|
3417
|
-
export
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
private activateOrbitControls;
|
|
3468
|
+
export interface StreamedGeometries {
|
|
3469
|
+
[id: number]: {
|
|
3470
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
3471
|
+
boundingBox: Float32Array;
|
|
3472
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
3473
|
+
hasHoles: boolean;
|
|
3474
|
+
/** An optional file path for the geometry data. */
|
|
3475
|
+
geometryFile?: string;
|
|
3476
|
+
};
|
|
3427
3477
|
}
|
|
3428
3478
|
/**
|
|
3429
|
-
*
|
|
3430
|
-
*/
|
|
3431
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3432
|
-
/**
|
|
3433
|
-
* The extensible list of supported navigation modes.
|
|
3434
|
-
*/
|
|
3435
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3436
|
-
/**
|
|
3437
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3479
|
+
* A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
|
|
3438
3480
|
*/
|
|
3439
|
-
export interface
|
|
3440
|
-
/** The unique
|
|
3441
|
-
id:
|
|
3442
|
-
/**
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3481
|
+
export interface StreamedAsset {
|
|
3482
|
+
/** The unique identifier of the asset. */
|
|
3483
|
+
id: number;
|
|
3484
|
+
/** An array of geometries associated with the asset. */
|
|
3485
|
+
geometries: {
|
|
3486
|
+
/** The unique identifier of the geometry. */
|
|
3487
|
+
geometryID: number;
|
|
3488
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
3489
|
+
transformation: number[];
|
|
3490
|
+
/** The color of the geometry as a number array. */
|
|
3491
|
+
color: number[];
|
|
3492
|
+
}[];
|
|
3493
|
+
}
|
|
3494
|
+
import * as THREE from "three";
|
|
3495
|
+
import * as WEBIFC from "web-ifc";
|
|
3496
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3497
|
+
export declare class CivilReader {
|
|
3498
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3499
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3500
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3501
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3502
|
+
} | undefined;
|
|
3503
|
+
get(civilItems: any): {
|
|
3504
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3505
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3506
|
+
} | undefined;
|
|
3507
|
+
private getCurves;
|
|
3508
|
+
}
|
|
3509
|
+
import * as WEBIFC from "web-ifc";
|
|
3510
|
+
import * as THREE from "three";
|
|
3511
|
+
export declare class Units {
|
|
3512
|
+
factor: number;
|
|
3513
|
+
complement: number;
|
|
3514
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3515
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3516
|
+
private getLengthUnits;
|
|
3517
|
+
private getScaleMatrix;
|
|
3453
3518
|
}
|
|
3454
3519
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3455
3520
|
export interface ModelsRelationMap {
|
|
@@ -3475,71 +3540,6 @@ export type InverseAttributes = [
|
|
|
3475
3540
|
"ContainsElements"
|
|
3476
3541
|
];
|
|
3477
3542
|
export type InverseAttribute = InverseAttributes[number];
|
|
3478
|
-
import * as THREE from "three";
|
|
3479
|
-
import { CameraProjection } from "./types";
|
|
3480
|
-
import { Event } from "../../Types";
|
|
3481
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3482
|
-
/**
|
|
3483
|
-
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3484
|
-
*/
|
|
3485
|
-
export declare class ProjectionManager {
|
|
3486
|
-
/**
|
|
3487
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
3488
|
-
*/
|
|
3489
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3490
|
-
/**
|
|
3491
|
-
* Current projection mode of the camera.
|
|
3492
|
-
* Default is "Perspective".
|
|
3493
|
-
*/
|
|
3494
|
-
current: CameraProjection;
|
|
3495
|
-
/**
|
|
3496
|
-
* The camera controlled by this ProjectionManager.
|
|
3497
|
-
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3498
|
-
*/
|
|
3499
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3500
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3501
|
-
matchOrthoDistanceEnabled: boolean;
|
|
3502
|
-
private _component;
|
|
3503
|
-
private _previousDistance;
|
|
3504
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3505
|
-
/**
|
|
3506
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3507
|
-
*
|
|
3508
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
3509
|
-
* it will have no effect.
|
|
3510
|
-
*/
|
|
3511
|
-
set(projection: CameraProjection): Promise<void>;
|
|
3512
|
-
/**
|
|
3513
|
-
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3514
|
-
* and vice versa.
|
|
3515
|
-
*/
|
|
3516
|
-
toggle(): Promise<void>;
|
|
3517
|
-
private setOrthoCamera;
|
|
3518
|
-
private getPerspectiveDims;
|
|
3519
|
-
private setupOrthoCamera;
|
|
3520
|
-
private getDistance;
|
|
3521
|
-
private setPerspectiveCamera;
|
|
3522
|
-
}
|
|
3523
|
-
import { NavigationMode } from "./types";
|
|
3524
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3525
|
-
/**
|
|
3526
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3527
|
-
*/
|
|
3528
|
-
export declare class PlanMode implements NavigationMode {
|
|
3529
|
-
private camera;
|
|
3530
|
-
/** {@link NavigationMode.enabled} */
|
|
3531
|
-
enabled: boolean;
|
|
3532
|
-
/** {@link NavigationMode.id} */
|
|
3533
|
-
readonly id = "Plan";
|
|
3534
|
-
private mouseAction1?;
|
|
3535
|
-
private mouseAction2?;
|
|
3536
|
-
private mouseInitialized;
|
|
3537
|
-
private readonly defaultAzimuthSpeed;
|
|
3538
|
-
private readonly defaultPolarSpeed;
|
|
3539
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3540
|
-
/** {@link NavigationMode.set} */
|
|
3541
|
-
set(active: boolean): void;
|
|
3542
|
-
}
|
|
3543
3543
|
import { BufferGeometry } from "three";
|
|
3544
3544
|
import * as THREE from "three";
|
|
3545
3545
|
export declare class TransformHelper {
|