@thatopen/components 2.0.23 → 2.0.25
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/index.cjs +5 -5
- package/dist/index.mjs +2126 -2020
- package/dist/measurement/MeasurementUtils/index.d.ts +35 -0
- package/dist/namespace.d.ts +1587 -1552
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
+
import { Components } from "../Components";
|
|
4
|
+
import { Component } from "../Types";
|
|
5
|
+
/**
|
|
6
|
+
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
7
|
+
*/
|
|
8
|
+
export declare class Disposer extends Component {
|
|
9
|
+
private _disposedComponents;
|
|
10
|
+
/** {@link Component.enabled} */
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A unique identifier for the component.
|
|
14
|
+
* This UUID is used to register the component within the Components system.
|
|
15
|
+
*/
|
|
16
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
17
|
+
constructor(components: Components);
|
|
18
|
+
/**
|
|
19
|
+
* Return the UUIDs of all disposed components.
|
|
20
|
+
*/
|
|
21
|
+
get(): Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
24
|
+
* using any of these in other parts of the application, make sure that you
|
|
25
|
+
* remove them from the mesh before disposing it.
|
|
26
|
+
*
|
|
27
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
28
|
+
* to remove.
|
|
29
|
+
*
|
|
30
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
31
|
+
*
|
|
32
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
33
|
+
*/
|
|
34
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
35
|
+
/**
|
|
36
|
+
* Disposes a geometry from memory.
|
|
37
|
+
*
|
|
38
|
+
* @param geometry - the
|
|
39
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
40
|
+
* to remove.
|
|
41
|
+
*/
|
|
42
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
43
|
+
private disposeGeometryAndMaterials;
|
|
44
|
+
private disposeChildren;
|
|
45
|
+
private static disposeMaterial;
|
|
46
|
+
}
|
|
47
|
+
import * as THREE from "three";
|
|
3
48
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
4
49
|
import { SimplePlane } from "./src";
|
|
5
50
|
import { Components } from "../Components";
|
|
@@ -126,50 +171,94 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
126
171
|
private _onStartDragging;
|
|
127
172
|
private _onEndDragging;
|
|
128
173
|
}
|
|
129
|
-
import
|
|
174
|
+
import { MiniMap } from "./src";
|
|
175
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
130
176
|
import { Components } from "../Components";
|
|
131
|
-
import { Component } from "../Types";
|
|
132
177
|
/**
|
|
133
|
-
* A
|
|
178
|
+
* 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).
|
|
134
179
|
*/
|
|
135
|
-
export declare class
|
|
136
|
-
private _disposedComponents;
|
|
137
|
-
/** {@link Component.enabled} */
|
|
138
|
-
enabled: boolean;
|
|
180
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
139
181
|
/**
|
|
140
182
|
* A unique identifier for the component.
|
|
141
183
|
* This UUID is used to register the component within the Components system.
|
|
142
184
|
*/
|
|
143
|
-
static readonly uuid: "
|
|
144
|
-
|
|
185
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
186
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
187
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
188
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
189
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
190
|
+
/** {@link Disposable.onDisposed} */
|
|
191
|
+
readonly onDisposed: Event<unknown>;
|
|
192
|
+
/** {@link Component.enabled} */
|
|
193
|
+
enabled: boolean;
|
|
145
194
|
/**
|
|
146
|
-
*
|
|
195
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
147
196
|
*/
|
|
148
|
-
|
|
197
|
+
list: Map<string, MiniMap>;
|
|
198
|
+
constructor(components: Components);
|
|
149
199
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* remove them from the mesh before disposing it.
|
|
200
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
201
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
153
202
|
*
|
|
154
|
-
* @param
|
|
155
|
-
*
|
|
203
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
204
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
205
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
206
|
+
*/
|
|
207
|
+
create(world: World): MiniMap;
|
|
208
|
+
/**
|
|
209
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
210
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
156
211
|
*
|
|
157
|
-
* @param
|
|
212
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
213
|
+
* @returns {void}
|
|
214
|
+
*/
|
|
215
|
+
delete(id: string): void;
|
|
216
|
+
/** {@link Disposable.dispose} */
|
|
217
|
+
dispose(): void;
|
|
218
|
+
/** {@link Updateable.update} */
|
|
219
|
+
update(): void;
|
|
220
|
+
}
|
|
221
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
222
|
+
import { SimpleRaycaster } from "./src";
|
|
223
|
+
import { Components } from "../Components";
|
|
224
|
+
/**
|
|
225
|
+
* 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).
|
|
226
|
+
*/
|
|
227
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
228
|
+
/**
|
|
229
|
+
* A unique identifier for the component.
|
|
230
|
+
* This UUID is used to register the component within the Components system.
|
|
231
|
+
*/
|
|
232
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
233
|
+
/** {@link Component.enabled} */
|
|
234
|
+
enabled: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* A Map that stores raycasters for each world.
|
|
237
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
238
|
+
*/
|
|
239
|
+
list: Map<string, SimpleRaycaster>;
|
|
240
|
+
/** {@link Disposable.onDisposed} */
|
|
241
|
+
onDisposed: Event<unknown>;
|
|
242
|
+
constructor(components: Components);
|
|
243
|
+
/**
|
|
244
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
245
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
246
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
158
247
|
*
|
|
159
|
-
* @param
|
|
248
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
249
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
160
250
|
*/
|
|
161
|
-
|
|
251
|
+
get(world: World): SimpleRaycaster;
|
|
162
252
|
/**
|
|
163
|
-
*
|
|
253
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
254
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
164
255
|
*
|
|
165
|
-
* @param
|
|
166
|
-
*
|
|
167
|
-
* to remove.
|
|
256
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
257
|
+
* @returns {void}
|
|
168
258
|
*/
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
private static disposeMaterial;
|
|
259
|
+
delete(world: World): void;
|
|
260
|
+
/** {@link Disposable.dispose} */
|
|
261
|
+
dispose(): void;
|
|
173
262
|
}
|
|
174
263
|
import { Component, Disposable, Event } from "../Types";
|
|
175
264
|
/**
|
|
@@ -179,7 +268,7 @@ export declare class Components implements Disposable {
|
|
|
179
268
|
/**
|
|
180
269
|
* The version of the @thatopen/components library.
|
|
181
270
|
*/
|
|
182
|
-
static readonly release = "2.0.
|
|
271
|
+
static readonly release = "2.0.25";
|
|
183
272
|
/** {@link Disposable.onDisposed} */
|
|
184
273
|
readonly onDisposed: Event<void>;
|
|
185
274
|
/**
|
|
@@ -247,47 +336,69 @@ export declare class Components implements Disposable {
|
|
|
247
336
|
private update;
|
|
248
337
|
private static setupBVH;
|
|
249
338
|
}
|
|
250
|
-
import
|
|
251
|
-
import { SimpleRaycaster } from "./src";
|
|
339
|
+
import * as THREE from "three";
|
|
252
340
|
import { Components } from "../Components";
|
|
341
|
+
import { SimpleCamera } from "..";
|
|
342
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
253
343
|
/**
|
|
254
|
-
* A
|
|
344
|
+
* 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).
|
|
255
345
|
*/
|
|
256
|
-
export declare class
|
|
346
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
257
347
|
/**
|
|
258
|
-
* A
|
|
259
|
-
* This UUID is used to register the component within the Components system.
|
|
348
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
260
349
|
*/
|
|
261
|
-
|
|
262
|
-
/** {@link Component.enabled} */
|
|
263
|
-
enabled: boolean;
|
|
350
|
+
readonly projection: ProjectionManager;
|
|
264
351
|
/**
|
|
265
|
-
* A
|
|
266
|
-
*
|
|
352
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
353
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
267
354
|
*/
|
|
268
|
-
|
|
269
|
-
/** {@link Disposable.onDisposed} */
|
|
270
|
-
onDisposed: Event<unknown>;
|
|
271
|
-
constructor(components: Components);
|
|
355
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
272
356
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
276
|
-
*
|
|
277
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
278
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
357
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
358
|
+
* This camera is used when the projection mode is set to perspective.
|
|
279
359
|
*/
|
|
280
|
-
|
|
360
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
361
|
+
protected readonly _userInputButtons: any;
|
|
362
|
+
protected readonly _frustumSize = 50;
|
|
363
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
364
|
+
protected _mode: NavigationMode | null;
|
|
365
|
+
private previousSize;
|
|
281
366
|
/**
|
|
282
|
-
*
|
|
283
|
-
*
|
|
367
|
+
* Getter for the current navigation mode.
|
|
368
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
284
369
|
*
|
|
285
|
-
* @
|
|
286
|
-
*
|
|
370
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
371
|
+
*
|
|
372
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
287
373
|
*/
|
|
288
|
-
|
|
374
|
+
get mode(): NavigationMode;
|
|
375
|
+
constructor(components: Components);
|
|
289
376
|
/** {@link Disposable.dispose} */
|
|
290
377
|
dispose(): void;
|
|
378
|
+
/**
|
|
379
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
380
|
+
*
|
|
381
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
382
|
+
*/
|
|
383
|
+
set(mode: NavModeID): void;
|
|
384
|
+
/**
|
|
385
|
+
* Make the camera view fit all the specified meshes.
|
|
386
|
+
*
|
|
387
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
388
|
+
* evaluate {@link Components.meshes}.
|
|
389
|
+
* @param offset the distance to the fit object
|
|
390
|
+
*/
|
|
391
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
392
|
+
/**
|
|
393
|
+
* Allows or prevents all user input.
|
|
394
|
+
*
|
|
395
|
+
* @param active - whether to enable or disable user inputs.
|
|
396
|
+
*/
|
|
397
|
+
setUserInput(active: boolean): void;
|
|
398
|
+
private disableUserInput;
|
|
399
|
+
private enableUserInput;
|
|
400
|
+
private newOrthoCamera;
|
|
401
|
+
private setOrthoPerspCameraAspect;
|
|
291
402
|
}
|
|
292
403
|
import { Components } from "../Components";
|
|
293
404
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
@@ -453,506 +564,25 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
453
564
|
/** {@link Updateable.update} */
|
|
454
565
|
update(delta?: number): void | Promise<void>;
|
|
455
566
|
}
|
|
456
|
-
import
|
|
457
|
-
import
|
|
458
|
-
import {
|
|
567
|
+
import * as THREE from "three";
|
|
568
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
569
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
570
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
459
571
|
/**
|
|
460
|
-
* A
|
|
572
|
+
* 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).
|
|
461
573
|
*/
|
|
462
|
-
export declare class
|
|
463
|
-
|
|
464
|
-
* A unique identifier for the component.
|
|
465
|
-
* This UUID is used to register the component within the Components system.
|
|
466
|
-
*/
|
|
467
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
468
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
469
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
470
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
471
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
472
|
-
/** {@link Disposable.onDisposed} */
|
|
473
|
-
readonly onDisposed: Event<unknown>;
|
|
574
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
575
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
474
576
|
/** {@link Component.enabled} */
|
|
475
577
|
enabled: boolean;
|
|
476
|
-
/**
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
578
|
+
/** {@link Disposable.onDisposed} */
|
|
579
|
+
readonly onDisposed: Event<unknown>;
|
|
580
|
+
private _absoluteMin;
|
|
581
|
+
private _absoluteMax;
|
|
582
|
+
private _meshes;
|
|
480
583
|
constructor(components: Components);
|
|
481
584
|
/**
|
|
482
|
-
*
|
|
483
|
-
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
484
|
-
*
|
|
485
|
-
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
486
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
487
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
488
|
-
*/
|
|
489
|
-
create(world: World): MiniMap;
|
|
490
|
-
/**
|
|
491
|
-
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
492
|
-
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
493
|
-
*
|
|
494
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
495
|
-
* @returns {void}
|
|
496
|
-
*/
|
|
497
|
-
delete(id: string): void;
|
|
498
|
-
/** {@link Disposable.dispose} */
|
|
499
|
-
dispose(): void;
|
|
500
|
-
/** {@link Updateable.update} */
|
|
501
|
-
update(): void;
|
|
502
|
-
}
|
|
503
|
-
import * as THREE from "three";
|
|
504
|
-
import { Components } from "../Components";
|
|
505
|
-
import { SimpleCamera } from "..";
|
|
506
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
507
|
-
/**
|
|
508
|
-
* 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).
|
|
509
|
-
*/
|
|
510
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
511
|
-
/**
|
|
512
|
-
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
513
|
-
*/
|
|
514
|
-
readonly projection: ProjectionManager;
|
|
515
|
-
/**
|
|
516
|
-
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
517
|
-
* This camera is used when the projection mode is set to orthographic.
|
|
518
|
-
*/
|
|
519
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
520
|
-
/**
|
|
521
|
-
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
522
|
-
* This camera is used when the projection mode is set to perspective.
|
|
523
|
-
*/
|
|
524
|
-
readonly threePersp: THREE.PerspectiveCamera;
|
|
525
|
-
protected readonly _userInputButtons: any;
|
|
526
|
-
protected readonly _frustumSize = 50;
|
|
527
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
528
|
-
protected _mode: NavigationMode | null;
|
|
529
|
-
private previousSize;
|
|
530
|
-
/**
|
|
531
|
-
* Getter for the current navigation mode.
|
|
532
|
-
* Throws an error if the mode is not found or the camera is not initialized.
|
|
533
|
-
*
|
|
534
|
-
* @returns {NavigationMode} The current navigation mode.
|
|
535
|
-
*
|
|
536
|
-
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
537
|
-
*/
|
|
538
|
-
get mode(): NavigationMode;
|
|
539
|
-
constructor(components: Components);
|
|
540
|
-
/** {@link Disposable.dispose} */
|
|
541
|
-
dispose(): void;
|
|
542
|
-
/**
|
|
543
|
-
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
544
|
-
*
|
|
545
|
-
* @param mode - The {@link NavigationMode} to set.
|
|
546
|
-
*/
|
|
547
|
-
set(mode: NavModeID): void;
|
|
548
|
-
/**
|
|
549
|
-
* Make the camera view fit all the specified meshes.
|
|
550
|
-
*
|
|
551
|
-
* @param meshes the meshes to fit. If it is not defined, it will
|
|
552
|
-
* evaluate {@link Components.meshes}.
|
|
553
|
-
* @param offset the distance to the fit object
|
|
554
|
-
*/
|
|
555
|
-
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
556
|
-
/**
|
|
557
|
-
* Allows or prevents all user input.
|
|
558
|
-
*
|
|
559
|
-
* @param active - whether to enable or disable user inputs.
|
|
560
|
-
*/
|
|
561
|
-
setUserInput(active: boolean): void;
|
|
562
|
-
private disableUserInput;
|
|
563
|
-
private enableUserInput;
|
|
564
|
-
private newOrthoCamera;
|
|
565
|
-
private setOrthoPerspCameraAspect;
|
|
566
|
-
}
|
|
567
|
-
import * as THREE from "three";
|
|
568
|
-
import { Component, Components } from "../../core";
|
|
569
|
-
/**
|
|
570
|
-
* Represents an edge measurement result.
|
|
571
|
-
*/
|
|
572
|
-
export interface MeasureEdge {
|
|
573
|
-
/**
|
|
574
|
-
* The distance between the two points of the edge.
|
|
575
|
-
*/
|
|
576
|
-
distance: number;
|
|
577
|
-
/**
|
|
578
|
-
* The two points that define the edge.
|
|
579
|
-
*/
|
|
580
|
-
points: THREE.Vector3[];
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* 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).
|
|
584
|
-
*/
|
|
585
|
-
export declare class MeasurementUtils extends Component {
|
|
586
|
-
/**
|
|
587
|
-
* A unique identifier for the component.
|
|
588
|
-
* This UUID is used to register the component within the Components system.
|
|
589
|
-
*/
|
|
590
|
-
static uuid: string;
|
|
591
|
-
/** {@link Component.enabled} */
|
|
592
|
-
enabled: boolean;
|
|
593
|
-
constructor(components: Components);
|
|
594
|
-
/**
|
|
595
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
596
|
-
*
|
|
597
|
-
* @param point - The point from which to calculate the distance.
|
|
598
|
-
* @param lineStart - The start point of the line segment.
|
|
599
|
-
* @param lineEnd - The end point of the line segment.
|
|
600
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
601
|
-
* @returns The distance from the point to the line segment.
|
|
602
|
-
*/
|
|
603
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
604
|
-
/**
|
|
605
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
606
|
-
* It also returns the edges of the found face and their indices.
|
|
607
|
-
*
|
|
608
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
609
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
610
|
-
* @param instance - The instance of the mesh (optional).
|
|
611
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
612
|
-
*/
|
|
613
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
614
|
-
edges: MeasureEdge[];
|
|
615
|
-
indices: Set<number>;
|
|
616
|
-
} | null;
|
|
617
|
-
/**
|
|
618
|
-
* Method to get the vertices and normal of a mesh face at a given index.
|
|
619
|
-
* It also applies instance transformation if provided.
|
|
620
|
-
*
|
|
621
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
622
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
623
|
-
* @param instance - The instance of the mesh (optional).
|
|
624
|
-
* @returns An object containing the vertices and normal of the face.
|
|
625
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
626
|
-
*/
|
|
627
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
628
|
-
p1: THREE.Vector3;
|
|
629
|
-
p2: THREE.Vector3;
|
|
630
|
-
p3: THREE.Vector3;
|
|
631
|
-
faceNormal: THREE.Vector3;
|
|
632
|
-
};
|
|
633
|
-
/**
|
|
634
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
635
|
-
* This is used to ensure numerical precision in edge detection.
|
|
636
|
-
*
|
|
637
|
-
* @param vector - The vector to round.
|
|
638
|
-
* @returns The vector with rounded components.
|
|
639
|
-
*/
|
|
640
|
-
round(vector: THREE.Vector3): void;
|
|
641
|
-
private getFaceData;
|
|
642
|
-
}
|
|
643
|
-
import * as THREE from "three";
|
|
644
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
645
|
-
center: THREE.Vector3;
|
|
646
|
-
halfSizes: THREE.Vector3;
|
|
647
|
-
rotation: THREE.Matrix3;
|
|
648
|
-
transformation: THREE.Matrix4;
|
|
649
|
-
};
|
|
650
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
651
|
-
import * as THREE from "three";
|
|
652
|
-
export declare class MaterialsUtils {
|
|
653
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
654
|
-
}
|
|
655
|
-
export declare class UUID {
|
|
656
|
-
private static _pattern;
|
|
657
|
-
private static _lut;
|
|
658
|
-
static create(): string;
|
|
659
|
-
static validate(uuid: string): void;
|
|
660
|
-
}
|
|
661
|
-
import * as THREE from "three";
|
|
662
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
663
|
-
/**
|
|
664
|
-
* Configuration interface for the VertexPicker component.
|
|
665
|
-
*/
|
|
666
|
-
export interface VertexPickerConfig {
|
|
667
|
-
/**
|
|
668
|
-
* If true, only vertices will be picked, not the closest point on the face.
|
|
669
|
-
*/
|
|
670
|
-
showOnlyVertex: boolean;
|
|
671
|
-
/**
|
|
672
|
-
* The maximum distance for snapping to a vertex.
|
|
673
|
-
*/
|
|
674
|
-
snapDistance: number;
|
|
675
|
-
/**
|
|
676
|
-
* The HTML element to use for previewing the picked vertex.
|
|
677
|
-
*/
|
|
678
|
-
previewElement: HTMLElement;
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
682
|
-
*/
|
|
683
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
684
|
-
/** {@link Disposable.onDisposed} */
|
|
685
|
-
readonly onDisposed: Event<unknown>;
|
|
686
|
-
/**
|
|
687
|
-
* An event that is triggered when a vertex is found.
|
|
688
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
689
|
-
*/
|
|
690
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
691
|
-
/**
|
|
692
|
-
* An event that is triggered when a vertex is lost.
|
|
693
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
694
|
-
*/
|
|
695
|
-
readonly onVertexLost: Event<THREE.Vector3>;
|
|
696
|
-
/**
|
|
697
|
-
* A reference to the Components instance associated with this VertexPicker.
|
|
698
|
-
*/
|
|
699
|
-
components: Components;
|
|
700
|
-
/**
|
|
701
|
-
* A reference to the working plane used for vertex picking.
|
|
702
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
703
|
-
* If this value is null, all vertices are considered valid.
|
|
704
|
-
*/
|
|
705
|
-
workingPlane: THREE.Plane | null;
|
|
706
|
-
private _pickedPoint;
|
|
707
|
-
private _config;
|
|
708
|
-
private _enabled;
|
|
709
|
-
/**
|
|
710
|
-
* Sets the enabled state of the VertexPicker.
|
|
711
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
712
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
713
|
-
*
|
|
714
|
-
* @param value - The new enabled state.
|
|
715
|
-
*/
|
|
716
|
-
set enabled(value: boolean);
|
|
717
|
-
/**
|
|
718
|
-
* Gets the current enabled state of the VertexPicker.
|
|
719
|
-
*
|
|
720
|
-
* @returns The current enabled state.
|
|
721
|
-
*/
|
|
722
|
-
get enabled(): boolean;
|
|
723
|
-
/**
|
|
724
|
-
* Sets the configuration for the VertexPicker component.
|
|
725
|
-
*
|
|
726
|
-
* @param value - A Partial object containing the configuration properties to update.
|
|
727
|
-
* The properties not provided in the value object will retain their current values.
|
|
728
|
-
*
|
|
729
|
-
* @example
|
|
730
|
-
* '''typescript
|
|
731
|
-
* vertexPicker.config = {
|
|
732
|
-
* snapDistance: 0.5,
|
|
733
|
-
* showOnlyVertex: true,
|
|
734
|
-
* };
|
|
735
|
-
* '''
|
|
736
|
-
*/
|
|
737
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
738
|
-
/**
|
|
739
|
-
* Gets the current configuration for the VertexPicker component.
|
|
740
|
-
*
|
|
741
|
-
* @returns A copy of the current VertexPickerConfig object.
|
|
742
|
-
*
|
|
743
|
-
* @example
|
|
744
|
-
* '''typescript
|
|
745
|
-
* const currentConfig = vertexPicker.config;
|
|
746
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
747
|
-
* '''
|
|
748
|
-
*/
|
|
749
|
-
get config(): Partial<VertexPickerConfig>;
|
|
750
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
751
|
-
/** {@link Disposable.dispose} */
|
|
752
|
-
dispose(): void;
|
|
753
|
-
/**
|
|
754
|
-
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
755
|
-
*
|
|
756
|
-
* @param world - The World instance to use for raycasting.
|
|
757
|
-
*
|
|
758
|
-
* @returns The current picked point, or null if no point is picked.
|
|
759
|
-
*
|
|
760
|
-
* @remarks
|
|
761
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
762
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
763
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
764
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
765
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
766
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
767
|
-
*/
|
|
768
|
-
get(world: World): THREE.Vector3 | null;
|
|
769
|
-
private getClosestVertex;
|
|
770
|
-
private getVertices;
|
|
771
|
-
private getVertex;
|
|
772
|
-
}
|
|
773
|
-
import * as THREE from "three";
|
|
774
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
775
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
776
|
-
/**
|
|
777
|
-
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
|
|
778
|
-
*/
|
|
779
|
-
export interface Classification {
|
|
780
|
-
/**
|
|
781
|
-
* A system within the classification.
|
|
782
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
783
|
-
*/
|
|
784
|
-
[system: string]: {
|
|
785
|
-
/**
|
|
786
|
-
* A class within the system.
|
|
787
|
-
* The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
|
|
788
|
-
*/
|
|
789
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
790
|
-
};
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
794
|
-
*/
|
|
795
|
-
export declare class Classifier extends Component implements Disposable {
|
|
796
|
-
/**
|
|
797
|
-
* A unique identifier for the component.
|
|
798
|
-
* This UUID is used to register the component within the Components system.
|
|
799
|
-
*/
|
|
800
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
801
|
-
/** {@link Component.enabled} */
|
|
802
|
-
enabled: boolean;
|
|
803
|
-
/**
|
|
804
|
-
* A map representing the classification systems.
|
|
805
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
806
|
-
*/
|
|
807
|
-
list: Classification;
|
|
808
|
-
/** {@link Disposable.onDisposed} */
|
|
809
|
-
readonly onDisposed: Event<unknown>;
|
|
810
|
-
constructor(components: Components);
|
|
811
|
-
private onFragmentsDisposed;
|
|
812
|
-
/** {@link Disposable.dispose} */
|
|
813
|
-
dispose(): void;
|
|
814
|
-
/**
|
|
815
|
-
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
816
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
817
|
-
*
|
|
818
|
-
* @param guid - The unique identifier of the fragment to be removed.
|
|
819
|
-
*/
|
|
820
|
-
remove(guid: string): void;
|
|
821
|
-
/**
|
|
822
|
-
* Finds and returns fragments based on the provided filter criteria.
|
|
823
|
-
* If no filter is provided, it returns all fragments.
|
|
824
|
-
*
|
|
825
|
-
* @param filter - An optional object containing filter criteria.
|
|
826
|
-
* The keys of the object represent the classification system names,
|
|
827
|
-
* and the values are arrays of class names to match.
|
|
828
|
-
*
|
|
829
|
-
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
830
|
-
* where the express IDs are filtered based on the provided filter criteria.
|
|
831
|
-
*
|
|
832
|
-
* @throws Will throw an error if the fragments map is malformed.
|
|
833
|
-
*/
|
|
834
|
-
find(filter?: {
|
|
835
|
-
[name: string]: string[];
|
|
836
|
-
}): FRAGS.FragmentIdMap;
|
|
837
|
-
/**
|
|
838
|
-
* Classifies fragments based on their modelID.
|
|
839
|
-
*
|
|
840
|
-
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
841
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
842
|
-
*
|
|
843
|
-
* @remarks
|
|
844
|
-
* This method iterates through the fragments in the provided group,
|
|
845
|
-
* and classifies them based on their modelID.
|
|
846
|
-
* The classification is stored in the 'list.models' property,
|
|
847
|
-
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
848
|
-
*
|
|
849
|
-
*/
|
|
850
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
851
|
-
/**
|
|
852
|
-
* Classifies fragments based on their PredefinedType property.
|
|
853
|
-
*
|
|
854
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
855
|
-
*
|
|
856
|
-
* @remarks
|
|
857
|
-
* This method iterates through the properties of the fragments in the provided group,
|
|
858
|
-
* and classifies them based on their PredefinedType property.
|
|
859
|
-
* The classification is stored in the 'list.predefinedTypes' property,
|
|
860
|
-
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
861
|
-
*
|
|
862
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
863
|
-
*/
|
|
864
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
865
|
-
/**
|
|
866
|
-
* Classifies fragments based on their entity type.
|
|
867
|
-
*
|
|
868
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
869
|
-
*
|
|
870
|
-
* @remarks
|
|
871
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
872
|
-
* and classifies them based on their entity type.
|
|
873
|
-
* The classification is stored in the 'list.entities' property,
|
|
874
|
-
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
875
|
-
*
|
|
876
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
877
|
-
*/
|
|
878
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
879
|
-
/**
|
|
880
|
-
* Classifies fragments based on a specific IFC relationship.
|
|
881
|
-
*
|
|
882
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
883
|
-
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
884
|
-
* @param systemName - The name of the classification system to store the classification.
|
|
885
|
-
*
|
|
886
|
-
* @remarks
|
|
887
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
888
|
-
* and classifies them based on the specified IFC relationship.
|
|
889
|
-
* The classification is stored in the 'list' property under the specified system name,
|
|
890
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
891
|
-
*
|
|
892
|
-
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
893
|
-
*/
|
|
894
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
895
|
-
/**
|
|
896
|
-
* Classifies fragments based on their spatial structure in the IFC model.
|
|
897
|
-
*
|
|
898
|
-
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
899
|
-
*
|
|
900
|
-
* @remarks
|
|
901
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
902
|
-
* and classifies them based on their spatial structure in the IFC model.
|
|
903
|
-
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
904
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
905
|
-
*
|
|
906
|
-
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
907
|
-
*/
|
|
908
|
-
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
909
|
-
/**
|
|
910
|
-
* Sets the color of the specified fragments.
|
|
911
|
-
*
|
|
912
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
913
|
-
* @param color - The color to set for the fragments.
|
|
914
|
-
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
915
|
-
*
|
|
916
|
-
* @remarks
|
|
917
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
918
|
-
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
919
|
-
*
|
|
920
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
921
|
-
*/
|
|
922
|
-
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
923
|
-
/**
|
|
924
|
-
* Resets the color of the specified fragments to their original color.
|
|
925
|
-
*
|
|
926
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
927
|
-
*
|
|
928
|
-
* @remarks
|
|
929
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
930
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
931
|
-
*
|
|
932
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
933
|
-
*/
|
|
934
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
935
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
936
|
-
}
|
|
937
|
-
import * as THREE from "three";
|
|
938
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
939
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
940
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
941
|
-
/**
|
|
942
|
-
* 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).
|
|
943
|
-
*/
|
|
944
|
-
export declare class BoundingBoxer extends Component implements Disposable {
|
|
945
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
946
|
-
/** {@link Component.enabled} */
|
|
947
|
-
enabled: boolean;
|
|
948
|
-
/** {@link Disposable.onDisposed} */
|
|
949
|
-
readonly onDisposed: Event<unknown>;
|
|
950
|
-
private _absoluteMin;
|
|
951
|
-
private _absoluteMax;
|
|
952
|
-
private _meshes;
|
|
953
|
-
constructor(components: Components);
|
|
954
|
-
/**
|
|
955
|
-
* A static method to calculate the dimensions of a given bounding box.
|
|
585
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
956
586
|
*
|
|
957
587
|
* @param bbox - The bounding box to calculate the dimensions for.
|
|
958
588
|
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
@@ -1119,43 +749,125 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
1119
749
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
1120
750
|
private static getFragmentBounds;
|
|
1121
751
|
}
|
|
752
|
+
import * as THREE from "three";
|
|
753
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
754
|
+
center: THREE.Vector3;
|
|
755
|
+
halfSizes: THREE.Vector3;
|
|
756
|
+
rotation: THREE.Matrix3;
|
|
757
|
+
transformation: THREE.Matrix4;
|
|
758
|
+
};
|
|
759
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
760
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
761
|
+
import * as THREE from "three";
|
|
1122
762
|
import * as FRAGS from "@thatopen/fragments";
|
|
1123
|
-
import { Components,
|
|
763
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
764
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1124
765
|
/**
|
|
1125
|
-
*
|
|
766
|
+
* Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
|
|
1126
767
|
*/
|
|
1127
|
-
export declare class
|
|
768
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
1128
769
|
/**
|
|
1129
770
|
* A unique identifier for the component.
|
|
1130
771
|
* This UUID is used to register the component within the Components system.
|
|
1131
772
|
*/
|
|
1132
|
-
static readonly uuid: "
|
|
773
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
774
|
+
/** {@link Disposable.onDisposed} */
|
|
775
|
+
readonly onDisposed: Event<unknown>;
|
|
776
|
+
/**
|
|
777
|
+
* Event triggered when fragments are loaded.
|
|
778
|
+
*/
|
|
779
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
780
|
+
/**
|
|
781
|
+
* Event triggered when fragments are disposed.
|
|
782
|
+
*/
|
|
783
|
+
readonly onFragmentsDisposed: Event<{
|
|
784
|
+
groupID: string;
|
|
785
|
+
fragmentIDs: string[];
|
|
786
|
+
}>;
|
|
787
|
+
/**
|
|
788
|
+
* Map containing all loaded fragments.
|
|
789
|
+
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
790
|
+
*/
|
|
791
|
+
readonly list: Map<string, Fragment>;
|
|
792
|
+
/**
|
|
793
|
+
* Map containing all loaded fragment groups.
|
|
794
|
+
* The key is the group's unique identifier, and the value is the group itself.
|
|
795
|
+
*/
|
|
796
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
797
|
+
baseCoordinationModel: string;
|
|
1133
798
|
/** {@link Component.enabled} */
|
|
1134
799
|
enabled: boolean;
|
|
800
|
+
private _loader;
|
|
801
|
+
/**
|
|
802
|
+
* Getter for the meshes of all fragments in the FragmentsManager.
|
|
803
|
+
* It iterates over the fragments in the list and pushes their meshes into an array.
|
|
804
|
+
* @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
|
|
805
|
+
*/
|
|
806
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
1135
807
|
constructor(components: Components);
|
|
808
|
+
/** {@link Disposable.dispose} */
|
|
809
|
+
dispose(): void;
|
|
1136
810
|
/**
|
|
1137
|
-
*
|
|
1138
|
-
*
|
|
1139
|
-
*
|
|
1140
|
-
*
|
|
1141
|
-
* @param visible - The visibility state to set for the fragments.
|
|
1142
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1143
|
-
* If not provided, all fragments will be affected.
|
|
811
|
+
* Dispose of a specific fragment group.
|
|
812
|
+
* This method removes the group from the groups map, deletes all fragments within the group from the list,
|
|
813
|
+
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
1144
814
|
*
|
|
1145
|
-
* @
|
|
815
|
+
* @param group - The fragment group to be disposed.
|
|
816
|
+
*/
|
|
817
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
818
|
+
/**
|
|
819
|
+
* Loads a binary file that contain fragment geometry.
|
|
820
|
+
* @param data - The binary data to load.
|
|
821
|
+
* @param config - Optional configuration for loading.
|
|
822
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
823
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
824
|
+
* @returns The loaded FragmentsGroup.
|
|
825
|
+
*/
|
|
826
|
+
load(data: Uint8Array, config?: Partial<{
|
|
827
|
+
coordinate: boolean;
|
|
828
|
+
name: string;
|
|
829
|
+
properties: FRAGS.IfcProperties;
|
|
830
|
+
relationsMap: RelationsMap;
|
|
831
|
+
}>): FragmentsGroup;
|
|
832
|
+
/**
|
|
833
|
+
* Export the specified fragmentsgroup to binary data.
|
|
834
|
+
* @param group - the fragments group to be exported.
|
|
835
|
+
* @returns the exported data as binary buffer.
|
|
836
|
+
*/
|
|
837
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
838
|
+
/**
|
|
839
|
+
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
840
|
+
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
841
|
+
* @returns A map of model IDs to sets of express IDs.
|
|
1146
842
|
*/
|
|
1147
|
-
|
|
843
|
+
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
844
|
+
[modelID: string]: Set<number>;
|
|
845
|
+
};
|
|
1148
846
|
/**
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
847
|
+
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
848
|
+
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
849
|
+
* @returns A fragment ID map.
|
|
850
|
+
* @remarks
|
|
851
|
+
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
852
|
+
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
853
|
+
* The fragment ID maps are then merged into a single map and returned.
|
|
854
|
+
* If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
|
|
855
|
+
*/
|
|
856
|
+
modelIdToFragmentIdMap(modelIdMap: {
|
|
857
|
+
[modelID: string]: Set<number>;
|
|
858
|
+
}): FRAGS.FragmentIdMap;
|
|
859
|
+
/**
|
|
860
|
+
* Applies coordinate transformation to the provided models.
|
|
861
|
+
* If no models are provided, all groups are used.
|
|
862
|
+
* The first model in the list becomes the base model for coordinate transformation.
|
|
863
|
+
* All other models are then transformed to match the base model's coordinate system.
|
|
1151
864
|
*
|
|
1152
|
-
* @param
|
|
1153
|
-
* If not provided, all
|
|
865
|
+
* @param models - The models to apply coordinate transformation to.
|
|
866
|
+
* If not provided, all groups are used.
|
|
1154
867
|
*
|
|
1155
868
|
* @returns {void}
|
|
1156
869
|
*/
|
|
1157
|
-
|
|
1158
|
-
private updateCulledVisibility;
|
|
870
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
1159
871
|
}
|
|
1160
872
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
1161
873
|
/**
|
|
@@ -1207,70 +919,271 @@ export declare class Exploder extends Component implements Disposable {
|
|
|
1207
919
|
*/
|
|
1208
920
|
set(active: boolean): void;
|
|
1209
921
|
}
|
|
922
|
+
import * as THREE from "three";
|
|
923
|
+
export declare class MaterialsUtils {
|
|
924
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
925
|
+
}
|
|
926
|
+
import * as THREE from "three";
|
|
927
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
928
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
929
|
+
/**
|
|
930
|
+
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
|
|
931
|
+
*/
|
|
932
|
+
export interface Classification {
|
|
933
|
+
/**
|
|
934
|
+
* A system within the classification.
|
|
935
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
936
|
+
*/
|
|
937
|
+
[system: string]: {
|
|
938
|
+
/**
|
|
939
|
+
* A class within the system.
|
|
940
|
+
* The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
|
|
941
|
+
*/
|
|
942
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
947
|
+
*/
|
|
948
|
+
export declare class Classifier extends Component implements Disposable {
|
|
949
|
+
/**
|
|
950
|
+
* A unique identifier for the component.
|
|
951
|
+
* This UUID is used to register the component within the Components system.
|
|
952
|
+
*/
|
|
953
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
954
|
+
/** {@link Component.enabled} */
|
|
955
|
+
enabled: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* A map representing the classification systems.
|
|
958
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
959
|
+
*/
|
|
960
|
+
list: Classification;
|
|
961
|
+
/** {@link Disposable.onDisposed} */
|
|
962
|
+
readonly onDisposed: Event<unknown>;
|
|
963
|
+
constructor(components: Components);
|
|
964
|
+
private onFragmentsDisposed;
|
|
965
|
+
/** {@link Disposable.dispose} */
|
|
966
|
+
dispose(): void;
|
|
967
|
+
/**
|
|
968
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
969
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
970
|
+
*
|
|
971
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
972
|
+
*/
|
|
973
|
+
remove(guid: string): void;
|
|
974
|
+
/**
|
|
975
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
976
|
+
* If no filter is provided, it returns all fragments.
|
|
977
|
+
*
|
|
978
|
+
* @param filter - An optional object containing filter criteria.
|
|
979
|
+
* The keys of the object represent the classification system names,
|
|
980
|
+
* and the values are arrays of class names to match.
|
|
981
|
+
*
|
|
982
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
983
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
984
|
+
*
|
|
985
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
986
|
+
*/
|
|
987
|
+
find(filter?: {
|
|
988
|
+
[name: string]: string[];
|
|
989
|
+
}): FRAGS.FragmentIdMap;
|
|
990
|
+
/**
|
|
991
|
+
* Classifies fragments based on their modelID.
|
|
992
|
+
*
|
|
993
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
994
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
995
|
+
*
|
|
996
|
+
* @remarks
|
|
997
|
+
* This method iterates through the fragments in the provided group,
|
|
998
|
+
* and classifies them based on their modelID.
|
|
999
|
+
* The classification is stored in the 'list.models' property,
|
|
1000
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1001
|
+
*
|
|
1002
|
+
*/
|
|
1003
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
1004
|
+
/**
|
|
1005
|
+
* Classifies fragments based on their PredefinedType property.
|
|
1006
|
+
*
|
|
1007
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1008
|
+
*
|
|
1009
|
+
* @remarks
|
|
1010
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
1011
|
+
* and classifies them based on their PredefinedType property.
|
|
1012
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
1013
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1014
|
+
*
|
|
1015
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
1016
|
+
*/
|
|
1017
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Classifies fragments based on their entity type.
|
|
1020
|
+
*
|
|
1021
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1022
|
+
*
|
|
1023
|
+
* @remarks
|
|
1024
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1025
|
+
* and classifies them based on their entity type.
|
|
1026
|
+
* The classification is stored in the 'list.entities' property,
|
|
1027
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1028
|
+
*
|
|
1029
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
1030
|
+
*/
|
|
1031
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
1032
|
+
/**
|
|
1033
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
1034
|
+
*
|
|
1035
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1036
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
1037
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
1038
|
+
*
|
|
1039
|
+
* @remarks
|
|
1040
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1041
|
+
* and classifies them based on the specified IFC relationship.
|
|
1042
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
1043
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1044
|
+
*
|
|
1045
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
1046
|
+
*/
|
|
1047
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
1050
|
+
*
|
|
1051
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
1052
|
+
*
|
|
1053
|
+
* @remarks
|
|
1054
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1055
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
1056
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
1057
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1058
|
+
*
|
|
1059
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
1060
|
+
*/
|
|
1061
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
1062
|
+
/**
|
|
1063
|
+
* Sets the color of the specified fragments.
|
|
1064
|
+
*
|
|
1065
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1066
|
+
* @param color - The color to set for the fragments.
|
|
1067
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
1068
|
+
*
|
|
1069
|
+
* @remarks
|
|
1070
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1071
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
1072
|
+
*
|
|
1073
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1074
|
+
*/
|
|
1075
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
1076
|
+
/**
|
|
1077
|
+
* Resets the color of the specified fragments to their original color.
|
|
1078
|
+
*
|
|
1079
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1080
|
+
*
|
|
1081
|
+
* @remarks
|
|
1082
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1083
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
1084
|
+
*
|
|
1085
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1086
|
+
*/
|
|
1087
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1088
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
1089
|
+
}
|
|
1210
1090
|
import * as WEBIFC from "web-ifc";
|
|
1211
|
-
import {
|
|
1212
|
-
import {
|
|
1091
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1092
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1213
1093
|
/**
|
|
1214
|
-
* A component that
|
|
1094
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1215
1095
|
*/
|
|
1216
|
-
export declare class
|
|
1096
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1217
1097
|
/**
|
|
1218
1098
|
* A unique identifier for the component.
|
|
1219
1099
|
* This UUID is used to register the component within the Components system.
|
|
1220
1100
|
*/
|
|
1221
|
-
static readonly uuid: "
|
|
1101
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1222
1102
|
/**
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1103
|
+
* Event triggered when geometry is streamed.
|
|
1104
|
+
* Contains the streamed geometry data and its buffer.
|
|
1225
1105
|
*/
|
|
1226
|
-
readonly
|
|
1227
|
-
|
|
1228
|
-
data:
|
|
1229
|
-
[id: number]: any;
|
|
1230
|
-
};
|
|
1106
|
+
readonly onGeometryStreamed: Event<{
|
|
1107
|
+
buffer: Uint8Array;
|
|
1108
|
+
data: StreamedGeometries;
|
|
1231
1109
|
}>;
|
|
1232
1110
|
/**
|
|
1233
|
-
*
|
|
1234
|
-
*
|
|
1111
|
+
* Event triggered when assets are streamed.
|
|
1112
|
+
* Contains the streamed assets.
|
|
1235
1113
|
*/
|
|
1236
|
-
readonly
|
|
1114
|
+
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1237
1115
|
/**
|
|
1238
|
-
*
|
|
1239
|
-
*
|
|
1116
|
+
* Event triggered to indicate the progress of the streaming process.
|
|
1117
|
+
* Contains the progress percentage.
|
|
1240
1118
|
*/
|
|
1241
|
-
readonly
|
|
1119
|
+
readonly onProgress: Event<number>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Event triggered when the IFC file is loaded.
|
|
1122
|
+
* Contains the loaded IFC file data.
|
|
1123
|
+
*/
|
|
1124
|
+
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1242
1125
|
/** {@link Disposable.onDisposed} */
|
|
1243
|
-
readonly onDisposed: Event<
|
|
1244
|
-
/** {@link Component.enabled} */
|
|
1245
|
-
enabled: boolean;
|
|
1126
|
+
readonly onDisposed: Event<unknown>;
|
|
1246
1127
|
/**
|
|
1247
|
-
*
|
|
1128
|
+
* Settings for the IfcGeometryTiler.
|
|
1248
1129
|
*/
|
|
1249
|
-
settings:
|
|
1130
|
+
settings: IfcStreamingSettings;
|
|
1131
|
+
/** {@link Component.enabled} */
|
|
1132
|
+
enabled: boolean;
|
|
1250
1133
|
/**
|
|
1251
|
-
*
|
|
1134
|
+
* The WebIFC API instance used for IFC file processing.
|
|
1252
1135
|
*/
|
|
1253
1136
|
webIfc: WEBIFC.IfcAPI;
|
|
1137
|
+
private _spatialTree;
|
|
1138
|
+
private _metaData;
|
|
1139
|
+
private _visitedGeometries;
|
|
1140
|
+
private _streamSerializer;
|
|
1141
|
+
private _geometries;
|
|
1142
|
+
private _geometryCount;
|
|
1143
|
+
private _civil;
|
|
1144
|
+
private _groupSerializer;
|
|
1145
|
+
private _assets;
|
|
1146
|
+
private _meshesWithHoles;
|
|
1147
|
+
constructor(components: Components);
|
|
1254
1148
|
/** {@link Disposable.dispose} */
|
|
1255
|
-
dispose():
|
|
1149
|
+
dispose(): void;
|
|
1256
1150
|
/**
|
|
1257
|
-
* This method
|
|
1151
|
+
* This method streams the IFC file from a given buffer.
|
|
1258
1152
|
*
|
|
1259
1153
|
* @param data - The Uint8Array containing the IFC file data.
|
|
1260
1154
|
* @returns A Promise that resolves when the streaming process is complete.
|
|
1155
|
+
*
|
|
1156
|
+
* @remarks
|
|
1157
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1158
|
+
*
|
|
1159
|
+
* @example
|
|
1160
|
+
* '''typescript
|
|
1161
|
+
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1162
|
+
* const rawBuffer = await response.arrayBuffer();
|
|
1163
|
+
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1164
|
+
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1165
|
+
* '''
|
|
1261
1166
|
*/
|
|
1262
1167
|
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1263
1168
|
/**
|
|
1264
|
-
* This method
|
|
1169
|
+
* This method streams the IFC file from a given callback.
|
|
1265
1170
|
*
|
|
1266
|
-
* @param loadCallback -
|
|
1171
|
+
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1267
1172
|
* @returns A Promise that resolves when the streaming process is complete.
|
|
1173
|
+
*
|
|
1174
|
+
* @remarks
|
|
1175
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1176
|
+
*
|
|
1268
1177
|
*/
|
|
1269
1178
|
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1270
1179
|
private readIfcFile;
|
|
1271
1180
|
private streamIfcFile;
|
|
1272
|
-
private
|
|
1181
|
+
private streamAllGeometries;
|
|
1273
1182
|
private cleanUp;
|
|
1183
|
+
private getMesh;
|
|
1184
|
+
private getGeometry;
|
|
1185
|
+
private streamAssets;
|
|
1186
|
+
private streamGeometries;
|
|
1274
1187
|
}
|
|
1275
1188
|
import * as WEBIFC from "web-ifc";
|
|
1276
1189
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -1387,215 +1300,244 @@ export declare class IfcLoader extends Component implements Disposable {
|
|
|
1387
1300
|
private getGeometry;
|
|
1388
1301
|
private autoSetWasm;
|
|
1389
1302
|
}
|
|
1390
|
-
import
|
|
1391
|
-
import
|
|
1392
|
-
import
|
|
1393
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
1394
|
-
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1303
|
+
import * as WEBIFC from "web-ifc";
|
|
1304
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1305
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1395
1306
|
/**
|
|
1396
|
-
*
|
|
1307
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1397
1308
|
*/
|
|
1398
|
-
export declare class
|
|
1309
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1399
1310
|
/**
|
|
1400
1311
|
* A unique identifier for the component.
|
|
1401
1312
|
* This UUID is used to register the component within the Components system.
|
|
1402
1313
|
*/
|
|
1403
|
-
static readonly uuid: "
|
|
1404
|
-
/** {@link Disposable.onDisposed} */
|
|
1405
|
-
readonly onDisposed: Event<unknown>;
|
|
1406
|
-
/**
|
|
1407
|
-
* Event triggered when fragments are loaded.
|
|
1408
|
-
*/
|
|
1409
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1314
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1410
1315
|
/**
|
|
1411
|
-
*
|
|
1316
|
+
* An event that is triggered when properties are streamed from the IFC file.
|
|
1317
|
+
* The event provides the type of the IFC entity and the corresponding data.
|
|
1412
1318
|
*/
|
|
1413
|
-
readonly
|
|
1414
|
-
|
|
1415
|
-
|
|
1319
|
+
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1320
|
+
type: number;
|
|
1321
|
+
data: {
|
|
1322
|
+
[id: number]: any;
|
|
1323
|
+
};
|
|
1416
1324
|
}>;
|
|
1417
1325
|
/**
|
|
1418
|
-
*
|
|
1419
|
-
* The
|
|
1326
|
+
* An event that is triggered to indicate the progress of the streaming process.
|
|
1327
|
+
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1420
1328
|
*/
|
|
1421
|
-
readonly
|
|
1329
|
+
readonly onProgress: AsyncEvent<number>;
|
|
1422
1330
|
/**
|
|
1423
|
-
*
|
|
1424
|
-
* The key is the
|
|
1331
|
+
* An event that is triggered when indices are streamed from the IFC file.
|
|
1332
|
+
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1425
1333
|
*/
|
|
1426
|
-
readonly
|
|
1427
|
-
|
|
1334
|
+
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1335
|
+
/** {@link Disposable.onDisposed} */
|
|
1336
|
+
readonly onDisposed: Event<string>;
|
|
1428
1337
|
/** {@link Component.enabled} */
|
|
1429
1338
|
enabled: boolean;
|
|
1430
|
-
private _loader;
|
|
1431
1339
|
/**
|
|
1432
|
-
*
|
|
1433
|
-
* It iterates over the fragments in the list and pushes their meshes into an array.
|
|
1434
|
-
* @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
|
|
1340
|
+
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1435
1341
|
*/
|
|
1436
|
-
|
|
1437
|
-
|
|
1342
|
+
settings: PropertiesStreamingSettings;
|
|
1343
|
+
/**
|
|
1344
|
+
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1345
|
+
*/
|
|
1346
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1438
1347
|
/** {@link Disposable.dispose} */
|
|
1439
|
-
dispose(): void
|
|
1348
|
+
dispose(): Promise<void>;
|
|
1440
1349
|
/**
|
|
1441
|
-
*
|
|
1442
|
-
* This method removes the group from the groups map, deletes all fragments within the group from the list,
|
|
1443
|
-
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
1350
|
+
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1444
1351
|
*
|
|
1445
|
-
* @param
|
|
1352
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1353
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1446
1354
|
*/
|
|
1447
|
-
|
|
1355
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1448
1356
|
/**
|
|
1449
|
-
*
|
|
1450
|
-
*
|
|
1451
|
-
* @param
|
|
1452
|
-
* @
|
|
1453
|
-
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
1454
|
-
* @returns The loaded FragmentsGroup.
|
|
1357
|
+
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1358
|
+
*
|
|
1359
|
+
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1360
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1455
1361
|
*/
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1362
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1363
|
+
private readIfcFile;
|
|
1364
|
+
private streamIfcFile;
|
|
1365
|
+
private streamAllProperties;
|
|
1366
|
+
private cleanUp;
|
|
1367
|
+
}
|
|
1368
|
+
import * as THREE from "three";
|
|
1369
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1370
|
+
import { Component, Components } from "../../core";
|
|
1371
|
+
/**
|
|
1372
|
+
* Represents an edge measurement result.
|
|
1373
|
+
*/
|
|
1374
|
+
export interface MeasureEdge {
|
|
1462
1375
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
* @param group - the fragments group to be exported.
|
|
1465
|
-
* @returns the exported data as binary buffer.
|
|
1376
|
+
* The distance between the two points of the edge.
|
|
1466
1377
|
*/
|
|
1467
|
-
|
|
1378
|
+
distance: number;
|
|
1468
1379
|
/**
|
|
1469
|
-
*
|
|
1470
|
-
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
1471
|
-
* @returns A map of model IDs to sets of express IDs.
|
|
1380
|
+
* The two points that define the edge.
|
|
1472
1381
|
*/
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1382
|
+
points: THREE.Vector3[];
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* 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).
|
|
1386
|
+
*/
|
|
1387
|
+
export declare class MeasurementUtils extends Component {
|
|
1476
1388
|
/**
|
|
1477
|
-
*
|
|
1478
|
-
*
|
|
1479
|
-
* @returns A fragment ID map.
|
|
1480
|
-
* @remarks
|
|
1481
|
-
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
1482
|
-
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
1483
|
-
* The fragment ID maps are then merged into a single map and returned.
|
|
1484
|
-
* If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
|
|
1389
|
+
* A unique identifier for the component.
|
|
1390
|
+
* This UUID is used to register the component within the Components system.
|
|
1485
1391
|
*/
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1392
|
+
static uuid: string;
|
|
1393
|
+
/** {@link Component.enabled} */
|
|
1394
|
+
enabled: boolean;
|
|
1395
|
+
constructor(components: Components);
|
|
1489
1396
|
/**
|
|
1490
|
-
*
|
|
1491
|
-
* If no models are provided, all groups are used.
|
|
1492
|
-
* The first model in the list becomes the base model for coordinate transformation.
|
|
1493
|
-
* All other models are then transformed to match the base model's coordinate system.
|
|
1397
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
1494
1398
|
*
|
|
1495
|
-
* @param
|
|
1496
|
-
*
|
|
1399
|
+
* @param point - The point from which to calculate the distance.
|
|
1400
|
+
* @param lineStart - The start point of the line segment.
|
|
1401
|
+
* @param lineEnd - The end point of the line segment.
|
|
1402
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1403
|
+
* @returns The distance from the point to the line segment.
|
|
1404
|
+
*/
|
|
1405
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1406
|
+
/**
|
|
1407
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
1408
|
+
* It also returns the edges of the found face and their indices.
|
|
1497
1409
|
*
|
|
1498
|
-
* @
|
|
1410
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1411
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1412
|
+
* @param instance - The instance of the mesh (optional).
|
|
1413
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1499
1414
|
*/
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1505
|
-
/**
|
|
1506
|
-
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1507
|
-
*/
|
|
1508
|
-
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1415
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1416
|
+
edges: MeasureEdge[];
|
|
1417
|
+
indices: Set<number>;
|
|
1418
|
+
} | null;
|
|
1509
1419
|
/**
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1420
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1421
|
+
* It also applies instance transformation if provided.
|
|
1422
|
+
*
|
|
1423
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1424
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
1425
|
+
* @param instance - The instance of the mesh (optional).
|
|
1426
|
+
* @returns An object containing the vertices and normal of the face.
|
|
1427
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
1512
1428
|
*/
|
|
1513
|
-
|
|
1429
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1430
|
+
p1: THREE.Vector3;
|
|
1431
|
+
p2: THREE.Vector3;
|
|
1432
|
+
p3: THREE.Vector3;
|
|
1433
|
+
faceNormal: THREE.Vector3;
|
|
1434
|
+
};
|
|
1514
1435
|
/**
|
|
1515
|
-
*
|
|
1516
|
-
*
|
|
1436
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
1437
|
+
* This is used to ensure numerical precision in edge detection.
|
|
1438
|
+
*
|
|
1439
|
+
* @param vector - The vector to round.
|
|
1440
|
+
* @returns The vector with rounded components.
|
|
1517
1441
|
*/
|
|
1518
|
-
|
|
1519
|
-
buffer: Uint8Array;
|
|
1520
|
-
data: StreamedGeometries;
|
|
1521
|
-
}>;
|
|
1442
|
+
round(vector: THREE.Vector3): void;
|
|
1522
1443
|
/**
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1444
|
+
* Calculates the volume of a set of fragments.
|
|
1445
|
+
*
|
|
1446
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1447
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
1448
|
+
*
|
|
1449
|
+
* @remarks
|
|
1450
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1451
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1452
|
+
*
|
|
1453
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1454
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
1525
1455
|
*/
|
|
1526
|
-
|
|
1456
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): {
|
|
1457
|
+
volume: number;
|
|
1458
|
+
sphere: THREE.Sphere;
|
|
1459
|
+
};
|
|
1460
|
+
/**
|
|
1461
|
+
* Calculates the total volume of a set of meshes.
|
|
1462
|
+
*
|
|
1463
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1464
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
1465
|
+
*
|
|
1466
|
+
* @remarks
|
|
1467
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1468
|
+
* and its bounding sphere.
|
|
1469
|
+
*
|
|
1470
|
+
*/
|
|
1471
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): {
|
|
1472
|
+
volume: number;
|
|
1473
|
+
sphere: THREE.Sphere;
|
|
1474
|
+
};
|
|
1475
|
+
private getFaceData;
|
|
1476
|
+
private getVolumeOfMesh;
|
|
1477
|
+
private getSignedVolumeOfTriangle;
|
|
1478
|
+
}
|
|
1479
|
+
import * as WEBIFC from "web-ifc";
|
|
1480
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1481
|
+
import { Component, Components } from "../../core";
|
|
1482
|
+
/**
|
|
1483
|
+
* 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).
|
|
1484
|
+
*/
|
|
1485
|
+
export declare class IfcJsonExporter extends Component {
|
|
1527
1486
|
/**
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1487
|
+
* A unique identifier for the component.
|
|
1488
|
+
* This UUID is used to register the component within the Components system.
|
|
1530
1489
|
*/
|
|
1531
|
-
readonly
|
|
1490
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1491
|
+
/** {@link Component.enabled} */
|
|
1492
|
+
enabled: boolean;
|
|
1493
|
+
constructor(components: Components);
|
|
1532
1494
|
/**
|
|
1533
|
-
*
|
|
1534
|
-
*
|
|
1495
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1496
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1497
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1498
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1499
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1500
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1535
1501
|
*/
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1502
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1503
|
+
}
|
|
1504
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1505
|
+
import { Components, Component } from "../../core";
|
|
1506
|
+
/**
|
|
1507
|
+
* 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).
|
|
1508
|
+
*/
|
|
1509
|
+
export declare class Hider extends Component {
|
|
1539
1510
|
/**
|
|
1540
|
-
*
|
|
1511
|
+
* A unique identifier for the component.
|
|
1512
|
+
* This UUID is used to register the component within the Components system.
|
|
1541
1513
|
*/
|
|
1542
|
-
|
|
1514
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1543
1515
|
/** {@link Component.enabled} */
|
|
1544
1516
|
enabled: boolean;
|
|
1545
|
-
/**
|
|
1546
|
-
* The WebIFC API instance used for IFC file processing.
|
|
1547
|
-
*/
|
|
1548
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1549
|
-
private _spatialTree;
|
|
1550
|
-
private _metaData;
|
|
1551
|
-
private _visitedGeometries;
|
|
1552
|
-
private _streamSerializer;
|
|
1553
|
-
private _geometries;
|
|
1554
|
-
private _geometryCount;
|
|
1555
|
-
private _civil;
|
|
1556
|
-
private _groupSerializer;
|
|
1557
|
-
private _assets;
|
|
1558
|
-
private _meshesWithHoles;
|
|
1559
1517
|
constructor(components: Components);
|
|
1560
|
-
/** {@link Disposable.dispose} */
|
|
1561
|
-
dispose(): void;
|
|
1562
1518
|
/**
|
|
1563
|
-
*
|
|
1564
|
-
*
|
|
1565
|
-
*
|
|
1566
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1519
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1520
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1521
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1567
1522
|
*
|
|
1568
|
-
* @
|
|
1569
|
-
*
|
|
1523
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1524
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1525
|
+
* If not provided, all fragments will be affected.
|
|
1570
1526
|
*
|
|
1571
|
-
* @
|
|
1572
|
-
* '''typescript
|
|
1573
|
-
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1574
|
-
* const rawBuffer = await response.arrayBuffer();
|
|
1575
|
-
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1576
|
-
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1577
|
-
* '''
|
|
1527
|
+
* @returns {void}
|
|
1578
1528
|
*/
|
|
1579
|
-
|
|
1529
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1580
1530
|
/**
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1583
|
-
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1584
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1531
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1532
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1585
1533
|
*
|
|
1586
|
-
* @
|
|
1587
|
-
*
|
|
1534
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1535
|
+
* If not provided, all fragments will be isolated.
|
|
1588
1536
|
*
|
|
1537
|
+
* @returns {void}
|
|
1589
1538
|
*/
|
|
1590
|
-
|
|
1591
|
-
private
|
|
1592
|
-
private streamIfcFile;
|
|
1593
|
-
private streamAllGeometries;
|
|
1594
|
-
private cleanUp;
|
|
1595
|
-
private getMesh;
|
|
1596
|
-
private getGeometry;
|
|
1597
|
-
private streamAssets;
|
|
1598
|
-
private streamGeometries;
|
|
1539
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1540
|
+
private updateCulledVisibility;
|
|
1599
1541
|
}
|
|
1600
1542
|
import * as WEBIFC from "web-ifc";
|
|
1601
1543
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
@@ -1994,133 +1936,129 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
1994
1936
|
private registerChange;
|
|
1995
1937
|
private newSingleProperty;
|
|
1996
1938
|
}
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
1939
|
+
export declare class UUID {
|
|
1940
|
+
private static _pattern;
|
|
1941
|
+
private static _lut;
|
|
1942
|
+
static create(): string;
|
|
1943
|
+
static validate(uuid: string): void;
|
|
1944
|
+
}
|
|
1945
|
+
import * as THREE from "three";
|
|
1946
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
2000
1947
|
/**
|
|
2001
|
-
*
|
|
1948
|
+
* Configuration interface for the VertexPicker component.
|
|
2002
1949
|
*/
|
|
2003
|
-
export
|
|
1950
|
+
export interface VertexPickerConfig {
|
|
2004
1951
|
/**
|
|
2005
|
-
*
|
|
2006
|
-
* This UUID is used to register the component within the Components system.
|
|
1952
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
2007
1953
|
*/
|
|
2008
|
-
|
|
2009
|
-
/** {@link Component.enabled} */
|
|
2010
|
-
enabled: boolean;
|
|
2011
|
-
constructor(components: Components);
|
|
1954
|
+
showOnlyVertex: boolean;
|
|
2012
1955
|
/**
|
|
2013
|
-
*
|
|
2014
|
-
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
2015
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
2016
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
2017
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
2018
|
-
* to make the location data available (e.g. absolute position of building).
|
|
1956
|
+
* The maximum distance for snapping to a vertex.
|
|
2019
1957
|
*/
|
|
2020
|
-
|
|
1958
|
+
snapDistance: number;
|
|
1959
|
+
/**
|
|
1960
|
+
* The HTML element to use for previewing the picked vertex.
|
|
1961
|
+
*/
|
|
1962
|
+
previewElement: HTMLElement;
|
|
2021
1963
|
}
|
|
2022
|
-
import * as THREE from "three";
|
|
2023
|
-
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2024
1964
|
/**
|
|
2025
|
-
* A class
|
|
1965
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
2026
1966
|
*/
|
|
2027
|
-
export declare class
|
|
1967
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
2028
1968
|
/** {@link Disposable.onDisposed} */
|
|
2029
1969
|
readonly onDisposed: Event<unknown>;
|
|
2030
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2031
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2032
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2033
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2034
|
-
/** {@link Resizeable.onResize} */
|
|
2035
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
2036
|
-
/**
|
|
2037
|
-
* The front offset of the minimap.
|
|
2038
|
-
* It determines how much the minimap's view is offset from the camera's view.
|
|
2039
|
-
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
2040
|
-
*/
|
|
2041
|
-
frontOffset: number;
|
|
2042
|
-
/**
|
|
2043
|
-
* The override material for the minimap.
|
|
2044
|
-
* It is used to render the depth information of the world onto the minimap.
|
|
2045
|
-
*/
|
|
2046
|
-
overrideMaterial: THREE.MeshDepthMaterial;
|
|
2047
1970
|
/**
|
|
2048
|
-
*
|
|
2049
|
-
*
|
|
1971
|
+
* An event that is triggered when a vertex is found.
|
|
1972
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
2050
1973
|
*/
|
|
2051
|
-
|
|
1974
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
2052
1975
|
/**
|
|
2053
|
-
*
|
|
2054
|
-
*
|
|
1976
|
+
* An event that is triggered when a vertex is lost.
|
|
1977
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
2055
1978
|
*/
|
|
2056
|
-
|
|
1979
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
2057
1980
|
/**
|
|
2058
|
-
* A
|
|
2059
|
-
* If disabled, the minimap will not update or render.
|
|
1981
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
2060
1982
|
*/
|
|
2061
|
-
|
|
1983
|
+
components: Components;
|
|
2062
1984
|
/**
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
1985
|
+
* A reference to the working plane used for vertex picking.
|
|
1986
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
1987
|
+
* If this value is null, all vertices are considered valid.
|
|
2065
1988
|
*/
|
|
2066
|
-
|
|
2067
|
-
private
|
|
2068
|
-
private
|
|
2069
|
-
private
|
|
2070
|
-
private _size;
|
|
2071
|
-
private _tempVector1;
|
|
2072
|
-
private _tempVector2;
|
|
2073
|
-
private _tempTarget;
|
|
2074
|
-
private readonly down;
|
|
1989
|
+
workingPlane: THREE.Plane | null;
|
|
1990
|
+
private _pickedPoint;
|
|
1991
|
+
private _config;
|
|
1992
|
+
private _enabled;
|
|
2075
1993
|
/**
|
|
2076
|
-
*
|
|
2077
|
-
* When
|
|
1994
|
+
* Sets the enabled state of the VertexPicker.
|
|
1995
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1996
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1997
|
+
*
|
|
1998
|
+
* @param value - The new enabled state.
|
|
2078
1999
|
*/
|
|
2079
|
-
|
|
2000
|
+
set enabled(value: boolean);
|
|
2080
2001
|
/**
|
|
2081
|
-
*
|
|
2082
|
-
*
|
|
2083
|
-
* @
|
|
2002
|
+
* Gets the current enabled state of the VertexPicker.
|
|
2003
|
+
*
|
|
2004
|
+
* @returns The current enabled state.
|
|
2084
2005
|
*/
|
|
2085
|
-
|
|
2006
|
+
get enabled(): boolean;
|
|
2086
2007
|
/**
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
2089
|
-
* @
|
|
2008
|
+
* Sets the configuration for the VertexPicker component.
|
|
2009
|
+
*
|
|
2010
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
2011
|
+
* The properties not provided in the value object will retain their current values.
|
|
2012
|
+
*
|
|
2013
|
+
* @example
|
|
2014
|
+
* '''typescript
|
|
2015
|
+
* vertexPicker.config = {
|
|
2016
|
+
* snapDistance: 0.5,
|
|
2017
|
+
* showOnlyVertex: true,
|
|
2018
|
+
* };
|
|
2019
|
+
* '''
|
|
2090
2020
|
*/
|
|
2091
|
-
|
|
2021
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
2092
2022
|
/**
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2095
|
-
* @
|
|
2023
|
+
* Gets the current configuration for the VertexPicker component.
|
|
2024
|
+
*
|
|
2025
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
2026
|
+
*
|
|
2027
|
+
* @example
|
|
2028
|
+
* '''typescript
|
|
2029
|
+
* const currentConfig = vertexPicker.config;
|
|
2030
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
2031
|
+
* '''
|
|
2096
2032
|
*/
|
|
2097
|
-
|
|
2098
|
-
constructor(
|
|
2033
|
+
get config(): Partial<VertexPickerConfig>;
|
|
2034
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
2099
2035
|
/** {@link Disposable.dispose} */
|
|
2100
2036
|
dispose(): void;
|
|
2101
|
-
/**
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2037
|
+
/**
|
|
2038
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
2039
|
+
*
|
|
2040
|
+
* @param world - The World instance to use for raycasting.
|
|
2041
|
+
*
|
|
2042
|
+
* @returns The current picked point, or null if no point is picked.
|
|
2043
|
+
*
|
|
2044
|
+
* @remarks
|
|
2045
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
2046
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
2047
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
2048
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
2049
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
2050
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
2051
|
+
*/
|
|
2052
|
+
get(world: World): THREE.Vector3 | null;
|
|
2053
|
+
private getClosestVertex;
|
|
2054
|
+
private getVertices;
|
|
2055
|
+
private getVertex;
|
|
2110
2056
|
}
|
|
2111
2057
|
/**
|
|
2112
2058
|
* A Set of unique numbers representing different types of IFC geometries.
|
|
2113
2059
|
*/
|
|
2114
2060
|
export declare const GeometryTypes: Set<number>;
|
|
2115
2061
|
import * as WEBIFC from "web-ifc";
|
|
2116
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
2117
|
-
export declare class SpatialStructure {
|
|
2118
|
-
itemsByFloor: IfcItemsCategories;
|
|
2119
|
-
private _units;
|
|
2120
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2121
|
-
cleanUp(): void;
|
|
2122
|
-
}
|
|
2123
|
-
import * as WEBIFC from "web-ifc";
|
|
2124
2062
|
/** Configuration of the IFC-fragment conversion. */
|
|
2125
2063
|
export declare class IfcFragmentSettings {
|
|
2126
2064
|
/** Whether to extract the IFC properties into a JSON. */
|
|
@@ -2161,288 +2099,179 @@ export declare class IfcFragmentSettings {
|
|
|
2161
2099
|
*/
|
|
2162
2100
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2163
2101
|
}
|
|
2164
|
-
import * as WEBIFC from "web-ifc";
|
|
2165
|
-
export interface IfcItemsCategories {
|
|
2166
|
-
[itemID: number]: number;
|
|
2167
|
-
}
|
|
2168
|
-
export declare class IfcCategories {
|
|
2169
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2170
|
-
}
|
|
2171
|
-
/**
|
|
2172
|
-
* 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.
|
|
2173
|
-
*
|
|
2174
|
-
* @remarks
|
|
2175
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2176
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2177
|
-
*
|
|
2178
|
-
*/
|
|
2179
|
-
export declare const IfcElements: {
|
|
2180
|
-
[key: number]: string;
|
|
2181
|
-
};
|
|
2182
|
-
/**
|
|
2183
|
-
* 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.
|
|
2184
|
-
*/
|
|
2185
|
-
export declare const IfcCategoryMap: {
|
|
2186
|
-
[key: number]: string;
|
|
2187
|
-
};
|
|
2188
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2189
|
-
export declare class IfcPropertiesUtils {
|
|
2190
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2191
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2192
|
-
[attribute: string]: any;
|
|
2193
|
-
} | null>;
|
|
2194
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2195
|
-
[relatingID: number]: number[];
|
|
2196
|
-
}>;
|
|
2197
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2198
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2199
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2200
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2201
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2202
|
-
key: string | null;
|
|
2203
|
-
name: string | null;
|
|
2204
|
-
}>;
|
|
2205
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2206
|
-
key: string | null;
|
|
2207
|
-
value: number | null;
|
|
2208
|
-
}>;
|
|
2209
|
-
static isRel(expressID: number): boolean;
|
|
2210
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2211
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2212
|
-
}
|
|
2213
2102
|
import * as THREE from "three";
|
|
2214
|
-
import {
|
|
2103
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2215
2104
|
/**
|
|
2216
|
-
* A class representing a
|
|
2217
|
-
*
|
|
2218
|
-
* @template T - The type of the scene. Default is BaseScene.
|
|
2219
|
-
* @template U - The type of the camera. Default is BaseCamera.
|
|
2220
|
-
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2105
|
+
* A class representing a 2D minimap of a 3D world.
|
|
2221
2106
|
*/
|
|
2222
|
-
export declare class
|
|
2223
|
-
/**
|
|
2224
|
-
|
|
2225
|
-
*/
|
|
2226
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2107
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
2108
|
+
/** {@link Disposable.onDisposed} */
|
|
2109
|
+
readonly onDisposed: Event<unknown>;
|
|
2227
2110
|
/** {@link Updateable.onAfterUpdate} */
|
|
2228
2111
|
readonly onAfterUpdate: Event<unknown>;
|
|
2229
2112
|
/** {@link Updateable.onBeforeUpdate} */
|
|
2230
2113
|
readonly onBeforeUpdate: Event<unknown>;
|
|
2231
|
-
/** {@link
|
|
2232
|
-
readonly
|
|
2233
|
-
/**
|
|
2234
|
-
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
2235
|
-
*/
|
|
2236
|
-
isDisposing: boolean;
|
|
2237
|
-
/**
|
|
2238
|
-
* Indicates whether the world is currently enabled.
|
|
2239
|
-
* When disabled, the world will not be updated.
|
|
2240
|
-
*/
|
|
2241
|
-
enabled: boolean;
|
|
2242
|
-
/**
|
|
2243
|
-
* A unique identifier for the world.
|
|
2244
|
-
*/
|
|
2245
|
-
uuid: string;
|
|
2246
|
-
/**
|
|
2247
|
-
* An optional name for the world.
|
|
2248
|
-
*/
|
|
2249
|
-
name?: string;
|
|
2250
|
-
private _scene?;
|
|
2251
|
-
private _camera?;
|
|
2252
|
-
private _renderer;
|
|
2253
|
-
/**
|
|
2254
|
-
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
2255
|
-
* @returns The current scene.
|
|
2256
|
-
*/
|
|
2257
|
-
get scene(): T;
|
|
2258
|
-
/**
|
|
2259
|
-
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
2260
|
-
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
2261
|
-
* @param scene - The new scene to be set.
|
|
2262
|
-
*/
|
|
2263
|
-
set scene(scene: T);
|
|
2264
|
-
/**
|
|
2265
|
-
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
2266
|
-
* @returns The current camera.
|
|
2267
|
-
*/
|
|
2268
|
-
get camera(): U;
|
|
2269
|
-
/**
|
|
2270
|
-
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
2271
|
-
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
2272
|
-
* @param camera - The new camera to be set.
|
|
2273
|
-
*/
|
|
2274
|
-
set camera(camera: U);
|
|
2275
|
-
/**
|
|
2276
|
-
* Getter for the renderer.
|
|
2277
|
-
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
2278
|
-
*/
|
|
2279
|
-
get renderer(): S | null;
|
|
2280
|
-
/**
|
|
2281
|
-
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
2282
|
-
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
2283
|
-
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
2284
|
-
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
2285
|
-
*/
|
|
2286
|
-
set renderer(renderer: S | null);
|
|
2287
|
-
/** {@link Updateable.update} */
|
|
2288
|
-
update(delta?: number): void;
|
|
2289
|
-
/** {@link Disposable.dispose} */
|
|
2290
|
-
dispose(disposeResources?: boolean): void;
|
|
2291
|
-
}
|
|
2292
|
-
import * as THREE from "three";
|
|
2293
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2294
|
-
import { Components } from "../../Components";
|
|
2295
|
-
/**
|
|
2296
|
-
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
2297
|
-
*/
|
|
2298
|
-
export interface SimpleSceneConfig {
|
|
2299
|
-
directionalLight: {
|
|
2300
|
-
color: THREE.Color;
|
|
2301
|
-
intensity: number;
|
|
2302
|
-
position: THREE.Vector3;
|
|
2303
|
-
};
|
|
2304
|
-
ambientLight: {
|
|
2305
|
-
color: THREE.Color;
|
|
2306
|
-
intensity: number;
|
|
2307
|
-
};
|
|
2308
|
-
}
|
|
2309
|
-
/**
|
|
2310
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
2311
|
-
*/
|
|
2312
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2313
|
-
/** {@link Configurable.isSetup} */
|
|
2314
|
-
isSetup: boolean;
|
|
2315
|
-
/**
|
|
2316
|
-
* The underlying Three.js scene object.
|
|
2317
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2318
|
-
*/
|
|
2319
|
-
three: THREE.Scene;
|
|
2320
|
-
/** {@link Configurable.onSetup} */
|
|
2321
|
-
readonly onSetup: Event<SimpleScene>;
|
|
2322
|
-
/**
|
|
2323
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
2324
|
-
* Defines properties for directional and ambient lights.
|
|
2325
|
-
*/
|
|
2326
|
-
config: Required<SimpleSceneConfig>;
|
|
2327
|
-
constructor(components: Components);
|
|
2328
|
-
/** {@link Configurable.setup} */
|
|
2329
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2330
|
-
}
|
|
2331
|
-
import * as THREE from "three";
|
|
2332
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
2333
|
-
import { Components } from "../../Components";
|
|
2334
|
-
/**
|
|
2335
|
-
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2336
|
-
*/
|
|
2337
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
2338
|
-
/**
|
|
2339
|
-
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2340
|
-
* Default is 'true'.
|
|
2341
|
-
*/
|
|
2342
|
-
enabled: boolean;
|
|
2343
|
-
/**
|
|
2344
|
-
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2345
|
-
*/
|
|
2346
|
-
container: HTMLElement;
|
|
2114
|
+
/** {@link Resizeable.onResize} */
|
|
2115
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
2347
2116
|
/**
|
|
2348
|
-
* The
|
|
2117
|
+
* The front offset of the minimap.
|
|
2118
|
+
* It determines how much the minimap's view is offset from the camera's view.
|
|
2119
|
+
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
2349
2120
|
*/
|
|
2350
|
-
|
|
2351
|
-
protected _canvas: HTMLCanvasElement;
|
|
2352
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2353
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
2354
|
-
protected onContainerUpdated: Event<unknown>;
|
|
2355
|
-
private _resizing;
|
|
2121
|
+
frontOffset: number;
|
|
2356
2122
|
/**
|
|
2357
|
-
*
|
|
2358
|
-
*
|
|
2359
|
-
* @param components - The components instance.
|
|
2360
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2361
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2123
|
+
* The override material for the minimap.
|
|
2124
|
+
* It is used to render the depth information of the world onto the minimap.
|
|
2362
2125
|
*/
|
|
2363
|
-
|
|
2364
|
-
/** {@link Updateable.update} */
|
|
2365
|
-
update(): void;
|
|
2366
|
-
/** {@link Disposable.dispose} */
|
|
2367
|
-
dispose(): void;
|
|
2368
|
-
/** {@link Resizeable.getSize}. */
|
|
2369
|
-
getSize(): THREE.Vector2;
|
|
2370
|
-
/** {@link Resizeable.resize} */
|
|
2371
|
-
resize: (size?: THREE.Vector2) => void;
|
|
2126
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
2372
2127
|
/**
|
|
2373
|
-
*
|
|
2374
|
-
*
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2378
|
-
*/
|
|
2379
|
-
setupEvents(active: boolean): void;
|
|
2380
|
-
private resizeEvent;
|
|
2381
|
-
private setupRenderer;
|
|
2382
|
-
private onContextLost;
|
|
2383
|
-
private onContextBack;
|
|
2384
|
-
}
|
|
2385
|
-
import * as THREE from "three";
|
|
2386
|
-
import CameraControls from "camera-controls";
|
|
2387
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2388
|
-
import { Components } from "../../Components";
|
|
2389
|
-
/**
|
|
2390
|
-
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
2391
|
-
*/
|
|
2392
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
2393
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2394
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2395
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2396
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2128
|
+
* The background color of the minimap.
|
|
2129
|
+
* It is used to set the background color of the minimap's renderer.
|
|
2130
|
+
*/
|
|
2131
|
+
backgroundColor: THREE.Color;
|
|
2397
2132
|
/**
|
|
2398
|
-
*
|
|
2399
|
-
*
|
|
2133
|
+
* The WebGL renderer for the minimap.
|
|
2134
|
+
* It is used to render the minimap onto the screen.
|
|
2400
2135
|
*/
|
|
2401
|
-
|
|
2402
|
-
/** {@link Disposable.onDisposed} */
|
|
2403
|
-
readonly onDisposed: Event<string>;
|
|
2136
|
+
renderer: THREE.WebGLRenderer;
|
|
2404
2137
|
/**
|
|
2405
|
-
* A
|
|
2406
|
-
*
|
|
2138
|
+
* A flag indicating whether the minimap is enabled.
|
|
2139
|
+
* If disabled, the minimap will not update or render.
|
|
2407
2140
|
*/
|
|
2408
|
-
|
|
2409
|
-
private _allControls;
|
|
2141
|
+
enabled: boolean;
|
|
2410
2142
|
/**
|
|
2411
|
-
* The
|
|
2412
|
-
*
|
|
2413
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
2414
|
-
* object to move, rotate, look at objects, etc.
|
|
2143
|
+
* The world in which the minimap is displayed.
|
|
2144
|
+
* It provides access to the 3D scene, camera, and other relevant world elements.
|
|
2415
2145
|
*/
|
|
2416
|
-
|
|
2146
|
+
world: World;
|
|
2147
|
+
private _lockRotation;
|
|
2148
|
+
private _camera;
|
|
2149
|
+
private _plane;
|
|
2150
|
+
private _size;
|
|
2151
|
+
private _tempVector1;
|
|
2152
|
+
private _tempVector2;
|
|
2153
|
+
private _tempTarget;
|
|
2154
|
+
private readonly down;
|
|
2417
2155
|
/**
|
|
2418
|
-
*
|
|
2419
|
-
*
|
|
2420
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
2421
|
-
*
|
|
2422
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
2156
|
+
* Gets or sets whether the minimap rotation is locked.
|
|
2157
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
2423
2158
|
*/
|
|
2424
|
-
get
|
|
2159
|
+
get lockRotation(): boolean;
|
|
2425
2160
|
/**
|
|
2426
|
-
*
|
|
2427
|
-
*
|
|
2428
|
-
*
|
|
2429
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
2161
|
+
* Sets whether the minimap rotation is locked.
|
|
2162
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
2163
|
+
* @param active - If 'true', rotation is locked. If 'false', rotation is not locked.
|
|
2430
2164
|
*/
|
|
2431
|
-
set
|
|
2432
|
-
|
|
2165
|
+
set lockRotation(active: boolean);
|
|
2166
|
+
/**
|
|
2167
|
+
* Gets the current zoom level of the minimap.
|
|
2168
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
2169
|
+
* @returns The current zoom level of the minimap.
|
|
2170
|
+
*/
|
|
2171
|
+
get zoom(): number;
|
|
2172
|
+
/**
|
|
2173
|
+
* Sets the zoom level of the minimap.
|
|
2174
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
2175
|
+
* @param value - The new zoom level of the minimap.
|
|
2176
|
+
*/
|
|
2177
|
+
set zoom(value: number);
|
|
2178
|
+
constructor(world: World);
|
|
2433
2179
|
/** {@link Disposable.dispose} */
|
|
2434
2180
|
dispose(): void;
|
|
2181
|
+
/** Returns the camera used by the MiniMap */
|
|
2182
|
+
get(): THREE.OrthographicCamera;
|
|
2435
2183
|
/** {@link Updateable.update} */
|
|
2436
|
-
update(
|
|
2184
|
+
update(): void;
|
|
2185
|
+
/** {@link Resizeable.getSize} */
|
|
2186
|
+
getSize(): THREE.Vector2;
|
|
2187
|
+
/** {@link Resizeable.resize} */
|
|
2188
|
+
resize(size?: THREE.Vector2): void;
|
|
2189
|
+
private updatePlanes;
|
|
2190
|
+
}
|
|
2191
|
+
import * as WEBIFC from "web-ifc";
|
|
2192
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2193
|
+
export declare class SpatialStructure {
|
|
2194
|
+
itemsByFloor: IfcItemsCategories;
|
|
2195
|
+
private _units;
|
|
2196
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2197
|
+
cleanUp(): void;
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* 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.
|
|
2201
|
+
*
|
|
2202
|
+
* @remarks
|
|
2203
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2204
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2205
|
+
*
|
|
2206
|
+
*/
|
|
2207
|
+
export declare const IfcElements: {
|
|
2208
|
+
[key: number]: string;
|
|
2209
|
+
};
|
|
2210
|
+
/**
|
|
2211
|
+
* 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.
|
|
2212
|
+
*/
|
|
2213
|
+
export declare const IfcCategoryMap: {
|
|
2214
|
+
[key: number]: string;
|
|
2215
|
+
};
|
|
2216
|
+
import * as WEBIFC from "web-ifc";
|
|
2217
|
+
export interface IfcItemsCategories {
|
|
2218
|
+
[itemID: number]: number;
|
|
2219
|
+
}
|
|
2220
|
+
export declare class IfcCategories {
|
|
2221
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2222
|
+
}
|
|
2223
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2224
|
+
export declare class IfcPropertiesUtils {
|
|
2225
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2226
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2227
|
+
[attribute: string]: any;
|
|
2228
|
+
} | null>;
|
|
2229
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2230
|
+
[relatingID: number]: number[];
|
|
2231
|
+
}>;
|
|
2232
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2233
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2234
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2235
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2236
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2237
|
+
key: string | null;
|
|
2238
|
+
name: string | null;
|
|
2239
|
+
}>;
|
|
2240
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2241
|
+
key: string | null;
|
|
2242
|
+
value: number | null;
|
|
2243
|
+
}>;
|
|
2244
|
+
static isRel(expressID: number): boolean;
|
|
2245
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2246
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* 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.
|
|
2250
|
+
*/
|
|
2251
|
+
export declare class Event<T> {
|
|
2437
2252
|
/**
|
|
2438
|
-
*
|
|
2439
|
-
*
|
|
2253
|
+
* Add a callback to this event instance.
|
|
2254
|
+
* @param handler - the callback to be added to this event.
|
|
2440
2255
|
*/
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2256
|
+
add(handler: T extends void ? {
|
|
2257
|
+
(): void;
|
|
2258
|
+
} : {
|
|
2259
|
+
(data: T): void;
|
|
2260
|
+
}): void;
|
|
2261
|
+
/**
|
|
2262
|
+
* Removes a callback from this event instance.
|
|
2263
|
+
* @param handler - the callback to be removed from this event.
|
|
2264
|
+
*/
|
|
2265
|
+
remove(handler: T extends void ? {
|
|
2266
|
+
(): void;
|
|
2267
|
+
} : {
|
|
2268
|
+
(data: T): void;
|
|
2269
|
+
}): void;
|
|
2270
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2271
|
+
trigger: (data?: T) => void;
|
|
2272
|
+
/** Gets rid of all the suscribed events. */
|
|
2273
|
+
reset(): void;
|
|
2274
|
+
private handlers;
|
|
2446
2275
|
}
|
|
2447
2276
|
import * as THREE from "three";
|
|
2448
2277
|
import CameraControls from "camera-controls";
|
|
@@ -2552,34 +2381,6 @@ export interface CameraControllable {
|
|
|
2552
2381
|
*/
|
|
2553
2382
|
controls: CameraControls;
|
|
2554
2383
|
}
|
|
2555
|
-
/**
|
|
2556
|
-
* 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.
|
|
2557
|
-
*/
|
|
2558
|
-
export declare class Event<T> {
|
|
2559
|
-
/**
|
|
2560
|
-
* Add a callback to this event instance.
|
|
2561
|
-
* @param handler - the callback to be added to this event.
|
|
2562
|
-
*/
|
|
2563
|
-
add(handler: T extends void ? {
|
|
2564
|
-
(): void;
|
|
2565
|
-
} : {
|
|
2566
|
-
(data: T): void;
|
|
2567
|
-
}): void;
|
|
2568
|
-
/**
|
|
2569
|
-
* Removes a callback from this event instance.
|
|
2570
|
-
* @param handler - the callback to be removed from this event.
|
|
2571
|
-
*/
|
|
2572
|
-
remove(handler: T extends void ? {
|
|
2573
|
-
(): void;
|
|
2574
|
-
} : {
|
|
2575
|
-
(data: T): void;
|
|
2576
|
-
}): void;
|
|
2577
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2578
|
-
trigger: (data?: T) => void;
|
|
2579
|
-
/** Gets rid of all the suscribed events. */
|
|
2580
|
-
reset(): void;
|
|
2581
|
-
private handlers;
|
|
2582
|
-
}
|
|
2583
2384
|
import { Base } from "./base";
|
|
2584
2385
|
/**
|
|
2585
2386
|
* 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.
|
|
@@ -2593,11 +2394,6 @@ export declare abstract class Component extends Base {
|
|
|
2593
2394
|
*/
|
|
2594
2395
|
abstract enabled: boolean;
|
|
2595
2396
|
}
|
|
2596
|
-
import { InverseAttribute } from "./types";
|
|
2597
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2598
|
-
forRelating: InverseAttribute;
|
|
2599
|
-
forRelated: InverseAttribute;
|
|
2600
|
-
}>;
|
|
2601
2397
|
/**
|
|
2602
2398
|
* 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.
|
|
2603
2399
|
*/
|
|
@@ -2626,6 +2422,34 @@ export declare class AsyncEvent<T> {
|
|
|
2626
2422
|
reset(): void;
|
|
2627
2423
|
private handlers;
|
|
2628
2424
|
}
|
|
2425
|
+
import * as THREE from "three";
|
|
2426
|
+
import CameraControls from "camera-controls";
|
|
2427
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2428
|
+
import { CameraControllable } from "./interfaces";
|
|
2429
|
+
/**
|
|
2430
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
2431
|
+
*/
|
|
2432
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
2433
|
+
/**
|
|
2434
|
+
* Whether the camera is enabled or not.
|
|
2435
|
+
*/
|
|
2436
|
+
abstract enabled: boolean;
|
|
2437
|
+
/**
|
|
2438
|
+
* The Three.js camera instance.
|
|
2439
|
+
*/
|
|
2440
|
+
abstract three: THREE.Camera;
|
|
2441
|
+
/**
|
|
2442
|
+
* Optional CameraControls instance for controlling the camera.
|
|
2443
|
+
* This property is only available if the camera is controllable.
|
|
2444
|
+
*/
|
|
2445
|
+
abstract controls?: CameraControls;
|
|
2446
|
+
/**
|
|
2447
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
2448
|
+
*
|
|
2449
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
2450
|
+
*/
|
|
2451
|
+
hasCameraControls: () => this is CameraControllable;
|
|
2452
|
+
}
|
|
2629
2453
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2630
2454
|
import { Components } from "../../Components";
|
|
2631
2455
|
/**
|
|
@@ -2656,45 +2480,17 @@ export declare abstract class BaseWorldItem extends Base {
|
|
|
2656
2480
|
readonly worlds: Map<string, World>;
|
|
2657
2481
|
/**
|
|
2658
2482
|
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2659
|
-
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2660
|
-
*/
|
|
2661
|
-
readonly onWorldChanged: Event<{
|
|
2662
|
-
world: World;
|
|
2663
|
-
action: "added" | "removed";
|
|
2664
|
-
}>;
|
|
2665
|
-
/**
|
|
2666
|
-
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2667
|
-
*/
|
|
2668
|
-
currentWorld: World | null;
|
|
2669
|
-
protected constructor(components: Components);
|
|
2670
|
-
}
|
|
2671
|
-
import * as THREE from "three";
|
|
2672
|
-
import CameraControls from "camera-controls";
|
|
2673
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2674
|
-
import { CameraControllable } from "./interfaces";
|
|
2675
|
-
/**
|
|
2676
|
-
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
2677
|
-
*/
|
|
2678
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
2679
|
-
/**
|
|
2680
|
-
* Whether the camera is enabled or not.
|
|
2681
|
-
*/
|
|
2682
|
-
abstract enabled: boolean;
|
|
2683
|
-
/**
|
|
2684
|
-
* The Three.js camera instance.
|
|
2685
|
-
*/
|
|
2686
|
-
abstract three: THREE.Camera;
|
|
2687
|
-
/**
|
|
2688
|
-
* Optional CameraControls instance for controlling the camera.
|
|
2689
|
-
* This property is only available if the camera is controllable.
|
|
2483
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2690
2484
|
*/
|
|
2691
|
-
|
|
2485
|
+
readonly onWorldChanged: Event<{
|
|
2486
|
+
world: World;
|
|
2487
|
+
action: "added" | "removed";
|
|
2488
|
+
}>;
|
|
2692
2489
|
/**
|
|
2693
|
-
*
|
|
2694
|
-
*
|
|
2695
|
-
* @returns True if the instance is controllable, false otherwise.
|
|
2490
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2696
2491
|
*/
|
|
2697
|
-
|
|
2492
|
+
currentWorld: World | null;
|
|
2493
|
+
protected constructor(components: Components);
|
|
2698
2494
|
}
|
|
2699
2495
|
import * as THREE from "three";
|
|
2700
2496
|
import { Vector2 } from "three";
|
|
@@ -2762,58 +2558,302 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
2762
2558
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2763
2559
|
}
|
|
2764
2560
|
import * as THREE from "three";
|
|
2765
|
-
import { Disposable } from "./interfaces";
|
|
2766
|
-
import { Event } from "./event";
|
|
2561
|
+
import { Disposable } from "./interfaces";
|
|
2562
|
+
import { Event } from "./event";
|
|
2563
|
+
import { Components } from "../../Components";
|
|
2564
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2565
|
+
/**
|
|
2566
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
2567
|
+
*/
|
|
2568
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2569
|
+
/** {@link Disposable.onDisposed} */
|
|
2570
|
+
readonly onDisposed: Event<unknown>;
|
|
2571
|
+
/**
|
|
2572
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
2573
|
+
* It should be implemented by subclasses.
|
|
2574
|
+
*/
|
|
2575
|
+
abstract three: THREE.Object3D;
|
|
2576
|
+
protected constructor(components: Components);
|
|
2577
|
+
/** {@link Disposable.dispose} */
|
|
2578
|
+
dispose(): void;
|
|
2579
|
+
}
|
|
2580
|
+
import * as THREE from "three";
|
|
2581
|
+
import { BaseScene } from "./base-scene";
|
|
2582
|
+
import { BaseCamera } from "./base-camera";
|
|
2583
|
+
import { BaseRenderer } from "./base-renderer";
|
|
2584
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
2585
|
+
/**
|
|
2586
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2587
|
+
*/
|
|
2588
|
+
export interface World extends Disposable, Updateable {
|
|
2589
|
+
/**
|
|
2590
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2591
|
+
*/
|
|
2592
|
+
meshes: Set<THREE.Mesh>;
|
|
2593
|
+
/**
|
|
2594
|
+
* The base scene of the world.
|
|
2595
|
+
*/
|
|
2596
|
+
scene: BaseScene;
|
|
2597
|
+
/**
|
|
2598
|
+
* The base camera of the world.
|
|
2599
|
+
*/
|
|
2600
|
+
camera: BaseCamera;
|
|
2601
|
+
/**
|
|
2602
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2603
|
+
*/
|
|
2604
|
+
renderer: BaseRenderer | null;
|
|
2605
|
+
/**
|
|
2606
|
+
* A unique identifier for the world.
|
|
2607
|
+
*/
|
|
2608
|
+
uuid: string;
|
|
2609
|
+
/**
|
|
2610
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2611
|
+
*/
|
|
2612
|
+
isDisposing: boolean;
|
|
2613
|
+
}
|
|
2614
|
+
import { InverseAttribute } from "./types";
|
|
2615
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2616
|
+
forRelating: InverseAttribute;
|
|
2617
|
+
forRelated: InverseAttribute;
|
|
2618
|
+
}>;
|
|
2619
|
+
import * as THREE from "three";
|
|
2620
|
+
import { Components } from "../../Components";
|
|
2621
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
2622
|
+
/**
|
|
2623
|
+
* Settings to configure the CullerRenderer.
|
|
2624
|
+
*/
|
|
2625
|
+
export interface CullerRendererSettings {
|
|
2626
|
+
/**
|
|
2627
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
2628
|
+
* Default value is 1000.
|
|
2629
|
+
*/
|
|
2630
|
+
updateInterval?: number;
|
|
2631
|
+
/**
|
|
2632
|
+
* Width of the render target used for visibility checks.
|
|
2633
|
+
* Default value is 512.
|
|
2634
|
+
*/
|
|
2635
|
+
width?: number;
|
|
2636
|
+
/**
|
|
2637
|
+
* Height of the render target used for visibility checks.
|
|
2638
|
+
* Default value is 512.
|
|
2639
|
+
*/
|
|
2640
|
+
height?: number;
|
|
2641
|
+
/**
|
|
2642
|
+
* Whether the visibility check should be performed automatically.
|
|
2643
|
+
* Default value is true.
|
|
2644
|
+
*/
|
|
2645
|
+
autoUpdate?: boolean;
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* A base renderer to determine visibility on screen.
|
|
2649
|
+
*/
|
|
2650
|
+
export declare class CullerRenderer {
|
|
2651
|
+
/** {@link Disposable.onDisposed} */
|
|
2652
|
+
readonly onDisposed: Event<string>;
|
|
2653
|
+
/**
|
|
2654
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
2655
|
+
* meshes that are currently visible, and the ones that were visible
|
|
2656
|
+
* just before but not anymore.
|
|
2657
|
+
*/
|
|
2658
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
2659
|
+
/**
|
|
2660
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2661
|
+
*/
|
|
2662
|
+
enabled: boolean;
|
|
2663
|
+
/**
|
|
2664
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
2665
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
2666
|
+
*/
|
|
2667
|
+
needsUpdate: boolean;
|
|
2668
|
+
/**
|
|
2669
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
2670
|
+
* for debugging purposes.
|
|
2671
|
+
*/
|
|
2672
|
+
renderDebugFrame: boolean;
|
|
2673
|
+
/** The components instance to which this renderer belongs. */
|
|
2674
|
+
components: Components;
|
|
2675
|
+
/** The world instance to which this renderer belongs. */
|
|
2676
|
+
readonly world: World;
|
|
2677
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
2678
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
2679
|
+
protected autoUpdate: boolean;
|
|
2680
|
+
protected updateInterval: number;
|
|
2681
|
+
protected readonly worker: Worker;
|
|
2682
|
+
protected readonly scene: THREE.Scene;
|
|
2683
|
+
private _width;
|
|
2684
|
+
private _height;
|
|
2685
|
+
private _availableColor;
|
|
2686
|
+
private readonly renderTarget;
|
|
2687
|
+
private readonly bufferSize;
|
|
2688
|
+
private readonly _buffer;
|
|
2689
|
+
protected _isWorkerBusy: boolean;
|
|
2690
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2691
|
+
/** {@link Disposable.dispose} */
|
|
2692
|
+
dispose(): void;
|
|
2693
|
+
/**
|
|
2694
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2695
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
2696
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2697
|
+
* not true.
|
|
2698
|
+
*/
|
|
2699
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
2700
|
+
protected getAvailableColor(): {
|
|
2701
|
+
r: number;
|
|
2702
|
+
g: number;
|
|
2703
|
+
b: number;
|
|
2704
|
+
code: string;
|
|
2705
|
+
};
|
|
2706
|
+
protected increaseColor(): void;
|
|
2707
|
+
protected decreaseColor(): void;
|
|
2708
|
+
private applySettings;
|
|
2709
|
+
}
|
|
2710
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2711
|
+
import * as THREE from "three";
|
|
2712
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2713
|
+
import { Components } from "../../Components";
|
|
2714
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2715
|
+
/**
|
|
2716
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2717
|
+
*/
|
|
2718
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2719
|
+
/**
|
|
2720
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2721
|
+
* Contains two sets: seen and unseen.
|
|
2722
|
+
*/
|
|
2723
|
+
readonly onViewUpdated: Event<{
|
|
2724
|
+
seen: Set<THREE.Mesh>;
|
|
2725
|
+
unseen: Set<THREE.Mesh>;
|
|
2726
|
+
}>;
|
|
2727
|
+
/**
|
|
2728
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2729
|
+
* Default value is 100.
|
|
2730
|
+
*/
|
|
2731
|
+
threshold: number;
|
|
2732
|
+
/**
|
|
2733
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2734
|
+
* Used to keep track of color-coded meshes.
|
|
2735
|
+
*/
|
|
2736
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2737
|
+
/**
|
|
2738
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2739
|
+
* Used to prevent concurrent processing.
|
|
2740
|
+
*/
|
|
2741
|
+
isProcessing: boolean;
|
|
2742
|
+
private _colorCodeMeshMap;
|
|
2743
|
+
private _meshIDColorCodeMap;
|
|
2744
|
+
private _currentVisibleMeshes;
|
|
2745
|
+
private _recentlyHiddenMeshes;
|
|
2746
|
+
private _intervalID;
|
|
2747
|
+
private readonly _transparentMat;
|
|
2748
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2749
|
+
/** {@link Disposable.dispose} */
|
|
2750
|
+
dispose(): void;
|
|
2751
|
+
/**
|
|
2752
|
+
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
2753
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2754
|
+
* @returns {void}
|
|
2755
|
+
*/
|
|
2756
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2757
|
+
/**
|
|
2758
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2759
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2760
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2761
|
+
* @returns {void}
|
|
2762
|
+
*/
|
|
2763
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2764
|
+
private handleWorkerMessage;
|
|
2765
|
+
private getAvailableMaterial;
|
|
2766
|
+
}
|
|
2767
|
+
import * as THREE from "three";
|
|
2768
|
+
import { Disposable, Event } from "../../Types";
|
|
2769
|
+
/**
|
|
2770
|
+
* 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.
|
|
2771
|
+
*/
|
|
2772
|
+
export declare class Mouse implements Disposable {
|
|
2773
|
+
dom: HTMLCanvasElement;
|
|
2774
|
+
private _event?;
|
|
2775
|
+
private _position;
|
|
2776
|
+
/** {@link Disposable.onDisposed} */
|
|
2777
|
+
readonly onDisposed: Event<unknown>;
|
|
2778
|
+
constructor(dom: HTMLCanvasElement);
|
|
2779
|
+
/**
|
|
2780
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2781
|
+
*/
|
|
2782
|
+
get position(): THREE.Vector2;
|
|
2783
|
+
/** {@link Disposable.dispose} */
|
|
2784
|
+
dispose(): void;
|
|
2785
|
+
private getPositionY;
|
|
2786
|
+
private getPositionX;
|
|
2787
|
+
private updateMouseInfo;
|
|
2788
|
+
private setupEvents;
|
|
2789
|
+
}
|
|
2790
|
+
/**
|
|
2791
|
+
* 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.
|
|
2792
|
+
*/
|
|
2793
|
+
export interface StreamedGeometries {
|
|
2794
|
+
[id: number]: {
|
|
2795
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
2796
|
+
boundingBox: Float32Array;
|
|
2797
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
2798
|
+
hasHoles: boolean;
|
|
2799
|
+
/** An optional file path for the geometry data. */
|
|
2800
|
+
geometryFile?: string;
|
|
2801
|
+
};
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* 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.
|
|
2805
|
+
*/
|
|
2806
|
+
export interface StreamedAsset {
|
|
2807
|
+
/** The unique identifier of the asset. */
|
|
2808
|
+
id: number;
|
|
2809
|
+
/** An array of geometries associated with the asset. */
|
|
2810
|
+
geometries: {
|
|
2811
|
+
/** The unique identifier of the geometry. */
|
|
2812
|
+
geometryID: number;
|
|
2813
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
2814
|
+
transformation: number[];
|
|
2815
|
+
/** The color of the geometry as a number array. */
|
|
2816
|
+
color: number[];
|
|
2817
|
+
}[];
|
|
2818
|
+
}
|
|
2819
|
+
import * as THREE from "three";
|
|
2820
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2767
2821
|
import { Components } from "../../Components";
|
|
2768
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2769
2822
|
/**
|
|
2770
|
-
*
|
|
2823
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
2771
2824
|
*/
|
|
2772
|
-
export
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
dispose(): void;
|
|
2825
|
+
export interface SimpleSceneConfig {
|
|
2826
|
+
directionalLight: {
|
|
2827
|
+
color: THREE.Color;
|
|
2828
|
+
intensity: number;
|
|
2829
|
+
position: THREE.Vector3;
|
|
2830
|
+
};
|
|
2831
|
+
ambientLight: {
|
|
2832
|
+
color: THREE.Color;
|
|
2833
|
+
intensity: number;
|
|
2834
|
+
};
|
|
2783
2835
|
}
|
|
2784
|
-
import * as THREE from "three";
|
|
2785
|
-
import { BaseScene } from "./base-scene";
|
|
2786
|
-
import { BaseCamera } from "./base-camera";
|
|
2787
|
-
import { BaseRenderer } from "./base-renderer";
|
|
2788
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
2789
2836
|
/**
|
|
2790
|
-
*
|
|
2837
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
2791
2838
|
*/
|
|
2792
|
-
export
|
|
2793
|
-
/**
|
|
2794
|
-
|
|
2795
|
-
*/
|
|
2796
|
-
meshes: Set<THREE.Mesh>;
|
|
2797
|
-
/**
|
|
2798
|
-
* The base scene of the world.
|
|
2799
|
-
*/
|
|
2800
|
-
scene: BaseScene;
|
|
2801
|
-
/**
|
|
2802
|
-
* The base camera of the world.
|
|
2803
|
-
*/
|
|
2804
|
-
camera: BaseCamera;
|
|
2805
|
-
/**
|
|
2806
|
-
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2807
|
-
*/
|
|
2808
|
-
renderer: BaseRenderer | null;
|
|
2839
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2840
|
+
/** {@link Configurable.isSetup} */
|
|
2841
|
+
isSetup: boolean;
|
|
2809
2842
|
/**
|
|
2810
|
-
*
|
|
2843
|
+
* The underlying Three.js scene object.
|
|
2844
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2811
2845
|
*/
|
|
2812
|
-
|
|
2846
|
+
three: THREE.Scene;
|
|
2847
|
+
/** {@link Configurable.onSetup} */
|
|
2848
|
+
readonly onSetup: Event<SimpleScene>;
|
|
2813
2849
|
/**
|
|
2814
|
-
*
|
|
2850
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
2851
|
+
* Defines properties for directional and ambient lights.
|
|
2815
2852
|
*/
|
|
2816
|
-
|
|
2853
|
+
config: Required<SimpleSceneConfig>;
|
|
2854
|
+
constructor(components: Components);
|
|
2855
|
+
/** {@link Configurable.setup} */
|
|
2856
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2817
2857
|
}
|
|
2818
2858
|
import * as THREE from "three";
|
|
2819
2859
|
import { Components } from "../../Components";
|
|
@@ -2868,357 +2908,285 @@ export declare class SimpleRaycaster implements Disposable {
|
|
|
2868
2908
|
private filterClippingPlanes;
|
|
2869
2909
|
}
|
|
2870
2910
|
import * as THREE from "three";
|
|
2871
|
-
import
|
|
2911
|
+
import CameraControls from "camera-controls";
|
|
2912
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2872
2913
|
import { Components } from "../../Components";
|
|
2873
2914
|
/**
|
|
2874
|
-
*
|
|
2915
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
2875
2916
|
*/
|
|
2876
|
-
export
|
|
2877
|
-
/**
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2917
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
2918
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2919
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2920
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2921
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2881
2922
|
/**
|
|
2882
|
-
*
|
|
2923
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
2924
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
2883
2925
|
*/
|
|
2884
|
-
|
|
2926
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
2927
|
+
/** {@link Disposable.onDisposed} */
|
|
2928
|
+
readonly onDisposed: Event<string>;
|
|
2885
2929
|
/**
|
|
2886
|
-
*
|
|
2930
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
2931
|
+
* This camera is used for rendering the scene.
|
|
2887
2932
|
*/
|
|
2888
|
-
|
|
2933
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2934
|
+
private _allControls;
|
|
2889
2935
|
/**
|
|
2890
|
-
* The
|
|
2936
|
+
* The object that controls the camera. An instance of
|
|
2937
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
2938
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
2939
|
+
* object to move, rotate, look at objects, etc.
|
|
2891
2940
|
*/
|
|
2892
|
-
|
|
2893
|
-
}
|
|
2894
|
-
/**
|
|
2895
|
-
* 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).
|
|
2896
|
-
*/
|
|
2897
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2898
|
-
/** {@link Disposable.onDisposed} */
|
|
2899
|
-
readonly onDisposed: Event<unknown>;
|
|
2900
|
-
/** The world instance to which this Raycaster belongs. */
|
|
2901
|
-
world: World;
|
|
2902
|
-
/** The components instance to which this grid belongs. */
|
|
2903
|
-
components: Components;
|
|
2904
|
-
/** {@link Hideable.visible} */
|
|
2905
|
-
get visible(): boolean;
|
|
2906
|
-
/** {@link Hideable.visible} */
|
|
2907
|
-
set visible(visible: boolean);
|
|
2908
|
-
/** The material of the grid. */
|
|
2909
|
-
get material(): THREE.ShaderMaterial;
|
|
2941
|
+
get controls(): CameraControls;
|
|
2910
2942
|
/**
|
|
2911
|
-
*
|
|
2912
|
-
*
|
|
2943
|
+
* Getter for the enabled state of the camera controls.
|
|
2944
|
+
* If the current world is null, it returns false.
|
|
2945
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
2946
|
+
*
|
|
2947
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
2913
2948
|
*/
|
|
2914
|
-
get
|
|
2949
|
+
get enabled(): boolean;
|
|
2915
2950
|
/**
|
|
2916
|
-
*
|
|
2917
|
-
*
|
|
2951
|
+
* Setter for the enabled state of the camera controls.
|
|
2952
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
2953
|
+
*
|
|
2954
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
2918
2955
|
*/
|
|
2919
|
-
set
|
|
2920
|
-
|
|
2921
|
-
readonly three: THREE.Mesh;
|
|
2922
|
-
private _fade;
|
|
2923
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
2956
|
+
set enabled(enabled: boolean);
|
|
2957
|
+
constructor(components: Components);
|
|
2924
2958
|
/** {@link Disposable.dispose} */
|
|
2925
2959
|
dispose(): void;
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
}
|
|
2929
|
-
import * as THREE from "three";
|
|
2930
|
-
import { Disposable, Event } from "../../Types";
|
|
2931
|
-
/**
|
|
2932
|
-
* 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.
|
|
2933
|
-
*/
|
|
2934
|
-
export declare class Mouse implements Disposable {
|
|
2935
|
-
dom: HTMLCanvasElement;
|
|
2936
|
-
private _event?;
|
|
2937
|
-
private _position;
|
|
2938
|
-
/** {@link Disposable.onDisposed} */
|
|
2939
|
-
readonly onDisposed: Event<unknown>;
|
|
2940
|
-
constructor(dom: HTMLCanvasElement);
|
|
2960
|
+
/** {@link Updateable.update} */
|
|
2961
|
+
update(_delta: number): void;
|
|
2941
2962
|
/**
|
|
2942
|
-
*
|
|
2963
|
+
* Updates the aspect of the camera to match the size of the
|
|
2964
|
+
* {@link Components.renderer}.
|
|
2943
2965
|
*/
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
private getPositionY;
|
|
2948
|
-
private getPositionX;
|
|
2949
|
-
private updateMouseInfo;
|
|
2966
|
+
updateAspect: () => void;
|
|
2967
|
+
private setupCamera;
|
|
2968
|
+
private newCameraControls;
|
|
2950
2969
|
private setupEvents;
|
|
2970
|
+
private static getSubsetOfThree;
|
|
2951
2971
|
}
|
|
2952
|
-
import
|
|
2953
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2954
|
-
import { Components } from "../../Components";
|
|
2955
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2972
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2956
2973
|
/**
|
|
2957
|
-
*
|
|
2974
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
2958
2975
|
*/
|
|
2959
|
-
export declare class
|
|
2960
|
-
/**
|
|
2961
|
-
* Event triggered when the visibility of meshes is updated.
|
|
2962
|
-
* Contains two sets: seen and unseen.
|
|
2963
|
-
*/
|
|
2964
|
-
readonly onViewUpdated: Event<{
|
|
2965
|
-
seen: Set<THREE.Mesh>;
|
|
2966
|
-
unseen: Set<THREE.Mesh>;
|
|
2967
|
-
}>;
|
|
2968
|
-
/**
|
|
2969
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2970
|
-
* Default value is 100.
|
|
2971
|
-
*/
|
|
2972
|
-
threshold: number;
|
|
2973
|
-
/**
|
|
2974
|
-
* Map of color code to THREE.InstancedMesh.
|
|
2975
|
-
* Used to keep track of color-coded meshes.
|
|
2976
|
-
*/
|
|
2977
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2978
|
-
/**
|
|
2979
|
-
* Flag to indicate if the renderer is currently processing.
|
|
2980
|
-
* Used to prevent concurrent processing.
|
|
2981
|
-
*/
|
|
2982
|
-
isProcessing: boolean;
|
|
2983
|
-
private _colorCodeMeshMap;
|
|
2984
|
-
private _meshIDColorCodeMap;
|
|
2985
|
-
private _currentVisibleMeshes;
|
|
2986
|
-
private _recentlyHiddenMeshes;
|
|
2987
|
-
private _intervalID;
|
|
2988
|
-
private readonly _transparentMat;
|
|
2989
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2990
|
-
/** {@link Disposable.dispose} */
|
|
2991
|
-
dispose(): void;
|
|
2976
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
2992
2977
|
/**
|
|
2993
|
-
*
|
|
2994
|
-
*
|
|
2995
|
-
* @returns {void}
|
|
2978
|
+
* Minimum number of geometries to be streamed.
|
|
2979
|
+
* Defaults to 10 geometries.
|
|
2996
2980
|
*/
|
|
2997
|
-
|
|
2981
|
+
minGeometrySize: number;
|
|
2998
2982
|
/**
|
|
2999
|
-
*
|
|
3000
|
-
*
|
|
3001
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3002
|
-
* @returns {void}
|
|
2983
|
+
* Minimum amount of assets to be streamed.
|
|
2984
|
+
* Defaults to 1000 assets.
|
|
3003
2985
|
*/
|
|
3004
|
-
|
|
3005
|
-
private handleWorkerMessage;
|
|
3006
|
-
private getAvailableMaterial;
|
|
2986
|
+
minAssetsSize: number;
|
|
3007
2987
|
}
|
|
3008
2988
|
import * as THREE from "three";
|
|
2989
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3009
2990
|
import { Components } from "../../Components";
|
|
3010
|
-
import { AsyncEvent, Event, World } from "../../Types";
|
|
3011
2991
|
/**
|
|
3012
|
-
*
|
|
2992
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
3013
2993
|
*/
|
|
3014
|
-
export interface
|
|
3015
|
-
/**
|
|
3016
|
-
*
|
|
3017
|
-
* Default value is 1000.
|
|
2994
|
+
export interface GridConfig {
|
|
2995
|
+
/**
|
|
2996
|
+
* The color of the grid lines.
|
|
3018
2997
|
*/
|
|
3019
|
-
|
|
2998
|
+
color: THREE.Color;
|
|
3020
2999
|
/**
|
|
3021
|
-
*
|
|
3022
|
-
* Default value is 512.
|
|
3000
|
+
* The size of the primary grid lines.
|
|
3023
3001
|
*/
|
|
3024
|
-
|
|
3002
|
+
size1: number;
|
|
3025
3003
|
/**
|
|
3026
|
-
*
|
|
3027
|
-
* Default value is 512.
|
|
3004
|
+
* The size of the secondary grid lines.
|
|
3028
3005
|
*/
|
|
3029
|
-
|
|
3006
|
+
size2: number;
|
|
3030
3007
|
/**
|
|
3031
|
-
*
|
|
3032
|
-
* Default value is true.
|
|
3008
|
+
* The distance at which the grid lines start to fade away.
|
|
3033
3009
|
*/
|
|
3034
|
-
|
|
3010
|
+
distance: number;
|
|
3035
3011
|
}
|
|
3036
3012
|
/**
|
|
3037
|
-
*
|
|
3013
|
+
* 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).
|
|
3038
3014
|
*/
|
|
3039
|
-
export declare class
|
|
3015
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3040
3016
|
/** {@link Disposable.onDisposed} */
|
|
3041
|
-
readonly onDisposed: Event<
|
|
3017
|
+
readonly onDisposed: Event<unknown>;
|
|
3018
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3019
|
+
world: World;
|
|
3020
|
+
/** The components instance to which this grid belongs. */
|
|
3021
|
+
components: Components;
|
|
3022
|
+
/** {@link Hideable.visible} */
|
|
3023
|
+
get visible(): boolean;
|
|
3024
|
+
/** {@link Hideable.visible} */
|
|
3025
|
+
set visible(visible: boolean);
|
|
3026
|
+
/** The material of the grid. */
|
|
3027
|
+
get material(): THREE.ShaderMaterial;
|
|
3042
3028
|
/**
|
|
3043
|
-
*
|
|
3044
|
-
*
|
|
3045
|
-
* just before but not anymore.
|
|
3029
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3030
|
+
* perspective cameras and false for orthographic cameras.
|
|
3046
3031
|
*/
|
|
3047
|
-
|
|
3032
|
+
get fade(): boolean;
|
|
3048
3033
|
/**
|
|
3049
|
-
* Whether
|
|
3034
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3035
|
+
* perspective cameras and false for orthographic cameras.
|
|
3036
|
+
*/
|
|
3037
|
+
set fade(active: boolean);
|
|
3038
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3039
|
+
readonly three: THREE.Mesh;
|
|
3040
|
+
private _fade;
|
|
3041
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
3042
|
+
/** {@link Disposable.dispose} */
|
|
3043
|
+
dispose(): void;
|
|
3044
|
+
private setupEvents;
|
|
3045
|
+
private updateZoom;
|
|
3046
|
+
}
|
|
3047
|
+
import * as THREE from "three";
|
|
3048
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
3049
|
+
import { Components } from "../../Components";
|
|
3050
|
+
/**
|
|
3051
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3052
|
+
*/
|
|
3053
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
3054
|
+
/**
|
|
3055
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3056
|
+
* Default is 'true'.
|
|
3050
3057
|
*/
|
|
3051
3058
|
enabled: boolean;
|
|
3052
3059
|
/**
|
|
3053
|
-
*
|
|
3054
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3060
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
3055
3061
|
*/
|
|
3056
|
-
|
|
3062
|
+
container: HTMLElement;
|
|
3057
3063
|
/**
|
|
3058
|
-
*
|
|
3059
|
-
* for debugging purposes.
|
|
3064
|
+
* The THREE.js WebGLRenderer instance.
|
|
3060
3065
|
*/
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
private readonly _buffer;
|
|
3078
|
-
protected _isWorkerBusy: boolean;
|
|
3079
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3066
|
+
three: THREE.WebGLRenderer;
|
|
3067
|
+
protected _canvas: HTMLCanvasElement;
|
|
3068
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3069
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
3070
|
+
protected onContainerUpdated: Event<unknown>;
|
|
3071
|
+
private _resizing;
|
|
3072
|
+
/**
|
|
3073
|
+
* Constructor for the SimpleRenderer class.
|
|
3074
|
+
*
|
|
3075
|
+
* @param components - The components instance.
|
|
3076
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3077
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3078
|
+
*/
|
|
3079
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3080
|
+
/** {@link Updateable.update} */
|
|
3081
|
+
update(): void;
|
|
3080
3082
|
/** {@link Disposable.dispose} */
|
|
3081
3083
|
dispose(): void;
|
|
3084
|
+
/** {@link Resizeable.getSize}. */
|
|
3085
|
+
getSize(): THREE.Vector2;
|
|
3086
|
+
/** {@link Resizeable.resize} */
|
|
3087
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3082
3088
|
/**
|
|
3083
|
-
*
|
|
3084
|
-
*
|
|
3085
|
-
* @param
|
|
3086
|
-
*
|
|
3089
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3090
|
+
*
|
|
3091
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3092
|
+
*
|
|
3093
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3087
3094
|
*/
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
code: string;
|
|
3094
|
-
};
|
|
3095
|
-
protected increaseColor(): void;
|
|
3096
|
-
protected decreaseColor(): void;
|
|
3097
|
-
private applySettings;
|
|
3098
|
-
}
|
|
3099
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3100
|
-
import { NavigationMode } from "./types";
|
|
3101
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3102
|
-
/**
|
|
3103
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3104
|
-
*/
|
|
3105
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3106
|
-
camera: OrthoPerspectiveCamera;
|
|
3107
|
-
/** {@link NavigationMode.enabled} */
|
|
3108
|
-
enabled: boolean;
|
|
3109
|
-
/** {@link NavigationMode.id} */
|
|
3110
|
-
readonly id = "Orbit";
|
|
3111
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3112
|
-
/** {@link NavigationMode.set} */
|
|
3113
|
-
set(active: boolean): void;
|
|
3114
|
-
private activateOrbitControls;
|
|
3115
|
-
}
|
|
3116
|
-
import { NavigationMode } from "./types";
|
|
3117
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3118
|
-
/**
|
|
3119
|
-
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3120
|
-
*/
|
|
3121
|
-
export declare class FirstPersonMode implements NavigationMode {
|
|
3122
|
-
private camera;
|
|
3123
|
-
/** {@link NavigationMode.enabled} */
|
|
3124
|
-
enabled: boolean;
|
|
3125
|
-
/** {@link NavigationMode.id} */
|
|
3126
|
-
readonly id = "FirstPerson";
|
|
3127
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3128
|
-
/** {@link NavigationMode.set} */
|
|
3129
|
-
set(active: boolean): void;
|
|
3130
|
-
private setupFirstPersonCamera;
|
|
3095
|
+
setupEvents(active: boolean): void;
|
|
3096
|
+
private resizeEvent;
|
|
3097
|
+
private setupRenderer;
|
|
3098
|
+
private onContextLost;
|
|
3099
|
+
private onContextBack;
|
|
3131
3100
|
}
|
|
3132
3101
|
import * as THREE from "three";
|
|
3133
|
-
import {
|
|
3134
|
-
import { Event } from "../../Types";
|
|
3135
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3102
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
3136
3103
|
/**
|
|
3137
|
-
*
|
|
3104
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
3105
|
+
*
|
|
3106
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
3107
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
3108
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
3138
3109
|
*/
|
|
3139
|
-
export declare class
|
|
3110
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
3140
3111
|
/**
|
|
3141
|
-
*
|
|
3112
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
3142
3113
|
*/
|
|
3143
|
-
readonly
|
|
3114
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
3115
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3116
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
3117
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3118
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
3119
|
+
/** {@link Disposable.onDisposed} */
|
|
3120
|
+
readonly onDisposed: Event<unknown>;
|
|
3144
3121
|
/**
|
|
3145
|
-
*
|
|
3146
|
-
* Default is "Perspective".
|
|
3122
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
3147
3123
|
*/
|
|
3148
|
-
|
|
3124
|
+
isDisposing: boolean;
|
|
3149
3125
|
/**
|
|
3150
|
-
*
|
|
3151
|
-
*
|
|
3126
|
+
* Indicates whether the world is currently enabled.
|
|
3127
|
+
* When disabled, the world will not be updated.
|
|
3152
3128
|
*/
|
|
3153
|
-
|
|
3154
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3155
|
-
matchOrthoDistanceEnabled: boolean;
|
|
3156
|
-
private _component;
|
|
3157
|
-
private _previousDistance;
|
|
3158
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3129
|
+
enabled: boolean;
|
|
3159
3130
|
/**
|
|
3160
|
-
*
|
|
3161
|
-
*
|
|
3162
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
3163
|
-
* it will have no effect.
|
|
3131
|
+
* A unique identifier for the world.
|
|
3164
3132
|
*/
|
|
3165
|
-
|
|
3133
|
+
uuid: string;
|
|
3166
3134
|
/**
|
|
3167
|
-
*
|
|
3168
|
-
* and vice versa.
|
|
3135
|
+
* An optional name for the world.
|
|
3169
3136
|
*/
|
|
3170
|
-
|
|
3171
|
-
private
|
|
3172
|
-
private
|
|
3173
|
-
private
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
/**
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
id: NavModeID;
|
|
3137
|
+
name?: string;
|
|
3138
|
+
private _scene?;
|
|
3139
|
+
private _camera?;
|
|
3140
|
+
private _renderer;
|
|
3141
|
+
/**
|
|
3142
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
3143
|
+
* @returns The current scene.
|
|
3144
|
+
*/
|
|
3145
|
+
get scene(): T;
|
|
3146
|
+
/**
|
|
3147
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
3148
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
3149
|
+
* @param scene - The new scene to be set.
|
|
3150
|
+
*/
|
|
3151
|
+
set scene(scene: T);
|
|
3152
|
+
/**
|
|
3153
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
3154
|
+
* @returns The current camera.
|
|
3155
|
+
*/
|
|
3156
|
+
get camera(): U;
|
|
3191
3157
|
/**
|
|
3192
|
-
*
|
|
3193
|
-
*
|
|
3194
|
-
*
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
*
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3158
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
3159
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
3160
|
+
* @param camera - The new camera to be set.
|
|
3161
|
+
*/
|
|
3162
|
+
set camera(camera: U);
|
|
3163
|
+
/**
|
|
3164
|
+
* Getter for the renderer.
|
|
3165
|
+
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
3166
|
+
*/
|
|
3167
|
+
get renderer(): S | null;
|
|
3168
|
+
/**
|
|
3169
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
3170
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
3171
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
3172
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
3173
|
+
*/
|
|
3174
|
+
set renderer(renderer: S | null);
|
|
3175
|
+
/** {@link Updateable.update} */
|
|
3176
|
+
update(delta?: number): void;
|
|
3177
|
+
/** {@link Disposable.dispose} */
|
|
3178
|
+
dispose(disposeResources?: boolean): void;
|
|
3202
3179
|
}
|
|
3203
|
-
import {
|
|
3204
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3180
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3205
3181
|
/**
|
|
3206
|
-
*
|
|
3182
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3207
3183
|
*/
|
|
3208
|
-
export declare class
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
private mouseAction1?;
|
|
3215
|
-
private mouseAction2?;
|
|
3216
|
-
private mouseInitialized;
|
|
3217
|
-
private readonly defaultAzimuthSpeed;
|
|
3218
|
-
private readonly defaultPolarSpeed;
|
|
3219
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3220
|
-
/** {@link NavigationMode.set} */
|
|
3221
|
-
set(active: boolean): void;
|
|
3184
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3185
|
+
/**
|
|
3186
|
+
* Amount of properties to be streamed.
|
|
3187
|
+
* Defaults to 100 properties.
|
|
3188
|
+
*/
|
|
3189
|
+
propertiesSize: number;
|
|
3222
3190
|
}
|
|
3223
3191
|
import * as THREE from "three";
|
|
3224
3192
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3317,6 +3285,11 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3317
3285
|
private newHelper;
|
|
3318
3286
|
private static newPlaneMesh;
|
|
3319
3287
|
}
|
|
3288
|
+
import * as WEBIFC from "web-ifc";
|
|
3289
|
+
export declare class IfcMetadataReader {
|
|
3290
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3291
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3292
|
+
}
|
|
3320
3293
|
import * as THREE from "three";
|
|
3321
3294
|
import * as WEBIFC from "web-ifc";
|
|
3322
3295
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -3332,37 +3305,143 @@ export declare class CivilReader {
|
|
|
3332
3305
|
} | undefined;
|
|
3333
3306
|
private getCurves;
|
|
3334
3307
|
}
|
|
3335
|
-
import {
|
|
3308
|
+
import { NavigationMode } from "./types";
|
|
3309
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3336
3310
|
/**
|
|
3337
|
-
*
|
|
3311
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3338
3312
|
*/
|
|
3339
|
-
export declare class
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3313
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3314
|
+
private camera;
|
|
3315
|
+
/** {@link NavigationMode.enabled} */
|
|
3316
|
+
enabled: boolean;
|
|
3317
|
+
/** {@link NavigationMode.id} */
|
|
3318
|
+
readonly id = "FirstPerson";
|
|
3319
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3320
|
+
/** {@link NavigationMode.set} */
|
|
3321
|
+
set(active: boolean): void;
|
|
3322
|
+
private setupFirstPersonCamera;
|
|
3345
3323
|
}
|
|
3346
|
-
import
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3324
|
+
import { NavigationMode } from "./types";
|
|
3325
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3326
|
+
/**
|
|
3327
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3328
|
+
*/
|
|
3329
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3330
|
+
camera: OrthoPerspectiveCamera;
|
|
3331
|
+
/** {@link NavigationMode.enabled} */
|
|
3332
|
+
enabled: boolean;
|
|
3333
|
+
/** {@link NavigationMode.id} */
|
|
3334
|
+
readonly id = "Orbit";
|
|
3335
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3336
|
+
/** {@link NavigationMode.set} */
|
|
3337
|
+
set(active: boolean): void;
|
|
3338
|
+
private activateOrbitControls;
|
|
3350
3339
|
}
|
|
3351
|
-
import
|
|
3340
|
+
import * as THREE from "three";
|
|
3341
|
+
import { CameraProjection } from "./types";
|
|
3342
|
+
import { Event } from "../../Types";
|
|
3343
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3352
3344
|
/**
|
|
3353
|
-
*
|
|
3345
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3354
3346
|
*/
|
|
3355
|
-
export declare class
|
|
3347
|
+
export declare class ProjectionManager {
|
|
3356
3348
|
/**
|
|
3357
|
-
*
|
|
3358
|
-
* Defaults to 10 geometries.
|
|
3349
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
3359
3350
|
*/
|
|
3360
|
-
|
|
3351
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3361
3352
|
/**
|
|
3362
|
-
*
|
|
3363
|
-
*
|
|
3353
|
+
* Current projection mode of the camera.
|
|
3354
|
+
* Default is "Perspective".
|
|
3364
3355
|
*/
|
|
3365
|
-
|
|
3356
|
+
current: CameraProjection;
|
|
3357
|
+
/**
|
|
3358
|
+
* The camera controlled by this ProjectionManager.
|
|
3359
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3360
|
+
*/
|
|
3361
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3362
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3363
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3364
|
+
private _component;
|
|
3365
|
+
private _previousDistance;
|
|
3366
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3367
|
+
/**
|
|
3368
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3369
|
+
*
|
|
3370
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3371
|
+
* it will have no effect.
|
|
3372
|
+
*/
|
|
3373
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3374
|
+
/**
|
|
3375
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3376
|
+
* and vice versa.
|
|
3377
|
+
*/
|
|
3378
|
+
toggle(): Promise<void>;
|
|
3379
|
+
private setOrthoCamera;
|
|
3380
|
+
private getPerspectiveDims;
|
|
3381
|
+
private setupOrthoCamera;
|
|
3382
|
+
private getDistance;
|
|
3383
|
+
private setPerspectiveCamera;
|
|
3384
|
+
}
|
|
3385
|
+
/**
|
|
3386
|
+
* The projection system of the camera.
|
|
3387
|
+
*/
|
|
3388
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3389
|
+
/**
|
|
3390
|
+
* The extensible list of supported navigation modes.
|
|
3391
|
+
*/
|
|
3392
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3393
|
+
/**
|
|
3394
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3395
|
+
*/
|
|
3396
|
+
export interface NavigationMode {
|
|
3397
|
+
/** The unique ID of this navigation mode. */
|
|
3398
|
+
id: NavModeID;
|
|
3399
|
+
/**
|
|
3400
|
+
* Enable or disable this navigation mode.
|
|
3401
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3402
|
+
* must be disabled.
|
|
3403
|
+
*
|
|
3404
|
+
* @param active - whether to enable or disable this mode.
|
|
3405
|
+
* @param options - any additional data required to enable or disable it.
|
|
3406
|
+
* */
|
|
3407
|
+
set: (active: boolean, options?: any) => void;
|
|
3408
|
+
/** Whether this navigation mode is active or not. */
|
|
3409
|
+
enabled: boolean;
|
|
3410
|
+
}
|
|
3411
|
+
import { NavigationMode } from "./types";
|
|
3412
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3413
|
+
/**
|
|
3414
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3415
|
+
*/
|
|
3416
|
+
export declare class PlanMode implements NavigationMode {
|
|
3417
|
+
private camera;
|
|
3418
|
+
/** {@link NavigationMode.enabled} */
|
|
3419
|
+
enabled: boolean;
|
|
3420
|
+
/** {@link NavigationMode.id} */
|
|
3421
|
+
readonly id = "Plan";
|
|
3422
|
+
private mouseAction1?;
|
|
3423
|
+
private mouseAction2?;
|
|
3424
|
+
private mouseInitialized;
|
|
3425
|
+
private readonly defaultAzimuthSpeed;
|
|
3426
|
+
private readonly defaultPolarSpeed;
|
|
3427
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3428
|
+
/** {@link NavigationMode.set} */
|
|
3429
|
+
set(active: boolean): void;
|
|
3430
|
+
}
|
|
3431
|
+
import * as WEBIFC from "web-ifc";
|
|
3432
|
+
import * as THREE from "three";
|
|
3433
|
+
export declare class Units {
|
|
3434
|
+
factor: number;
|
|
3435
|
+
complement: number;
|
|
3436
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3437
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3438
|
+
private getLengthUnits;
|
|
3439
|
+
private getScaleMatrix;
|
|
3440
|
+
}
|
|
3441
|
+
import { BufferGeometry } from "three";
|
|
3442
|
+
import * as THREE from "three";
|
|
3443
|
+
export declare class TransformHelper {
|
|
3444
|
+
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3366
3445
|
}
|
|
3367
3446
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3368
3447
|
export interface ModelsRelationMap {
|
|
@@ -3388,49 +3467,5 @@ export type InverseAttributes = [
|
|
|
3388
3467
|
"ContainsElements"
|
|
3389
3468
|
];
|
|
3390
3469
|
export type InverseAttribute = InverseAttributes[number];
|
|
3391
|
-
import { BufferGeometry } from "three";
|
|
3392
|
-
import * as THREE from "three";
|
|
3393
|
-
export declare class TransformHelper {
|
|
3394
|
-
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3395
|
-
}
|
|
3396
|
-
import * as WEBIFC from "web-ifc";
|
|
3397
|
-
import * as THREE from "three";
|
|
3398
|
-
export declare class Units {
|
|
3399
|
-
factor: number;
|
|
3400
|
-
complement: number;
|
|
3401
|
-
apply(matrix: THREE.Matrix4): void;
|
|
3402
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3403
|
-
private getLengthUnits;
|
|
3404
|
-
private getScaleMatrix;
|
|
3405
|
-
}
|
|
3406
|
-
/**
|
|
3407
|
-
* 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.
|
|
3408
|
-
*/
|
|
3409
|
-
export interface StreamedGeometries {
|
|
3410
|
-
[id: number]: {
|
|
3411
|
-
/** The bounding box of the geometry as a Float32Array. */
|
|
3412
|
-
boundingBox: Float32Array;
|
|
3413
|
-
/** A boolean indicating whether the geometry has holes. */
|
|
3414
|
-
hasHoles: boolean;
|
|
3415
|
-
/** An optional file path for the geometry data. */
|
|
3416
|
-
geometryFile?: string;
|
|
3417
|
-
};
|
|
3418
|
-
}
|
|
3419
|
-
/**
|
|
3420
|
-
* 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.
|
|
3421
|
-
*/
|
|
3422
|
-
export interface StreamedAsset {
|
|
3423
|
-
/** The unique identifier of the asset. */
|
|
3424
|
-
id: number;
|
|
3425
|
-
/** An array of geometries associated with the asset. */
|
|
3426
|
-
geometries: {
|
|
3427
|
-
/** The unique identifier of the geometry. */
|
|
3428
|
-
geometryID: number;
|
|
3429
|
-
/** The transformation matrix of the geometry as a number array. */
|
|
3430
|
-
transformation: number[];
|
|
3431
|
-
/** The color of the geometry as a number array. */
|
|
3432
|
-
color: number[];
|
|
3433
|
-
}[];
|
|
3434
|
-
}
|
|
3435
3470
|
|
|
3436
3471
|
}
|