@thatopen/components 2.0.25 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Components/index.d.ts +1 -1
- package/dist/fragments/BoundingBoxer/index.d.ts +23 -0
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +838 -810
- package/dist/measurement/MeasurementUtils/index.d.ts +2 -8
- package/dist/namespace.d.ts +1398 -1381
- package/package.json +56 -56
package/dist/namespace.d.ts
CHANGED
|
@@ -1,4 +1,80 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
+
import { Component, Disposable, Event } from "../Types";
|
|
3
|
+
/**
|
|
4
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Components implements Disposable {
|
|
7
|
+
/**
|
|
8
|
+
* The version of the @thatopen/components library.
|
|
9
|
+
*/
|
|
10
|
+
static readonly release = "2.1.0";
|
|
11
|
+
/** {@link Disposable.onDisposed} */
|
|
12
|
+
readonly onDisposed: Event<void>;
|
|
13
|
+
/**
|
|
14
|
+
* The list of components created in this app.
|
|
15
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
16
|
+
*/
|
|
17
|
+
readonly list: Map<string, Component>;
|
|
18
|
+
/**
|
|
19
|
+
* If disabled, the animation loop will be stopped.
|
|
20
|
+
* Default value is false.
|
|
21
|
+
*/
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
private _clock;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a component to the list of components.
|
|
26
|
+
* Throws an error if a component with the same UUID already exists.
|
|
27
|
+
*
|
|
28
|
+
* @param uuid - The unique identifier of the component.
|
|
29
|
+
* @param instance - The instance of the component to be added.
|
|
30
|
+
*
|
|
31
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
add(uuid: string, instance: Component): void;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a component instance by its constructor function.
|
|
38
|
+
* If the component does not exist in the list, it will be created and added.
|
|
39
|
+
*
|
|
40
|
+
* @template U - The type of the component to retrieve.
|
|
41
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
42
|
+
*
|
|
43
|
+
* @returns The instance of the requested component.
|
|
44
|
+
*
|
|
45
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
50
|
+
constructor();
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the Components instance.
|
|
53
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
54
|
+
* and calls the update method.
|
|
55
|
+
*
|
|
56
|
+
* @returns {void}
|
|
57
|
+
*/
|
|
58
|
+
init(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
61
|
+
* the library. A memory leak will be created if:
|
|
62
|
+
*
|
|
63
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
64
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
65
|
+
* Angular, Vue, etc).
|
|
66
|
+
*
|
|
67
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
68
|
+
* referenced by a reference type (object or array).
|
|
69
|
+
*
|
|
70
|
+
* You can learn more about how Three.js handles memory leaks
|
|
71
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
dispose(): void;
|
|
75
|
+
private update;
|
|
76
|
+
private static setupBVH;
|
|
77
|
+
}
|
|
2
78
|
import * as THREE from "three";
|
|
3
79
|
import { Components } from "../Components";
|
|
4
80
|
import { Component } from "../Types";
|
|
@@ -44,6 +120,164 @@ export declare class Disposer extends Component {
|
|
|
44
120
|
private disposeChildren;
|
|
45
121
|
private static disposeMaterial;
|
|
46
122
|
}
|
|
123
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
124
|
+
import { SimpleRaycaster } from "./src";
|
|
125
|
+
import { Components } from "../Components";
|
|
126
|
+
/**
|
|
127
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
128
|
+
*/
|
|
129
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
130
|
+
/**
|
|
131
|
+
* A unique identifier for the component.
|
|
132
|
+
* This UUID is used to register the component within the Components system.
|
|
133
|
+
*/
|
|
134
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
135
|
+
/** {@link Component.enabled} */
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* A Map that stores raycasters for each world.
|
|
139
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
140
|
+
*/
|
|
141
|
+
list: Map<string, SimpleRaycaster>;
|
|
142
|
+
/** {@link Disposable.onDisposed} */
|
|
143
|
+
onDisposed: Event<unknown>;
|
|
144
|
+
constructor(components: Components);
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
147
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
148
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
149
|
+
*
|
|
150
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
151
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
152
|
+
*/
|
|
153
|
+
get(world: World): SimpleRaycaster;
|
|
154
|
+
/**
|
|
155
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
156
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
157
|
+
*
|
|
158
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
159
|
+
* @returns {void}
|
|
160
|
+
*/
|
|
161
|
+
delete(world: World): void;
|
|
162
|
+
/** {@link Disposable.dispose} */
|
|
163
|
+
dispose(): void;
|
|
164
|
+
}
|
|
165
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
166
|
+
import { Components } from "../Components";
|
|
167
|
+
import { SimpleWorld } from "./src";
|
|
168
|
+
/**
|
|
169
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
170
|
+
*/
|
|
171
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
172
|
+
/**
|
|
173
|
+
* A unique identifier for the component.
|
|
174
|
+
* This UUID is used to register the component within the Components system.
|
|
175
|
+
*/
|
|
176
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
177
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
178
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
179
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
180
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
181
|
+
/** {@link Disposable.onDisposed} */
|
|
182
|
+
readonly onDisposed: Event<unknown>;
|
|
183
|
+
/**
|
|
184
|
+
* An event that is triggered when a new world is created.
|
|
185
|
+
* The event passes the newly created world as a parameter.
|
|
186
|
+
*/
|
|
187
|
+
readonly onWorldCreated: Event<World>;
|
|
188
|
+
/**
|
|
189
|
+
* An event that is triggered when a world is deleted.
|
|
190
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
191
|
+
*/
|
|
192
|
+
readonly onWorldDeleted: Event<string>;
|
|
193
|
+
/**
|
|
194
|
+
* A collection of worlds managed by this component.
|
|
195
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
196
|
+
*/
|
|
197
|
+
list: Map<string, World>;
|
|
198
|
+
/** {@link Component.enabled} */
|
|
199
|
+
enabled: boolean;
|
|
200
|
+
constructor(components: Components);
|
|
201
|
+
/**
|
|
202
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
203
|
+
*
|
|
204
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
205
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
206
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
207
|
+
*
|
|
208
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
209
|
+
*/
|
|
210
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
211
|
+
/**
|
|
212
|
+
* Deletes a world from the list of worlds.
|
|
213
|
+
*
|
|
214
|
+
* @param {World} world - The world to be deleted.
|
|
215
|
+
*
|
|
216
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
217
|
+
*
|
|
218
|
+
* @returns {void}
|
|
219
|
+
*/
|
|
220
|
+
delete(world: World): void;
|
|
221
|
+
/**
|
|
222
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
223
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
224
|
+
* and triggers the onDisposed event.
|
|
225
|
+
*
|
|
226
|
+
* @returns {void}
|
|
227
|
+
*/
|
|
228
|
+
dispose(): void;
|
|
229
|
+
/** {@link Updateable.update} */
|
|
230
|
+
update(delta?: number): void | Promise<void>;
|
|
231
|
+
}
|
|
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
|
+
}
|
|
47
281
|
import * as THREE from "three";
|
|
48
282
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
49
283
|
import { SimplePlane } from "./src";
|
|
@@ -171,170 +405,100 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
171
405
|
private _onStartDragging;
|
|
172
406
|
private _onEndDragging;
|
|
173
407
|
}
|
|
174
|
-
import { MiniMap } from "./src";
|
|
175
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
176
408
|
import { Components } from "../Components";
|
|
409
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
410
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
177
411
|
/**
|
|
178
|
-
* A component that
|
|
412
|
+
* 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).
|
|
179
413
|
*/
|
|
180
|
-
export declare class
|
|
414
|
+
export declare class Cullers extends Component implements Disposable {
|
|
181
415
|
/**
|
|
182
416
|
* A unique identifier for the component.
|
|
183
417
|
* This UUID is used to register the component within the Components system.
|
|
184
418
|
*/
|
|
185
|
-
static readonly uuid: "
|
|
186
|
-
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
190
|
-
/** {@link Disposable.onDisposed} */
|
|
419
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
420
|
+
/**
|
|
421
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
422
|
+
*/
|
|
191
423
|
readonly onDisposed: Event<unknown>;
|
|
192
|
-
|
|
193
|
-
enabled: boolean;
|
|
424
|
+
private _enabled;
|
|
194
425
|
/**
|
|
195
|
-
* A
|
|
426
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
196
427
|
*/
|
|
197
|
-
list: Map<string,
|
|
428
|
+
list: Map<string, MeshCullerRenderer>;
|
|
429
|
+
/** {@link Component.enabled} */
|
|
430
|
+
get enabled(): boolean;
|
|
431
|
+
/** {@link Component.enabled} */
|
|
432
|
+
set enabled(value: boolean);
|
|
198
433
|
constructor(components: Components);
|
|
199
434
|
/**
|
|
200
|
-
* Creates a new
|
|
201
|
-
* If a
|
|
435
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
436
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
202
437
|
*
|
|
203
|
-
* @param world - The
|
|
204
|
-
* @
|
|
205
|
-
*
|
|
438
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
439
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
440
|
+
*
|
|
441
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
206
442
|
*/
|
|
207
|
-
create(world: World):
|
|
443
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
208
444
|
/**
|
|
209
|
-
* Deletes
|
|
210
|
-
* If a
|
|
445
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
446
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
447
|
+
*
|
|
448
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
211
449
|
*
|
|
212
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
213
450
|
* @returns {void}
|
|
214
451
|
*/
|
|
215
|
-
delete(
|
|
452
|
+
delete(world: World): void;
|
|
216
453
|
/** {@link Disposable.dispose} */
|
|
217
454
|
dispose(): void;
|
|
218
|
-
/** {@link Updateable.update} */
|
|
219
|
-
update(): void;
|
|
220
455
|
}
|
|
221
|
-
import {
|
|
222
|
-
import {
|
|
456
|
+
import { MiniMap } from "./src";
|
|
457
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
223
458
|
import { Components } from "../Components";
|
|
224
459
|
/**
|
|
225
|
-
* A component that manages
|
|
460
|
+
* 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).
|
|
226
461
|
*/
|
|
227
|
-
export declare class
|
|
462
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
228
463
|
/**
|
|
229
464
|
* A unique identifier for the component.
|
|
230
465
|
* This UUID is used to register the component within the Components system.
|
|
231
466
|
*/
|
|
232
|
-
static readonly uuid: "
|
|
467
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
468
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
469
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
470
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
471
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
472
|
+
/** {@link Disposable.onDisposed} */
|
|
473
|
+
readonly onDisposed: Event<unknown>;
|
|
233
474
|
/** {@link Component.enabled} */
|
|
234
475
|
enabled: boolean;
|
|
235
476
|
/**
|
|
236
|
-
* A
|
|
237
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
477
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
238
478
|
*/
|
|
239
|
-
list: Map<string,
|
|
240
|
-
/** {@link Disposable.onDisposed} */
|
|
241
|
-
onDisposed: Event<unknown>;
|
|
479
|
+
list: Map<string, MiniMap>;
|
|
242
480
|
constructor(components: Components);
|
|
243
481
|
/**
|
|
244
|
-
*
|
|
245
|
-
* If a
|
|
246
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
482
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
483
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
247
484
|
*
|
|
248
|
-
* @param world - The
|
|
249
|
-
* @returns The
|
|
485
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
486
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
487
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
250
488
|
*/
|
|
251
|
-
|
|
489
|
+
create(world: World): MiniMap;
|
|
252
490
|
/**
|
|
253
|
-
* Deletes
|
|
254
|
-
* If a
|
|
491
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
492
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
255
493
|
*
|
|
256
|
-
* @param
|
|
494
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
257
495
|
* @returns {void}
|
|
258
496
|
*/
|
|
259
|
-
delete(
|
|
497
|
+
delete(id: string): void;
|
|
260
498
|
/** {@link Disposable.dispose} */
|
|
261
499
|
dispose(): void;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* 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.
|
|
266
|
-
*/
|
|
267
|
-
export declare class Components implements Disposable {
|
|
268
|
-
/**
|
|
269
|
-
* The version of the @thatopen/components library.
|
|
270
|
-
*/
|
|
271
|
-
static readonly release = "2.0.25";
|
|
272
|
-
/** {@link Disposable.onDisposed} */
|
|
273
|
-
readonly onDisposed: Event<void>;
|
|
274
|
-
/**
|
|
275
|
-
* The list of components created in this app.
|
|
276
|
-
* The keys are UUIDs and the values are instances of the components.
|
|
277
|
-
*/
|
|
278
|
-
readonly list: Map<string, Component>;
|
|
279
|
-
/**
|
|
280
|
-
* If disabled, the animation loop will be stopped.
|
|
281
|
-
* Default value is false.
|
|
282
|
-
*/
|
|
283
|
-
enabled: boolean;
|
|
284
|
-
private _clock;
|
|
285
|
-
/**
|
|
286
|
-
* Adds a component to the list of components.
|
|
287
|
-
* Throws an error if a component with the same UUID already exists.
|
|
288
|
-
*
|
|
289
|
-
* @param uuid - The unique identifier of the component.
|
|
290
|
-
* @param instance - The instance of the component to be added.
|
|
291
|
-
*
|
|
292
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
293
|
-
*
|
|
294
|
-
* @internal
|
|
295
|
-
*/
|
|
296
|
-
add(uuid: string, instance: Component): void;
|
|
297
|
-
/**
|
|
298
|
-
* Retrieves a component instance by its constructor function.
|
|
299
|
-
* If the component does not exist in the list, it will be created and added.
|
|
300
|
-
*
|
|
301
|
-
* @template U - The type of the component to retrieve.
|
|
302
|
-
* @param Component - The constructor function of the component to retrieve.
|
|
303
|
-
*
|
|
304
|
-
* @returns The instance of the requested component.
|
|
305
|
-
*
|
|
306
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
307
|
-
*
|
|
308
|
-
* @internal
|
|
309
|
-
*/
|
|
310
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
311
|
-
constructor();
|
|
312
|
-
/**
|
|
313
|
-
* Initializes the Components instance.
|
|
314
|
-
* This method starts the animation loop, sets the enabled flag to true,
|
|
315
|
-
* and calls the update method.
|
|
316
|
-
*
|
|
317
|
-
* @returns {void}
|
|
318
|
-
*/
|
|
319
|
-
init(): void;
|
|
320
|
-
/**
|
|
321
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
322
|
-
* the library. A memory leak will be created if:
|
|
323
|
-
*
|
|
324
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
325
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
326
|
-
* Angular, Vue, etc).
|
|
327
|
-
*
|
|
328
|
-
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
329
|
-
* referenced by a reference type (object or array).
|
|
330
|
-
*
|
|
331
|
-
* You can learn more about how Three.js handles memory leaks
|
|
332
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
333
|
-
*
|
|
334
|
-
*/
|
|
335
|
-
dispose(): void;
|
|
336
|
-
private update;
|
|
337
|
-
private static setupBVH;
|
|
500
|
+
/** {@link Updateable.update} */
|
|
501
|
+
update(): void;
|
|
338
502
|
}
|
|
339
503
|
import * as THREE from "three";
|
|
340
504
|
import { Components } from "../Components";
|
|
@@ -400,245 +564,81 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
400
564
|
private newOrthoCamera;
|
|
401
565
|
private setOrthoPerspCameraAspect;
|
|
402
566
|
}
|
|
403
|
-
import
|
|
404
|
-
import
|
|
405
|
-
import {
|
|
567
|
+
import * as THREE from "three";
|
|
568
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
569
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
570
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
406
571
|
/**
|
|
407
|
-
* A
|
|
572
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
408
573
|
*/
|
|
409
|
-
export declare class
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
415
|
-
/**
|
|
416
|
-
* An event that is triggered when the Cullers component is disposed.
|
|
417
|
-
*/
|
|
574
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
575
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
576
|
+
/** {@link Component.enabled} */
|
|
577
|
+
enabled: boolean;
|
|
578
|
+
/** {@link Disposable.onDisposed} */
|
|
418
579
|
readonly onDisposed: Event<unknown>;
|
|
419
|
-
private
|
|
580
|
+
private _absoluteMin;
|
|
581
|
+
private _absoluteMax;
|
|
582
|
+
private _meshes;
|
|
583
|
+
constructor(components: Components);
|
|
420
584
|
/**
|
|
421
|
-
* A
|
|
585
|
+
* A static method to calculate the dimensions of a given bounding box.
|
|
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.
|
|
422
589
|
*/
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
590
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
591
|
+
width: number;
|
|
592
|
+
height: number;
|
|
593
|
+
depth: number;
|
|
594
|
+
center: THREE.Vector3;
|
|
595
|
+
};
|
|
429
596
|
/**
|
|
430
|
-
*
|
|
431
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
597
|
+
* A static method to create a new bounding box boundary.
|
|
432
598
|
*
|
|
433
|
-
* @param
|
|
434
|
-
* @
|
|
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.
|
|
435
601
|
*
|
|
436
|
-
* @
|
|
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 }
|
|
611
|
+
*
|
|
612
|
+
* const negativeBound = BoundingBoxer.newBound(false);
|
|
613
|
+
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
614
|
+
* '''
|
|
437
615
|
*/
|
|
438
|
-
|
|
616
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
439
617
|
/**
|
|
440
|
-
*
|
|
441
|
-
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
618
|
+
* A static method to calculate the bounding box of a set of points.
|
|
442
619
|
*
|
|
443
|
-
* @param
|
|
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.
|
|
444
624
|
*
|
|
445
|
-
* @
|
|
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
|
+
* ];
|
|
636
|
+
*
|
|
637
|
+
* const bbox = BoundingBoxer.getBounds(points);
|
|
638
|
+
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
639
|
+
* '''
|
|
446
640
|
*/
|
|
447
|
-
|
|
448
|
-
/** {@link Disposable.dispose} */
|
|
449
|
-
dispose(): void;
|
|
450
|
-
}
|
|
451
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
452
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
453
|
-
import { Components } from "../Components";
|
|
454
|
-
/**
|
|
455
|
-
* 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).
|
|
456
|
-
*/
|
|
457
|
-
export declare class Grids extends Component implements Disposable {
|
|
458
|
-
/**
|
|
459
|
-
* A unique identifier for the component.
|
|
460
|
-
* This UUID is used to register the component within the Components system.
|
|
461
|
-
*/
|
|
462
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
463
|
-
/**
|
|
464
|
-
* A map of world UUIDs to their corresponding grid instances.
|
|
465
|
-
*/
|
|
466
|
-
list: Map<string, SimpleGrid>;
|
|
467
|
-
/**
|
|
468
|
-
* The default configuration for grid creation.
|
|
469
|
-
*/
|
|
470
|
-
config: Required<GridConfig>;
|
|
471
|
-
/** {@link Disposable.onDisposed} */
|
|
472
|
-
readonly onDisposed: Event<unknown>;
|
|
473
|
-
/** {@link Component.enabled} */
|
|
474
|
-
enabled: boolean;
|
|
475
|
-
constructor(components: Components);
|
|
476
|
-
/**
|
|
477
|
-
* Creates a new grid for the given world.
|
|
478
|
-
* Throws an error if a grid already exists for the world.
|
|
479
|
-
*
|
|
480
|
-
* @param world - The world to create the grid for.
|
|
481
|
-
* @returns The newly created grid.
|
|
482
|
-
*
|
|
483
|
-
* @throws Will throw an error if a grid already exists for the given world.
|
|
484
|
-
*/
|
|
485
|
-
create(world: World): SimpleGrid;
|
|
486
|
-
/**
|
|
487
|
-
* Deletes the grid associated with the given world.
|
|
488
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
489
|
-
*
|
|
490
|
-
* @param world - The world for which to delete the grid.
|
|
491
|
-
*
|
|
492
|
-
* @remarks
|
|
493
|
-
* This method will dispose of the grid and remove it from the internal list.
|
|
494
|
-
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
495
|
-
*/
|
|
496
|
-
delete(world: World): void;
|
|
497
|
-
/** {@link Disposable.dispose} */
|
|
498
|
-
dispose(): void;
|
|
499
|
-
}
|
|
500
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
501
|
-
import { Components } from "../Components";
|
|
502
|
-
import { SimpleWorld } from "./src";
|
|
503
|
-
/**
|
|
504
|
-
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
505
|
-
*/
|
|
506
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
507
|
-
/**
|
|
508
|
-
* A unique identifier for the component.
|
|
509
|
-
* This UUID is used to register the component within the Components system.
|
|
510
|
-
*/
|
|
511
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
512
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
513
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
514
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
515
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
516
|
-
/** {@link Disposable.onDisposed} */
|
|
517
|
-
readonly onDisposed: Event<unknown>;
|
|
518
|
-
/**
|
|
519
|
-
* An event that is triggered when a new world is created.
|
|
520
|
-
* The event passes the newly created world as a parameter.
|
|
521
|
-
*/
|
|
522
|
-
readonly onWorldCreated: Event<World>;
|
|
523
|
-
/**
|
|
524
|
-
* An event that is triggered when a world is deleted.
|
|
525
|
-
* The event passes the UUID of the deleted world as a parameter.
|
|
526
|
-
*/
|
|
527
|
-
readonly onWorldDeleted: Event<string>;
|
|
528
|
-
/**
|
|
529
|
-
* A collection of worlds managed by this component.
|
|
530
|
-
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
531
|
-
*/
|
|
532
|
-
list: Map<string, World>;
|
|
533
|
-
/** {@link Component.enabled} */
|
|
534
|
-
enabled: boolean;
|
|
535
|
-
constructor(components: Components);
|
|
536
|
-
/**
|
|
537
|
-
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
538
|
-
*
|
|
539
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
540
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
541
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
542
|
-
*
|
|
543
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
544
|
-
*/
|
|
545
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
546
|
-
/**
|
|
547
|
-
* Deletes a world from the list of worlds.
|
|
548
|
-
*
|
|
549
|
-
* @param {World} world - The world to be deleted.
|
|
550
|
-
*
|
|
551
|
-
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
552
|
-
*
|
|
553
|
-
* @returns {void}
|
|
554
|
-
*/
|
|
555
|
-
delete(world: World): void;
|
|
556
|
-
/**
|
|
557
|
-
* Disposes of the Worlds component and all its managed worlds.
|
|
558
|
-
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
559
|
-
* and triggers the onDisposed event.
|
|
560
|
-
*
|
|
561
|
-
* @returns {void}
|
|
562
|
-
*/
|
|
563
|
-
dispose(): void;
|
|
564
|
-
/** {@link Updateable.update} */
|
|
565
|
-
update(delta?: number): void | Promise<void>;
|
|
566
|
-
}
|
|
567
|
-
import * as THREE from "three";
|
|
568
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
569
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
570
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
571
|
-
/**
|
|
572
|
-
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
573
|
-
*/
|
|
574
|
-
export declare class BoundingBoxer extends Component implements Disposable {
|
|
575
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
576
|
-
/** {@link Component.enabled} */
|
|
577
|
-
enabled: boolean;
|
|
578
|
-
/** {@link Disposable.onDisposed} */
|
|
579
|
-
readonly onDisposed: Event<unknown>;
|
|
580
|
-
private _absoluteMin;
|
|
581
|
-
private _absoluteMax;
|
|
582
|
-
private _meshes;
|
|
583
|
-
constructor(components: Components);
|
|
584
|
-
/**
|
|
585
|
-
* A static method to calculate the dimensions of a given bounding box.
|
|
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.
|
|
589
|
-
*/
|
|
590
|
-
static getDimensions(bbox: THREE.Box3): {
|
|
591
|
-
width: number;
|
|
592
|
-
height: number;
|
|
593
|
-
depth: number;
|
|
594
|
-
center: THREE.Vector3;
|
|
595
|
-
};
|
|
596
|
-
/**
|
|
597
|
-
* A static method to create a new bounding box boundary.
|
|
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 }
|
|
611
|
-
*
|
|
612
|
-
* const negativeBound = BoundingBoxer.newBound(false);
|
|
613
|
-
* console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
|
|
614
|
-
* '''
|
|
615
|
-
*/
|
|
616
|
-
static newBound(positive: boolean): THREE.Vector3;
|
|
617
|
-
/**
|
|
618
|
-
* A static method to calculate the bounding box of a set of points.
|
|
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
|
-
* ];
|
|
636
|
-
*
|
|
637
|
-
* const bbox = BoundingBoxer.getBounds(points);
|
|
638
|
-
* console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
|
|
639
|
-
* '''
|
|
640
|
-
*/
|
|
641
|
-
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
641
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
642
642
|
/** {@link Disposable.dispose} */
|
|
643
643
|
dispose(): void;
|
|
644
644
|
/**
|
|
@@ -747,230 +747,79 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
747
747
|
* '''
|
|
748
748
|
*/
|
|
749
749
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
750
|
+
/**
|
|
751
|
+
* Uses a FragmentIdMap to add its meshes to the bb calculation.
|
|
752
|
+
*
|
|
753
|
+
* This method iterates through the provided 'fragmentIdMap', retrieves the corresponding fragment from the 'FragmentsManager',
|
|
754
|
+
* and then calls the 'addMesh' method for each fragment's mesh, passing the expression IDs as the second parameter.
|
|
755
|
+
*
|
|
756
|
+
* @param fragmentIdMap - A mapping of fragment IDs to their corresponding expression IDs.
|
|
757
|
+
*
|
|
758
|
+
* @remarks
|
|
759
|
+
* This method is used to add a mapping of fragment IDs to their corresponding expression IDs.
|
|
760
|
+
* It ensures that the bounding box calculations are accurate and up-to-date by updating the internal minimum and maximum vectors.
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* '''typescript
|
|
764
|
+
* const boundingBoxer = components.get(BoundingBoxer);
|
|
765
|
+
* const fragmentIdMap: FRAGS.FragmentIdMap = {
|
|
766
|
+
* '5991fa75-2eef-4825-90b3-85177f51a9c9': [123, 245, 389],
|
|
767
|
+
* '3469077e-39bf-4fc9-b3e6-4a1d78ad52b0': [454, 587, 612],
|
|
768
|
+
* };
|
|
769
|
+
* boundingBoxer.addFragmentIdMap(fragmentIdMap);
|
|
770
|
+
* '''
|
|
771
|
+
*/
|
|
772
|
+
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
750
773
|
private static getFragmentBounds;
|
|
751
774
|
}
|
|
752
775
|
import * as THREE from "three";
|
|
753
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
754
|
-
center: THREE.Vector3;
|
|
755
|
-
halfSizes: THREE.Vector3;
|
|
756
|
-
rotation: THREE.Matrix3;
|
|
757
|
-
transformation: THREE.Matrix4;
|
|
758
|
-
};
|
|
759
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
760
|
-
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
761
|
-
import * as THREE from "three";
|
|
762
776
|
import * as FRAGS from "@thatopen/fragments";
|
|
763
|
-
import {
|
|
764
|
-
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
777
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
765
778
|
/**
|
|
766
|
-
*
|
|
779
|
+
* 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.
|
|
767
780
|
*/
|
|
768
|
-
export
|
|
781
|
+
export interface Classification {
|
|
782
|
+
/**
|
|
783
|
+
* A system within the classification.
|
|
784
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
785
|
+
*/
|
|
786
|
+
[system: string]: {
|
|
787
|
+
/**
|
|
788
|
+
* A class within the system.
|
|
789
|
+
* The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
|
|
790
|
+
*/
|
|
791
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* 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).
|
|
796
|
+
*/
|
|
797
|
+
export declare class Classifier extends Component implements Disposable {
|
|
769
798
|
/**
|
|
770
799
|
* A unique identifier for the component.
|
|
771
800
|
* This UUID is used to register the component within the Components system.
|
|
772
801
|
*/
|
|
773
|
-
static readonly uuid: "
|
|
774
|
-
/** {@link
|
|
775
|
-
|
|
802
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
803
|
+
/** {@link Component.enabled} */
|
|
804
|
+
enabled: boolean;
|
|
776
805
|
/**
|
|
777
|
-
*
|
|
806
|
+
* A map representing the classification systems.
|
|
807
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
778
808
|
*/
|
|
779
|
-
|
|
809
|
+
list: Classification;
|
|
810
|
+
/** {@link Disposable.onDisposed} */
|
|
811
|
+
readonly onDisposed: Event<unknown>;
|
|
812
|
+
constructor(components: Components);
|
|
813
|
+
private onFragmentsDisposed;
|
|
814
|
+
/** {@link Disposable.dispose} */
|
|
815
|
+
dispose(): void;
|
|
780
816
|
/**
|
|
781
|
-
*
|
|
817
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
818
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
819
|
+
*
|
|
820
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
782
821
|
*/
|
|
783
|
-
|
|
784
|
-
groupID: string;
|
|
785
|
-
fragmentIDs: string[];
|
|
786
|
-
}>;
|
|
787
|
-
/**
|
|
788
|
-
* Map containing all loaded fragments.
|
|
789
|
-
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
790
|
-
*/
|
|
791
|
-
readonly list: Map<string, Fragment>;
|
|
792
|
-
/**
|
|
793
|
-
* Map containing all loaded fragment groups.
|
|
794
|
-
* The key is the group's unique identifier, and the value is the group itself.
|
|
795
|
-
*/
|
|
796
|
-
readonly groups: Map<string, FragmentsGroup>;
|
|
797
|
-
baseCoordinationModel: string;
|
|
798
|
-
/** {@link Component.enabled} */
|
|
799
|
-
enabled: boolean;
|
|
800
|
-
private _loader;
|
|
801
|
-
/**
|
|
802
|
-
* Getter for the meshes of all fragments in the FragmentsManager.
|
|
803
|
-
* It iterates over the fragments in the list and pushes their meshes into an array.
|
|
804
|
-
* @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
|
|
805
|
-
*/
|
|
806
|
-
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
807
|
-
constructor(components: Components);
|
|
808
|
-
/** {@link Disposable.dispose} */
|
|
809
|
-
dispose(): void;
|
|
810
|
-
/**
|
|
811
|
-
* Dispose of a specific fragment group.
|
|
812
|
-
* This method removes the group from the groups map, deletes all fragments within the group from the list,
|
|
813
|
-
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
814
|
-
*
|
|
815
|
-
* @param group - The fragment group to be disposed.
|
|
816
|
-
*/
|
|
817
|
-
disposeGroup(group: FragmentsGroup): void;
|
|
818
|
-
/**
|
|
819
|
-
* Loads a binary file that contain fragment geometry.
|
|
820
|
-
* @param data - The binary data to load.
|
|
821
|
-
* @param config - Optional configuration for loading.
|
|
822
|
-
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
823
|
-
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
824
|
-
* @returns The loaded FragmentsGroup.
|
|
825
|
-
*/
|
|
826
|
-
load(data: Uint8Array, config?: Partial<{
|
|
827
|
-
coordinate: boolean;
|
|
828
|
-
name: string;
|
|
829
|
-
properties: FRAGS.IfcProperties;
|
|
830
|
-
relationsMap: RelationsMap;
|
|
831
|
-
}>): FragmentsGroup;
|
|
832
|
-
/**
|
|
833
|
-
* Export the specified fragmentsgroup to binary data.
|
|
834
|
-
* @param group - the fragments group to be exported.
|
|
835
|
-
* @returns the exported data as binary buffer.
|
|
836
|
-
*/
|
|
837
|
-
export(group: FragmentsGroup): Uint8Array;
|
|
838
|
-
/**
|
|
839
|
-
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
840
|
-
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
841
|
-
* @returns A map of model IDs to sets of express IDs.
|
|
842
|
-
*/
|
|
843
|
-
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
844
|
-
[modelID: string]: Set<number>;
|
|
845
|
-
};
|
|
846
|
-
/**
|
|
847
|
-
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
848
|
-
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
849
|
-
* @returns A fragment ID map.
|
|
850
|
-
* @remarks
|
|
851
|
-
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
852
|
-
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
853
|
-
* The fragment ID maps are then merged into a single map and returned.
|
|
854
|
-
* If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
|
|
855
|
-
*/
|
|
856
|
-
modelIdToFragmentIdMap(modelIdMap: {
|
|
857
|
-
[modelID: string]: Set<number>;
|
|
858
|
-
}): FRAGS.FragmentIdMap;
|
|
859
|
-
/**
|
|
860
|
-
* Applies coordinate transformation to the provided models.
|
|
861
|
-
* If no models are provided, all groups are used.
|
|
862
|
-
* The first model in the list becomes the base model for coordinate transformation.
|
|
863
|
-
* All other models are then transformed to match the base model's coordinate system.
|
|
864
|
-
*
|
|
865
|
-
* @param models - The models to apply coordinate transformation to.
|
|
866
|
-
* If not provided, all groups are used.
|
|
867
|
-
*
|
|
868
|
-
* @returns {void}
|
|
869
|
-
*/
|
|
870
|
-
coordinate(models?: FragmentsGroup[]): void;
|
|
871
|
-
}
|
|
872
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
873
|
-
/**
|
|
874
|
-
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
875
|
-
*/
|
|
876
|
-
export declare class Exploder extends Component implements Disposable {
|
|
877
|
-
/**
|
|
878
|
-
* A unique identifier for the component.
|
|
879
|
-
* This UUID is used to register the component within the Components system.
|
|
880
|
-
*/
|
|
881
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
882
|
-
/** {@link Disposable.onDisposed} */
|
|
883
|
-
readonly onDisposed: Event<unknown>;
|
|
884
|
-
/** {@link Component.enabled} */
|
|
885
|
-
enabled: boolean;
|
|
886
|
-
/**
|
|
887
|
-
* The height of the explosion animation.
|
|
888
|
-
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
889
|
-
* Default value is 10.
|
|
890
|
-
*/
|
|
891
|
-
height: number;
|
|
892
|
-
/**
|
|
893
|
-
* The group name used for the explosion animation.
|
|
894
|
-
* This property specifies the group of fragments that will be affected by the explosion.
|
|
895
|
-
* Default value is "storeys".
|
|
896
|
-
*/
|
|
897
|
-
groupName: string;
|
|
898
|
-
/**
|
|
899
|
-
* A set of strings representing the exploded items.
|
|
900
|
-
* This set is used to keep track of which items have been exploded.
|
|
901
|
-
*/
|
|
902
|
-
list: Set<string>;
|
|
903
|
-
constructor(components: Components);
|
|
904
|
-
/** {@link Disposable.dispose} */
|
|
905
|
-
dispose(): void;
|
|
906
|
-
/**
|
|
907
|
-
* Sets the explosion state of the fragments.
|
|
908
|
-
*
|
|
909
|
-
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
910
|
-
*
|
|
911
|
-
* @remarks
|
|
912
|
-
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
913
|
-
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
914
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
915
|
-
*
|
|
916
|
-
* The method also keeps track of the exploded items using the 'list' set.
|
|
917
|
-
*
|
|
918
|
-
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
919
|
-
*/
|
|
920
|
-
set(active: boolean): void;
|
|
921
|
-
}
|
|
922
|
-
import * as THREE from "three";
|
|
923
|
-
export declare class MaterialsUtils {
|
|
924
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
925
|
-
}
|
|
926
|
-
import * as THREE from "three";
|
|
927
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
928
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
929
|
-
/**
|
|
930
|
-
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
|
|
931
|
-
*/
|
|
932
|
-
export interface Classification {
|
|
933
|
-
/**
|
|
934
|
-
* A system within the classification.
|
|
935
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
936
|
-
*/
|
|
937
|
-
[system: string]: {
|
|
938
|
-
/**
|
|
939
|
-
* A class within the system.
|
|
940
|
-
* The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
|
|
941
|
-
*/
|
|
942
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
943
|
-
};
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
* The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
947
|
-
*/
|
|
948
|
-
export declare class Classifier extends Component implements Disposable {
|
|
949
|
-
/**
|
|
950
|
-
* A unique identifier for the component.
|
|
951
|
-
* This UUID is used to register the component within the Components system.
|
|
952
|
-
*/
|
|
953
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
954
|
-
/** {@link Component.enabled} */
|
|
955
|
-
enabled: boolean;
|
|
956
|
-
/**
|
|
957
|
-
* A map representing the classification systems.
|
|
958
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
959
|
-
*/
|
|
960
|
-
list: Classification;
|
|
961
|
-
/** {@link Disposable.onDisposed} */
|
|
962
|
-
readonly onDisposed: Event<unknown>;
|
|
963
|
-
constructor(components: Components);
|
|
964
|
-
private onFragmentsDisposed;
|
|
965
|
-
/** {@link Disposable.dispose} */
|
|
966
|
-
dispose(): void;
|
|
967
|
-
/**
|
|
968
|
-
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
969
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
970
|
-
*
|
|
971
|
-
* @param guid - The unique identifier of the fragment to be removed.
|
|
972
|
-
*/
|
|
973
|
-
remove(guid: string): void;
|
|
822
|
+
remove(guid: string): void;
|
|
974
823
|
/**
|
|
975
824
|
* Finds and returns fragments based on the provided filter criteria.
|
|
976
825
|
* If no filter is provided, it returns all fragments.
|
|
@@ -1087,103 +936,93 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
1087
936
|
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1088
937
|
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
1089
938
|
}
|
|
1090
|
-
import * as
|
|
1091
|
-
import { Components,
|
|
1092
|
-
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
939
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
940
|
+
import { Components, Component } from "../../core";
|
|
1093
941
|
/**
|
|
1094
|
-
* A component that
|
|
942
|
+
* 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).
|
|
1095
943
|
*/
|
|
1096
|
-
export declare class
|
|
944
|
+
export declare class Hider extends Component {
|
|
1097
945
|
/**
|
|
1098
946
|
* A unique identifier for the component.
|
|
1099
947
|
* This UUID is used to register the component within the Components system.
|
|
1100
948
|
*/
|
|
1101
|
-
static readonly uuid: "
|
|
1102
|
-
/**
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
*/
|
|
1106
|
-
readonly onGeometryStreamed: Event<{
|
|
1107
|
-
buffer: Uint8Array;
|
|
1108
|
-
data: StreamedGeometries;
|
|
1109
|
-
}>;
|
|
949
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
950
|
+
/** {@link Component.enabled} */
|
|
951
|
+
enabled: boolean;
|
|
952
|
+
constructor(components: Components);
|
|
1110
953
|
/**
|
|
1111
|
-
*
|
|
1112
|
-
*
|
|
954
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
955
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
956
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
957
|
+
*
|
|
958
|
+
* @param visible - The visibility state to set for the fragments.
|
|
959
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
960
|
+
* If not provided, all fragments will be affected.
|
|
961
|
+
*
|
|
962
|
+
* @returns {void}
|
|
1113
963
|
*/
|
|
1114
|
-
|
|
964
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1115
965
|
/**
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
966
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
967
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
968
|
+
*
|
|
969
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
970
|
+
* If not provided, all fragments will be isolated.
|
|
971
|
+
*
|
|
972
|
+
* @returns {void}
|
|
1118
973
|
*/
|
|
1119
|
-
|
|
974
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
975
|
+
private updateCulledVisibility;
|
|
976
|
+
}
|
|
977
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
978
|
+
/**
|
|
979
|
+
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
980
|
+
*/
|
|
981
|
+
export declare class Exploder extends Component implements Disposable {
|
|
1120
982
|
/**
|
|
1121
|
-
*
|
|
1122
|
-
*
|
|
983
|
+
* A unique identifier for the component.
|
|
984
|
+
* This UUID is used to register the component within the Components system.
|
|
1123
985
|
*/
|
|
1124
|
-
readonly
|
|
986
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1125
987
|
/** {@link Disposable.onDisposed} */
|
|
1126
988
|
readonly onDisposed: Event<unknown>;
|
|
1127
|
-
/**
|
|
1128
|
-
* Settings for the IfcGeometryTiler.
|
|
1129
|
-
*/
|
|
1130
|
-
settings: IfcStreamingSettings;
|
|
1131
989
|
/** {@link Component.enabled} */
|
|
1132
990
|
enabled: boolean;
|
|
1133
991
|
/**
|
|
1134
|
-
* The
|
|
992
|
+
* The height of the explosion animation.
|
|
993
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
994
|
+
* Default value is 10.
|
|
1135
995
|
*/
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
996
|
+
height: number;
|
|
997
|
+
/**
|
|
998
|
+
* The group name used for the explosion animation.
|
|
999
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1000
|
+
* Default value is "storeys".
|
|
1001
|
+
*/
|
|
1002
|
+
groupName: string;
|
|
1003
|
+
/**
|
|
1004
|
+
* A set of strings representing the exploded items.
|
|
1005
|
+
* This set is used to keep track of which items have been exploded.
|
|
1006
|
+
*/
|
|
1007
|
+
list: Set<string>;
|
|
1147
1008
|
constructor(components: Components);
|
|
1148
1009
|
/** {@link Disposable.dispose} */
|
|
1149
1010
|
dispose(): void;
|
|
1150
1011
|
/**
|
|
1151
|
-
*
|
|
1012
|
+
* Sets the explosion state of the fragments.
|
|
1152
1013
|
*
|
|
1153
|
-
* @param
|
|
1154
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1014
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1155
1015
|
*
|
|
1156
1016
|
* @remarks
|
|
1157
|
-
* This method
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1160
|
-
* '''typescript
|
|
1161
|
-
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1162
|
-
* const rawBuffer = await response.arrayBuffer();
|
|
1163
|
-
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1164
|
-
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1165
|
-
* '''
|
|
1166
|
-
*/
|
|
1167
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1168
|
-
/**
|
|
1169
|
-
* This method streams the IFC file from a given callback.
|
|
1170
|
-
*
|
|
1171
|
-
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1172
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1017
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1018
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1019
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1173
1020
|
*
|
|
1174
|
-
*
|
|
1175
|
-
* This method cleans up any resources after the streaming process is complete.
|
|
1021
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1176
1022
|
*
|
|
1023
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1177
1024
|
*/
|
|
1178
|
-
|
|
1179
|
-
private readIfcFile;
|
|
1180
|
-
private streamIfcFile;
|
|
1181
|
-
private streamAllGeometries;
|
|
1182
|
-
private cleanUp;
|
|
1183
|
-
private getMesh;
|
|
1184
|
-
private getGeometry;
|
|
1185
|
-
private streamAssets;
|
|
1186
|
-
private streamGeometries;
|
|
1025
|
+
set(active: boolean): void;
|
|
1187
1026
|
}
|
|
1188
1027
|
import * as WEBIFC from "web-ifc";
|
|
1189
1028
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -1300,181 +1139,280 @@ export declare class IfcLoader extends Component implements Disposable {
|
|
|
1300
1139
|
private getGeometry;
|
|
1301
1140
|
private autoSetWasm;
|
|
1302
1141
|
}
|
|
1303
|
-
import
|
|
1304
|
-
import
|
|
1305
|
-
import
|
|
1142
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1143
|
+
import * as THREE from "three";
|
|
1144
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1145
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1146
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1306
1147
|
/**
|
|
1307
|
-
*
|
|
1148
|
+
* Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
|
|
1308
1149
|
*/
|
|
1309
|
-
export declare class
|
|
1150
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
1310
1151
|
/**
|
|
1311
1152
|
* A unique identifier for the component.
|
|
1312
1153
|
* This UUID is used to register the component within the Components system.
|
|
1313
1154
|
*/
|
|
1314
|
-
static readonly uuid: "
|
|
1155
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
1156
|
+
/** {@link Disposable.onDisposed} */
|
|
1157
|
+
readonly onDisposed: Event<unknown>;
|
|
1315
1158
|
/**
|
|
1316
|
-
*
|
|
1317
|
-
* The event provides the type of the IFC entity and the corresponding data.
|
|
1159
|
+
* Event triggered when fragments are loaded.
|
|
1318
1160
|
*/
|
|
1319
|
-
readonly
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1161
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Event triggered when fragments are disposed.
|
|
1164
|
+
*/
|
|
1165
|
+
readonly onFragmentsDisposed: Event<{
|
|
1166
|
+
groupID: string;
|
|
1167
|
+
fragmentIDs: string[];
|
|
1324
1168
|
}>;
|
|
1325
1169
|
/**
|
|
1326
|
-
*
|
|
1327
|
-
* The
|
|
1170
|
+
* Map containing all loaded fragments.
|
|
1171
|
+
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
1328
1172
|
*/
|
|
1329
|
-
readonly
|
|
1173
|
+
readonly list: Map<string, Fragment>;
|
|
1330
1174
|
/**
|
|
1331
|
-
*
|
|
1332
|
-
* The
|
|
1175
|
+
* Map containing all loaded fragment groups.
|
|
1176
|
+
* The key is the group's unique identifier, and the value is the group itself.
|
|
1333
1177
|
*/
|
|
1334
|
-
readonly
|
|
1335
|
-
|
|
1336
|
-
readonly onDisposed: Event<string>;
|
|
1178
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
1179
|
+
baseCoordinationModel: string;
|
|
1337
1180
|
/** {@link Component.enabled} */
|
|
1338
1181
|
enabled: boolean;
|
|
1182
|
+
private _loader;
|
|
1339
1183
|
/**
|
|
1340
|
-
*
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
/**
|
|
1344
|
-
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1184
|
+
* Getter for the meshes of all fragments in the FragmentsManager.
|
|
1185
|
+
* It iterates over the fragments in the list and pushes their meshes into an array.
|
|
1186
|
+
* @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
|
|
1345
1187
|
*/
|
|
1346
|
-
|
|
1188
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
1189
|
+
constructor(components: Components);
|
|
1347
1190
|
/** {@link Disposable.dispose} */
|
|
1348
|
-
dispose():
|
|
1191
|
+
dispose(): void;
|
|
1349
1192
|
/**
|
|
1350
|
-
*
|
|
1193
|
+
* Dispose of a specific fragment group.
|
|
1194
|
+
* This method removes the group from the groups map, deletes all fragments within the group from the list,
|
|
1195
|
+
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
1351
1196
|
*
|
|
1352
|
-
* @param
|
|
1353
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1197
|
+
* @param group - The fragment group to be disposed.
|
|
1354
1198
|
*/
|
|
1355
|
-
|
|
1199
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
1356
1200
|
/**
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1359
|
-
* @param
|
|
1360
|
-
* @
|
|
1201
|
+
* Loads a binary file that contain fragment geometry.
|
|
1202
|
+
* @param data - The binary data to load.
|
|
1203
|
+
* @param config - Optional configuration for loading.
|
|
1204
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
1205
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
1206
|
+
* @returns The loaded FragmentsGroup.
|
|
1361
1207
|
*/
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
import * as THREE from "three";
|
|
1369
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1370
|
-
import { Component, Components } from "../../core";
|
|
1371
|
-
/**
|
|
1372
|
-
* Represents an edge measurement result.
|
|
1373
|
-
*/
|
|
1374
|
-
export interface MeasureEdge {
|
|
1208
|
+
load(data: Uint8Array, config?: Partial<{
|
|
1209
|
+
coordinate: boolean;
|
|
1210
|
+
name: string;
|
|
1211
|
+
properties: FRAGS.IfcProperties;
|
|
1212
|
+
relationsMap: RelationsMap;
|
|
1213
|
+
}>): FragmentsGroup;
|
|
1375
1214
|
/**
|
|
1376
|
-
*
|
|
1215
|
+
* Export the specified fragmentsgroup to binary data.
|
|
1216
|
+
* @param group - the fragments group to be exported.
|
|
1217
|
+
* @returns the exported data as binary buffer.
|
|
1377
1218
|
*/
|
|
1378
|
-
|
|
1219
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
1379
1220
|
/**
|
|
1380
|
-
*
|
|
1221
|
+
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
1222
|
+
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
1223
|
+
* @returns A map of model IDs to sets of express IDs.
|
|
1381
1224
|
*/
|
|
1382
|
-
|
|
1225
|
+
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
1226
|
+
[modelID: string]: Set<number>;
|
|
1227
|
+
};
|
|
1228
|
+
/**
|
|
1229
|
+
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
1230
|
+
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
1231
|
+
* @returns A fragment ID map.
|
|
1232
|
+
* @remarks
|
|
1233
|
+
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
1234
|
+
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
1235
|
+
* The fragment ID maps are then merged into a single map and returned.
|
|
1236
|
+
* If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
|
|
1237
|
+
*/
|
|
1238
|
+
modelIdToFragmentIdMap(modelIdMap: {
|
|
1239
|
+
[modelID: string]: Set<number>;
|
|
1240
|
+
}): FRAGS.FragmentIdMap;
|
|
1241
|
+
/**
|
|
1242
|
+
* Applies coordinate transformation to the provided models.
|
|
1243
|
+
* If no models are provided, all groups are used.
|
|
1244
|
+
* The first model in the list becomes the base model for coordinate transformation.
|
|
1245
|
+
* All other models are then transformed to match the base model's coordinate system.
|
|
1246
|
+
*
|
|
1247
|
+
* @param models - The models to apply coordinate transformation to.
|
|
1248
|
+
* If not provided, all groups are used.
|
|
1249
|
+
*
|
|
1250
|
+
* @returns {void}
|
|
1251
|
+
*/
|
|
1252
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
1383
1253
|
}
|
|
1254
|
+
import * as WEBIFC from "web-ifc";
|
|
1255
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1256
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1384
1257
|
/**
|
|
1385
|
-
*
|
|
1258
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1386
1259
|
*/
|
|
1387
|
-
export declare class
|
|
1260
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1388
1261
|
/**
|
|
1389
1262
|
* A unique identifier for the component.
|
|
1390
1263
|
* This UUID is used to register the component within the Components system.
|
|
1391
1264
|
*/
|
|
1392
|
-
static uuid:
|
|
1393
|
-
/** {@link Component.enabled} */
|
|
1394
|
-
enabled: boolean;
|
|
1395
|
-
constructor(components: Components);
|
|
1265
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1396
1266
|
/**
|
|
1397
|
-
*
|
|
1398
|
-
*
|
|
1399
|
-
* @param point - The point from which to calculate the distance.
|
|
1400
|
-
* @param lineStart - The start point of the line segment.
|
|
1401
|
-
* @param lineEnd - The end point of the line segment.
|
|
1402
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1403
|
-
* @returns The distance from the point to the line segment.
|
|
1267
|
+
* Event triggered when geometry is streamed.
|
|
1268
|
+
* Contains the streamed geometry data and its buffer.
|
|
1404
1269
|
*/
|
|
1405
|
-
|
|
1270
|
+
readonly onGeometryStreamed: Event<{
|
|
1271
|
+
buffer: Uint8Array;
|
|
1272
|
+
data: StreamedGeometries;
|
|
1273
|
+
}>;
|
|
1406
1274
|
/**
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1411
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1412
|
-
* @param instance - The instance of the mesh (optional).
|
|
1413
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1275
|
+
* Event triggered when assets are streamed.
|
|
1276
|
+
* Contains the streamed assets.
|
|
1414
1277
|
*/
|
|
1415
|
-
|
|
1416
|
-
edges: MeasureEdge[];
|
|
1417
|
-
indices: Set<number>;
|
|
1418
|
-
} | null;
|
|
1278
|
+
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1419
1279
|
/**
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1422
|
-
*
|
|
1423
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1424
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
1425
|
-
* @param instance - The instance of the mesh (optional).
|
|
1426
|
-
* @returns An object containing the vertices and normal of the face.
|
|
1427
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
1280
|
+
* Event triggered to indicate the progress of the streaming process.
|
|
1281
|
+
* Contains the progress percentage.
|
|
1428
1282
|
*/
|
|
1429
|
-
|
|
1430
|
-
p1: THREE.Vector3;
|
|
1431
|
-
p2: THREE.Vector3;
|
|
1432
|
-
p3: THREE.Vector3;
|
|
1433
|
-
faceNormal: THREE.Vector3;
|
|
1434
|
-
};
|
|
1283
|
+
readonly onProgress: Event<number>;
|
|
1435
1284
|
/**
|
|
1436
|
-
*
|
|
1437
|
-
*
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
round(vector: THREE.Vector3): void;
|
|
1285
|
+
* Event triggered when the IFC file is loaded.
|
|
1286
|
+
* Contains the loaded IFC file data.
|
|
1287
|
+
*/
|
|
1288
|
+
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1289
|
+
/** {@link Disposable.onDisposed} */
|
|
1290
|
+
readonly onDisposed: Event<unknown>;
|
|
1443
1291
|
/**
|
|
1444
|
-
*
|
|
1292
|
+
* Settings for the IfcGeometryTiler.
|
|
1293
|
+
*/
|
|
1294
|
+
settings: IfcStreamingSettings;
|
|
1295
|
+
/** {@link Component.enabled} */
|
|
1296
|
+
enabled: boolean;
|
|
1297
|
+
/**
|
|
1298
|
+
* The WebIFC API instance used for IFC file processing.
|
|
1299
|
+
*/
|
|
1300
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1301
|
+
private _spatialTree;
|
|
1302
|
+
private _metaData;
|
|
1303
|
+
private _visitedGeometries;
|
|
1304
|
+
private _streamSerializer;
|
|
1305
|
+
private _geometries;
|
|
1306
|
+
private _geometryCount;
|
|
1307
|
+
private _civil;
|
|
1308
|
+
private _groupSerializer;
|
|
1309
|
+
private _assets;
|
|
1310
|
+
private _meshesWithHoles;
|
|
1311
|
+
constructor(components: Components);
|
|
1312
|
+
/** {@link Disposable.dispose} */
|
|
1313
|
+
dispose(): void;
|
|
1314
|
+
/**
|
|
1315
|
+
* This method streams the IFC file from a given buffer.
|
|
1445
1316
|
*
|
|
1446
|
-
* @param
|
|
1447
|
-
* @returns
|
|
1317
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1318
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1448
1319
|
*
|
|
1449
1320
|
* @remarks
|
|
1450
|
-
* This method
|
|
1451
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1321
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1452
1322
|
*
|
|
1453
|
-
* @
|
|
1454
|
-
*
|
|
1323
|
+
* @example
|
|
1324
|
+
* '''typescript
|
|
1325
|
+
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1326
|
+
* const rawBuffer = await response.arrayBuffer();
|
|
1327
|
+
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1328
|
+
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1329
|
+
* '''
|
|
1455
1330
|
*/
|
|
1456
|
-
|
|
1457
|
-
volume: number;
|
|
1458
|
-
sphere: THREE.Sphere;
|
|
1459
|
-
};
|
|
1331
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1460
1332
|
/**
|
|
1461
|
-
*
|
|
1333
|
+
* This method streams the IFC file from a given callback.
|
|
1462
1334
|
*
|
|
1463
|
-
* @param
|
|
1464
|
-
* @returns
|
|
1335
|
+
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1336
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1465
1337
|
*
|
|
1466
1338
|
* @remarks
|
|
1467
|
-
* This method
|
|
1468
|
-
* and its bounding sphere.
|
|
1339
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1469
1340
|
*
|
|
1470
1341
|
*/
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
private
|
|
1476
|
-
private
|
|
1477
|
-
private
|
|
1342
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1343
|
+
private readIfcFile;
|
|
1344
|
+
private streamIfcFile;
|
|
1345
|
+
private streamAllGeometries;
|
|
1346
|
+
private cleanUp;
|
|
1347
|
+
private getMesh;
|
|
1348
|
+
private getGeometry;
|
|
1349
|
+
private streamAssets;
|
|
1350
|
+
private streamGeometries;
|
|
1351
|
+
}
|
|
1352
|
+
import * as WEBIFC from "web-ifc";
|
|
1353
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1354
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1355
|
+
/**
|
|
1356
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1357
|
+
*/
|
|
1358
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1359
|
+
/**
|
|
1360
|
+
* A unique identifier for the component.
|
|
1361
|
+
* This UUID is used to register the component within the Components system.
|
|
1362
|
+
*/
|
|
1363
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1364
|
+
/**
|
|
1365
|
+
* An event that is triggered when properties are streamed from the IFC file.
|
|
1366
|
+
* The event provides the type of the IFC entity and the corresponding data.
|
|
1367
|
+
*/
|
|
1368
|
+
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1369
|
+
type: number;
|
|
1370
|
+
data: {
|
|
1371
|
+
[id: number]: any;
|
|
1372
|
+
};
|
|
1373
|
+
}>;
|
|
1374
|
+
/**
|
|
1375
|
+
* An event that is triggered to indicate the progress of the streaming process.
|
|
1376
|
+
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1377
|
+
*/
|
|
1378
|
+
readonly onProgress: AsyncEvent<number>;
|
|
1379
|
+
/**
|
|
1380
|
+
* An event that is triggered when indices are streamed from the IFC file.
|
|
1381
|
+
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1382
|
+
*/
|
|
1383
|
+
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1384
|
+
/** {@link Disposable.onDisposed} */
|
|
1385
|
+
readonly onDisposed: Event<string>;
|
|
1386
|
+
/** {@link Component.enabled} */
|
|
1387
|
+
enabled: boolean;
|
|
1388
|
+
/**
|
|
1389
|
+
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1390
|
+
*/
|
|
1391
|
+
settings: PropertiesStreamingSettings;
|
|
1392
|
+
/**
|
|
1393
|
+
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1394
|
+
*/
|
|
1395
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1396
|
+
/** {@link Disposable.dispose} */
|
|
1397
|
+
dispose(): Promise<void>;
|
|
1398
|
+
/**
|
|
1399
|
+
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1400
|
+
*
|
|
1401
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1402
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1403
|
+
*/
|
|
1404
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1405
|
+
/**
|
|
1406
|
+
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1407
|
+
*
|
|
1408
|
+
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1409
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1410
|
+
*/
|
|
1411
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1412
|
+
private readIfcFile;
|
|
1413
|
+
private streamIfcFile;
|
|
1414
|
+
private streamAllProperties;
|
|
1415
|
+
private cleanUp;
|
|
1478
1416
|
}
|
|
1479
1417
|
import * as WEBIFC from "web-ifc";
|
|
1480
1418
|
import * as FRAG from "@thatopen/fragments";
|
|
@@ -1501,44 +1439,6 @@ export declare class IfcJsonExporter extends Component {
|
|
|
1501
1439
|
*/
|
|
1502
1440
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1503
1441
|
}
|
|
1504
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1505
|
-
import { Components, Component } from "../../core";
|
|
1506
|
-
/**
|
|
1507
|
-
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1508
|
-
*/
|
|
1509
|
-
export declare class Hider extends Component {
|
|
1510
|
-
/**
|
|
1511
|
-
* A unique identifier for the component.
|
|
1512
|
-
* This UUID is used to register the component within the Components system.
|
|
1513
|
-
*/
|
|
1514
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1515
|
-
/** {@link Component.enabled} */
|
|
1516
|
-
enabled: boolean;
|
|
1517
|
-
constructor(components: Components);
|
|
1518
|
-
/**
|
|
1519
|
-
* Sets the visibility of fragments within the 3D scene.
|
|
1520
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1521
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1522
|
-
*
|
|
1523
|
-
* @param visible - The visibility state to set for the fragments.
|
|
1524
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1525
|
-
* If not provided, all fragments will be affected.
|
|
1526
|
-
*
|
|
1527
|
-
* @returns {void}
|
|
1528
|
-
*/
|
|
1529
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1530
|
-
/**
|
|
1531
|
-
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1532
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1533
|
-
*
|
|
1534
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1535
|
-
* If not provided, all fragments will be isolated.
|
|
1536
|
-
*
|
|
1537
|
-
* @returns {void}
|
|
1538
|
-
*/
|
|
1539
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1540
|
-
private updateCulledVisibility;
|
|
1541
|
-
}
|
|
1542
1442
|
import * as WEBIFC from "web-ifc";
|
|
1543
1443
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1544
1444
|
import { Disposable, Event, Component, Components } from "../../core";
|
|
@@ -1936,76 +1836,193 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
1936
1836
|
private registerChange;
|
|
1937
1837
|
private newSingleProperty;
|
|
1938
1838
|
}
|
|
1939
|
-
export declare class UUID {
|
|
1940
|
-
private static _pattern;
|
|
1941
|
-
private static _lut;
|
|
1942
|
-
static create(): string;
|
|
1943
|
-
static validate(uuid: string): void;
|
|
1944
|
-
}
|
|
1945
1839
|
import * as THREE from "three";
|
|
1946
|
-
import
|
|
1840
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1841
|
+
import { Component, Components } from "../../core";
|
|
1947
1842
|
/**
|
|
1948
|
-
*
|
|
1843
|
+
* Represents an edge measurement result.
|
|
1949
1844
|
*/
|
|
1950
|
-
export interface
|
|
1951
|
-
/**
|
|
1952
|
-
* If true, only vertices will be picked, not the closest point on the face.
|
|
1953
|
-
*/
|
|
1954
|
-
showOnlyVertex: boolean;
|
|
1845
|
+
export interface MeasureEdge {
|
|
1955
1846
|
/**
|
|
1956
|
-
* The
|
|
1847
|
+
* The distance between the two points of the edge.
|
|
1957
1848
|
*/
|
|
1958
|
-
|
|
1849
|
+
distance: number;
|
|
1959
1850
|
/**
|
|
1960
|
-
* The
|
|
1851
|
+
* The two points that define the edge.
|
|
1961
1852
|
*/
|
|
1962
|
-
|
|
1853
|
+
points: THREE.Vector3[];
|
|
1963
1854
|
}
|
|
1964
1855
|
/**
|
|
1965
|
-
*
|
|
1856
|
+
* 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).
|
|
1966
1857
|
*/
|
|
1967
|
-
export declare class
|
|
1968
|
-
/** {@link Disposable.onDisposed} */
|
|
1969
|
-
readonly onDisposed: Event<unknown>;
|
|
1970
|
-
/**
|
|
1971
|
-
* An event that is triggered when a vertex is found.
|
|
1972
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1973
|
-
*/
|
|
1974
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1975
|
-
/**
|
|
1976
|
-
* An event that is triggered when a vertex is lost.
|
|
1977
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1978
|
-
*/
|
|
1979
|
-
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1980
|
-
/**
|
|
1981
|
-
* A reference to the Components instance associated with this VertexPicker.
|
|
1982
|
-
*/
|
|
1983
|
-
components: Components;
|
|
1858
|
+
export declare class MeasurementUtils extends Component {
|
|
1984
1859
|
/**
|
|
1985
|
-
* A
|
|
1986
|
-
* This
|
|
1987
|
-
* If this value is null, all vertices are considered valid.
|
|
1860
|
+
* A unique identifier for the component.
|
|
1861
|
+
* This UUID is used to register the component within the Components system.
|
|
1988
1862
|
*/
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1863
|
+
static uuid: string;
|
|
1864
|
+
/** {@link Component.enabled} */
|
|
1865
|
+
enabled: boolean;
|
|
1866
|
+
constructor(components: Components);
|
|
1993
1867
|
/**
|
|
1994
|
-
*
|
|
1995
|
-
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1996
|
-
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1868
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
1997
1869
|
*
|
|
1998
|
-
* @param
|
|
1870
|
+
* @param point - The point from which to calculate the distance.
|
|
1871
|
+
* @param lineStart - The start point of the line segment.
|
|
1872
|
+
* @param lineEnd - The end point of the line segment.
|
|
1873
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1874
|
+
* @returns The distance from the point to the line segment.
|
|
1999
1875
|
*/
|
|
2000
|
-
|
|
1876
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
2001
1877
|
/**
|
|
2002
|
-
*
|
|
1878
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
1879
|
+
* It also returns the edges of the found face and their indices.
|
|
2003
1880
|
*
|
|
2004
|
-
* @
|
|
1881
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1882
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1883
|
+
* @param instance - The instance of the mesh (optional).
|
|
1884
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
2005
1885
|
*/
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1886
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1887
|
+
edges: MeasureEdge[];
|
|
1888
|
+
indices: Set<number>;
|
|
1889
|
+
} | null;
|
|
1890
|
+
/**
|
|
1891
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1892
|
+
* It also applies instance transformation if provided.
|
|
1893
|
+
*
|
|
1894
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1895
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
1896
|
+
* @param instance - The instance of the mesh (optional).
|
|
1897
|
+
* @returns An object containing the vertices and normal of the face.
|
|
1898
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
1899
|
+
*/
|
|
1900
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1901
|
+
p1: THREE.Vector3;
|
|
1902
|
+
p2: THREE.Vector3;
|
|
1903
|
+
p3: THREE.Vector3;
|
|
1904
|
+
faceNormal: THREE.Vector3;
|
|
1905
|
+
};
|
|
1906
|
+
/**
|
|
1907
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
1908
|
+
* This is used to ensure numerical precision in edge detection.
|
|
1909
|
+
*
|
|
1910
|
+
* @param vector - The vector to round.
|
|
1911
|
+
* @returns The vector with rounded components.
|
|
1912
|
+
*/
|
|
1913
|
+
round(vector: THREE.Vector3): void;
|
|
1914
|
+
/**
|
|
1915
|
+
* Calculates the volume of a set of fragments.
|
|
1916
|
+
*
|
|
1917
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1918
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
1919
|
+
*
|
|
1920
|
+
* @remarks
|
|
1921
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1922
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1923
|
+
*
|
|
1924
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1925
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
1926
|
+
*/
|
|
1927
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
1928
|
+
/**
|
|
1929
|
+
* Calculates the total volume of a set of meshes.
|
|
1930
|
+
*
|
|
1931
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1932
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
1933
|
+
*
|
|
1934
|
+
* @remarks
|
|
1935
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1936
|
+
* and its bounding sphere.
|
|
1937
|
+
*
|
|
1938
|
+
*/
|
|
1939
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
1940
|
+
private getFaceData;
|
|
1941
|
+
private getVolumeOfMesh;
|
|
1942
|
+
private getSignedVolumeOfTriangle;
|
|
1943
|
+
}
|
|
1944
|
+
import * as THREE from "three";
|
|
1945
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1946
|
+
center: THREE.Vector3;
|
|
1947
|
+
halfSizes: THREE.Vector3;
|
|
1948
|
+
rotation: THREE.Matrix3;
|
|
1949
|
+
transformation: THREE.Matrix4;
|
|
1950
|
+
};
|
|
1951
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1952
|
+
import * as THREE from "three";
|
|
1953
|
+
export declare class MaterialsUtils {
|
|
1954
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
1955
|
+
}
|
|
1956
|
+
export declare class UUID {
|
|
1957
|
+
private static _pattern;
|
|
1958
|
+
private static _lut;
|
|
1959
|
+
static create(): string;
|
|
1960
|
+
static validate(uuid: string): void;
|
|
1961
|
+
}
|
|
1962
|
+
import * as THREE from "three";
|
|
1963
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1964
|
+
/**
|
|
1965
|
+
* Configuration interface for the VertexPicker component.
|
|
1966
|
+
*/
|
|
1967
|
+
export interface VertexPickerConfig {
|
|
1968
|
+
/**
|
|
1969
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
1970
|
+
*/
|
|
1971
|
+
showOnlyVertex: boolean;
|
|
1972
|
+
/**
|
|
1973
|
+
* The maximum distance for snapping to a vertex.
|
|
1974
|
+
*/
|
|
1975
|
+
snapDistance: number;
|
|
1976
|
+
/**
|
|
1977
|
+
* The HTML element to use for previewing the picked vertex.
|
|
1978
|
+
*/
|
|
1979
|
+
previewElement: HTMLElement;
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1983
|
+
*/
|
|
1984
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
1985
|
+
/** {@link Disposable.onDisposed} */
|
|
1986
|
+
readonly onDisposed: Event<unknown>;
|
|
1987
|
+
/**
|
|
1988
|
+
* An event that is triggered when a vertex is found.
|
|
1989
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1990
|
+
*/
|
|
1991
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1992
|
+
/**
|
|
1993
|
+
* An event that is triggered when a vertex is lost.
|
|
1994
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1995
|
+
*/
|
|
1996
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1997
|
+
/**
|
|
1998
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
1999
|
+
*/
|
|
2000
|
+
components: Components;
|
|
2001
|
+
/**
|
|
2002
|
+
* A reference to the working plane used for vertex picking.
|
|
2003
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
2004
|
+
* If this value is null, all vertices are considered valid.
|
|
2005
|
+
*/
|
|
2006
|
+
workingPlane: THREE.Plane | null;
|
|
2007
|
+
private _pickedPoint;
|
|
2008
|
+
private _config;
|
|
2009
|
+
private _enabled;
|
|
2010
|
+
/**
|
|
2011
|
+
* Sets the enabled state of the VertexPicker.
|
|
2012
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
2013
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
2014
|
+
*
|
|
2015
|
+
* @param value - The new enabled state.
|
|
2016
|
+
*/
|
|
2017
|
+
set enabled(value: boolean);
|
|
2018
|
+
/**
|
|
2019
|
+
* Gets the current enabled state of the VertexPicker.
|
|
2020
|
+
*
|
|
2021
|
+
* @returns The current enabled state.
|
|
2022
|
+
*/
|
|
2023
|
+
get enabled(): boolean;
|
|
2024
|
+
/**
|
|
2025
|
+
* Sets the configuration for the VertexPicker component.
|
|
2009
2026
|
*
|
|
2010
2027
|
* @param value - A Partial object containing the configuration properties to update.
|
|
2011
2028
|
* The properties not provided in the value object will retain their current values.
|
|
@@ -2054,51 +2071,6 @@ export declare class VertexPicker extends Component implements Disposable {
|
|
|
2054
2071
|
private getVertices;
|
|
2055
2072
|
private getVertex;
|
|
2056
2073
|
}
|
|
2057
|
-
/**
|
|
2058
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2059
|
-
*/
|
|
2060
|
-
export declare const GeometryTypes: Set<number>;
|
|
2061
|
-
import * as WEBIFC from "web-ifc";
|
|
2062
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
2063
|
-
export declare class IfcFragmentSettings {
|
|
2064
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
2065
|
-
includeProperties: boolean;
|
|
2066
|
-
/**
|
|
2067
|
-
* Generate the geometry for categories that are not included by default,
|
|
2068
|
-
* like IFCSPACE.
|
|
2069
|
-
*/
|
|
2070
|
-
optionalCategories: number[];
|
|
2071
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
2072
|
-
coordinate: boolean;
|
|
2073
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2074
|
-
wasm: {
|
|
2075
|
-
path: string;
|
|
2076
|
-
absolute: boolean;
|
|
2077
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2078
|
-
};
|
|
2079
|
-
/** List of categories that won't be converted to fragments. */
|
|
2080
|
-
excludedCategories: Set<number>;
|
|
2081
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
2082
|
-
saveLocations: boolean;
|
|
2083
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2084
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
2085
|
-
/**
|
|
2086
|
-
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2087
|
-
* If set to true, the path will be set to the default path of the WASM file.
|
|
2088
|
-
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2089
|
-
* Default value is true.
|
|
2090
|
-
*/
|
|
2091
|
-
autoSetWasm: boolean;
|
|
2092
|
-
/**
|
|
2093
|
-
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2094
|
-
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2095
|
-
* If set to null, the default file location handler will be used.
|
|
2096
|
-
*
|
|
2097
|
-
* @param url - The URL of the file to locate.
|
|
2098
|
-
* @returns The absolute path of the file.
|
|
2099
|
-
*/
|
|
2100
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2101
|
-
}
|
|
2102
2074
|
import * as THREE from "three";
|
|
2103
2075
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2104
2076
|
/**
|
|
@@ -2188,6 +2160,15 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2188
2160
|
resize(size?: THREE.Vector2): void;
|
|
2189
2161
|
private updatePlanes;
|
|
2190
2162
|
}
|
|
2163
|
+
/**
|
|
2164
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2165
|
+
*/
|
|
2166
|
+
export declare const GeometryTypes: Set<number>;
|
|
2167
|
+
import { InverseAttribute } from "./types";
|
|
2168
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2169
|
+
forRelating: InverseAttribute;
|
|
2170
|
+
forRelated: InverseAttribute;
|
|
2171
|
+
}>;
|
|
2191
2172
|
import * as WEBIFC from "web-ifc";
|
|
2192
2173
|
import { IfcItemsCategories } from "../../../ifc";
|
|
2193
2174
|
export declare class SpatialStructure {
|
|
@@ -2196,6 +2177,54 @@ export declare class SpatialStructure {
|
|
|
2196
2177
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2197
2178
|
cleanUp(): void;
|
|
2198
2179
|
}
|
|
2180
|
+
import * as WEBIFC from "web-ifc";
|
|
2181
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2182
|
+
export declare class IfcFragmentSettings {
|
|
2183
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2184
|
+
includeProperties: boolean;
|
|
2185
|
+
/**
|
|
2186
|
+
* Generate the geometry for categories that are not included by default,
|
|
2187
|
+
* like IFCSPACE.
|
|
2188
|
+
*/
|
|
2189
|
+
optionalCategories: number[];
|
|
2190
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2191
|
+
coordinate: boolean;
|
|
2192
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2193
|
+
wasm: {
|
|
2194
|
+
path: string;
|
|
2195
|
+
absolute: boolean;
|
|
2196
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2197
|
+
};
|
|
2198
|
+
/** List of categories that won't be converted to fragments. */
|
|
2199
|
+
excludedCategories: Set<number>;
|
|
2200
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2201
|
+
saveLocations: boolean;
|
|
2202
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2203
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2204
|
+
/**
|
|
2205
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2206
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2207
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2208
|
+
* Default value is true.
|
|
2209
|
+
*/
|
|
2210
|
+
autoSetWasm: boolean;
|
|
2211
|
+
/**
|
|
2212
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2213
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2214
|
+
* If set to null, the default file location handler will be used.
|
|
2215
|
+
*
|
|
2216
|
+
* @param url - The URL of the file to locate.
|
|
2217
|
+
* @returns The absolute path of the file.
|
|
2218
|
+
*/
|
|
2219
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2220
|
+
}
|
|
2221
|
+
import * as WEBIFC from "web-ifc";
|
|
2222
|
+
export interface IfcItemsCategories {
|
|
2223
|
+
[itemID: number]: number;
|
|
2224
|
+
}
|
|
2225
|
+
export declare class IfcCategories {
|
|
2226
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2227
|
+
}
|
|
2199
2228
|
/**
|
|
2200
2229
|
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2201
2230
|
*
|
|
@@ -2213,13 +2242,6 @@ export declare const IfcElements: {
|
|
|
2213
2242
|
export declare const IfcCategoryMap: {
|
|
2214
2243
|
[key: number]: string;
|
|
2215
2244
|
};
|
|
2216
|
-
import * as WEBIFC from "web-ifc";
|
|
2217
|
-
export interface IfcItemsCategories {
|
|
2218
|
-
[itemID: number]: number;
|
|
2219
|
-
}
|
|
2220
|
-
export declare class IfcCategories {
|
|
2221
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2222
|
-
}
|
|
2223
2245
|
import * as FRAGS from "@thatopen/fragments";
|
|
2224
2246
|
export declare class IfcPropertiesUtils {
|
|
2225
2247
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2245,14 +2267,89 @@ export declare class IfcPropertiesUtils {
|
|
|
2245
2267
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2246
2268
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2247
2269
|
}
|
|
2270
|
+
import * as THREE from "three";
|
|
2271
|
+
import { Disposable, Event } from "../../Types";
|
|
2248
2272
|
/**
|
|
2249
|
-
*
|
|
2273
|
+
* 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.
|
|
2250
2274
|
*/
|
|
2251
|
-
export declare class
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2275
|
+
export declare class Mouse implements Disposable {
|
|
2276
|
+
dom: HTMLCanvasElement;
|
|
2277
|
+
private _event?;
|
|
2278
|
+
private _position;
|
|
2279
|
+
/** {@link Disposable.onDisposed} */
|
|
2280
|
+
readonly onDisposed: Event<unknown>;
|
|
2281
|
+
constructor(dom: HTMLCanvasElement);
|
|
2282
|
+
/**
|
|
2283
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2284
|
+
*/
|
|
2285
|
+
get position(): THREE.Vector2;
|
|
2286
|
+
/** {@link Disposable.dispose} */
|
|
2287
|
+
dispose(): void;
|
|
2288
|
+
private getPositionY;
|
|
2289
|
+
private getPositionX;
|
|
2290
|
+
private updateMouseInfo;
|
|
2291
|
+
private setupEvents;
|
|
2292
|
+
}
|
|
2293
|
+
import * as THREE from "three";
|
|
2294
|
+
import { Components } from "../../Components";
|
|
2295
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2296
|
+
import { Mouse } from "./mouse";
|
|
2297
|
+
/**
|
|
2298
|
+
* 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.
|
|
2299
|
+
*/
|
|
2300
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2301
|
+
/** {@link Component.enabled} */
|
|
2302
|
+
enabled: boolean;
|
|
2303
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2304
|
+
components: Components;
|
|
2305
|
+
/** {@link Disposable.onDisposed} */
|
|
2306
|
+
readonly onDisposed: Event<unknown>;
|
|
2307
|
+
/** The position of the mouse in the screen. */
|
|
2308
|
+
readonly mouse: Mouse;
|
|
2309
|
+
/**
|
|
2310
|
+
* A reference to the Three.js Raycaster instance.
|
|
2311
|
+
* This is used for raycasting operations.
|
|
2312
|
+
*/
|
|
2313
|
+
readonly three: THREE.Raycaster;
|
|
2314
|
+
/**
|
|
2315
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2316
|
+
* This is used to access the camera and meshes.
|
|
2317
|
+
*/
|
|
2318
|
+
world: World;
|
|
2319
|
+
constructor(components: Components, world: World);
|
|
2320
|
+
/** {@link Disposable.dispose} */
|
|
2321
|
+
dispose(): void;
|
|
2322
|
+
/**
|
|
2323
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2324
|
+
* the first item found. This also takes into account the clipping planes
|
|
2325
|
+
* used by the renderer.
|
|
2326
|
+
*
|
|
2327
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2328
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2329
|
+
* {@link Components.meshes}.
|
|
2330
|
+
*/
|
|
2331
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2332
|
+
/**
|
|
2333
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2334
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2335
|
+
*
|
|
2336
|
+
* @param origin - The origin of the ray.
|
|
2337
|
+
* @param direction - The direction of the ray.
|
|
2338
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2339
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2340
|
+
*/
|
|
2341
|
+
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;
|
|
2342
|
+
private intersect;
|
|
2343
|
+
private filterClippingPlanes;
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* 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.
|
|
2347
|
+
*/
|
|
2348
|
+
export declare class Event<T> {
|
|
2349
|
+
/**
|
|
2350
|
+
* Add a callback to this event instance.
|
|
2351
|
+
* @param handler - the callback to be added to this event.
|
|
2352
|
+
*/
|
|
2256
2353
|
add(handler: T extends void ? {
|
|
2257
2354
|
(): void;
|
|
2258
2355
|
} : {
|
|
@@ -2273,6 +2370,34 @@ export declare class Event<T> {
|
|
|
2273
2370
|
reset(): void;
|
|
2274
2371
|
private handlers;
|
|
2275
2372
|
}
|
|
2373
|
+
/**
|
|
2374
|
+
* 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.
|
|
2375
|
+
*/
|
|
2376
|
+
export declare class AsyncEvent<T> {
|
|
2377
|
+
/**
|
|
2378
|
+
* Add a callback to this event instance.
|
|
2379
|
+
* @param handler - the callback to be added to this event.
|
|
2380
|
+
*/
|
|
2381
|
+
add(handler: T extends void ? {
|
|
2382
|
+
(): Promise<void>;
|
|
2383
|
+
} : {
|
|
2384
|
+
(data: T): Promise<void>;
|
|
2385
|
+
}): void;
|
|
2386
|
+
/**
|
|
2387
|
+
* Removes a callback from this event instance.
|
|
2388
|
+
* @param handler - the callback to be removed from this event.
|
|
2389
|
+
*/
|
|
2390
|
+
remove(handler: T extends void ? {
|
|
2391
|
+
(): Promise<void>;
|
|
2392
|
+
} : {
|
|
2393
|
+
(data: T): Promise<void>;
|
|
2394
|
+
}): void;
|
|
2395
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2396
|
+
trigger: (data?: T) => Promise<void>;
|
|
2397
|
+
/** Gets rid of all the suscribed events. */
|
|
2398
|
+
reset(): void;
|
|
2399
|
+
private handlers;
|
|
2400
|
+
}
|
|
2276
2401
|
import * as THREE from "three";
|
|
2277
2402
|
import CameraControls from "camera-controls";
|
|
2278
2403
|
import { Event } from "./event";
|
|
@@ -2394,33 +2519,24 @@ export declare abstract class Component extends Base {
|
|
|
2394
2519
|
*/
|
|
2395
2520
|
abstract enabled: boolean;
|
|
2396
2521
|
}
|
|
2522
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2523
|
+
import { Components } from "../../Components";
|
|
2397
2524
|
/**
|
|
2398
|
-
*
|
|
2525
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2399
2526
|
*/
|
|
2400
|
-
export declare class
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
*/
|
|
2414
|
-
remove(handler: T extends void ? {
|
|
2415
|
-
(): Promise<void>;
|
|
2416
|
-
} : {
|
|
2417
|
-
(data: T): Promise<void>;
|
|
2418
|
-
}): void;
|
|
2419
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2420
|
-
trigger: (data?: T) => Promise<void>;
|
|
2421
|
-
/** Gets rid of all the suscribed events. */
|
|
2422
|
-
reset(): void;
|
|
2423
|
-
private handlers;
|
|
2527
|
+
export declare abstract class Base {
|
|
2528
|
+
components: Components;
|
|
2529
|
+
constructor(components: Components);
|
|
2530
|
+
/** Whether is component is {@link Disposable}. */
|
|
2531
|
+
isDisposeable: () => this is Disposable;
|
|
2532
|
+
/** Whether is component is {@link Resizeable}. */
|
|
2533
|
+
isResizeable: () => this is Resizeable;
|
|
2534
|
+
/** Whether is component is {@link Updateable}. */
|
|
2535
|
+
isUpdateable: () => this is Updateable;
|
|
2536
|
+
/** Whether is component is {@link Hideable}. */
|
|
2537
|
+
isHideable: () => this is Hideable;
|
|
2538
|
+
/** Whether is component is {@link Configurable}. */
|
|
2539
|
+
isConfigurable: () => this is Configurable<any>;
|
|
2424
2540
|
}
|
|
2425
2541
|
import * as THREE from "three";
|
|
2426
2542
|
import CameraControls from "camera-controls";
|
|
@@ -2450,25 +2566,6 @@ export declare abstract class BaseCamera extends BaseWorldItem {
|
|
|
2450
2566
|
*/
|
|
2451
2567
|
hasCameraControls: () => this is CameraControllable;
|
|
2452
2568
|
}
|
|
2453
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2454
|
-
import { Components } from "../../Components";
|
|
2455
|
-
/**
|
|
2456
|
-
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2457
|
-
*/
|
|
2458
|
-
export declare abstract class Base {
|
|
2459
|
-
components: Components;
|
|
2460
|
-
constructor(components: Components);
|
|
2461
|
-
/** Whether is component is {@link Disposable}. */
|
|
2462
|
-
isDisposeable: () => this is Disposable;
|
|
2463
|
-
/** Whether is component is {@link Resizeable}. */
|
|
2464
|
-
isResizeable: () => this is Resizeable;
|
|
2465
|
-
/** Whether is component is {@link Updateable}. */
|
|
2466
|
-
isUpdateable: () => this is Updateable;
|
|
2467
|
-
/** Whether is component is {@link Hideable}. */
|
|
2468
|
-
isHideable: () => this is Hideable;
|
|
2469
|
-
/** Whether is component is {@link Configurable}. */
|
|
2470
|
-
isConfigurable: () => this is Configurable<any>;
|
|
2471
|
-
}
|
|
2472
2569
|
import { Base } from "./base";
|
|
2473
2570
|
import { World } from "./world";
|
|
2474
2571
|
import { Event } from "./event";
|
|
@@ -2611,11 +2708,6 @@ export interface World extends Disposable, Updateable {
|
|
|
2611
2708
|
*/
|
|
2612
2709
|
isDisposing: boolean;
|
|
2613
2710
|
}
|
|
2614
|
-
import { InverseAttribute } from "./types";
|
|
2615
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2616
|
-
forRelating: InverseAttribute;
|
|
2617
|
-
forRelated: InverseAttribute;
|
|
2618
|
-
}>;
|
|
2619
2711
|
import * as THREE from "three";
|
|
2620
2712
|
import { Components } from "../../Components";
|
|
2621
2713
|
import { AsyncEvent, Event, World } from "../../Types";
|
|
@@ -2707,284 +2799,6 @@ export declare class CullerRenderer {
|
|
|
2707
2799
|
protected decreaseColor(): void;
|
|
2708
2800
|
private applySettings;
|
|
2709
2801
|
}
|
|
2710
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2711
|
-
import * as THREE from "three";
|
|
2712
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2713
|
-
import { Components } from "../../Components";
|
|
2714
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2715
|
-
/**
|
|
2716
|
-
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2717
|
-
*/
|
|
2718
|
-
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2719
|
-
/**
|
|
2720
|
-
* Event triggered when the visibility of meshes is updated.
|
|
2721
|
-
* Contains two sets: seen and unseen.
|
|
2722
|
-
*/
|
|
2723
|
-
readonly onViewUpdated: Event<{
|
|
2724
|
-
seen: Set<THREE.Mesh>;
|
|
2725
|
-
unseen: Set<THREE.Mesh>;
|
|
2726
|
-
}>;
|
|
2727
|
-
/**
|
|
2728
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2729
|
-
* Default value is 100.
|
|
2730
|
-
*/
|
|
2731
|
-
threshold: number;
|
|
2732
|
-
/**
|
|
2733
|
-
* Map of color code to THREE.InstancedMesh.
|
|
2734
|
-
* Used to keep track of color-coded meshes.
|
|
2735
|
-
*/
|
|
2736
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2737
|
-
/**
|
|
2738
|
-
* Flag to indicate if the renderer is currently processing.
|
|
2739
|
-
* Used to prevent concurrent processing.
|
|
2740
|
-
*/
|
|
2741
|
-
isProcessing: boolean;
|
|
2742
|
-
private _colorCodeMeshMap;
|
|
2743
|
-
private _meshIDColorCodeMap;
|
|
2744
|
-
private _currentVisibleMeshes;
|
|
2745
|
-
private _recentlyHiddenMeshes;
|
|
2746
|
-
private _intervalID;
|
|
2747
|
-
private readonly _transparentMat;
|
|
2748
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2749
|
-
/** {@link Disposable.dispose} */
|
|
2750
|
-
dispose(): void;
|
|
2751
|
-
/**
|
|
2752
|
-
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
2753
|
-
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2754
|
-
* @returns {void}
|
|
2755
|
-
*/
|
|
2756
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2757
|
-
/**
|
|
2758
|
-
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2759
|
-
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2760
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2761
|
-
* @returns {void}
|
|
2762
|
-
*/
|
|
2763
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2764
|
-
private handleWorkerMessage;
|
|
2765
|
-
private getAvailableMaterial;
|
|
2766
|
-
}
|
|
2767
|
-
import * as THREE from "three";
|
|
2768
|
-
import { Disposable, Event } from "../../Types";
|
|
2769
|
-
/**
|
|
2770
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
2771
|
-
*/
|
|
2772
|
-
export declare class Mouse implements Disposable {
|
|
2773
|
-
dom: HTMLCanvasElement;
|
|
2774
|
-
private _event?;
|
|
2775
|
-
private _position;
|
|
2776
|
-
/** {@link Disposable.onDisposed} */
|
|
2777
|
-
readonly onDisposed: Event<unknown>;
|
|
2778
|
-
constructor(dom: HTMLCanvasElement);
|
|
2779
|
-
/**
|
|
2780
|
-
* The real position of the mouse of the Three.js canvas.
|
|
2781
|
-
*/
|
|
2782
|
-
get position(): THREE.Vector2;
|
|
2783
|
-
/** {@link Disposable.dispose} */
|
|
2784
|
-
dispose(): void;
|
|
2785
|
-
private getPositionY;
|
|
2786
|
-
private getPositionX;
|
|
2787
|
-
private updateMouseInfo;
|
|
2788
|
-
private setupEvents;
|
|
2789
|
-
}
|
|
2790
|
-
/**
|
|
2791
|
-
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
2792
|
-
*/
|
|
2793
|
-
export interface StreamedGeometries {
|
|
2794
|
-
[id: number]: {
|
|
2795
|
-
/** The bounding box of the geometry as a Float32Array. */
|
|
2796
|
-
boundingBox: Float32Array;
|
|
2797
|
-
/** A boolean indicating whether the geometry has holes. */
|
|
2798
|
-
hasHoles: boolean;
|
|
2799
|
-
/** An optional file path for the geometry data. */
|
|
2800
|
-
geometryFile?: string;
|
|
2801
|
-
};
|
|
2802
|
-
}
|
|
2803
|
-
/**
|
|
2804
|
-
* A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
|
|
2805
|
-
*/
|
|
2806
|
-
export interface StreamedAsset {
|
|
2807
|
-
/** The unique identifier of the asset. */
|
|
2808
|
-
id: number;
|
|
2809
|
-
/** An array of geometries associated with the asset. */
|
|
2810
|
-
geometries: {
|
|
2811
|
-
/** The unique identifier of the geometry. */
|
|
2812
|
-
geometryID: number;
|
|
2813
|
-
/** The transformation matrix of the geometry as a number array. */
|
|
2814
|
-
transformation: number[];
|
|
2815
|
-
/** The color of the geometry as a number array. */
|
|
2816
|
-
color: number[];
|
|
2817
|
-
}[];
|
|
2818
|
-
}
|
|
2819
|
-
import * as THREE from "three";
|
|
2820
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
2821
|
-
import { Components } from "../../Components";
|
|
2822
|
-
/**
|
|
2823
|
-
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
2824
|
-
*/
|
|
2825
|
-
export interface SimpleSceneConfig {
|
|
2826
|
-
directionalLight: {
|
|
2827
|
-
color: THREE.Color;
|
|
2828
|
-
intensity: number;
|
|
2829
|
-
position: THREE.Vector3;
|
|
2830
|
-
};
|
|
2831
|
-
ambientLight: {
|
|
2832
|
-
color: THREE.Color;
|
|
2833
|
-
intensity: number;
|
|
2834
|
-
};
|
|
2835
|
-
}
|
|
2836
|
-
/**
|
|
2837
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
2838
|
-
*/
|
|
2839
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2840
|
-
/** {@link Configurable.isSetup} */
|
|
2841
|
-
isSetup: boolean;
|
|
2842
|
-
/**
|
|
2843
|
-
* The underlying Three.js scene object.
|
|
2844
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2845
|
-
*/
|
|
2846
|
-
three: THREE.Scene;
|
|
2847
|
-
/** {@link Configurable.onSetup} */
|
|
2848
|
-
readonly onSetup: Event<SimpleScene>;
|
|
2849
|
-
/**
|
|
2850
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
2851
|
-
* Defines properties for directional and ambient lights.
|
|
2852
|
-
*/
|
|
2853
|
-
config: Required<SimpleSceneConfig>;
|
|
2854
|
-
constructor(components: Components);
|
|
2855
|
-
/** {@link Configurable.setup} */
|
|
2856
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2857
|
-
}
|
|
2858
|
-
import * as THREE from "three";
|
|
2859
|
-
import { Components } from "../../Components";
|
|
2860
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2861
|
-
import { Mouse } from "./mouse";
|
|
2862
|
-
/**
|
|
2863
|
-
* 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.
|
|
2864
|
-
*/
|
|
2865
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
2866
|
-
/** {@link Component.enabled} */
|
|
2867
|
-
enabled: boolean;
|
|
2868
|
-
/** The components instance to which this Raycaster belongs. */
|
|
2869
|
-
components: Components;
|
|
2870
|
-
/** {@link Disposable.onDisposed} */
|
|
2871
|
-
readonly onDisposed: Event<unknown>;
|
|
2872
|
-
/** The position of the mouse in the screen. */
|
|
2873
|
-
readonly mouse: Mouse;
|
|
2874
|
-
/**
|
|
2875
|
-
* A reference to the Three.js Raycaster instance.
|
|
2876
|
-
* This is used for raycasting operations.
|
|
2877
|
-
*/
|
|
2878
|
-
readonly three: THREE.Raycaster;
|
|
2879
|
-
/**
|
|
2880
|
-
* A reference to the world instance to which this Raycaster belongs.
|
|
2881
|
-
* This is used to access the camera and meshes.
|
|
2882
|
-
*/
|
|
2883
|
-
world: World;
|
|
2884
|
-
constructor(components: Components, world: World);
|
|
2885
|
-
/** {@link Disposable.dispose} */
|
|
2886
|
-
dispose(): void;
|
|
2887
|
-
/**
|
|
2888
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2889
|
-
* the first item found. This also takes into account the clipping planes
|
|
2890
|
-
* used by the renderer.
|
|
2891
|
-
*
|
|
2892
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2893
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
2894
|
-
* {@link Components.meshes}.
|
|
2895
|
-
*/
|
|
2896
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2897
|
-
/**
|
|
2898
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2899
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
2900
|
-
*
|
|
2901
|
-
* @param origin - The origin of the ray.
|
|
2902
|
-
* @param direction - The direction of the ray.
|
|
2903
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2904
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2905
|
-
*/
|
|
2906
|
-
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;
|
|
2907
|
-
private intersect;
|
|
2908
|
-
private filterClippingPlanes;
|
|
2909
|
-
}
|
|
2910
|
-
import * as THREE from "three";
|
|
2911
|
-
import CameraControls from "camera-controls";
|
|
2912
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2913
|
-
import { Components } from "../../Components";
|
|
2914
|
-
/**
|
|
2915
|
-
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
2916
|
-
*/
|
|
2917
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
2918
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2919
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2920
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2921
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2922
|
-
/**
|
|
2923
|
-
* Event that is triggered when the aspect of the camera has been updated.
|
|
2924
|
-
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
2925
|
-
*/
|
|
2926
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
2927
|
-
/** {@link Disposable.onDisposed} */
|
|
2928
|
-
readonly onDisposed: Event<string>;
|
|
2929
|
-
/**
|
|
2930
|
-
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
2931
|
-
* This camera is used for rendering the scene.
|
|
2932
|
-
*/
|
|
2933
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2934
|
-
private _allControls;
|
|
2935
|
-
/**
|
|
2936
|
-
* The object that controls the camera. An instance of
|
|
2937
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
2938
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
2939
|
-
* object to move, rotate, look at objects, etc.
|
|
2940
|
-
*/
|
|
2941
|
-
get controls(): CameraControls;
|
|
2942
|
-
/**
|
|
2943
|
-
* Getter for the enabled state of the camera controls.
|
|
2944
|
-
* If the current world is null, it returns false.
|
|
2945
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
2946
|
-
*
|
|
2947
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
2948
|
-
*/
|
|
2949
|
-
get enabled(): boolean;
|
|
2950
|
-
/**
|
|
2951
|
-
* Setter for the enabled state of the camera controls.
|
|
2952
|
-
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
2953
|
-
*
|
|
2954
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
2955
|
-
*/
|
|
2956
|
-
set enabled(enabled: boolean);
|
|
2957
|
-
constructor(components: Components);
|
|
2958
|
-
/** {@link Disposable.dispose} */
|
|
2959
|
-
dispose(): void;
|
|
2960
|
-
/** {@link Updateable.update} */
|
|
2961
|
-
update(_delta: number): void;
|
|
2962
|
-
/**
|
|
2963
|
-
* Updates the aspect of the camera to match the size of the
|
|
2964
|
-
* {@link Components.renderer}.
|
|
2965
|
-
*/
|
|
2966
|
-
updateAspect: () => void;
|
|
2967
|
-
private setupCamera;
|
|
2968
|
-
private newCameraControls;
|
|
2969
|
-
private setupEvents;
|
|
2970
|
-
private static getSubsetOfThree;
|
|
2971
|
-
}
|
|
2972
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2973
|
-
/**
|
|
2974
|
-
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
2975
|
-
*/
|
|
2976
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
2977
|
-
/**
|
|
2978
|
-
* Minimum number of geometries to be streamed.
|
|
2979
|
-
* Defaults to 10 geometries.
|
|
2980
|
-
*/
|
|
2981
|
-
minGeometrySize: number;
|
|
2982
|
-
/**
|
|
2983
|
-
* Minimum amount of assets to be streamed.
|
|
2984
|
-
* Defaults to 1000 assets.
|
|
2985
|
-
*/
|
|
2986
|
-
minAssetsSize: number;
|
|
2987
|
-
}
|
|
2988
2802
|
import * as THREE from "three";
|
|
2989
2803
|
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2990
2804
|
import { Components } from "../../Components";
|
|
@@ -3045,58 +2859,72 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
3045
2859
|
private updateZoom;
|
|
3046
2860
|
}
|
|
3047
2861
|
import * as THREE from "three";
|
|
3048
|
-
import {
|
|
2862
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
3049
2863
|
import { Components } from "../../Components";
|
|
2864
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3050
2865
|
/**
|
|
3051
|
-
* A
|
|
2866
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
3052
2867
|
*/
|
|
3053
|
-
export declare class
|
|
2868
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3054
2869
|
/**
|
|
3055
|
-
*
|
|
3056
|
-
*
|
|
2870
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2871
|
+
* Contains two sets: seen and unseen.
|
|
3057
2872
|
*/
|
|
3058
|
-
|
|
2873
|
+
readonly onViewUpdated: Event<{
|
|
2874
|
+
seen: Set<THREE.Mesh>;
|
|
2875
|
+
unseen: Set<THREE.Mesh>;
|
|
2876
|
+
}>;
|
|
3059
2877
|
/**
|
|
3060
|
-
*
|
|
2878
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2879
|
+
* Default value is 100.
|
|
3061
2880
|
*/
|
|
3062
|
-
|
|
2881
|
+
threshold: number;
|
|
3063
2882
|
/**
|
|
3064
|
-
*
|
|
2883
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2884
|
+
* Used to keep track of color-coded meshes.
|
|
3065
2885
|
*/
|
|
3066
|
-
|
|
3067
|
-
protected _canvas: HTMLCanvasElement;
|
|
3068
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3069
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
3070
|
-
protected onContainerUpdated: Event<unknown>;
|
|
3071
|
-
private _resizing;
|
|
2886
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3072
2887
|
/**
|
|
3073
|
-
*
|
|
3074
|
-
*
|
|
3075
|
-
* @param components - The components instance.
|
|
3076
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3077
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2888
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2889
|
+
* Used to prevent concurrent processing.
|
|
3078
2890
|
*/
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
2891
|
+
isProcessing: boolean;
|
|
2892
|
+
private _colorCodeMeshMap;
|
|
2893
|
+
private _meshIDColorCodeMap;
|
|
2894
|
+
private _currentVisibleMeshes;
|
|
2895
|
+
private _recentlyHiddenMeshes;
|
|
2896
|
+
private _intervalID;
|
|
2897
|
+
private readonly _transparentMat;
|
|
2898
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3082
2899
|
/** {@link Disposable.dispose} */
|
|
3083
2900
|
dispose(): void;
|
|
3084
|
-
/** {@link Resizeable.getSize}. */
|
|
3085
|
-
getSize(): THREE.Vector2;
|
|
3086
|
-
/** {@link Resizeable.resize} */
|
|
3087
|
-
resize: (size?: THREE.Vector2) => void;
|
|
3088
2901
|
/**
|
|
3089
|
-
*
|
|
3090
|
-
*
|
|
3091
|
-
* @
|
|
3092
|
-
*
|
|
3093
|
-
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2902
|
+
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
2903
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2904
|
+
* @returns {void}
|
|
3094
2905
|
*/
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
2906
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2907
|
+
/**
|
|
2908
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2909
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2910
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2911
|
+
* @returns {void}
|
|
2912
|
+
*/
|
|
2913
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2914
|
+
private handleWorkerMessage;
|
|
2915
|
+
private getAvailableMaterial;
|
|
2916
|
+
}
|
|
2917
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2918
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2919
|
+
/**
|
|
2920
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
2921
|
+
*/
|
|
2922
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
2923
|
+
/**
|
|
2924
|
+
* Amount of properties to be streamed.
|
|
2925
|
+
* Defaults to 100 properties.
|
|
2926
|
+
*/
|
|
2927
|
+
propertiesSize: number;
|
|
3100
2928
|
}
|
|
3101
2929
|
import * as THREE from "three";
|
|
3102
2930
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
@@ -3177,133 +3005,205 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
3177
3005
|
/** {@link Disposable.dispose} */
|
|
3178
3006
|
dispose(disposeResources?: boolean): void;
|
|
3179
3007
|
}
|
|
3180
|
-
import
|
|
3008
|
+
import * as THREE from "three";
|
|
3009
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3010
|
+
import { Components } from "../../Components";
|
|
3181
3011
|
/**
|
|
3182
|
-
*
|
|
3012
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
3183
3013
|
*/
|
|
3184
|
-
export
|
|
3014
|
+
export interface SimpleSceneConfig {
|
|
3015
|
+
directionalLight: {
|
|
3016
|
+
color: THREE.Color;
|
|
3017
|
+
intensity: number;
|
|
3018
|
+
position: THREE.Vector3;
|
|
3019
|
+
};
|
|
3020
|
+
ambientLight: {
|
|
3021
|
+
color: THREE.Color;
|
|
3022
|
+
intensity: number;
|
|
3023
|
+
};
|
|
3024
|
+
}
|
|
3025
|
+
/**
|
|
3026
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
3027
|
+
*/
|
|
3028
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3029
|
+
/** {@link Configurable.isSetup} */
|
|
3030
|
+
isSetup: boolean;
|
|
3185
3031
|
/**
|
|
3186
|
-
*
|
|
3187
|
-
*
|
|
3032
|
+
* The underlying Three.js scene object.
|
|
3033
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3188
3034
|
*/
|
|
3189
|
-
|
|
3035
|
+
three: THREE.Scene;
|
|
3036
|
+
/** {@link Configurable.onSetup} */
|
|
3037
|
+
readonly onSetup: Event<SimpleScene>;
|
|
3038
|
+
/**
|
|
3039
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3040
|
+
* Defines properties for directional and ambient lights.
|
|
3041
|
+
*/
|
|
3042
|
+
config: Required<SimpleSceneConfig>;
|
|
3043
|
+
constructor(components: Components);
|
|
3044
|
+
/** {@link Configurable.setup} */
|
|
3045
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3190
3046
|
}
|
|
3191
3047
|
import * as THREE from "three";
|
|
3192
|
-
import {
|
|
3048
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
3193
3049
|
import { Components } from "../../Components";
|
|
3194
3050
|
/**
|
|
3195
|
-
*
|
|
3051
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3196
3052
|
*/
|
|
3197
|
-
export declare class
|
|
3198
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
3199
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
3200
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
3201
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
3202
|
-
/** {@link Disposable.onDisposed} */
|
|
3203
|
-
readonly onDisposed: Event<unknown>;
|
|
3053
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
3204
3054
|
/**
|
|
3205
|
-
*
|
|
3055
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3056
|
+
* Default is 'true'.
|
|
3206
3057
|
*/
|
|
3207
|
-
|
|
3058
|
+
enabled: boolean;
|
|
3208
3059
|
/**
|
|
3209
|
-
* The
|
|
3060
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
3210
3061
|
*/
|
|
3211
|
-
|
|
3062
|
+
container: HTMLElement;
|
|
3212
3063
|
/**
|
|
3213
|
-
* The THREE.js
|
|
3064
|
+
* The THREE.js WebGLRenderer instance.
|
|
3214
3065
|
*/
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
protected _visible: boolean;
|
|
3222
|
-
protected _enabled: boolean;
|
|
3223
|
-
private _controlsActive;
|
|
3224
|
-
private readonly _arrowBoundBox;
|
|
3225
|
-
private readonly _planeMesh;
|
|
3226
|
-
private readonly _controls;
|
|
3227
|
-
private readonly _hiddenMaterial;
|
|
3066
|
+
three: THREE.WebGLRenderer;
|
|
3067
|
+
protected _canvas: HTMLCanvasElement;
|
|
3068
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3069
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
3070
|
+
protected onContainerUpdated: Event<unknown>;
|
|
3071
|
+
private _resizing;
|
|
3228
3072
|
/**
|
|
3229
|
-
*
|
|
3230
|
-
*
|
|
3073
|
+
* Constructor for the SimpleRenderer class.
|
|
3074
|
+
*
|
|
3075
|
+
* @param components - The components instance.
|
|
3076
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3077
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3231
3078
|
*/
|
|
3232
|
-
|
|
3079
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3080
|
+
/** {@link Updateable.update} */
|
|
3081
|
+
update(): void;
|
|
3082
|
+
/** {@link Disposable.dispose} */
|
|
3083
|
+
dispose(): void;
|
|
3084
|
+
/** {@link Resizeable.getSize}. */
|
|
3085
|
+
getSize(): THREE.Vector2;
|
|
3086
|
+
/** {@link Resizeable.resize} */
|
|
3087
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3233
3088
|
/**
|
|
3234
|
-
*
|
|
3235
|
-
*
|
|
3236
|
-
* @param
|
|
3089
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3090
|
+
*
|
|
3091
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3092
|
+
*
|
|
3093
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3237
3094
|
*/
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3095
|
+
setupEvents(active: boolean): void;
|
|
3096
|
+
private resizeEvent;
|
|
3097
|
+
private setupRenderer;
|
|
3098
|
+
private onContextLost;
|
|
3099
|
+
private onContextBack;
|
|
3100
|
+
}
|
|
3101
|
+
import * as THREE from "three";
|
|
3102
|
+
import CameraControls from "camera-controls";
|
|
3103
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3104
|
+
import { Components } from "../../Components";
|
|
3105
|
+
/**
|
|
3106
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
3107
|
+
*/
|
|
3108
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3109
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3110
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3111
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3112
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3253
3113
|
/**
|
|
3254
|
-
*
|
|
3255
|
-
*
|
|
3256
|
-
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
3257
|
-
*
|
|
3258
|
-
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
3114
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3115
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3259
3116
|
*/
|
|
3260
|
-
|
|
3261
|
-
|
|
3117
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
3118
|
+
/** {@link Disposable.onDisposed} */
|
|
3119
|
+
readonly onDisposed: Event<string>;
|
|
3262
3120
|
/**
|
|
3263
|
-
*
|
|
3264
|
-
* This
|
|
3265
|
-
|
|
3121
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3122
|
+
* This camera is used for rendering the scene.
|
|
3123
|
+
*/
|
|
3124
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3125
|
+
private _allControls;
|
|
3126
|
+
/**
|
|
3127
|
+
* The object that controls the camera. An instance of
|
|
3128
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3129
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3130
|
+
* object to move, rotate, look at objects, etc.
|
|
3131
|
+
*/
|
|
3132
|
+
get controls(): CameraControls;
|
|
3133
|
+
/**
|
|
3134
|
+
* Getter for the enabled state of the camera controls.
|
|
3135
|
+
* If the current world is null, it returns false.
|
|
3136
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3266
3137
|
*
|
|
3267
|
-
* @
|
|
3268
|
-
|
|
3138
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3139
|
+
*/
|
|
3140
|
+
get enabled(): boolean;
|
|
3141
|
+
/**
|
|
3142
|
+
* Setter for the enabled state of the camera controls.
|
|
3143
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3269
3144
|
*
|
|
3270
|
-
* @
|
|
3145
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3271
3146
|
*/
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
update: () => void;
|
|
3147
|
+
set enabled(enabled: boolean);
|
|
3148
|
+
constructor(components: Components);
|
|
3275
3149
|
/** {@link Disposable.dispose} */
|
|
3276
3150
|
dispose(): void;
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
private
|
|
3285
|
-
private
|
|
3286
|
-
private
|
|
3151
|
+
/** {@link Updateable.update} */
|
|
3152
|
+
update(_delta: number): void;
|
|
3153
|
+
/**
|
|
3154
|
+
* Updates the aspect of the camera to match the size of the
|
|
3155
|
+
* {@link Components.renderer}.
|
|
3156
|
+
*/
|
|
3157
|
+
updateAspect: () => void;
|
|
3158
|
+
private setupCamera;
|
|
3159
|
+
private newCameraControls;
|
|
3160
|
+
private setupEvents;
|
|
3161
|
+
private static getSubsetOfThree;
|
|
3287
3162
|
}
|
|
3288
|
-
import
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3163
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3164
|
+
/**
|
|
3165
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3166
|
+
*/
|
|
3167
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3168
|
+
/**
|
|
3169
|
+
* Minimum number of geometries to be streamed.
|
|
3170
|
+
* Defaults to 10 geometries.
|
|
3171
|
+
*/
|
|
3172
|
+
minGeometrySize: number;
|
|
3173
|
+
/**
|
|
3174
|
+
* Minimum amount of assets to be streamed.
|
|
3175
|
+
* Defaults to 1000 assets.
|
|
3176
|
+
*/
|
|
3177
|
+
minAssetsSize: number;
|
|
3292
3178
|
}
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
export
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3179
|
+
/**
|
|
3180
|
+
* 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.
|
|
3181
|
+
*/
|
|
3182
|
+
export interface StreamedGeometries {
|
|
3183
|
+
[id: number]: {
|
|
3184
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
3185
|
+
boundingBox: Float32Array;
|
|
3186
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
3187
|
+
hasHoles: boolean;
|
|
3188
|
+
/** An optional file path for the geometry data. */
|
|
3189
|
+
geometryFile?: string;
|
|
3190
|
+
};
|
|
3191
|
+
}
|
|
3192
|
+
/**
|
|
3193
|
+
* 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.
|
|
3194
|
+
*/
|
|
3195
|
+
export interface StreamedAsset {
|
|
3196
|
+
/** The unique identifier of the asset. */
|
|
3197
|
+
id: number;
|
|
3198
|
+
/** An array of geometries associated with the asset. */
|
|
3199
|
+
geometries: {
|
|
3200
|
+
/** The unique identifier of the geometry. */
|
|
3201
|
+
geometryID: number;
|
|
3202
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
3203
|
+
transformation: number[];
|
|
3204
|
+
/** The color of the geometry as a number array. */
|
|
3205
|
+
color: number[];
|
|
3206
|
+
}[];
|
|
3307
3207
|
}
|
|
3308
3208
|
import { NavigationMode } from "./types";
|
|
3309
3209
|
import { OrthoPerspectiveCamera } from "../index";
|
|
@@ -3337,6 +3237,26 @@ export declare class OrbitMode implements NavigationMode {
|
|
|
3337
3237
|
set(active: boolean): void;
|
|
3338
3238
|
private activateOrbitControls;
|
|
3339
3239
|
}
|
|
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
|
+
}
|
|
3340
3260
|
import * as THREE from "three";
|
|
3341
3261
|
import { CameraProjection } from "./types";
|
|
3342
3262
|
import { Event } from "../../Types";
|
|
@@ -3408,25 +3328,122 @@ export interface NavigationMode {
|
|
|
3408
3328
|
/** Whether this navigation mode is active or not. */
|
|
3409
3329
|
enabled: boolean;
|
|
3410
3330
|
}
|
|
3411
|
-
import
|
|
3412
|
-
import
|
|
3331
|
+
import * as THREE from "three";
|
|
3332
|
+
import * as WEBIFC from "web-ifc";
|
|
3333
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3334
|
+
export declare class CivilReader {
|
|
3335
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3336
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3337
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3338
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3339
|
+
} | undefined;
|
|
3340
|
+
get(civilItems: any): {
|
|
3341
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3342
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3343
|
+
} | undefined;
|
|
3344
|
+
private getCurves;
|
|
3345
|
+
}
|
|
3346
|
+
import * as WEBIFC from "web-ifc";
|
|
3347
|
+
export declare class IfcMetadataReader {
|
|
3348
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3349
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3350
|
+
}
|
|
3351
|
+
import * as THREE from "three";
|
|
3352
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3353
|
+
import { Components } from "../../Components";
|
|
3413
3354
|
/**
|
|
3414
|
-
*
|
|
3355
|
+
* Each of the clipping planes created by the clipper.
|
|
3415
3356
|
*/
|
|
3416
|
-
export declare class
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3357
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
3358
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
3359
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
3360
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
3361
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
3362
|
+
/** {@link Disposable.onDisposed} */
|
|
3363
|
+
readonly onDisposed: Event<unknown>;
|
|
3364
|
+
/**
|
|
3365
|
+
* The normal vector of the clipping plane.
|
|
3366
|
+
*/
|
|
3367
|
+
readonly normal: THREE.Vector3;
|
|
3368
|
+
/**
|
|
3369
|
+
* The origin point of the clipping plane.
|
|
3370
|
+
*/
|
|
3371
|
+
readonly origin: THREE.Vector3;
|
|
3372
|
+
/**
|
|
3373
|
+
* The THREE.js Plane object representing the clipping plane.
|
|
3374
|
+
*/
|
|
3375
|
+
readonly three: THREE.Plane;
|
|
3376
|
+
/** The components instance to which this plane belongs. */
|
|
3377
|
+
components: Components;
|
|
3378
|
+
/** The world instance to which this plane belongs. */
|
|
3379
|
+
world: World;
|
|
3380
|
+
protected readonly _helper: THREE.Object3D;
|
|
3381
|
+
protected _visible: boolean;
|
|
3382
|
+
protected _enabled: boolean;
|
|
3383
|
+
private _controlsActive;
|
|
3384
|
+
private readonly _arrowBoundBox;
|
|
3385
|
+
private readonly _planeMesh;
|
|
3386
|
+
private readonly _controls;
|
|
3387
|
+
private readonly _hiddenMaterial;
|
|
3388
|
+
/**
|
|
3389
|
+
* Getter for the enabled state of the clipping plane.
|
|
3390
|
+
* @returns {boolean} The current enabled state.
|
|
3391
|
+
*/
|
|
3392
|
+
get enabled(): boolean;
|
|
3393
|
+
/**
|
|
3394
|
+
* Setter for the enabled state of the clipping plane.
|
|
3395
|
+
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
3396
|
+
* @param {boolean} state - The new enabled state.
|
|
3397
|
+
*/
|
|
3398
|
+
set enabled(state: boolean);
|
|
3399
|
+
/** {@link Hideable.visible } */
|
|
3400
|
+
get visible(): boolean;
|
|
3401
|
+
/** {@link Hideable.visible } */
|
|
3402
|
+
set visible(state: boolean);
|
|
3403
|
+
/** The meshes used for raycasting */
|
|
3404
|
+
get meshes(): THREE.Mesh[];
|
|
3405
|
+
/** The material of the clipping plane representation. */
|
|
3406
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
3407
|
+
/** The material of the clipping plane representation. */
|
|
3408
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
3409
|
+
/** The size of the clipping plane representation. */
|
|
3410
|
+
get size(): number;
|
|
3411
|
+
/** Sets the size of the clipping plane representation. */
|
|
3412
|
+
set size(size: number);
|
|
3413
|
+
/**
|
|
3414
|
+
* Getter for the helper object of the clipping plane.
|
|
3415
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
3416
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
3417
|
+
*
|
|
3418
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
3419
|
+
*/
|
|
3420
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3421
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
3422
|
+
/**
|
|
3423
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
3424
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
3425
|
+
* and positions the helper object accordingly.
|
|
3426
|
+
*
|
|
3427
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
3428
|
+
* @param point - The new origin point for the clipping plane.
|
|
3429
|
+
*
|
|
3430
|
+
* @returns {void}
|
|
3431
|
+
*/
|
|
3432
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
3433
|
+
/** {@link Updateable.update} */
|
|
3434
|
+
update: () => void;
|
|
3435
|
+
/** {@link Disposable.dispose} */
|
|
3436
|
+
dispose(): void;
|
|
3437
|
+
private reset;
|
|
3438
|
+
protected toggleControls(state: boolean): void;
|
|
3439
|
+
private newTransformControls;
|
|
3440
|
+
private initializeControls;
|
|
3441
|
+
private createArrowBoundingBox;
|
|
3442
|
+
private changeDrag;
|
|
3443
|
+
private notifyDraggingChanged;
|
|
3444
|
+
private preventCameraMovement;
|
|
3445
|
+
private newHelper;
|
|
3446
|
+
private static newPlaneMesh;
|
|
3430
3447
|
}
|
|
3431
3448
|
import * as WEBIFC from "web-ifc";
|
|
3432
3449
|
import * as THREE from "three";
|
|
@@ -3438,11 +3455,6 @@ export declare class Units {
|
|
|
3438
3455
|
private getLengthUnits;
|
|
3439
3456
|
private getScaleMatrix;
|
|
3440
3457
|
}
|
|
3441
|
-
import { BufferGeometry } from "three";
|
|
3442
|
-
import * as THREE from "three";
|
|
3443
|
-
export declare class TransformHelper {
|
|
3444
|
-
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3445
|
-
}
|
|
3446
3458
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3447
3459
|
export interface ModelsRelationMap {
|
|
3448
3460
|
[modelID: string]: RelationsMap;
|
|
@@ -3467,5 +3479,10 @@ export type InverseAttributes = [
|
|
|
3467
3479
|
"ContainsElements"
|
|
3468
3480
|
];
|
|
3469
3481
|
export type InverseAttribute = InverseAttributes[number];
|
|
3482
|
+
import { BufferGeometry } from "three";
|
|
3483
|
+
import * as THREE from "three";
|
|
3484
|
+
export declare class TransformHelper {
|
|
3485
|
+
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3486
|
+
}
|
|
3470
3487
|
|
|
3471
3488
|
}
|