@thatopen/components 2.1.20 → 2.1.22
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/core/ShadowedScene/index.d.ts +59 -0
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +67 -0
- package/dist/core/ShadowedScene/src/index.d.ts +1 -0
- package/dist/core/Types/src/base-scene.d.ts +4 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/index.cjs +61 -21
- package/dist/index.mjs +3281 -2962
- package/dist/namespace.d.ts +1722 -1592
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,46 +1,4 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
3
|
-
import { SimpleRaycaster } from "./src";
|
|
4
|
-
import { Components } from "../Components";
|
|
5
|
-
/**
|
|
6
|
-
* 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).
|
|
7
|
-
*/
|
|
8
|
-
export declare class Raycasters 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: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
14
|
-
/** {@link Component.enabled} */
|
|
15
|
-
enabled: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* A Map that stores raycasters for each world.
|
|
18
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
19
|
-
*/
|
|
20
|
-
list: Map<string, SimpleRaycaster>;
|
|
21
|
-
/** {@link Disposable.onDisposed} */
|
|
22
|
-
onDisposed: Event<unknown>;
|
|
23
|
-
constructor(components: Components);
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves a SimpleRaycaster instance for the given world.
|
|
26
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
27
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
28
|
-
*
|
|
29
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
30
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
31
|
-
*/
|
|
32
|
-
get(world: World): SimpleRaycaster;
|
|
33
|
-
/**
|
|
34
|
-
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
35
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
36
|
-
*
|
|
37
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
38
|
-
* @returns {void}
|
|
39
|
-
*/
|
|
40
|
-
delete(world: World): void;
|
|
41
|
-
/** {@link Disposable.dispose} */
|
|
42
|
-
dispose(): void;
|
|
43
|
-
}
|
|
44
2
|
import { Component, Disposable, Event } from "../Types";
|
|
45
3
|
/**
|
|
46
4
|
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
@@ -49,7 +7,7 @@ export declare class Components implements Disposable {
|
|
|
49
7
|
/**
|
|
50
8
|
* The version of the @thatopen/components library.
|
|
51
9
|
*/
|
|
52
|
-
static readonly release = "2.1.
|
|
10
|
+
static readonly release = "2.1.22";
|
|
53
11
|
/** {@link Disposable.onDisposed} */
|
|
54
12
|
readonly onDisposed: Event<void>;
|
|
55
13
|
/**
|
|
@@ -118,305 +76,306 @@ export declare class Components implements Disposable {
|
|
|
118
76
|
private static setupBVH;
|
|
119
77
|
}
|
|
120
78
|
import * as THREE from "three";
|
|
121
|
-
import
|
|
122
|
-
import {
|
|
123
|
-
import { Components } from "../Components";
|
|
79
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
80
|
+
import { Component, Components } from "../../core";
|
|
124
81
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param components - the instance of {@link Components} used.
|
|
128
|
-
* E.g. {@link SimplePlane}.
|
|
82
|
+
* Represents an edge measurement result.
|
|
129
83
|
*/
|
|
130
|
-
export
|
|
131
|
-
/**
|
|
132
|
-
* A unique identifier for the component.
|
|
133
|
-
* This UUID is used to register the component within the Components system.
|
|
134
|
-
*/
|
|
135
|
-
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
136
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
137
|
-
readonly onBeforeDrag: Event<void>;
|
|
138
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
139
|
-
readonly onAfterDrag: Event<void>;
|
|
140
|
-
/**
|
|
141
|
-
* Event that fires when the user starts creating a clipping plane.
|
|
142
|
-
*/
|
|
143
|
-
readonly onBeforeCreate: Event<unknown>;
|
|
144
|
-
/**
|
|
145
|
-
* Event that fires when the user cancels the creation of a clipping plane.
|
|
146
|
-
*/
|
|
147
|
-
readonly onBeforeCancel: Event<unknown>;
|
|
148
|
-
/**
|
|
149
|
-
* Event that fires after the user cancels the creation of a clipping plane.
|
|
150
|
-
*/
|
|
151
|
-
readonly onAfterCancel: Event<unknown>;
|
|
152
|
-
/**
|
|
153
|
-
* Event that fires when the user starts deleting a clipping plane.
|
|
154
|
-
*/
|
|
155
|
-
readonly onBeforeDelete: Event<unknown>;
|
|
84
|
+
export interface MeasureEdge {
|
|
156
85
|
/**
|
|
157
|
-
*
|
|
158
|
-
* @param plane - The newly created clipping plane.
|
|
86
|
+
* The distance between the two points of the edge.
|
|
159
87
|
*/
|
|
160
|
-
|
|
88
|
+
distance: number;
|
|
161
89
|
/**
|
|
162
|
-
*
|
|
163
|
-
* @param plane - The deleted clipping plane.
|
|
90
|
+
* The two points that define the edge.
|
|
164
91
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
92
|
+
points: THREE.Vector3[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
96
|
+
*/
|
|
97
|
+
export declare class MeasurementUtils extends Component {
|
|
168
98
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* clipping plane is created in its roof, which might have a slight
|
|
172
|
-
* slope for draining purposes.
|
|
99
|
+
* A unique identifier for the component.
|
|
100
|
+
* This UUID is used to register the component within the Components system.
|
|
173
101
|
*/
|
|
174
|
-
|
|
102
|
+
static uuid: string;
|
|
103
|
+
/** {@link Component.enabled} */
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
constructor(components: Components);
|
|
175
106
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
107
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
108
|
+
*
|
|
109
|
+
* @param point - The point from which to calculate the distance.
|
|
110
|
+
* @param lineStart - The start point of the line segment.
|
|
111
|
+
* @param lineEnd - The end point of the line segment.
|
|
112
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
113
|
+
* @returns The distance from the point to the line segment.
|
|
179
114
|
*/
|
|
180
|
-
|
|
115
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
181
116
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
117
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
118
|
+
* It also returns the edges of the found face and their indices.
|
|
119
|
+
*
|
|
120
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
121
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
122
|
+
* @param instance - The instance of the mesh (optional).
|
|
123
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
184
124
|
*/
|
|
185
|
-
|
|
125
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
126
|
+
edges: MeasureEdge[];
|
|
127
|
+
indices: Set<number>;
|
|
128
|
+
} | null;
|
|
186
129
|
/**
|
|
187
|
-
*
|
|
130
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
131
|
+
* It also applies instance transformation if provided.
|
|
132
|
+
*
|
|
133
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
134
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
135
|
+
* @param instance - The instance of the mesh (optional).
|
|
136
|
+
* @returns An object containing the vertices and normal of the face.
|
|
137
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
188
138
|
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/** {@link Component.enabled} */
|
|
196
|
-
get enabled(): boolean;
|
|
197
|
-
/** {@link Component.enabled} */
|
|
198
|
-
set enabled(state: boolean);
|
|
199
|
-
/** {@link Hideable.visible } */
|
|
200
|
-
get visible(): boolean;
|
|
201
|
-
/** {@link Hideable.visible } */
|
|
202
|
-
set visible(state: boolean);
|
|
203
|
-
/** The material of the clipping plane representation. */
|
|
204
|
-
get material(): THREE.MeshBasicMaterial;
|
|
205
|
-
/** The material of the clipping plane representation. */
|
|
206
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
207
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
208
|
-
get size(): number;
|
|
209
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
210
|
-
set size(size: number);
|
|
211
|
-
constructor(components: Components);
|
|
212
|
-
/** {@link Disposable.dispose} */
|
|
213
|
-
dispose(): void;
|
|
214
|
-
/** {@link Createable.create} */
|
|
215
|
-
create(world: World): SimplePlane | null;
|
|
139
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
140
|
+
p1: THREE.Vector3;
|
|
141
|
+
p2: THREE.Vector3;
|
|
142
|
+
p3: THREE.Vector3;
|
|
143
|
+
faceNormal: THREE.Vector3;
|
|
144
|
+
};
|
|
216
145
|
/**
|
|
217
|
-
*
|
|
218
|
-
*
|
|
146
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
147
|
+
* This is used to ensure numerical precision in edge detection.
|
|
219
148
|
*
|
|
220
|
-
* @param
|
|
221
|
-
* @
|
|
222
|
-
* @param point - the position of the clipping plane.
|
|
223
|
-
* navigation.
|
|
149
|
+
* @param vector - The vector to round.
|
|
150
|
+
* @returns The vector with rounded components.
|
|
224
151
|
*/
|
|
225
|
-
|
|
152
|
+
round(vector: THREE.Vector3): void;
|
|
226
153
|
/**
|
|
227
|
-
*
|
|
154
|
+
* Calculates the volume of a set of fragments.
|
|
228
155
|
*
|
|
229
|
-
* @param
|
|
230
|
-
* @
|
|
231
|
-
*
|
|
156
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
157
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
161
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
162
|
+
*
|
|
163
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
164
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
232
165
|
*/
|
|
233
|
-
|
|
166
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
234
167
|
/**
|
|
235
|
-
*
|
|
168
|
+
* Calculates the total volume of a set of meshes.
|
|
169
|
+
*
|
|
170
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
171
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
175
|
+
* and its bounding sphere.
|
|
236
176
|
*
|
|
237
|
-
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
238
177
|
*/
|
|
239
|
-
|
|
240
|
-
private
|
|
241
|
-
private
|
|
242
|
-
private
|
|
243
|
-
private createPlaneFromIntersection;
|
|
244
|
-
private getWorldNormal;
|
|
245
|
-
private normalizePlaneDirectionY;
|
|
246
|
-
private newPlane;
|
|
247
|
-
private updateMaterialsAndPlanes;
|
|
248
|
-
private _onStartDragging;
|
|
249
|
-
private _onEndDragging;
|
|
178
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
179
|
+
private getFaceData;
|
|
180
|
+
private getVolumeOfMesh;
|
|
181
|
+
private getSignedVolumeOfTriangle;
|
|
250
182
|
}
|
|
251
|
-
import
|
|
183
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
184
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
252
185
|
import { Components } from "../Components";
|
|
253
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
254
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
255
186
|
/**
|
|
256
|
-
* A component that
|
|
187
|
+
* 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).
|
|
257
188
|
*/
|
|
258
|
-
export declare class
|
|
189
|
+
export declare class Grids extends Component implements Disposable {
|
|
259
190
|
/**
|
|
260
191
|
* A unique identifier for the component.
|
|
261
192
|
* This UUID is used to register the component within the Components system.
|
|
262
193
|
*/
|
|
263
|
-
static readonly uuid: "
|
|
194
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
264
195
|
/**
|
|
265
|
-
*
|
|
196
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
266
197
|
*/
|
|
267
|
-
|
|
268
|
-
private _enabled;
|
|
198
|
+
list: Map<string, SimpleGrid>;
|
|
269
199
|
/**
|
|
270
|
-
*
|
|
200
|
+
* The default configuration for grid creation.
|
|
271
201
|
*/
|
|
272
|
-
|
|
273
|
-
/** {@link
|
|
274
|
-
|
|
202
|
+
config: Required<GridConfig>;
|
|
203
|
+
/** {@link Disposable.onDisposed} */
|
|
204
|
+
readonly onDisposed: Event<unknown>;
|
|
275
205
|
/** {@link Component.enabled} */
|
|
276
|
-
|
|
206
|
+
enabled: boolean;
|
|
277
207
|
constructor(components: Components);
|
|
278
208
|
/**
|
|
279
|
-
* Creates a new
|
|
280
|
-
*
|
|
209
|
+
* Creates a new grid for the given world.
|
|
210
|
+
* Throws an error if a grid already exists for the world.
|
|
281
211
|
*
|
|
282
|
-
* @param world - The world
|
|
283
|
-
* @
|
|
212
|
+
* @param world - The world to create the grid for.
|
|
213
|
+
* @returns The newly created grid.
|
|
284
214
|
*
|
|
285
|
-
* @
|
|
215
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
286
216
|
*/
|
|
287
|
-
create(world: World
|
|
217
|
+
create(world: World): SimpleGrid;
|
|
288
218
|
/**
|
|
289
|
-
* Deletes the
|
|
290
|
-
* If a
|
|
219
|
+
* Deletes the grid associated with the given world.
|
|
220
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
291
221
|
*
|
|
292
|
-
* @param world - The world for which to delete the
|
|
222
|
+
* @param world - The world for which to delete the grid.
|
|
293
223
|
*
|
|
294
|
-
* @
|
|
224
|
+
* @remarks
|
|
225
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
226
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
295
227
|
*/
|
|
296
228
|
delete(world: World): void;
|
|
297
229
|
/** {@link Disposable.dispose} */
|
|
298
230
|
dispose(): void;
|
|
299
|
-
/**
|
|
300
|
-
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
301
|
-
*
|
|
302
|
-
* @param meshes - The meshes to update.
|
|
303
|
-
*
|
|
304
|
-
* @returns {void}
|
|
305
|
-
*/
|
|
306
|
-
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
307
231
|
}
|
|
308
|
-
import
|
|
232
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
233
|
+
import { SimpleRaycaster } from "./src";
|
|
309
234
|
import { Components } from "../Components";
|
|
310
|
-
import { SimpleCamera } from "..";
|
|
311
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
312
235
|
/**
|
|
313
|
-
* A
|
|
236
|
+
* 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).
|
|
314
237
|
*/
|
|
315
|
-
export declare class
|
|
238
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
316
239
|
/**
|
|
317
|
-
* A
|
|
240
|
+
* A unique identifier for the component.
|
|
241
|
+
* This UUID is used to register the component within the Components system.
|
|
318
242
|
*/
|
|
319
|
-
readonly
|
|
243
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
244
|
+
/** {@link Component.enabled} */
|
|
245
|
+
enabled: boolean;
|
|
320
246
|
/**
|
|
321
|
-
* A
|
|
322
|
-
*
|
|
247
|
+
* A Map that stores raycasters for each world.
|
|
248
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
323
249
|
*/
|
|
324
|
-
|
|
250
|
+
list: Map<string, SimpleRaycaster>;
|
|
251
|
+
/** {@link Disposable.onDisposed} */
|
|
252
|
+
onDisposed: Event<unknown>;
|
|
253
|
+
constructor(components: Components);
|
|
325
254
|
/**
|
|
326
|
-
*
|
|
327
|
-
*
|
|
255
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
256
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
257
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
258
|
+
*
|
|
259
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
260
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
328
261
|
*/
|
|
329
|
-
|
|
330
|
-
protected readonly _userInputButtons: any;
|
|
331
|
-
protected readonly _frustumSize = 50;
|
|
332
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
333
|
-
protected _mode: NavigationMode | null;
|
|
334
|
-
private previousSize;
|
|
262
|
+
get(world: World): SimpleRaycaster;
|
|
335
263
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* @returns {NavigationMode} The current navigation mode.
|
|
264
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
265
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
340
266
|
*
|
|
341
|
-
* @
|
|
267
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
268
|
+
* @returns {void}
|
|
342
269
|
*/
|
|
343
|
-
|
|
344
|
-
constructor(components: Components);
|
|
270
|
+
delete(world: World): void;
|
|
345
271
|
/** {@link Disposable.dispose} */
|
|
346
272
|
dispose(): void;
|
|
273
|
+
}
|
|
274
|
+
import { MiniMap } from "./src";
|
|
275
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
276
|
+
import { Components } from "../Components";
|
|
277
|
+
/**
|
|
278
|
+
* 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).
|
|
279
|
+
*/
|
|
280
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
347
281
|
/**
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
* @param mode - The {@link NavigationMode} to set.
|
|
282
|
+
* A unique identifier for the component.
|
|
283
|
+
* This UUID is used to register the component within the Components system.
|
|
351
284
|
*/
|
|
352
|
-
|
|
285
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
286
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
287
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
288
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
289
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
290
|
+
/** {@link Disposable.onDisposed} */
|
|
291
|
+
readonly onDisposed: Event<unknown>;
|
|
292
|
+
/** {@link Component.enabled} */
|
|
293
|
+
enabled: boolean;
|
|
353
294
|
/**
|
|
354
|
-
*
|
|
295
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
296
|
+
*/
|
|
297
|
+
list: Map<string, MiniMap>;
|
|
298
|
+
constructor(components: Components);
|
|
299
|
+
/**
|
|
300
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
301
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
355
302
|
*
|
|
356
|
-
* @param
|
|
357
|
-
*
|
|
358
|
-
* @
|
|
303
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
304
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
305
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
359
306
|
*/
|
|
360
|
-
|
|
307
|
+
create(world: World): MiniMap;
|
|
361
308
|
/**
|
|
362
|
-
*
|
|
309
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
310
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
363
311
|
*
|
|
364
|
-
* @param
|
|
312
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
313
|
+
* @returns {void}
|
|
365
314
|
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
315
|
+
delete(id: string): void;
|
|
316
|
+
/** {@link Disposable.dispose} */
|
|
317
|
+
dispose(): void;
|
|
318
|
+
/** {@link Updateable.update} */
|
|
319
|
+
update(): void;
|
|
371
320
|
}
|
|
372
|
-
import {
|
|
373
|
-
import {
|
|
374
|
-
import {
|
|
321
|
+
import { SimpleScene, SimpleSceneConfig } from "../Worlds";
|
|
322
|
+
import { DistanceRenderer } from "./src";
|
|
323
|
+
import { Disposable } from "../Types";
|
|
375
324
|
/**
|
|
376
|
-
*
|
|
325
|
+
* Configuration interface for the {@link ShadowedScene}. Defines properties for directional and ambient lights,
|
|
326
|
+
* as well as shadows.
|
|
377
327
|
*/
|
|
378
|
-
export
|
|
328
|
+
export interface ShadowedSceneConfig extends SimpleSceneConfig {
|
|
329
|
+
shadows: {
|
|
330
|
+
cascade: number;
|
|
331
|
+
resolution: number;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* A scene that supports efficient cast shadows.
|
|
336
|
+
*/
|
|
337
|
+
export declare class ShadowedScene extends SimpleScene implements Disposable {
|
|
338
|
+
private _distanceRenderer?;
|
|
379
339
|
/**
|
|
380
|
-
*
|
|
381
|
-
* This UUID is used to register the component within the Components system.
|
|
340
|
+
* Whether the bias property should be set automatically depending on the shadow distance.
|
|
382
341
|
*/
|
|
383
|
-
|
|
342
|
+
autoBias: boolean;
|
|
384
343
|
/**
|
|
385
|
-
*
|
|
344
|
+
* Configuration interface for the {@link ShadowedScene}.
|
|
345
|
+
* Defines properties for directional and ambient lights, as well as shadows.
|
|
386
346
|
*/
|
|
387
|
-
|
|
347
|
+
config: Required<ShadowedSceneConfig>;
|
|
348
|
+
private _lightsWithShadow;
|
|
349
|
+
private _isComputingShadows;
|
|
350
|
+
private _shadowsEnabled;
|
|
351
|
+
private _bias;
|
|
388
352
|
/**
|
|
389
|
-
* The
|
|
353
|
+
* The getter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
390
354
|
*/
|
|
391
|
-
|
|
392
|
-
/** {@link Disposable.onDisposed} */
|
|
393
|
-
readonly onDisposed: Event<unknown>;
|
|
394
|
-
/** {@link Component.enabled} */
|
|
395
|
-
enabled: boolean;
|
|
396
|
-
constructor(components: Components);
|
|
355
|
+
get bias(): number;
|
|
397
356
|
/**
|
|
398
|
-
*
|
|
399
|
-
* Throws an error if a grid already exists for the world.
|
|
400
|
-
*
|
|
401
|
-
* @param world - The world to create the grid for.
|
|
402
|
-
* @returns The newly created grid.
|
|
403
|
-
*
|
|
404
|
-
* @throws Will throw an error if a grid already exists for the given world.
|
|
357
|
+
* The setter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
405
358
|
*/
|
|
406
|
-
|
|
359
|
+
set bias(value: number);
|
|
407
360
|
/**
|
|
408
|
-
*
|
|
409
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
410
|
-
*
|
|
411
|
-
* @param world - The world for which to delete the grid.
|
|
412
|
-
*
|
|
413
|
-
* @remarks
|
|
414
|
-
* This method will dispose of the grid and remove it from the internal list.
|
|
415
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
361
|
+
* Getter to see whether the shadows are enabled or not in this scene instance.
|
|
416
362
|
*/
|
|
417
|
-
|
|
363
|
+
get shadowsEnabled(): boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Setter to control whether the shadows are enabled or not in this scene instance.
|
|
366
|
+
*/
|
|
367
|
+
set shadowsEnabled(value: boolean);
|
|
368
|
+
/**
|
|
369
|
+
* Getter to get the renderer used to determine the farthest distance from the camera.
|
|
370
|
+
*/
|
|
371
|
+
get distanceRenderer(): DistanceRenderer;
|
|
372
|
+
/** {@link Configurable.setup} */
|
|
373
|
+
setup(config?: Partial<ShadowedSceneConfig>): void;
|
|
418
374
|
/** {@link Disposable.dispose} */
|
|
419
375
|
dispose(): void;
|
|
376
|
+
/** Update all the shadows of the scene. */
|
|
377
|
+
updateShadows(): Promise<void>;
|
|
378
|
+
private recomputeShadows;
|
|
420
379
|
}
|
|
421
380
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
422
381
|
import { Components } from "../Components";
|
|
@@ -485,305 +444,319 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
485
444
|
/** {@link Updateable.update} */
|
|
486
445
|
update(delta?: number): void | Promise<void>;
|
|
487
446
|
}
|
|
488
|
-
import
|
|
489
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
447
|
+
import * as THREE from "three";
|
|
490
448
|
import { Components } from "../Components";
|
|
449
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
450
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
491
451
|
/**
|
|
492
|
-
* A component that
|
|
452
|
+
* 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).
|
|
493
453
|
*/
|
|
494
|
-
export declare class
|
|
454
|
+
export declare class Cullers extends Component implements Disposable {
|
|
495
455
|
/**
|
|
496
456
|
* A unique identifier for the component.
|
|
497
457
|
* This UUID is used to register the component within the Components system.
|
|
498
458
|
*/
|
|
499
|
-
static readonly uuid: "
|
|
500
|
-
/**
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
504
|
-
/** {@link Disposable.onDisposed} */
|
|
459
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
460
|
+
/**
|
|
461
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
462
|
+
*/
|
|
505
463
|
readonly onDisposed: Event<unknown>;
|
|
506
|
-
|
|
507
|
-
enabled: boolean;
|
|
464
|
+
private _enabled;
|
|
508
465
|
/**
|
|
509
|
-
* A
|
|
466
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
510
467
|
*/
|
|
511
|
-
list: Map<string,
|
|
468
|
+
list: Map<string, MeshCullerRenderer>;
|
|
469
|
+
/** {@link Component.enabled} */
|
|
470
|
+
get enabled(): boolean;
|
|
471
|
+
/** {@link Component.enabled} */
|
|
472
|
+
set enabled(value: boolean);
|
|
512
473
|
constructor(components: Components);
|
|
513
474
|
/**
|
|
514
|
-
* Creates a new
|
|
515
|
-
* If a
|
|
475
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
476
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
516
477
|
*
|
|
517
|
-
* @param world - The
|
|
518
|
-
* @
|
|
519
|
-
*
|
|
478
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
479
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
480
|
+
*
|
|
481
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
520
482
|
*/
|
|
521
|
-
create(world: World):
|
|
483
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
522
484
|
/**
|
|
523
|
-
* Deletes
|
|
524
|
-
* If a
|
|
485
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
486
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
487
|
+
*
|
|
488
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
525
489
|
*
|
|
526
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
527
490
|
* @returns {void}
|
|
528
491
|
*/
|
|
529
|
-
delete(
|
|
492
|
+
delete(world: World): void;
|
|
530
493
|
/** {@link Disposable.dispose} */
|
|
531
494
|
dispose(): void;
|
|
532
|
-
/**
|
|
533
|
-
|
|
495
|
+
/**
|
|
496
|
+
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
497
|
+
*
|
|
498
|
+
* @param meshes - The meshes to update.
|
|
499
|
+
*
|
|
500
|
+
* @returns {void}
|
|
501
|
+
*/
|
|
502
|
+
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
534
503
|
}
|
|
535
504
|
import * as THREE from "three";
|
|
505
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
506
|
+
import { SimplePlane } from "./src";
|
|
536
507
|
import { Components } from "../Components";
|
|
537
|
-
import { Component } from "../Types";
|
|
538
508
|
/**
|
|
539
|
-
* A
|
|
509
|
+
* 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).
|
|
510
|
+
*
|
|
511
|
+
* @param components - the instance of {@link Components} used.
|
|
512
|
+
* E.g. {@link SimplePlane}.
|
|
540
513
|
*/
|
|
541
|
-
export declare class
|
|
542
|
-
private _disposedComponents;
|
|
543
|
-
/** {@link Component.enabled} */
|
|
544
|
-
enabled: boolean;
|
|
514
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
545
515
|
/**
|
|
546
516
|
* A unique identifier for the component.
|
|
547
517
|
* This UUID is used to register the component within the Components system.
|
|
548
518
|
*/
|
|
549
|
-
static readonly uuid: "
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
519
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
520
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
521
|
+
readonly onBeforeDrag: Event<void>;
|
|
522
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
523
|
+
readonly onAfterDrag: Event<void>;
|
|
524
|
+
/**
|
|
525
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
553
526
|
*/
|
|
554
|
-
|
|
527
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
555
528
|
/**
|
|
556
|
-
*
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
*
|
|
561
|
-
|
|
529
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
530
|
+
*/
|
|
531
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
532
|
+
/**
|
|
533
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
534
|
+
*/
|
|
535
|
+
readonly onAfterCancel: Event<unknown>;
|
|
536
|
+
/**
|
|
537
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
538
|
+
*/
|
|
539
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
540
|
+
/**
|
|
541
|
+
* Event that fires after a clipping plane has been created.
|
|
542
|
+
* @param plane - The newly created clipping plane.
|
|
543
|
+
*/
|
|
544
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
545
|
+
/**
|
|
546
|
+
* Event that fires after a clipping plane has been deleted.
|
|
547
|
+
* @param plane - The deleted clipping plane.
|
|
548
|
+
*/
|
|
549
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
550
|
+
/** {@link Disposable.onDisposed} */
|
|
551
|
+
readonly onDisposed: Event<string>;
|
|
552
|
+
/**
|
|
553
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
554
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
555
|
+
* clipping plane is created in its roof, which might have a slight
|
|
556
|
+
* slope for draining purposes.
|
|
557
|
+
*/
|
|
558
|
+
orthogonalY: boolean;
|
|
559
|
+
/**
|
|
560
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
561
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
562
|
+
* has to be 'true' for this to apply.
|
|
563
|
+
*/
|
|
564
|
+
toleranceOrthogonalY: number;
|
|
565
|
+
/**
|
|
566
|
+
* The type of clipping plane to be created.
|
|
567
|
+
* Default is {@link SimplePlane}.
|
|
568
|
+
*/
|
|
569
|
+
Type: new (...args: any) => SimplePlane;
|
|
570
|
+
/**
|
|
571
|
+
* A list of all the clipping planes created by this component.
|
|
572
|
+
*/
|
|
573
|
+
list: SimplePlane[];
|
|
574
|
+
/** The material used in all the clipping planes. */
|
|
575
|
+
private _material;
|
|
576
|
+
private _size;
|
|
577
|
+
private _enabled;
|
|
578
|
+
private _visible;
|
|
579
|
+
/** {@link Component.enabled} */
|
|
580
|
+
get enabled(): boolean;
|
|
581
|
+
/** {@link Component.enabled} */
|
|
582
|
+
set enabled(state: boolean);
|
|
583
|
+
/** {@link Hideable.visible } */
|
|
584
|
+
get visible(): boolean;
|
|
585
|
+
/** {@link Hideable.visible } */
|
|
586
|
+
set visible(state: boolean);
|
|
587
|
+
/** The material of the clipping plane representation. */
|
|
588
|
+
get material(): THREE.MeshBasicMaterial;
|
|
589
|
+
/** The material of the clipping plane representation. */
|
|
590
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
591
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
592
|
+
get size(): number;
|
|
593
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
594
|
+
set size(size: number);
|
|
595
|
+
constructor(components: Components);
|
|
596
|
+
/** {@link Disposable.dispose} */
|
|
597
|
+
dispose(): void;
|
|
598
|
+
/** {@link Createable.create} */
|
|
599
|
+
create(world: World): SimplePlane | null;
|
|
600
|
+
/**
|
|
601
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
602
|
+
* without the need of the mouse.
|
|
562
603
|
*
|
|
563
|
-
* @param
|
|
604
|
+
* @param world - the world where this plane should be created.
|
|
605
|
+
* @param normal - the orientation of the clipping plane.
|
|
606
|
+
* @param point - the position of the clipping plane.
|
|
607
|
+
* navigation.
|
|
608
|
+
*/
|
|
609
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
610
|
+
/**
|
|
611
|
+
* {@link Createable.delete}
|
|
564
612
|
*
|
|
565
|
-
* @param
|
|
613
|
+
* @param world - the world where the plane to delete is.
|
|
614
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
615
|
+
* found under the cursor will be deleted.
|
|
566
616
|
*/
|
|
567
|
-
|
|
617
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
568
618
|
/**
|
|
569
|
-
*
|
|
619
|
+
* Deletes all the existing clipping planes.
|
|
570
620
|
*
|
|
571
|
-
* @param
|
|
572
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
573
|
-
* to remove.
|
|
621
|
+
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
574
622
|
*/
|
|
575
|
-
|
|
576
|
-
private
|
|
577
|
-
private
|
|
578
|
-
private
|
|
623
|
+
deleteAll(types?: Set<string>): void;
|
|
624
|
+
private deletePlane;
|
|
625
|
+
private pickPlane;
|
|
626
|
+
private getAllPlaneMeshes;
|
|
627
|
+
private createPlaneFromIntersection;
|
|
628
|
+
private getWorldNormal;
|
|
629
|
+
private normalizePlaneDirectionY;
|
|
630
|
+
private newPlane;
|
|
631
|
+
private updateMaterialsAndPlanes;
|
|
632
|
+
private _onStartDragging;
|
|
633
|
+
private _onEndDragging;
|
|
579
634
|
}
|
|
580
635
|
import * as THREE from "three";
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
636
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
637
|
+
center: THREE.Vector3;
|
|
638
|
+
halfSizes: THREE.Vector3;
|
|
639
|
+
rotation: THREE.Matrix3;
|
|
640
|
+
transformation: THREE.Matrix4;
|
|
641
|
+
};
|
|
642
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
643
|
+
import * as THREE from "three";
|
|
644
|
+
import { Components } from "../Components";
|
|
645
|
+
import { SimpleCamera } from "..";
|
|
646
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
584
647
|
/**
|
|
585
|
-
* A
|
|
648
|
+
* 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).
|
|
586
649
|
*/
|
|
587
|
-
export declare class
|
|
588
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
589
|
-
/** {@link Component.enabled} */
|
|
590
|
-
enabled: boolean;
|
|
591
|
-
/** {@link Disposable.onDisposed} */
|
|
592
|
-
readonly onDisposed: Event<unknown>;
|
|
593
|
-
private _absoluteMin;
|
|
594
|
-
private _absoluteMax;
|
|
595
|
-
private _meshes;
|
|
596
|
-
constructor(components: Components);
|
|
650
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
597
651
|
/**
|
|
598
|
-
* A
|
|
599
|
-
*
|
|
600
|
-
* @param bbox - The bounding box to calculate the dimensions for.
|
|
601
|
-
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
652
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
602
653
|
*/
|
|
603
|
-
|
|
604
|
-
width: number;
|
|
605
|
-
height: number;
|
|
606
|
-
depth: number;
|
|
607
|
-
center: THREE.Vector3;
|
|
608
|
-
};
|
|
654
|
+
readonly projection: ProjectionManager;
|
|
609
655
|
/**
|
|
610
|
-
* A
|
|
611
|
-
*
|
|
612
|
-
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
613
|
-
* @returns A new THREE.Vector3 representing the boundary.
|
|
614
|
-
*
|
|
615
|
-
* @remarks
|
|
616
|
-
* This method is used to create a new boundary for calculating bounding boxes.
|
|
617
|
-
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
618
|
-
* depending on the value of the 'positive' parameter.
|
|
619
|
-
*
|
|
620
|
-
* @example
|
|
621
|
-
* '''typescript
|
|
622
|
-
* const positiveBound = BoundingBoxer.newBound(true);
|
|
623
|
-
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
624
|
-
*
|
|
625
|
-
* const negativeBound = BoundingBoxer.newBound(false);
|
|
626
|
-
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
627
|
-
* '''
|
|
656
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
657
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
628
658
|
*/
|
|
629
|
-
|
|
659
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
630
660
|
/**
|
|
631
|
-
* A
|
|
632
|
-
*
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
661
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
662
|
+
* This camera is used when the projection mode is set to perspective.
|
|
663
|
+
*/
|
|
664
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
665
|
+
protected readonly _userInputButtons: any;
|
|
666
|
+
protected readonly _frustumSize = 50;
|
|
667
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
668
|
+
protected _mode: NavigationMode | null;
|
|
669
|
+
private previousSize;
|
|
670
|
+
/**
|
|
671
|
+
* Getter for the current navigation mode.
|
|
672
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
641
673
|
*
|
|
642
|
-
* @
|
|
643
|
-
* '''typescript
|
|
644
|
-
* const points = [
|
|
645
|
-
* new THREE.Vector3(1, 2, 3),
|
|
646
|
-
* new THREE.Vector3(4, 5, 6),
|
|
647
|
-
* new THREE.Vector3(7, 8, 9),
|
|
648
|
-
* ];
|
|
674
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
649
675
|
*
|
|
650
|
-
*
|
|
651
|
-
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
652
|
-
* '''
|
|
676
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
653
677
|
*/
|
|
654
|
-
|
|
678
|
+
get mode(): NavigationMode;
|
|
679
|
+
constructor(components: Components);
|
|
655
680
|
/** {@link Disposable.dispose} */
|
|
656
681
|
dispose(): void;
|
|
657
682
|
/**
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
661
|
-
*
|
|
662
|
-
* @remarks
|
|
663
|
-
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
664
|
-
* The returned box represents the bounding box of the calculated fragments.
|
|
683
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
665
684
|
*
|
|
666
|
-
* @
|
|
667
|
-
* '''typescript
|
|
668
|
-
* const boundingBox = boundingBoxer.get();
|
|
669
|
-
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
670
|
-
* '''
|
|
685
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
671
686
|
*/
|
|
672
|
-
|
|
687
|
+
set(mode: NavModeID): void;
|
|
673
688
|
/**
|
|
674
|
-
*
|
|
675
|
-
*
|
|
676
|
-
* @returns A new THREE.Sphere instance representing the calculated sphere.
|
|
677
|
-
*
|
|
678
|
-
* @remarks
|
|
679
|
-
* This method calculates the center and radius of a sphere that encompasses the entire bounding box.
|
|
680
|
-
* The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
|
|
681
|
-
* The radius is calculated as the distance from the center to the minimum bound.
|
|
689
|
+
* Make the camera view fit all the specified meshes.
|
|
682
690
|
*
|
|
683
|
-
* @
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
687
|
-
* const boundingSphere = boundingBoxer.getSphere();
|
|
688
|
-
* console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
|
|
689
|
-
* '''
|
|
691
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
692
|
+
* evaluate {@link Components.meshes}.
|
|
693
|
+
* @param offset the distance to the fit object
|
|
690
694
|
*/
|
|
691
|
-
|
|
695
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
692
696
|
/**
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
* @returns A new THREE.Mesh instance representing the bounding box.
|
|
696
|
-
*
|
|
697
|
-
* @remarks
|
|
698
|
-
* This method calculates the dimensions of the bounding box using the 'getDimensions' method.
|
|
699
|
-
* It then creates a new THREE.BoxGeometry with the calculated dimensions.
|
|
700
|
-
* A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
|
|
701
|
-
* The position of the mesh is set to the center of the bounding box.
|
|
697
|
+
* Allows or prevents all user input.
|
|
702
698
|
*
|
|
703
|
-
* @
|
|
704
|
-
* '''typescript
|
|
705
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
706
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
707
|
-
* const boundingBoxMesh = boundingBoxer.getMesh();
|
|
708
|
-
* scene.add(boundingBoxMesh);
|
|
709
|
-
* '''
|
|
699
|
+
* @param active - whether to enable or disable user inputs.
|
|
710
700
|
*/
|
|
711
|
-
|
|
701
|
+
setUserInput(active: boolean): void;
|
|
702
|
+
private disableUserInput;
|
|
703
|
+
private enableUserInput;
|
|
704
|
+
private newOrthoCamera;
|
|
705
|
+
private setOrthoPerspCameraAspect;
|
|
706
|
+
}
|
|
707
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
708
|
+
/**
|
|
709
|
+
* 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).
|
|
710
|
+
*/
|
|
711
|
+
export declare class Exploder extends Component implements Disposable {
|
|
712
712
|
/**
|
|
713
|
-
*
|
|
714
|
-
* This
|
|
715
|
-
*
|
|
716
|
-
* @remarks
|
|
717
|
-
* This method is called when a new set of fragments is added to the BoundingBoxer.
|
|
718
|
-
* It ensures that the bounding box calculations are accurate and up-to-date.
|
|
719
|
-
*
|
|
720
|
-
* @example
|
|
721
|
-
* '''typescript
|
|
722
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
723
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
724
|
-
* // ...
|
|
725
|
-
* boundingBoxer.reset();
|
|
726
|
-
* '''
|
|
713
|
+
* A unique identifier for the component.
|
|
714
|
+
* This UUID is used to register the component within the Components system.
|
|
727
715
|
*/
|
|
728
|
-
|
|
716
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
717
|
+
/** {@link Disposable.onDisposed} */
|
|
718
|
+
readonly onDisposed: Event<unknown>;
|
|
719
|
+
/** {@link Component.enabled} */
|
|
720
|
+
enabled: boolean;
|
|
729
721
|
/**
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
* @remarks
|
|
735
|
-
* This method iterates through each fragment in the provided FragmentsGroup,
|
|
736
|
-
* and calls the 'addMesh' method for each fragment's mesh.
|
|
737
|
-
*
|
|
738
|
-
* @example
|
|
739
|
-
* '''typescript
|
|
740
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
741
|
-
* boundingBoxer.add(fragmentsGroup);
|
|
742
|
-
* '''
|
|
722
|
+
* The height of the explosion animation.
|
|
723
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
724
|
+
* Default value is 10.
|
|
743
725
|
*/
|
|
744
|
-
|
|
726
|
+
height: number;
|
|
745
727
|
/**
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
* @param itemIDs - An optional iterable of numbers representing the item IDs.
|
|
750
|
-
*
|
|
751
|
-
* @remarks
|
|
752
|
-
* This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
|
|
753
|
-
* If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
|
|
754
|
-
* If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
|
|
755
|
-
*
|
|
756
|
-
* @example
|
|
757
|
-
* '''typescript
|
|
758
|
-
* const boundingBoxer = components.get(BoundingBoxer);
|
|
759
|
-
* boundingBoxer.addMesh(mesh);
|
|
760
|
-
* '''
|
|
728
|
+
* The group name used for the explosion animation.
|
|
729
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
730
|
+
* Default value is "storeys".
|
|
761
731
|
*/
|
|
762
|
-
|
|
732
|
+
groupName: string;
|
|
763
733
|
/**
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
|
|
767
|
-
|
|
734
|
+
* A set of strings representing the exploded items.
|
|
735
|
+
* This set is used to keep track of which items have been exploded.
|
|
736
|
+
*/
|
|
737
|
+
list: Set<string>;
|
|
738
|
+
constructor(components: Components);
|
|
739
|
+
/** {@link Disposable.dispose} */
|
|
740
|
+
dispose(): void;
|
|
741
|
+
/**
|
|
742
|
+
* Sets the explosion state of the fragments.
|
|
768
743
|
*
|
|
769
|
-
* @param
|
|
744
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
770
745
|
*
|
|
771
746
|
* @remarks
|
|
772
|
-
* This method
|
|
773
|
-
*
|
|
747
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
748
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
749
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
774
750
|
*
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
779
|
-
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
780
|
-
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
781
|
-
* };
|
|
782
|
-
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
783
|
-
* '''
|
|
751
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
752
|
+
*
|
|
753
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
784
754
|
*/
|
|
785
|
-
|
|
786
|
-
|
|
755
|
+
set(active: boolean): void;
|
|
756
|
+
}
|
|
757
|
+
import * as THREE from "three";
|
|
758
|
+
export declare class MaterialsUtils {
|
|
759
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
787
760
|
}
|
|
788
761
|
import * as THREE from "three";
|
|
789
762
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -944,77 +917,26 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
944
917
|
*
|
|
945
918
|
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
946
919
|
*/
|
|
947
|
-
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
948
|
-
/**
|
|
949
|
-
* Resets the color of the specified fragments to their original color.
|
|
950
|
-
*
|
|
951
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
952
|
-
*
|
|
953
|
-
* @remarks
|
|
954
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
955
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
956
|
-
*
|
|
957
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
958
|
-
*/
|
|
959
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
960
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
961
|
-
}
|
|
962
|
-
import * as THREE from "three";
|
|
963
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
964
|
-
center: THREE.Vector3;
|
|
965
|
-
halfSizes: THREE.Vector3;
|
|
966
|
-
rotation: THREE.Matrix3;
|
|
967
|
-
transformation: THREE.Matrix4;
|
|
968
|
-
};
|
|
969
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
970
|
-
/**
|
|
971
|
-
* 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).
|
|
972
|
-
*/
|
|
973
|
-
export declare class Exploder extends Component implements Disposable {
|
|
974
|
-
/**
|
|
975
|
-
* A unique identifier for the component.
|
|
976
|
-
* This UUID is used to register the component within the Components system.
|
|
977
|
-
*/
|
|
978
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
979
|
-
/** {@link Disposable.onDisposed} */
|
|
980
|
-
readonly onDisposed: Event<unknown>;
|
|
981
|
-
/** {@link Component.enabled} */
|
|
982
|
-
enabled: boolean;
|
|
983
|
-
/**
|
|
984
|
-
* The height of the explosion animation.
|
|
985
|
-
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
986
|
-
* Default value is 10.
|
|
987
|
-
*/
|
|
988
|
-
height: number;
|
|
989
|
-
/**
|
|
990
|
-
* The group name used for the explosion animation.
|
|
991
|
-
* This property specifies the group of fragments that will be affected by the explosion.
|
|
992
|
-
* Default value is "storeys".
|
|
993
|
-
*/
|
|
994
|
-
groupName: string;
|
|
995
|
-
/**
|
|
996
|
-
* A set of strings representing the exploded items.
|
|
997
|
-
* This set is used to keep track of which items have been exploded.
|
|
998
|
-
*/
|
|
999
|
-
list: Set<string>;
|
|
1000
|
-
constructor(components: Components);
|
|
1001
|
-
/** {@link Disposable.dispose} */
|
|
1002
|
-
dispose(): void;
|
|
920
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
1003
921
|
/**
|
|
1004
|
-
*
|
|
922
|
+
* Resets the color of the specified fragments to their original color.
|
|
1005
923
|
*
|
|
1006
|
-
* @param
|
|
924
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1007
925
|
*
|
|
1008
926
|
* @remarks
|
|
1009
|
-
* This method
|
|
1010
|
-
*
|
|
1011
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
1012
|
-
*
|
|
1013
|
-
* The method also keeps track of the exploded items using the 'list' set.
|
|
927
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
928
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
1014
929
|
*
|
|
1015
|
-
* @throws Will throw an error if the
|
|
930
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1016
931
|
*/
|
|
1017
|
-
|
|
932
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
933
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
934
|
+
}
|
|
935
|
+
export declare class UUID {
|
|
936
|
+
private static _pattern;
|
|
937
|
+
private static _lut;
|
|
938
|
+
static create(): string;
|
|
939
|
+
static validate(uuid: string): void;
|
|
1018
940
|
}
|
|
1019
941
|
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1020
942
|
import * as THREE from "three";
|
|
@@ -1152,7 +1074,6 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
1152
1074
|
*/
|
|
1153
1075
|
clone(model: FRAGS.FragmentsGroup, items?: FRAGS.FragmentIdMap): FragmentsGroup;
|
|
1154
1076
|
}
|
|
1155
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1156
1077
|
import * as WEBIFC from "web-ifc";
|
|
1157
1078
|
import { Components, Disposable, Event, Component } from "../../core";
|
|
1158
1079
|
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
@@ -1252,196 +1173,157 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
|
1252
1173
|
private streamGeometries;
|
|
1253
1174
|
}
|
|
1254
1175
|
import * as WEBIFC from "web-ifc";
|
|
1255
|
-
import
|
|
1256
|
-
import {
|
|
1257
|
-
import {
|
|
1258
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1176
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1177
|
+
import { IfcFragmentSettings } from "./src";
|
|
1178
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1259
1179
|
/**
|
|
1260
|
-
*
|
|
1180
|
+
* 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).
|
|
1261
1181
|
*/
|
|
1262
|
-
export declare class
|
|
1182
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1263
1183
|
/**
|
|
1264
1184
|
* A unique identifier for the component.
|
|
1265
1185
|
* This UUID is used to register the component within the Components system.
|
|
1266
1186
|
*/
|
|
1267
|
-
static readonly uuid: "
|
|
1187
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1268
1188
|
/** {@link Disposable.onDisposed} */
|
|
1269
1189
|
readonly onDisposed: Event<string>;
|
|
1270
1190
|
/**
|
|
1271
|
-
*
|
|
1272
|
-
* This event provides the model's UUID and the relations map generated for that model.
|
|
1273
|
-
*
|
|
1274
|
-
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
1275
|
-
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
1276
|
-
* The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
1191
|
+
* An event triggered when the IFC file starts loading.
|
|
1277
1192
|
*/
|
|
1278
|
-
readonly
|
|
1279
|
-
modelID: string;
|
|
1280
|
-
relationsMap: RelationsMap;
|
|
1281
|
-
}>;
|
|
1193
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1282
1194
|
/**
|
|
1283
|
-
*
|
|
1284
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
1285
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
1286
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
1287
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
1288
|
-
* of entity relationships within a model.
|
|
1195
|
+
* An event triggered when the setup process is completed.
|
|
1289
1196
|
*/
|
|
1290
|
-
readonly
|
|
1197
|
+
readonly onSetup: Event<void>;
|
|
1198
|
+
/**
|
|
1199
|
+
* The settings for the IfcLoader.
|
|
1200
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1201
|
+
*/
|
|
1202
|
+
settings: IfcFragmentSettings;
|
|
1203
|
+
/**
|
|
1204
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1205
|
+
*/
|
|
1206
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1291
1207
|
/** {@link Component.enabled} */
|
|
1292
1208
|
enabled: boolean;
|
|
1293
|
-
private
|
|
1294
|
-
private
|
|
1295
|
-
private
|
|
1209
|
+
private _material;
|
|
1210
|
+
private _spatialTree;
|
|
1211
|
+
private _metaData;
|
|
1212
|
+
private _fragmentInstances;
|
|
1213
|
+
private _civil;
|
|
1214
|
+
private _visitedFragments;
|
|
1215
|
+
private _materialT;
|
|
1296
1216
|
constructor(components: Components);
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
private getAttributeIndex;
|
|
1217
|
+
/** {@link Disposable.dispose} */
|
|
1218
|
+
dispose(): void;
|
|
1300
1219
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1303
|
-
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
1304
|
-
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
1220
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1305
1221
|
*
|
|
1306
|
-
* @
|
|
1307
|
-
|
|
1308
|
-
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
1309
|
-
/**
|
|
1310
|
-
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
1311
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
1312
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
1222
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
1223
|
+
* If not provided, the existing settings will be used.
|
|
1313
1224
|
*
|
|
1314
|
-
*
|
|
1315
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
1316
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
1317
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
1318
|
-
* of entities that are related through that attribute.
|
|
1225
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
1319
1226
|
*
|
|
1320
|
-
* @
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1323
|
-
* @throws An error if the model does not have properties loaded.
|
|
1324
|
-
*/
|
|
1325
|
-
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
1326
|
-
/**
|
|
1327
|
-
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
1227
|
+
* @remarks
|
|
1228
|
+
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1229
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1328
1230
|
*
|
|
1329
|
-
* @
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1231
|
+
* @example
|
|
1232
|
+
* '''typescript
|
|
1233
|
+
* const ifcLoader = new IfcLoader(components);
|
|
1234
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1235
|
+
* '''
|
|
1333
1236
|
*/
|
|
1334
|
-
|
|
1237
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1335
1238
|
/**
|
|
1336
|
-
*
|
|
1337
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
1338
|
-
* returning the IDs of related entities if a match is found.
|
|
1239
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
1339
1240
|
*
|
|
1340
|
-
* @param
|
|
1341
|
-
* @param
|
|
1342
|
-
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
1343
|
-
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
1344
|
-
* or the specified relation name is not indexed.
|
|
1345
|
-
*/
|
|
1346
|
-
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
1347
|
-
/**
|
|
1348
|
-
* Serializes the relations of a given relation map into a JSON string.
|
|
1349
|
-
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
1350
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1351
|
-
* The resulting object is then serialized into a JSON string.
|
|
1241
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1242
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1352
1243
|
*
|
|
1353
|
-
* @
|
|
1354
|
-
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
1355
|
-
*/
|
|
1356
|
-
serializeRelations(relationMap: RelationsMap): string;
|
|
1357
|
-
/**
|
|
1358
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
1359
|
-
* This method iterates through the relations indexed for the given model,
|
|
1360
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
1361
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1362
|
-
* The resulting object is then serialized into a JSON string.
|
|
1244
|
+
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1363
1245
|
*
|
|
1364
|
-
* @
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1246
|
+
* @example
|
|
1247
|
+
* '''typescript
|
|
1248
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1249
|
+
* const group = await ifcLoader.load(ifcData);
|
|
1250
|
+
* '''
|
|
1367
1251
|
*/
|
|
1368
|
-
|
|
1252
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1369
1253
|
/**
|
|
1370
|
-
*
|
|
1371
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
1372
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
1373
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
1374
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
1254
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
1375
1255
|
*
|
|
1376
|
-
* @
|
|
1377
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
1378
|
-
*/
|
|
1379
|
-
serializeAllRelations(): string;
|
|
1380
|
-
/**
|
|
1381
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
1382
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
1383
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
1384
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
1385
|
-
* of express IDs of entities related through that relation type.
|
|
1256
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1386
1257
|
*
|
|
1387
|
-
* @
|
|
1388
|
-
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
1389
|
-
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
1390
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
1391
|
-
*/
|
|
1392
|
-
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
1393
|
-
/** {@link Disposable.dispose} */
|
|
1394
|
-
dispose(): void;
|
|
1395
|
-
/**
|
|
1396
|
-
* Adds relations between an entity and other entities in a BIM model.
|
|
1258
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1397
1259
|
*
|
|
1398
|
-
* @
|
|
1399
|
-
*
|
|
1400
|
-
*
|
|
1401
|
-
* @param relIDs - The expressIDs of the related entities within the model.
|
|
1260
|
+
* @remarks
|
|
1261
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1262
|
+
* It also opens the IFC model using the provided data and settings.
|
|
1402
1263
|
*
|
|
1403
|
-
* @
|
|
1264
|
+
* @example
|
|
1265
|
+
* '''typescript
|
|
1266
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1267
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
1268
|
+
* '''
|
|
1404
1269
|
*/
|
|
1405
|
-
|
|
1270
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1406
1271
|
/**
|
|
1407
|
-
*
|
|
1272
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1273
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1408
1274
|
*
|
|
1409
|
-
* @
|
|
1410
|
-
*
|
|
1411
|
-
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
1275
|
+
* @remarks
|
|
1276
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1412
1277
|
*
|
|
1413
|
-
* @
|
|
1278
|
+
* @example
|
|
1279
|
+
* '''typescript
|
|
1280
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1281
|
+
* ifcLoader.cleanUp();
|
|
1282
|
+
* '''
|
|
1414
1283
|
*/
|
|
1415
|
-
|
|
1284
|
+
cleanUp(): void;
|
|
1285
|
+
private getAllGeometries;
|
|
1286
|
+
private getMesh;
|
|
1287
|
+
private getGeometry;
|
|
1288
|
+
private autoSetWasm;
|
|
1416
1289
|
}
|
|
1417
|
-
import * as
|
|
1418
|
-
import
|
|
1419
|
-
import { Component, Components } from "../../core";
|
|
1290
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1291
|
+
import { Components, Component } from "../../core";
|
|
1420
1292
|
/**
|
|
1421
|
-
*
|
|
1293
|
+
* 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).
|
|
1422
1294
|
*/
|
|
1423
|
-
export declare class
|
|
1295
|
+
export declare class Hider extends Component {
|
|
1424
1296
|
/**
|
|
1425
1297
|
* A unique identifier for the component.
|
|
1426
1298
|
* This UUID is used to register the component within the Components system.
|
|
1427
1299
|
*/
|
|
1428
|
-
static readonly uuid: "
|
|
1300
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1429
1301
|
/** {@link Component.enabled} */
|
|
1430
1302
|
enabled: boolean;
|
|
1431
1303
|
constructor(components: Components);
|
|
1432
1304
|
/**
|
|
1433
|
-
*
|
|
1434
|
-
*
|
|
1435
|
-
*
|
|
1436
|
-
*
|
|
1437
|
-
* @param
|
|
1438
|
-
*
|
|
1305
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1306
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1307
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1308
|
+
*
|
|
1309
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1310
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1311
|
+
* If not provided, all fragments will be affected.
|
|
1312
|
+
*
|
|
1313
|
+
* @returns {void}
|
|
1439
1314
|
*/
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1315
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1316
|
+
/**
|
|
1317
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1318
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1319
|
+
*
|
|
1320
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1321
|
+
* If not provided, all fragments will be isolated.
|
|
1322
|
+
*
|
|
1323
|
+
* @returns {void}
|
|
1324
|
+
*/
|
|
1325
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1326
|
+
private updateCulledVisibility;
|
|
1445
1327
|
}
|
|
1446
1328
|
import * as WEBIFC from "web-ifc";
|
|
1447
1329
|
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
@@ -1508,641 +1390,826 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
1508
1390
|
private streamAllProperties;
|
|
1509
1391
|
private cleanUp;
|
|
1510
1392
|
}
|
|
1511
|
-
import * as
|
|
1512
|
-
import {
|
|
1513
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1514
|
-
/**
|
|
1515
|
-
* Types for boolean properties in IFC schema.
|
|
1516
|
-
*/
|
|
1517
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1518
|
-
/**
|
|
1519
|
-
* Types for string properties in IFC schema.
|
|
1520
|
-
*/
|
|
1521
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1522
|
-
/**
|
|
1523
|
-
* Types for numeric properties in IFC schema.
|
|
1524
|
-
*/
|
|
1525
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1526
|
-
/**
|
|
1527
|
-
* 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.
|
|
1528
|
-
*/
|
|
1529
|
-
export interface ChangeMap {
|
|
1530
|
-
[modelID: string]: Set<number>;
|
|
1531
|
-
}
|
|
1393
|
+
import * as THREE from "three";
|
|
1394
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1532
1395
|
/**
|
|
1533
|
-
*
|
|
1396
|
+
* Configuration interface for the VertexPicker component.
|
|
1534
1397
|
*/
|
|
1535
|
-
export interface
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1398
|
+
export interface VertexPickerConfig {
|
|
1399
|
+
/**
|
|
1400
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
1401
|
+
*/
|
|
1402
|
+
showOnlyVertex: boolean;
|
|
1403
|
+
/**
|
|
1404
|
+
* The maximum distance for snapping to a vertex.
|
|
1405
|
+
*/
|
|
1406
|
+
snapDistance: number;
|
|
1407
|
+
/**
|
|
1408
|
+
* The HTML element to use for previewing the picked vertex.
|
|
1409
|
+
*/
|
|
1410
|
+
previewElement: HTMLElement;
|
|
1541
1411
|
}
|
|
1542
1412
|
/**
|
|
1543
|
-
*
|
|
1413
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1544
1414
|
*/
|
|
1545
|
-
export declare class
|
|
1415
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
1416
|
+
/** {@link Disposable.onDisposed} */
|
|
1417
|
+
readonly onDisposed: Event<unknown>;
|
|
1546
1418
|
/**
|
|
1547
|
-
*
|
|
1548
|
-
*
|
|
1419
|
+
* An event that is triggered when a vertex is found.
|
|
1420
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1549
1421
|
*/
|
|
1550
|
-
|
|
1551
|
-
/** {@link Disposable.onDisposed} */
|
|
1552
|
-
readonly onDisposed: Event<string>;
|
|
1422
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1553
1423
|
/**
|
|
1554
|
-
*
|
|
1424
|
+
* An event that is triggered when a vertex is lost.
|
|
1425
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1555
1426
|
*/
|
|
1556
|
-
readonly
|
|
1427
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1557
1428
|
/**
|
|
1558
|
-
*
|
|
1429
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
1559
1430
|
*/
|
|
1560
|
-
|
|
1431
|
+
readonly onEnabled: Event<boolean>;
|
|
1561
1432
|
/**
|
|
1562
|
-
*
|
|
1433
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
1563
1434
|
*/
|
|
1564
|
-
|
|
1565
|
-
model: FragmentsGroup;
|
|
1566
|
-
psetID: number;
|
|
1567
|
-
elementID: number;
|
|
1568
|
-
}>;
|
|
1435
|
+
components: Components;
|
|
1569
1436
|
/**
|
|
1570
|
-
*
|
|
1437
|
+
* A reference to the working plane used for vertex picking.
|
|
1438
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
1439
|
+
* If this value is null, all vertices are considered valid.
|
|
1571
1440
|
*/
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
}>;
|
|
1441
|
+
workingPlane: THREE.Plane | null;
|
|
1442
|
+
private _pickedPoint;
|
|
1443
|
+
private _config;
|
|
1444
|
+
private _enabled;
|
|
1577
1445
|
/**
|
|
1578
|
-
*
|
|
1446
|
+
* Sets the enabled state of the VertexPicker.
|
|
1447
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1448
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1449
|
+
*
|
|
1450
|
+
* @param value - The new enabled state.
|
|
1579
1451
|
*/
|
|
1580
|
-
|
|
1581
|
-
model: FragmentsGroup;
|
|
1582
|
-
psetID: number;
|
|
1583
|
-
}>;
|
|
1452
|
+
set enabled(value: boolean);
|
|
1584
1453
|
/**
|
|
1585
|
-
*
|
|
1454
|
+
* Gets the current enabled state of the VertexPicker.
|
|
1455
|
+
*
|
|
1456
|
+
* @returns The current enabled state.
|
|
1586
1457
|
*/
|
|
1587
|
-
|
|
1588
|
-
model: FragmentsGroup;
|
|
1589
|
-
expressID: number;
|
|
1590
|
-
}>;
|
|
1458
|
+
get enabled(): boolean;
|
|
1591
1459
|
/**
|
|
1592
|
-
*
|
|
1460
|
+
* Sets the configuration for the VertexPicker component.
|
|
1461
|
+
*
|
|
1462
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
1463
|
+
* The properties not provided in the value object will retain their current values.
|
|
1464
|
+
*
|
|
1465
|
+
* @example
|
|
1466
|
+
* '''typescript
|
|
1467
|
+
* vertexPicker.config = {
|
|
1468
|
+
* snapDistance: 0.5,
|
|
1469
|
+
* showOnlyVertex: true,
|
|
1470
|
+
* };
|
|
1471
|
+
* '''
|
|
1593
1472
|
*/
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1473
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
1474
|
+
/**
|
|
1475
|
+
* Gets the current configuration for the VertexPicker component.
|
|
1476
|
+
*
|
|
1477
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
1478
|
+
*
|
|
1479
|
+
* @example
|
|
1480
|
+
* '''typescript
|
|
1481
|
+
* const currentConfig = vertexPicker.config;
|
|
1482
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1483
|
+
* '''
|
|
1484
|
+
*/
|
|
1485
|
+
get config(): Partial<VertexPickerConfig>;
|
|
1486
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
1487
|
+
/** {@link Disposable.dispose} */
|
|
1488
|
+
dispose(): void;
|
|
1489
|
+
/**
|
|
1490
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
1491
|
+
*
|
|
1492
|
+
* @param world - The World instance to use for raycasting.
|
|
1493
|
+
*
|
|
1494
|
+
* @returns The current picked point, or null if no point is picked.
|
|
1495
|
+
*
|
|
1496
|
+
* @remarks
|
|
1497
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
1498
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
1499
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
1500
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
1501
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
1502
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1503
|
+
*/
|
|
1504
|
+
get(world: World): THREE.Vector3 | null;
|
|
1505
|
+
private getClosestVertex;
|
|
1506
|
+
private getVertices;
|
|
1507
|
+
private getVertex;
|
|
1508
|
+
}
|
|
1509
|
+
import * as THREE from "three";
|
|
1510
|
+
import { Components } from "../Components";
|
|
1511
|
+
import { Component } from "../Types";
|
|
1512
|
+
/**
|
|
1513
|
+
* 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).
|
|
1514
|
+
*/
|
|
1515
|
+
export declare class Disposer extends Component {
|
|
1516
|
+
private _disposedComponents;
|
|
1598
1517
|
/** {@link Component.enabled} */
|
|
1599
1518
|
enabled: boolean;
|
|
1600
1519
|
/**
|
|
1601
|
-
*
|
|
1520
|
+
* A unique identifier for the component.
|
|
1521
|
+
* This UUID is used to register the component within the Components system.
|
|
1602
1522
|
*/
|
|
1603
|
-
|
|
1523
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
1524
|
+
constructor(components: Components);
|
|
1604
1525
|
/**
|
|
1605
|
-
*
|
|
1526
|
+
* Return the UUIDs of all disposed components.
|
|
1606
1527
|
*/
|
|
1607
|
-
|
|
1528
|
+
get(): Set<string>;
|
|
1608
1529
|
/**
|
|
1609
|
-
*
|
|
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.
|
|
1610
1540
|
*/
|
|
1611
|
-
|
|
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 * as THREE from "three";
|
|
1555
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1556
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1557
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
1558
|
+
/**
|
|
1559
|
+
* 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).
|
|
1560
|
+
*/
|
|
1561
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
1562
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
1563
|
+
/** {@link Component.enabled} */
|
|
1564
|
+
enabled: boolean;
|
|
1565
|
+
/** {@link Disposable.onDisposed} */
|
|
1566
|
+
readonly onDisposed: Event<unknown>;
|
|
1567
|
+
private _absoluteMin;
|
|
1568
|
+
private _absoluteMax;
|
|
1569
|
+
private _meshes;
|
|
1612
1570
|
constructor(components: Components);
|
|
1613
|
-
/** {@link Disposable.dispose} */
|
|
1614
|
-
dispose(): void;
|
|
1615
1571
|
/**
|
|
1616
|
-
*
|
|
1572
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
1617
1573
|
*
|
|
1618
|
-
* @param
|
|
1619
|
-
* @
|
|
1620
|
-
* @returns The IFC schema associated with the given model.
|
|
1574
|
+
* @param bbox - The bounding box to calculate the dimensions for.
|
|
1575
|
+
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
1621
1576
|
*/
|
|
1622
|
-
static
|
|
1577
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
1578
|
+
width: number;
|
|
1579
|
+
height: number;
|
|
1580
|
+
depth: number;
|
|
1581
|
+
center: THREE.Vector3;
|
|
1582
|
+
};
|
|
1623
1583
|
/**
|
|
1624
|
-
*
|
|
1584
|
+
* A static method to create a new bounding box boundary.
|
|
1585
|
+
*
|
|
1586
|
+
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
1587
|
+
* @returns A new THREE.Vector3 representing the boundary.
|
|
1625
1588
|
*
|
|
1626
|
-
* @
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1629
|
-
*
|
|
1589
|
+
* @remarks
|
|
1590
|
+
* This method is used to create a new boundary for calculating bounding boxes.
|
|
1591
|
+
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
1592
|
+
* depending on the value of the 'positive' parameter.
|
|
1630
1593
|
*
|
|
1631
|
-
* @
|
|
1594
|
+
* @example
|
|
1595
|
+
* '''typescript
|
|
1596
|
+
* const positiveBound = BoundingBoxer.newBound(true);
|
|
1597
|
+
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
1632
1598
|
*
|
|
1633
|
-
*
|
|
1599
|
+
* const negativeBound = BoundingBoxer.newBound(false);
|
|
1600
|
+
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
1601
|
+
* '''
|
|
1634
1602
|
*/
|
|
1635
|
-
|
|
1603
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
1636
1604
|
/**
|
|
1637
|
-
*
|
|
1605
|
+
* A static method to calculate the bounding box of a set of points.
|
|
1638
1606
|
*
|
|
1639
|
-
* @param
|
|
1640
|
-
* @param
|
|
1641
|
-
* @param
|
|
1607
|
+
* @param points - An array of THREE.Vector3 representing the points.
|
|
1608
|
+
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
1609
|
+
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
1610
|
+
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
1642
1611
|
*
|
|
1643
|
-
* @
|
|
1612
|
+
* @remarks
|
|
1613
|
+
* This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
|
|
1614
|
+
* 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.
|
|
1644
1615
|
*
|
|
1645
|
-
* @
|
|
1646
|
-
*
|
|
1616
|
+
* @example
|
|
1617
|
+
* '''typescript
|
|
1618
|
+
* const points = [
|
|
1619
|
+
* new THREE.Vector3(1, 2, 3),
|
|
1620
|
+
* new THREE.Vector3(4, 5, 6),
|
|
1621
|
+
* new THREE.Vector3(7, 8, 9),
|
|
1622
|
+
* ];
|
|
1623
|
+
*
|
|
1624
|
+
* const bbox = BoundingBoxer.getBounds(points);
|
|
1625
|
+
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
1626
|
+
* '''
|
|
1647
1627
|
*/
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
}>;
|
|
1628
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
1629
|
+
/** {@link Disposable.dispose} */
|
|
1630
|
+
dispose(): void;
|
|
1652
1631
|
/**
|
|
1653
|
-
*
|
|
1632
|
+
* Returns the bounding box of the calculated fragments.
|
|
1654
1633
|
*
|
|
1655
|
-
* @
|
|
1656
|
-
* @param psetID - The express IDs of the Psets to be removed.
|
|
1634
|
+
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
1657
1635
|
*
|
|
1658
|
-
* @
|
|
1636
|
+
* @remarks
|
|
1637
|
+
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
1638
|
+
* The returned box represents the bounding box of the calculated fragments.
|
|
1659
1639
|
*
|
|
1660
|
-
* @
|
|
1661
|
-
*
|
|
1662
|
-
*
|
|
1640
|
+
* @example
|
|
1641
|
+
* '''typescript
|
|
1642
|
+
* const boundingBox = boundingBoxer.get();
|
|
1643
|
+
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
1644
|
+
* '''
|
|
1663
1645
|
*/
|
|
1664
|
-
|
|
1646
|
+
get(): THREE.Box3;
|
|
1665
1647
|
/**
|
|
1666
|
-
*
|
|
1648
|
+
* Calculates and returns a sphere that encompasses the entire bounding box.
|
|
1667
1649
|
*
|
|
1668
|
-
* @
|
|
1669
|
-
* @param type - The type of the property value. Must be a string property type.
|
|
1670
|
-
* @param name - The name of the property.
|
|
1671
|
-
* @param value - The value of the property. Must be a string.
|
|
1650
|
+
* @returns A new THREE.Sphere instance representing the calculated sphere.
|
|
1672
1651
|
*
|
|
1673
|
-
* @
|
|
1652
|
+
* @remarks
|
|
1653
|
+
* This method calculates the center and radius of a sphere that encompasses the entire bounding box.
|
|
1654
|
+
* The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
|
|
1655
|
+
* The radius is calculated as the distance from the center to the minimum bound.
|
|
1674
1656
|
*
|
|
1675
|
-
* @
|
|
1676
|
-
*
|
|
1657
|
+
* @example
|
|
1658
|
+
* '''typescript
|
|
1659
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1660
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1661
|
+
* const boundingSphere = boundingBoxer.getSphere();
|
|
1662
|
+
* console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
|
|
1663
|
+
* '''
|
|
1677
1664
|
*/
|
|
1678
|
-
|
|
1665
|
+
getSphere(): THREE.Sphere;
|
|
1679
1666
|
/**
|
|
1680
|
-
*
|
|
1667
|
+
* Returns a THREE.Mesh instance representing the bounding box.
|
|
1681
1668
|
*
|
|
1682
|
-
* @
|
|
1683
|
-
* @param type - The type of the property value. Must be a numeric property type.
|
|
1684
|
-
* @param name - The name of the property.
|
|
1685
|
-
* @param value - The value of the property. Must be a number.
|
|
1669
|
+
* @returns A new THREE.Mesh instance representing the bounding box.
|
|
1686
1670
|
*
|
|
1687
|
-
* @
|
|
1671
|
+
* @remarks
|
|
1672
|
+
* This method calculates the dimensions of the bounding box using the 'getDimensions' method.
|
|
1673
|
+
* It then creates a new THREE.BoxGeometry with the calculated dimensions.
|
|
1674
|
+
* A new THREE.Mesh is created using the box geometry, and it is added to the '_meshes' array.
|
|
1675
|
+
* The position of the mesh is set to the center of the bounding box.
|
|
1688
1676
|
*
|
|
1689
|
-
* @
|
|
1690
|
-
*
|
|
1677
|
+
* @example
|
|
1678
|
+
* '''typescript
|
|
1679
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1680
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1681
|
+
* const boundingBoxMesh = boundingBoxer.getMesh();
|
|
1682
|
+
* scene.add(boundingBoxMesh);
|
|
1683
|
+
* '''
|
|
1691
1684
|
*/
|
|
1692
|
-
|
|
1685
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1693
1686
|
/**
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1696
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1697
|
-
* @param type - The type of the property value. Must be a boolean property type.
|
|
1698
|
-
* @param name - The name of the property.
|
|
1699
|
-
* @param value - The value of the property. Must be a boolean.
|
|
1687
|
+
* Resets the internal minimum and maximum vectors to positive and negative infinity, respectively.
|
|
1688
|
+
* This method is used to prepare the BoundingBoxer for a new set of fragments.
|
|
1700
1689
|
*
|
|
1701
|
-
* @
|
|
1690
|
+
* @remarks
|
|
1691
|
+
* This method is called when a new set of fragments is added to the BoundingBoxer.
|
|
1692
|
+
* It ensures that the bounding box calculations are accurate and up-to-date.
|
|
1702
1693
|
*
|
|
1703
|
-
* @
|
|
1704
|
-
*
|
|
1694
|
+
* @example
|
|
1695
|
+
* '''typescript
|
|
1696
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1697
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1698
|
+
* // ...
|
|
1699
|
+
* boundingBoxer.reset();
|
|
1700
|
+
* '''
|
|
1705
1701
|
*/
|
|
1706
|
-
|
|
1702
|
+
reset(): void;
|
|
1707
1703
|
/**
|
|
1708
|
-
*
|
|
1704
|
+
* Adds a FragmentsGroup to the BoundingBoxer.
|
|
1709
1705
|
*
|
|
1710
|
-
* @param
|
|
1711
|
-
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1712
|
-
* @param propID - The express ID of the property to be removed.
|
|
1706
|
+
* @param group - The FragmentsGroup to add.
|
|
1713
1707
|
*
|
|
1714
|
-
* @
|
|
1708
|
+
* @remarks
|
|
1709
|
+
* This method iterates through each fragment in the provided FragmentsGroup,
|
|
1710
|
+
* and calls the 'addMesh' method for each fragment's mesh.
|
|
1715
1711
|
*
|
|
1716
|
-
* @
|
|
1717
|
-
*
|
|
1712
|
+
* @example
|
|
1713
|
+
* '''typescript
|
|
1714
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1715
|
+
* boundingBoxer.add(fragmentsGroup);
|
|
1716
|
+
* '''
|
|
1718
1717
|
*/
|
|
1719
|
-
|
|
1720
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
1718
|
+
add(group: FragmentsGroup): void;
|
|
1721
1719
|
/**
|
|
1722
|
-
* Adds
|
|
1720
|
+
* Adds a mesh to the BoundingBoxer and calculates the bounding box.
|
|
1723
1721
|
*
|
|
1724
|
-
* @param
|
|
1725
|
-
* @param
|
|
1726
|
-
* @param elementID - The express IDs of the elements to be added.
|
|
1722
|
+
* @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
|
|
1723
|
+
* @param itemIDs - An optional iterable of numbers representing the item IDs.
|
|
1727
1724
|
*
|
|
1728
|
-
* @
|
|
1725
|
+
* @remarks
|
|
1726
|
+
* This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
|
|
1727
|
+
* If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
|
|
1728
|
+
* If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
|
|
1729
1729
|
*
|
|
1730
|
-
* @
|
|
1731
|
-
*
|
|
1732
|
-
*
|
|
1730
|
+
* @example
|
|
1731
|
+
* '''typescript
|
|
1732
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1733
|
+
* boundingBoxer.addMesh(mesh);
|
|
1734
|
+
* '''
|
|
1733
1735
|
*/
|
|
1734
|
-
|
|
1736
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
1735
1737
|
/**
|
|
1736
|
-
*
|
|
1738
|
+
* Uses a FragmentIdMap to add its meshes to the bb calculation.
|
|
1737
1739
|
*
|
|
1738
|
-
*
|
|
1739
|
-
*
|
|
1740
|
+
* This method iterates through the provided 'fragmentIdMap', retrieves the corresponding fragment from the 'FragmentsManager',
|
|
1741
|
+
* and then calls the 'addMesh' method for each fragment's mesh, passing the expression IDs as the second parameter.
|
|
1740
1742
|
*
|
|
1741
|
-
* @
|
|
1743
|
+
* @param fragmentIdMap - A mapping of fragment IDs to their corresponding expression IDs.
|
|
1742
1744
|
*
|
|
1743
|
-
* @
|
|
1745
|
+
* @remarks
|
|
1746
|
+
* This method is used to add a mapping of fragment IDs to their corresponding expression IDs.
|
|
1747
|
+
* It ensures that the bounding box calculations are accurate and up-to-date by updating the internal minimum and maximum vectors.
|
|
1748
|
+
*
|
|
1749
|
+
* @example
|
|
1750
|
+
* '''typescript
|
|
1751
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
1752
|
+
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
1753
|
+
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
1754
|
+
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
1755
|
+
* };
|
|
1756
|
+
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
1757
|
+
* '''
|
|
1744
1758
|
*/
|
|
1745
|
-
|
|
1759
|
+
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
1760
|
+
private static getFragmentBounds;
|
|
1761
|
+
}
|
|
1762
|
+
import * as WEBIFC from "web-ifc";
|
|
1763
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1764
|
+
import { Component, Components } from "../../core";
|
|
1765
|
+
/**
|
|
1766
|
+
* 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).
|
|
1767
|
+
*/
|
|
1768
|
+
export declare class IfcJsonExporter extends Component {
|
|
1746
1769
|
/**
|
|
1747
|
-
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1751
|
-
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1752
|
-
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1753
|
-
*
|
|
1754
|
-
* @returns The event that will be triggered when the attribute's value changes.
|
|
1755
|
-
*
|
|
1756
|
-
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
1757
|
-
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
1758
|
-
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1770
|
+
* A unique identifier for the component.
|
|
1771
|
+
* This UUID is used to register the component within the Components system.
|
|
1759
1772
|
*/
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1773
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1774
|
+
/** {@link Component.enabled} */
|
|
1775
|
+
enabled: boolean;
|
|
1776
|
+
constructor(components: Components);
|
|
1777
|
+
/**
|
|
1778
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1779
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1780
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1781
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1782
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1783
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1784
|
+
*/
|
|
1785
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1766
1786
|
}
|
|
1767
1787
|
import * as WEBIFC from "web-ifc";
|
|
1768
|
-
import
|
|
1769
|
-
import {
|
|
1770
|
-
import {
|
|
1788
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1789
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
1790
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1791
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1771
1792
|
/**
|
|
1772
|
-
*
|
|
1793
|
+
* 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).
|
|
1773
1794
|
*/
|
|
1774
|
-
export declare class
|
|
1795
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1775
1796
|
/**
|
|
1776
1797
|
* A unique identifier for the component.
|
|
1777
1798
|
* This UUID is used to register the component within the Components system.
|
|
1778
1799
|
*/
|
|
1779
|
-
static readonly uuid: "
|
|
1800
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1780
1801
|
/** {@link Disposable.onDisposed} */
|
|
1781
1802
|
readonly onDisposed: Event<string>;
|
|
1782
1803
|
/**
|
|
1783
|
-
*
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
*
|
|
1788
|
-
|
|
1789
|
-
readonly onSetup: Event<void>;
|
|
1790
|
-
/**
|
|
1791
|
-
* The settings for the IfcLoader.
|
|
1792
|
-
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1804
|
+
* Event triggered when relations for a model have been indexed.
|
|
1805
|
+
* This event provides the model's UUID and the relations map generated for that model.
|
|
1806
|
+
*
|
|
1807
|
+
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
1808
|
+
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
1809
|
+
* The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
1793
1810
|
*/
|
|
1794
|
-
|
|
1811
|
+
readonly onRelationsIndexed: Event<{
|
|
1812
|
+
modelID: string;
|
|
1813
|
+
relationsMap: RelationsMap;
|
|
1814
|
+
}>;
|
|
1795
1815
|
/**
|
|
1796
|
-
*
|
|
1816
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
1817
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
1818
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
1819
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
1820
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
1821
|
+
* of entity relationships within a model.
|
|
1797
1822
|
*/
|
|
1798
|
-
|
|
1823
|
+
readonly relationMaps: ModelsRelationMap;
|
|
1799
1824
|
/** {@link Component.enabled} */
|
|
1800
1825
|
enabled: boolean;
|
|
1801
|
-
private
|
|
1802
|
-
private
|
|
1803
|
-
private
|
|
1804
|
-
private _fragmentInstances;
|
|
1805
|
-
private _civil;
|
|
1806
|
-
private _visitedFragments;
|
|
1807
|
-
private _materialT;
|
|
1826
|
+
private _relToAttributesMap;
|
|
1827
|
+
private _inverseAttributes;
|
|
1828
|
+
private _ifcRels;
|
|
1808
1829
|
constructor(components: Components);
|
|
1809
|
-
|
|
1810
|
-
|
|
1830
|
+
private onFragmentsDisposed;
|
|
1831
|
+
private indexRelations;
|
|
1832
|
+
private getAttributeIndex;
|
|
1811
1833
|
/**
|
|
1812
|
-
*
|
|
1813
|
-
*
|
|
1814
|
-
* @param config - Optional configuration settings for the IfcLoader.
|
|
1815
|
-
* If not provided, the existing settings will be used.
|
|
1816
|
-
*
|
|
1817
|
-
* @returns A Promise that resolves when the setup process is completed.
|
|
1834
|
+
* Adds a relation map to the model's relations map.
|
|
1818
1835
|
*
|
|
1819
|
-
* @
|
|
1820
|
-
*
|
|
1821
|
-
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1836
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
1837
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
1822
1838
|
*
|
|
1823
|
-
* @
|
|
1824
|
-
* '''typescript
|
|
1825
|
-
* const ifcLoader = new IfcLoader(components);
|
|
1826
|
-
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1827
|
-
* '''
|
|
1839
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
1828
1840
|
*/
|
|
1829
|
-
|
|
1841
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
1830
1842
|
/**
|
|
1831
|
-
*
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1834
|
-
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1843
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
1844
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
1845
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
1835
1846
|
*
|
|
1836
|
-
*
|
|
1847
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
1848
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
1849
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
1850
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
1851
|
+
* of entities that are related through that attribute.
|
|
1837
1852
|
*
|
|
1838
|
-
* @
|
|
1839
|
-
*
|
|
1840
|
-
*
|
|
1841
|
-
*
|
|
1842
|
-
* '''
|
|
1853
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
1854
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
1855
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
1856
|
+
* @throws An error if the model does not have properties loaded.
|
|
1843
1857
|
*/
|
|
1844
|
-
|
|
1858
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
1845
1859
|
/**
|
|
1846
|
-
*
|
|
1847
|
-
*
|
|
1848
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1860
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
1849
1861
|
*
|
|
1850
|
-
* @
|
|
1862
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
1863
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
1864
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
1865
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
1866
|
+
*/
|
|
1867
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
1868
|
+
/**
|
|
1869
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
1870
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
1871
|
+
* returning the IDs of related entities if a match is found.
|
|
1851
1872
|
*
|
|
1852
|
-
* @
|
|
1853
|
-
*
|
|
1854
|
-
*
|
|
1873
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
1874
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
1875
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
1876
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
1877
|
+
* or the specified relation name is not indexed.
|
|
1878
|
+
*/
|
|
1879
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
1880
|
+
/**
|
|
1881
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
1882
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
1883
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1884
|
+
* The resulting object is then serialized into a JSON string.
|
|
1855
1885
|
*
|
|
1856
|
-
* @
|
|
1857
|
-
*
|
|
1858
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1859
|
-
* await ifcLoader.readIfcFile(ifcData);
|
|
1860
|
-
* '''
|
|
1886
|
+
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
1887
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
1861
1888
|
*/
|
|
1862
|
-
|
|
1889
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
1863
1890
|
/**
|
|
1864
|
-
*
|
|
1865
|
-
*
|
|
1891
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
1892
|
+
* This method iterates through the relations indexed for the given model,
|
|
1893
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
1894
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1895
|
+
* The resulting object is then serialized into a JSON string.
|
|
1866
1896
|
*
|
|
1867
|
-
* @
|
|
1868
|
-
*
|
|
1897
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
1898
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
1899
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
1900
|
+
*/
|
|
1901
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
1902
|
+
/**
|
|
1903
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
1904
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
1905
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
1906
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
1907
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
1869
1908
|
*
|
|
1870
|
-
* @
|
|
1871
|
-
*
|
|
1872
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
1873
|
-
* ifcLoader.cleanUp();
|
|
1874
|
-
* '''
|
|
1909
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
1910
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
1875
1911
|
*/
|
|
1876
|
-
|
|
1877
|
-
private getAllGeometries;
|
|
1878
|
-
private getMesh;
|
|
1879
|
-
private getGeometry;
|
|
1880
|
-
private autoSetWasm;
|
|
1881
|
-
}
|
|
1882
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1883
|
-
import { Components, Component } from "../../core";
|
|
1884
|
-
/**
|
|
1885
|
-
* 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).
|
|
1886
|
-
*/
|
|
1887
|
-
export declare class Hider extends Component {
|
|
1912
|
+
serializeAllRelations(): string;
|
|
1888
1913
|
/**
|
|
1889
|
-
*
|
|
1890
|
-
* This
|
|
1914
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
1915
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
1916
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
1917
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
1918
|
+
* of express IDs of entities related through that relation type.
|
|
1919
|
+
*
|
|
1920
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
1921
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
1922
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
1923
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
1891
1924
|
*/
|
|
1892
|
-
|
|
1893
|
-
/** {@link
|
|
1894
|
-
|
|
1895
|
-
constructor(components: Components);
|
|
1925
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
1926
|
+
/** {@link Disposable.dispose} */
|
|
1927
|
+
dispose(): void;
|
|
1896
1928
|
/**
|
|
1897
|
-
*
|
|
1898
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1899
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1929
|
+
* Adds relations between an entity and other entities in a BIM model.
|
|
1900
1930
|
*
|
|
1901
|
-
* @param
|
|
1902
|
-
* @param
|
|
1903
|
-
*
|
|
1931
|
+
* @param model - The BIM model to which the relations will be added.
|
|
1932
|
+
* @param expressID - The expressID of the entity within the model.
|
|
1933
|
+
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
1934
|
+
* @param relIDs - The expressIDs of the related entities within the model.
|
|
1904
1935
|
*
|
|
1905
|
-
* @
|
|
1936
|
+
* @throws An error if the relation name is not a valid relation name.
|
|
1906
1937
|
*/
|
|
1907
|
-
|
|
1938
|
+
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
1908
1939
|
/**
|
|
1909
|
-
*
|
|
1910
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1940
|
+
* Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
|
|
1911
1941
|
*
|
|
1912
|
-
* @param
|
|
1913
|
-
*
|
|
1942
|
+
* @param model The BIM model whose children to get.
|
|
1943
|
+
* @param expressID The expressID of the item whose children to get.
|
|
1944
|
+
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
1914
1945
|
*
|
|
1915
|
-
* @returns
|
|
1946
|
+
* @returns A 'Set' with the expressIDs of the found items.
|
|
1916
1947
|
*/
|
|
1917
|
-
|
|
1918
|
-
private updateCulledVisibility;
|
|
1948
|
+
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
1919
1949
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1950
|
+
import * as WEBIFC from "web-ifc";
|
|
1951
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1952
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1953
|
+
/**
|
|
1954
|
+
* Types for boolean properties in IFC schema.
|
|
1955
|
+
*/
|
|
1956
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1957
|
+
/**
|
|
1958
|
+
* Types for string properties in IFC schema.
|
|
1959
|
+
*/
|
|
1960
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1961
|
+
/**
|
|
1962
|
+
* Types for numeric properties in IFC schema.
|
|
1963
|
+
*/
|
|
1964
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1965
|
+
/**
|
|
1966
|
+
* 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.
|
|
1967
|
+
*/
|
|
1968
|
+
export interface ChangeMap {
|
|
1969
|
+
[modelID: string]: Set<number>;
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* 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.
|
|
1973
|
+
*/
|
|
1974
|
+
export interface AttributeListener {
|
|
1975
|
+
[modelID: string]: {
|
|
1976
|
+
[expressID: number]: {
|
|
1977
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1978
|
+
};
|
|
1979
|
+
};
|
|
1925
1980
|
}
|
|
1926
|
-
import * as THREE from "three";
|
|
1927
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1928
1981
|
/**
|
|
1929
|
-
*
|
|
1982
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1930
1983
|
*/
|
|
1931
|
-
export
|
|
1984
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1932
1985
|
/**
|
|
1933
|
-
*
|
|
1986
|
+
* A unique identifier for the component.
|
|
1987
|
+
* This UUID is used to register the component within the Components system.
|
|
1934
1988
|
*/
|
|
1935
|
-
|
|
1989
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1990
|
+
/** {@link Disposable.onDisposed} */
|
|
1991
|
+
readonly onDisposed: Event<string>;
|
|
1936
1992
|
/**
|
|
1937
|
-
*
|
|
1993
|
+
* Event triggered when a file is requested for export.
|
|
1938
1994
|
*/
|
|
1939
|
-
|
|
1995
|
+
readonly onRequestFile: Event<unknown>;
|
|
1940
1996
|
/**
|
|
1941
|
-
*
|
|
1997
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1942
1998
|
*/
|
|
1943
|
-
|
|
1944
|
-
}
|
|
1945
|
-
/**
|
|
1946
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1947
|
-
*/
|
|
1948
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
1949
|
-
/** {@link Disposable.onDisposed} */
|
|
1950
|
-
readonly onDisposed: Event<unknown>;
|
|
1999
|
+
ifcToExport: ArrayBuffer | null;
|
|
1951
2000
|
/**
|
|
1952
|
-
*
|
|
1953
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
2001
|
+
* Event triggered when an element is added to a Pset.
|
|
1954
2002
|
*/
|
|
1955
|
-
readonly
|
|
2003
|
+
readonly onElementToPset: Event<{
|
|
2004
|
+
model: FragmentsGroup;
|
|
2005
|
+
psetID: number;
|
|
2006
|
+
elementID: number;
|
|
2007
|
+
}>;
|
|
1956
2008
|
/**
|
|
1957
|
-
*
|
|
1958
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
2009
|
+
* Event triggered when a property is added to a Pset.
|
|
1959
2010
|
*/
|
|
1960
|
-
readonly
|
|
2011
|
+
readonly onPropToPset: Event<{
|
|
2012
|
+
model: FragmentsGroup;
|
|
2013
|
+
psetID: number;
|
|
2014
|
+
propID: number;
|
|
2015
|
+
}>;
|
|
1961
2016
|
/**
|
|
1962
|
-
*
|
|
2017
|
+
* Event triggered when a Pset is removed.
|
|
1963
2018
|
*/
|
|
1964
|
-
readonly
|
|
2019
|
+
readonly onPsetRemoved: Event<{
|
|
2020
|
+
model: FragmentsGroup;
|
|
2021
|
+
psetID: number;
|
|
2022
|
+
}>;
|
|
1965
2023
|
/**
|
|
1966
|
-
*
|
|
2024
|
+
* Event triggered when data in the model changes.
|
|
1967
2025
|
*/
|
|
1968
|
-
|
|
2026
|
+
readonly onDataChanged: Event<{
|
|
2027
|
+
model: FragmentsGroup;
|
|
2028
|
+
expressID: number;
|
|
2029
|
+
}>;
|
|
1969
2030
|
/**
|
|
1970
|
-
*
|
|
1971
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
1972
|
-
* If this value is null, all vertices are considered valid.
|
|
2031
|
+
* Configuration for the WebAssembly module.
|
|
1973
2032
|
*/
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2033
|
+
wasm: {
|
|
2034
|
+
path: string;
|
|
2035
|
+
absolute: boolean;
|
|
2036
|
+
};
|
|
2037
|
+
/** {@link Component.enabled} */
|
|
2038
|
+
enabled: boolean;
|
|
1978
2039
|
/**
|
|
1979
|
-
*
|
|
1980
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1981
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1982
|
-
*
|
|
1983
|
-
* @param value - The new enabled state.
|
|
2040
|
+
* Map of attribute listeners.
|
|
1984
2041
|
*/
|
|
1985
|
-
|
|
2042
|
+
attributeListeners: AttributeListener;
|
|
1986
2043
|
/**
|
|
1987
|
-
*
|
|
1988
|
-
*
|
|
1989
|
-
* @returns The current enabled state.
|
|
2044
|
+
* The currently selected model.
|
|
1990
2045
|
*/
|
|
1991
|
-
|
|
2046
|
+
selectedModel?: FragmentsGroup;
|
|
1992
2047
|
/**
|
|
1993
|
-
*
|
|
1994
|
-
*
|
|
1995
|
-
* @param value - A Partial object containing the configuration properties to update.
|
|
1996
|
-
* The properties not provided in the value object will retain their current values.
|
|
1997
|
-
*
|
|
1998
|
-
* @example
|
|
1999
|
-
* '''typescript
|
|
2000
|
-
* vertexPicker.config = {
|
|
2001
|
-
* snapDistance: 0.5,
|
|
2002
|
-
* showOnlyVertex: true,
|
|
2003
|
-
* };
|
|
2004
|
-
* '''
|
|
2048
|
+
* Map of changed entities in the model.
|
|
2005
2049
|
*/
|
|
2006
|
-
|
|
2050
|
+
changeMap: ChangeMap;
|
|
2051
|
+
constructor(components: Components);
|
|
2052
|
+
/** {@link Disposable.dispose} */
|
|
2053
|
+
dispose(): void;
|
|
2007
2054
|
/**
|
|
2008
|
-
*
|
|
2009
|
-
*
|
|
2010
|
-
* @returns A copy of the current VertexPickerConfig object.
|
|
2055
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
2011
2056
|
*
|
|
2012
|
-
* @
|
|
2013
|
-
*
|
|
2014
|
-
*
|
|
2015
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
2016
|
-
* '''
|
|
2057
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
2058
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2059
|
+
* @returns The IFC schema associated with the given model.
|
|
2017
2060
|
*/
|
|
2018
|
-
|
|
2019
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
2020
|
-
/** {@link Disposable.dispose} */
|
|
2021
|
-
dispose(): void;
|
|
2061
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
2022
2062
|
/**
|
|
2023
|
-
*
|
|
2063
|
+
* Method to set properties data in the model.
|
|
2024
2064
|
*
|
|
2025
|
-
* @param
|
|
2065
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
2066
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
2067
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
2068
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
2026
2069
|
*
|
|
2027
|
-
* @returns
|
|
2070
|
+
* @returns A promise that resolves when all the properties have been set.
|
|
2028
2071
|
*
|
|
2029
|
-
* @
|
|
2030
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
2031
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
2032
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
2033
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
2034
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
2035
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
2072
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
2036
2073
|
*/
|
|
2037
|
-
|
|
2038
|
-
private getClosestVertex;
|
|
2039
|
-
private getVertices;
|
|
2040
|
-
private getVertex;
|
|
2041
|
-
}
|
|
2042
|
-
import * as THREE from "three";
|
|
2043
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2044
|
-
import { Component, Components } from "../../core";
|
|
2045
|
-
/**
|
|
2046
|
-
* Represents an edge measurement result.
|
|
2047
|
-
*/
|
|
2048
|
-
export interface MeasureEdge {
|
|
2074
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
2049
2075
|
/**
|
|
2050
|
-
*
|
|
2076
|
+
* Creates a new Property Set (Pset) in the given model.
|
|
2077
|
+
*
|
|
2078
|
+
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
2079
|
+
* @param name - The name of the Pset.
|
|
2080
|
+
* @param description - (Optional) The description of the Pset.
|
|
2081
|
+
*
|
|
2082
|
+
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
2083
|
+
*
|
|
2084
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2085
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
2051
2086
|
*/
|
|
2052
|
-
|
|
2087
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
2088
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
2089
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
2090
|
+
}>;
|
|
2053
2091
|
/**
|
|
2054
|
-
*
|
|
2092
|
+
* Removes a Property Set (Pset) from the given model.
|
|
2093
|
+
*
|
|
2094
|
+
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
2095
|
+
* @param psetID - The express IDs of the Psets to be removed.
|
|
2096
|
+
*
|
|
2097
|
+
* @returns A promise that resolves when all the Psets have been removed.
|
|
2098
|
+
*
|
|
2099
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
2100
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
2101
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
2055
2102
|
*/
|
|
2056
|
-
|
|
2057
|
-
}
|
|
2058
|
-
/**
|
|
2059
|
-
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
2060
|
-
*/
|
|
2061
|
-
export declare class MeasurementUtils extends Component {
|
|
2103
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
2062
2104
|
/**
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
2105
|
+
* Creates a new single-value property of type string in the given model.
|
|
2106
|
+
*
|
|
2107
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
2108
|
+
* @param type - The type of the property value. Must be a string property type.
|
|
2109
|
+
* @param name - The name of the property.
|
|
2110
|
+
* @param value - The value of the property. Must be a string.
|
|
2111
|
+
*
|
|
2112
|
+
* @returns The newly created single-value property.
|
|
2113
|
+
*
|
|
2114
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2115
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
2065
2116
|
*/
|
|
2066
|
-
|
|
2067
|
-
/** {@link Component.enabled} */
|
|
2068
|
-
enabled: boolean;
|
|
2069
|
-
constructor(components: Components);
|
|
2117
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
2070
2118
|
/**
|
|
2071
|
-
*
|
|
2119
|
+
* Creates a new single-value property of type numeric in the given model.
|
|
2072
2120
|
*
|
|
2073
|
-
* @param
|
|
2074
|
-
* @param
|
|
2075
|
-
* @param
|
|
2076
|
-
* @param
|
|
2077
|
-
*
|
|
2121
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
2122
|
+
* @param type - The type of the property value. Must be a numeric property type.
|
|
2123
|
+
* @param name - The name of the property.
|
|
2124
|
+
* @param value - The value of the property. Must be a number.
|
|
2125
|
+
*
|
|
2126
|
+
* @returns The newly created single-value property.
|
|
2127
|
+
*
|
|
2128
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2129
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
2078
2130
|
*/
|
|
2079
|
-
|
|
2131
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
2080
2132
|
/**
|
|
2081
|
-
*
|
|
2082
|
-
* It also returns the edges of the found face and their indices.
|
|
2133
|
+
* Creates a new single-value property of type boolean in the given model.
|
|
2083
2134
|
*
|
|
2084
|
-
* @param
|
|
2085
|
-
* @param
|
|
2086
|
-
* @param
|
|
2087
|
-
* @
|
|
2135
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
2136
|
+
* @param type - The type of the property value. Must be a boolean property type.
|
|
2137
|
+
* @param name - The name of the property.
|
|
2138
|
+
* @param value - The value of the property. Must be a boolean.
|
|
2139
|
+
*
|
|
2140
|
+
* @returns The newly created single-value property.
|
|
2141
|
+
*
|
|
2142
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
2143
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
2088
2144
|
*/
|
|
2089
|
-
|
|
2090
|
-
edges: MeasureEdge[];
|
|
2091
|
-
indices: Set<number>;
|
|
2092
|
-
} | null;
|
|
2145
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
2093
2146
|
/**
|
|
2094
|
-
*
|
|
2095
|
-
* It also applies instance transformation if provided.
|
|
2147
|
+
* Removes a property from a Property Set (Pset) in the given model.
|
|
2096
2148
|
*
|
|
2097
|
-
* @param
|
|
2098
|
-
* @param
|
|
2099
|
-
* @param
|
|
2100
|
-
*
|
|
2101
|
-
* @
|
|
2149
|
+
* @param model - The FragmentsGroup model from which to remove the property.
|
|
2150
|
+
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
2151
|
+
* @param propID - The express ID of the property to be removed.
|
|
2152
|
+
*
|
|
2153
|
+
* @returns A promise that resolves when the property has been removed.
|
|
2154
|
+
*
|
|
2155
|
+
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
2156
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
2102
2157
|
*/
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
p2: THREE.Vector3;
|
|
2106
|
-
p3: THREE.Vector3;
|
|
2107
|
-
faceNormal: THREE.Vector3;
|
|
2108
|
-
};
|
|
2158
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
2159
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
2109
2160
|
/**
|
|
2110
|
-
*
|
|
2111
|
-
* This is used to ensure numerical precision in edge detection.
|
|
2161
|
+
* Adds elements to a Property Set (Pset) in the given model.
|
|
2112
2162
|
*
|
|
2113
|
-
* @param
|
|
2114
|
-
* @
|
|
2163
|
+
* @param model - The FragmentsGroup model in which to add the elements.
|
|
2164
|
+
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
2165
|
+
* @param elementID - The express IDs of the elements to be added.
|
|
2166
|
+
*
|
|
2167
|
+
* @returns A promise that resolves when all the elements have been added.
|
|
2168
|
+
*
|
|
2169
|
+
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
2170
|
+
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
2171
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
2115
2172
|
*/
|
|
2116
|
-
|
|
2173
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
2117
2174
|
/**
|
|
2118
|
-
*
|
|
2175
|
+
* Saves the changes made to the model to a new IFC file.
|
|
2119
2176
|
*
|
|
2120
|
-
* @param
|
|
2121
|
-
* @
|
|
2177
|
+
* @param model - The FragmentsGroup model from which to save the changes.
|
|
2178
|
+
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
2122
2179
|
*
|
|
2123
|
-
* @
|
|
2124
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
2125
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
2180
|
+
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
2126
2181
|
*
|
|
2127
|
-
* @throws Will throw an error if
|
|
2128
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
2182
|
+
* @throws Will throw an error if any issues occur during the saving process.
|
|
2129
2183
|
*/
|
|
2130
|
-
|
|
2184
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
2131
2185
|
/**
|
|
2132
|
-
*
|
|
2186
|
+
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
2187
|
+
* The listener will trigger an event whenever the attribute's value changes.
|
|
2133
2188
|
*
|
|
2134
|
-
* @param
|
|
2135
|
-
* @
|
|
2189
|
+
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
2190
|
+
* @param expressID - The express ID of the entity for which to set the listener.
|
|
2191
|
+
* @param attributeName - The name of the attribute for which to set the listener.
|
|
2136
2192
|
*
|
|
2137
|
-
* @
|
|
2138
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
2139
|
-
* and its bounding sphere.
|
|
2193
|
+
* @returns The event that will be triggered when the attribute's value changes.
|
|
2140
2194
|
*
|
|
2195
|
+
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
2196
|
+
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
2197
|
+
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
2141
2198
|
*/
|
|
2142
|
-
|
|
2143
|
-
private
|
|
2144
|
-
private
|
|
2145
|
-
private
|
|
2199
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
2200
|
+
private increaseMaxID;
|
|
2201
|
+
private newGUID;
|
|
2202
|
+
private getOwnerHistory;
|
|
2203
|
+
private registerChange;
|
|
2204
|
+
private newSingleProperty;
|
|
2205
|
+
}
|
|
2206
|
+
import * as WEBIFC from "web-ifc";
|
|
2207
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2208
|
+
export declare class SpatialStructure {
|
|
2209
|
+
itemsByFloor: IfcItemsCategories;
|
|
2210
|
+
private _units;
|
|
2211
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2212
|
+
cleanUp(): void;
|
|
2146
2213
|
}
|
|
2147
2214
|
import * as THREE from "three";
|
|
2148
2215
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
@@ -2238,18 +2305,6 @@ import * as WEBIFC from "web-ifc";
|
|
|
2238
2305
|
export declare class SpatialIdsFinder {
|
|
2239
2306
|
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2240
2307
|
}
|
|
2241
|
-
/**
|
|
2242
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2243
|
-
*/
|
|
2244
|
-
export declare const GeometryTypes: Set<number>;
|
|
2245
|
-
import * as WEBIFC from "web-ifc";
|
|
2246
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
2247
|
-
export declare class SpatialStructure {
|
|
2248
|
-
itemsByFloor: IfcItemsCategories;
|
|
2249
|
-
private _units;
|
|
2250
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2251
|
-
cleanUp(): void;
|
|
2252
|
-
}
|
|
2253
2308
|
import * as WEBIFC from "web-ifc";
|
|
2254
2309
|
/** Configuration of the IFC-fragment conversion. */
|
|
2255
2310
|
export declare class IfcFragmentSettings {
|
|
@@ -2293,13 +2348,6 @@ export declare class IfcFragmentSettings {
|
|
|
2293
2348
|
*/
|
|
2294
2349
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2295
2350
|
}
|
|
2296
|
-
import * as WEBIFC from "web-ifc";
|
|
2297
|
-
export interface IfcItemsCategories {
|
|
2298
|
-
[itemID: number]: number;
|
|
2299
|
-
}
|
|
2300
|
-
export declare class IfcCategories {
|
|
2301
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2302
|
-
}
|
|
2303
2351
|
/**
|
|
2304
2352
|
* 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.
|
|
2305
2353
|
*
|
|
@@ -2311,6 +2359,13 @@ export declare class IfcCategories {
|
|
|
2311
2359
|
export declare const IfcElements: {
|
|
2312
2360
|
[key: number]: string;
|
|
2313
2361
|
};
|
|
2362
|
+
import * as WEBIFC from "web-ifc";
|
|
2363
|
+
export interface IfcItemsCategories {
|
|
2364
|
+
[itemID: number]: number;
|
|
2365
|
+
}
|
|
2366
|
+
export declare class IfcCategories {
|
|
2367
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2368
|
+
}
|
|
2314
2369
|
/**
|
|
2315
2370
|
* 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.
|
|
2316
2371
|
*/
|
|
@@ -2343,79 +2398,71 @@ export declare class IfcPropertiesUtils {
|
|
|
2343
2398
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2344
2399
|
}
|
|
2345
2400
|
import * as THREE from "three";
|
|
2401
|
+
import { Event, World } from "../../Types";
|
|
2346
2402
|
import { Components } from "../../Components";
|
|
2347
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2348
|
-
import { Mouse } from "./mouse";
|
|
2349
2403
|
/**
|
|
2350
|
-
* A
|
|
2404
|
+
* A base renderer to determine visibility on screen.
|
|
2351
2405
|
*/
|
|
2352
|
-
export declare class
|
|
2353
|
-
/** {@link Component.enabled} */
|
|
2354
|
-
enabled: boolean;
|
|
2355
|
-
/** The components instance to which this Raycaster belongs. */
|
|
2356
|
-
components: Components;
|
|
2406
|
+
export declare class DistanceRenderer {
|
|
2357
2407
|
/** {@link Disposable.onDisposed} */
|
|
2358
|
-
readonly onDisposed: Event<
|
|
2359
|
-
/** The position of the mouse in the screen. */
|
|
2360
|
-
readonly mouse: Mouse;
|
|
2408
|
+
readonly onDisposed: Event<string>;
|
|
2361
2409
|
/**
|
|
2362
|
-
*
|
|
2363
|
-
*
|
|
2410
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
2411
|
+
* meshes that are currently visible, and the ones that were visible
|
|
2412
|
+
* just before but not anymore.
|
|
2364
2413
|
*/
|
|
2365
|
-
readonly
|
|
2414
|
+
readonly onDistanceComputed: Event<number>;
|
|
2366
2415
|
/**
|
|
2367
|
-
*
|
|
2368
|
-
* This is used to access the camera and meshes.
|
|
2416
|
+
* Objects that won't be taken into account in the distance check.
|
|
2369
2417
|
*/
|
|
2370
|
-
|
|
2371
|
-
constructor(components: Components, world: World);
|
|
2372
|
-
/** {@link Disposable.dispose} */
|
|
2373
|
-
dispose(): void;
|
|
2418
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
2374
2419
|
/**
|
|
2375
|
-
*
|
|
2376
|
-
* the first item found. This also takes into account the clipping planes
|
|
2377
|
-
* used by the renderer.
|
|
2378
|
-
*
|
|
2379
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2380
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
2381
|
-
* {@link Components.meshes}.
|
|
2420
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2382
2421
|
*/
|
|
2383
|
-
|
|
2422
|
+
enabled: boolean;
|
|
2384
2423
|
/**
|
|
2385
|
-
*
|
|
2386
|
-
*
|
|
2387
|
-
*
|
|
2388
|
-
* @param origin - The origin of the ray.
|
|
2389
|
-
* @param direction - The direction of the ray.
|
|
2390
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2391
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2424
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
2425
|
+
* for debugging purposes.
|
|
2392
2426
|
*/
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
}
|
|
2397
|
-
import * as THREE from "three";
|
|
2398
|
-
import { Disposable, Event } from "../../Types";
|
|
2399
|
-
/**
|
|
2400
|
-
* 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.
|
|
2401
|
-
*/
|
|
2402
|
-
export declare class Mouse implements Disposable {
|
|
2403
|
-
dom: HTMLCanvasElement;
|
|
2404
|
-
private _event?;
|
|
2405
|
-
private _position;
|
|
2406
|
-
/** {@link Disposable.onDisposed} */
|
|
2407
|
-
readonly onDisposed: Event<unknown>;
|
|
2408
|
-
constructor(dom: HTMLCanvasElement);
|
|
2427
|
+
renderDebugFrame: boolean;
|
|
2428
|
+
/** The components instance to which this renderer belongs. */
|
|
2429
|
+
components: Components;
|
|
2409
2430
|
/**
|
|
2410
|
-
* The
|
|
2431
|
+
* The scene where the distance is computed.
|
|
2411
2432
|
*/
|
|
2412
|
-
|
|
2433
|
+
scene: THREE.Scene;
|
|
2434
|
+
/**
|
|
2435
|
+
* The camera used to compute the distance.
|
|
2436
|
+
*/
|
|
2437
|
+
camera: THREE.OrthographicCamera;
|
|
2438
|
+
/**
|
|
2439
|
+
* The material used to compute the distance.
|
|
2440
|
+
*/
|
|
2441
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
2442
|
+
/** The world instance to which this renderer belongs. */
|
|
2443
|
+
readonly world: World;
|
|
2444
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
2445
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
2446
|
+
protected readonly worker: Worker;
|
|
2447
|
+
private _width;
|
|
2448
|
+
private _height;
|
|
2449
|
+
private readonly _postQuad;
|
|
2450
|
+
private readonly tempRT;
|
|
2451
|
+
private readonly resultRT;
|
|
2452
|
+
private readonly bufferSize;
|
|
2453
|
+
private readonly _buffer;
|
|
2454
|
+
protected _isWorkerBusy: boolean;
|
|
2455
|
+
constructor(components: Components, world: World);
|
|
2413
2456
|
/** {@link Disposable.dispose} */
|
|
2414
2457
|
dispose(): void;
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2458
|
+
/**
|
|
2459
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2460
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
2461
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2462
|
+
* not true.
|
|
2463
|
+
*/
|
|
2464
|
+
compute: () => Promise<void>;
|
|
2465
|
+
private handleWorkerMessage;
|
|
2419
2466
|
}
|
|
2420
2467
|
import * as THREE from "three";
|
|
2421
2468
|
import { Components } from "../../Components";
|
|
@@ -2509,6 +2556,10 @@ export declare class CullerRenderer {
|
|
|
2509
2556
|
private applySettings;
|
|
2510
2557
|
}
|
|
2511
2558
|
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2559
|
+
/**
|
|
2560
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2561
|
+
*/
|
|
2562
|
+
export declare const GeometryTypes: Set<number>;
|
|
2512
2563
|
import * as THREE from "three";
|
|
2513
2564
|
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2514
2565
|
import { Components } from "../../Components";
|
|
@@ -2574,6 +2625,65 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
2574
2625
|
private getAvailableMaterial;
|
|
2575
2626
|
}
|
|
2576
2627
|
import * as THREE from "three";
|
|
2628
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
2629
|
+
import { Components } from "../../Components";
|
|
2630
|
+
/**
|
|
2631
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2632
|
+
*/
|
|
2633
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
2634
|
+
/**
|
|
2635
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2636
|
+
* Default is 'true'.
|
|
2637
|
+
*/
|
|
2638
|
+
enabled: boolean;
|
|
2639
|
+
/**
|
|
2640
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2641
|
+
*/
|
|
2642
|
+
container: HTMLElement;
|
|
2643
|
+
/**
|
|
2644
|
+
* The THREE.js WebGLRenderer instance.
|
|
2645
|
+
*/
|
|
2646
|
+
three: THREE.WebGLRenderer;
|
|
2647
|
+
protected _canvas: HTMLCanvasElement;
|
|
2648
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2649
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
2650
|
+
protected onContainerUpdated: Event<unknown>;
|
|
2651
|
+
private _resizing;
|
|
2652
|
+
/**
|
|
2653
|
+
* Constructor for the SimpleRenderer class.
|
|
2654
|
+
*
|
|
2655
|
+
* @param components - The components instance.
|
|
2656
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2657
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2658
|
+
*/
|
|
2659
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2660
|
+
/** {@link Updateable.update} */
|
|
2661
|
+
update(): void;
|
|
2662
|
+
/** {@link Disposable.dispose} */
|
|
2663
|
+
dispose(): void;
|
|
2664
|
+
/** {@link Resizeable.getSize}. */
|
|
2665
|
+
getSize(): THREE.Vector2;
|
|
2666
|
+
/** {@link Resizeable.resize} */
|
|
2667
|
+
resize: (size?: THREE.Vector2) => void;
|
|
2668
|
+
/**
|
|
2669
|
+
* Sets up and manages the event listeners for the renderer.
|
|
2670
|
+
*
|
|
2671
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2672
|
+
*
|
|
2673
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2674
|
+
*/
|
|
2675
|
+
setupEvents(active: boolean): void;
|
|
2676
|
+
private resizeEvent;
|
|
2677
|
+
private setupRenderer;
|
|
2678
|
+
private onContextLost;
|
|
2679
|
+
private onContextBack;
|
|
2680
|
+
}
|
|
2681
|
+
import { InverseAttribute } from "./types";
|
|
2682
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711, {
|
|
2683
|
+
forRelating: InverseAttribute;
|
|
2684
|
+
forRelated: InverseAttribute;
|
|
2685
|
+
}>;
|
|
2686
|
+
import * as THREE from "three";
|
|
2577
2687
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2578
2688
|
/**
|
|
2579
2689
|
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
@@ -2653,65 +2763,6 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
2653
2763
|
dispose(disposeResources?: boolean): void;
|
|
2654
2764
|
}
|
|
2655
2765
|
import * as THREE from "three";
|
|
2656
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
2657
|
-
import { Components } from "../../Components";
|
|
2658
|
-
/**
|
|
2659
|
-
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2660
|
-
*/
|
|
2661
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
2662
|
-
/**
|
|
2663
|
-
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2664
|
-
* Default is 'true'.
|
|
2665
|
-
*/
|
|
2666
|
-
enabled: boolean;
|
|
2667
|
-
/**
|
|
2668
|
-
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2669
|
-
*/
|
|
2670
|
-
container: HTMLElement;
|
|
2671
|
-
/**
|
|
2672
|
-
* The THREE.js WebGLRenderer instance.
|
|
2673
|
-
*/
|
|
2674
|
-
three: THREE.WebGLRenderer;
|
|
2675
|
-
protected _canvas: HTMLCanvasElement;
|
|
2676
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2677
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
2678
|
-
protected onContainerUpdated: Event<unknown>;
|
|
2679
|
-
private _resizing;
|
|
2680
|
-
/**
|
|
2681
|
-
* Constructor for the SimpleRenderer class.
|
|
2682
|
-
*
|
|
2683
|
-
* @param components - The components instance.
|
|
2684
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2685
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2686
|
-
*/
|
|
2687
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2688
|
-
/** {@link Updateable.update} */
|
|
2689
|
-
update(): void;
|
|
2690
|
-
/** {@link Disposable.dispose} */
|
|
2691
|
-
dispose(): void;
|
|
2692
|
-
/** {@link Resizeable.getSize}. */
|
|
2693
|
-
getSize(): THREE.Vector2;
|
|
2694
|
-
/** {@link Resizeable.resize} */
|
|
2695
|
-
resize: (size?: THREE.Vector2) => void;
|
|
2696
|
-
/**
|
|
2697
|
-
* Sets up and manages the event listeners for the renderer.
|
|
2698
|
-
*
|
|
2699
|
-
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2700
|
-
*
|
|
2701
|
-
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2702
|
-
*/
|
|
2703
|
-
setupEvents(active: boolean): void;
|
|
2704
|
-
private resizeEvent;
|
|
2705
|
-
private setupRenderer;
|
|
2706
|
-
private onContextLost;
|
|
2707
|
-
private onContextBack;
|
|
2708
|
-
}
|
|
2709
|
-
import { InverseAttribute } from "./types";
|
|
2710
|
-
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711, {
|
|
2711
|
-
forRelating: InverseAttribute;
|
|
2712
|
-
forRelated: InverseAttribute;
|
|
2713
|
-
}>;
|
|
2714
|
-
import * as THREE from "three";
|
|
2715
2766
|
import CameraControls from "camera-controls";
|
|
2716
2767
|
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2717
2768
|
import { Components } from "../../Components";
|
|
@@ -2840,66 +2891,6 @@ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
|
2840
2891
|
/** {@link Configurable.setup} */
|
|
2841
2892
|
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2842
2893
|
}
|
|
2843
|
-
/**
|
|
2844
|
-
* 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.
|
|
2845
|
-
*/
|
|
2846
|
-
export declare class AsyncEvent<T> {
|
|
2847
|
-
/**
|
|
2848
|
-
* Add a callback to this event instance.
|
|
2849
|
-
* @param handler - the callback to be added to this event.
|
|
2850
|
-
*/
|
|
2851
|
-
add(handler: T extends void ? {
|
|
2852
|
-
(): Promise<void>;
|
|
2853
|
-
} : {
|
|
2854
|
-
(data: T): Promise<void>;
|
|
2855
|
-
}): void;
|
|
2856
|
-
/**
|
|
2857
|
-
* Removes a callback from this event instance.
|
|
2858
|
-
* @param handler - the callback to be removed from this event.
|
|
2859
|
-
*/
|
|
2860
|
-
remove(handler: T extends void ? {
|
|
2861
|
-
(): Promise<void>;
|
|
2862
|
-
} : {
|
|
2863
|
-
(data: T): Promise<void>;
|
|
2864
|
-
}): void;
|
|
2865
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2866
|
-
trigger: (data?: T) => Promise<void>;
|
|
2867
|
-
/** Gets rid of all the suscribed events. */
|
|
2868
|
-
reset(): void;
|
|
2869
|
-
private handlers;
|
|
2870
|
-
}
|
|
2871
|
-
import { Base } from "./base";
|
|
2872
|
-
/**
|
|
2873
|
-
* 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.
|
|
2874
|
-
*/
|
|
2875
|
-
export declare abstract class Component extends Base {
|
|
2876
|
-
/**
|
|
2877
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
2878
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2879
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2880
|
-
* will not be updated automatically each frame.
|
|
2881
|
-
*/
|
|
2882
|
-
abstract enabled: boolean;
|
|
2883
|
-
}
|
|
2884
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2885
|
-
import { Components } from "../../Components";
|
|
2886
|
-
/**
|
|
2887
|
-
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2888
|
-
*/
|
|
2889
|
-
export declare abstract class Base {
|
|
2890
|
-
components: Components;
|
|
2891
|
-
constructor(components: Components);
|
|
2892
|
-
/** Whether is component is {@link Disposable}. */
|
|
2893
|
-
isDisposeable: () => this is Disposable;
|
|
2894
|
-
/** Whether is component is {@link Resizeable}. */
|
|
2895
|
-
isResizeable: () => this is Resizeable;
|
|
2896
|
-
/** Whether is component is {@link Updateable}. */
|
|
2897
|
-
isUpdateable: () => this is Updateable;
|
|
2898
|
-
/** Whether is component is {@link Hideable}. */
|
|
2899
|
-
isHideable: () => this is Hideable;
|
|
2900
|
-
/** Whether is component is {@link Configurable}. */
|
|
2901
|
-
isConfigurable: () => this is Configurable<any>;
|
|
2902
|
-
}
|
|
2903
2894
|
import * as THREE from "three";
|
|
2904
2895
|
import CameraControls from "camera-controls";
|
|
2905
2896
|
import { Event } from "./event";
|
|
@@ -3008,6 +2999,66 @@ export interface CameraControllable {
|
|
|
3008
2999
|
*/
|
|
3009
3000
|
controls: CameraControls;
|
|
3010
3001
|
}
|
|
3002
|
+
/**
|
|
3003
|
+
* 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.
|
|
3004
|
+
*/
|
|
3005
|
+
export declare class AsyncEvent<T> {
|
|
3006
|
+
/**
|
|
3007
|
+
* Add a callback to this event instance.
|
|
3008
|
+
* @param handler - the callback to be added to this event.
|
|
3009
|
+
*/
|
|
3010
|
+
add(handler: T extends void ? {
|
|
3011
|
+
(): Promise<void>;
|
|
3012
|
+
} : {
|
|
3013
|
+
(data: T): Promise<void>;
|
|
3014
|
+
}): void;
|
|
3015
|
+
/**
|
|
3016
|
+
* Removes a callback from this event instance.
|
|
3017
|
+
* @param handler - the callback to be removed from this event.
|
|
3018
|
+
*/
|
|
3019
|
+
remove(handler: T extends void ? {
|
|
3020
|
+
(): Promise<void>;
|
|
3021
|
+
} : {
|
|
3022
|
+
(data: T): Promise<void>;
|
|
3023
|
+
}): void;
|
|
3024
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
3025
|
+
trigger: (data?: T) => Promise<void>;
|
|
3026
|
+
/** Gets rid of all the suscribed events. */
|
|
3027
|
+
reset(): void;
|
|
3028
|
+
private handlers;
|
|
3029
|
+
}
|
|
3030
|
+
import { Base } from "./base";
|
|
3031
|
+
/**
|
|
3032
|
+
* 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.
|
|
3033
|
+
*/
|
|
3034
|
+
export declare abstract class Component extends Base {
|
|
3035
|
+
/**
|
|
3036
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
3037
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
3038
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
3039
|
+
* will not be updated automatically each frame.
|
|
3040
|
+
*/
|
|
3041
|
+
abstract enabled: boolean;
|
|
3042
|
+
}
|
|
3043
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
3044
|
+
import { Components } from "../../Components";
|
|
3045
|
+
/**
|
|
3046
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
3047
|
+
*/
|
|
3048
|
+
export declare abstract class Base {
|
|
3049
|
+
components: Components;
|
|
3050
|
+
constructor(components: Components);
|
|
3051
|
+
/** Whether is component is {@link Disposable}. */
|
|
3052
|
+
isDisposeable: () => this is Disposable;
|
|
3053
|
+
/** Whether is component is {@link Resizeable}. */
|
|
3054
|
+
isResizeable: () => this is Resizeable;
|
|
3055
|
+
/** Whether is component is {@link Updateable}. */
|
|
3056
|
+
isUpdateable: () => this is Updateable;
|
|
3057
|
+
/** Whether is component is {@link Hideable}. */
|
|
3058
|
+
isHideable: () => this is Hideable;
|
|
3059
|
+
/** Whether is component is {@link Configurable}. */
|
|
3060
|
+
isConfigurable: () => this is Configurable<any>;
|
|
3061
|
+
}
|
|
3011
3062
|
import { Base } from "./base";
|
|
3012
3063
|
import { World } from "./world";
|
|
3013
3064
|
import { Event } from "./event";
|
|
@@ -3032,6 +3083,34 @@ export declare abstract class BaseWorldItem extends Base {
|
|
|
3032
3083
|
protected constructor(components: Components);
|
|
3033
3084
|
}
|
|
3034
3085
|
import * as THREE from "three";
|
|
3086
|
+
import CameraControls from "camera-controls";
|
|
3087
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
3088
|
+
import { CameraControllable } from "./interfaces";
|
|
3089
|
+
/**
|
|
3090
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
3091
|
+
*/
|
|
3092
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
3093
|
+
/**
|
|
3094
|
+
* Whether the camera is enabled or not.
|
|
3095
|
+
*/
|
|
3096
|
+
abstract enabled: boolean;
|
|
3097
|
+
/**
|
|
3098
|
+
* The Three.js camera instance.
|
|
3099
|
+
*/
|
|
3100
|
+
abstract three: THREE.Camera;
|
|
3101
|
+
/**
|
|
3102
|
+
* Optional CameraControls instance for controlling the camera.
|
|
3103
|
+
* This property is only available if the camera is controllable.
|
|
3104
|
+
*/
|
|
3105
|
+
abstract controls?: CameraControls;
|
|
3106
|
+
/**
|
|
3107
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
3108
|
+
*
|
|
3109
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
3110
|
+
*/
|
|
3111
|
+
hasCameraControls: () => this is CameraControllable;
|
|
3112
|
+
}
|
|
3113
|
+
import * as THREE from "three";
|
|
3035
3114
|
import { Vector2 } from "three";
|
|
3036
3115
|
import { Event } from "./event";
|
|
3037
3116
|
import { BaseWorldItem } from "./base-world-item";
|
|
@@ -3097,32 +3176,38 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
3097
3176
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
3098
3177
|
}
|
|
3099
3178
|
import * as THREE from "three";
|
|
3100
|
-
import
|
|
3101
|
-
import {
|
|
3102
|
-
import {
|
|
3179
|
+
import { BaseScene } from "./base-scene";
|
|
3180
|
+
import { BaseCamera } from "./base-camera";
|
|
3181
|
+
import { BaseRenderer } from "./base-renderer";
|
|
3182
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
3103
3183
|
/**
|
|
3104
|
-
*
|
|
3184
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
3105
3185
|
*/
|
|
3106
|
-
export
|
|
3186
|
+
export interface World extends Disposable, Updateable {
|
|
3107
3187
|
/**
|
|
3108
|
-
*
|
|
3188
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
3109
3189
|
*/
|
|
3110
|
-
|
|
3190
|
+
meshes: Set<THREE.Mesh>;
|
|
3111
3191
|
/**
|
|
3112
|
-
* The
|
|
3192
|
+
* The base scene of the world.
|
|
3113
3193
|
*/
|
|
3114
|
-
|
|
3194
|
+
scene: BaseScene;
|
|
3115
3195
|
/**
|
|
3116
|
-
*
|
|
3117
|
-
* This property is only available if the camera is controllable.
|
|
3196
|
+
* The base camera of the world.
|
|
3118
3197
|
*/
|
|
3119
|
-
|
|
3198
|
+
camera: BaseCamera;
|
|
3120
3199
|
/**
|
|
3121
|
-
*
|
|
3122
|
-
*
|
|
3123
|
-
* @returns True if the instance is controllable, false otherwise.
|
|
3200
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
3124
3201
|
*/
|
|
3125
|
-
|
|
3202
|
+
renderer: BaseRenderer | null;
|
|
3203
|
+
/**
|
|
3204
|
+
* A unique identifier for the world.
|
|
3205
|
+
*/
|
|
3206
|
+
uuid: string;
|
|
3207
|
+
/**
|
|
3208
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
3209
|
+
*/
|
|
3210
|
+
isDisposing: boolean;
|
|
3126
3211
|
}
|
|
3127
3212
|
import * as THREE from "three";
|
|
3128
3213
|
import { Disposable } from "./interfaces";
|
|
@@ -3140,43 +3225,62 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
|
|
|
3140
3225
|
* It should be implemented by subclasses.
|
|
3141
3226
|
*/
|
|
3142
3227
|
abstract three: THREE.Object3D;
|
|
3228
|
+
/** The set of directional lights managed by this scene component. */
|
|
3229
|
+
directionalLights: Map<string, THREE.DirectionalLight>;
|
|
3230
|
+
/** The set of ambient lights managed by this scene component. */
|
|
3231
|
+
ambientLights: Map<string, THREE.AmbientLight>;
|
|
3143
3232
|
protected constructor(components: Components);
|
|
3144
3233
|
/** {@link Disposable.dispose} */
|
|
3145
3234
|
dispose(): void;
|
|
3146
3235
|
}
|
|
3147
|
-
import
|
|
3148
|
-
import { BaseScene } from "./base-scene";
|
|
3149
|
-
import { BaseCamera } from "./base-camera";
|
|
3150
|
-
import { BaseRenderer } from "./base-renderer";
|
|
3151
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
3236
|
+
import { Event } from "./event";
|
|
3152
3237
|
/**
|
|
3153
|
-
*
|
|
3238
|
+
* A class that extends the built-in Set class and provides additional functionality.
|
|
3239
|
+
* It triggers events when items are added, deleted, or the set is cleared.
|
|
3240
|
+
*
|
|
3241
|
+
* @template T - The type of elements in the set.
|
|
3154
3242
|
*/
|
|
3155
|
-
export
|
|
3243
|
+
export declare class DataSet<T> extends Set<T> {
|
|
3156
3244
|
/**
|
|
3157
|
-
*
|
|
3245
|
+
* An event that is triggered when a new item is added to the set.
|
|
3158
3246
|
*/
|
|
3159
|
-
|
|
3247
|
+
readonly onItemAdded: Event<T>;
|
|
3160
3248
|
/**
|
|
3161
|
-
*
|
|
3249
|
+
* An event that is triggered when an item is deleted from the set.
|
|
3162
3250
|
*/
|
|
3163
|
-
|
|
3251
|
+
readonly onItemDeleted: Event<unknown>;
|
|
3164
3252
|
/**
|
|
3165
|
-
*
|
|
3253
|
+
* An event that is triggered when the set is cleared.
|
|
3166
3254
|
*/
|
|
3167
|
-
|
|
3255
|
+
readonly onCleared: Event<unknown>;
|
|
3168
3256
|
/**
|
|
3169
|
-
*
|
|
3257
|
+
* Constructs a new instance of the DataSet class.
|
|
3258
|
+
*
|
|
3259
|
+
* @param iterable - An optional iterable object to initialize the set with.
|
|
3170
3260
|
*/
|
|
3171
|
-
|
|
3261
|
+
constructor(iterable?: Iterable<T> | null);
|
|
3172
3262
|
/**
|
|
3173
|
-
*
|
|
3263
|
+
* Clears the set and triggers the onCleared event.
|
|
3174
3264
|
*/
|
|
3175
|
-
|
|
3265
|
+
clear(): void;
|
|
3176
3266
|
/**
|
|
3177
|
-
*
|
|
3267
|
+
* Adds a value to the set and triggers the onItemAdded event.
|
|
3268
|
+
*
|
|
3269
|
+
* @param value - The value to add to the set.
|
|
3270
|
+
* @returns - The set instance.
|
|
3178
3271
|
*/
|
|
3179
|
-
|
|
3272
|
+
add(value: T): this;
|
|
3273
|
+
/**
|
|
3274
|
+
* Deletes a value from the set and triggers the onItemDeleted event.
|
|
3275
|
+
*
|
|
3276
|
+
* @param value - The value to delete from the set.
|
|
3277
|
+
* @returns - True if the value was successfully deleted, false otherwise.
|
|
3278
|
+
*/
|
|
3279
|
+
delete(value: T): boolean;
|
|
3280
|
+
/**
|
|
3281
|
+
* Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
|
|
3282
|
+
*/
|
|
3283
|
+
dispose(): void;
|
|
3180
3284
|
}
|
|
3181
3285
|
import { Event } from "./event";
|
|
3182
3286
|
/**
|
|
@@ -3238,54 +3342,241 @@ export declare class DataMap<K, V> extends Map<K, V> {
|
|
|
3238
3342
|
*/
|
|
3239
3343
|
dispose(): void;
|
|
3240
3344
|
}
|
|
3241
|
-
import
|
|
3345
|
+
import * as THREE from "three";
|
|
3346
|
+
import { Disposable, Event } from "../../Types";
|
|
3242
3347
|
/**
|
|
3243
|
-
* A
|
|
3244
|
-
* It triggers events when items are added, deleted, or the set is cleared.
|
|
3245
|
-
*
|
|
3246
|
-
* @template T - The type of elements in the set.
|
|
3348
|
+
* 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.
|
|
3247
3349
|
*/
|
|
3248
|
-
export declare class
|
|
3350
|
+
export declare class Mouse implements Disposable {
|
|
3351
|
+
dom: HTMLCanvasElement;
|
|
3352
|
+
private _event?;
|
|
3353
|
+
private _position;
|
|
3354
|
+
/** {@link Disposable.onDisposed} */
|
|
3355
|
+
readonly onDisposed: Event<unknown>;
|
|
3356
|
+
constructor(dom: HTMLCanvasElement);
|
|
3249
3357
|
/**
|
|
3250
|
-
*
|
|
3358
|
+
* The real position of the mouse of the Three.js canvas.
|
|
3251
3359
|
*/
|
|
3252
|
-
|
|
3360
|
+
get position(): THREE.Vector2;
|
|
3361
|
+
/** {@link Disposable.dispose} */
|
|
3362
|
+
dispose(): void;
|
|
3363
|
+
private getPositionY;
|
|
3364
|
+
private getPositionX;
|
|
3365
|
+
private updateMouseInfo;
|
|
3366
|
+
private setupEvents;
|
|
3367
|
+
}
|
|
3368
|
+
import * as THREE from "three";
|
|
3369
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3370
|
+
import { Components } from "../../Components";
|
|
3371
|
+
/**
|
|
3372
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
3373
|
+
*/
|
|
3374
|
+
export interface GridConfig {
|
|
3253
3375
|
/**
|
|
3254
|
-
*
|
|
3376
|
+
* The color of the grid lines.
|
|
3255
3377
|
*/
|
|
3256
|
-
|
|
3378
|
+
color: THREE.Color;
|
|
3257
3379
|
/**
|
|
3258
|
-
*
|
|
3380
|
+
* The size of the primary grid lines.
|
|
3259
3381
|
*/
|
|
3260
|
-
|
|
3382
|
+
size1: number;
|
|
3261
3383
|
/**
|
|
3262
|
-
*
|
|
3263
|
-
*
|
|
3264
|
-
* @param iterable - An optional iterable object to initialize the set with.
|
|
3384
|
+
* The size of the secondary grid lines.
|
|
3265
3385
|
*/
|
|
3266
|
-
|
|
3386
|
+
size2: number;
|
|
3267
3387
|
/**
|
|
3268
|
-
*
|
|
3388
|
+
* The distance at which the grid lines start to fade away.
|
|
3269
3389
|
*/
|
|
3270
|
-
|
|
3390
|
+
distance: number;
|
|
3391
|
+
}
|
|
3392
|
+
/**
|
|
3393
|
+
* 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).
|
|
3394
|
+
*/
|
|
3395
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3396
|
+
/** {@link Disposable.onDisposed} */
|
|
3397
|
+
readonly onDisposed: Event<unknown>;
|
|
3398
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3399
|
+
world: World;
|
|
3400
|
+
/** The components instance to which this grid belongs. */
|
|
3401
|
+
components: Components;
|
|
3402
|
+
/** {@link Hideable.visible} */
|
|
3403
|
+
get visible(): boolean;
|
|
3404
|
+
/** {@link Hideable.visible} */
|
|
3405
|
+
set visible(visible: boolean);
|
|
3406
|
+
/** The material of the grid. */
|
|
3407
|
+
get material(): THREE.ShaderMaterial;
|
|
3271
3408
|
/**
|
|
3272
|
-
*
|
|
3409
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3410
|
+
* perspective cameras and false for orthographic cameras.
|
|
3411
|
+
*/
|
|
3412
|
+
get fade(): boolean;
|
|
3413
|
+
/**
|
|
3414
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3415
|
+
* perspective cameras and false for orthographic cameras.
|
|
3416
|
+
*/
|
|
3417
|
+
set fade(active: boolean);
|
|
3418
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3419
|
+
readonly three: THREE.Mesh;
|
|
3420
|
+
private _fade;
|
|
3421
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
3422
|
+
/** {@link Disposable.dispose} */
|
|
3423
|
+
dispose(): void;
|
|
3424
|
+
private setupEvents;
|
|
3425
|
+
private updateZoom;
|
|
3426
|
+
}
|
|
3427
|
+
import * as THREE from "three";
|
|
3428
|
+
import { Components } from "../../Components";
|
|
3429
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3430
|
+
import { Mouse } from "./mouse";
|
|
3431
|
+
/**
|
|
3432
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3433
|
+
*/
|
|
3434
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
3435
|
+
/** {@link Component.enabled} */
|
|
3436
|
+
enabled: boolean;
|
|
3437
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3438
|
+
components: Components;
|
|
3439
|
+
/** {@link Disposable.onDisposed} */
|
|
3440
|
+
readonly onDisposed: Event<unknown>;
|
|
3441
|
+
/** The position of the mouse in the screen. */
|
|
3442
|
+
readonly mouse: Mouse;
|
|
3443
|
+
/**
|
|
3444
|
+
* A reference to the Three.js Raycaster instance.
|
|
3445
|
+
* This is used for raycasting operations.
|
|
3446
|
+
*/
|
|
3447
|
+
readonly three: THREE.Raycaster;
|
|
3448
|
+
/**
|
|
3449
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3450
|
+
* This is used to access the camera and meshes.
|
|
3451
|
+
*/
|
|
3452
|
+
world: World;
|
|
3453
|
+
constructor(components: Components, world: World);
|
|
3454
|
+
/** {@link Disposable.dispose} */
|
|
3455
|
+
dispose(): void;
|
|
3456
|
+
/**
|
|
3457
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3458
|
+
* the first item found. This also takes into account the clipping planes
|
|
3459
|
+
* used by the renderer.
|
|
3273
3460
|
*
|
|
3274
|
-
* @param
|
|
3275
|
-
*
|
|
3461
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3462
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3463
|
+
* {@link Components.meshes}.
|
|
3276
3464
|
*/
|
|
3277
|
-
|
|
3465
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3278
3466
|
/**
|
|
3279
|
-
*
|
|
3467
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3468
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
3280
3469
|
*
|
|
3281
|
-
* @param
|
|
3282
|
-
* @
|
|
3470
|
+
* @param origin - The origin of the ray.
|
|
3471
|
+
* @param direction - The direction of the ray.
|
|
3472
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3473
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3283
3474
|
*/
|
|
3284
|
-
|
|
3475
|
+
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
3476
|
+
private intersect;
|
|
3477
|
+
private filterClippingPlanes;
|
|
3478
|
+
}
|
|
3479
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3480
|
+
/**
|
|
3481
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3482
|
+
*/
|
|
3483
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3484
|
+
/**
|
|
3485
|
+
* Minimum number of geometries to be streamed.
|
|
3486
|
+
* Defaults to 10 geometries.
|
|
3487
|
+
*/
|
|
3488
|
+
minGeometrySize: number;
|
|
3489
|
+
/**
|
|
3490
|
+
* Minimum amount of assets to be streamed.
|
|
3491
|
+
* Defaults to 1000 assets.
|
|
3492
|
+
*/
|
|
3493
|
+
minAssetsSize: number;
|
|
3494
|
+
}
|
|
3495
|
+
import * as THREE from "three";
|
|
3496
|
+
import * as WEBIFC from "web-ifc";
|
|
3497
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3498
|
+
export declare class CivilReader {
|
|
3499
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3500
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3501
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3502
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3503
|
+
} | undefined;
|
|
3504
|
+
get(civilItems: any): {
|
|
3505
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3506
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3507
|
+
} | undefined;
|
|
3508
|
+
private getCurves;
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* 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.
|
|
3512
|
+
*/
|
|
3513
|
+
export interface StreamedGeometries {
|
|
3514
|
+
[id: number]: {
|
|
3515
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
3516
|
+
boundingBox: Float32Array;
|
|
3517
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
3518
|
+
hasHoles: boolean;
|
|
3519
|
+
/** An optional file path for the geometry data. */
|
|
3520
|
+
geometryFile?: string;
|
|
3521
|
+
};
|
|
3522
|
+
}
|
|
3523
|
+
/**
|
|
3524
|
+
* 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.
|
|
3525
|
+
*/
|
|
3526
|
+
export interface StreamedAsset {
|
|
3527
|
+
/** The unique identifier of the asset. */
|
|
3528
|
+
id: number;
|
|
3529
|
+
/** An array of geometries associated with the asset. */
|
|
3530
|
+
geometries: {
|
|
3531
|
+
/** The unique identifier of the geometry. */
|
|
3532
|
+
geometryID: number;
|
|
3533
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
3534
|
+
transformation: number[];
|
|
3535
|
+
/** The color of the geometry as a number array. */
|
|
3536
|
+
color: number[];
|
|
3537
|
+
}[];
|
|
3538
|
+
}
|
|
3539
|
+
import * as WEBIFC from "web-ifc";
|
|
3540
|
+
export declare class IfcMetadataReader {
|
|
3541
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3542
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3543
|
+
}
|
|
3544
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3545
|
+
/**
|
|
3546
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3547
|
+
*/
|
|
3548
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3285
3549
|
/**
|
|
3286
|
-
*
|
|
3550
|
+
* Amount of properties to be streamed.
|
|
3551
|
+
* Defaults to 100 properties.
|
|
3287
3552
|
*/
|
|
3288
|
-
|
|
3553
|
+
propertiesSize: number;
|
|
3554
|
+
}
|
|
3555
|
+
import * as WEBIFC from "web-ifc";
|
|
3556
|
+
import * as THREE from "three";
|
|
3557
|
+
export declare class Units {
|
|
3558
|
+
factor: number;
|
|
3559
|
+
complement: number;
|
|
3560
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3561
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3562
|
+
private getLengthUnits;
|
|
3563
|
+
private getScaleMatrix;
|
|
3564
|
+
}
|
|
3565
|
+
import { NavigationMode } from "./types";
|
|
3566
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3567
|
+
/**
|
|
3568
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3569
|
+
*/
|
|
3570
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3571
|
+
private camera;
|
|
3572
|
+
/** {@link NavigationMode.enabled} */
|
|
3573
|
+
enabled: boolean;
|
|
3574
|
+
/** {@link NavigationMode.id} */
|
|
3575
|
+
readonly id = "FirstPerson";
|
|
3576
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3577
|
+
/** {@link NavigationMode.set} */
|
|
3578
|
+
set(active: boolean): void;
|
|
3579
|
+
private setupFirstPersonCamera;
|
|
3289
3580
|
}
|
|
3290
3581
|
import * as THREE from "three";
|
|
3291
3582
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3386,96 +3677,25 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3386
3677
|
private newHelper;
|
|
3387
3678
|
private static newPlaneMesh;
|
|
3388
3679
|
}
|
|
3389
|
-
import * as THREE from "three";
|
|
3390
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3391
|
-
import { Components } from "../../Components";
|
|
3392
|
-
/**
|
|
3393
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
3394
|
-
*/
|
|
3395
|
-
export interface GridConfig {
|
|
3396
|
-
/**
|
|
3397
|
-
* The color of the grid lines.
|
|
3398
|
-
*/
|
|
3399
|
-
color: THREE.Color;
|
|
3400
|
-
/**
|
|
3401
|
-
* The size of the primary grid lines.
|
|
3402
|
-
*/
|
|
3403
|
-
size1: number;
|
|
3404
|
-
/**
|
|
3405
|
-
* The size of the secondary grid lines.
|
|
3406
|
-
*/
|
|
3407
|
-
size2: number;
|
|
3408
|
-
/**
|
|
3409
|
-
* The distance at which the grid lines start to fade away.
|
|
3410
|
-
*/
|
|
3411
|
-
distance: number;
|
|
3412
|
-
}
|
|
3413
|
-
/**
|
|
3414
|
-
* 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).
|
|
3415
|
-
*/
|
|
3416
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3417
|
-
/** {@link Disposable.onDisposed} */
|
|
3418
|
-
readonly onDisposed: Event<unknown>;
|
|
3419
|
-
/** The world instance to which this Raycaster belongs. */
|
|
3420
|
-
world: World;
|
|
3421
|
-
/** The components instance to which this grid belongs. */
|
|
3422
|
-
components: Components;
|
|
3423
|
-
/** {@link Hideable.visible} */
|
|
3424
|
-
get visible(): boolean;
|
|
3425
|
-
/** {@link Hideable.visible} */
|
|
3426
|
-
set visible(visible: boolean);
|
|
3427
|
-
/** The material of the grid. */
|
|
3428
|
-
get material(): THREE.ShaderMaterial;
|
|
3429
|
-
/**
|
|
3430
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3431
|
-
* perspective cameras and false for orthographic cameras.
|
|
3432
|
-
*/
|
|
3433
|
-
get fade(): boolean;
|
|
3434
|
-
/**
|
|
3435
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3436
|
-
* perspective cameras and false for orthographic cameras.
|
|
3437
|
-
*/
|
|
3438
|
-
set fade(active: boolean);
|
|
3439
|
-
/** The Three.js mesh that contains the infinite grid. */
|
|
3440
|
-
readonly three: THREE.Mesh;
|
|
3441
|
-
private _fade;
|
|
3442
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
3443
|
-
/** {@link Disposable.dispose} */
|
|
3444
|
-
dispose(): void;
|
|
3445
|
-
private setupEvents;
|
|
3446
|
-
private updateZoom;
|
|
3447
|
-
}
|
|
3448
3680
|
import { NavigationMode } from "./types";
|
|
3449
3681
|
import { OrthoPerspectiveCamera } from "../index";
|
|
3450
3682
|
/**
|
|
3451
|
-
* A {@link NavigationMode} that allows
|
|
3683
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3452
3684
|
*/
|
|
3453
|
-
export declare class
|
|
3685
|
+
export declare class PlanMode implements NavigationMode {
|
|
3454
3686
|
private camera;
|
|
3455
3687
|
/** {@link NavigationMode.enabled} */
|
|
3456
3688
|
enabled: boolean;
|
|
3457
3689
|
/** {@link NavigationMode.id} */
|
|
3458
|
-
readonly id = "
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
private
|
|
3463
|
-
|
|
3464
|
-
import { NavigationMode } from "./types";
|
|
3465
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3466
|
-
/**
|
|
3467
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3468
|
-
*/
|
|
3469
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3470
|
-
camera: OrthoPerspectiveCamera;
|
|
3471
|
-
/** {@link NavigationMode.enabled} */
|
|
3472
|
-
enabled: boolean;
|
|
3473
|
-
/** {@link NavigationMode.id} */
|
|
3474
|
-
readonly id = "Orbit";
|
|
3690
|
+
readonly id = "Plan";
|
|
3691
|
+
private mouseAction1?;
|
|
3692
|
+
private mouseAction2?;
|
|
3693
|
+
private mouseInitialized;
|
|
3694
|
+
private readonly defaultAzimuthSpeed;
|
|
3695
|
+
private readonly defaultPolarSpeed;
|
|
3475
3696
|
constructor(camera: OrthoPerspectiveCamera);
|
|
3476
3697
|
/** {@link NavigationMode.set} */
|
|
3477
3698
|
set(active: boolean): void;
|
|
3478
|
-
private activateOrbitControls;
|
|
3479
3699
|
}
|
|
3480
3700
|
import * as THREE from "three";
|
|
3481
3701
|
import { CameraProjection } from "./types";
|
|
@@ -3525,98 +3745,44 @@ export declare class ProjectionManager {
|
|
|
3525
3745
|
import { NavigationMode } from "./types";
|
|
3526
3746
|
import { OrthoPerspectiveCamera } from "../index";
|
|
3527
3747
|
/**
|
|
3528
|
-
* A {@link NavigationMode} that allows
|
|
3748
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3529
3749
|
*/
|
|
3530
|
-
export declare class
|
|
3531
|
-
|
|
3750
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3751
|
+
camera: OrthoPerspectiveCamera;
|
|
3532
3752
|
/** {@link NavigationMode.enabled} */
|
|
3533
3753
|
enabled: boolean;
|
|
3534
3754
|
/** {@link NavigationMode.id} */
|
|
3535
|
-
readonly id = "
|
|
3536
|
-
private mouseAction1?;
|
|
3537
|
-
private mouseAction2?;
|
|
3538
|
-
private mouseInitialized;
|
|
3539
|
-
private readonly defaultAzimuthSpeed;
|
|
3540
|
-
private readonly defaultPolarSpeed;
|
|
3755
|
+
readonly id = "Orbit";
|
|
3541
3756
|
constructor(camera: OrthoPerspectiveCamera);
|
|
3542
3757
|
/** {@link NavigationMode.set} */
|
|
3543
3758
|
set(active: boolean): void;
|
|
3759
|
+
private activateOrbitControls;
|
|
3544
3760
|
}
|
|
3545
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3546
|
-
/**
|
|
3547
|
-
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3548
|
-
*/
|
|
3549
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3550
|
-
/**
|
|
3551
|
-
* Minimum number of geometries to be streamed.
|
|
3552
|
-
* Defaults to 10 geometries.
|
|
3553
|
-
*/
|
|
3554
|
-
minGeometrySize: number;
|
|
3555
|
-
/**
|
|
3556
|
-
* Minimum amount of assets to be streamed.
|
|
3557
|
-
* Defaults to 1000 assets.
|
|
3558
|
-
*/
|
|
3559
|
-
minAssetsSize: number;
|
|
3560
|
-
}
|
|
3561
|
-
import * as THREE from "three";
|
|
3562
|
-
import * as WEBIFC from "web-ifc";
|
|
3563
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
3564
|
-
export declare class CivilReader {
|
|
3565
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
3566
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
3567
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
3568
|
-
coordinationMatrix: THREE.Matrix4;
|
|
3569
|
-
} | undefined;
|
|
3570
|
-
get(civilItems: any): {
|
|
3571
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
3572
|
-
coordinationMatrix: THREE.Matrix4;
|
|
3573
|
-
} | undefined;
|
|
3574
|
-
private getCurves;
|
|
3575
|
-
}
|
|
3576
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3577
3761
|
/**
|
|
3578
|
-
*
|
|
3762
|
+
* The projection system of the camera.
|
|
3579
3763
|
*/
|
|
3580
|
-
export
|
|
3581
|
-
/**
|
|
3582
|
-
* Amount of properties to be streamed.
|
|
3583
|
-
* Defaults to 100 properties.
|
|
3584
|
-
*/
|
|
3585
|
-
propertiesSize: number;
|
|
3586
|
-
}
|
|
3764
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3587
3765
|
/**
|
|
3588
|
-
*
|
|
3766
|
+
* The extensible list of supported navigation modes.
|
|
3589
3767
|
*/
|
|
3590
|
-
export
|
|
3591
|
-
[id: number]: {
|
|
3592
|
-
/** The bounding box of the geometry as a Float32Array. */
|
|
3593
|
-
boundingBox: Float32Array;
|
|
3594
|
-
/** A boolean indicating whether the geometry has holes. */
|
|
3595
|
-
hasHoles: boolean;
|
|
3596
|
-
/** An optional file path for the geometry data. */
|
|
3597
|
-
geometryFile?: string;
|
|
3598
|
-
};
|
|
3599
|
-
}
|
|
3768
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3600
3769
|
/**
|
|
3601
|
-
*
|
|
3770
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3602
3771
|
*/
|
|
3603
|
-
export interface
|
|
3604
|
-
/** The unique
|
|
3605
|
-
id:
|
|
3606
|
-
/**
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
export declare class IfcMetadataReader {
|
|
3618
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3619
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3772
|
+
export interface NavigationMode {
|
|
3773
|
+
/** The unique ID of this navigation mode. */
|
|
3774
|
+
id: NavModeID;
|
|
3775
|
+
/**
|
|
3776
|
+
* Enable or disable this navigation mode.
|
|
3777
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3778
|
+
* must be disabled.
|
|
3779
|
+
*
|
|
3780
|
+
* @param active - whether to enable or disable this mode.
|
|
3781
|
+
* @param options - any additional data required to enable or disable it.
|
|
3782
|
+
* */
|
|
3783
|
+
set: (active: boolean, options?: any) => void;
|
|
3784
|
+
/** Whether this navigation mode is active or not. */
|
|
3785
|
+
enabled: boolean;
|
|
3620
3786
|
}
|
|
3621
3787
|
import * as WEBIFC from "web-ifc";
|
|
3622
3788
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
@@ -3670,41 +3836,5 @@ import * as THREE from "three";
|
|
|
3670
3836
|
export declare class TransformHelper {
|
|
3671
3837
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3672
3838
|
}
|
|
3673
|
-
import * as WEBIFC from "web-ifc";
|
|
3674
|
-
import * as THREE from "three";
|
|
3675
|
-
export declare class Units {
|
|
3676
|
-
factor: number;
|
|
3677
|
-
complement: number;
|
|
3678
|
-
apply(matrix: THREE.Matrix4): void;
|
|
3679
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3680
|
-
private getLengthUnits;
|
|
3681
|
-
private getScaleMatrix;
|
|
3682
|
-
}
|
|
3683
|
-
/**
|
|
3684
|
-
* The projection system of the camera.
|
|
3685
|
-
*/
|
|
3686
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3687
|
-
/**
|
|
3688
|
-
* The extensible list of supported navigation modes.
|
|
3689
|
-
*/
|
|
3690
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3691
|
-
/**
|
|
3692
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3693
|
-
*/
|
|
3694
|
-
export interface NavigationMode {
|
|
3695
|
-
/** The unique ID of this navigation mode. */
|
|
3696
|
-
id: NavModeID;
|
|
3697
|
-
/**
|
|
3698
|
-
* Enable or disable this navigation mode.
|
|
3699
|
-
* When a new navigation mode is enabled, the previous navigation mode
|
|
3700
|
-
* must be disabled.
|
|
3701
|
-
*
|
|
3702
|
-
* @param active - whether to enable or disable this mode.
|
|
3703
|
-
* @param options - any additional data required to enable or disable it.
|
|
3704
|
-
* */
|
|
3705
|
-
set: (active: boolean, options?: any) => void;
|
|
3706
|
-
/** Whether this navigation mode is active or not. */
|
|
3707
|
-
enabled: boolean;
|
|
3708
|
-
}
|
|
3709
3839
|
|
|
3710
3840
|
}
|