@thatopen/components 2.2.5 → 2.2.6
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/ifc/IfcPropertiesManager/index.d.ts +19 -1
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +3 -0
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +7 -0
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +3 -0
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +18 -0
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +33 -3
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +2 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +4 -2
- package/dist/index.cjs +28 -28
- package/dist/index.mjs +8082 -7902
- package/dist/namespace.d.ts +1571 -1495
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class Components implements Disposable {
|
|
|
7
7
|
/**
|
|
8
8
|
* The version of the @thatopen/components library.
|
|
9
9
|
*/
|
|
10
|
-
static readonly release = "2.2.
|
|
10
|
+
static readonly release = "2.2.6";
|
|
11
11
|
/** {@link Disposable.onDisposed} */
|
|
12
12
|
readonly onDisposed: Event<void>;
|
|
13
13
|
/**
|
|
@@ -75,48 +75,6 @@ export declare class Components implements Disposable {
|
|
|
75
75
|
private update;
|
|
76
76
|
private static setupBVH;
|
|
77
77
|
}
|
|
78
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
79
|
-
import { SimpleRaycaster } from "./src";
|
|
80
|
-
import { Components } from "../Components";
|
|
81
|
-
/**
|
|
82
|
-
* 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).
|
|
83
|
-
*/
|
|
84
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
85
|
-
/**
|
|
86
|
-
* A unique identifier for the component.
|
|
87
|
-
* This UUID is used to register the component within the Components system.
|
|
88
|
-
*/
|
|
89
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
90
|
-
/** {@link Component.enabled} */
|
|
91
|
-
enabled: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* A Map that stores raycasters for each world.
|
|
94
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
95
|
-
*/
|
|
96
|
-
list: Map<string, SimpleRaycaster>;
|
|
97
|
-
/** {@link Disposable.onDisposed} */
|
|
98
|
-
onDisposed: Event<unknown>;
|
|
99
|
-
constructor(components: Components);
|
|
100
|
-
/**
|
|
101
|
-
* Retrieves a SimpleRaycaster instance for the given world.
|
|
102
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
103
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
104
|
-
*
|
|
105
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
106
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
107
|
-
*/
|
|
108
|
-
get(world: World): SimpleRaycaster;
|
|
109
|
-
/**
|
|
110
|
-
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
111
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
112
|
-
*
|
|
113
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
114
|
-
* @returns {void}
|
|
115
|
-
*/
|
|
116
|
-
delete(world: World): void;
|
|
117
|
-
/** {@link Disposable.dispose} */
|
|
118
|
-
dispose(): void;
|
|
119
|
-
}
|
|
120
78
|
import * as THREE from "three";
|
|
121
79
|
import { Components } from "../Components";
|
|
122
80
|
import { Component } from "../Types";
|
|
@@ -221,6 +179,164 @@ export declare class ShadowedScene extends SimpleScene implements Disposable {
|
|
|
221
179
|
updateShadows(): Promise<void>;
|
|
222
180
|
private recomputeShadows;
|
|
223
181
|
}
|
|
182
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
183
|
+
import { SimpleRaycaster } from "./src";
|
|
184
|
+
import { Components } from "../Components";
|
|
185
|
+
/**
|
|
186
|
+
* 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).
|
|
187
|
+
*/
|
|
188
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
189
|
+
/**
|
|
190
|
+
* A unique identifier for the component.
|
|
191
|
+
* This UUID is used to register the component within the Components system.
|
|
192
|
+
*/
|
|
193
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
194
|
+
/** {@link Component.enabled} */
|
|
195
|
+
enabled: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* A Map that stores raycasters for each world.
|
|
198
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
199
|
+
*/
|
|
200
|
+
list: Map<string, SimpleRaycaster>;
|
|
201
|
+
/** {@link Disposable.onDisposed} */
|
|
202
|
+
onDisposed: Event<unknown>;
|
|
203
|
+
constructor(components: Components);
|
|
204
|
+
/**
|
|
205
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
206
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
207
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
208
|
+
*
|
|
209
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
210
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
211
|
+
*/
|
|
212
|
+
get(world: World): SimpleRaycaster;
|
|
213
|
+
/**
|
|
214
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
215
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
216
|
+
*
|
|
217
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
218
|
+
* @returns {void}
|
|
219
|
+
*/
|
|
220
|
+
delete(world: World): void;
|
|
221
|
+
/** {@link Disposable.dispose} */
|
|
222
|
+
dispose(): void;
|
|
223
|
+
}
|
|
224
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
225
|
+
import { Components } from "../Components";
|
|
226
|
+
import { SimpleWorld } from "./src";
|
|
227
|
+
/**
|
|
228
|
+
* 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).
|
|
229
|
+
*/
|
|
230
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
231
|
+
/**
|
|
232
|
+
* A unique identifier for the component.
|
|
233
|
+
* This UUID is used to register the component within the Components system.
|
|
234
|
+
*/
|
|
235
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
236
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
237
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
238
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
239
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
240
|
+
/** {@link Disposable.onDisposed} */
|
|
241
|
+
readonly onDisposed: Event<unknown>;
|
|
242
|
+
/**
|
|
243
|
+
* An event that is triggered when a new world is created.
|
|
244
|
+
* The event passes the newly created world as a parameter.
|
|
245
|
+
*/
|
|
246
|
+
readonly onWorldCreated: Event<World>;
|
|
247
|
+
/**
|
|
248
|
+
* An event that is triggered when a world is deleted.
|
|
249
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
250
|
+
*/
|
|
251
|
+
readonly onWorldDeleted: Event<string>;
|
|
252
|
+
/**
|
|
253
|
+
* A collection of worlds managed by this component.
|
|
254
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
255
|
+
*/
|
|
256
|
+
list: Map<string, World>;
|
|
257
|
+
/** {@link Component.enabled} */
|
|
258
|
+
enabled: boolean;
|
|
259
|
+
constructor(components: Components);
|
|
260
|
+
/**
|
|
261
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
262
|
+
*
|
|
263
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
264
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
265
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
266
|
+
*
|
|
267
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
268
|
+
*/
|
|
269
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
270
|
+
/**
|
|
271
|
+
* Deletes a world from the list of worlds.
|
|
272
|
+
*
|
|
273
|
+
* @param {World} world - The world to be deleted.
|
|
274
|
+
*
|
|
275
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
276
|
+
*
|
|
277
|
+
* @returns {void}
|
|
278
|
+
*/
|
|
279
|
+
delete(world: World): void;
|
|
280
|
+
/**
|
|
281
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
282
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
283
|
+
* and triggers the onDisposed event.
|
|
284
|
+
*
|
|
285
|
+
* @returns {void}
|
|
286
|
+
*/
|
|
287
|
+
dispose(): void;
|
|
288
|
+
/** {@link Updateable.update} */
|
|
289
|
+
update(delta?: number): void | Promise<void>;
|
|
290
|
+
}
|
|
291
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
292
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
293
|
+
import { Components } from "../Components";
|
|
294
|
+
/**
|
|
295
|
+
* 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).
|
|
296
|
+
*/
|
|
297
|
+
export declare class Grids extends Component implements Disposable {
|
|
298
|
+
/**
|
|
299
|
+
* A unique identifier for the component.
|
|
300
|
+
* This UUID is used to register the component within the Components system.
|
|
301
|
+
*/
|
|
302
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
303
|
+
/**
|
|
304
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
305
|
+
*/
|
|
306
|
+
list: Map<string, SimpleGrid>;
|
|
307
|
+
/**
|
|
308
|
+
* The default configuration for grid creation.
|
|
309
|
+
*/
|
|
310
|
+
config: Required<GridConfig>;
|
|
311
|
+
/** {@link Disposable.onDisposed} */
|
|
312
|
+
readonly onDisposed: Event<unknown>;
|
|
313
|
+
/** {@link Component.enabled} */
|
|
314
|
+
enabled: boolean;
|
|
315
|
+
constructor(components: Components);
|
|
316
|
+
/**
|
|
317
|
+
* Creates a new grid for the given world.
|
|
318
|
+
* Throws an error if a grid already exists for the world.
|
|
319
|
+
*
|
|
320
|
+
* @param world - The world to create the grid for.
|
|
321
|
+
* @returns The newly created grid.
|
|
322
|
+
*
|
|
323
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
324
|
+
*/
|
|
325
|
+
create(world: World): SimpleGrid;
|
|
326
|
+
/**
|
|
327
|
+
* Deletes the grid associated with the given world.
|
|
328
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
329
|
+
*
|
|
330
|
+
* @param world - The world for which to delete the grid.
|
|
331
|
+
*
|
|
332
|
+
* @remarks
|
|
333
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
334
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
335
|
+
*/
|
|
336
|
+
delete(world: World): void;
|
|
337
|
+
/** {@link Disposable.dispose} */
|
|
338
|
+
dispose(): void;
|
|
339
|
+
}
|
|
224
340
|
import * as THREE from "three";
|
|
225
341
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
226
342
|
import { SimplePlane } from "./src";
|
|
@@ -352,54 +468,98 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
352
468
|
private _onStartDragging;
|
|
353
469
|
private _onEndDragging;
|
|
354
470
|
}
|
|
355
|
-
import { Component, Disposable,
|
|
356
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
471
|
+
import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
|
|
357
472
|
import { Components } from "../Components";
|
|
473
|
+
import { BCFViewpoint, Viewpoint } from "./src";
|
|
358
474
|
/**
|
|
359
|
-
*
|
|
475
|
+
* Configuration interface for the Viewpoints general behavior.
|
|
360
476
|
*/
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* A unique identifier for the component.
|
|
364
|
-
* This UUID is used to register the component within the Components system.
|
|
365
|
-
*/
|
|
366
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
477
|
+
interface ViewpointsConfig {
|
|
367
478
|
/**
|
|
368
|
-
*
|
|
479
|
+
* Indicates whether to overwrite the fragments colors when applying viewpoints.
|
|
480
|
+
* @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
|
|
481
|
+
* @default false
|
|
369
482
|
*/
|
|
370
|
-
|
|
483
|
+
overwriteColors: boolean;
|
|
484
|
+
}
|
|
485
|
+
export declare class Viewpoints extends Component implements Disposable, Configurable<ViewpointsConfig> {
|
|
486
|
+
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
487
|
+
enabled: boolean;
|
|
371
488
|
/**
|
|
372
|
-
*
|
|
489
|
+
* A DataMap that stores Viewpoint instances, indexed by their unique identifiers (guid).
|
|
490
|
+
* This map is used to manage and retrieve Viewpoint instances within the Viewpoints component.
|
|
373
491
|
*/
|
|
374
|
-
|
|
375
|
-
/** {@link Disposable.onDisposed} */
|
|
376
|
-
readonly onDisposed: Event<unknown>;
|
|
377
|
-
/** {@link Component.enabled} */
|
|
378
|
-
enabled: boolean;
|
|
379
|
-
constructor(components: Components);
|
|
492
|
+
readonly list: DataMap<string, Viewpoint>;
|
|
380
493
|
/**
|
|
381
|
-
* Creates a new
|
|
382
|
-
* Throws an error if a grid already exists for the world.
|
|
494
|
+
* Creates a new Viewpoint instance and adds it to the list.
|
|
383
495
|
*
|
|
384
|
-
* @param world - The world
|
|
385
|
-
* @
|
|
496
|
+
* @param world - The world in which the Viewpoint will be created.
|
|
497
|
+
* @param data - Optional partial data for the Viewpoint. If not provided, default data will be used.
|
|
386
498
|
*
|
|
387
|
-
* @
|
|
499
|
+
* @returns The newly created Viewpoint instance.
|
|
388
500
|
*/
|
|
389
|
-
create(world: World):
|
|
501
|
+
create(world: World, data?: Partial<BCFViewpoint>): Viewpoint;
|
|
502
|
+
constructor(components: Components);
|
|
503
|
+
isSetup: boolean;
|
|
504
|
+
setup(): void;
|
|
505
|
+
onSetup: Event<unknown>;
|
|
506
|
+
config: Required<ViewpointsConfig>;
|
|
507
|
+
readonly onDisposed: Event<unknown>;
|
|
390
508
|
/**
|
|
391
|
-
*
|
|
392
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
393
|
-
*
|
|
394
|
-
* @param world - The world for which to delete the grid.
|
|
509
|
+
* Disposes of the Viewpoints component and its associated resources.
|
|
395
510
|
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
511
|
+
* This method is responsible for cleaning up any resources held by the Viewpoints component,
|
|
512
|
+
* such as disposing of the DataMap of Viewpoint instances and triggering and resetting the
|
|
513
|
+
* onDisposed event.
|
|
399
514
|
*/
|
|
400
|
-
|
|
515
|
+
dispose(): void;
|
|
516
|
+
}
|
|
517
|
+
import { MiniMap } from "./src";
|
|
518
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
519
|
+
import { Components } from "../Components";
|
|
520
|
+
/**
|
|
521
|
+
* 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).
|
|
522
|
+
*/
|
|
523
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
524
|
+
/**
|
|
525
|
+
* A unique identifier for the component.
|
|
526
|
+
* This UUID is used to register the component within the Components system.
|
|
527
|
+
*/
|
|
528
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
529
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
530
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
531
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
532
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
533
|
+
/** {@link Disposable.onDisposed} */
|
|
534
|
+
readonly onDisposed: Event<unknown>;
|
|
535
|
+
/** {@link Component.enabled} */
|
|
536
|
+
enabled: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
539
|
+
*/
|
|
540
|
+
list: Map<string, MiniMap>;
|
|
541
|
+
constructor(components: Components);
|
|
542
|
+
/**
|
|
543
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
544
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
545
|
+
*
|
|
546
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
547
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
548
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
549
|
+
*/
|
|
550
|
+
create(world: World): MiniMap;
|
|
551
|
+
/**
|
|
552
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
553
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
554
|
+
*
|
|
555
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
556
|
+
* @returns {void}
|
|
557
|
+
*/
|
|
558
|
+
delete(id: string): void;
|
|
401
559
|
/** {@link Disposable.dispose} */
|
|
402
560
|
dispose(): void;
|
|
561
|
+
/** {@link Updateable.update} */
|
|
562
|
+
update(): void;
|
|
403
563
|
}
|
|
404
564
|
import * as THREE from "three";
|
|
405
565
|
import { Components } from "../Components";
|
|
@@ -458,119 +618,6 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
458
618
|
*/
|
|
459
619
|
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
460
620
|
}
|
|
461
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
462
|
-
import { Components } from "../Components";
|
|
463
|
-
import { SimpleWorld } from "./src";
|
|
464
|
-
/**
|
|
465
|
-
* 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).
|
|
466
|
-
*/
|
|
467
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
468
|
-
/**
|
|
469
|
-
* A unique identifier for the component.
|
|
470
|
-
* This UUID is used to register the component within the Components system.
|
|
471
|
-
*/
|
|
472
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
473
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
474
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
475
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
476
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
477
|
-
/** {@link Disposable.onDisposed} */
|
|
478
|
-
readonly onDisposed: Event<unknown>;
|
|
479
|
-
/**
|
|
480
|
-
* An event that is triggered when a new world is created.
|
|
481
|
-
* The event passes the newly created world as a parameter.
|
|
482
|
-
*/
|
|
483
|
-
readonly onWorldCreated: Event<World>;
|
|
484
|
-
/**
|
|
485
|
-
* An event that is triggered when a world is deleted.
|
|
486
|
-
* The event passes the UUID of the deleted world as a parameter.
|
|
487
|
-
*/
|
|
488
|
-
readonly onWorldDeleted: Event<string>;
|
|
489
|
-
/**
|
|
490
|
-
* A collection of worlds managed by this component.
|
|
491
|
-
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
492
|
-
*/
|
|
493
|
-
list: Map<string, World>;
|
|
494
|
-
/** {@link Component.enabled} */
|
|
495
|
-
enabled: boolean;
|
|
496
|
-
constructor(components: Components);
|
|
497
|
-
/**
|
|
498
|
-
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
499
|
-
*
|
|
500
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
501
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
502
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
503
|
-
*
|
|
504
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
505
|
-
*/
|
|
506
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
507
|
-
/**
|
|
508
|
-
* Deletes a world from the list of worlds.
|
|
509
|
-
*
|
|
510
|
-
* @param {World} world - The world to be deleted.
|
|
511
|
-
*
|
|
512
|
-
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
513
|
-
*
|
|
514
|
-
* @returns {void}
|
|
515
|
-
*/
|
|
516
|
-
delete(world: World): void;
|
|
517
|
-
/**
|
|
518
|
-
* Disposes of the Worlds component and all its managed worlds.
|
|
519
|
-
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
520
|
-
* and triggers the onDisposed event.
|
|
521
|
-
*
|
|
522
|
-
* @returns {void}
|
|
523
|
-
*/
|
|
524
|
-
dispose(): void;
|
|
525
|
-
/** {@link Updateable.update} */
|
|
526
|
-
update(delta?: number): void | Promise<void>;
|
|
527
|
-
}
|
|
528
|
-
import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
|
|
529
|
-
import { Components } from "../Components";
|
|
530
|
-
import { BCFViewpoint, Viewpoint } from "./src";
|
|
531
|
-
/**
|
|
532
|
-
* Configuration interface for the Viewpoints general behavior.
|
|
533
|
-
*/
|
|
534
|
-
interface ViewpointsConfig {
|
|
535
|
-
/**
|
|
536
|
-
* Indicates whether to overwrite the fragments colors when applying viewpoints.
|
|
537
|
-
* @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
|
|
538
|
-
* @default false
|
|
539
|
-
*/
|
|
540
|
-
overwriteColors: boolean;
|
|
541
|
-
}
|
|
542
|
-
export declare class Viewpoints extends Component implements Disposable, Configurable<ViewpointsConfig> {
|
|
543
|
-
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
544
|
-
enabled: boolean;
|
|
545
|
-
/**
|
|
546
|
-
* A DataMap that stores Viewpoint instances, indexed by their unique identifiers (guid).
|
|
547
|
-
* This map is used to manage and retrieve Viewpoint instances within the Viewpoints component.
|
|
548
|
-
*/
|
|
549
|
-
readonly list: DataMap<string, Viewpoint>;
|
|
550
|
-
/**
|
|
551
|
-
* Creates a new Viewpoint instance and adds it to the list.
|
|
552
|
-
*
|
|
553
|
-
* @param world - The world in which the Viewpoint will be created.
|
|
554
|
-
* @param data - Optional partial data for the Viewpoint. If not provided, default data will be used.
|
|
555
|
-
*
|
|
556
|
-
* @returns The newly created Viewpoint instance.
|
|
557
|
-
*/
|
|
558
|
-
create(world: World, data?: Partial<BCFViewpoint>): Viewpoint;
|
|
559
|
-
constructor(components: Components);
|
|
560
|
-
isSetup: boolean;
|
|
561
|
-
setup(): void;
|
|
562
|
-
onSetup: Event<unknown>;
|
|
563
|
-
config: Required<ViewpointsConfig>;
|
|
564
|
-
readonly onDisposed: Event<unknown>;
|
|
565
|
-
/**
|
|
566
|
-
* Disposes of the Viewpoints component and its associated resources.
|
|
567
|
-
*
|
|
568
|
-
* This method is responsible for cleaning up any resources held by the Viewpoints component,
|
|
569
|
-
* such as disposing of the DataMap of Viewpoint instances and triggering and resetting the
|
|
570
|
-
* onDisposed event.
|
|
571
|
-
*/
|
|
572
|
-
dispose(): void;
|
|
573
|
-
}
|
|
574
621
|
import * as THREE from "three";
|
|
575
622
|
import { Components } from "../Components";
|
|
576
623
|
import { SimpleCamera } from "..";
|
|
@@ -635,53 +682,6 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
635
682
|
private newOrthoCamera;
|
|
636
683
|
private setOrthoPerspCameraAspect;
|
|
637
684
|
}
|
|
638
|
-
import { MiniMap } from "./src";
|
|
639
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
640
|
-
import { Components } from "../Components";
|
|
641
|
-
/**
|
|
642
|
-
* 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).
|
|
643
|
-
*/
|
|
644
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
645
|
-
/**
|
|
646
|
-
* A unique identifier for the component.
|
|
647
|
-
* This UUID is used to register the component within the Components system.
|
|
648
|
-
*/
|
|
649
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
650
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
651
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
652
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
653
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
654
|
-
/** {@link Disposable.onDisposed} */
|
|
655
|
-
readonly onDisposed: Event<unknown>;
|
|
656
|
-
/** {@link Component.enabled} */
|
|
657
|
-
enabled: boolean;
|
|
658
|
-
/**
|
|
659
|
-
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
660
|
-
*/
|
|
661
|
-
list: Map<string, MiniMap>;
|
|
662
|
-
constructor(components: Components);
|
|
663
|
-
/**
|
|
664
|
-
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
665
|
-
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
666
|
-
*
|
|
667
|
-
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
668
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
669
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
670
|
-
*/
|
|
671
|
-
create(world: World): MiniMap;
|
|
672
|
-
/**
|
|
673
|
-
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
674
|
-
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
675
|
-
*
|
|
676
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
677
|
-
* @returns {void}
|
|
678
|
-
*/
|
|
679
|
-
delete(id: string): void;
|
|
680
|
-
/** {@link Disposable.dispose} */
|
|
681
|
-
dispose(): void;
|
|
682
|
-
/** {@link Updateable.update} */
|
|
683
|
-
update(): void;
|
|
684
|
-
}
|
|
685
685
|
import * as THREE from "three";
|
|
686
686
|
import * as FRAGS from "@thatopen/fragments";
|
|
687
687
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
@@ -890,51 +890,139 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
890
890
|
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
891
891
|
private static getFragmentBounds;
|
|
892
892
|
}
|
|
893
|
-
import
|
|
894
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
895
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
896
|
-
/**
|
|
897
|
-
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
|
|
898
|
-
*/
|
|
899
|
-
export interface Classification {
|
|
900
|
-
/**
|
|
901
|
-
* A system within the classification.
|
|
902
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
903
|
-
*/
|
|
904
|
-
[system: string]: {
|
|
905
|
-
/**
|
|
906
|
-
* A class within the system.
|
|
907
|
-
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
908
|
-
*/
|
|
909
|
-
[className: string]: {
|
|
910
|
-
map: FRAGS.FragmentIdMap;
|
|
911
|
-
name: string;
|
|
912
|
-
id: number | null;
|
|
913
|
-
};
|
|
914
|
-
};
|
|
915
|
-
}
|
|
893
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
916
894
|
/**
|
|
917
|
-
* The
|
|
895
|
+
* 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).
|
|
918
896
|
*/
|
|
919
|
-
export declare class
|
|
897
|
+
export declare class Exploder extends Component implements Disposable {
|
|
920
898
|
/**
|
|
921
899
|
* A unique identifier for the component.
|
|
922
900
|
* This UUID is used to register the component within the Components system.
|
|
923
901
|
*/
|
|
924
|
-
static readonly uuid: "
|
|
902
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
903
|
+
/** {@link Disposable.onDisposed} */
|
|
904
|
+
readonly onDisposed: Event<unknown>;
|
|
925
905
|
/** {@link Component.enabled} */
|
|
926
906
|
enabled: boolean;
|
|
927
907
|
/**
|
|
928
|
-
*
|
|
929
|
-
*
|
|
908
|
+
* The height of the explosion animation.
|
|
909
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
910
|
+
* Default value is 10.
|
|
930
911
|
*/
|
|
931
|
-
|
|
932
|
-
/**
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
912
|
+
height: number;
|
|
913
|
+
/**
|
|
914
|
+
* The group name used for the explosion animation.
|
|
915
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
916
|
+
* Default value is "storeys".
|
|
917
|
+
*/
|
|
918
|
+
groupName: string;
|
|
919
|
+
/**
|
|
920
|
+
* A set of strings representing the exploded items.
|
|
921
|
+
* This set is used to keep track of which items have been exploded.
|
|
922
|
+
*/
|
|
923
|
+
list: Set<string>;
|
|
924
|
+
constructor(components: Components);
|
|
925
|
+
/** {@link Disposable.dispose} */
|
|
926
|
+
dispose(): void;
|
|
927
|
+
/**
|
|
928
|
+
* Sets the explosion state of the fragments.
|
|
929
|
+
*
|
|
930
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
931
|
+
*
|
|
932
|
+
* @remarks
|
|
933
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
934
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
935
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
936
|
+
*
|
|
937
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
938
|
+
*
|
|
939
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
940
|
+
*/
|
|
941
|
+
set(active: boolean): void;
|
|
942
|
+
}
|
|
943
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
944
|
+
import { Components, Component } from "../../core";
|
|
945
|
+
/**
|
|
946
|
+
* 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).
|
|
947
|
+
*/
|
|
948
|
+
export declare class Hider extends Component {
|
|
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: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
954
|
+
/** {@link Component.enabled} */
|
|
955
|
+
enabled: boolean;
|
|
956
|
+
constructor(components: Components);
|
|
957
|
+
/**
|
|
958
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
959
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
960
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
961
|
+
*
|
|
962
|
+
* @param visible - The visibility state to set for the fragments.
|
|
963
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
964
|
+
* If not provided, all fragments will be affected.
|
|
965
|
+
*
|
|
966
|
+
* @returns {void}
|
|
967
|
+
*/
|
|
968
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
969
|
+
/**
|
|
970
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
971
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
972
|
+
*
|
|
973
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
974
|
+
* If not provided, all fragments will be isolated.
|
|
975
|
+
*
|
|
976
|
+
* @returns {void}
|
|
977
|
+
*/
|
|
978
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
979
|
+
private updateCulledVisibility;
|
|
980
|
+
}
|
|
981
|
+
import * as THREE from "three";
|
|
982
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
983
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
984
|
+
/**
|
|
985
|
+
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
|
|
986
|
+
*/
|
|
987
|
+
export interface Classification {
|
|
988
|
+
/**
|
|
989
|
+
* A system within the classification.
|
|
990
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
991
|
+
*/
|
|
992
|
+
[system: string]: {
|
|
993
|
+
/**
|
|
994
|
+
* A class within the system.
|
|
995
|
+
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
996
|
+
*/
|
|
997
|
+
[className: string]: {
|
|
998
|
+
map: FRAGS.FragmentIdMap;
|
|
999
|
+
name: string;
|
|
1000
|
+
id: number | null;
|
|
1001
|
+
};
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* 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).
|
|
1006
|
+
*/
|
|
1007
|
+
export declare class Classifier extends Component implements Disposable {
|
|
1008
|
+
/**
|
|
1009
|
+
* A unique identifier for the component.
|
|
1010
|
+
* This UUID is used to register the component within the Components system.
|
|
1011
|
+
*/
|
|
1012
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
1013
|
+
/** {@link Component.enabled} */
|
|
1014
|
+
enabled: boolean;
|
|
1015
|
+
/**
|
|
1016
|
+
* A map representing the classification systems.
|
|
1017
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
1018
|
+
*/
|
|
1019
|
+
list: Classification;
|
|
1020
|
+
/** {@link Disposable.onDisposed} */
|
|
1021
|
+
readonly onDisposed: Event<unknown>;
|
|
1022
|
+
constructor(components: Components);
|
|
1023
|
+
private onFragmentsDisposed;
|
|
1024
|
+
/** {@link Disposable.dispose} */
|
|
1025
|
+
dispose(): void;
|
|
938
1026
|
/**
|
|
939
1027
|
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
940
1028
|
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
@@ -1064,94 +1152,6 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
1064
1152
|
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1065
1153
|
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
1066
1154
|
}
|
|
1067
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1068
|
-
/**
|
|
1069
|
-
* 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).
|
|
1070
|
-
*/
|
|
1071
|
-
export declare class Exploder extends Component implements Disposable {
|
|
1072
|
-
/**
|
|
1073
|
-
* A unique identifier for the component.
|
|
1074
|
-
* This UUID is used to register the component within the Components system.
|
|
1075
|
-
*/
|
|
1076
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1077
|
-
/** {@link Disposable.onDisposed} */
|
|
1078
|
-
readonly onDisposed: Event<unknown>;
|
|
1079
|
-
/** {@link Component.enabled} */
|
|
1080
|
-
enabled: boolean;
|
|
1081
|
-
/**
|
|
1082
|
-
* The height of the explosion animation.
|
|
1083
|
-
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1084
|
-
* Default value is 10.
|
|
1085
|
-
*/
|
|
1086
|
-
height: number;
|
|
1087
|
-
/**
|
|
1088
|
-
* The group name used for the explosion animation.
|
|
1089
|
-
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1090
|
-
* Default value is "storeys".
|
|
1091
|
-
*/
|
|
1092
|
-
groupName: string;
|
|
1093
|
-
/**
|
|
1094
|
-
* A set of strings representing the exploded items.
|
|
1095
|
-
* This set is used to keep track of which items have been exploded.
|
|
1096
|
-
*/
|
|
1097
|
-
list: Set<string>;
|
|
1098
|
-
constructor(components: Components);
|
|
1099
|
-
/** {@link Disposable.dispose} */
|
|
1100
|
-
dispose(): void;
|
|
1101
|
-
/**
|
|
1102
|
-
* Sets the explosion state of the fragments.
|
|
1103
|
-
*
|
|
1104
|
-
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1105
|
-
*
|
|
1106
|
-
* @remarks
|
|
1107
|
-
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1108
|
-
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1109
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
1110
|
-
*
|
|
1111
|
-
* The method also keeps track of the exploded items using the 'list' set.
|
|
1112
|
-
*
|
|
1113
|
-
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1114
|
-
*/
|
|
1115
|
-
set(active: boolean): void;
|
|
1116
|
-
}
|
|
1117
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1118
|
-
import { Components, Component } from "../../core";
|
|
1119
|
-
/**
|
|
1120
|
-
* 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).
|
|
1121
|
-
*/
|
|
1122
|
-
export declare class Hider extends Component {
|
|
1123
|
-
/**
|
|
1124
|
-
* A unique identifier for the component.
|
|
1125
|
-
* This UUID is used to register the component within the Components system.
|
|
1126
|
-
*/
|
|
1127
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1128
|
-
/** {@link Component.enabled} */
|
|
1129
|
-
enabled: boolean;
|
|
1130
|
-
constructor(components: Components);
|
|
1131
|
-
/**
|
|
1132
|
-
* Sets the visibility of fragments within the 3D scene.
|
|
1133
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1134
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1135
|
-
*
|
|
1136
|
-
* @param visible - The visibility state to set for the fragments.
|
|
1137
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1138
|
-
* If not provided, all fragments will be affected.
|
|
1139
|
-
*
|
|
1140
|
-
* @returns {void}
|
|
1141
|
-
*/
|
|
1142
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1143
|
-
/**
|
|
1144
|
-
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1145
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1146
|
-
*
|
|
1147
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1148
|
-
* If not provided, all fragments will be isolated.
|
|
1149
|
-
*
|
|
1150
|
-
* @returns {void}
|
|
1151
|
-
*/
|
|
1152
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1153
|
-
private updateCulledVisibility;
|
|
1154
|
-
}
|
|
1155
1155
|
import * as WEBIFC from "web-ifc";
|
|
1156
1156
|
import * as FRAGS from "@thatopen/fragments";
|
|
1157
1157
|
import { IfcFragmentSettings } from "./src";
|
|
@@ -1267,6 +1267,7 @@ export declare class IfcLoader extends Component implements Disposable {
|
|
|
1267
1267
|
private getGeometry;
|
|
1268
1268
|
private autoSetWasm;
|
|
1269
1269
|
}
|
|
1270
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1270
1271
|
import * as THREE from "three";
|
|
1271
1272
|
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1272
1273
|
center: THREE.Vector3;
|
|
@@ -1274,7 +1275,6 @@ export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
|
1274
1275
|
rotation: THREE.Matrix3;
|
|
1275
1276
|
transformation: THREE.Matrix4;
|
|
1276
1277
|
};
|
|
1277
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1278
1278
|
import * as THREE from "three";
|
|
1279
1279
|
export declare class MaterialsUtils {
|
|
1280
1280
|
static isTransparent(material: THREE.Material): boolean;
|
|
@@ -1586,219 +1586,259 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
1586
1586
|
private streamAllProperties;
|
|
1587
1587
|
private cleanUp;
|
|
1588
1588
|
}
|
|
1589
|
-
import * as
|
|
1590
|
-
import * as
|
|
1589
|
+
import * as THREE from "three";
|
|
1590
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1591
1591
|
import { Component, Components } from "../../core";
|
|
1592
1592
|
/**
|
|
1593
|
-
*
|
|
1593
|
+
* Represents an edge measurement result.
|
|
1594
1594
|
*/
|
|
1595
|
-
export
|
|
1595
|
+
export interface MeasureEdge {
|
|
1596
1596
|
/**
|
|
1597
|
-
*
|
|
1598
|
-
* This UUID is used to register the component within the Components system.
|
|
1597
|
+
* The distance between the two points of the edge.
|
|
1599
1598
|
*/
|
|
1600
|
-
|
|
1601
|
-
/** {@link Component.enabled} */
|
|
1602
|
-
enabled: boolean;
|
|
1603
|
-
constructor(components: Components);
|
|
1599
|
+
distance: number;
|
|
1604
1600
|
/**
|
|
1605
|
-
*
|
|
1606
|
-
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1607
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
1608
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
1609
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1610
|
-
* to make the location data available (e.g. absolute position of building).
|
|
1601
|
+
* The two points that define the edge.
|
|
1611
1602
|
*/
|
|
1612
|
-
|
|
1603
|
+
points: THREE.Vector3[];
|
|
1613
1604
|
}
|
|
1614
|
-
import * as WEBIFC from "web-ifc";
|
|
1615
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1616
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
1617
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1618
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1619
1605
|
/**
|
|
1620
|
-
*
|
|
1606
|
+
* 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).
|
|
1621
1607
|
*/
|
|
1622
|
-
export declare class
|
|
1608
|
+
export declare class MeasurementUtils extends Component {
|
|
1623
1609
|
/**
|
|
1624
1610
|
* A unique identifier for the component.
|
|
1625
1611
|
* This UUID is used to register the component within the Components system.
|
|
1626
1612
|
*/
|
|
1627
|
-
static
|
|
1628
|
-
/** {@link
|
|
1629
|
-
|
|
1613
|
+
static uuid: string;
|
|
1614
|
+
/** {@link Component.enabled} */
|
|
1615
|
+
enabled: boolean;
|
|
1616
|
+
constructor(components: Components);
|
|
1630
1617
|
/**
|
|
1631
|
-
*
|
|
1632
|
-
* This event provides the model's UUID and the relations map generated for that model.
|
|
1618
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
1633
1619
|
*
|
|
1634
|
-
* @
|
|
1635
|
-
* @
|
|
1636
|
-
*
|
|
1620
|
+
* @param point - The point from which to calculate the distance.
|
|
1621
|
+
* @param lineStart - The start point of the line segment.
|
|
1622
|
+
* @param lineEnd - The end point of the line segment.
|
|
1623
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1624
|
+
* @returns The distance from the point to the line segment.
|
|
1637
1625
|
*/
|
|
1638
|
-
|
|
1639
|
-
modelID: string;
|
|
1640
|
-
relationsMap: RelationsMap;
|
|
1641
|
-
}>;
|
|
1626
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1642
1627
|
/**
|
|
1643
|
-
*
|
|
1644
|
-
*
|
|
1645
|
-
*
|
|
1646
|
-
*
|
|
1647
|
-
*
|
|
1648
|
-
*
|
|
1628
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
1629
|
+
* It also returns the edges of the found face and their indices.
|
|
1630
|
+
*
|
|
1631
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1632
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1633
|
+
* @param instance - The instance of the mesh (optional).
|
|
1634
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1649
1635
|
*/
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
private _inverseAttributes;
|
|
1655
|
-
private _ifcRels;
|
|
1656
|
-
constructor(components: Components);
|
|
1657
|
-
private onFragmentsDisposed;
|
|
1658
|
-
private indexRelations;
|
|
1659
|
-
private getAttributeIndex;
|
|
1636
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1637
|
+
edges: MeasureEdge[];
|
|
1638
|
+
indices: Set<number>;
|
|
1639
|
+
} | null;
|
|
1660
1640
|
/**
|
|
1661
|
-
*
|
|
1641
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1642
|
+
* It also applies instance transformation if provided.
|
|
1662
1643
|
*
|
|
1663
|
-
* @param
|
|
1664
|
-
* @param
|
|
1644
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1645
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
1646
|
+
* @param instance - The instance of the mesh (optional).
|
|
1647
|
+
* @returns An object containing the vertices and normal of the face.
|
|
1648
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
1649
|
+
*/
|
|
1650
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1651
|
+
p1: THREE.Vector3;
|
|
1652
|
+
p2: THREE.Vector3;
|
|
1653
|
+
p3: THREE.Vector3;
|
|
1654
|
+
faceNormal: THREE.Vector3;
|
|
1655
|
+
};
|
|
1656
|
+
/**
|
|
1657
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
1658
|
+
* This is used to ensure numerical precision in edge detection.
|
|
1665
1659
|
*
|
|
1666
|
-
* @
|
|
1660
|
+
* @param vector - The vector to round.
|
|
1661
|
+
* @returns The vector with rounded components.
|
|
1667
1662
|
*/
|
|
1668
|
-
|
|
1663
|
+
round(vector: THREE.Vector3): void;
|
|
1669
1664
|
/**
|
|
1670
|
-
*
|
|
1671
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
1672
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
1665
|
+
* Calculates the volume of a set of fragments.
|
|
1673
1666
|
*
|
|
1674
|
-
*
|
|
1675
|
-
*
|
|
1676
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
1677
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
1678
|
-
* of entities that are related through that attribute.
|
|
1667
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1668
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
1679
1669
|
*
|
|
1680
|
-
* @
|
|
1681
|
-
*
|
|
1682
|
-
*
|
|
1683
|
-
*
|
|
1670
|
+
* @remarks
|
|
1671
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1672
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1673
|
+
*
|
|
1674
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1675
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
1684
1676
|
*/
|
|
1685
|
-
|
|
1677
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
1686
1678
|
/**
|
|
1687
|
-
*
|
|
1679
|
+
* Calculates the total volume of a set of meshes.
|
|
1680
|
+
*
|
|
1681
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1682
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
1683
|
+
*
|
|
1684
|
+
* @remarks
|
|
1685
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1686
|
+
* and its bounding sphere.
|
|
1688
1687
|
*
|
|
1689
|
-
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
1690
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
1691
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
1692
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
1693
1688
|
*/
|
|
1694
|
-
|
|
1689
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
1690
|
+
private getFaceData;
|
|
1691
|
+
private getVolumeOfMesh;
|
|
1692
|
+
private getSignedVolumeOfTriangle;
|
|
1693
|
+
}
|
|
1694
|
+
import { XMLParser } from "fast-xml-parser";
|
|
1695
|
+
import { Component, Configurable, Disposable, Event, World, DataMap } from "../../core/Types";
|
|
1696
|
+
import { BCFTopic, BCFTopicsConfig, Topic } from "./src";
|
|
1697
|
+
import { Viewpoint } from "../../core/Viewpoints";
|
|
1698
|
+
export declare class BCFTopics extends Component implements Disposable, Configurable<BCFTopicsConfig> {
|
|
1699
|
+
static uuid: "de977976-e4f6-4e4f-a01a-204727839802";
|
|
1700
|
+
enabled: boolean;
|
|
1701
|
+
static xmlParser: XMLParser;
|
|
1702
|
+
config: Required<BCFTopicsConfig>;
|
|
1703
|
+
readonly list: DataMap<string, Topic>;
|
|
1704
|
+
readonly onSetup: Event<unknown>;
|
|
1705
|
+
isSetup: boolean;
|
|
1706
|
+
setup(config?: Partial<BCFTopicsConfig>): void;
|
|
1707
|
+
readonly onBCFImported: Event<Topic[]>;
|
|
1695
1708
|
/**
|
|
1696
|
-
*
|
|
1697
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
1698
|
-
* returning the IDs of related entities if a match is found.
|
|
1709
|
+
* Creates a new BCFTopic instance and adds it to the list.
|
|
1699
1710
|
*
|
|
1700
|
-
* @param
|
|
1701
|
-
*
|
|
1702
|
-
* @
|
|
1703
|
-
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
1704
|
-
* or the specified relation name is not indexed.
|
|
1711
|
+
* @param data - Optional partial BCFTopic object to initialize the new topic with.
|
|
1712
|
+
* If not provided, default values will be used.
|
|
1713
|
+
* @returns The newly created BCFTopic instance.
|
|
1705
1714
|
*/
|
|
1706
|
-
|
|
1715
|
+
create(data?: Partial<BCFTopic>): Topic;
|
|
1716
|
+
readonly onDisposed: Event<unknown>;
|
|
1707
1717
|
/**
|
|
1708
|
-
*
|
|
1709
|
-
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
1710
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1711
|
-
* The resulting object is then serialized into a JSON string.
|
|
1718
|
+
* Disposes of the BCFTopics component and triggers the onDisposed event.
|
|
1712
1719
|
*
|
|
1713
|
-
* @
|
|
1714
|
-
*
|
|
1720
|
+
* @remarks
|
|
1721
|
+
* This method clears the list of topics and triggers the onDisposed event.
|
|
1722
|
+
* It also resets the onDisposed event listener.
|
|
1715
1723
|
*/
|
|
1716
|
-
|
|
1724
|
+
dispose(): void;
|
|
1717
1725
|
/**
|
|
1718
|
-
*
|
|
1719
|
-
* This method iterates through the relations indexed for the given model,
|
|
1720
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
1721
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
1722
|
-
* The resulting object is then serialized into a JSON string.
|
|
1726
|
+
* Retrieves the unique set of topic types used across all topics.
|
|
1723
1727
|
*
|
|
1724
|
-
* @
|
|
1725
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
1726
|
-
* If the model has no indexed relations, 'null' is returned.
|
|
1728
|
+
* @returns A Set containing the unique topic types.
|
|
1727
1729
|
*/
|
|
1728
|
-
|
|
1730
|
+
get usedTypes(): Set<string>;
|
|
1729
1731
|
/**
|
|
1730
|
-
*
|
|
1731
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
1732
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
1733
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
1734
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
1732
|
+
* Retrieves the unique set of topic statuses used across all topics.
|
|
1735
1733
|
*
|
|
1736
|
-
* @returns A
|
|
1737
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
1734
|
+
* @returns A Set containing the unique topic statuses.
|
|
1738
1735
|
*/
|
|
1739
|
-
|
|
1736
|
+
get usedStatuses(): Set<string>;
|
|
1740
1737
|
/**
|
|
1741
|
-
*
|
|
1742
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
1743
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
1744
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
1745
|
-
* of express IDs of entities related through that relation type.
|
|
1738
|
+
* Retrieves the unique set of topic priorities used across all topics.
|
|
1746
1739
|
*
|
|
1747
|
-
* @
|
|
1748
|
-
*
|
|
1749
|
-
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
1750
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
1740
|
+
* @returns A Set containing the unique topic priorities.
|
|
1741
|
+
* Note: This method filters out any null or undefined priorities.
|
|
1751
1742
|
*/
|
|
1752
|
-
|
|
1753
|
-
/** {@link Disposable.dispose} */
|
|
1754
|
-
dispose(): void;
|
|
1743
|
+
get usedPriorities(): Set<string | undefined>;
|
|
1755
1744
|
/**
|
|
1756
|
-
* Retrieves the
|
|
1757
|
-
*
|
|
1758
|
-
* @param model - The BIM model to search for related entities.
|
|
1759
|
-
* @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
1760
|
-
* @param expressID - The expressID of the entity within the model.
|
|
1745
|
+
* Retrieves the unique set of topic stages used across all topics.
|
|
1761
1746
|
*
|
|
1762
|
-
* @returns A
|
|
1747
|
+
* @returns A Set containing the unique topic stages.
|
|
1748
|
+
* Note: This method filters out any null or undefined stages.
|
|
1749
|
+
*/
|
|
1750
|
+
get usedStages(): Set<string | undefined>;
|
|
1751
|
+
/**
|
|
1752
|
+
* Retrieves the unique set of users associated with topics.
|
|
1763
1753
|
*
|
|
1764
|
-
* @
|
|
1754
|
+
* @returns A Set containing the unique users.
|
|
1755
|
+
* Note: This method collects users from the creation author, assigned to, modified author, and comment authors.
|
|
1765
1756
|
*/
|
|
1766
|
-
|
|
1757
|
+
get usedUsers(): Set<string>;
|
|
1767
1758
|
/**
|
|
1768
|
-
*
|
|
1759
|
+
* Retrieves the unique set of labels used across all topics.
|
|
1769
1760
|
*
|
|
1770
|
-
* @
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1761
|
+
* @returns A Set containing the unique labels.
|
|
1762
|
+
*/
|
|
1763
|
+
get usedLabels(): Set<string>;
|
|
1764
|
+
/**
|
|
1765
|
+
* Updates the set of extensions (types, statuses, priorities, labels, stages, users) based on the current topics.
|
|
1766
|
+
* This method iterates through each topic in the list and adds its properties to the corresponding sets in the config.
|
|
1767
|
+
*/
|
|
1768
|
+
updateExtensions(): void;
|
|
1769
|
+
/**
|
|
1770
|
+
* Updates the references to viewpoints in the topics.
|
|
1771
|
+
* This function iterates through each topic and checks if the viewpoints exist in the viewpoints list.
|
|
1772
|
+
* If a viewpoint does not exist, it is removed from the topic's viewpoints.
|
|
1773
|
+
*/
|
|
1774
|
+
updateViewpointReferences(): void;
|
|
1775
|
+
/**
|
|
1776
|
+
* Exports the given topics to a BCF (Building Collaboration Format) zip file.
|
|
1774
1777
|
*
|
|
1775
|
-
* @
|
|
1778
|
+
* @param topics - The topics to export. Defaults to all topics in the list.
|
|
1779
|
+
* @returns A promise that resolves to a Blob containing the exported BCF zip file.
|
|
1776
1780
|
*/
|
|
1777
|
-
|
|
1781
|
+
export(topics?: Iterable<Topic>): Promise<Blob>;
|
|
1782
|
+
private serializeExtensions;
|
|
1783
|
+
private processMarkupComment;
|
|
1784
|
+
private getMarkupComments;
|
|
1785
|
+
private getMarkupLabels;
|
|
1786
|
+
private getMarkupViewpoints;
|
|
1787
|
+
private getMarkupRelatedTopics;
|
|
1778
1788
|
/**
|
|
1779
|
-
*
|
|
1789
|
+
* Loads BCF (Building Collaboration Format) data into the engine.
|
|
1780
1790
|
*
|
|
1781
|
-
* @param
|
|
1782
|
-
* @param
|
|
1783
|
-
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
1791
|
+
* @param world - The default world where the viewpoints are going to be created.
|
|
1792
|
+
* @param data - The BCF data to load.
|
|
1784
1793
|
*
|
|
1785
|
-
* @returns A
|
|
1794
|
+
* @returns A promise that resolves to an object containing the created viewpoints and topics.
|
|
1795
|
+
*
|
|
1796
|
+
* @throws An error if the BCF version is not supported.
|
|
1786
1797
|
*/
|
|
1787
|
-
|
|
1798
|
+
load(data: Uint8Array, world: World): Promise<{
|
|
1799
|
+
viewpoints: Viewpoint[];
|
|
1800
|
+
topics: Topic[];
|
|
1801
|
+
}>;
|
|
1788
1802
|
}
|
|
1789
1803
|
import * as WEBIFC from "web-ifc";
|
|
1790
|
-
import
|
|
1791
|
-
import { Component,
|
|
1792
|
-
/**
|
|
1793
|
-
* Types for boolean properties in IFC schema.
|
|
1794
|
-
*/
|
|
1795
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1804
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1805
|
+
import { Component, Components } from "../../core";
|
|
1796
1806
|
/**
|
|
1797
|
-
*
|
|
1807
|
+
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1798
1808
|
*/
|
|
1799
|
-
export
|
|
1800
|
-
/**
|
|
1801
|
-
|
|
1809
|
+
export declare class IfcJsonExporter extends Component {
|
|
1810
|
+
/**
|
|
1811
|
+
* A unique identifier for the component.
|
|
1812
|
+
* This UUID is used to register the component within the Components system.
|
|
1813
|
+
*/
|
|
1814
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1815
|
+
/** {@link Component.enabled} */
|
|
1816
|
+
enabled: boolean;
|
|
1817
|
+
constructor(components: Components);
|
|
1818
|
+
/**
|
|
1819
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1820
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1821
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1822
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1823
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1824
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1825
|
+
*/
|
|
1826
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1827
|
+
}
|
|
1828
|
+
import * as WEBIFC from "web-ifc";
|
|
1829
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1830
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1831
|
+
import { IfcRelation } from "../IfcRelationsIndexer";
|
|
1832
|
+
/**
|
|
1833
|
+
* Types for boolean properties in IFC schema.
|
|
1834
|
+
*/
|
|
1835
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1836
|
+
/**
|
|
1837
|
+
* Types for string properties in IFC schema.
|
|
1838
|
+
*/
|
|
1839
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1840
|
+
/**
|
|
1841
|
+
* Types for numeric properties in IFC schema.
|
|
1802
1842
|
*/
|
|
1803
1843
|
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1804
1844
|
/**
|
|
@@ -1995,7 +2035,10 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
1995
2035
|
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1996
2036
|
*/
|
|
1997
2037
|
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
1998
|
-
|
|
2038
|
+
/**
|
|
2039
|
+
* @deprecated Use indexer.addEntitiesRelation instead. This will be removed in future releases.
|
|
2040
|
+
*/
|
|
2041
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): void;
|
|
1999
2042
|
/**
|
|
2000
2043
|
* Adds elements to a Property Set (Pset) in the given model.
|
|
2001
2044
|
*
|
|
@@ -2010,6 +2053,19 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
2010
2053
|
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
2011
2054
|
*/
|
|
2012
2055
|
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
2056
|
+
/**
|
|
2057
|
+
* Creates a new instance of a relationship between entities in the IFC model.
|
|
2058
|
+
*
|
|
2059
|
+
* @param model - The FragmentsGroup model in which to create the relationship.
|
|
2060
|
+
* @param type - The type of the relationship to create.
|
|
2061
|
+
* @param relatingID - The express ID of the entity that is related to the other entities.
|
|
2062
|
+
* @param relatedIDs - The express IDs of the entities that are related to the relating entity.
|
|
2063
|
+
*
|
|
2064
|
+
* @returns A promise that resolves with the newly created relationship.
|
|
2065
|
+
*
|
|
2066
|
+
* @throws Will throw an error if the relationship type is unsupported.
|
|
2067
|
+
*/
|
|
2068
|
+
createIfcRel(model: FragmentsGroup, type: IfcRelation, relatingID: number, relatedIDs: number[]): Promise<any>;
|
|
2013
2069
|
/**
|
|
2014
2070
|
* Saves the changes made to the model to a new IFC file.
|
|
2015
2071
|
*
|
|
@@ -2053,219 +2109,209 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
2053
2109
|
private registerChange;
|
|
2054
2110
|
private newSingleProperty;
|
|
2055
2111
|
}
|
|
2056
|
-
import
|
|
2057
|
-
import {
|
|
2058
|
-
import {
|
|
2059
|
-
import {
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
config: Required<BCFTopicsConfig>;
|
|
2065
|
-
readonly list: DataMap<string, Topic>;
|
|
2066
|
-
readonly onSetup: Event<unknown>;
|
|
2067
|
-
isSetup: boolean;
|
|
2068
|
-
setup(config?: Partial<BCFTopicsConfig>): void;
|
|
2069
|
-
readonly onBCFImported: Event<Topic[]>;
|
|
2112
|
+
import * as WEBIFC from "web-ifc";
|
|
2113
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
2114
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
2115
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
|
|
2116
|
+
/**
|
|
2117
|
+
* Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
|
|
2118
|
+
*/
|
|
2119
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
2070
2120
|
/**
|
|
2071
|
-
*
|
|
2072
|
-
*
|
|
2073
|
-
* @param data - Optional partial BCFTopic object to initialize the new topic with.
|
|
2074
|
-
* If not provided, default values will be used.
|
|
2075
|
-
* @returns The newly created BCFTopic instance.
|
|
2121
|
+
* A unique identifier for the component.
|
|
2122
|
+
* This UUID is used to register the component within the Components system.
|
|
2076
2123
|
*/
|
|
2077
|
-
|
|
2078
|
-
|
|
2124
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
2125
|
+
/** {@link Disposable.onDisposed} */
|
|
2126
|
+
readonly onDisposed: Event<string>;
|
|
2079
2127
|
/**
|
|
2080
|
-
*
|
|
2128
|
+
* Event triggered when relations for a model have been indexed.
|
|
2129
|
+
* This event provides the model's UUID and the relations map generated for that model.
|
|
2081
2130
|
*
|
|
2082
|
-
* @
|
|
2083
|
-
*
|
|
2084
|
-
*
|
|
2131
|
+
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
2132
|
+
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
2133
|
+
* The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
2085
2134
|
*/
|
|
2086
|
-
|
|
2135
|
+
readonly onRelationsIndexed: Event<{
|
|
2136
|
+
modelID: string;
|
|
2137
|
+
relationsMap: RelationsMap;
|
|
2138
|
+
}>;
|
|
2087
2139
|
/**
|
|
2088
|
-
*
|
|
2089
|
-
*
|
|
2090
|
-
*
|
|
2140
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
2141
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
2142
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
2143
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
2144
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
2145
|
+
* of entity relationships within a model.
|
|
2091
2146
|
*/
|
|
2092
|
-
|
|
2147
|
+
readonly relationMaps: ModelsRelationMap;
|
|
2148
|
+
/** {@link Component.enabled} */
|
|
2149
|
+
enabled: boolean;
|
|
2150
|
+
private _relToAttributesMap;
|
|
2151
|
+
private _inverseAttributes;
|
|
2152
|
+
private _ifcRels;
|
|
2153
|
+
constructor(components: Components);
|
|
2154
|
+
private onFragmentsDisposed;
|
|
2155
|
+
private indexRelations;
|
|
2156
|
+
private getAttributeIndex;
|
|
2093
2157
|
/**
|
|
2094
|
-
*
|
|
2158
|
+
* Adds a relation map to the model's relations map.
|
|
2095
2159
|
*
|
|
2096
|
-
* @
|
|
2160
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
2161
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
2162
|
+
*
|
|
2163
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
2097
2164
|
*/
|
|
2098
|
-
|
|
2165
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
2099
2166
|
/**
|
|
2100
|
-
*
|
|
2167
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
2168
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
2169
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
2101
2170
|
*
|
|
2102
|
-
*
|
|
2103
|
-
*
|
|
2171
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
2172
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
2173
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
2174
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
2175
|
+
* of entities that are related through that attribute.
|
|
2176
|
+
*
|
|
2177
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
2178
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
2179
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
2180
|
+
* @throws An error if the model does not have properties loaded.
|
|
2104
2181
|
*/
|
|
2105
|
-
|
|
2182
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
2106
2183
|
/**
|
|
2107
|
-
*
|
|
2184
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
2108
2185
|
*
|
|
2109
|
-
* @
|
|
2110
|
-
*
|
|
2186
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
2187
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
2188
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
2189
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
2111
2190
|
*/
|
|
2112
|
-
|
|
2191
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
2113
2192
|
/**
|
|
2114
|
-
* Retrieves the
|
|
2193
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
2194
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
2195
|
+
* returning the IDs of related entities if a match is found.
|
|
2115
2196
|
*
|
|
2116
|
-
* @
|
|
2117
|
-
*
|
|
2197
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
2198
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
2199
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
2200
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
2201
|
+
* or the specified relation name is not indexed.
|
|
2118
2202
|
*/
|
|
2119
|
-
|
|
2203
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
2120
2204
|
/**
|
|
2121
|
-
*
|
|
2205
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
2206
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
2207
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
2208
|
+
* The resulting object is then serialized into a JSON string.
|
|
2122
2209
|
*
|
|
2123
|
-
* @
|
|
2210
|
+
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
2211
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
2124
2212
|
*/
|
|
2125
|
-
|
|
2213
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
2126
2214
|
/**
|
|
2127
|
-
*
|
|
2128
|
-
* This method iterates through
|
|
2215
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
2216
|
+
* This method iterates through the relations indexed for the given model,
|
|
2217
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
2218
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
2219
|
+
* The resulting object is then serialized into a JSON string.
|
|
2220
|
+
*
|
|
2221
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
2222
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
2223
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
2129
2224
|
*/
|
|
2130
|
-
|
|
2225
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
2131
2226
|
/**
|
|
2132
|
-
*
|
|
2133
|
-
* This
|
|
2134
|
-
*
|
|
2227
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
2228
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
2229
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
2230
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
2231
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
2232
|
+
*
|
|
2233
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
2234
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
2135
2235
|
*/
|
|
2136
|
-
|
|
2236
|
+
serializeAllRelations(): string;
|
|
2137
2237
|
/**
|
|
2138
|
-
*
|
|
2238
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
2239
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
2240
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
2241
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
2242
|
+
* of express IDs of entities related through that relation type.
|
|
2139
2243
|
*
|
|
2140
|
-
* @param
|
|
2141
|
-
* @returns A
|
|
2244
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
2245
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
2246
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
2247
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
2142
2248
|
*/
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
private getMarkupComments;
|
|
2147
|
-
private getMarkupLabels;
|
|
2148
|
-
private getMarkupViewpoints;
|
|
2149
|
-
private getMarkupRelatedTopics;
|
|
2249
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
2250
|
+
/** {@link Disposable.dispose} */
|
|
2251
|
+
dispose(): void;
|
|
2150
2252
|
/**
|
|
2151
|
-
*
|
|
2253
|
+
* Retrieves the entities within a model that have a specific relation with a given entity.
|
|
2152
2254
|
*
|
|
2153
|
-
* @param
|
|
2154
|
-
* @param
|
|
2255
|
+
* @param model - The BIM model to search for related entities.
|
|
2256
|
+
* @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
2257
|
+
* @param expressID - The expressID of the entity within the model.
|
|
2155
2258
|
*
|
|
2156
|
-
* @returns A
|
|
2259
|
+
* @returns A 'Set' with the expressIDs of the entities that have the specified relation with the given entity.
|
|
2157
2260
|
*
|
|
2158
|
-
* @throws An error if the
|
|
2261
|
+
* @throws An error if the model relations are not indexed or if the inverse attribute name is invalid.
|
|
2159
2262
|
*/
|
|
2160
|
-
|
|
2161
|
-
viewpoints: Viewpoint[];
|
|
2162
|
-
topics: Topic[];
|
|
2163
|
-
}>;
|
|
2164
|
-
}
|
|
2165
|
-
import * as THREE from "three";
|
|
2166
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2167
|
-
import { Component, Components } from "../../core";
|
|
2168
|
-
/**
|
|
2169
|
-
* Represents an edge measurement result.
|
|
2170
|
-
*/
|
|
2171
|
-
export interface MeasureEdge {
|
|
2263
|
+
getEntitiesWithRelation(model: FragmentsGroup, inv: InverseAttribute, expressID: number): Set<number>;
|
|
2172
2264
|
/**
|
|
2173
|
-
*
|
|
2265
|
+
* Adds relations between an entity and other entities in a BIM model.
|
|
2266
|
+
*
|
|
2267
|
+
* @param model - The BIM model to which the relations will be added.
|
|
2268
|
+
* @param expressID - The expressID of the entity within the model.
|
|
2269
|
+
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
2270
|
+
* @param relIDs - The expressIDs of the related entities within the model.
|
|
2271
|
+
* @deprecated Use addEntitiesRelation instead. This will be removed in future versions.
|
|
2272
|
+
*
|
|
2273
|
+
* @throws An error if the relation name is not a valid relation name.
|
|
2174
2274
|
*/
|
|
2175
|
-
|
|
2275
|
+
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
2176
2276
|
/**
|
|
2177
|
-
*
|
|
2277
|
+
* Converts the relations made into actual IFC data.
|
|
2278
|
+
*
|
|
2279
|
+
* @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
|
|
2280
|
+
* It only make sense to use if the relations need to be write in the IFC file.
|
|
2281
|
+
*
|
|
2282
|
+
* @returns A promise that resolves when all the relation changes have been applied.
|
|
2178
2283
|
*/
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
/**
|
|
2182
|
-
* 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).
|
|
2183
|
-
*/
|
|
2184
|
-
export declare class MeasurementUtils extends Component {
|
|
2185
|
-
/**
|
|
2186
|
-
* A unique identifier for the component.
|
|
2187
|
-
* This UUID is used to register the component within the Components system.
|
|
2188
|
-
*/
|
|
2189
|
-
static uuid: string;
|
|
2190
|
-
/** {@link Component.enabled} */
|
|
2191
|
-
enabled: boolean;
|
|
2192
|
-
constructor(components: Components);
|
|
2193
|
-
/**
|
|
2194
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
2195
|
-
*
|
|
2196
|
-
* @param point - The point from which to calculate the distance.
|
|
2197
|
-
* @param lineStart - The start point of the line segment.
|
|
2198
|
-
* @param lineEnd - The end point of the line segment.
|
|
2199
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
2200
|
-
* @returns The distance from the point to the line segment.
|
|
2201
|
-
*/
|
|
2202
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
2203
|
-
/**
|
|
2204
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
2205
|
-
* It also returns the edges of the found face and their indices.
|
|
2206
|
-
*
|
|
2207
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
2208
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
2209
|
-
* @param instance - The instance of the mesh (optional).
|
|
2210
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
2211
|
-
*/
|
|
2212
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
2213
|
-
edges: MeasureEdge[];
|
|
2214
|
-
indices: Set<number>;
|
|
2215
|
-
} | null;
|
|
2284
|
+
applyRelationChanges(): Promise<void>;
|
|
2285
|
+
private readonly _changeMap;
|
|
2216
2286
|
/**
|
|
2217
|
-
*
|
|
2218
|
-
*
|
|
2219
|
-
*
|
|
2220
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
2221
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
2222
|
-
* @param instance - The instance of the mesh (optional).
|
|
2223
|
-
* @returns An object containing the vertices and normal of the face.
|
|
2224
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
2225
|
-
*/
|
|
2226
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
2227
|
-
p1: THREE.Vector3;
|
|
2228
|
-
p2: THREE.Vector3;
|
|
2229
|
-
p3: THREE.Vector3;
|
|
2230
|
-
faceNormal: THREE.Vector3;
|
|
2231
|
-
};
|
|
2232
|
-
/**
|
|
2233
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
2234
|
-
* This is used to ensure numerical precision in edge detection.
|
|
2235
|
-
*
|
|
2236
|
-
* @param vector - The vector to round.
|
|
2237
|
-
* @returns The vector with rounded components.
|
|
2238
|
-
*/
|
|
2239
|
-
round(vector: THREE.Vector3): void;
|
|
2240
|
-
/**
|
|
2241
|
-
* Calculates the volume of a set of fragments.
|
|
2242
|
-
*
|
|
2243
|
-
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
2244
|
-
* @returns The total volume of the fragments and the bounding sphere.
|
|
2245
|
-
*
|
|
2246
|
-
* @remarks
|
|
2247
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
2248
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
2249
|
-
*
|
|
2250
|
-
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
2251
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
2287
|
+
* An event that is triggered when entities are related in a BIM model.
|
|
2288
|
+
* The event provides information about the type of relation, the inverse attribute,
|
|
2289
|
+
* the IDs of the entities related, and the IDs of the entities that are being related.
|
|
2252
2290
|
*/
|
|
2253
|
-
|
|
2291
|
+
readonly onEntitiesRelated: Event<{
|
|
2292
|
+
/** The type of the IFC relation. */
|
|
2293
|
+
relType: IfcRelation;
|
|
2294
|
+
/** The inverse attribute of the relation. */
|
|
2295
|
+
invAttribute: InverseAttribute;
|
|
2296
|
+
/** The IDs of the entities that are relating. */
|
|
2297
|
+
relatingIDs: number[];
|
|
2298
|
+
/** The IDs of the entities that are being related. */
|
|
2299
|
+
relatedIDs: number[];
|
|
2300
|
+
}>;
|
|
2301
|
+
addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
|
|
2302
|
+
type: IfcRelation;
|
|
2303
|
+
inv: InverseAttribute;
|
|
2304
|
+
}, ...relatedIDs: number[]): void;
|
|
2254
2305
|
/**
|
|
2255
|
-
*
|
|
2256
|
-
*
|
|
2257
|
-
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
2258
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
2306
|
+
* Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
|
|
2259
2307
|
*
|
|
2260
|
-
* @
|
|
2261
|
-
*
|
|
2262
|
-
*
|
|
2308
|
+
* @param model The BIM model whose children to get.
|
|
2309
|
+
* @param expressID The expressID of the item whose children to get.
|
|
2310
|
+
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
2263
2311
|
*
|
|
2312
|
+
* @returns A 'Set' with the expressIDs of the found items.
|
|
2264
2313
|
*/
|
|
2265
|
-
|
|
2266
|
-
private getFaceData;
|
|
2267
|
-
private getVolumeOfMesh;
|
|
2268
|
-
private getSignedVolumeOfTriangle;
|
|
2314
|
+
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
2269
2315
|
}
|
|
2270
2316
|
export declare class UUID {
|
|
2271
2317
|
private static _pattern;
|
|
@@ -2389,6 +2435,10 @@ export declare class VertexPicker extends Component implements Disposable {
|
|
|
2389
2435
|
private getVertices;
|
|
2390
2436
|
private getVertex;
|
|
2391
2437
|
}
|
|
2438
|
+
/**
|
|
2439
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2440
|
+
*/
|
|
2441
|
+
export declare const GeometryTypes: Set<number>;
|
|
2392
2442
|
import * as THREE from "three";
|
|
2393
2443
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2394
2444
|
/**
|
|
@@ -2478,10 +2528,11 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2478
2528
|
resize(size?: THREE.Vector2): void;
|
|
2479
2529
|
private updatePlanes;
|
|
2480
2530
|
}
|
|
2481
|
-
|
|
2482
|
-
*
|
|
2483
|
-
|
|
2484
|
-
|
|
2531
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2532
|
+
import * as WEBIFC from "web-ifc";
|
|
2533
|
+
export declare class SpatialIdsFinder {
|
|
2534
|
+
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2535
|
+
}
|
|
2485
2536
|
import * as WEBIFC from "web-ifc";
|
|
2486
2537
|
/** Configuration of the IFC-fragment conversion. */
|
|
2487
2538
|
export declare class IfcFragmentSettings {
|
|
@@ -2525,11 +2576,6 @@ export declare class IfcFragmentSettings {
|
|
|
2525
2576
|
*/
|
|
2526
2577
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2527
2578
|
}
|
|
2528
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2529
|
-
import * as WEBIFC from "web-ifc";
|
|
2530
|
-
export declare class SpatialIdsFinder {
|
|
2531
|
-
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2532
|
-
}
|
|
2533
2579
|
import * as WEBIFC from "web-ifc";
|
|
2534
2580
|
export interface IfcItemsCategories {
|
|
2535
2581
|
[itemID: number]: number;
|
|
@@ -2537,12 +2583,6 @@ export interface IfcItemsCategories {
|
|
|
2537
2583
|
export declare class IfcCategories {
|
|
2538
2584
|
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2539
2585
|
}
|
|
2540
|
-
/**
|
|
2541
|
-
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2542
|
-
*/
|
|
2543
|
-
export declare const IfcCategoryMap: {
|
|
2544
|
-
[key: number]: string;
|
|
2545
|
-
};
|
|
2546
2586
|
/**
|
|
2547
2587
|
* 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.
|
|
2548
2588
|
*
|
|
@@ -2554,6 +2594,12 @@ export declare const IfcCategoryMap: {
|
|
|
2554
2594
|
export declare const IfcElements: {
|
|
2555
2595
|
[key: number]: string;
|
|
2556
2596
|
};
|
|
2597
|
+
/**
|
|
2598
|
+
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2599
|
+
*/
|
|
2600
|
+
export declare const IfcCategoryMap: {
|
|
2601
|
+
[key: number]: string;
|
|
2602
|
+
};
|
|
2557
2603
|
import * as FRAGS from "@thatopen/fragments";
|
|
2558
2604
|
export declare class IfcPropertiesUtils {
|
|
2559
2605
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2834,6 +2880,11 @@ export declare abstract class BaseWorldItem extends Base {
|
|
|
2834
2880
|
currentWorld: World | null;
|
|
2835
2881
|
protected constructor(components: Components);
|
|
2836
2882
|
}
|
|
2883
|
+
import { InverseAttribute } from "./types";
|
|
2884
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
|
|
2885
|
+
forRelating: InverseAttribute;
|
|
2886
|
+
forRelated: InverseAttribute;
|
|
2887
|
+
}>;
|
|
2837
2888
|
import * as THREE from "three";
|
|
2838
2889
|
import { Vector2 } from "three";
|
|
2839
2890
|
import { Event } from "./event";
|
|
@@ -2899,11 +2950,40 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
2899
2950
|
*/
|
|
2900
2951
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2901
2952
|
}
|
|
2902
|
-
import
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
}
|
|
2953
|
+
import * as THREE from "three";
|
|
2954
|
+
import { BaseScene } from "./base-scene";
|
|
2955
|
+
import { BaseCamera } from "./base-camera";
|
|
2956
|
+
import { BaseRenderer } from "./base-renderer";
|
|
2957
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
2958
|
+
/**
|
|
2959
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2960
|
+
*/
|
|
2961
|
+
export interface World extends Disposable, Updateable {
|
|
2962
|
+
/**
|
|
2963
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2964
|
+
*/
|
|
2965
|
+
meshes: Set<THREE.Mesh>;
|
|
2966
|
+
/**
|
|
2967
|
+
* The base scene of the world.
|
|
2968
|
+
*/
|
|
2969
|
+
scene: BaseScene;
|
|
2970
|
+
/**
|
|
2971
|
+
* The base camera of the world.
|
|
2972
|
+
*/
|
|
2973
|
+
camera: BaseCamera;
|
|
2974
|
+
/**
|
|
2975
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2976
|
+
*/
|
|
2977
|
+
renderer: BaseRenderer | null;
|
|
2978
|
+
/**
|
|
2979
|
+
* A unique identifier for the world.
|
|
2980
|
+
*/
|
|
2981
|
+
uuid: string;
|
|
2982
|
+
/**
|
|
2983
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2984
|
+
*/
|
|
2985
|
+
isDisposing: boolean;
|
|
2986
|
+
}
|
|
2907
2987
|
import * as THREE from "three";
|
|
2908
2988
|
import { Disposable } from "./interfaces";
|
|
2909
2989
|
import { Event } from "./event";
|
|
@@ -2928,39 +3008,64 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
|
|
|
2928
3008
|
/** {@link Disposable.dispose} */
|
|
2929
3009
|
dispose(): void;
|
|
2930
3010
|
}
|
|
2931
|
-
import
|
|
2932
|
-
import { BaseScene } from "./base-scene";
|
|
2933
|
-
import { BaseCamera } from "./base-camera";
|
|
2934
|
-
import { BaseRenderer } from "./base-renderer";
|
|
2935
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
3011
|
+
import { Event } from "./event";
|
|
2936
3012
|
/**
|
|
2937
|
-
*
|
|
3013
|
+
* A class that extends the built-in Set class and provides additional functionality.
|
|
3014
|
+
* It triggers events when items are added, deleted, or the set is cleared.
|
|
3015
|
+
*
|
|
3016
|
+
* @template T - The type of elements in the set.
|
|
2938
3017
|
*/
|
|
2939
|
-
export
|
|
3018
|
+
export declare class DataSet<T> extends Set<T> {
|
|
2940
3019
|
/**
|
|
2941
|
-
*
|
|
3020
|
+
* An event that is triggered when a new item is added to the set.
|
|
2942
3021
|
*/
|
|
2943
|
-
|
|
3022
|
+
readonly onItemAdded: Event<T>;
|
|
2944
3023
|
/**
|
|
2945
|
-
*
|
|
3024
|
+
* An event that is triggered when an item is deleted from the set.
|
|
2946
3025
|
*/
|
|
2947
|
-
|
|
3026
|
+
readonly onItemDeleted: Event<unknown>;
|
|
2948
3027
|
/**
|
|
2949
|
-
*
|
|
3028
|
+
* An event that is triggered when the set is cleared.
|
|
2950
3029
|
*/
|
|
2951
|
-
|
|
3030
|
+
readonly onCleared: Event<unknown>;
|
|
2952
3031
|
/**
|
|
2953
|
-
*
|
|
3032
|
+
* Constructs a new instance of the DataSet class.
|
|
3033
|
+
*
|
|
3034
|
+
* @param iterable - An optional iterable object to initialize the set with.
|
|
2954
3035
|
*/
|
|
2955
|
-
|
|
3036
|
+
constructor(iterable?: Iterable<T> | null);
|
|
2956
3037
|
/**
|
|
2957
|
-
*
|
|
3038
|
+
* Clears the set and triggers the onCleared event.
|
|
2958
3039
|
*/
|
|
2959
|
-
|
|
3040
|
+
clear(): void;
|
|
2960
3041
|
/**
|
|
2961
|
-
*
|
|
3042
|
+
* Adds one or multiple values to the set and triggers the onItemAdded event per each.
|
|
3043
|
+
*
|
|
3044
|
+
* @param value - The value to add to the set.
|
|
3045
|
+
* @returns - The set instance.
|
|
2962
3046
|
*/
|
|
2963
|
-
|
|
3047
|
+
add(...value: T[]): this;
|
|
3048
|
+
/**
|
|
3049
|
+
* A function that acts as a guard for adding items to the set.
|
|
3050
|
+
* It determines whether a given value should be allowed to be added to the set.
|
|
3051
|
+
*
|
|
3052
|
+
* @param value - The value to be checked against the guard.
|
|
3053
|
+
* @returns A boolean indicating whether the value should be allowed to be added to the set.
|
|
3054
|
+
* By default, this function always returns true, allowing all values to be added.
|
|
3055
|
+
* You can override this behavior by providing a custom implementation.
|
|
3056
|
+
*/
|
|
3057
|
+
guard: (value: T) => boolean;
|
|
3058
|
+
/**
|
|
3059
|
+
* Deletes a value from the set and triggers the onItemDeleted event.
|
|
3060
|
+
*
|
|
3061
|
+
* @param value - The value to delete from the set.
|
|
3062
|
+
* @returns - True if the value was successfully deleted, false otherwise.
|
|
3063
|
+
*/
|
|
3064
|
+
delete(value: T): boolean;
|
|
3065
|
+
/**
|
|
3066
|
+
* Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
|
|
3067
|
+
*/
|
|
3068
|
+
dispose(): void;
|
|
2964
3069
|
}
|
|
2965
3070
|
import { Event } from "./event";
|
|
2966
3071
|
/**
|
|
@@ -3033,353 +3138,365 @@ export declare class DataMap<K, V> extends Map<K, V> {
|
|
|
3033
3138
|
*/
|
|
3034
3139
|
dispose(): void;
|
|
3035
3140
|
}
|
|
3036
|
-
import {
|
|
3141
|
+
import { Topic } from "..";
|
|
3142
|
+
import { Viewpoint } from "../../../core/Viewpoints";
|
|
3143
|
+
import { Components } from "../../../core/Components";
|
|
3037
3144
|
/**
|
|
3038
|
-
*
|
|
3039
|
-
* It triggers events when items are added, deleted, or the set is cleared.
|
|
3040
|
-
*
|
|
3041
|
-
* @template T - The type of elements in the set.
|
|
3145
|
+
* Represents a comment in a BCF Topic.
|
|
3042
3146
|
*/
|
|
3043
|
-
export declare class
|
|
3147
|
+
export declare class Comment {
|
|
3148
|
+
date: Date;
|
|
3149
|
+
author: string;
|
|
3150
|
+
guid: string;
|
|
3151
|
+
viewpoint?: Viewpoint;
|
|
3152
|
+
modifiedAuthor?: string;
|
|
3153
|
+
modifiedDate?: Date;
|
|
3154
|
+
topic?: Topic;
|
|
3155
|
+
private _components;
|
|
3156
|
+
private _comment;
|
|
3044
3157
|
/**
|
|
3045
|
-
*
|
|
3158
|
+
* Sets the comment text and updates the modified date and author.
|
|
3159
|
+
* The author will be the one defined in BCFTopics.config.author
|
|
3160
|
+
* @param value - The new comment text.
|
|
3046
3161
|
*/
|
|
3047
|
-
|
|
3162
|
+
set comment(value: string);
|
|
3048
3163
|
/**
|
|
3049
|
-
*
|
|
3164
|
+
* Gets the comment text.
|
|
3165
|
+
* @returns The comment text.
|
|
3050
3166
|
*/
|
|
3051
|
-
|
|
3167
|
+
get comment(): string;
|
|
3052
3168
|
/**
|
|
3053
|
-
*
|
|
3169
|
+
* Constructs a new BCF Topic Comment instance.
|
|
3170
|
+
* @param components - The Components instance.
|
|
3171
|
+
* @param text - The initial comment text.
|
|
3054
3172
|
*/
|
|
3055
|
-
|
|
3173
|
+
constructor(components: Components, text: string);
|
|
3056
3174
|
/**
|
|
3057
|
-
*
|
|
3175
|
+
* Serializes the Comment instance into a BCF compliant XML string.
|
|
3058
3176
|
*
|
|
3059
|
-
* @
|
|
3177
|
+
* @returns A string representing the Comment in BCFv2 XML format.
|
|
3060
3178
|
*/
|
|
3061
|
-
|
|
3179
|
+
serialize(): string;
|
|
3180
|
+
}
|
|
3181
|
+
import * as THREE from "three";
|
|
3182
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3183
|
+
import { Components } from "../../Components";
|
|
3184
|
+
/**
|
|
3185
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
3186
|
+
*/
|
|
3187
|
+
export interface SimpleSceneConfig {
|
|
3188
|
+
directionalLight: {
|
|
3189
|
+
color: THREE.Color;
|
|
3190
|
+
intensity: number;
|
|
3191
|
+
position: THREE.Vector3;
|
|
3192
|
+
};
|
|
3193
|
+
ambientLight: {
|
|
3194
|
+
color: THREE.Color;
|
|
3195
|
+
intensity: number;
|
|
3196
|
+
};
|
|
3197
|
+
}
|
|
3198
|
+
/**
|
|
3199
|
+
* 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.
|
|
3200
|
+
*/
|
|
3201
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3202
|
+
/** {@link Configurable.isSetup} */
|
|
3203
|
+
isSetup: boolean;
|
|
3062
3204
|
/**
|
|
3063
|
-
*
|
|
3205
|
+
* The underlying Three.js scene object.
|
|
3206
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3064
3207
|
*/
|
|
3065
|
-
|
|
3208
|
+
three: THREE.Scene;
|
|
3209
|
+
/** {@link Configurable.onSetup} */
|
|
3210
|
+
readonly onSetup: Event<SimpleScene>;
|
|
3066
3211
|
/**
|
|
3067
|
-
*
|
|
3068
|
-
*
|
|
3069
|
-
* @param value - The value to add to the set.
|
|
3070
|
-
* @returns - The set instance.
|
|
3212
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3213
|
+
* Defines properties for directional and ambient lights.
|
|
3071
3214
|
*/
|
|
3072
|
-
|
|
3215
|
+
config: Required<SimpleSceneConfig>;
|
|
3216
|
+
constructor(components: Components);
|
|
3217
|
+
/** {@link Configurable.setup} */
|
|
3218
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3219
|
+
}
|
|
3220
|
+
import * as THREE from "three";
|
|
3221
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
3222
|
+
/**
|
|
3223
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
3224
|
+
*
|
|
3225
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
3226
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
3227
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
3228
|
+
*/
|
|
3229
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
3073
3230
|
/**
|
|
3074
|
-
*
|
|
3075
|
-
* It determines whether a given value should be allowed to be added to the set.
|
|
3076
|
-
*
|
|
3077
|
-
* @param value - The value to be checked against the guard.
|
|
3078
|
-
* @returns A boolean indicating whether the value should be allowed to be added to the set.
|
|
3079
|
-
* By default, this function always returns true, allowing all values to be added.
|
|
3080
|
-
* You can override this behavior by providing a custom implementation.
|
|
3231
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
3081
3232
|
*/
|
|
3082
|
-
|
|
3233
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
3234
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3235
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
3236
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3237
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
3238
|
+
/** {@link Disposable.onDisposed} */
|
|
3239
|
+
readonly onDisposed: Event<unknown>;
|
|
3083
3240
|
/**
|
|
3084
|
-
*
|
|
3085
|
-
*
|
|
3086
|
-
* @param value - The value to delete from the set.
|
|
3087
|
-
* @returns - True if the value was successfully deleted, false otherwise.
|
|
3241
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
3088
3242
|
*/
|
|
3089
|
-
|
|
3243
|
+
isDisposing: boolean;
|
|
3090
3244
|
/**
|
|
3091
|
-
*
|
|
3245
|
+
* Indicates whether the world is currently enabled.
|
|
3246
|
+
* When disabled, the world will not be updated.
|
|
3092
3247
|
*/
|
|
3093
|
-
|
|
3094
|
-
}
|
|
3095
|
-
import { Topic } from "..";
|
|
3096
|
-
import { Viewpoint } from "../../../core/Viewpoints";
|
|
3097
|
-
import { Components } from "../../../core/Components";
|
|
3098
|
-
/**
|
|
3099
|
-
* Represents a comment in a BCF Topic.
|
|
3100
|
-
*/
|
|
3101
|
-
export declare class Comment {
|
|
3102
|
-
date: Date;
|
|
3103
|
-
author: string;
|
|
3104
|
-
guid: string;
|
|
3105
|
-
viewpoint?: Viewpoint;
|
|
3106
|
-
modifiedAuthor?: string;
|
|
3107
|
-
modifiedDate?: Date;
|
|
3108
|
-
topic?: Topic;
|
|
3109
|
-
private _components;
|
|
3110
|
-
private _comment;
|
|
3248
|
+
enabled: boolean;
|
|
3111
3249
|
/**
|
|
3112
|
-
*
|
|
3113
|
-
* The author will be the one defined in BCFTopics.config.author
|
|
3114
|
-
* @param value - The new comment text.
|
|
3250
|
+
* A unique identifier for the world.
|
|
3115
3251
|
*/
|
|
3116
|
-
|
|
3252
|
+
uuid: string;
|
|
3117
3253
|
/**
|
|
3118
|
-
*
|
|
3119
|
-
* @returns The comment text.
|
|
3254
|
+
* An optional name for the world.
|
|
3120
3255
|
*/
|
|
3121
|
-
|
|
3256
|
+
name?: string;
|
|
3257
|
+
private _scene?;
|
|
3258
|
+
private _camera?;
|
|
3259
|
+
private _renderer;
|
|
3122
3260
|
/**
|
|
3123
|
-
*
|
|
3124
|
-
* @
|
|
3125
|
-
* @param text - The initial comment text.
|
|
3261
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
3262
|
+
* @returns The current scene.
|
|
3126
3263
|
*/
|
|
3127
|
-
|
|
3264
|
+
get scene(): T;
|
|
3128
3265
|
/**
|
|
3129
|
-
*
|
|
3130
|
-
*
|
|
3131
|
-
* @
|
|
3266
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
3267
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
3268
|
+
* @param scene - The new scene to be set.
|
|
3132
3269
|
*/
|
|
3133
|
-
|
|
3134
|
-
}
|
|
3135
|
-
import * as THREE from "three";
|
|
3136
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3137
|
-
import { Components } from "../../Components";
|
|
3138
|
-
/**
|
|
3139
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
3140
|
-
*/
|
|
3141
|
-
export interface GridConfig {
|
|
3270
|
+
set scene(scene: T);
|
|
3142
3271
|
/**
|
|
3143
|
-
*
|
|
3272
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
3273
|
+
* @returns The current camera.
|
|
3144
3274
|
*/
|
|
3145
|
-
|
|
3275
|
+
get camera(): U;
|
|
3146
3276
|
/**
|
|
3147
|
-
*
|
|
3277
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
3278
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
3279
|
+
* @param camera - The new camera to be set.
|
|
3148
3280
|
*/
|
|
3149
|
-
|
|
3281
|
+
set camera(camera: U);
|
|
3150
3282
|
/**
|
|
3151
|
-
*
|
|
3283
|
+
* Getter for the renderer.
|
|
3284
|
+
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
3152
3285
|
*/
|
|
3153
|
-
|
|
3286
|
+
get renderer(): S | null;
|
|
3154
3287
|
/**
|
|
3155
|
-
*
|
|
3288
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
3289
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
3290
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
3291
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
3156
3292
|
*/
|
|
3157
|
-
|
|
3293
|
+
set renderer(renderer: S | null);
|
|
3294
|
+
/** {@link Updateable.update} */
|
|
3295
|
+
update(delta?: number): void;
|
|
3296
|
+
/** {@link Disposable.dispose} */
|
|
3297
|
+
dispose(disposeResources?: boolean): void;
|
|
3158
3298
|
}
|
|
3299
|
+
import * as THREE from "three";
|
|
3300
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
3301
|
+
import { Components } from "../../Components";
|
|
3159
3302
|
/**
|
|
3160
|
-
*
|
|
3303
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3161
3304
|
*/
|
|
3162
|
-
export declare class
|
|
3163
|
-
/** {@link Disposable.onDisposed} */
|
|
3164
|
-
readonly onDisposed: Event<unknown>;
|
|
3165
|
-
/** The world instance to which this Raycaster belongs. */
|
|
3166
|
-
world: World;
|
|
3167
|
-
/** The components instance to which this grid belongs. */
|
|
3168
|
-
components: Components;
|
|
3169
|
-
/** {@link Hideable.visible} */
|
|
3170
|
-
get visible(): boolean;
|
|
3171
|
-
/** {@link Hideable.visible} */
|
|
3172
|
-
set visible(visible: boolean);
|
|
3173
|
-
/** The material of the grid. */
|
|
3174
|
-
get material(): THREE.ShaderMaterial;
|
|
3305
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
3175
3306
|
/**
|
|
3176
|
-
*
|
|
3177
|
-
*
|
|
3307
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3308
|
+
* Default is 'true'.
|
|
3178
3309
|
*/
|
|
3179
|
-
|
|
3310
|
+
enabled: boolean;
|
|
3180
3311
|
/**
|
|
3181
|
-
*
|
|
3182
|
-
* perspective cameras and false for orthographic cameras.
|
|
3312
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
3183
3313
|
*/
|
|
3184
|
-
|
|
3185
|
-
/**
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3314
|
+
container: HTMLElement;
|
|
3315
|
+
/**
|
|
3316
|
+
* The THREE.js WebGLRenderer instance.
|
|
3317
|
+
*/
|
|
3318
|
+
three: THREE.WebGLRenderer;
|
|
3319
|
+
protected _canvas: HTMLCanvasElement;
|
|
3320
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3321
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
3322
|
+
protected onContainerUpdated: Event<unknown>;
|
|
3323
|
+
private _resizing;
|
|
3324
|
+
/**
|
|
3325
|
+
* Constructor for the SimpleRenderer class.
|
|
3326
|
+
*
|
|
3327
|
+
* @param components - The components instance.
|
|
3328
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3329
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3330
|
+
*/
|
|
3331
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3332
|
+
/** {@link Updateable.update} */
|
|
3333
|
+
update(): void;
|
|
3189
3334
|
/** {@link Disposable.dispose} */
|
|
3190
3335
|
dispose(): void;
|
|
3191
|
-
|
|
3192
|
-
|
|
3336
|
+
/** {@link Resizeable.getSize}. */
|
|
3337
|
+
getSize(): THREE.Vector2;
|
|
3338
|
+
/** {@link Resizeable.resize} */
|
|
3339
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3340
|
+
/**
|
|
3341
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3342
|
+
*
|
|
3343
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3344
|
+
*
|
|
3345
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3346
|
+
*/
|
|
3347
|
+
setupEvents(active: boolean): void;
|
|
3348
|
+
private resizeEvent;
|
|
3349
|
+
private setupRenderer;
|
|
3350
|
+
private onContextLost;
|
|
3351
|
+
private onContextBack;
|
|
3193
3352
|
}
|
|
3194
|
-
import {
|
|
3195
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3353
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3196
3354
|
/**
|
|
3197
|
-
*
|
|
3355
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3198
3356
|
*/
|
|
3199
|
-
export declare class
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3206
|
-
/** {@link NavigationMode.set} */
|
|
3207
|
-
set(active: boolean): void;
|
|
3208
|
-
private setupFirstPersonCamera;
|
|
3357
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3358
|
+
/**
|
|
3359
|
+
* Amount of properties to be streamed.
|
|
3360
|
+
* Defaults to 100 properties.
|
|
3361
|
+
*/
|
|
3362
|
+
propertiesSize: number;
|
|
3209
3363
|
}
|
|
3210
3364
|
import * as THREE from "three";
|
|
3211
|
-
import
|
|
3365
|
+
import CameraControls from "camera-controls";
|
|
3366
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3212
3367
|
import { Components } from "../../Components";
|
|
3213
3368
|
/**
|
|
3214
|
-
* A
|
|
3369
|
+
* 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.
|
|
3215
3370
|
*/
|
|
3216
|
-
export declare class
|
|
3217
|
-
/** {@link
|
|
3218
|
-
readonly
|
|
3219
|
-
/**
|
|
3220
|
-
|
|
3221
|
-
* meshes that are currently visible, and the ones that were visible
|
|
3222
|
-
* just before but not anymore.
|
|
3223
|
-
*/
|
|
3224
|
-
readonly onDistanceComputed: Event<number>;
|
|
3225
|
-
/**
|
|
3226
|
-
* Objects that won't be taken into account in the distance check.
|
|
3227
|
-
*/
|
|
3228
|
-
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
3371
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3372
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3373
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3374
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3375
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3229
3376
|
/**
|
|
3230
|
-
*
|
|
3377
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3378
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3231
3379
|
*/
|
|
3232
|
-
|
|
3380
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
3381
|
+
/** {@link Disposable.onDisposed} */
|
|
3382
|
+
readonly onDisposed: Event<string>;
|
|
3233
3383
|
/**
|
|
3234
|
-
*
|
|
3235
|
-
* for
|
|
3384
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3385
|
+
* This camera is used for rendering the scene.
|
|
3236
3386
|
*/
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
components: Components;
|
|
3387
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3388
|
+
private _allControls;
|
|
3240
3389
|
/**
|
|
3241
|
-
* The
|
|
3390
|
+
* The object that controls the camera. An instance of
|
|
3391
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3392
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3393
|
+
* object to move, rotate, look at objects, etc.
|
|
3242
3394
|
*/
|
|
3243
|
-
|
|
3395
|
+
get controls(): CameraControls;
|
|
3244
3396
|
/**
|
|
3245
|
-
*
|
|
3397
|
+
* Getter for the enabled state of the camera controls.
|
|
3398
|
+
* If the current world is null, it returns false.
|
|
3399
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3400
|
+
*
|
|
3401
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3246
3402
|
*/
|
|
3247
|
-
|
|
3403
|
+
get enabled(): boolean;
|
|
3248
3404
|
/**
|
|
3249
|
-
*
|
|
3405
|
+
* Setter for the enabled state of the camera controls.
|
|
3406
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3407
|
+
*
|
|
3408
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3250
3409
|
*/
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
readonly world: World;
|
|
3254
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
3255
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
3256
|
-
protected readonly worker: Worker;
|
|
3257
|
-
private _width;
|
|
3258
|
-
private _height;
|
|
3259
|
-
private readonly _postQuad;
|
|
3260
|
-
private readonly tempRT;
|
|
3261
|
-
private readonly resultRT;
|
|
3262
|
-
private readonly bufferSize;
|
|
3263
|
-
private readonly _buffer;
|
|
3264
|
-
protected _isWorkerBusy: boolean;
|
|
3265
|
-
constructor(components: Components, world: World);
|
|
3410
|
+
set enabled(enabled: boolean);
|
|
3411
|
+
constructor(components: Components);
|
|
3266
3412
|
/** {@link Disposable.dispose} */
|
|
3267
3413
|
dispose(): void;
|
|
3414
|
+
/** {@link Updateable.update} */
|
|
3415
|
+
update(_delta: number): void;
|
|
3268
3416
|
/**
|
|
3269
|
-
*
|
|
3270
|
-
*
|
|
3271
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3272
|
-
* not true.
|
|
3417
|
+
* Updates the aspect of the camera to match the size of the
|
|
3418
|
+
* {@link Components.renderer}.
|
|
3273
3419
|
*/
|
|
3274
|
-
|
|
3275
|
-
private
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
/**
|
|
3280
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3281
|
-
*/
|
|
3282
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3283
|
-
camera: OrthoPerspectiveCamera;
|
|
3284
|
-
/** {@link NavigationMode.enabled} */
|
|
3285
|
-
enabled: boolean;
|
|
3286
|
-
/** {@link NavigationMode.id} */
|
|
3287
|
-
readonly id = "Orbit";
|
|
3288
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3289
|
-
/** {@link NavigationMode.set} */
|
|
3290
|
-
set(active: boolean): void;
|
|
3291
|
-
private activateOrbitControls;
|
|
3292
|
-
}
|
|
3293
|
-
import { NavigationMode } from "./types";
|
|
3294
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3295
|
-
/**
|
|
3296
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3297
|
-
*/
|
|
3298
|
-
export declare class PlanMode implements NavigationMode {
|
|
3299
|
-
private camera;
|
|
3300
|
-
/** {@link NavigationMode.enabled} */
|
|
3301
|
-
enabled: boolean;
|
|
3302
|
-
/** {@link NavigationMode.id} */
|
|
3303
|
-
readonly id = "Plan";
|
|
3304
|
-
private mouseAction1?;
|
|
3305
|
-
private mouseAction2?;
|
|
3306
|
-
private mouseInitialized;
|
|
3307
|
-
private readonly defaultAzimuthSpeed;
|
|
3308
|
-
private readonly defaultPolarSpeed;
|
|
3309
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3310
|
-
/** {@link NavigationMode.set} */
|
|
3311
|
-
set(active: boolean): void;
|
|
3420
|
+
updateAspect: () => void;
|
|
3421
|
+
private setupCamera;
|
|
3422
|
+
private newCameraControls;
|
|
3423
|
+
private setupEvents;
|
|
3424
|
+
private static getSubsetOfThree;
|
|
3312
3425
|
}
|
|
3313
3426
|
import * as THREE from "three";
|
|
3314
|
-
import {
|
|
3315
|
-
import { Event } from "../../Types";
|
|
3316
|
-
import {
|
|
3427
|
+
import { Components } from "../../Components";
|
|
3428
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3429
|
+
import { Mouse } from "./mouse";
|
|
3317
3430
|
/**
|
|
3318
|
-
*
|
|
3431
|
+
* 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.
|
|
3319
3432
|
*/
|
|
3320
|
-
export declare class
|
|
3321
|
-
/**
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3433
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
3434
|
+
/** {@link Component.enabled} */
|
|
3435
|
+
enabled: boolean;
|
|
3436
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3437
|
+
components: Components;
|
|
3438
|
+
/** {@link Disposable.onDisposed} */
|
|
3439
|
+
readonly onDisposed: Event<unknown>;
|
|
3440
|
+
/** The position of the mouse in the screen. */
|
|
3441
|
+
readonly mouse: Mouse;
|
|
3325
3442
|
/**
|
|
3326
|
-
*
|
|
3327
|
-
*
|
|
3443
|
+
* A reference to the Three.js Raycaster instance.
|
|
3444
|
+
* This is used for raycasting operations.
|
|
3328
3445
|
*/
|
|
3329
|
-
|
|
3446
|
+
readonly three: THREE.Raycaster;
|
|
3330
3447
|
/**
|
|
3331
|
-
*
|
|
3332
|
-
*
|
|
3448
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3449
|
+
* This is used to access the camera and meshes.
|
|
3333
3450
|
*/
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
private _previousDistance;
|
|
3339
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3451
|
+
world: World;
|
|
3452
|
+
constructor(components: Components, world: World);
|
|
3453
|
+
/** {@link Disposable.dispose} */
|
|
3454
|
+
dispose(): void;
|
|
3340
3455
|
/**
|
|
3341
|
-
*
|
|
3456
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3457
|
+
* the first item found. This also takes into account the clipping planes
|
|
3458
|
+
* used by the renderer.
|
|
3342
3459
|
*
|
|
3343
|
-
* @param
|
|
3344
|
-
* it will
|
|
3460
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3461
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3462
|
+
* {@link Components.meshes}.
|
|
3345
3463
|
*/
|
|
3346
|
-
|
|
3464
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3347
3465
|
/**
|
|
3348
|
-
*
|
|
3349
|
-
*
|
|
3466
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3467
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
3468
|
+
*
|
|
3469
|
+
* @param origin - The origin of the ray.
|
|
3470
|
+
* @param direction - The direction of the ray.
|
|
3471
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3472
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3350
3473
|
*/
|
|
3351
|
-
|
|
3352
|
-
private
|
|
3353
|
-
private
|
|
3354
|
-
private setupOrthoCamera;
|
|
3355
|
-
private getDistance;
|
|
3356
|
-
private setPerspectiveCamera;
|
|
3474
|
+
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;
|
|
3475
|
+
private intersect;
|
|
3476
|
+
private filterClippingPlanes;
|
|
3357
3477
|
}
|
|
3478
|
+
import * as THREE from "three";
|
|
3479
|
+
import { Disposable, Event } from "../../Types";
|
|
3358
3480
|
/**
|
|
3359
|
-
*
|
|
3360
|
-
*/
|
|
3361
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3362
|
-
/**
|
|
3363
|
-
* The extensible list of supported navigation modes.
|
|
3364
|
-
*/
|
|
3365
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3366
|
-
/**
|
|
3367
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3481
|
+
* 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.
|
|
3368
3482
|
*/
|
|
3369
|
-
export
|
|
3370
|
-
|
|
3371
|
-
|
|
3483
|
+
export declare class Mouse implements Disposable {
|
|
3484
|
+
dom: HTMLCanvasElement;
|
|
3485
|
+
private _event?;
|
|
3486
|
+
private _position;
|
|
3487
|
+
/** {@link Disposable.onDisposed} */
|
|
3488
|
+
readonly onDisposed: Event<unknown>;
|
|
3489
|
+
constructor(dom: HTMLCanvasElement);
|
|
3372
3490
|
/**
|
|
3373
|
-
*
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
enabled: boolean;
|
|
3491
|
+
* The real position of the mouse of the Three.js canvas.
|
|
3492
|
+
*/
|
|
3493
|
+
get position(): THREE.Vector2;
|
|
3494
|
+
/** {@link Disposable.dispose} */
|
|
3495
|
+
dispose(): void;
|
|
3496
|
+
private getPositionY;
|
|
3497
|
+
private getPositionX;
|
|
3498
|
+
private updateMouseInfo;
|
|
3499
|
+
private setupEvents;
|
|
3383
3500
|
}
|
|
3384
3501
|
import * as THREE from "three";
|
|
3385
3502
|
import { Components } from "../../Components";
|
|
@@ -3481,297 +3598,122 @@ import { Event, World, Disposable } from "../../Types";
|
|
|
3481
3598
|
*/
|
|
3482
3599
|
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3483
3600
|
/**
|
|
3484
|
-
* Event triggered when the visibility of meshes is updated.
|
|
3485
|
-
* Contains two sets: seen and unseen.
|
|
3486
|
-
*/
|
|
3487
|
-
readonly onViewUpdated: Event<{
|
|
3488
|
-
seen: Set<THREE.Mesh>;
|
|
3489
|
-
unseen: Set<THREE.Mesh>;
|
|
3490
|
-
}>;
|
|
3491
|
-
/**
|
|
3492
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
3493
|
-
* Default value is 100.
|
|
3494
|
-
*/
|
|
3495
|
-
threshold: number;
|
|
3496
|
-
/**
|
|
3497
|
-
* Map of color code to THREE.InstancedMesh.
|
|
3498
|
-
* Used to keep track of color-coded meshes.
|
|
3499
|
-
*/
|
|
3500
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3501
|
-
/**
|
|
3502
|
-
* Flag to indicate if the renderer is currently processing.
|
|
3503
|
-
* Used to prevent concurrent processing.
|
|
3504
|
-
*/
|
|
3505
|
-
isProcessing: boolean;
|
|
3506
|
-
private _interval;
|
|
3507
|
-
private _colorCodeMeshMap;
|
|
3508
|
-
private _meshIDColorCodeMap;
|
|
3509
|
-
private _currentVisibleMeshes;
|
|
3510
|
-
private _recentlyHiddenMeshes;
|
|
3511
|
-
private _intervalID;
|
|
3512
|
-
private readonly _transparentMat;
|
|
3513
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3514
|
-
/** {@link Disposable.dispose} */
|
|
3515
|
-
dispose(): void;
|
|
3516
|
-
/**
|
|
3517
|
-
* 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.
|
|
3518
|
-
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3519
|
-
* @returns {void}
|
|
3520
|
-
*/
|
|
3521
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3522
|
-
/**
|
|
3523
|
-
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3524
|
-
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3525
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3526
|
-
* @returns {void}
|
|
3527
|
-
*/
|
|
3528
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3529
|
-
/**
|
|
3530
|
-
* Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
3531
|
-
*
|
|
3532
|
-
* @param meshes - The meshes to update.
|
|
3533
|
-
*
|
|
3534
|
-
* @returns {void}
|
|
3535
|
-
*/
|
|
3536
|
-
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
3537
|
-
private handleWorkerMessage;
|
|
3538
|
-
private getAvailableMaterial;
|
|
3539
|
-
}
|
|
3540
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3541
|
-
import * as THREE from "three";
|
|
3542
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
3543
|
-
/**
|
|
3544
|
-
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
3545
|
-
*
|
|
3546
|
-
* @template T - The type of the scene. Default is BaseScene.
|
|
3547
|
-
* @template U - The type of the camera. Default is BaseCamera.
|
|
3548
|
-
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
3549
|
-
*/
|
|
3550
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
3551
|
-
/**
|
|
3552
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
3553
|
-
*/
|
|
3554
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
3555
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
3556
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
3557
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
3558
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
3559
|
-
/** {@link Disposable.onDisposed} */
|
|
3560
|
-
readonly onDisposed: Event<unknown>;
|
|
3561
|
-
/**
|
|
3562
|
-
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
3563
|
-
*/
|
|
3564
|
-
isDisposing: boolean;
|
|
3565
|
-
/**
|
|
3566
|
-
* Indicates whether the world is currently enabled.
|
|
3567
|
-
* When disabled, the world will not be updated.
|
|
3568
|
-
*/
|
|
3569
|
-
enabled: boolean;
|
|
3570
|
-
/**
|
|
3571
|
-
* A unique identifier for the world.
|
|
3572
|
-
*/
|
|
3573
|
-
uuid: string;
|
|
3574
|
-
/**
|
|
3575
|
-
* An optional name for the world.
|
|
3576
|
-
*/
|
|
3577
|
-
name?: string;
|
|
3578
|
-
private _scene?;
|
|
3579
|
-
private _camera?;
|
|
3580
|
-
private _renderer;
|
|
3581
|
-
/**
|
|
3582
|
-
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
3583
|
-
* @returns The current scene.
|
|
3584
|
-
*/
|
|
3585
|
-
get scene(): T;
|
|
3586
|
-
/**
|
|
3587
|
-
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
3588
|
-
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
3589
|
-
* @param scene - The new scene to be set.
|
|
3590
|
-
*/
|
|
3591
|
-
set scene(scene: T);
|
|
3592
|
-
/**
|
|
3593
|
-
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
3594
|
-
* @returns The current camera.
|
|
3595
|
-
*/
|
|
3596
|
-
get camera(): U;
|
|
3597
|
-
/**
|
|
3598
|
-
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
3599
|
-
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
3600
|
-
* @param camera - The new camera to be set.
|
|
3601
|
-
*/
|
|
3602
|
-
set camera(camera: U);
|
|
3603
|
-
/**
|
|
3604
|
-
* Getter for the renderer.
|
|
3605
|
-
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
3606
|
-
*/
|
|
3607
|
-
get renderer(): S | null;
|
|
3608
|
-
/**
|
|
3609
|
-
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
3610
|
-
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
3611
|
-
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
3612
|
-
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
3613
|
-
*/
|
|
3614
|
-
set renderer(renderer: S | null);
|
|
3615
|
-
/** {@link Updateable.update} */
|
|
3616
|
-
update(delta?: number): void;
|
|
3617
|
-
/** {@link Disposable.dispose} */
|
|
3618
|
-
dispose(disposeResources?: boolean): void;
|
|
3619
|
-
}
|
|
3620
|
-
import * as THREE from "three";
|
|
3621
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3622
|
-
import { Components } from "../../Components";
|
|
3623
|
-
/**
|
|
3624
|
-
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
3625
|
-
*/
|
|
3626
|
-
export interface SimpleSceneConfig {
|
|
3627
|
-
directionalLight: {
|
|
3628
|
-
color: THREE.Color;
|
|
3629
|
-
intensity: number;
|
|
3630
|
-
position: THREE.Vector3;
|
|
3631
|
-
};
|
|
3632
|
-
ambientLight: {
|
|
3633
|
-
color: THREE.Color;
|
|
3634
|
-
intensity: number;
|
|
3635
|
-
};
|
|
3636
|
-
}
|
|
3637
|
-
/**
|
|
3638
|
-
* 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.
|
|
3639
|
-
*/
|
|
3640
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3641
|
-
/** {@link Configurable.isSetup} */
|
|
3642
|
-
isSetup: boolean;
|
|
3643
|
-
/**
|
|
3644
|
-
* The underlying Three.js scene object.
|
|
3645
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3646
|
-
*/
|
|
3647
|
-
three: THREE.Scene;
|
|
3648
|
-
/** {@link Configurable.onSetup} */
|
|
3649
|
-
readonly onSetup: Event<SimpleScene>;
|
|
3650
|
-
/**
|
|
3651
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
3652
|
-
* Defines properties for directional and ambient lights.
|
|
3653
|
-
*/
|
|
3654
|
-
config: Required<SimpleSceneConfig>;
|
|
3655
|
-
constructor(components: Components);
|
|
3656
|
-
/** {@link Configurable.setup} */
|
|
3657
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3658
|
-
}
|
|
3659
|
-
import * as THREE from "three";
|
|
3660
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
3661
|
-
import { Components } from "../../Components";
|
|
3662
|
-
/**
|
|
3663
|
-
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3664
|
-
*/
|
|
3665
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
3666
|
-
/**
|
|
3667
|
-
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3668
|
-
* Default is 'true'.
|
|
3601
|
+
* Event triggered when the visibility of meshes is updated.
|
|
3602
|
+
* Contains two sets: seen and unseen.
|
|
3669
3603
|
*/
|
|
3670
|
-
|
|
3604
|
+
readonly onViewUpdated: Event<{
|
|
3605
|
+
seen: Set<THREE.Mesh>;
|
|
3606
|
+
unseen: Set<THREE.Mesh>;
|
|
3607
|
+
}>;
|
|
3671
3608
|
/**
|
|
3672
|
-
*
|
|
3609
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
3610
|
+
* Default value is 100.
|
|
3673
3611
|
*/
|
|
3674
|
-
|
|
3612
|
+
threshold: number;
|
|
3675
3613
|
/**
|
|
3676
|
-
*
|
|
3614
|
+
* Map of color code to THREE.InstancedMesh.
|
|
3615
|
+
* Used to keep track of color-coded meshes.
|
|
3677
3616
|
*/
|
|
3678
|
-
|
|
3679
|
-
protected _canvas: HTMLCanvasElement;
|
|
3680
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3681
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
3682
|
-
protected onContainerUpdated: Event<unknown>;
|
|
3683
|
-
private _resizing;
|
|
3617
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3684
3618
|
/**
|
|
3685
|
-
*
|
|
3686
|
-
*
|
|
3687
|
-
* @param components - The components instance.
|
|
3688
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3689
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3619
|
+
* Flag to indicate if the renderer is currently processing.
|
|
3620
|
+
* Used to prevent concurrent processing.
|
|
3690
3621
|
*/
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3622
|
+
isProcessing: boolean;
|
|
3623
|
+
private _interval;
|
|
3624
|
+
private _colorCodeMeshMap;
|
|
3625
|
+
private _meshIDColorCodeMap;
|
|
3626
|
+
private _currentVisibleMeshes;
|
|
3627
|
+
private _recentlyHiddenMeshes;
|
|
3628
|
+
private _intervalID;
|
|
3629
|
+
private readonly _transparentMat;
|
|
3630
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3694
3631
|
/** {@link Disposable.dispose} */
|
|
3695
3632
|
dispose(): void;
|
|
3696
|
-
/** {@link Resizeable.getSize}. */
|
|
3697
|
-
getSize(): THREE.Vector2;
|
|
3698
|
-
/** {@link Resizeable.resize} */
|
|
3699
|
-
resize: (size?: THREE.Vector2) => void;
|
|
3700
3633
|
/**
|
|
3701
|
-
*
|
|
3634
|
+
* 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.
|
|
3635
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3636
|
+
* @returns {void}
|
|
3637
|
+
*/
|
|
3638
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3639
|
+
/**
|
|
3640
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3641
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3642
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3643
|
+
* @returns {void}
|
|
3644
|
+
*/
|
|
3645
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3646
|
+
/**
|
|
3647
|
+
* Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
3702
3648
|
*
|
|
3703
|
-
* @param
|
|
3649
|
+
* @param meshes - The meshes to update.
|
|
3704
3650
|
*
|
|
3705
|
-
* @
|
|
3651
|
+
* @returns {void}
|
|
3706
3652
|
*/
|
|
3707
|
-
|
|
3708
|
-
private
|
|
3709
|
-
private
|
|
3710
|
-
private onContextLost;
|
|
3711
|
-
private onContextBack;
|
|
3653
|
+
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
3654
|
+
private handleWorkerMessage;
|
|
3655
|
+
private getAvailableMaterial;
|
|
3712
3656
|
}
|
|
3713
3657
|
import * as THREE from "three";
|
|
3714
|
-
import
|
|
3715
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3658
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3716
3659
|
import { Components } from "../../Components";
|
|
3717
3660
|
/**
|
|
3718
|
-
*
|
|
3661
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
3719
3662
|
*/
|
|
3720
|
-
export
|
|
3721
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
3722
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3723
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
3724
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3663
|
+
export interface GridConfig {
|
|
3725
3664
|
/**
|
|
3726
|
-
*
|
|
3727
|
-
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3665
|
+
* The color of the grid lines.
|
|
3728
3666
|
*/
|
|
3729
|
-
|
|
3730
|
-
/** {@link Disposable.onDisposed} */
|
|
3731
|
-
readonly onDisposed: Event<string>;
|
|
3667
|
+
color: THREE.Color;
|
|
3732
3668
|
/**
|
|
3733
|
-
*
|
|
3734
|
-
* This camera is used for rendering the scene.
|
|
3669
|
+
* The size of the primary grid lines.
|
|
3735
3670
|
*/
|
|
3736
|
-
|
|
3737
|
-
private _allControls;
|
|
3671
|
+
size1: number;
|
|
3738
3672
|
/**
|
|
3739
|
-
* The
|
|
3740
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3741
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
3742
|
-
* object to move, rotate, look at objects, etc.
|
|
3673
|
+
* The size of the secondary grid lines.
|
|
3743
3674
|
*/
|
|
3744
|
-
|
|
3675
|
+
size2: number;
|
|
3745
3676
|
/**
|
|
3746
|
-
*
|
|
3747
|
-
* If the current world is null, it returns false.
|
|
3748
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
3749
|
-
*
|
|
3750
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
3677
|
+
* The distance at which the grid lines start to fade away.
|
|
3751
3678
|
*/
|
|
3752
|
-
|
|
3679
|
+
distance: number;
|
|
3680
|
+
}
|
|
3681
|
+
/**
|
|
3682
|
+
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
3683
|
+
*/
|
|
3684
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3685
|
+
/** {@link Disposable.onDisposed} */
|
|
3686
|
+
readonly onDisposed: Event<unknown>;
|
|
3687
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3688
|
+
world: World;
|
|
3689
|
+
/** The components instance to which this grid belongs. */
|
|
3690
|
+
components: Components;
|
|
3691
|
+
/** {@link Hideable.visible} */
|
|
3692
|
+
get visible(): boolean;
|
|
3693
|
+
/** {@link Hideable.visible} */
|
|
3694
|
+
set visible(visible: boolean);
|
|
3695
|
+
/** The material of the grid. */
|
|
3696
|
+
get material(): THREE.ShaderMaterial;
|
|
3753
3697
|
/**
|
|
3754
|
-
*
|
|
3755
|
-
*
|
|
3756
|
-
*
|
|
3757
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3698
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3699
|
+
* perspective cameras and false for orthographic cameras.
|
|
3758
3700
|
*/
|
|
3759
|
-
|
|
3760
|
-
constructor(components: Components);
|
|
3761
|
-
/** {@link Disposable.dispose} */
|
|
3762
|
-
dispose(): void;
|
|
3763
|
-
/** {@link Updateable.update} */
|
|
3764
|
-
update(_delta: number): void;
|
|
3701
|
+
get fade(): boolean;
|
|
3765
3702
|
/**
|
|
3766
|
-
*
|
|
3767
|
-
*
|
|
3703
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3704
|
+
* perspective cameras and false for orthographic cameras.
|
|
3768
3705
|
*/
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3706
|
+
set fade(active: boolean);
|
|
3707
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3708
|
+
readonly three: THREE.Mesh;
|
|
3709
|
+
private _fade;
|
|
3710
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
3711
|
+
/** {@link Disposable.dispose} */
|
|
3712
|
+
dispose(): void;
|
|
3772
3713
|
private setupEvents;
|
|
3773
|
-
private
|
|
3714
|
+
private updateZoom;
|
|
3774
3715
|
}
|
|
3716
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3775
3717
|
import { SimplePlane } from "../../Clipper";
|
|
3776
3718
|
import { DataSet } from "../../Types";
|
|
3777
3719
|
export interface ViewpointCamera {
|
|
@@ -3805,6 +3747,22 @@ export interface BCFViewpoint {
|
|
|
3805
3747
|
openingsVisible: boolean;
|
|
3806
3748
|
defaultVisibility: boolean;
|
|
3807
3749
|
}
|
|
3750
|
+
import { NavigationMode } from "./types";
|
|
3751
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3752
|
+
/**
|
|
3753
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3754
|
+
*/
|
|
3755
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3756
|
+
private camera;
|
|
3757
|
+
/** {@link NavigationMode.enabled} */
|
|
3758
|
+
enabled: boolean;
|
|
3759
|
+
/** {@link NavigationMode.id} */
|
|
3760
|
+
readonly id = "FirstPerson";
|
|
3761
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3762
|
+
/** {@link NavigationMode.set} */
|
|
3763
|
+
set(active: boolean): void;
|
|
3764
|
+
private setupFirstPersonCamera;
|
|
3765
|
+
}
|
|
3808
3766
|
import * as THREE from "three";
|
|
3809
3767
|
import * as FRAGS from "@thatopen/fragments";
|
|
3810
3768
|
import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
|
|
@@ -3995,91 +3953,179 @@ export declare class Viewpoint implements BCFViewpoint {
|
|
|
3995
3953
|
*/
|
|
3996
3954
|
serialize(version?: import("../../../openbim/BCFTopics").BCFVersion): Promise<string>;
|
|
3997
3955
|
}
|
|
3956
|
+
import { NavigationMode } from "./types";
|
|
3957
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3958
|
+
/**
|
|
3959
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3960
|
+
*/
|
|
3961
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3962
|
+
camera: OrthoPerspectiveCamera;
|
|
3963
|
+
/** {@link NavigationMode.enabled} */
|
|
3964
|
+
enabled: boolean;
|
|
3965
|
+
/** {@link NavigationMode.id} */
|
|
3966
|
+
readonly id = "Orbit";
|
|
3967
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3968
|
+
/** {@link NavigationMode.set} */
|
|
3969
|
+
set(active: boolean): void;
|
|
3970
|
+
private activateOrbitControls;
|
|
3971
|
+
}
|
|
3972
|
+
import { NavigationMode } from "./types";
|
|
3973
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3974
|
+
/**
|
|
3975
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3976
|
+
*/
|
|
3977
|
+
export declare class PlanMode implements NavigationMode {
|
|
3978
|
+
private camera;
|
|
3979
|
+
/** {@link NavigationMode.enabled} */
|
|
3980
|
+
enabled: boolean;
|
|
3981
|
+
/** {@link NavigationMode.id} */
|
|
3982
|
+
readonly id = "Plan";
|
|
3983
|
+
private mouseAction1?;
|
|
3984
|
+
private mouseAction2?;
|
|
3985
|
+
private mouseInitialized;
|
|
3986
|
+
private readonly defaultAzimuthSpeed;
|
|
3987
|
+
private readonly defaultPolarSpeed;
|
|
3988
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3989
|
+
/** {@link NavigationMode.set} */
|
|
3990
|
+
set(active: boolean): void;
|
|
3991
|
+
}
|
|
3998
3992
|
import * as THREE from "three";
|
|
3999
|
-
import {
|
|
3993
|
+
import { CameraProjection } from "./types";
|
|
3994
|
+
import { Event } from "../../Types";
|
|
3995
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3996
|
+
/**
|
|
3997
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3998
|
+
*/
|
|
3999
|
+
export declare class ProjectionManager {
|
|
4000
|
+
/**
|
|
4001
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
4002
|
+
*/
|
|
4003
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
4004
|
+
/**
|
|
4005
|
+
* Current projection mode of the camera.
|
|
4006
|
+
* Default is "Perspective".
|
|
4007
|
+
*/
|
|
4008
|
+
current: CameraProjection;
|
|
4009
|
+
/**
|
|
4010
|
+
* The camera controlled by this ProjectionManager.
|
|
4011
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
4012
|
+
*/
|
|
4013
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
4014
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
4015
|
+
matchOrthoDistanceEnabled: boolean;
|
|
4016
|
+
private _component;
|
|
4017
|
+
private _previousDistance;
|
|
4018
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
4019
|
+
/**
|
|
4020
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
4021
|
+
*
|
|
4022
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
4023
|
+
* it will have no effect.
|
|
4024
|
+
*/
|
|
4025
|
+
set(projection: CameraProjection): Promise<void>;
|
|
4026
|
+
/**
|
|
4027
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
4028
|
+
* and vice versa.
|
|
4029
|
+
*/
|
|
4030
|
+
toggle(): Promise<void>;
|
|
4031
|
+
private setOrthoCamera;
|
|
4032
|
+
private getPerspectiveDims;
|
|
4033
|
+
private setupOrthoCamera;
|
|
4034
|
+
private getDistance;
|
|
4035
|
+
private setPerspectiveCamera;
|
|
4036
|
+
}
|
|
4037
|
+
/**
|
|
4038
|
+
* The projection system of the camera.
|
|
4039
|
+
*/
|
|
4040
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
4000
4041
|
/**
|
|
4001
|
-
*
|
|
4042
|
+
* The extensible list of supported navigation modes.
|
|
4002
4043
|
*/
|
|
4003
|
-
export
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4044
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
4045
|
+
/**
|
|
4046
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
4047
|
+
*/
|
|
4048
|
+
export interface NavigationMode {
|
|
4049
|
+
/** The unique ID of this navigation mode. */
|
|
4050
|
+
id: NavModeID;
|
|
4010
4051
|
/**
|
|
4011
|
-
*
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4052
|
+
* Enable or disable this navigation mode.
|
|
4053
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
4054
|
+
* must be disabled.
|
|
4055
|
+
*
|
|
4056
|
+
* @param active - whether to enable or disable this mode.
|
|
4057
|
+
* @param options - any additional data required to enable or disable it.
|
|
4058
|
+
* */
|
|
4059
|
+
set: (active: boolean, options?: any) => void;
|
|
4060
|
+
/** Whether this navigation mode is active or not. */
|
|
4061
|
+
enabled: boolean;
|
|
4020
4062
|
}
|
|
4021
4063
|
import * as THREE from "three";
|
|
4064
|
+
import { Event, World } from "../../Types";
|
|
4022
4065
|
import { Components } from "../../Components";
|
|
4023
|
-
import { Event, World, Disposable } from "../../Types";
|
|
4024
|
-
import { Mouse } from "./mouse";
|
|
4025
4066
|
/**
|
|
4026
|
-
* A
|
|
4067
|
+
* A base renderer to determine visibility on screen.
|
|
4027
4068
|
*/
|
|
4028
|
-
export declare class
|
|
4029
|
-
/** {@link Component.enabled} */
|
|
4030
|
-
enabled: boolean;
|
|
4031
|
-
/** The components instance to which this Raycaster belongs. */
|
|
4032
|
-
components: Components;
|
|
4069
|
+
export declare class DistanceRenderer {
|
|
4033
4070
|
/** {@link Disposable.onDisposed} */
|
|
4034
|
-
readonly onDisposed: Event<
|
|
4035
|
-
/** The position of the mouse in the screen. */
|
|
4036
|
-
readonly mouse: Mouse;
|
|
4071
|
+
readonly onDisposed: Event<string>;
|
|
4037
4072
|
/**
|
|
4038
|
-
*
|
|
4039
|
-
*
|
|
4073
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
4074
|
+
* meshes that are currently visible, and the ones that were visible
|
|
4075
|
+
* just before but not anymore.
|
|
4040
4076
|
*/
|
|
4041
|
-
readonly
|
|
4077
|
+
readonly onDistanceComputed: Event<number>;
|
|
4042
4078
|
/**
|
|
4043
|
-
*
|
|
4044
|
-
* This is used to access the camera and meshes.
|
|
4079
|
+
* Objects that won't be taken into account in the distance check.
|
|
4045
4080
|
*/
|
|
4046
|
-
|
|
4047
|
-
constructor(components: Components, world: World);
|
|
4048
|
-
/** {@link Disposable.dispose} */
|
|
4049
|
-
dispose(): void;
|
|
4081
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
4050
4082
|
/**
|
|
4051
|
-
*
|
|
4052
|
-
* the first item found. This also takes into account the clipping planes
|
|
4053
|
-
* used by the renderer.
|
|
4054
|
-
*
|
|
4055
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
4056
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
4057
|
-
* {@link Components.meshes}.
|
|
4083
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
4058
4084
|
*/
|
|
4059
|
-
|
|
4085
|
+
enabled: boolean;
|
|
4060
4086
|
/**
|
|
4061
|
-
*
|
|
4062
|
-
*
|
|
4063
|
-
*
|
|
4064
|
-
* @param origin - The origin of the ray.
|
|
4065
|
-
* @param direction - The direction of the ray.
|
|
4066
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
4067
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
4087
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
4088
|
+
* for debugging purposes.
|
|
4068
4089
|
*/
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
}
|
|
4073
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
4074
|
-
/**
|
|
4075
|
-
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
4076
|
-
*/
|
|
4077
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
4090
|
+
renderDebugFrame: boolean;
|
|
4091
|
+
/** The components instance to which this renderer belongs. */
|
|
4092
|
+
components: Components;
|
|
4078
4093
|
/**
|
|
4079
|
-
*
|
|
4080
|
-
* Defaults to 100 properties.
|
|
4094
|
+
* The scene where the distance is computed.
|
|
4081
4095
|
*/
|
|
4082
|
-
|
|
4096
|
+
scene: THREE.Scene;
|
|
4097
|
+
/**
|
|
4098
|
+
* The camera used to compute the distance.
|
|
4099
|
+
*/
|
|
4100
|
+
camera: THREE.OrthographicCamera;
|
|
4101
|
+
/**
|
|
4102
|
+
* The material used to compute the distance.
|
|
4103
|
+
*/
|
|
4104
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
4105
|
+
/** The world instance to which this renderer belongs. */
|
|
4106
|
+
readonly world: World;
|
|
4107
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
4108
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
4109
|
+
protected readonly worker: Worker;
|
|
4110
|
+
private _width;
|
|
4111
|
+
private _height;
|
|
4112
|
+
private readonly _postQuad;
|
|
4113
|
+
private readonly tempRT;
|
|
4114
|
+
private readonly resultRT;
|
|
4115
|
+
private readonly bufferSize;
|
|
4116
|
+
private readonly _buffer;
|
|
4117
|
+
protected _isWorkerBusy: boolean;
|
|
4118
|
+
constructor(components: Components, world: World);
|
|
4119
|
+
/** {@link Disposable.dispose} */
|
|
4120
|
+
dispose(): void;
|
|
4121
|
+
/**
|
|
4122
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
4123
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
4124
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
4125
|
+
* not true.
|
|
4126
|
+
*/
|
|
4127
|
+
compute: () => Promise<void>;
|
|
4128
|
+
private handleWorkerMessage;
|
|
4083
4129
|
}
|
|
4084
4130
|
import * as THREE from "three";
|
|
4085
4131
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -4180,6 +4226,51 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
4180
4226
|
private newHelper;
|
|
4181
4227
|
private static newPlaneMesh;
|
|
4182
4228
|
}
|
|
4229
|
+
/**
|
|
4230
|
+
* 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.
|
|
4231
|
+
*/
|
|
4232
|
+
export interface StreamedGeometries {
|
|
4233
|
+
[id: number]: {
|
|
4234
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
4235
|
+
boundingBox: Float32Array;
|
|
4236
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
4237
|
+
hasHoles: boolean;
|
|
4238
|
+
/** An optional file path for the geometry data. */
|
|
4239
|
+
geometryFile?: string;
|
|
4240
|
+
};
|
|
4241
|
+
}
|
|
4242
|
+
/**
|
|
4243
|
+
* 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.
|
|
4244
|
+
*/
|
|
4245
|
+
export interface StreamedAsset {
|
|
4246
|
+
/** The unique identifier of the asset. */
|
|
4247
|
+
id: number;
|
|
4248
|
+
/** An array of geometries associated with the asset. */
|
|
4249
|
+
geometries: {
|
|
4250
|
+
/** The unique identifier of the geometry. */
|
|
4251
|
+
geometryID: number;
|
|
4252
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
4253
|
+
transformation: number[];
|
|
4254
|
+
/** The color of the geometry as a number array. */
|
|
4255
|
+
color: number[];
|
|
4256
|
+
}[];
|
|
4257
|
+
}
|
|
4258
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
4259
|
+
/**
|
|
4260
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
4261
|
+
*/
|
|
4262
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
4263
|
+
/**
|
|
4264
|
+
* Minimum number of geometries to be streamed.
|
|
4265
|
+
* Defaults to 10 geometries.
|
|
4266
|
+
*/
|
|
4267
|
+
minGeometrySize: number;
|
|
4268
|
+
/**
|
|
4269
|
+
* Minimum amount of assets to be streamed.
|
|
4270
|
+
* Defaults to 1000 assets.
|
|
4271
|
+
*/
|
|
4272
|
+
minAssetsSize: number;
|
|
4273
|
+
}
|
|
4183
4274
|
import * as THREE from "three";
|
|
4184
4275
|
import * as WEBIFC from "web-ifc";
|
|
4185
4276
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -4196,6 +4287,21 @@ export declare class CivilReader {
|
|
|
4196
4287
|
private getCurves;
|
|
4197
4288
|
}
|
|
4198
4289
|
import * as WEBIFC from "web-ifc";
|
|
4290
|
+
export declare class IfcMetadataReader {
|
|
4291
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
4292
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
4293
|
+
}
|
|
4294
|
+
import { IfcRelName } from "./types";
|
|
4295
|
+
type IfcRelAttributePosition = {
|
|
4296
|
+
related: number;
|
|
4297
|
+
relating: number;
|
|
4298
|
+
};
|
|
4299
|
+
export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
|
|
4300
|
+
export {};
|
|
4301
|
+
import { IfcRelName } from "./types";
|
|
4302
|
+
import { IfcRelation } from "../../IfcRelationsIndexer";
|
|
4303
|
+
export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
|
|
4304
|
+
import * as WEBIFC from "web-ifc";
|
|
4199
4305
|
import * as THREE from "three";
|
|
4200
4306
|
export declare class Units {
|
|
4201
4307
|
factor: number;
|
|
@@ -4205,55 +4311,171 @@ export declare class Units {
|
|
|
4205
4311
|
private getLengthUnits;
|
|
4206
4312
|
private getScaleMatrix;
|
|
4207
4313
|
}
|
|
4208
|
-
|
|
4314
|
+
export type IfcRelationNames = [
|
|
4315
|
+
"IfcRelAssignsToControl",
|
|
4316
|
+
"IfcRelAssignsToGroup",
|
|
4317
|
+
"IfcRelAssignsToProduct",
|
|
4318
|
+
"IfcRelAssociatesClassification",
|
|
4319
|
+
"IfcRelAssociatesMaterial",
|
|
4320
|
+
"IfcRelAssociatesDocument",
|
|
4321
|
+
"IfcRelContainedInSpatialStructure",
|
|
4322
|
+
"IfcRelFlowControlElements",
|
|
4323
|
+
"IfcRelConnectsElements",
|
|
4324
|
+
"IfcRelDeclares",
|
|
4325
|
+
"IfcRelAggregates",
|
|
4326
|
+
"IfcRelNests",
|
|
4327
|
+
"IfcRelDefinesByProperties",
|
|
4328
|
+
"IfcRelDefinesByType",
|
|
4329
|
+
"IfcRelDefinesByTemplate"
|
|
4330
|
+
];
|
|
4331
|
+
export type IfcRelName = IfcRelationNames[number];
|
|
4332
|
+
import * as WEBIFC from "web-ifc";
|
|
4333
|
+
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
4334
|
+
export interface ModelsRelationMap {
|
|
4335
|
+
[modelID: string]: RelationsMap;
|
|
4336
|
+
}
|
|
4337
|
+
/**
|
|
4338
|
+
* Type alias for an array of inverse attribute names.
|
|
4339
|
+
*/
|
|
4340
|
+
export type InverseAttributes = [
|
|
4341
|
+
"IsDecomposedBy",
|
|
4342
|
+
"Decomposes",
|
|
4343
|
+
"AssociatedTo",
|
|
4344
|
+
"HasAssociations",
|
|
4345
|
+
"ClassificationForObjects",
|
|
4346
|
+
"IsGroupedBy",
|
|
4347
|
+
"HasAssignments",
|
|
4348
|
+
"IsDefinedBy",
|
|
4349
|
+
"DefinesOcurrence",
|
|
4350
|
+
"IsTypedBy",
|
|
4351
|
+
"Types",
|
|
4352
|
+
"Defines",
|
|
4353
|
+
"ContainedInStructure",
|
|
4354
|
+
"ContainsElements",
|
|
4355
|
+
"HasControlElements",
|
|
4356
|
+
"AssignedToFlowElement",
|
|
4357
|
+
"ConnectedTo",
|
|
4358
|
+
"ConnectedFrom",
|
|
4359
|
+
"ReferencedBy",
|
|
4360
|
+
"Declares",
|
|
4361
|
+
"HasContext",
|
|
4362
|
+
"Controls",
|
|
4363
|
+
"IsNestedBy",
|
|
4364
|
+
"Nests",
|
|
4365
|
+
"DocumentRefForObjects"
|
|
4366
|
+
];
|
|
4367
|
+
export type InverseAttribute = InverseAttributes[number];
|
|
4368
|
+
/**
|
|
4369
|
+
* Type alias for an array of IfcRelation types from WebIfc.
|
|
4370
|
+
*/
|
|
4371
|
+
export type IfcRelations = [
|
|
4372
|
+
typeof WEBIFC.IFCRELAGGREGATES,
|
|
4373
|
+
typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
|
|
4374
|
+
typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
|
|
4375
|
+
typeof WEBIFC.IFCRELASSIGNSTOGROUP,
|
|
4376
|
+
typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
|
|
4377
|
+
typeof WEBIFC.IFCRELDEFINESBYTYPE,
|
|
4378
|
+
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
4379
|
+
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
4380
|
+
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
4381
|
+
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
4382
|
+
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
4383
|
+
typeof WEBIFC.IFCRELDECLARES,
|
|
4384
|
+
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
4385
|
+
typeof WEBIFC.IFCRELNESTS,
|
|
4386
|
+
typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
|
|
4387
|
+
];
|
|
4388
|
+
export type IfcRelation = IfcRelations[number];
|
|
4389
|
+
export type BCFVersion = "2.1" | "3";
|
|
4390
|
+
export interface BCFTopic {
|
|
4391
|
+
guid: string;
|
|
4392
|
+
serverAssignedId?: string;
|
|
4393
|
+
type: string;
|
|
4394
|
+
status: string;
|
|
4395
|
+
title: string;
|
|
4396
|
+
priority?: string;
|
|
4397
|
+
index?: number;
|
|
4398
|
+
labels: Set<string>;
|
|
4399
|
+
creationDate: Date;
|
|
4400
|
+
creationAuthor: string;
|
|
4401
|
+
modifiedDate?: Date;
|
|
4402
|
+
modifiedAuthor?: string;
|
|
4403
|
+
dueDate?: Date;
|
|
4404
|
+
assignedTo?: string;
|
|
4405
|
+
description?: string;
|
|
4406
|
+
stage?: string;
|
|
4407
|
+
}
|
|
4209
4408
|
/**
|
|
4210
|
-
*
|
|
4409
|
+
* Configuration settings for managing BCF topics.
|
|
4410
|
+
* This interface defines the properties and their meanings used to control the behavior of exporting and importing BCF topics.
|
|
4211
4411
|
*/
|
|
4212
|
-
export
|
|
4412
|
+
export interface BCFTopicsConfig {
|
|
4213
4413
|
/**
|
|
4214
|
-
*
|
|
4215
|
-
* Defaults to 10 geometries.
|
|
4414
|
+
* The BCF version used during export.
|
|
4216
4415
|
*/
|
|
4217
|
-
|
|
4416
|
+
version: BCFVersion;
|
|
4218
4417
|
/**
|
|
4219
|
-
*
|
|
4220
|
-
* Defaults to 1000 assets.
|
|
4418
|
+
* The email of the user creating topics using this component.
|
|
4221
4419
|
*/
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
/**
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4420
|
+
author: string;
|
|
4421
|
+
/**
|
|
4422
|
+
* The set of allowed topic types. This is exported inside the
|
|
4423
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4424
|
+
*/
|
|
4425
|
+
types: Set<string>;
|
|
4426
|
+
/**
|
|
4427
|
+
* The set of allowed topic statuses. This is exported inside the
|
|
4428
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4429
|
+
*/
|
|
4430
|
+
statuses: Set<string>;
|
|
4431
|
+
/**
|
|
4432
|
+
* The set of allowed topic priorities. This is exported inside the
|
|
4433
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4434
|
+
*/
|
|
4435
|
+
priorities: Set<string>;
|
|
4436
|
+
/**
|
|
4437
|
+
* The set of allowed topic labels. This is exported inside the
|
|
4438
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4439
|
+
*/
|
|
4440
|
+
labels: Set<string>;
|
|
4441
|
+
/**
|
|
4442
|
+
* The set of allowed topic stages. This is exported inside the
|
|
4443
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4444
|
+
*/
|
|
4445
|
+
stages: Set<string>;
|
|
4446
|
+
/**
|
|
4447
|
+
* The set of allowed topic users. This is exported inside the
|
|
4448
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4449
|
+
*/
|
|
4450
|
+
users: Set<string>;
|
|
4451
|
+
/**
|
|
4452
|
+
* Whether or not to include the AuthoringSoftwareId in the viewpoint components during export.
|
|
4453
|
+
*/
|
|
4454
|
+
includeSelectionTag: boolean;
|
|
4455
|
+
/**
|
|
4456
|
+
* Updates the types, statuses, users, etc., after importing an external BCF.
|
|
4457
|
+
*/
|
|
4458
|
+
updateExtensionsOnImport: boolean;
|
|
4459
|
+
/**
|
|
4460
|
+
* Only allow to use the extensions (types, statuses, etc.) defined in the config when setting the corresponding data in a topic.
|
|
4461
|
+
*/
|
|
4462
|
+
strict: boolean;
|
|
4463
|
+
/**
|
|
4464
|
+
* If true, export the extensions (types, status, etc.) based on topics data. This doesn't update the extensions in the config.
|
|
4465
|
+
* If false, only export the extensions defined in each collection of possibilities set in the config.
|
|
4466
|
+
* In all cases, all the values from each collection of extensions defined in the config are going to be exported.
|
|
4467
|
+
*/
|
|
4468
|
+
includeAllExtensionsOnExport: boolean;
|
|
4469
|
+
/**
|
|
4470
|
+
* Version to be used when importing if no bcf.version file is present in the incoming data.
|
|
4471
|
+
* When null, the importer will throw an error if the version is missing or is not supported.
|
|
4472
|
+
*/
|
|
4473
|
+
fallbackVersionOnImport: BCFVersion | null;
|
|
4474
|
+
/**
|
|
4475
|
+
* If true, do not import a topic with missing information (guid, type, status, title, creationDate or creationAuthor).
|
|
4476
|
+
* If false, use default values for missing data.
|
|
4477
|
+
*/
|
|
4478
|
+
ignoreIncompleteTopicsOnImport: boolean;
|
|
4257
4479
|
}
|
|
4258
4480
|
import { Components } from "../../../core/Components";
|
|
4259
4481
|
import { Viewpoint } from "../../../core/Viewpoints";
|
|
@@ -4378,97 +4600,6 @@ export declare class Topic implements BCFTopic {
|
|
|
4378
4600
|
*/
|
|
4379
4601
|
serialize(): string;
|
|
4380
4602
|
}
|
|
4381
|
-
export type BCFVersion = "2.1" | "3";
|
|
4382
|
-
export interface BCFTopic {
|
|
4383
|
-
guid: string;
|
|
4384
|
-
serverAssignedId?: string;
|
|
4385
|
-
type: string;
|
|
4386
|
-
status: string;
|
|
4387
|
-
title: string;
|
|
4388
|
-
priority?: string;
|
|
4389
|
-
index?: number;
|
|
4390
|
-
labels: Set<string>;
|
|
4391
|
-
creationDate: Date;
|
|
4392
|
-
creationAuthor: string;
|
|
4393
|
-
modifiedDate?: Date;
|
|
4394
|
-
modifiedAuthor?: string;
|
|
4395
|
-
dueDate?: Date;
|
|
4396
|
-
assignedTo?: string;
|
|
4397
|
-
description?: string;
|
|
4398
|
-
stage?: string;
|
|
4399
|
-
}
|
|
4400
|
-
/**
|
|
4401
|
-
* Configuration settings for managing BCF topics.
|
|
4402
|
-
* This interface defines the properties and their meanings used to control the behavior of exporting and importing BCF topics.
|
|
4403
|
-
*/
|
|
4404
|
-
export interface BCFTopicsConfig {
|
|
4405
|
-
/**
|
|
4406
|
-
* The BCF version used during export.
|
|
4407
|
-
*/
|
|
4408
|
-
version: BCFVersion;
|
|
4409
|
-
/**
|
|
4410
|
-
* The email of the user creating topics using this component.
|
|
4411
|
-
*/
|
|
4412
|
-
author: string;
|
|
4413
|
-
/**
|
|
4414
|
-
* The set of allowed topic types. This is exported inside the
|
|
4415
|
-
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4416
|
-
*/
|
|
4417
|
-
types: Set<string>;
|
|
4418
|
-
/**
|
|
4419
|
-
* The set of allowed topic statuses. This is exported inside the
|
|
4420
|
-
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4421
|
-
*/
|
|
4422
|
-
statuses: Set<string>;
|
|
4423
|
-
/**
|
|
4424
|
-
* The set of allowed topic priorities. This is exported inside the
|
|
4425
|
-
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4426
|
-
*/
|
|
4427
|
-
priorities: Set<string>;
|
|
4428
|
-
/**
|
|
4429
|
-
* The set of allowed topic labels. This is exported inside the
|
|
4430
|
-
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4431
|
-
*/
|
|
4432
|
-
labels: Set<string>;
|
|
4433
|
-
/**
|
|
4434
|
-
* The set of allowed topic stages. This is exported inside the
|
|
4435
|
-
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4436
|
-
*/
|
|
4437
|
-
stages: Set<string>;
|
|
4438
|
-
/**
|
|
4439
|
-
* The set of allowed topic users. This is exported inside the
|
|
4440
|
-
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
4441
|
-
*/
|
|
4442
|
-
users: Set<string>;
|
|
4443
|
-
/**
|
|
4444
|
-
* Whether or not to include the AuthoringSoftwareId in the viewpoint components during export.
|
|
4445
|
-
*/
|
|
4446
|
-
includeSelectionTag: boolean;
|
|
4447
|
-
/**
|
|
4448
|
-
* Updates the types, statuses, users, etc., after importing an external BCF.
|
|
4449
|
-
*/
|
|
4450
|
-
updateExtensionsOnImport: boolean;
|
|
4451
|
-
/**
|
|
4452
|
-
* Only allow to use the extensions (types, statuses, etc.) defined in the config when setting the corresponding data in a topic.
|
|
4453
|
-
*/
|
|
4454
|
-
strict: boolean;
|
|
4455
|
-
/**
|
|
4456
|
-
* If true, export the extensions (types, status, etc.) based on topics data. This doesn't update the extensions in the config.
|
|
4457
|
-
* If false, only export the extensions defined in each collection of possibilities set in the config.
|
|
4458
|
-
* In all cases, all the values from each collection of extensions defined in the config are going to be exported.
|
|
4459
|
-
*/
|
|
4460
|
-
includeAllExtensionsOnExport: boolean;
|
|
4461
|
-
/**
|
|
4462
|
-
* Version to be used when importing if no bcf.version file is present in the incoming data.
|
|
4463
|
-
* When null, the importer will throw an error if the version is missing or is not supported.
|
|
4464
|
-
*/
|
|
4465
|
-
fallbackVersionOnImport: BCFVersion | null;
|
|
4466
|
-
/**
|
|
4467
|
-
* If true, do not import a topic with missing information (guid, type, status, title, creationDate or creationAuthor).
|
|
4468
|
-
* If false, use default values for missing data.
|
|
4469
|
-
*/
|
|
4470
|
-
ignoreIncompleteTopicsOnImport: boolean;
|
|
4471
|
-
}
|
|
4472
4603
|
import { BCFTopics } from "../..";
|
|
4473
4604
|
export declare const extensionsImporter: (manager: BCFTopics, extensionsXML: string) => void;
|
|
4474
4605
|
import { BufferGeometry } from "three";
|
|
@@ -4476,60 +4607,5 @@ import * as THREE from "three";
|
|
|
4476
4607
|
export declare class TransformHelper {
|
|
4477
4608
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
4478
4609
|
}
|
|
4479
|
-
import * as WEBIFC from "web-ifc";
|
|
4480
|
-
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
4481
|
-
export interface ModelsRelationMap {
|
|
4482
|
-
[modelID: string]: RelationsMap;
|
|
4483
|
-
}
|
|
4484
|
-
/**
|
|
4485
|
-
* Type alias for an array of inverse attribute names.
|
|
4486
|
-
*/
|
|
4487
|
-
export type InverseAttributes = [
|
|
4488
|
-
"IsDecomposedBy",
|
|
4489
|
-
"Decomposes",
|
|
4490
|
-
"AssociatedTo",
|
|
4491
|
-
"HasAssociations",
|
|
4492
|
-
"ClassificationForObjects",
|
|
4493
|
-
"IsGroupedBy",
|
|
4494
|
-
"HasAssignments",
|
|
4495
|
-
"IsDefinedBy",
|
|
4496
|
-
"DefinesOcurrence",
|
|
4497
|
-
"IsTypedBy",
|
|
4498
|
-
"Types",
|
|
4499
|
-
"Defines",
|
|
4500
|
-
"ContainedInStructure",
|
|
4501
|
-
"ContainsElements",
|
|
4502
|
-
"HasControlElements",
|
|
4503
|
-
"AssignedToFlowElement",
|
|
4504
|
-
"ConnectedTo",
|
|
4505
|
-
"ConnectedFrom",
|
|
4506
|
-
"ReferencedBy",
|
|
4507
|
-
"Declares",
|
|
4508
|
-
"HasContext",
|
|
4509
|
-
"Controls",
|
|
4510
|
-
"IsNestedBy",
|
|
4511
|
-
"Nests"
|
|
4512
|
-
];
|
|
4513
|
-
export type InverseAttribute = InverseAttributes[number];
|
|
4514
|
-
/**
|
|
4515
|
-
* Type alias for an array of IfcRelation types from WebIfc.
|
|
4516
|
-
*/
|
|
4517
|
-
export type IfcRelations = [
|
|
4518
|
-
typeof WEBIFC.IFCRELAGGREGATES,
|
|
4519
|
-
typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
|
|
4520
|
-
typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
|
|
4521
|
-
typeof WEBIFC.IFCRELASSIGNSTOGROUP,
|
|
4522
|
-
typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
|
|
4523
|
-
typeof WEBIFC.IFCRELDEFINESBYTYPE,
|
|
4524
|
-
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
4525
|
-
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
4526
|
-
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
4527
|
-
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
4528
|
-
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
4529
|
-
typeof WEBIFC.IFCRELDECLARES,
|
|
4530
|
-
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
4531
|
-
typeof WEBIFC.IFCRELNESTS
|
|
4532
|
-
];
|
|
4533
|
-
export type IfcRelation = IfcRelations[number];
|
|
4534
4610
|
|
|
4535
4611
|
}
|