@thatopen/components 2.0.20 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Components/index.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +519 -505
- package/dist/namespace.d.ts +1259 -1259
- package/package.json +2 -2
package/dist/namespace.d.ts
CHANGED
|
@@ -1,125 +1,4 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
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 { Component, Disposable, Event } from "../Types";
|
|
48
|
-
/**
|
|
49
|
-
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
50
|
-
*/
|
|
51
|
-
export declare class Components implements Disposable {
|
|
52
|
-
/**
|
|
53
|
-
* The version of the @thatopen/components library.
|
|
54
|
-
*/
|
|
55
|
-
static readonly release = "2.0.20";
|
|
56
|
-
/** {@link Disposable.onDisposed} */
|
|
57
|
-
readonly onDisposed: Event<void>;
|
|
58
|
-
/**
|
|
59
|
-
* The list of components created in this app.
|
|
60
|
-
* The keys are UUIDs and the values are instances of the components.
|
|
61
|
-
*/
|
|
62
|
-
readonly list: Map<string, Component>;
|
|
63
|
-
/**
|
|
64
|
-
* If disabled, the animation loop will be stopped.
|
|
65
|
-
* Default value is false.
|
|
66
|
-
*/
|
|
67
|
-
enabled: boolean;
|
|
68
|
-
private _clock;
|
|
69
|
-
/**
|
|
70
|
-
* Adds a component to the list of components.
|
|
71
|
-
* Throws an error if a component with the same UUID already exists.
|
|
72
|
-
*
|
|
73
|
-
* @param uuid - The unique identifier of the component.
|
|
74
|
-
* @param instance - The instance of the component to be added.
|
|
75
|
-
*
|
|
76
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
77
|
-
*
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
add(uuid: string, instance: Component): void;
|
|
81
|
-
/**
|
|
82
|
-
* Retrieves a component instance by its constructor function.
|
|
83
|
-
* If the component does not exist in the list, it will be created and added.
|
|
84
|
-
*
|
|
85
|
-
* @template U - The type of the component to retrieve.
|
|
86
|
-
* @param Component - The constructor function of the component to retrieve.
|
|
87
|
-
*
|
|
88
|
-
* @returns The instance of the requested component.
|
|
89
|
-
*
|
|
90
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
91
|
-
*
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
95
|
-
constructor();
|
|
96
|
-
/**
|
|
97
|
-
* Initializes the Components instance.
|
|
98
|
-
* This method starts the animation loop, sets the enabled flag to true,
|
|
99
|
-
* and calls the update method.
|
|
100
|
-
*
|
|
101
|
-
* @returns {void}
|
|
102
|
-
*/
|
|
103
|
-
init(): void;
|
|
104
|
-
/**
|
|
105
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
106
|
-
* the library. A memory leak will be created if:
|
|
107
|
-
*
|
|
108
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
109
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
110
|
-
* Angular, Vue, etc).
|
|
111
|
-
*
|
|
112
|
-
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
113
|
-
* referenced by a reference type (object or array).
|
|
114
|
-
*
|
|
115
|
-
* You can learn more about how Three.js handles memory leaks
|
|
116
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
117
|
-
*
|
|
118
|
-
*/
|
|
119
|
-
dispose(): void;
|
|
120
|
-
private update;
|
|
121
|
-
private static setupBVH;
|
|
122
|
-
}
|
|
123
2
|
import { Component, Disposable, World, Event } from "../Types";
|
|
124
3
|
import { SimpleRaycaster } from "./src";
|
|
125
4
|
import { Components } from "../Components";
|
|
@@ -229,55 +108,6 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
229
108
|
/** {@link Updateable.update} */
|
|
230
109
|
update(delta?: number): void | Promise<void>;
|
|
231
110
|
}
|
|
232
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
233
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
234
|
-
import { Components } from "../Components";
|
|
235
|
-
/**
|
|
236
|
-
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
237
|
-
*/
|
|
238
|
-
export declare class Grids extends Component implements Disposable {
|
|
239
|
-
/**
|
|
240
|
-
* A unique identifier for the component.
|
|
241
|
-
* This UUID is used to register the component within the Components system.
|
|
242
|
-
*/
|
|
243
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
244
|
-
/**
|
|
245
|
-
* A map of world UUIDs to their corresponding grid instances.
|
|
246
|
-
*/
|
|
247
|
-
list: Map<string, SimpleGrid>;
|
|
248
|
-
/**
|
|
249
|
-
* The default configuration for grid creation.
|
|
250
|
-
*/
|
|
251
|
-
config: Required<GridConfig>;
|
|
252
|
-
/** {@link Disposable.onDisposed} */
|
|
253
|
-
readonly onDisposed: Event<unknown>;
|
|
254
|
-
/** {@link Component.enabled} */
|
|
255
|
-
enabled: boolean;
|
|
256
|
-
constructor(components: Components);
|
|
257
|
-
/**
|
|
258
|
-
* Creates a new grid for the given world.
|
|
259
|
-
* Throws an error if a grid already exists for the world.
|
|
260
|
-
*
|
|
261
|
-
* @param world - The world to create the grid for.
|
|
262
|
-
* @returns The newly created grid.
|
|
263
|
-
*
|
|
264
|
-
* @throws Will throw an error if a grid already exists for the given world.
|
|
265
|
-
*/
|
|
266
|
-
create(world: World): SimpleGrid;
|
|
267
|
-
/**
|
|
268
|
-
* Deletes the grid associated with the given world.
|
|
269
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
270
|
-
*
|
|
271
|
-
* @param world - The world for which to delete the grid.
|
|
272
|
-
*
|
|
273
|
-
* @remarks
|
|
274
|
-
* This method will dispose of the grid and remove it from the internal list.
|
|
275
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
276
|
-
*/
|
|
277
|
-
delete(world: World): void;
|
|
278
|
-
/** {@link Disposable.dispose} */
|
|
279
|
-
dispose(): void;
|
|
280
|
-
}
|
|
281
111
|
import * as THREE from "three";
|
|
282
112
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
283
113
|
import { SimplePlane } from "./src";
|
|
@@ -405,100 +235,223 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
405
235
|
private _onStartDragging;
|
|
406
236
|
private _onEndDragging;
|
|
407
237
|
}
|
|
408
|
-
import {
|
|
409
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
410
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
238
|
+
import { Component, Disposable, Event } from "../Types";
|
|
411
239
|
/**
|
|
412
|
-
*
|
|
240
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
413
241
|
*/
|
|
414
|
-
export declare class
|
|
242
|
+
export declare class Components implements Disposable {
|
|
415
243
|
/**
|
|
416
|
-
*
|
|
417
|
-
* This UUID is used to register the component within the Components system.
|
|
244
|
+
* The version of the @thatopen/components library.
|
|
418
245
|
*/
|
|
419
|
-
static readonly
|
|
246
|
+
static readonly release = "2.0.22";
|
|
247
|
+
/** {@link Disposable.onDisposed} */
|
|
248
|
+
readonly onDisposed: Event<void>;
|
|
420
249
|
/**
|
|
421
|
-
*
|
|
250
|
+
* The list of components created in this app.
|
|
251
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
422
252
|
*/
|
|
423
|
-
readonly
|
|
424
|
-
private _enabled;
|
|
253
|
+
readonly list: Map<string, Component>;
|
|
425
254
|
/**
|
|
426
|
-
*
|
|
255
|
+
* If disabled, the animation loop will be stopped.
|
|
256
|
+
* Default value is false.
|
|
427
257
|
*/
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
get enabled(): boolean;
|
|
431
|
-
/** {@link Component.enabled} */
|
|
432
|
-
set enabled(value: boolean);
|
|
433
|
-
constructor(components: Components);
|
|
258
|
+
enabled: boolean;
|
|
259
|
+
private _clock;
|
|
434
260
|
/**
|
|
435
|
-
*
|
|
436
|
-
*
|
|
261
|
+
* Adds a component to the list of components.
|
|
262
|
+
* Throws an error if a component with the same UUID already exists.
|
|
437
263
|
*
|
|
438
|
-
* @param
|
|
439
|
-
* @param
|
|
264
|
+
* @param uuid - The unique identifier of the component.
|
|
265
|
+
* @param instance - The instance of the component to be added.
|
|
440
266
|
*
|
|
441
|
-
* @
|
|
267
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
268
|
+
*
|
|
269
|
+
* @internal
|
|
442
270
|
*/
|
|
443
|
-
|
|
271
|
+
add(uuid: string, instance: Component): void;
|
|
444
272
|
/**
|
|
445
|
-
*
|
|
446
|
-
* If
|
|
273
|
+
* Retrieves a component instance by its constructor function.
|
|
274
|
+
* If the component does not exist in the list, it will be created and added.
|
|
447
275
|
*
|
|
448
|
-
* @
|
|
276
|
+
* @template U - The type of the component to retrieve.
|
|
277
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
278
|
+
*
|
|
279
|
+
* @returns The instance of the requested component.
|
|
280
|
+
*
|
|
281
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
282
|
+
*
|
|
283
|
+
* @internal
|
|
284
|
+
*/
|
|
285
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
286
|
+
constructor();
|
|
287
|
+
/**
|
|
288
|
+
* Initializes the Components instance.
|
|
289
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
290
|
+
* and calls the update method.
|
|
449
291
|
*
|
|
450
292
|
* @returns {void}
|
|
451
293
|
*/
|
|
452
|
-
|
|
453
|
-
/**
|
|
294
|
+
init(): void;
|
|
295
|
+
/**
|
|
296
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
297
|
+
* the library. A memory leak will be created if:
|
|
298
|
+
*
|
|
299
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
300
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
301
|
+
* Angular, Vue, etc).
|
|
302
|
+
*
|
|
303
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
304
|
+
* referenced by a reference type (object or array).
|
|
305
|
+
*
|
|
306
|
+
* You can learn more about how Three.js handles memory leaks
|
|
307
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
308
|
+
*
|
|
309
|
+
*/
|
|
454
310
|
dispose(): void;
|
|
311
|
+
private update;
|
|
312
|
+
private static setupBVH;
|
|
455
313
|
}
|
|
456
|
-
import {
|
|
457
|
-
import {
|
|
314
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
315
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
458
316
|
import { Components } from "../Components";
|
|
459
317
|
/**
|
|
460
|
-
* A component that manages
|
|
318
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
461
319
|
*/
|
|
462
|
-
export declare class
|
|
320
|
+
export declare class Grids extends Component implements Disposable {
|
|
463
321
|
/**
|
|
464
322
|
* A unique identifier for the component.
|
|
465
323
|
* This UUID is used to register the component within the Components system.
|
|
466
324
|
*/
|
|
467
|
-
static readonly uuid: "
|
|
468
|
-
/**
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
325
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
326
|
+
/**
|
|
327
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
328
|
+
*/
|
|
329
|
+
list: Map<string, SimpleGrid>;
|
|
330
|
+
/**
|
|
331
|
+
* The default configuration for grid creation.
|
|
332
|
+
*/
|
|
333
|
+
config: Required<GridConfig>;
|
|
472
334
|
/** {@link Disposable.onDisposed} */
|
|
473
335
|
readonly onDisposed: Event<unknown>;
|
|
474
336
|
/** {@link Component.enabled} */
|
|
475
337
|
enabled: boolean;
|
|
338
|
+
constructor(components: Components);
|
|
476
339
|
/**
|
|
477
|
-
*
|
|
340
|
+
* Creates a new grid for the given world.
|
|
341
|
+
* Throws an error if a grid already exists for the world.
|
|
342
|
+
*
|
|
343
|
+
* @param world - The world to create the grid for.
|
|
344
|
+
* @returns The newly created grid.
|
|
345
|
+
*
|
|
346
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
478
347
|
*/
|
|
479
|
-
|
|
348
|
+
create(world: World): SimpleGrid;
|
|
349
|
+
/**
|
|
350
|
+
* Deletes the grid associated with the given world.
|
|
351
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
352
|
+
*
|
|
353
|
+
* @param world - The world for which to delete the grid.
|
|
354
|
+
*
|
|
355
|
+
* @remarks
|
|
356
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
357
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
358
|
+
*/
|
|
359
|
+
delete(world: World): void;
|
|
360
|
+
/** {@link Disposable.dispose} */
|
|
361
|
+
dispose(): void;
|
|
362
|
+
}
|
|
363
|
+
import { Components } from "../Components";
|
|
364
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
365
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
366
|
+
/**
|
|
367
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
368
|
+
*/
|
|
369
|
+
export declare class Cullers extends Component implements Disposable {
|
|
370
|
+
/**
|
|
371
|
+
* A unique identifier for the component.
|
|
372
|
+
* This UUID is used to register the component within the Components system.
|
|
373
|
+
*/
|
|
374
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
375
|
+
/**
|
|
376
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
377
|
+
*/
|
|
378
|
+
readonly onDisposed: Event<unknown>;
|
|
379
|
+
private _enabled;
|
|
380
|
+
/**
|
|
381
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
382
|
+
*/
|
|
383
|
+
list: Map<string, MeshCullerRenderer>;
|
|
384
|
+
/** {@link Component.enabled} */
|
|
385
|
+
get enabled(): boolean;
|
|
386
|
+
/** {@link Component.enabled} */
|
|
387
|
+
set enabled(value: boolean);
|
|
480
388
|
constructor(components: Components);
|
|
481
389
|
/**
|
|
482
|
-
* Creates a new
|
|
483
|
-
* If a
|
|
390
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
391
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
484
392
|
*
|
|
485
|
-
* @param world - The
|
|
486
|
-
* @
|
|
487
|
-
*
|
|
393
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
394
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
395
|
+
*
|
|
396
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
488
397
|
*/
|
|
489
|
-
create(world: World):
|
|
398
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
490
399
|
/**
|
|
491
|
-
* Deletes
|
|
492
|
-
* If a
|
|
400
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
401
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
402
|
+
*
|
|
403
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
493
404
|
*
|
|
494
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
495
405
|
* @returns {void}
|
|
496
406
|
*/
|
|
497
|
-
delete(
|
|
407
|
+
delete(world: World): void;
|
|
498
408
|
/** {@link Disposable.dispose} */
|
|
499
409
|
dispose(): void;
|
|
500
|
-
|
|
501
|
-
|
|
410
|
+
}
|
|
411
|
+
import * as THREE from "three";
|
|
412
|
+
import { Components } from "../Components";
|
|
413
|
+
import { Component } from "../Types";
|
|
414
|
+
/**
|
|
415
|
+
* 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).
|
|
416
|
+
*/
|
|
417
|
+
export declare class Disposer extends Component {
|
|
418
|
+
private _disposedComponents;
|
|
419
|
+
/** {@link Component.enabled} */
|
|
420
|
+
enabled: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* A unique identifier for the component.
|
|
423
|
+
* This UUID is used to register the component within the Components system.
|
|
424
|
+
*/
|
|
425
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
426
|
+
constructor(components: Components);
|
|
427
|
+
/**
|
|
428
|
+
* Return the UUIDs of all disposed components.
|
|
429
|
+
*/
|
|
430
|
+
get(): Set<string>;
|
|
431
|
+
/**
|
|
432
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
433
|
+
* using any of these in other parts of the application, make sure that you
|
|
434
|
+
* remove them from the mesh before disposing it.
|
|
435
|
+
*
|
|
436
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
437
|
+
* to remove.
|
|
438
|
+
*
|
|
439
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
440
|
+
*
|
|
441
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
442
|
+
*/
|
|
443
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
444
|
+
/**
|
|
445
|
+
* Disposes a geometry from memory.
|
|
446
|
+
*
|
|
447
|
+
* @param geometry - the
|
|
448
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
449
|
+
* to remove.
|
|
450
|
+
*/
|
|
451
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
452
|
+
private disposeGeometryAndMaterials;
|
|
453
|
+
private disposeChildren;
|
|
454
|
+
private static disposeMaterial;
|
|
502
455
|
}
|
|
503
456
|
import * as THREE from "three";
|
|
504
457
|
import { Components } from "../Components";
|
|
@@ -565,101 +518,278 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
565
518
|
private setOrthoPerspCameraAspect;
|
|
566
519
|
}
|
|
567
520
|
import * as THREE from "three";
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
521
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
522
|
+
center: THREE.Vector3;
|
|
523
|
+
halfSizes: THREE.Vector3;
|
|
524
|
+
rotation: THREE.Matrix3;
|
|
525
|
+
transformation: THREE.Matrix4;
|
|
526
|
+
};
|
|
527
|
+
import { MiniMap } from "./src";
|
|
528
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
529
|
+
import { Components } from "../Components";
|
|
571
530
|
/**
|
|
572
|
-
* A
|
|
531
|
+
* 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).
|
|
573
532
|
*/
|
|
574
|
-
export declare class
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
533
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
534
|
+
/**
|
|
535
|
+
* A unique identifier for the component.
|
|
536
|
+
* This UUID is used to register the component within the Components system.
|
|
537
|
+
*/
|
|
538
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
539
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
540
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
541
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
542
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
578
543
|
/** {@link Disposable.onDisposed} */
|
|
579
544
|
readonly onDisposed: Event<unknown>;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
private _meshes;
|
|
583
|
-
constructor(components: Components);
|
|
545
|
+
/** {@link Component.enabled} */
|
|
546
|
+
enabled: boolean;
|
|
584
547
|
/**
|
|
585
|
-
* A
|
|
586
|
-
*
|
|
587
|
-
* @param bbox - The bounding box to calculate the dimensions for.
|
|
588
|
-
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
548
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
589
549
|
*/
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
height: number;
|
|
593
|
-
depth: number;
|
|
594
|
-
center: THREE.Vector3;
|
|
595
|
-
};
|
|
550
|
+
list: Map<string, MiniMap>;
|
|
551
|
+
constructor(components: Components);
|
|
596
552
|
/**
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
600
|
-
* @returns A new THREE.Vector3 representing the boundary.
|
|
601
|
-
*
|
|
602
|
-
* @remarks
|
|
603
|
-
* This method is used to create a new boundary for calculating bounding boxes.
|
|
604
|
-
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
605
|
-
* depending on the value of the 'positive' parameter.
|
|
606
|
-
*
|
|
607
|
-
* @example
|
|
608
|
-
* '''typescript
|
|
609
|
-
* const positiveBound = BoundingBoxer.newBound(true);
|
|
610
|
-
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
553
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
554
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
611
555
|
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
556
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
557
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
558
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
615
559
|
*/
|
|
616
|
-
|
|
560
|
+
create(world: World): MiniMap;
|
|
617
561
|
/**
|
|
618
|
-
*
|
|
619
|
-
*
|
|
620
|
-
* @param points - An array of THREE.Vector3 representing the points.
|
|
621
|
-
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
622
|
-
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
623
|
-
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
624
|
-
*
|
|
625
|
-
* @remarks
|
|
626
|
-
* This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
|
|
627
|
-
* If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
|
|
628
|
-
*
|
|
629
|
-
* @example
|
|
630
|
-
* '''typescript
|
|
631
|
-
* const points = [
|
|
632
|
-
* new THREE.Vector3(1, 2, 3),
|
|
633
|
-
* new THREE.Vector3(4, 5, 6),
|
|
634
|
-
* new THREE.Vector3(7, 8, 9),
|
|
635
|
-
* ];
|
|
562
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
563
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
636
564
|
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* '''
|
|
565
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
566
|
+
* @returns {void}
|
|
640
567
|
*/
|
|
641
|
-
|
|
568
|
+
delete(id: string): void;
|
|
642
569
|
/** {@link Disposable.dispose} */
|
|
643
570
|
dispose(): void;
|
|
644
|
-
/**
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
571
|
+
/** {@link Updateable.update} */
|
|
572
|
+
update(): void;
|
|
573
|
+
}
|
|
574
|
+
export declare class UUID {
|
|
575
|
+
private static _pattern;
|
|
576
|
+
private static _lut;
|
|
577
|
+
static create(): string;
|
|
578
|
+
static validate(uuid: string): void;
|
|
579
|
+
}
|
|
580
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
581
|
+
import * as THREE from "three";
|
|
582
|
+
export declare class MaterialsUtils {
|
|
583
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
584
|
+
}
|
|
585
|
+
import * as THREE from "three";
|
|
586
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
587
|
+
/**
|
|
588
|
+
* Configuration interface for the VertexPicker component.
|
|
589
|
+
*/
|
|
590
|
+
export interface VertexPickerConfig {
|
|
591
|
+
/**
|
|
592
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
593
|
+
*/
|
|
594
|
+
showOnlyVertex: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* The maximum distance for snapping to a vertex.
|
|
597
|
+
*/
|
|
598
|
+
snapDistance: number;
|
|
599
|
+
/**
|
|
600
|
+
* The HTML element to use for previewing the picked vertex.
|
|
601
|
+
*/
|
|
602
|
+
previewElement: HTMLElement;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
606
|
+
*/
|
|
607
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
608
|
+
/** {@link Disposable.onDisposed} */
|
|
609
|
+
readonly onDisposed: Event<unknown>;
|
|
610
|
+
/**
|
|
611
|
+
* An event that is triggered when a vertex is found.
|
|
612
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
613
|
+
*/
|
|
614
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
615
|
+
/**
|
|
616
|
+
* An event that is triggered when a vertex is lost.
|
|
617
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
618
|
+
*/
|
|
619
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
620
|
+
/**
|
|
621
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
622
|
+
*/
|
|
623
|
+
components: Components;
|
|
624
|
+
/**
|
|
625
|
+
* A reference to the working plane used for vertex picking.
|
|
626
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
627
|
+
* If this value is null, all vertices are considered valid.
|
|
628
|
+
*/
|
|
629
|
+
workingPlane: THREE.Plane | null;
|
|
630
|
+
private _pickedPoint;
|
|
631
|
+
private _config;
|
|
632
|
+
private _enabled;
|
|
633
|
+
/**
|
|
634
|
+
* Sets the enabled state of the VertexPicker.
|
|
635
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
636
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
637
|
+
*
|
|
638
|
+
* @param value - The new enabled state.
|
|
639
|
+
*/
|
|
640
|
+
set enabled(value: boolean);
|
|
641
|
+
/**
|
|
642
|
+
* Gets the current enabled state of the VertexPicker.
|
|
643
|
+
*
|
|
644
|
+
* @returns The current enabled state.
|
|
645
|
+
*/
|
|
646
|
+
get enabled(): boolean;
|
|
647
|
+
/**
|
|
648
|
+
* Sets the configuration for the VertexPicker component.
|
|
649
|
+
*
|
|
650
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
651
|
+
* The properties not provided in the value object will retain their current values.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* '''typescript
|
|
655
|
+
* vertexPicker.config = {
|
|
656
|
+
* snapDistance: 0.5,
|
|
657
|
+
* showOnlyVertex: true,
|
|
658
|
+
* };
|
|
659
|
+
* '''
|
|
660
|
+
*/
|
|
661
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
662
|
+
/**
|
|
663
|
+
* Gets the current configuration for the VertexPicker component.
|
|
664
|
+
*
|
|
665
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* '''typescript
|
|
669
|
+
* const currentConfig = vertexPicker.config;
|
|
670
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
671
|
+
* '''
|
|
672
|
+
*/
|
|
673
|
+
get config(): Partial<VertexPickerConfig>;
|
|
674
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
675
|
+
/** {@link Disposable.dispose} */
|
|
676
|
+
dispose(): void;
|
|
677
|
+
/**
|
|
678
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
679
|
+
*
|
|
680
|
+
* @param world - The World instance to use for raycasting.
|
|
681
|
+
*
|
|
682
|
+
* @returns The current picked point, or null if no point is picked.
|
|
683
|
+
*
|
|
684
|
+
* @remarks
|
|
685
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
686
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
687
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
688
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
689
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
690
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
691
|
+
*/
|
|
692
|
+
get(world: World): THREE.Vector3 | null;
|
|
693
|
+
private getClosestVertex;
|
|
694
|
+
private getVertices;
|
|
695
|
+
private getVertex;
|
|
696
|
+
}
|
|
697
|
+
import * as THREE from "three";
|
|
698
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
699
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
700
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
701
|
+
/**
|
|
702
|
+
* 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).
|
|
703
|
+
*/
|
|
704
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
705
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
706
|
+
/** {@link Component.enabled} */
|
|
707
|
+
enabled: boolean;
|
|
708
|
+
/** {@link Disposable.onDisposed} */
|
|
709
|
+
readonly onDisposed: Event<unknown>;
|
|
710
|
+
private _absoluteMin;
|
|
711
|
+
private _absoluteMax;
|
|
712
|
+
private _meshes;
|
|
713
|
+
constructor(components: Components);
|
|
714
|
+
/**
|
|
715
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
716
|
+
*
|
|
717
|
+
* @param bbox - The bounding box to calculate the dimensions for.
|
|
718
|
+
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
719
|
+
*/
|
|
720
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
721
|
+
width: number;
|
|
722
|
+
height: number;
|
|
723
|
+
depth: number;
|
|
724
|
+
center: THREE.Vector3;
|
|
725
|
+
};
|
|
726
|
+
/**
|
|
727
|
+
* A static method to create a new bounding box boundary.
|
|
728
|
+
*
|
|
729
|
+
* @param positive - A boolean indicating whether to create a boundary for positive or negative values.
|
|
730
|
+
* @returns A new THREE.Vector3 representing the boundary.
|
|
731
|
+
*
|
|
732
|
+
* @remarks
|
|
733
|
+
* This method is used to create a new boundary for calculating bounding boxes.
|
|
734
|
+
* It sets the x, y, and z components of the returned vector to positive or negative infinity,
|
|
735
|
+
* depending on the value of the 'positive' parameter.
|
|
736
|
+
*
|
|
737
|
+
* @example
|
|
738
|
+
* '''typescript
|
|
739
|
+
* const positiveBound = BoundingBoxer.newBound(true);
|
|
740
|
+
* console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
|
|
741
|
+
*
|
|
742
|
+
* const negativeBound = BoundingBoxer.newBound(false);
|
|
743
|
+
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
744
|
+
* '''
|
|
745
|
+
*/
|
|
746
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
747
|
+
/**
|
|
748
|
+
* A static method to calculate the bounding box of a set of points.
|
|
749
|
+
*
|
|
750
|
+
* @param points - An array of THREE.Vector3 representing the points.
|
|
751
|
+
* @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
|
|
752
|
+
* @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
|
|
753
|
+
* @returns A THREE.Box3 representing the bounding box of the given points.
|
|
754
|
+
*
|
|
755
|
+
* @remarks
|
|
756
|
+
* This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
|
|
757
|
+
* If the 'min' or 'max' parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
|
|
758
|
+
*
|
|
759
|
+
* @example
|
|
760
|
+
* '''typescript
|
|
761
|
+
* const points = [
|
|
762
|
+
* new THREE.Vector3(1, 2, 3),
|
|
763
|
+
* new THREE.Vector3(4, 5, 6),
|
|
764
|
+
* new THREE.Vector3(7, 8, 9),
|
|
765
|
+
* ];
|
|
766
|
+
*
|
|
767
|
+
* const bbox = BoundingBoxer.getBounds(points);
|
|
768
|
+
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
769
|
+
* '''
|
|
770
|
+
*/
|
|
771
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
772
|
+
/** {@link Disposable.dispose} */
|
|
773
|
+
dispose(): void;
|
|
774
|
+
/**
|
|
775
|
+
* Returns the bounding box of the calculated fragments.
|
|
776
|
+
*
|
|
777
|
+
* @returns A new THREE.Box3 instance representing the bounding box.
|
|
778
|
+
*
|
|
779
|
+
* @remarks
|
|
780
|
+
* This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
|
|
781
|
+
* The returned box represents the bounding box of the calculated fragments.
|
|
782
|
+
*
|
|
783
|
+
* @example
|
|
784
|
+
* '''typescript
|
|
785
|
+
* const boundingBox = boundingBoxer.get();
|
|
786
|
+
* console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
|
|
787
|
+
* '''
|
|
788
|
+
*/
|
|
789
|
+
get(): THREE.Box3;
|
|
790
|
+
/**
|
|
791
|
+
* Calculates and returns a sphere that encompasses the entire bounding box.
|
|
792
|
+
*
|
|
663
793
|
* @returns A new THREE.Sphere instance representing the calculated sphere.
|
|
664
794
|
*
|
|
665
795
|
* @remarks
|
|
@@ -750,168 +880,118 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
750
880
|
private static getFragmentBounds;
|
|
751
881
|
}
|
|
752
882
|
import * as THREE from "three";
|
|
753
|
-
import
|
|
754
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
883
|
+
import { Component, Components } from "../../core";
|
|
755
884
|
/**
|
|
756
|
-
*
|
|
885
|
+
* Represents an edge measurement result.
|
|
757
886
|
*/
|
|
758
|
-
export interface
|
|
887
|
+
export interface MeasureEdge {
|
|
759
888
|
/**
|
|
760
|
-
*
|
|
761
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
889
|
+
* The distance between the two points of the edge.
|
|
762
890
|
*/
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
769
|
-
};
|
|
891
|
+
distance: number;
|
|
892
|
+
/**
|
|
893
|
+
* The two points that define the edge.
|
|
894
|
+
*/
|
|
895
|
+
points: THREE.Vector3[];
|
|
770
896
|
}
|
|
771
897
|
/**
|
|
772
|
-
*
|
|
898
|
+
* 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).
|
|
773
899
|
*/
|
|
774
|
-
export declare class
|
|
900
|
+
export declare class MeasurementUtils extends Component {
|
|
775
901
|
/**
|
|
776
902
|
* A unique identifier for the component.
|
|
777
903
|
* This UUID is used to register the component within the Components system.
|
|
778
904
|
*/
|
|
779
|
-
static
|
|
905
|
+
static uuid: string;
|
|
780
906
|
/** {@link Component.enabled} */
|
|
781
907
|
enabled: boolean;
|
|
908
|
+
constructor(components: Components);
|
|
782
909
|
/**
|
|
783
|
-
*
|
|
784
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
785
|
-
*/
|
|
786
|
-
list: Classification;
|
|
787
|
-
/** {@link Disposable.onDisposed} */
|
|
788
|
-
readonly onDisposed: Event<unknown>;
|
|
789
|
-
constructor(components: Components);
|
|
790
|
-
private onFragmentsDisposed;
|
|
791
|
-
/** {@link Disposable.dispose} */
|
|
792
|
-
dispose(): void;
|
|
793
|
-
/**
|
|
794
|
-
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
795
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
796
|
-
*
|
|
797
|
-
* @param guid - The unique identifier of the fragment to be removed.
|
|
798
|
-
*/
|
|
799
|
-
remove(guid: string): void;
|
|
800
|
-
/**
|
|
801
|
-
* Finds and returns fragments based on the provided filter criteria.
|
|
802
|
-
* If no filter is provided, it returns all fragments.
|
|
803
|
-
*
|
|
804
|
-
* @param filter - An optional object containing filter criteria.
|
|
805
|
-
* The keys of the object represent the classification system names,
|
|
806
|
-
* and the values are arrays of class names to match.
|
|
807
|
-
*
|
|
808
|
-
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
809
|
-
* where the express IDs are filtered based on the provided filter criteria.
|
|
810
|
-
*
|
|
811
|
-
* @throws Will throw an error if the fragments map is malformed.
|
|
812
|
-
*/
|
|
813
|
-
find(filter?: {
|
|
814
|
-
[name: string]: string[];
|
|
815
|
-
}): FRAGS.FragmentIdMap;
|
|
816
|
-
/**
|
|
817
|
-
* Classifies fragments based on their modelID.
|
|
818
|
-
*
|
|
819
|
-
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
820
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
821
|
-
*
|
|
822
|
-
* @remarks
|
|
823
|
-
* This method iterates through the fragments in the provided group,
|
|
824
|
-
* and classifies them based on their modelID.
|
|
825
|
-
* The classification is stored in the 'list.models' property,
|
|
826
|
-
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
910
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
827
911
|
*
|
|
912
|
+
* @param point - The point from which to calculate the distance.
|
|
913
|
+
* @param lineStart - The start point of the line segment.
|
|
914
|
+
* @param lineEnd - The end point of the line segment.
|
|
915
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
916
|
+
* @returns The distance from the point to the line segment.
|
|
828
917
|
*/
|
|
829
|
-
|
|
918
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
830
919
|
/**
|
|
831
|
-
*
|
|
832
|
-
*
|
|
833
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
834
|
-
*
|
|
835
|
-
* @remarks
|
|
836
|
-
* This method iterates through the properties of the fragments in the provided group,
|
|
837
|
-
* and classifies them based on their PredefinedType property.
|
|
838
|
-
* The classification is stored in the 'list.predefinedTypes' property,
|
|
839
|
-
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
920
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
921
|
+
* It also returns the edges of the found face and their indices.
|
|
840
922
|
*
|
|
841
|
-
* @
|
|
923
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
924
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
925
|
+
* @param instance - The instance of the mesh (optional).
|
|
926
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
842
927
|
*/
|
|
843
|
-
|
|
928
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
929
|
+
edges: MeasureEdge[];
|
|
930
|
+
indices: Set<number>;
|
|
931
|
+
} | null;
|
|
844
932
|
/**
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
848
|
-
*
|
|
849
|
-
* @remarks
|
|
850
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
851
|
-
* and classifies them based on their entity type.
|
|
852
|
-
* The classification is stored in the 'list.entities' property,
|
|
853
|
-
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
933
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
934
|
+
* It also applies instance transformation if provided.
|
|
854
935
|
*
|
|
855
|
-
* @
|
|
936
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
937
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
938
|
+
* @param instance - The instance of the mesh (optional).
|
|
939
|
+
* @returns An object containing the vertices and normal of the face.
|
|
940
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
856
941
|
*/
|
|
857
|
-
|
|
942
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
943
|
+
p1: THREE.Vector3;
|
|
944
|
+
p2: THREE.Vector3;
|
|
945
|
+
p3: THREE.Vector3;
|
|
946
|
+
faceNormal: THREE.Vector3;
|
|
947
|
+
};
|
|
858
948
|
/**
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
862
|
-
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
863
|
-
* @param systemName - The name of the classification system to store the classification.
|
|
864
|
-
*
|
|
865
|
-
* @remarks
|
|
866
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
867
|
-
* and classifies them based on the specified IFC relationship.
|
|
868
|
-
* The classification is stored in the 'list' property under the specified system name,
|
|
869
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
949
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
950
|
+
* This is used to ensure numerical precision in edge detection.
|
|
870
951
|
*
|
|
871
|
-
* @
|
|
952
|
+
* @param vector - The vector to round.
|
|
953
|
+
* @returns The vector with rounded components.
|
|
872
954
|
*/
|
|
873
|
-
|
|
955
|
+
round(vector: THREE.Vector3): void;
|
|
956
|
+
private getFaceData;
|
|
957
|
+
}
|
|
958
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
959
|
+
import { Components, Component } from "../../core";
|
|
960
|
+
/**
|
|
961
|
+
* 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).
|
|
962
|
+
*/
|
|
963
|
+
export declare class Hider extends Component {
|
|
874
964
|
/**
|
|
875
|
-
*
|
|
876
|
-
*
|
|
877
|
-
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
878
|
-
*
|
|
879
|
-
* @remarks
|
|
880
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
881
|
-
* and classifies them based on their spatial structure in the IFC model.
|
|
882
|
-
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
883
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
884
|
-
*
|
|
885
|
-
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
965
|
+
* A unique identifier for the component.
|
|
966
|
+
* This UUID is used to register the component within the Components system.
|
|
886
967
|
*/
|
|
887
|
-
|
|
968
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
969
|
+
/** {@link Component.enabled} */
|
|
970
|
+
enabled: boolean;
|
|
971
|
+
constructor(components: Components);
|
|
888
972
|
/**
|
|
889
|
-
* Sets the
|
|
890
|
-
*
|
|
891
|
-
*
|
|
892
|
-
* @param color - The color to set for the fragments.
|
|
893
|
-
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
973
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
974
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
975
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
894
976
|
*
|
|
895
|
-
* @
|
|
896
|
-
*
|
|
897
|
-
*
|
|
977
|
+
* @param visible - The visibility state to set for the fragments.
|
|
978
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
979
|
+
* If not provided, all fragments will be affected.
|
|
898
980
|
*
|
|
899
|
-
* @
|
|
981
|
+
* @returns {void}
|
|
900
982
|
*/
|
|
901
|
-
|
|
983
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
902
984
|
/**
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
985
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
986
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
906
987
|
*
|
|
907
|
-
* @
|
|
908
|
-
*
|
|
909
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
988
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
989
|
+
* If not provided, all fragments will be isolated.
|
|
910
990
|
*
|
|
911
|
-
* @
|
|
991
|
+
* @returns {void}
|
|
912
992
|
*/
|
|
913
|
-
|
|
914
|
-
|
|
993
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
994
|
+
private updateCulledVisibility;
|
|
915
995
|
}
|
|
916
996
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
917
997
|
/**
|
|
@@ -963,44 +1043,6 @@ export declare class Exploder extends Component implements Disposable {
|
|
|
963
1043
|
*/
|
|
964
1044
|
set(active: boolean): void;
|
|
965
1045
|
}
|
|
966
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
967
|
-
import { Components, Component } from "../../core";
|
|
968
|
-
/**
|
|
969
|
-
* 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).
|
|
970
|
-
*/
|
|
971
|
-
export declare class Hider extends Component {
|
|
972
|
-
/**
|
|
973
|
-
* A unique identifier for the component.
|
|
974
|
-
* This UUID is used to register the component within the Components system.
|
|
975
|
-
*/
|
|
976
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
977
|
-
/** {@link Component.enabled} */
|
|
978
|
-
enabled: boolean;
|
|
979
|
-
constructor(components: Components);
|
|
980
|
-
/**
|
|
981
|
-
* Sets the visibility of fragments within the 3D scene.
|
|
982
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
983
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
984
|
-
*
|
|
985
|
-
* @param visible - The visibility state to set for the fragments.
|
|
986
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
987
|
-
* If not provided, all fragments will be affected.
|
|
988
|
-
*
|
|
989
|
-
* @returns {void}
|
|
990
|
-
*/
|
|
991
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
992
|
-
/**
|
|
993
|
-
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
994
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
995
|
-
*
|
|
996
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
997
|
-
* If not provided, all fragments will be isolated.
|
|
998
|
-
*
|
|
999
|
-
* @returns {void}
|
|
1000
|
-
*/
|
|
1001
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1002
|
-
private updateCulledVisibility;
|
|
1003
|
-
}
|
|
1004
1046
|
import * as WEBIFC from "web-ifc";
|
|
1005
1047
|
import * as FRAGS from "@thatopen/fragments";
|
|
1006
1048
|
import { IfcFragmentSettings } from "./src";
|
|
@@ -1416,164 +1458,34 @@ export declare class IfcJsonExporter extends Component {
|
|
|
1416
1458
|
*/
|
|
1417
1459
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1418
1460
|
}
|
|
1419
|
-
import * as
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
transformation: THREE.Matrix4;
|
|
1425
|
-
};
|
|
1426
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1427
|
-
import * as THREE from "three";
|
|
1428
|
-
export declare class MaterialsUtils {
|
|
1429
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
1430
|
-
}
|
|
1431
|
-
export declare class UUID {
|
|
1432
|
-
private static _pattern;
|
|
1433
|
-
private static _lut;
|
|
1434
|
-
static create(): string;
|
|
1435
|
-
static validate(uuid: string): void;
|
|
1436
|
-
}
|
|
1437
|
-
import * as THREE from "three";
|
|
1438
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1461
|
+
import * as WEBIFC from "web-ifc";
|
|
1462
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1463
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
1464
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1465
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1439
1466
|
/**
|
|
1440
|
-
*
|
|
1467
|
+
* Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
|
|
1441
1468
|
*/
|
|
1442
|
-
export
|
|
1469
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1443
1470
|
/**
|
|
1444
|
-
*
|
|
1471
|
+
* A unique identifier for the component.
|
|
1472
|
+
* This UUID is used to register the component within the Components system.
|
|
1445
1473
|
*/
|
|
1446
|
-
|
|
1474
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1475
|
+
/** {@link Disposable.onDisposed} */
|
|
1476
|
+
readonly onDisposed: Event<string>;
|
|
1447
1477
|
/**
|
|
1448
|
-
*
|
|
1478
|
+
* Event triggered when relations for a model have been indexed.
|
|
1479
|
+
* This event provides the model's UUID and the relations map generated for that model.
|
|
1480
|
+
*
|
|
1481
|
+
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
1482
|
+
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
1483
|
+
* The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
1449
1484
|
*/
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
previewElement: HTMLElement;
|
|
1455
|
-
}
|
|
1456
|
-
/**
|
|
1457
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1458
|
-
*/
|
|
1459
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
1460
|
-
/** {@link Disposable.onDisposed} */
|
|
1461
|
-
readonly onDisposed: Event<unknown>;
|
|
1462
|
-
/**
|
|
1463
|
-
* An event that is triggered when a vertex is found.
|
|
1464
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1465
|
-
*/
|
|
1466
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1467
|
-
/**
|
|
1468
|
-
* An event that is triggered when a vertex is lost.
|
|
1469
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1470
|
-
*/
|
|
1471
|
-
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1472
|
-
/**
|
|
1473
|
-
* A reference to the Components instance associated with this VertexPicker.
|
|
1474
|
-
*/
|
|
1475
|
-
components: Components;
|
|
1476
|
-
/**
|
|
1477
|
-
* A reference to the working plane used for vertex picking.
|
|
1478
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
1479
|
-
* If this value is null, all vertices are considered valid.
|
|
1480
|
-
*/
|
|
1481
|
-
workingPlane: THREE.Plane | null;
|
|
1482
|
-
private _pickedPoint;
|
|
1483
|
-
private _config;
|
|
1484
|
-
private _enabled;
|
|
1485
|
-
/**
|
|
1486
|
-
* Sets the enabled state of the VertexPicker.
|
|
1487
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1488
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1489
|
-
*
|
|
1490
|
-
* @param value - The new enabled state.
|
|
1491
|
-
*/
|
|
1492
|
-
set enabled(value: boolean);
|
|
1493
|
-
/**
|
|
1494
|
-
* Gets the current enabled state of the VertexPicker.
|
|
1495
|
-
*
|
|
1496
|
-
* @returns The current enabled state.
|
|
1497
|
-
*/
|
|
1498
|
-
get enabled(): boolean;
|
|
1499
|
-
/**
|
|
1500
|
-
* Sets the configuration for the VertexPicker component.
|
|
1501
|
-
*
|
|
1502
|
-
* @param value - A Partial object containing the configuration properties to update.
|
|
1503
|
-
* The properties not provided in the value object will retain their current values.
|
|
1504
|
-
*
|
|
1505
|
-
* @example
|
|
1506
|
-
* '''typescript
|
|
1507
|
-
* vertexPicker.config = {
|
|
1508
|
-
* snapDistance: 0.5,
|
|
1509
|
-
* showOnlyVertex: true,
|
|
1510
|
-
* };
|
|
1511
|
-
* '''
|
|
1512
|
-
*/
|
|
1513
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
1514
|
-
/**
|
|
1515
|
-
* Gets the current configuration for the VertexPicker component.
|
|
1516
|
-
*
|
|
1517
|
-
* @returns A copy of the current VertexPickerConfig object.
|
|
1518
|
-
*
|
|
1519
|
-
* @example
|
|
1520
|
-
* '''typescript
|
|
1521
|
-
* const currentConfig = vertexPicker.config;
|
|
1522
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1523
|
-
* '''
|
|
1524
|
-
*/
|
|
1525
|
-
get config(): Partial<VertexPickerConfig>;
|
|
1526
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
1527
|
-
/** {@link Disposable.dispose} */
|
|
1528
|
-
dispose(): void;
|
|
1529
|
-
/**
|
|
1530
|
-
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
1531
|
-
*
|
|
1532
|
-
* @param world - The World instance to use for raycasting.
|
|
1533
|
-
*
|
|
1534
|
-
* @returns The current picked point, or null if no point is picked.
|
|
1535
|
-
*
|
|
1536
|
-
* @remarks
|
|
1537
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
1538
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
1539
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
1540
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
1541
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
1542
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1543
|
-
*/
|
|
1544
|
-
get(world: World): THREE.Vector3 | null;
|
|
1545
|
-
private getClosestVertex;
|
|
1546
|
-
private getVertices;
|
|
1547
|
-
private getVertex;
|
|
1548
|
-
}
|
|
1549
|
-
import * as WEBIFC from "web-ifc";
|
|
1550
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1551
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
1552
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1553
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1554
|
-
/**
|
|
1555
|
-
* Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
|
|
1556
|
-
*/
|
|
1557
|
-
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1558
|
-
/**
|
|
1559
|
-
* A unique identifier for the component.
|
|
1560
|
-
* This UUID is used to register the component within the Components system.
|
|
1561
|
-
*/
|
|
1562
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1563
|
-
/** {@link Disposable.onDisposed} */
|
|
1564
|
-
readonly onDisposed: Event<string>;
|
|
1565
|
-
/**
|
|
1566
|
-
* Event triggered when relations for a model have been indexed.
|
|
1567
|
-
* This event provides the model's UUID and the relations map generated for that model.
|
|
1568
|
-
*
|
|
1569
|
-
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
1570
|
-
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
1571
|
-
* The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
1572
|
-
*/
|
|
1573
|
-
readonly onRelationsIndexed: Event<{
|
|
1574
|
-
modelID: string;
|
|
1575
|
-
relationsMap: RelationsMap;
|
|
1576
|
-
}>;
|
|
1485
|
+
readonly onRelationsIndexed: Event<{
|
|
1486
|
+
modelID: string;
|
|
1487
|
+
relationsMap: RelationsMap;
|
|
1488
|
+
}>;
|
|
1577
1489
|
/**
|
|
1578
1490
|
* Holds the relationship mappings for each model processed by the indexer.
|
|
1579
1491
|
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
@@ -1687,125 +1599,289 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
1687
1599
|
/** {@link Disposable.dispose} */
|
|
1688
1600
|
dispose(): void;
|
|
1689
1601
|
}
|
|
1690
|
-
import * as
|
|
1691
|
-
import
|
|
1692
|
-
import {
|
|
1693
|
-
/**
|
|
1694
|
-
* Types for boolean properties in IFC schema.
|
|
1695
|
-
*/
|
|
1696
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1697
|
-
/**
|
|
1698
|
-
* Types for string properties in IFC schema.
|
|
1699
|
-
*/
|
|
1700
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1701
|
-
/**
|
|
1702
|
-
* Types for numeric properties in IFC schema.
|
|
1703
|
-
*/
|
|
1704
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1705
|
-
/**
|
|
1706
|
-
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1707
|
-
*/
|
|
1708
|
-
export interface ChangeMap {
|
|
1709
|
-
[modelID: string]: Set<number>;
|
|
1710
|
-
}
|
|
1602
|
+
import * as THREE from "three";
|
|
1603
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1604
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
1711
1605
|
/**
|
|
1712
|
-
* Interface representing a
|
|
1606
|
+
* 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.
|
|
1713
1607
|
*/
|
|
1714
|
-
export interface
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1608
|
+
export interface Classification {
|
|
1609
|
+
/**
|
|
1610
|
+
* A system within the classification.
|
|
1611
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
1612
|
+
*/
|
|
1613
|
+
[system: string]: {
|
|
1614
|
+
/**
|
|
1615
|
+
* A class within the system.
|
|
1616
|
+
* The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
|
|
1617
|
+
*/
|
|
1618
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
1719
1619
|
};
|
|
1720
1620
|
}
|
|
1721
1621
|
/**
|
|
1722
|
-
*
|
|
1622
|
+
* 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).
|
|
1723
1623
|
*/
|
|
1724
|
-
export declare class
|
|
1624
|
+
export declare class Classifier extends Component implements Disposable {
|
|
1725
1625
|
/**
|
|
1726
1626
|
* A unique identifier for the component.
|
|
1727
1627
|
* This UUID is used to register the component within the Components system.
|
|
1728
1628
|
*/
|
|
1729
|
-
static readonly uuid: "
|
|
1730
|
-
/** {@link Disposable.onDisposed} */
|
|
1731
|
-
readonly onDisposed: Event<string>;
|
|
1732
|
-
/**
|
|
1733
|
-
* Event triggered when a file is requested for export.
|
|
1734
|
-
*/
|
|
1735
|
-
readonly onRequestFile: Event<unknown>;
|
|
1736
|
-
/**
|
|
1737
|
-
* ArrayBuffer containing the IFC data to be exported.
|
|
1738
|
-
*/
|
|
1739
|
-
ifcToExport: ArrayBuffer | null;
|
|
1740
|
-
/**
|
|
1741
|
-
* Event triggered when an element is added to a Pset.
|
|
1742
|
-
*/
|
|
1743
|
-
readonly onElementToPset: Event<{
|
|
1744
|
-
model: FragmentsGroup;
|
|
1745
|
-
psetID: number;
|
|
1746
|
-
elementID: number;
|
|
1747
|
-
}>;
|
|
1748
|
-
/**
|
|
1749
|
-
* Event triggered when a property is added to a Pset.
|
|
1750
|
-
*/
|
|
1751
|
-
readonly onPropToPset: Event<{
|
|
1752
|
-
model: FragmentsGroup;
|
|
1753
|
-
psetID: number;
|
|
1754
|
-
propID: number;
|
|
1755
|
-
}>;
|
|
1756
|
-
/**
|
|
1757
|
-
* Event triggered when a Pset is removed.
|
|
1758
|
-
*/
|
|
1759
|
-
readonly onPsetRemoved: Event<{
|
|
1760
|
-
model: FragmentsGroup;
|
|
1761
|
-
psetID: number;
|
|
1762
|
-
}>;
|
|
1763
|
-
/**
|
|
1764
|
-
* Event triggered when data in the model changes.
|
|
1765
|
-
*/
|
|
1766
|
-
readonly onDataChanged: Event<{
|
|
1767
|
-
model: FragmentsGroup;
|
|
1768
|
-
expressID: number;
|
|
1769
|
-
}>;
|
|
1770
|
-
/**
|
|
1771
|
-
* Configuration for the WebAssembly module.
|
|
1772
|
-
*/
|
|
1773
|
-
wasm: {
|
|
1774
|
-
path: string;
|
|
1775
|
-
absolute: boolean;
|
|
1776
|
-
};
|
|
1629
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
1777
1630
|
/** {@link Component.enabled} */
|
|
1778
1631
|
enabled: boolean;
|
|
1779
1632
|
/**
|
|
1780
|
-
*
|
|
1781
|
-
|
|
1782
|
-
attributeListeners: AttributeListener;
|
|
1783
|
-
/**
|
|
1784
|
-
* The currently selected model.
|
|
1785
|
-
*/
|
|
1786
|
-
selectedModel?: FragmentsGroup;
|
|
1787
|
-
/**
|
|
1788
|
-
* Map of changed entities in the model.
|
|
1633
|
+
* A map representing the classification systems.
|
|
1634
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
1789
1635
|
*/
|
|
1790
|
-
|
|
1636
|
+
list: Classification;
|
|
1637
|
+
/** {@link Disposable.onDisposed} */
|
|
1638
|
+
readonly onDisposed: Event<unknown>;
|
|
1791
1639
|
constructor(components: Components);
|
|
1640
|
+
private onFragmentsDisposed;
|
|
1792
1641
|
/** {@link Disposable.dispose} */
|
|
1793
1642
|
dispose(): void;
|
|
1794
1643
|
/**
|
|
1795
|
-
*
|
|
1644
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
1645
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
1796
1646
|
*
|
|
1797
|
-
* @param
|
|
1798
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1799
|
-
* @returns The IFC schema associated with the given model.
|
|
1647
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
1800
1648
|
*/
|
|
1801
|
-
|
|
1649
|
+
remove(guid: string): void;
|
|
1802
1650
|
/**
|
|
1803
|
-
*
|
|
1651
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
1652
|
+
* If no filter is provided, it returns all fragments.
|
|
1804
1653
|
*
|
|
1805
|
-
* @param
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
1808
|
-
*
|
|
1654
|
+
* @param filter - An optional object containing filter criteria.
|
|
1655
|
+
* The keys of the object represent the classification system names,
|
|
1656
|
+
* and the values are arrays of class names to match.
|
|
1657
|
+
*
|
|
1658
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
1659
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
1660
|
+
*
|
|
1661
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
1662
|
+
*/
|
|
1663
|
+
find(filter?: {
|
|
1664
|
+
[name: string]: string[];
|
|
1665
|
+
}): FRAGS.FragmentIdMap;
|
|
1666
|
+
/**
|
|
1667
|
+
* Classifies fragments based on their modelID.
|
|
1668
|
+
*
|
|
1669
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
1670
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1671
|
+
*
|
|
1672
|
+
* @remarks
|
|
1673
|
+
* This method iterates through the fragments in the provided group,
|
|
1674
|
+
* and classifies them based on their modelID.
|
|
1675
|
+
* The classification is stored in the 'list.models' property,
|
|
1676
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1677
|
+
*
|
|
1678
|
+
*/
|
|
1679
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
1680
|
+
/**
|
|
1681
|
+
* Classifies fragments based on their PredefinedType property.
|
|
1682
|
+
*
|
|
1683
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1684
|
+
*
|
|
1685
|
+
* @remarks
|
|
1686
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
1687
|
+
* and classifies them based on their PredefinedType property.
|
|
1688
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
1689
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1690
|
+
*
|
|
1691
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
1692
|
+
*/
|
|
1693
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
1694
|
+
/**
|
|
1695
|
+
* Classifies fragments based on their entity type.
|
|
1696
|
+
*
|
|
1697
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1698
|
+
*
|
|
1699
|
+
* @remarks
|
|
1700
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1701
|
+
* and classifies them based on their entity type.
|
|
1702
|
+
* The classification is stored in the 'list.entities' property,
|
|
1703
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1704
|
+
*
|
|
1705
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
1706
|
+
*/
|
|
1707
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
1708
|
+
/**
|
|
1709
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
1710
|
+
*
|
|
1711
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1712
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
1713
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
1714
|
+
*
|
|
1715
|
+
* @remarks
|
|
1716
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1717
|
+
* and classifies them based on the specified IFC relationship.
|
|
1718
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
1719
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1720
|
+
*
|
|
1721
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
1722
|
+
*/
|
|
1723
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
1724
|
+
/**
|
|
1725
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
1726
|
+
*
|
|
1727
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
1728
|
+
*
|
|
1729
|
+
* @remarks
|
|
1730
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1731
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
1732
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
1733
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1734
|
+
*
|
|
1735
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
1736
|
+
*/
|
|
1737
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
1738
|
+
/**
|
|
1739
|
+
* Sets the color of the specified fragments.
|
|
1740
|
+
*
|
|
1741
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1742
|
+
* @param color - The color to set for the fragments.
|
|
1743
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
1744
|
+
*
|
|
1745
|
+
* @remarks
|
|
1746
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1747
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
1748
|
+
*
|
|
1749
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1750
|
+
*/
|
|
1751
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
1752
|
+
/**
|
|
1753
|
+
* Resets the color of the specified fragments to their original color.
|
|
1754
|
+
*
|
|
1755
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1756
|
+
*
|
|
1757
|
+
* @remarks
|
|
1758
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1759
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
1760
|
+
*
|
|
1761
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1762
|
+
*/
|
|
1763
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1764
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
1765
|
+
}
|
|
1766
|
+
import * as WEBIFC from "web-ifc";
|
|
1767
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1768
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1769
|
+
/**
|
|
1770
|
+
* Types for boolean properties in IFC schema.
|
|
1771
|
+
*/
|
|
1772
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1773
|
+
/**
|
|
1774
|
+
* Types for string properties in IFC schema.
|
|
1775
|
+
*/
|
|
1776
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1777
|
+
/**
|
|
1778
|
+
* Types for numeric properties in IFC schema.
|
|
1779
|
+
*/
|
|
1780
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1781
|
+
/**
|
|
1782
|
+
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1783
|
+
*/
|
|
1784
|
+
export interface ChangeMap {
|
|
1785
|
+
[modelID: string]: Set<number>;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1789
|
+
*/
|
|
1790
|
+
export interface AttributeListener {
|
|
1791
|
+
[modelID: string]: {
|
|
1792
|
+
[expressID: number]: {
|
|
1793
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1794
|
+
};
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1799
|
+
*/
|
|
1800
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1801
|
+
/**
|
|
1802
|
+
* A unique identifier for the component.
|
|
1803
|
+
* This UUID is used to register the component within the Components system.
|
|
1804
|
+
*/
|
|
1805
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1806
|
+
/** {@link Disposable.onDisposed} */
|
|
1807
|
+
readonly onDisposed: Event<string>;
|
|
1808
|
+
/**
|
|
1809
|
+
* Event triggered when a file is requested for export.
|
|
1810
|
+
*/
|
|
1811
|
+
readonly onRequestFile: Event<unknown>;
|
|
1812
|
+
/**
|
|
1813
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1814
|
+
*/
|
|
1815
|
+
ifcToExport: ArrayBuffer | null;
|
|
1816
|
+
/**
|
|
1817
|
+
* Event triggered when an element is added to a Pset.
|
|
1818
|
+
*/
|
|
1819
|
+
readonly onElementToPset: Event<{
|
|
1820
|
+
model: FragmentsGroup;
|
|
1821
|
+
psetID: number;
|
|
1822
|
+
elementID: number;
|
|
1823
|
+
}>;
|
|
1824
|
+
/**
|
|
1825
|
+
* Event triggered when a property is added to a Pset.
|
|
1826
|
+
*/
|
|
1827
|
+
readonly onPropToPset: Event<{
|
|
1828
|
+
model: FragmentsGroup;
|
|
1829
|
+
psetID: number;
|
|
1830
|
+
propID: number;
|
|
1831
|
+
}>;
|
|
1832
|
+
/**
|
|
1833
|
+
* Event triggered when a Pset is removed.
|
|
1834
|
+
*/
|
|
1835
|
+
readonly onPsetRemoved: Event<{
|
|
1836
|
+
model: FragmentsGroup;
|
|
1837
|
+
psetID: number;
|
|
1838
|
+
}>;
|
|
1839
|
+
/**
|
|
1840
|
+
* Event triggered when data in the model changes.
|
|
1841
|
+
*/
|
|
1842
|
+
readonly onDataChanged: Event<{
|
|
1843
|
+
model: FragmentsGroup;
|
|
1844
|
+
expressID: number;
|
|
1845
|
+
}>;
|
|
1846
|
+
/**
|
|
1847
|
+
* Configuration for the WebAssembly module.
|
|
1848
|
+
*/
|
|
1849
|
+
wasm: {
|
|
1850
|
+
path: string;
|
|
1851
|
+
absolute: boolean;
|
|
1852
|
+
};
|
|
1853
|
+
/** {@link Component.enabled} */
|
|
1854
|
+
enabled: boolean;
|
|
1855
|
+
/**
|
|
1856
|
+
* Map of attribute listeners.
|
|
1857
|
+
*/
|
|
1858
|
+
attributeListeners: AttributeListener;
|
|
1859
|
+
/**
|
|
1860
|
+
* The currently selected model.
|
|
1861
|
+
*/
|
|
1862
|
+
selectedModel?: FragmentsGroup;
|
|
1863
|
+
/**
|
|
1864
|
+
* Map of changed entities in the model.
|
|
1865
|
+
*/
|
|
1866
|
+
changeMap: ChangeMap;
|
|
1867
|
+
constructor(components: Components);
|
|
1868
|
+
/** {@link Disposable.dispose} */
|
|
1869
|
+
dispose(): void;
|
|
1870
|
+
/**
|
|
1871
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
1872
|
+
*
|
|
1873
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1874
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1875
|
+
* @returns The IFC schema associated with the given model.
|
|
1876
|
+
*/
|
|
1877
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1878
|
+
/**
|
|
1879
|
+
* Method to set properties data in the model.
|
|
1880
|
+
*
|
|
1881
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1882
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1883
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1884
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
1809
1885
|
*
|
|
1810
1886
|
* @returns {Promise<void>} A promise that resolves when all the properties have been set.
|
|
1811
1887
|
*
|
|
@@ -1943,86 +2019,54 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
1943
2019
|
private registerChange;
|
|
1944
2020
|
private newSingleProperty;
|
|
1945
2021
|
}
|
|
1946
|
-
import * as
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
export interface MeasureEdge {
|
|
1952
|
-
/**
|
|
1953
|
-
* The distance between the two points of the edge.
|
|
1954
|
-
*/
|
|
1955
|
-
distance: number;
|
|
1956
|
-
/**
|
|
1957
|
-
* The two points that define the edge.
|
|
1958
|
-
*/
|
|
1959
|
-
points: THREE.Vector3[];
|
|
1960
|
-
}
|
|
1961
|
-
/**
|
|
1962
|
-
* 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).
|
|
1963
|
-
*/
|
|
1964
|
-
export declare class MeasurementUtils extends Component {
|
|
2022
|
+
import * as WEBIFC from "web-ifc";
|
|
2023
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2024
|
+
export declare class IfcFragmentSettings {
|
|
2025
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2026
|
+
includeProperties: boolean;
|
|
1965
2027
|
/**
|
|
1966
|
-
*
|
|
1967
|
-
*
|
|
2028
|
+
* Generate the geometry for categories that are not included by default,
|
|
2029
|
+
* like IFCSPACE.
|
|
1968
2030
|
*/
|
|
1969
|
-
|
|
1970
|
-
/**
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
1985
|
-
* It also returns the edges of the found face and their indices.
|
|
1986
|
-
*
|
|
1987
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1988
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1989
|
-
* @param instance - The instance of the mesh (optional).
|
|
1990
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1991
|
-
*/
|
|
1992
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1993
|
-
edges: MeasureEdge[];
|
|
1994
|
-
indices: Set<number>;
|
|
1995
|
-
} | null;
|
|
2031
|
+
optionalCategories: number[];
|
|
2032
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2033
|
+
coordinate: boolean;
|
|
2034
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2035
|
+
wasm: {
|
|
2036
|
+
path: string;
|
|
2037
|
+
absolute: boolean;
|
|
2038
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2039
|
+
};
|
|
2040
|
+
/** List of categories that won't be converted to fragments. */
|
|
2041
|
+
excludedCategories: Set<number>;
|
|
2042
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2043
|
+
saveLocations: boolean;
|
|
2044
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2045
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
1996
2046
|
/**
|
|
1997
|
-
*
|
|
1998
|
-
*
|
|
1999
|
-
*
|
|
2000
|
-
*
|
|
2001
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
2002
|
-
* @param instance - The instance of the mesh (optional).
|
|
2003
|
-
* @returns An object containing the vertices and normal of the face.
|
|
2004
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
2047
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2048
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2049
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2050
|
+
* Default value is true.
|
|
2005
2051
|
*/
|
|
2006
|
-
|
|
2007
|
-
p1: THREE.Vector3;
|
|
2008
|
-
p2: THREE.Vector3;
|
|
2009
|
-
p3: THREE.Vector3;
|
|
2010
|
-
faceNormal: THREE.Vector3;
|
|
2011
|
-
};
|
|
2052
|
+
autoSetWasm: boolean;
|
|
2012
2053
|
/**
|
|
2013
|
-
*
|
|
2014
|
-
* This
|
|
2054
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2055
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2056
|
+
* If set to null, the default file location handler will be used.
|
|
2015
2057
|
*
|
|
2016
|
-
* @param
|
|
2017
|
-
* @returns The
|
|
2058
|
+
* @param url - The URL of the file to locate.
|
|
2059
|
+
* @returns The absolute path of the file.
|
|
2018
2060
|
*/
|
|
2019
|
-
|
|
2020
|
-
|
|
2061
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2062
|
+
}
|
|
2063
|
+
import * as WEBIFC from "web-ifc";
|
|
2064
|
+
export interface IfcItemsCategories {
|
|
2065
|
+
[itemID: number]: number;
|
|
2066
|
+
}
|
|
2067
|
+
export declare class IfcCategories {
|
|
2068
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2021
2069
|
}
|
|
2022
|
-
/**
|
|
2023
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2024
|
-
*/
|
|
2025
|
-
export declare const GeometryTypes: Set<number>;
|
|
2026
2070
|
import * as THREE from "three";
|
|
2027
2071
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2028
2072
|
/**
|
|
@@ -2112,67 +2156,12 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2112
2156
|
resize(size?: THREE.Vector2): void;
|
|
2113
2157
|
private updatePlanes;
|
|
2114
2158
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
2122
|
-
export declare class SpatialStructure {
|
|
2123
|
-
itemsByFloor: IfcItemsCategories;
|
|
2124
|
-
private _units;
|
|
2125
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2126
|
-
cleanUp(): void;
|
|
2127
|
-
}
|
|
2128
|
-
import * as WEBIFC from "web-ifc";
|
|
2129
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
2130
|
-
export declare class IfcFragmentSettings {
|
|
2131
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
2132
|
-
includeProperties: boolean;
|
|
2133
|
-
/**
|
|
2134
|
-
* Generate the geometry for categories that are not included by default,
|
|
2135
|
-
* like IFCSPACE.
|
|
2136
|
-
*/
|
|
2137
|
-
optionalCategories: number[];
|
|
2138
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
2139
|
-
coordinate: boolean;
|
|
2140
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2141
|
-
wasm: {
|
|
2142
|
-
path: string;
|
|
2143
|
-
absolute: boolean;
|
|
2144
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2145
|
-
};
|
|
2146
|
-
/** List of categories that won't be converted to fragments. */
|
|
2147
|
-
excludedCategories: Set<number>;
|
|
2148
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
2149
|
-
saveLocations: boolean;
|
|
2150
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2151
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
2152
|
-
/**
|
|
2153
|
-
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2154
|
-
* If set to true, the path will be set to the default path of the WASM file.
|
|
2155
|
-
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2156
|
-
* Default value is true.
|
|
2157
|
-
*/
|
|
2158
|
-
autoSetWasm: boolean;
|
|
2159
|
-
/**
|
|
2160
|
-
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2161
|
-
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2162
|
-
* If set to null, the default file location handler will be used.
|
|
2163
|
-
*
|
|
2164
|
-
* @param url - The URL of the file to locate.
|
|
2165
|
-
* @returns The absolute path of the file.
|
|
2166
|
-
*/
|
|
2167
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2168
|
-
}
|
|
2169
|
-
import * as WEBIFC from "web-ifc";
|
|
2170
|
-
export interface IfcItemsCategories {
|
|
2171
|
-
[itemID: number]: number;
|
|
2172
|
-
}
|
|
2173
|
-
export declare class IfcCategories {
|
|
2174
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2175
|
-
}
|
|
2159
|
+
/**
|
|
2160
|
+
* 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.
|
|
2161
|
+
*/
|
|
2162
|
+
export declare const IfcCategoryMap: {
|
|
2163
|
+
[key: number]: string;
|
|
2164
|
+
};
|
|
2176
2165
|
/**
|
|
2177
2166
|
* 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.
|
|
2178
2167
|
*
|
|
@@ -2184,12 +2173,14 @@ export declare class IfcCategories {
|
|
|
2184
2173
|
export declare const IfcElements: {
|
|
2185
2174
|
[key: number]: string;
|
|
2186
2175
|
};
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2176
|
+
import * as WEBIFC from "web-ifc";
|
|
2177
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2178
|
+
export declare class SpatialStructure {
|
|
2179
|
+
itemsByFloor: IfcItemsCategories;
|
|
2180
|
+
private _units;
|
|
2181
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2182
|
+
cleanUp(): void;
|
|
2183
|
+
}
|
|
2193
2184
|
import * as FRAGS from "@thatopen/fragments";
|
|
2194
2185
|
export declare class IfcPropertiesUtils {
|
|
2195
2186
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2216,60 +2207,26 @@ export declare class IfcPropertiesUtils {
|
|
|
2216
2207
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2217
2208
|
}
|
|
2218
2209
|
/**
|
|
2219
|
-
*
|
|
2210
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2220
2211
|
*/
|
|
2221
|
-
export declare
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
} : {
|
|
2229
|
-
(data: T): void;
|
|
2230
|
-
}): void;
|
|
2231
|
-
/**
|
|
2232
|
-
* Removes a callback from this event instance.
|
|
2233
|
-
* @param handler - the callback to be removed from this event.
|
|
2234
|
-
*/
|
|
2235
|
-
remove(handler: T extends void ? {
|
|
2236
|
-
(): void;
|
|
2237
|
-
} : {
|
|
2238
|
-
(data: T): void;
|
|
2239
|
-
}): void;
|
|
2240
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2241
|
-
trigger: (data?: T) => void;
|
|
2242
|
-
/** Gets rid of all the suscribed events. */
|
|
2243
|
-
reset(): void;
|
|
2244
|
-
private handlers;
|
|
2245
|
-
}
|
|
2212
|
+
export declare const GeometryTypes: Set<number>;
|
|
2213
|
+
import { InverseAttribute } from "./types";
|
|
2214
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2215
|
+
forRelating: InverseAttribute;
|
|
2216
|
+
forRelated: InverseAttribute;
|
|
2217
|
+
}>;
|
|
2218
|
+
import { Base } from "./base";
|
|
2246
2219
|
/**
|
|
2247
|
-
*
|
|
2220
|
+
* 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.
|
|
2248
2221
|
*/
|
|
2249
|
-
export declare class
|
|
2250
|
-
/**
|
|
2251
|
-
* Add a callback to this event instance.
|
|
2252
|
-
* @param handler - the callback to be added to this event.
|
|
2253
|
-
*/
|
|
2254
|
-
add(handler: T extends void ? {
|
|
2255
|
-
(): Promise<void>;
|
|
2256
|
-
} : {
|
|
2257
|
-
(data: T): Promise<void>;
|
|
2258
|
-
}): void;
|
|
2222
|
+
export declare abstract class Component extends Base {
|
|
2259
2223
|
/**
|
|
2260
|
-
*
|
|
2261
|
-
*
|
|
2224
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
2225
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2226
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2227
|
+
* will not be updated automatically each frame.
|
|
2262
2228
|
*/
|
|
2263
|
-
|
|
2264
|
-
(): Promise<void>;
|
|
2265
|
-
} : {
|
|
2266
|
-
(data: T): Promise<void>;
|
|
2267
|
-
}): void;
|
|
2268
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2269
|
-
trigger: (data?: T) => Promise<void>;
|
|
2270
|
-
/** Gets rid of all the suscribed events. */
|
|
2271
|
-
reset(): void;
|
|
2272
|
-
private handlers;
|
|
2229
|
+
abstract enabled: boolean;
|
|
2273
2230
|
}
|
|
2274
2231
|
import * as THREE from "three";
|
|
2275
2232
|
import CameraControls from "camera-controls";
|
|
@@ -2379,33 +2336,76 @@ export interface CameraControllable {
|
|
|
2379
2336
|
*/
|
|
2380
2337
|
controls: CameraControls;
|
|
2381
2338
|
}
|
|
2382
|
-
import { Base } from "./base";
|
|
2383
2339
|
/**
|
|
2384
|
-
*
|
|
2340
|
+
* 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.
|
|
2385
2341
|
*/
|
|
2386
|
-
export declare
|
|
2342
|
+
export declare class Event<T> {
|
|
2387
2343
|
/**
|
|
2388
|
-
*
|
|
2389
|
-
*
|
|
2390
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2391
|
-
* will not be updated automatically each frame.
|
|
2344
|
+
* Add a callback to this event instance.
|
|
2345
|
+
* @param handler - the callback to be added to this event.
|
|
2392
2346
|
*/
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
/**
|
|
2408
|
-
|
|
2347
|
+
add(handler: T extends void ? {
|
|
2348
|
+
(): void;
|
|
2349
|
+
} : {
|
|
2350
|
+
(data: T): void;
|
|
2351
|
+
}): void;
|
|
2352
|
+
/**
|
|
2353
|
+
* Removes a callback from this event instance.
|
|
2354
|
+
* @param handler - the callback to be removed from this event.
|
|
2355
|
+
*/
|
|
2356
|
+
remove(handler: T extends void ? {
|
|
2357
|
+
(): void;
|
|
2358
|
+
} : {
|
|
2359
|
+
(data: T): void;
|
|
2360
|
+
}): void;
|
|
2361
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2362
|
+
trigger: (data?: T) => void;
|
|
2363
|
+
/** Gets rid of all the suscribed events. */
|
|
2364
|
+
reset(): void;
|
|
2365
|
+
private handlers;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* 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.
|
|
2369
|
+
*/
|
|
2370
|
+
export declare class AsyncEvent<T> {
|
|
2371
|
+
/**
|
|
2372
|
+
* Add a callback to this event instance.
|
|
2373
|
+
* @param handler - the callback to be added to this event.
|
|
2374
|
+
*/
|
|
2375
|
+
add(handler: T extends void ? {
|
|
2376
|
+
(): Promise<void>;
|
|
2377
|
+
} : {
|
|
2378
|
+
(data: T): Promise<void>;
|
|
2379
|
+
}): void;
|
|
2380
|
+
/**
|
|
2381
|
+
* Removes a callback from this event instance.
|
|
2382
|
+
* @param handler - the callback to be removed from this event.
|
|
2383
|
+
*/
|
|
2384
|
+
remove(handler: T extends void ? {
|
|
2385
|
+
(): Promise<void>;
|
|
2386
|
+
} : {
|
|
2387
|
+
(data: T): Promise<void>;
|
|
2388
|
+
}): void;
|
|
2389
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2390
|
+
trigger: (data?: T) => Promise<void>;
|
|
2391
|
+
/** Gets rid of all the suscribed events. */
|
|
2392
|
+
reset(): void;
|
|
2393
|
+
private handlers;
|
|
2394
|
+
}
|
|
2395
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2396
|
+
import { Components } from "../../Components";
|
|
2397
|
+
/**
|
|
2398
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2399
|
+
*/
|
|
2400
|
+
export declare abstract class Base {
|
|
2401
|
+
components: Components;
|
|
2402
|
+
constructor(components: Components);
|
|
2403
|
+
/** Whether is component is {@link Disposable}. */
|
|
2404
|
+
isDisposeable: () => this is Disposable;
|
|
2405
|
+
/** Whether is component is {@link Resizeable}. */
|
|
2406
|
+
isResizeable: () => this is Resizeable;
|
|
2407
|
+
/** Whether is component is {@link Updateable}. */
|
|
2408
|
+
isUpdateable: () => this is Updateable;
|
|
2409
2409
|
/** Whether is component is {@link Hideable}. */
|
|
2410
2410
|
isHideable: () => this is Hideable;
|
|
2411
2411
|
/** Whether is component is {@link Configurable}. */
|
|
@@ -2582,79 +2582,83 @@ export interface World extends Disposable, Updateable {
|
|
|
2582
2582
|
isDisposing: boolean;
|
|
2583
2583
|
}
|
|
2584
2584
|
import * as THREE from "three";
|
|
2585
|
-
import { Disposable,
|
|
2585
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
2586
2586
|
/**
|
|
2587
|
-
* A
|
|
2587
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
2588
|
+
*
|
|
2589
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
2590
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
2591
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2588
2592
|
*/
|
|
2589
|
-
export declare class
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
2594
|
+
/**
|
|
2595
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
2596
|
+
*/
|
|
2597
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2598
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2599
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
2600
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2601
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
2593
2602
|
/** {@link Disposable.onDisposed} */
|
|
2594
2603
|
readonly onDisposed: Event<unknown>;
|
|
2595
|
-
constructor(dom: HTMLCanvasElement);
|
|
2596
2604
|
/**
|
|
2597
|
-
*
|
|
2605
|
+
* 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.
|
|
2606
|
+
*/
|
|
2607
|
+
isDisposing: boolean;
|
|
2608
|
+
/**
|
|
2609
|
+
* Indicates whether the world is currently enabled.
|
|
2610
|
+
* When disabled, the world will not be updated.
|
|
2598
2611
|
*/
|
|
2599
|
-
get position(): THREE.Vector2;
|
|
2600
|
-
/** {@link Disposable.dispose} */
|
|
2601
|
-
dispose(): void;
|
|
2602
|
-
private getPositionY;
|
|
2603
|
-
private getPositionX;
|
|
2604
|
-
private updateMouseInfo;
|
|
2605
|
-
private setupEvents;
|
|
2606
|
-
}
|
|
2607
|
-
import * as THREE from "three";
|
|
2608
|
-
import { Components } from "../../Components";
|
|
2609
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2610
|
-
import { Mouse } from "./mouse";
|
|
2611
|
-
/**
|
|
2612
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
2613
|
-
*/
|
|
2614
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
2615
|
-
/** {@link Component.enabled} */
|
|
2616
2612
|
enabled: boolean;
|
|
2617
|
-
/** The components instance to which this Raycaster belongs. */
|
|
2618
|
-
components: Components;
|
|
2619
|
-
/** {@link Disposable.onDisposed} */
|
|
2620
|
-
readonly onDisposed: Event<unknown>;
|
|
2621
|
-
/** The position of the mouse in the screen. */
|
|
2622
|
-
readonly mouse: Mouse;
|
|
2623
2613
|
/**
|
|
2624
|
-
* A
|
|
2625
|
-
* This is used for raycasting operations.
|
|
2614
|
+
* A unique identifier for the world.
|
|
2626
2615
|
*/
|
|
2627
|
-
|
|
2616
|
+
uuid: string;
|
|
2628
2617
|
/**
|
|
2629
|
-
*
|
|
2630
|
-
* This is used to access the camera and meshes.
|
|
2618
|
+
* An optional name for the world.
|
|
2631
2619
|
*/
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2620
|
+
name?: string;
|
|
2621
|
+
private _scene?;
|
|
2622
|
+
private _camera?;
|
|
2623
|
+
private _renderer;
|
|
2636
2624
|
/**
|
|
2637
|
-
*
|
|
2638
|
-
*
|
|
2639
|
-
* used by the renderer.
|
|
2640
|
-
*
|
|
2641
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2642
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
2643
|
-
* {@link Components.meshes}.
|
|
2625
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
2626
|
+
* @returns The current scene.
|
|
2644
2627
|
*/
|
|
2645
|
-
|
|
2628
|
+
get scene(): T;
|
|
2646
2629
|
/**
|
|
2647
|
-
*
|
|
2648
|
-
*
|
|
2649
|
-
*
|
|
2650
|
-
* @param origin - The origin of the ray.
|
|
2651
|
-
* @param direction - The direction of the ray.
|
|
2652
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2653
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2630
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
2631
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
2632
|
+
* @param scene - The new scene to be set.
|
|
2654
2633
|
*/
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2634
|
+
set scene(scene: T);
|
|
2635
|
+
/**
|
|
2636
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
2637
|
+
* @returns The current camera.
|
|
2638
|
+
*/
|
|
2639
|
+
get camera(): U;
|
|
2640
|
+
/**
|
|
2641
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
2642
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
2643
|
+
* @param camera - The new camera to be set.
|
|
2644
|
+
*/
|
|
2645
|
+
set camera(camera: U);
|
|
2646
|
+
/**
|
|
2647
|
+
* Getter for the renderer.
|
|
2648
|
+
* @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).
|
|
2649
|
+
*/
|
|
2650
|
+
get renderer(): S | null;
|
|
2651
|
+
/**
|
|
2652
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
2653
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
2654
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
2655
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
2656
|
+
*/
|
|
2657
|
+
set renderer(renderer: S | null);
|
|
2658
|
+
/** {@link Updateable.update} */
|
|
2659
|
+
update(delta?: number): void;
|
|
2660
|
+
/** {@link Disposable.dispose} */
|
|
2661
|
+
dispose(disposeResources?: boolean): void;
|
|
2658
2662
|
}
|
|
2659
2663
|
import * as THREE from "three";
|
|
2660
2664
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
@@ -2750,142 +2754,86 @@ export declare class SimpleRenderer extends BaseRenderer {
|
|
|
2750
2754
|
private onContextBack;
|
|
2751
2755
|
}
|
|
2752
2756
|
import * as THREE from "three";
|
|
2753
|
-
import {
|
|
2757
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2758
|
+
import { Components } from "../../Components";
|
|
2754
2759
|
/**
|
|
2755
|
-
*
|
|
2756
|
-
*
|
|
2757
|
-
* @template T - The type of the scene. Default is BaseScene.
|
|
2758
|
-
* @template U - The type of the camera. Default is BaseCamera.
|
|
2759
|
-
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
2760
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
2760
2761
|
*/
|
|
2761
|
-
export
|
|
2762
|
-
/**
|
|
2763
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
2764
|
-
*/
|
|
2765
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
2766
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2767
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
2768
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2769
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
2770
|
-
/** {@link Disposable.onDisposed} */
|
|
2771
|
-
readonly onDisposed: Event<unknown>;
|
|
2772
|
-
/**
|
|
2773
|
-
* 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.
|
|
2774
|
-
*/
|
|
2775
|
-
isDisposing: boolean;
|
|
2762
|
+
export interface GridConfig {
|
|
2776
2763
|
/**
|
|
2777
|
-
*
|
|
2778
|
-
* When disabled, the world will not be updated.
|
|
2764
|
+
* The color of the grid lines.
|
|
2779
2765
|
*/
|
|
2780
|
-
|
|
2766
|
+
color: THREE.Color;
|
|
2781
2767
|
/**
|
|
2782
|
-
*
|
|
2768
|
+
* The size of the primary grid lines.
|
|
2783
2769
|
*/
|
|
2784
|
-
|
|
2770
|
+
size1: number;
|
|
2785
2771
|
/**
|
|
2786
|
-
*
|
|
2772
|
+
* The size of the secondary grid lines.
|
|
2787
2773
|
*/
|
|
2788
|
-
|
|
2789
|
-
private _scene?;
|
|
2790
|
-
private _camera?;
|
|
2791
|
-
private _renderer;
|
|
2774
|
+
size2: number;
|
|
2792
2775
|
/**
|
|
2793
|
-
*
|
|
2794
|
-
* @returns The current scene.
|
|
2776
|
+
* The distance at which the grid lines start to fade away.
|
|
2795
2777
|
*/
|
|
2796
|
-
|
|
2778
|
+
distance: number;
|
|
2779
|
+
}
|
|
2780
|
+
/**
|
|
2781
|
+
* 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).
|
|
2782
|
+
*/
|
|
2783
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2784
|
+
/** {@link Disposable.onDisposed} */
|
|
2785
|
+
readonly onDisposed: Event<unknown>;
|
|
2786
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2787
|
+
world: World;
|
|
2788
|
+
/** The components instance to which this grid belongs. */
|
|
2789
|
+
components: Components;
|
|
2790
|
+
/** {@link Hideable.visible} */
|
|
2791
|
+
get visible(): boolean;
|
|
2792
|
+
/** {@link Hideable.visible} */
|
|
2793
|
+
set visible(visible: boolean);
|
|
2794
|
+
/** The material of the grid. */
|
|
2795
|
+
get material(): THREE.ShaderMaterial;
|
|
2797
2796
|
/**
|
|
2798
|
-
*
|
|
2799
|
-
*
|
|
2800
|
-
* @param scene - The new scene to be set.
|
|
2797
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2798
|
+
* perspective cameras and false for orthographic cameras.
|
|
2801
2799
|
*/
|
|
2802
|
-
|
|
2800
|
+
get fade(): boolean;
|
|
2803
2801
|
/**
|
|
2804
|
-
*
|
|
2805
|
-
*
|
|
2802
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2803
|
+
* perspective cameras and false for orthographic cameras.
|
|
2806
2804
|
*/
|
|
2807
|
-
|
|
2808
|
-
/**
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
*/
|
|
2813
|
-
set camera(camera: U);
|
|
2814
|
-
/**
|
|
2815
|
-
* Getter for the renderer.
|
|
2816
|
-
* @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).
|
|
2817
|
-
*/
|
|
2818
|
-
get renderer(): S | null;
|
|
2819
|
-
/**
|
|
2820
|
-
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
2821
|
-
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
2822
|
-
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
2823
|
-
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
2824
|
-
*/
|
|
2825
|
-
set renderer(renderer: S | null);
|
|
2826
|
-
/** {@link Updateable.update} */
|
|
2827
|
-
update(delta?: number): void;
|
|
2805
|
+
set fade(active: boolean);
|
|
2806
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2807
|
+
readonly three: THREE.Mesh;
|
|
2808
|
+
private _fade;
|
|
2809
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2828
2810
|
/** {@link Disposable.dispose} */
|
|
2829
|
-
dispose(
|
|
2811
|
+
dispose(): void;
|
|
2812
|
+
private setupEvents;
|
|
2813
|
+
private updateZoom;
|
|
2830
2814
|
}
|
|
2831
2815
|
import * as THREE from "three";
|
|
2832
|
-
import {
|
|
2833
|
-
import { Components } from "../../Components";
|
|
2834
|
-
/**
|
|
2835
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
2836
|
-
*/
|
|
2837
|
-
export interface GridConfig {
|
|
2838
|
-
/**
|
|
2839
|
-
* The color of the grid lines.
|
|
2840
|
-
*/
|
|
2841
|
-
color: THREE.Color;
|
|
2842
|
-
/**
|
|
2843
|
-
* The size of the primary grid lines.
|
|
2844
|
-
*/
|
|
2845
|
-
size1: number;
|
|
2846
|
-
/**
|
|
2847
|
-
* The size of the secondary grid lines.
|
|
2848
|
-
*/
|
|
2849
|
-
size2: number;
|
|
2850
|
-
/**
|
|
2851
|
-
* The distance at which the grid lines start to fade away.
|
|
2852
|
-
*/
|
|
2853
|
-
distance: number;
|
|
2854
|
-
}
|
|
2816
|
+
import { Disposable, Event } from "../../Types";
|
|
2855
2817
|
/**
|
|
2856
|
-
*
|
|
2818
|
+
* 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.
|
|
2857
2819
|
*/
|
|
2858
|
-
export declare class
|
|
2820
|
+
export declare class Mouse implements Disposable {
|
|
2821
|
+
dom: HTMLCanvasElement;
|
|
2822
|
+
private _event?;
|
|
2823
|
+
private _position;
|
|
2859
2824
|
/** {@link Disposable.onDisposed} */
|
|
2860
2825
|
readonly onDisposed: Event<unknown>;
|
|
2861
|
-
|
|
2862
|
-
world: World;
|
|
2863
|
-
/** The components instance to which this grid belongs. */
|
|
2864
|
-
components: Components;
|
|
2865
|
-
/** {@link Hideable.visible} */
|
|
2866
|
-
get visible(): boolean;
|
|
2867
|
-
/** {@link Hideable.visible} */
|
|
2868
|
-
set visible(visible: boolean);
|
|
2869
|
-
/** The material of the grid. */
|
|
2870
|
-
get material(): THREE.ShaderMaterial;
|
|
2871
|
-
/**
|
|
2872
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2873
|
-
* perspective cameras and false for orthographic cameras.
|
|
2874
|
-
*/
|
|
2875
|
-
get fade(): boolean;
|
|
2826
|
+
constructor(dom: HTMLCanvasElement);
|
|
2876
2827
|
/**
|
|
2877
|
-
*
|
|
2878
|
-
* perspective cameras and false for orthographic cameras.
|
|
2828
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2879
2829
|
*/
|
|
2880
|
-
|
|
2881
|
-
/** The Three.js mesh that contains the infinite grid. */
|
|
2882
|
-
readonly three: THREE.Mesh;
|
|
2883
|
-
private _fade;
|
|
2884
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
2830
|
+
get position(): THREE.Vector2;
|
|
2885
2831
|
/** {@link Disposable.dispose} */
|
|
2886
2832
|
dispose(): void;
|
|
2833
|
+
private getPositionY;
|
|
2834
|
+
private getPositionX;
|
|
2835
|
+
private updateMouseInfo;
|
|
2887
2836
|
private setupEvents;
|
|
2888
|
-
private updateZoom;
|
|
2889
2837
|
}
|
|
2890
2838
|
import * as THREE from "three";
|
|
2891
2839
|
import { Components } from "../../Components";
|
|
@@ -3097,6 +3045,113 @@ export declare class MeshCullerRenderer extends CullerRenderer implements Dispos
|
|
|
3097
3045
|
private getAvailableMaterial;
|
|
3098
3046
|
}
|
|
3099
3047
|
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3048
|
+
import { NavigationMode } from "./types";
|
|
3049
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3050
|
+
/**
|
|
3051
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3052
|
+
*/
|
|
3053
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3054
|
+
private camera;
|
|
3055
|
+
/** {@link NavigationMode.enabled} */
|
|
3056
|
+
enabled: boolean;
|
|
3057
|
+
/** {@link NavigationMode.id} */
|
|
3058
|
+
readonly id = "FirstPerson";
|
|
3059
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3060
|
+
/** {@link NavigationMode.set} */
|
|
3061
|
+
set(active: boolean): void;
|
|
3062
|
+
private setupFirstPersonCamera;
|
|
3063
|
+
}
|
|
3064
|
+
import { NavigationMode } from "./types";
|
|
3065
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3066
|
+
/**
|
|
3067
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3068
|
+
*/
|
|
3069
|
+
export declare class PlanMode implements NavigationMode {
|
|
3070
|
+
private camera;
|
|
3071
|
+
/** {@link NavigationMode.enabled} */
|
|
3072
|
+
enabled: boolean;
|
|
3073
|
+
/** {@link NavigationMode.id} */
|
|
3074
|
+
readonly id = "Plan";
|
|
3075
|
+
private mouseAction1?;
|
|
3076
|
+
private mouseAction2?;
|
|
3077
|
+
private mouseInitialized;
|
|
3078
|
+
private readonly defaultAzimuthSpeed;
|
|
3079
|
+
private readonly defaultPolarSpeed;
|
|
3080
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3081
|
+
/** {@link NavigationMode.set} */
|
|
3082
|
+
set(active: boolean): void;
|
|
3083
|
+
}
|
|
3084
|
+
import * as THREE from "three";
|
|
3085
|
+
import { CameraProjection } from "./types";
|
|
3086
|
+
import { Event } from "../../Types";
|
|
3087
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3088
|
+
/**
|
|
3089
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3090
|
+
*/
|
|
3091
|
+
export declare class ProjectionManager {
|
|
3092
|
+
/**
|
|
3093
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
3094
|
+
*/
|
|
3095
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3096
|
+
/**
|
|
3097
|
+
* Current projection mode of the camera.
|
|
3098
|
+
* Default is "Perspective".
|
|
3099
|
+
*/
|
|
3100
|
+
current: CameraProjection;
|
|
3101
|
+
/**
|
|
3102
|
+
* The camera controlled by this ProjectionManager.
|
|
3103
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3104
|
+
*/
|
|
3105
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3106
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3107
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3108
|
+
private _component;
|
|
3109
|
+
private _previousDistance;
|
|
3110
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3111
|
+
/**
|
|
3112
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3113
|
+
*
|
|
3114
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3115
|
+
* it will have no effect.
|
|
3116
|
+
*/
|
|
3117
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3118
|
+
/**
|
|
3119
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3120
|
+
* and vice versa.
|
|
3121
|
+
*/
|
|
3122
|
+
toggle(): Promise<void>;
|
|
3123
|
+
private setOrthoCamera;
|
|
3124
|
+
private getPerspectiveDims;
|
|
3125
|
+
private setupOrthoCamera;
|
|
3126
|
+
private getDistance;
|
|
3127
|
+
private setPerspectiveCamera;
|
|
3128
|
+
}
|
|
3129
|
+
/**
|
|
3130
|
+
* The projection system of the camera.
|
|
3131
|
+
*/
|
|
3132
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3133
|
+
/**
|
|
3134
|
+
* The extensible list of supported navigation modes.
|
|
3135
|
+
*/
|
|
3136
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3137
|
+
/**
|
|
3138
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3139
|
+
*/
|
|
3140
|
+
export interface NavigationMode {
|
|
3141
|
+
/** The unique ID of this navigation mode. */
|
|
3142
|
+
id: NavModeID;
|
|
3143
|
+
/**
|
|
3144
|
+
* Enable or disable this navigation mode.
|
|
3145
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3146
|
+
* must be disabled.
|
|
3147
|
+
*
|
|
3148
|
+
* @param active - whether to enable or disable this mode.
|
|
3149
|
+
* @param options - any additional data required to enable or disable it.
|
|
3150
|
+
* */
|
|
3151
|
+
set: (active: boolean, options?: any) => void;
|
|
3152
|
+
/** Whether this navigation mode is active or not. */
|
|
3153
|
+
enabled: boolean;
|
|
3154
|
+
}
|
|
3100
3155
|
import * as THREE from "three";
|
|
3101
3156
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3102
3157
|
import { Components } from "../../Components";
|
|
@@ -3194,32 +3249,57 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3194
3249
|
private newHelper;
|
|
3195
3250
|
private static newPlaneMesh;
|
|
3196
3251
|
}
|
|
3197
|
-
import
|
|
3252
|
+
import * as THREE from "three";
|
|
3253
|
+
import { Components } from "../../Components";
|
|
3254
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3255
|
+
import { Mouse } from "./mouse";
|
|
3198
3256
|
/**
|
|
3199
|
-
*
|
|
3257
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3200
3258
|
*/
|
|
3201
|
-
export declare class
|
|
3259
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
3260
|
+
/** {@link Component.enabled} */
|
|
3261
|
+
enabled: boolean;
|
|
3262
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3263
|
+
components: Components;
|
|
3264
|
+
/** {@link Disposable.onDisposed} */
|
|
3265
|
+
readonly onDisposed: Event<unknown>;
|
|
3266
|
+
/** The position of the mouse in the screen. */
|
|
3267
|
+
readonly mouse: Mouse;
|
|
3202
3268
|
/**
|
|
3203
|
-
*
|
|
3204
|
-
*
|
|
3269
|
+
* A reference to the Three.js Raycaster instance.
|
|
3270
|
+
* This is used for raycasting operations.
|
|
3205
3271
|
*/
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
/**
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3272
|
+
readonly three: THREE.Raycaster;
|
|
3273
|
+
/**
|
|
3274
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3275
|
+
* This is used to access the camera and meshes.
|
|
3276
|
+
*/
|
|
3277
|
+
world: World;
|
|
3278
|
+
constructor(components: Components, world: World);
|
|
3279
|
+
/** {@link Disposable.dispose} */
|
|
3280
|
+
dispose(): void;
|
|
3281
|
+
/**
|
|
3282
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3283
|
+
* the first item found. This also takes into account the clipping planes
|
|
3284
|
+
* used by the renderer.
|
|
3285
|
+
*
|
|
3286
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3287
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3288
|
+
* {@link Components.meshes}.
|
|
3289
|
+
*/
|
|
3290
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3291
|
+
/**
|
|
3292
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3293
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
3294
|
+
*
|
|
3295
|
+
* @param origin - The origin of the ray.
|
|
3296
|
+
* @param direction - The direction of the ray.
|
|
3297
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3298
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3299
|
+
*/
|
|
3300
|
+
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
3301
|
+
private intersect;
|
|
3302
|
+
private filterClippingPlanes;
|
|
3223
3303
|
}
|
|
3224
3304
|
import { NavigationMode } from "./types";
|
|
3225
3305
|
import { OrthoPerspectiveCamera } from "../index";
|
|
@@ -3237,102 +3317,6 @@ export declare class OrbitMode implements NavigationMode {
|
|
|
3237
3317
|
set(active: boolean): void;
|
|
3238
3318
|
private activateOrbitControls;
|
|
3239
3319
|
}
|
|
3240
|
-
import { NavigationMode } from "./types";
|
|
3241
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3242
|
-
/**
|
|
3243
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3244
|
-
*/
|
|
3245
|
-
export declare class PlanMode implements NavigationMode {
|
|
3246
|
-
private camera;
|
|
3247
|
-
/** {@link NavigationMode.enabled} */
|
|
3248
|
-
enabled: boolean;
|
|
3249
|
-
/** {@link NavigationMode.id} */
|
|
3250
|
-
readonly id = "Plan";
|
|
3251
|
-
private mouseAction1?;
|
|
3252
|
-
private mouseAction2?;
|
|
3253
|
-
private mouseInitialized;
|
|
3254
|
-
private readonly defaultAzimuthSpeed;
|
|
3255
|
-
private readonly defaultPolarSpeed;
|
|
3256
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3257
|
-
/** {@link NavigationMode.set} */
|
|
3258
|
-
set(active: boolean): void;
|
|
3259
|
-
}
|
|
3260
|
-
import * as THREE from "three";
|
|
3261
|
-
import { CameraProjection } from "./types";
|
|
3262
|
-
import { Event } from "../../Types";
|
|
3263
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3264
|
-
/**
|
|
3265
|
-
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3266
|
-
*/
|
|
3267
|
-
export declare class ProjectionManager {
|
|
3268
|
-
/**
|
|
3269
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
3270
|
-
*/
|
|
3271
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3272
|
-
/**
|
|
3273
|
-
* Current projection mode of the camera.
|
|
3274
|
-
* Default is "Perspective".
|
|
3275
|
-
*/
|
|
3276
|
-
current: CameraProjection;
|
|
3277
|
-
/**
|
|
3278
|
-
* The camera controlled by this ProjectionManager.
|
|
3279
|
-
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3280
|
-
*/
|
|
3281
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3282
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3283
|
-
matchOrthoDistanceEnabled: boolean;
|
|
3284
|
-
private _component;
|
|
3285
|
-
private _previousDistance;
|
|
3286
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3287
|
-
/**
|
|
3288
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3289
|
-
*
|
|
3290
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
3291
|
-
* it will have no effect.
|
|
3292
|
-
*/
|
|
3293
|
-
set(projection: CameraProjection): Promise<void>;
|
|
3294
|
-
/**
|
|
3295
|
-
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3296
|
-
* and vice versa.
|
|
3297
|
-
*/
|
|
3298
|
-
toggle(): Promise<void>;
|
|
3299
|
-
private setOrthoCamera;
|
|
3300
|
-
private getPerspectiveDims;
|
|
3301
|
-
private setupOrthoCamera;
|
|
3302
|
-
private getDistance;
|
|
3303
|
-
private setPerspectiveCamera;
|
|
3304
|
-
}
|
|
3305
|
-
/**
|
|
3306
|
-
* The projection system of the camera.
|
|
3307
|
-
*/
|
|
3308
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3309
|
-
/**
|
|
3310
|
-
* The extensible list of supported navigation modes.
|
|
3311
|
-
*/
|
|
3312
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3313
|
-
/**
|
|
3314
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3315
|
-
*/
|
|
3316
|
-
export interface NavigationMode {
|
|
3317
|
-
/** The unique ID of this navigation mode. */
|
|
3318
|
-
id: NavModeID;
|
|
3319
|
-
/**
|
|
3320
|
-
* Enable or disable this navigation mode.
|
|
3321
|
-
* When a new navigation mode is enabled, the previous navigation mode
|
|
3322
|
-
* must be disabled.
|
|
3323
|
-
*
|
|
3324
|
-
* @param active - whether to enable or disable this mode.
|
|
3325
|
-
* @param options - any additional data required to enable or disable it.
|
|
3326
|
-
* */
|
|
3327
|
-
set: (active: boolean, options?: any) => void;
|
|
3328
|
-
/** Whether this navigation mode is active or not. */
|
|
3329
|
-
enabled: boolean;
|
|
3330
|
-
}
|
|
3331
|
-
import * as WEBIFC from "web-ifc";
|
|
3332
|
-
export declare class IfcMetadataReader {
|
|
3333
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3334
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3335
|
-
}
|
|
3336
3320
|
import * as THREE from "three";
|
|
3337
3321
|
import * as WEBIFC from "web-ifc";
|
|
3338
3322
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -3348,51 +3332,6 @@ export declare class CivilReader {
|
|
|
3348
3332
|
} | undefined;
|
|
3349
3333
|
private getCurves;
|
|
3350
3334
|
}
|
|
3351
|
-
/**
|
|
3352
|
-
* 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.
|
|
3353
|
-
*/
|
|
3354
|
-
export interface StreamedGeometries {
|
|
3355
|
-
[id: number]: {
|
|
3356
|
-
/** The bounding box of the geometry as a Float32Array. */
|
|
3357
|
-
boundingBox: Float32Array;
|
|
3358
|
-
/** A boolean indicating whether the geometry has holes. */
|
|
3359
|
-
hasHoles: boolean;
|
|
3360
|
-
/** An optional file path for the geometry data. */
|
|
3361
|
-
geometryFile?: string;
|
|
3362
|
-
};
|
|
3363
|
-
}
|
|
3364
|
-
/**
|
|
3365
|
-
* 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.
|
|
3366
|
-
*/
|
|
3367
|
-
export interface StreamedAsset {
|
|
3368
|
-
/** The unique identifier of the asset. */
|
|
3369
|
-
id: number;
|
|
3370
|
-
/** An array of geometries associated with the asset. */
|
|
3371
|
-
geometries: {
|
|
3372
|
-
/** The unique identifier of the geometry. */
|
|
3373
|
-
geometryID: number;
|
|
3374
|
-
/** The transformation matrix of the geometry as a number array. */
|
|
3375
|
-
transformation: number[];
|
|
3376
|
-
/** The color of the geometry as a number array. */
|
|
3377
|
-
color: number[];
|
|
3378
|
-
}[];
|
|
3379
|
-
}
|
|
3380
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3381
|
-
/**
|
|
3382
|
-
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3383
|
-
*/
|
|
3384
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3385
|
-
/**
|
|
3386
|
-
* Minimum number of geometries to be streamed.
|
|
3387
|
-
* Defaults to 10 geometries.
|
|
3388
|
-
*/
|
|
3389
|
-
minGeometrySize: number;
|
|
3390
|
-
/**
|
|
3391
|
-
* Minimum amount of assets to be streamed.
|
|
3392
|
-
* Defaults to 1000 assets.
|
|
3393
|
-
*/
|
|
3394
|
-
minAssetsSize: number;
|
|
3395
|
-
}
|
|
3396
3335
|
import * as WEBIFC from "web-ifc";
|
|
3397
3336
|
import * as THREE from "three";
|
|
3398
3337
|
export declare class Units {
|
|
@@ -3403,6 +3342,22 @@ export declare class Units {
|
|
|
3403
3342
|
private getLengthUnits;
|
|
3404
3343
|
private getScaleMatrix;
|
|
3405
3344
|
}
|
|
3345
|
+
import * as WEBIFC from "web-ifc";
|
|
3346
|
+
export declare class IfcMetadataReader {
|
|
3347
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3348
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3349
|
+
}
|
|
3350
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3351
|
+
/**
|
|
3352
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3353
|
+
*/
|
|
3354
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3355
|
+
/**
|
|
3356
|
+
* Amount of properties to be streamed.
|
|
3357
|
+
* Defaults to 100 properties.
|
|
3358
|
+
*/
|
|
3359
|
+
propertiesSize: number;
|
|
3360
|
+
}
|
|
3406
3361
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3407
3362
|
export interface ModelsRelationMap {
|
|
3408
3363
|
[modelID: string]: RelationsMap;
|
|
@@ -3427,10 +3382,55 @@ export type InverseAttributes = [
|
|
|
3427
3382
|
"ContainsElements"
|
|
3428
3383
|
];
|
|
3429
3384
|
export type InverseAttribute = InverseAttributes[number];
|
|
3385
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3386
|
+
/**
|
|
3387
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3388
|
+
*/
|
|
3389
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3390
|
+
/**
|
|
3391
|
+
* Minimum number of geometries to be streamed.
|
|
3392
|
+
* Defaults to 10 geometries.
|
|
3393
|
+
*/
|
|
3394
|
+
minGeometrySize: number;
|
|
3395
|
+
/**
|
|
3396
|
+
* Minimum amount of assets to be streamed.
|
|
3397
|
+
* Defaults to 1000 assets.
|
|
3398
|
+
*/
|
|
3399
|
+
minAssetsSize: number;
|
|
3400
|
+
}
|
|
3430
3401
|
import { BufferGeometry } from "three";
|
|
3431
3402
|
import * as THREE from "three";
|
|
3432
3403
|
export declare class TransformHelper {
|
|
3433
3404
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3434
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
3435
|
|
|
3436
3436
|
}
|