@thatopen/components 2.3.13 → 2.3.15
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 +0 -1
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +8 -18
- package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +51 -0
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +17 -0
- package/dist/index.cjs +23 -23
- package/dist/index.mjs +1347 -1390
- package/dist/namespace.d.ts +2015 -1958
- 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.3.
|
|
10
|
+
static readonly release = "2.3.15";
|
|
11
11
|
/** {@link Disposable.onDisposed} */
|
|
12
12
|
readonly onDisposed: Event<void>;
|
|
13
13
|
/**
|
|
@@ -137,48 +137,6 @@ export declare class Disposer extends Component {
|
|
|
137
137
|
private disposeChildren;
|
|
138
138
|
private static disposeMaterial;
|
|
139
139
|
}
|
|
140
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
141
|
-
import { SimpleRaycaster } from "./src";
|
|
142
|
-
import { Components } from "../Components";
|
|
143
|
-
/**
|
|
144
|
-
* 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).
|
|
145
|
-
*/
|
|
146
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
147
|
-
/**
|
|
148
|
-
* A unique identifier for the component.
|
|
149
|
-
* This UUID is used to register the component within the Components system.
|
|
150
|
-
*/
|
|
151
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
152
|
-
/** {@link Component.enabled} */
|
|
153
|
-
enabled: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* A Map that stores raycasters for each world.
|
|
156
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
157
|
-
*/
|
|
158
|
-
list: Map<string, SimpleRaycaster>;
|
|
159
|
-
/** {@link Disposable.onDisposed} */
|
|
160
|
-
onDisposed: Event<unknown>;
|
|
161
|
-
constructor(components: Components);
|
|
162
|
-
/**
|
|
163
|
-
* Retrieves a SimpleRaycaster instance for the given world.
|
|
164
|
-
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
165
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
166
|
-
*
|
|
167
|
-
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
168
|
-
* @returns The SimpleRaycaster instance for the given world.
|
|
169
|
-
*/
|
|
170
|
-
get(world: World): SimpleRaycaster;
|
|
171
|
-
/**
|
|
172
|
-
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
173
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
174
|
-
*
|
|
175
|
-
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
176
|
-
* @returns {void}
|
|
177
|
-
*/
|
|
178
|
-
delete(world: World): void;
|
|
179
|
-
/** {@link Disposable.dispose} */
|
|
180
|
-
dispose(): void;
|
|
181
|
-
}
|
|
182
140
|
import { SimpleScene, SimpleSceneConfig, SimpleSceneConfigManager } from "../Worlds";
|
|
183
141
|
import { DistanceRenderer } from "./src";
|
|
184
142
|
import { Configurable, Disposable } from "../Types";
|
|
@@ -290,6 +248,66 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
290
248
|
/** {@link Updateable.update} */
|
|
291
249
|
update(delta?: number): void | Promise<void>;
|
|
292
250
|
}
|
|
251
|
+
import * as THREE from "three";
|
|
252
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
253
|
+
center: THREE.Vector3;
|
|
254
|
+
halfSizes: THREE.Vector3;
|
|
255
|
+
rotation: THREE.Matrix3;
|
|
256
|
+
transformation: THREE.Matrix4;
|
|
257
|
+
};
|
|
258
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
259
|
+
import { SimpleRaycaster } from "./src";
|
|
260
|
+
import { Components } from "../Components";
|
|
261
|
+
/**
|
|
262
|
+
* 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).
|
|
263
|
+
*/
|
|
264
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
265
|
+
/**
|
|
266
|
+
* A unique identifier for the component.
|
|
267
|
+
* This UUID is used to register the component within the Components system.
|
|
268
|
+
*/
|
|
269
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
270
|
+
/** {@link Component.enabled} */
|
|
271
|
+
enabled: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* A Map that stores raycasters for each world.
|
|
274
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
275
|
+
*/
|
|
276
|
+
list: Map<string, SimpleRaycaster>;
|
|
277
|
+
/** {@link Disposable.onDisposed} */
|
|
278
|
+
onDisposed: Event<unknown>;
|
|
279
|
+
constructor(components: Components);
|
|
280
|
+
/**
|
|
281
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
282
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
283
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
284
|
+
*
|
|
285
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
286
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
287
|
+
*/
|
|
288
|
+
get(world: World): SimpleRaycaster;
|
|
289
|
+
/**
|
|
290
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
291
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
292
|
+
*
|
|
293
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
294
|
+
* @returns {void}
|
|
295
|
+
*/
|
|
296
|
+
delete(world: World): void;
|
|
297
|
+
/** {@link Disposable.dispose} */
|
|
298
|
+
dispose(): void;
|
|
299
|
+
}
|
|
300
|
+
import * as THREE from "three";
|
|
301
|
+
export declare class MaterialsUtils {
|
|
302
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
303
|
+
}
|
|
304
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
305
|
+
export declare class UUID {
|
|
306
|
+
private static _pattern;
|
|
307
|
+
private static _lut;
|
|
308
|
+
static create(): string;
|
|
309
|
+
static validate(uuid: string): void;
|
|
310
|
+
}
|
|
293
311
|
import { Component, Disposable, World, Event } from "../Types";
|
|
294
312
|
import { SimpleGrid } from "./src";
|
|
295
313
|
import { Components } from "../Components";
|
|
@@ -336,6 +354,61 @@ export declare class Grids extends Component implements Disposable {
|
|
|
336
354
|
dispose(): void;
|
|
337
355
|
}
|
|
338
356
|
import * as THREE from "three";
|
|
357
|
+
import { Components } from "../Components";
|
|
358
|
+
import { MeshCullerRenderer } from "./src";
|
|
359
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
360
|
+
/**
|
|
361
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
362
|
+
*/
|
|
363
|
+
export declare class Cullers extends Component implements Disposable {
|
|
364
|
+
/**
|
|
365
|
+
* A unique identifier for the component.
|
|
366
|
+
* This UUID is used to register the component within the Components system.
|
|
367
|
+
*/
|
|
368
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
369
|
+
/**
|
|
370
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
371
|
+
*/
|
|
372
|
+
readonly onDisposed: Event<unknown>;
|
|
373
|
+
private _enabled;
|
|
374
|
+
/**
|
|
375
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
376
|
+
*/
|
|
377
|
+
list: Map<string, MeshCullerRenderer>;
|
|
378
|
+
/** {@link Component.enabled} */
|
|
379
|
+
get enabled(): boolean;
|
|
380
|
+
/** {@link Component.enabled} */
|
|
381
|
+
set enabled(value: boolean);
|
|
382
|
+
constructor(components: Components);
|
|
383
|
+
/**
|
|
384
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
385
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
386
|
+
*
|
|
387
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
388
|
+
*
|
|
389
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
390
|
+
*/
|
|
391
|
+
create(world: World): MeshCullerRenderer;
|
|
392
|
+
/**
|
|
393
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
394
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
395
|
+
*
|
|
396
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
397
|
+
*
|
|
398
|
+
* @returns {void}
|
|
399
|
+
*/
|
|
400
|
+
delete(world: World): void;
|
|
401
|
+
/** {@link Disposable.dispose} */
|
|
402
|
+
dispose(): void;
|
|
403
|
+
/**
|
|
404
|
+
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
405
|
+
*
|
|
406
|
+
* @param meshes - The meshes to update.
|
|
407
|
+
*
|
|
408
|
+
*/
|
|
409
|
+
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
410
|
+
}
|
|
411
|
+
import * as THREE from "three";
|
|
339
412
|
import { Component, Configurable, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
340
413
|
import { SimplePlane } from "./src";
|
|
341
414
|
import { Components } from "../Components";
|
|
@@ -476,60 +549,111 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
476
549
|
private _onStartDragging;
|
|
477
550
|
private _onEndDragging;
|
|
478
551
|
}
|
|
479
|
-
import
|
|
552
|
+
import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
|
|
553
|
+
import { Components } from "../Components";
|
|
554
|
+
import { BCFViewpoint, Viewpoint } from "./src";
|
|
555
|
+
import { ViewpointsConfigManager, ViewpointsConfig } from "./src/viewpoints-config";
|
|
556
|
+
export declare class Viewpoints extends Component implements Disposable, Configurable<ViewpointsConfigManager, ViewpointsConfig> {
|
|
557
|
+
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
558
|
+
enabled: boolean;
|
|
559
|
+
/**
|
|
560
|
+
* A DataMap that stores Viewpoint instances, indexed by their unique identifiers (guid).
|
|
561
|
+
* This map is used to manage and retrieve Viewpoint instances within the Viewpoints component.
|
|
562
|
+
*/
|
|
563
|
+
readonly list: DataMap<string, Viewpoint>;
|
|
564
|
+
/**
|
|
565
|
+
* Creates a new Viewpoint instance and adds it to the list.
|
|
566
|
+
*
|
|
567
|
+
* @param world - The world in which the Viewpoint will be created.
|
|
568
|
+
* @param data - Optional partial data for the Viewpoint. If not provided, default data will be used.
|
|
569
|
+
*
|
|
570
|
+
* @returns The newly created Viewpoint instance.
|
|
571
|
+
*/
|
|
572
|
+
create(world: World, data?: Partial<BCFViewpoint>): Viewpoint;
|
|
573
|
+
constructor(components: Components);
|
|
574
|
+
isSetup: boolean;
|
|
575
|
+
setup(): void;
|
|
576
|
+
onSetup: Event<unknown>;
|
|
577
|
+
config: ViewpointsConfigManager;
|
|
578
|
+
/** {@link Disposable.onDisposed} */
|
|
579
|
+
readonly onDisposed: Event<unknown>;
|
|
580
|
+
/**
|
|
581
|
+
* Disposes of the Viewpoints component and its associated resources.
|
|
582
|
+
*
|
|
583
|
+
* This method is responsible for cleaning up any resources held by the Viewpoints component,
|
|
584
|
+
* such as disposing of the DataMap of Viewpoint instances and triggering and resetting the
|
|
585
|
+
* onDisposed event.
|
|
586
|
+
*/
|
|
587
|
+
dispose(): void;
|
|
588
|
+
}
|
|
589
|
+
import { MiniMap } from "./src";
|
|
590
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
480
591
|
import { Components } from "../Components";
|
|
481
|
-
import { MeshCullerRenderer } from "./src";
|
|
482
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
483
592
|
/**
|
|
484
|
-
* A component that
|
|
593
|
+
* 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).
|
|
485
594
|
*/
|
|
486
|
-
export declare class
|
|
595
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
487
596
|
/**
|
|
488
597
|
* A unique identifier for the component.
|
|
489
598
|
* This UUID is used to register the component within the Components system.
|
|
490
599
|
*/
|
|
491
|
-
static readonly uuid: "
|
|
492
|
-
/**
|
|
493
|
-
|
|
494
|
-
|
|
600
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
601
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
602
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
603
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
604
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
605
|
+
/** {@link Disposable.onDisposed} */
|
|
495
606
|
readonly onDisposed: Event<unknown>;
|
|
496
|
-
|
|
607
|
+
/** {@link Configurable.onSetup} */
|
|
608
|
+
readonly onSetup: Event<unknown>;
|
|
609
|
+
/** {@link Component.enabled} */
|
|
610
|
+
enabled: boolean;
|
|
497
611
|
/**
|
|
498
|
-
* A
|
|
612
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
499
613
|
*/
|
|
500
|
-
list: Map<string,
|
|
501
|
-
/** {@link Component.enabled} */
|
|
502
|
-
get enabled(): boolean;
|
|
503
|
-
/** {@link Component.enabled} */
|
|
504
|
-
set enabled(value: boolean);
|
|
614
|
+
list: Map<string, MiniMap>;
|
|
505
615
|
constructor(components: Components);
|
|
506
616
|
/**
|
|
507
|
-
* Creates a new
|
|
508
|
-
* If a
|
|
509
|
-
*
|
|
510
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
617
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
618
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
511
619
|
*
|
|
512
|
-
* @
|
|
620
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
621
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
622
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
513
623
|
*/
|
|
514
|
-
create(world: World):
|
|
624
|
+
create(world: World): MiniMap;
|
|
515
625
|
/**
|
|
516
|
-
* Deletes
|
|
517
|
-
* If a
|
|
518
|
-
*
|
|
519
|
-
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
626
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
627
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
520
628
|
*
|
|
629
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
521
630
|
* @returns {void}
|
|
522
631
|
*/
|
|
523
|
-
delete(
|
|
632
|
+
delete(id: string): void;
|
|
524
633
|
/** {@link Disposable.dispose} */
|
|
525
634
|
dispose(): void;
|
|
526
|
-
/**
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
635
|
+
/** {@link Updateable.update} */
|
|
636
|
+
update(): void;
|
|
637
|
+
}
|
|
638
|
+
import { Component, DataMap } from "../Types";
|
|
639
|
+
import { Components } from "../Components";
|
|
640
|
+
import { Configurator } from "./src";
|
|
641
|
+
/**
|
|
642
|
+
* A tool to manage all the configuration from the app centrally.
|
|
643
|
+
*/
|
|
644
|
+
export declare class ConfigManager extends Component {
|
|
645
|
+
/**
|
|
646
|
+
* The list of all configurations of this app.
|
|
647
|
+
*/
|
|
648
|
+
list: DataMap<string, Configurator<any, any>>;
|
|
649
|
+
/** {@link Component.enabled} */
|
|
650
|
+
enabled: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* A unique identifier for the component.
|
|
653
|
+
* This UUID is used to register the component within the Components system.
|
|
654
|
+
*/
|
|
655
|
+
static readonly uuid: "b8c764e0-6b24-4e77-9a32-35fa728ee5b4";
|
|
656
|
+
constructor(components: Components);
|
|
533
657
|
}
|
|
534
658
|
import * as THREE from "three";
|
|
535
659
|
import { Components } from "../Components";
|
|
@@ -595,345 +719,131 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
595
719
|
private newOrthoCamera;
|
|
596
720
|
private setOrthoPerspCameraAspect;
|
|
597
721
|
}
|
|
598
|
-
import
|
|
599
|
-
import { Components } from "../
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
enabled: boolean;
|
|
722
|
+
import * as THREE from "three";
|
|
723
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
724
|
+
/**
|
|
725
|
+
* Configuration interface for the VertexPicker component.
|
|
726
|
+
*/
|
|
727
|
+
export interface VertexPickerConfig {
|
|
605
728
|
/**
|
|
606
|
-
*
|
|
607
|
-
* This map is used to manage and retrieve Viewpoint instances within the Viewpoints component.
|
|
729
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
608
730
|
*/
|
|
609
|
-
|
|
731
|
+
showOnlyVertex: boolean;
|
|
610
732
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
* @param world - The world in which the Viewpoint will be created.
|
|
614
|
-
* @param data - Optional partial data for the Viewpoint. If not provided, default data will be used.
|
|
615
|
-
*
|
|
616
|
-
* @returns The newly created Viewpoint instance.
|
|
733
|
+
* The maximum distance for snapping to a vertex.
|
|
617
734
|
*/
|
|
618
|
-
|
|
619
|
-
constructor(components: Components);
|
|
620
|
-
isSetup: boolean;
|
|
621
|
-
setup(): void;
|
|
622
|
-
onSetup: Event<unknown>;
|
|
623
|
-
config: ViewpointsConfigManager;
|
|
624
|
-
/** {@link Disposable.onDisposed} */
|
|
625
|
-
readonly onDisposed: Event<unknown>;
|
|
735
|
+
snapDistance: number;
|
|
626
736
|
/**
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
* This method is responsible for cleaning up any resources held by the Viewpoints component,
|
|
630
|
-
* such as disposing of the DataMap of Viewpoint instances and triggering and resetting the
|
|
631
|
-
* onDisposed event.
|
|
737
|
+
* The HTML element to use for previewing the picked vertex.
|
|
632
738
|
*/
|
|
633
|
-
|
|
739
|
+
previewElement: HTMLElement;
|
|
634
740
|
}
|
|
635
|
-
import { Component, DataMap } from "../Types";
|
|
636
|
-
import { Components } from "../Components";
|
|
637
|
-
import { Configurator } from "./src";
|
|
638
741
|
/**
|
|
639
|
-
* A
|
|
742
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
640
743
|
*/
|
|
641
|
-
export declare class
|
|
744
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
745
|
+
/** {@link Disposable.onDisposed} */
|
|
746
|
+
readonly onDisposed: Event<unknown>;
|
|
642
747
|
/**
|
|
643
|
-
*
|
|
748
|
+
* An event that is triggered when a vertex is found.
|
|
749
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
644
750
|
*/
|
|
645
|
-
|
|
646
|
-
/** {@link Component.enabled} */
|
|
647
|
-
enabled: boolean;
|
|
751
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
648
752
|
/**
|
|
649
|
-
*
|
|
650
|
-
*
|
|
753
|
+
* An event that is triggered when a vertex is lost.
|
|
754
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
651
755
|
*/
|
|
652
|
-
|
|
653
|
-
constructor(components: Components);
|
|
654
|
-
}
|
|
655
|
-
import { MiniMap } from "./src";
|
|
656
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
657
|
-
import { Components } from "../Components";
|
|
658
|
-
/**
|
|
659
|
-
* 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).
|
|
660
|
-
*/
|
|
661
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
756
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
662
757
|
/**
|
|
663
|
-
*
|
|
664
|
-
* This UUID is used to register the component within the Components system.
|
|
758
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
665
759
|
*/
|
|
666
|
-
|
|
667
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
668
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
669
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
670
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
671
|
-
/** {@link Disposable.onDisposed} */
|
|
672
|
-
readonly onDisposed: Event<unknown>;
|
|
673
|
-
/** {@link Configurable.onSetup} */
|
|
674
|
-
readonly onSetup: Event<unknown>;
|
|
675
|
-
/** {@link Component.enabled} */
|
|
676
|
-
enabled: boolean;
|
|
760
|
+
readonly onEnabled: Event<boolean>;
|
|
677
761
|
/**
|
|
678
|
-
* A
|
|
762
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
679
763
|
*/
|
|
680
|
-
|
|
681
|
-
constructor(components: Components);
|
|
764
|
+
components: Components;
|
|
682
765
|
/**
|
|
683
|
-
*
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
687
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
688
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
766
|
+
* A reference to the working plane used for vertex picking.
|
|
767
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
768
|
+
* If this value is null, all vertices are considered valid.
|
|
689
769
|
*/
|
|
690
|
-
|
|
770
|
+
workingPlane: THREE.Plane | null;
|
|
771
|
+
private _pickedPoint;
|
|
772
|
+
private _config;
|
|
773
|
+
private _enabled;
|
|
691
774
|
/**
|
|
692
|
-
*
|
|
693
|
-
*
|
|
775
|
+
* Sets the enabled state of the VertexPicker.
|
|
776
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
777
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
694
778
|
*
|
|
695
|
-
* @param
|
|
696
|
-
* @returns {void}
|
|
697
|
-
*/
|
|
698
|
-
delete(id: string): void;
|
|
699
|
-
/** {@link Disposable.dispose} */
|
|
700
|
-
dispose(): void;
|
|
701
|
-
/** {@link Updateable.update} */
|
|
702
|
-
update(): void;
|
|
703
|
-
}
|
|
704
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
705
|
-
/**
|
|
706
|
-
* 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).
|
|
707
|
-
*/
|
|
708
|
-
export declare class Exploder extends Component implements Disposable {
|
|
709
|
-
/**
|
|
710
|
-
* A unique identifier for the component.
|
|
711
|
-
* This UUID is used to register the component within the Components system.
|
|
779
|
+
* @param value - The new enabled state.
|
|
712
780
|
*/
|
|
713
|
-
|
|
714
|
-
/** {@link Disposable.onDisposed} */
|
|
715
|
-
readonly onDisposed: Event<unknown>;
|
|
716
|
-
/** {@link Component.enabled} */
|
|
717
|
-
enabled: boolean;
|
|
781
|
+
set enabled(value: boolean);
|
|
718
782
|
/**
|
|
719
|
-
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
783
|
+
* Gets the current enabled state of the VertexPicker.
|
|
784
|
+
*
|
|
785
|
+
* @returns The current enabled state.
|
|
722
786
|
*/
|
|
723
|
-
|
|
787
|
+
get enabled(): boolean;
|
|
724
788
|
/**
|
|
725
|
-
*
|
|
726
|
-
*
|
|
727
|
-
*
|
|
789
|
+
* Sets the configuration for the VertexPicker component.
|
|
790
|
+
*
|
|
791
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
792
|
+
* The properties not provided in the value object will retain their current values.
|
|
793
|
+
*
|
|
794
|
+
* @example
|
|
795
|
+
* '''typescript
|
|
796
|
+
* vertexPicker.config = {
|
|
797
|
+
* snapDistance: 0.5,
|
|
798
|
+
* showOnlyVertex: true,
|
|
799
|
+
* };
|
|
800
|
+
* '''
|
|
728
801
|
*/
|
|
729
|
-
|
|
802
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
730
803
|
/**
|
|
731
|
-
*
|
|
732
|
-
*
|
|
804
|
+
* Gets the current configuration for the VertexPicker component.
|
|
805
|
+
*
|
|
806
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
807
|
+
*
|
|
808
|
+
* @example
|
|
809
|
+
* '''typescript
|
|
810
|
+
* const currentConfig = vertexPicker.config;
|
|
811
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
812
|
+
* '''
|
|
733
813
|
*/
|
|
734
|
-
|
|
735
|
-
constructor(components: Components);
|
|
814
|
+
get config(): Partial<VertexPickerConfig>;
|
|
815
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
736
816
|
/** {@link Disposable.dispose} */
|
|
737
817
|
dispose(): void;
|
|
738
818
|
/**
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
819
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
742
820
|
*
|
|
743
|
-
* @
|
|
744
|
-
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
745
|
-
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
746
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
821
|
+
* @param world - The World instance to use for raycasting.
|
|
747
822
|
*
|
|
748
|
-
* The
|
|
823
|
+
* @returns The current picked point, or null if no point is picked.
|
|
749
824
|
*
|
|
750
|
-
* @
|
|
825
|
+
* @remarks
|
|
826
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
827
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
828
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
829
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
830
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
831
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
751
832
|
*/
|
|
752
|
-
|
|
833
|
+
get(world: World): THREE.Vector3 | null;
|
|
834
|
+
private getClosestVertex;
|
|
835
|
+
private getVertices;
|
|
836
|
+
private getVertex;
|
|
753
837
|
}
|
|
754
838
|
import * as THREE from "three";
|
|
755
839
|
import * as FRAGS from "@thatopen/fragments";
|
|
756
|
-
import {
|
|
757
|
-
|
|
758
|
-
* 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.
|
|
759
|
-
*/
|
|
760
|
-
export interface Classification {
|
|
761
|
-
/**
|
|
762
|
-
* A system within the classification.
|
|
763
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
764
|
-
*/
|
|
765
|
-
[system: string]: {
|
|
766
|
-
/**
|
|
767
|
-
* A class within the system.
|
|
768
|
-
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
769
|
-
*/
|
|
770
|
-
[groupName: string]: {
|
|
771
|
-
map: FRAGS.FragmentIdMap;
|
|
772
|
-
name: string;
|
|
773
|
-
id: number | null;
|
|
774
|
-
};
|
|
775
|
-
};
|
|
776
|
-
}
|
|
840
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
841
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
777
842
|
/**
|
|
778
|
-
*
|
|
843
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
779
844
|
*/
|
|
780
|
-
export declare class
|
|
781
|
-
|
|
782
|
-
* A unique identifier for the component.
|
|
783
|
-
* This UUID is used to register the component within the Components system.
|
|
784
|
-
*/
|
|
785
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
786
|
-
/** {@link Component.enabled} */
|
|
787
|
-
enabled: boolean;
|
|
788
|
-
/**
|
|
789
|
-
* A map representing the classification systems.
|
|
790
|
-
* The key is the system name, and the value is an object representing the classes within the system.
|
|
791
|
-
*/
|
|
792
|
-
list: Classification;
|
|
793
|
-
/** {@link Disposable.onDisposed} */
|
|
794
|
-
readonly onDisposed: Event<unknown>;
|
|
795
|
-
constructor(components: Components);
|
|
796
|
-
private onFragmentsDisposed;
|
|
797
|
-
/** {@link Disposable.dispose} */
|
|
798
|
-
dispose(): void;
|
|
799
|
-
/**
|
|
800
|
-
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
801
|
-
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
802
|
-
*
|
|
803
|
-
* @param guid - The unique identifier of the fragment to be removed.
|
|
804
|
-
*/
|
|
805
|
-
remove(guid: string): void;
|
|
806
|
-
/**
|
|
807
|
-
* Finds and returns fragments based on the provided filter criteria.
|
|
808
|
-
* If no filter is provided, it returns all fragments.
|
|
809
|
-
*
|
|
810
|
-
* @param filter - An optional object containing filter criteria.
|
|
811
|
-
* The keys of the object represent the classification system names,
|
|
812
|
-
* and the values are arrays of class names to match.
|
|
813
|
-
*
|
|
814
|
-
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
815
|
-
* where the express IDs are filtered based on the provided filter criteria.
|
|
816
|
-
*
|
|
817
|
-
* @throws Will throw an error if the fragments map is malformed.
|
|
818
|
-
*/
|
|
819
|
-
find(filter?: {
|
|
820
|
-
[name: string]: string[];
|
|
821
|
-
}): FRAGS.FragmentIdMap;
|
|
822
|
-
/**
|
|
823
|
-
* Classifies fragments based on their modelID.
|
|
824
|
-
*
|
|
825
|
-
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
826
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
827
|
-
*
|
|
828
|
-
* @remarks
|
|
829
|
-
* This method iterates through the fragments in the provided group,
|
|
830
|
-
* and classifies them based on their modelID.
|
|
831
|
-
* The classification is stored in the 'list.models' property,
|
|
832
|
-
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
833
|
-
*
|
|
834
|
-
*/
|
|
835
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
836
|
-
/**
|
|
837
|
-
* Classifies fragments based on their PredefinedType property.
|
|
838
|
-
*
|
|
839
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
840
|
-
*
|
|
841
|
-
* @remarks
|
|
842
|
-
* This method iterates through the properties of the fragments in the provided group,
|
|
843
|
-
* and classifies them based on their PredefinedType property.
|
|
844
|
-
* The classification is stored in the 'list.predefinedTypes' property,
|
|
845
|
-
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
846
|
-
*
|
|
847
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
848
|
-
*/
|
|
849
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
850
|
-
/**
|
|
851
|
-
* Classifies fragments based on their entity type.
|
|
852
|
-
*
|
|
853
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
854
|
-
*
|
|
855
|
-
* @remarks
|
|
856
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
857
|
-
* and classifies them based on their entity type.
|
|
858
|
-
* The classification is stored in the 'list.entities' property,
|
|
859
|
-
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
860
|
-
*
|
|
861
|
-
* @throws Will throw an error if the fragment ID is not found.
|
|
862
|
-
*/
|
|
863
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
864
|
-
/**
|
|
865
|
-
* Classifies fragments based on a specific IFC relationship.
|
|
866
|
-
*
|
|
867
|
-
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
868
|
-
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
869
|
-
* @param systemName - The name of the classification system to store the classification.
|
|
870
|
-
*
|
|
871
|
-
* @remarks
|
|
872
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
873
|
-
* and classifies them based on the specified IFC relationship.
|
|
874
|
-
* The classification is stored in the 'list' property under the specified system name,
|
|
875
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
876
|
-
*
|
|
877
|
-
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
878
|
-
*/
|
|
879
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
880
|
-
/**
|
|
881
|
-
* Classifies fragments based on their spatial structure in the IFC model.
|
|
882
|
-
*
|
|
883
|
-
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
884
|
-
* @param config - The configuration for the classifier. It includes "useProperties", which is true by default
|
|
885
|
-
* (if false, the classification will use the expressIDs instead of the names), and "isolate", which will make
|
|
886
|
-
* the classifier just pick the WEBIFC categories provided.
|
|
887
|
-
*
|
|
888
|
-
* @remarks
|
|
889
|
-
* This method iterates through the relations of the fragments in the provided group,
|
|
890
|
-
* and classifies them based on their spatial structure in the IFC model.
|
|
891
|
-
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
892
|
-
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
893
|
-
*
|
|
894
|
-
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
895
|
-
*/
|
|
896
|
-
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
897
|
-
useProperties?: boolean;
|
|
898
|
-
isolate?: Set<number>;
|
|
899
|
-
}): Promise<void>;
|
|
900
|
-
/**
|
|
901
|
-
* Sets the color of the specified fragments.
|
|
902
|
-
*
|
|
903
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
904
|
-
* @param color - The color to set for the fragments.
|
|
905
|
-
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
906
|
-
*
|
|
907
|
-
* @remarks
|
|
908
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
909
|
-
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
910
|
-
*
|
|
911
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
912
|
-
*/
|
|
913
|
-
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
914
|
-
/**
|
|
915
|
-
* Resets the color of the specified fragments to their original color.
|
|
916
|
-
*
|
|
917
|
-
* @param items - A map of fragment IDs to their respective express IDs.
|
|
918
|
-
*
|
|
919
|
-
* @remarks
|
|
920
|
-
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
921
|
-
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
922
|
-
*
|
|
923
|
-
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
924
|
-
*/
|
|
925
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
926
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
927
|
-
}
|
|
928
|
-
import * as THREE from "three";
|
|
929
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
930
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
931
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
932
|
-
/**
|
|
933
|
-
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
934
|
-
*/
|
|
935
|
-
export declare class BoundingBoxer extends Component implements Disposable {
|
|
936
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
845
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
846
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
937
847
|
/** {@link Component.enabled} */
|
|
938
848
|
enabled: boolean;
|
|
939
849
|
/** {@link Disposable.onDisposed} */
|
|
@@ -1133,177 +1043,267 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
1133
1043
|
addFragmentIdMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
1134
1044
|
private static getFragmentBounds;
|
|
1135
1045
|
}
|
|
1046
|
+
import * as THREE from "three";
|
|
1136
1047
|
import * as FRAGS from "@thatopen/fragments";
|
|
1137
|
-
import {
|
|
1048
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
1138
1049
|
/**
|
|
1139
|
-
*
|
|
1050
|
+
* 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.
|
|
1140
1051
|
*/
|
|
1141
|
-
export
|
|
1052
|
+
export interface Classification {
|
|
1053
|
+
/**
|
|
1054
|
+
* A system within the classification.
|
|
1055
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
1056
|
+
*/
|
|
1057
|
+
[system: string]: {
|
|
1058
|
+
/**
|
|
1059
|
+
* A class within the system.
|
|
1060
|
+
* The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
|
|
1061
|
+
*/
|
|
1062
|
+
[groupName: string]: {
|
|
1063
|
+
map: FRAGS.FragmentIdMap;
|
|
1064
|
+
name: string;
|
|
1065
|
+
id: number | null;
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* 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).
|
|
1071
|
+
*/
|
|
1072
|
+
export declare class Classifier extends Component implements Disposable {
|
|
1142
1073
|
/**
|
|
1143
1074
|
* A unique identifier for the component.
|
|
1144
1075
|
* This UUID is used to register the component within the Components system.
|
|
1145
1076
|
*/
|
|
1146
|
-
static readonly uuid: "
|
|
1077
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
1147
1078
|
/** {@link Component.enabled} */
|
|
1148
1079
|
enabled: boolean;
|
|
1080
|
+
/**
|
|
1081
|
+
* A map representing the classification systems.
|
|
1082
|
+
* The key is the system name, and the value is an object representing the classes within the system.
|
|
1083
|
+
*/
|
|
1084
|
+
list: Classification;
|
|
1085
|
+
/** {@link Disposable.onDisposed} */
|
|
1086
|
+
readonly onDisposed: Event<unknown>;
|
|
1149
1087
|
constructor(components: Components);
|
|
1088
|
+
private onFragmentsDisposed;
|
|
1089
|
+
/** {@link Disposable.dispose} */
|
|
1090
|
+
dispose(): void;
|
|
1150
1091
|
/**
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1154
|
-
*
|
|
1155
|
-
* @param visible - The visibility state to set for the fragments.
|
|
1156
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1157
|
-
* If not provided, all fragments will be affected.
|
|
1092
|
+
* Removes a fragment from the classification based on its unique identifier (guid).
|
|
1093
|
+
* This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
|
|
1158
1094
|
*
|
|
1159
|
-
* @
|
|
1095
|
+
* @param guid - The unique identifier of the fragment to be removed.
|
|
1160
1096
|
*/
|
|
1161
|
-
|
|
1097
|
+
remove(guid: string): void;
|
|
1162
1098
|
/**
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
1099
|
+
* Finds and returns fragments based on the provided filter criteria.
|
|
1100
|
+
* If no filter is provided, it returns all fragments.
|
|
1165
1101
|
*
|
|
1166
|
-
* @param
|
|
1167
|
-
*
|
|
1102
|
+
* @param filter - An optional object containing filter criteria.
|
|
1103
|
+
* The keys of the object represent the classification system names,
|
|
1104
|
+
* and the values are arrays of class names to match.
|
|
1168
1105
|
*
|
|
1169
|
-
* @returns
|
|
1106
|
+
* @returns A map of fragment GUIDs to their respective express IDs,
|
|
1107
|
+
* where the express IDs are filtered based on the provided filter criteria.
|
|
1108
|
+
*
|
|
1109
|
+
* @throws Will throw an error if the fragments map is malformed.
|
|
1170
1110
|
*/
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
}
|
|
1174
|
-
import * as THREE from "three";
|
|
1175
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1176
|
-
center: THREE.Vector3;
|
|
1177
|
-
halfSizes: THREE.Vector3;
|
|
1178
|
-
rotation: THREE.Matrix3;
|
|
1179
|
-
transformation: THREE.Matrix4;
|
|
1180
|
-
};
|
|
1181
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1182
|
-
import * as THREE from "three";
|
|
1183
|
-
export declare class MaterialsUtils {
|
|
1184
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
1185
|
-
}
|
|
1186
|
-
export declare class UUID {
|
|
1187
|
-
private static _pattern;
|
|
1188
|
-
private static _lut;
|
|
1189
|
-
static create(): string;
|
|
1190
|
-
static validate(uuid: string): void;
|
|
1191
|
-
}
|
|
1192
|
-
import * as THREE from "three";
|
|
1193
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1194
|
-
/**
|
|
1195
|
-
* Configuration interface for the VertexPicker component.
|
|
1196
|
-
*/
|
|
1197
|
-
export interface VertexPickerConfig {
|
|
1111
|
+
find(filter?: {
|
|
1112
|
+
[name: string]: string[];
|
|
1113
|
+
}): FRAGS.FragmentIdMap;
|
|
1198
1114
|
/**
|
|
1199
|
-
*
|
|
1115
|
+
* Classifies fragments based on their modelID.
|
|
1116
|
+
*
|
|
1117
|
+
* @param modelID - The unique identifier of the model to classify fragments by.
|
|
1118
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1119
|
+
*
|
|
1120
|
+
* @remarks
|
|
1121
|
+
* This method iterates through the fragments in the provided group,
|
|
1122
|
+
* and classifies them based on their modelID.
|
|
1123
|
+
* The classification is stored in the 'list.models' property,
|
|
1124
|
+
* with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1125
|
+
*
|
|
1200
1126
|
*/
|
|
1201
|
-
|
|
1127
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
1202
1128
|
/**
|
|
1203
|
-
*
|
|
1129
|
+
* Classifies fragments based on their PredefinedType property.
|
|
1130
|
+
*
|
|
1131
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1132
|
+
*
|
|
1133
|
+
* @remarks
|
|
1134
|
+
* This method iterates through the properties of the fragments in the provided group,
|
|
1135
|
+
* and classifies them based on their PredefinedType property.
|
|
1136
|
+
* The classification is stored in the 'list.predefinedTypes' property,
|
|
1137
|
+
* with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1138
|
+
*
|
|
1139
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
1204
1140
|
*/
|
|
1205
|
-
|
|
1141
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
1206
1142
|
/**
|
|
1207
|
-
*
|
|
1143
|
+
* Classifies fragments based on their entity type.
|
|
1144
|
+
*
|
|
1145
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1146
|
+
*
|
|
1147
|
+
* @remarks
|
|
1148
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1149
|
+
* and classifies them based on their entity type.
|
|
1150
|
+
* The classification is stored in the 'list.entities' property,
|
|
1151
|
+
* with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
|
|
1152
|
+
*
|
|
1153
|
+
* @throws Will throw an error if the fragment ID is not found.
|
|
1208
1154
|
*/
|
|
1209
|
-
|
|
1210
|
-
}
|
|
1211
|
-
/**
|
|
1212
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1213
|
-
*/
|
|
1214
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
1215
|
-
/** {@link Disposable.onDisposed} */
|
|
1216
|
-
readonly onDisposed: Event<unknown>;
|
|
1155
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
1217
1156
|
/**
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1157
|
+
* Classifies fragments based on a specific IFC relationship.
|
|
1158
|
+
*
|
|
1159
|
+
* @param group - The FragmentsGroup containing the fragments to be classified.
|
|
1160
|
+
* @param ifcRel - The IFC relationship number to classify fragments by.
|
|
1161
|
+
* @param systemName - The name of the classification system to store the classification.
|
|
1162
|
+
*
|
|
1163
|
+
* @remarks
|
|
1164
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1165
|
+
* and classifies them based on the specified IFC relationship.
|
|
1166
|
+
* The classification is stored in the 'list' property under the specified system name,
|
|
1167
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1168
|
+
*
|
|
1169
|
+
* @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
|
|
1220
1170
|
*/
|
|
1221
|
-
|
|
1171
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
1222
1172
|
/**
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1173
|
+
* Classifies fragments based on their spatial structure in the IFC model.
|
|
1174
|
+
*
|
|
1175
|
+
* @param model - The FragmentsGroup containing the fragments to be classified.
|
|
1176
|
+
* @param config - The configuration for the classifier. It includes "useProperties", which is true by default
|
|
1177
|
+
* (if false, the classification will use the expressIDs instead of the names), and "isolate", which will make
|
|
1178
|
+
* the classifier just pick the WEBIFC categories provided.
|
|
1179
|
+
*
|
|
1180
|
+
* @remarks
|
|
1181
|
+
* This method iterates through the relations of the fragments in the provided group,
|
|
1182
|
+
* and classifies them based on their spatial structure in the IFC model.
|
|
1183
|
+
* The classification is stored in the 'list' property under the system name "spatialStructures",
|
|
1184
|
+
* with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
|
|
1185
|
+
*
|
|
1186
|
+
* @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
|
|
1225
1187
|
*/
|
|
1226
|
-
|
|
1188
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
|
|
1189
|
+
useProperties?: boolean;
|
|
1190
|
+
isolate?: Set<number>;
|
|
1191
|
+
}): Promise<void>;
|
|
1227
1192
|
/**
|
|
1228
|
-
*
|
|
1193
|
+
* Sets the color of the specified fragments.
|
|
1194
|
+
*
|
|
1195
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1196
|
+
* @param color - The color to set for the fragments.
|
|
1197
|
+
* @param override - A boolean indicating whether to override the existing color of the fragments.
|
|
1198
|
+
*
|
|
1199
|
+
* @remarks
|
|
1200
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1201
|
+
* and sets their color using the 'setColor' method of the FragmentsGroup class.
|
|
1202
|
+
*
|
|
1203
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1229
1204
|
*/
|
|
1230
|
-
|
|
1205
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
1231
1206
|
/**
|
|
1232
|
-
*
|
|
1207
|
+
* Resets the color of the specified fragments to their original color.
|
|
1208
|
+
*
|
|
1209
|
+
* @param items - A map of fragment IDs to their respective express IDs.
|
|
1210
|
+
*
|
|
1211
|
+
* @remarks
|
|
1212
|
+
* This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
|
|
1213
|
+
* and resets their color using the 'resetColor' method of the FragmentsGroup class.
|
|
1214
|
+
*
|
|
1215
|
+
* @throws Will throw an error if the fragment with the specified ID is not found.
|
|
1233
1216
|
*/
|
|
1234
|
-
|
|
1217
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1218
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
1219
|
+
}
|
|
1220
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1221
|
+
/**
|
|
1222
|
+
* 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).
|
|
1223
|
+
*/
|
|
1224
|
+
export declare class Exploder extends Component implements Disposable {
|
|
1235
1225
|
/**
|
|
1236
|
-
* A
|
|
1237
|
-
* This
|
|
1238
|
-
* If this value is null, all vertices are considered valid.
|
|
1226
|
+
* A unique identifier for the component.
|
|
1227
|
+
* This UUID is used to register the component within the Components system.
|
|
1239
1228
|
*/
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1229
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1230
|
+
/** {@link Disposable.onDisposed} */
|
|
1231
|
+
readonly onDisposed: Event<unknown>;
|
|
1232
|
+
/** {@link Component.enabled} */
|
|
1233
|
+
enabled: boolean;
|
|
1244
1234
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1249
|
-
* @param value - The new enabled state.
|
|
1235
|
+
* The height of the explosion animation.
|
|
1236
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1237
|
+
* Default value is 10.
|
|
1250
1238
|
*/
|
|
1251
|
-
|
|
1239
|
+
height: number;
|
|
1252
1240
|
/**
|
|
1253
|
-
*
|
|
1254
|
-
*
|
|
1255
|
-
*
|
|
1241
|
+
* The group name used for the explosion animation.
|
|
1242
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1243
|
+
* Default value is "storeys".
|
|
1256
1244
|
*/
|
|
1257
|
-
|
|
1245
|
+
groupName: string;
|
|
1258
1246
|
/**
|
|
1259
|
-
*
|
|
1247
|
+
* A set of strings representing the exploded items.
|
|
1248
|
+
* This set is used to keep track of which items have been exploded.
|
|
1249
|
+
*/
|
|
1250
|
+
list: Set<string>;
|
|
1251
|
+
constructor(components: Components);
|
|
1252
|
+
/** {@link Disposable.dispose} */
|
|
1253
|
+
dispose(): void;
|
|
1254
|
+
/**
|
|
1255
|
+
* Sets the explosion state of the fragments.
|
|
1260
1256
|
*
|
|
1261
|
-
* @param
|
|
1262
|
-
* The properties not provided in the value object will retain their current values.
|
|
1257
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1263
1258
|
*
|
|
1264
|
-
* @
|
|
1265
|
-
* ''
|
|
1266
|
-
*
|
|
1267
|
-
*
|
|
1268
|
-
*
|
|
1269
|
-
*
|
|
1270
|
-
*
|
|
1259
|
+
* @remarks
|
|
1260
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1261
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1262
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1263
|
+
*
|
|
1264
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1265
|
+
*
|
|
1266
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1271
1267
|
*/
|
|
1272
|
-
set
|
|
1268
|
+
set(active: boolean): void;
|
|
1269
|
+
}
|
|
1270
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1271
|
+
import { Components, Component } from "../../core";
|
|
1272
|
+
/**
|
|
1273
|
+
* 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).
|
|
1274
|
+
*/
|
|
1275
|
+
export declare class Hider extends Component {
|
|
1273
1276
|
/**
|
|
1274
|
-
*
|
|
1277
|
+
* A unique identifier for the component.
|
|
1278
|
+
* This UUID is used to register the component within the Components system.
|
|
1279
|
+
*/
|
|
1280
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1281
|
+
/** {@link Component.enabled} */
|
|
1282
|
+
enabled: boolean;
|
|
1283
|
+
constructor(components: Components);
|
|
1284
|
+
/**
|
|
1285
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1286
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1287
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1275
1288
|
*
|
|
1276
|
-
* @
|
|
1289
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1290
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1291
|
+
* If not provided, all fragments will be affected.
|
|
1277
1292
|
*
|
|
1278
|
-
* @
|
|
1279
|
-
* '''typescript
|
|
1280
|
-
* const currentConfig = vertexPicker.config;
|
|
1281
|
-
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1282
|
-
* '''
|
|
1293
|
+
* @returns {void}
|
|
1283
1294
|
*/
|
|
1284
|
-
|
|
1285
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
1286
|
-
/** {@link Disposable.dispose} */
|
|
1287
|
-
dispose(): void;
|
|
1295
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1288
1296
|
/**
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
* @param world - The World instance to use for raycasting.
|
|
1297
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1298
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1292
1299
|
*
|
|
1293
|
-
* @
|
|
1300
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1301
|
+
* If not provided, all fragments will be isolated.
|
|
1294
1302
|
*
|
|
1295
|
-
* @
|
|
1296
|
-
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
1297
|
-
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
1298
|
-
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
1299
|
-
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
1300
|
-
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
1301
|
-
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1303
|
+
* @returns {void}
|
|
1302
1304
|
*/
|
|
1303
|
-
|
|
1304
|
-
private
|
|
1305
|
-
private getVertices;
|
|
1306
|
-
private getVertex;
|
|
1305
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1306
|
+
private updateCulledVisibility;
|
|
1307
1307
|
}
|
|
1308
1308
|
import * as WEBIFC from "web-ifc";
|
|
1309
1309
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -1673,123 +1673,18 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
|
1673
1673
|
private streamGeometries;
|
|
1674
1674
|
private registerGeometryData;
|
|
1675
1675
|
}
|
|
1676
|
-
import * as
|
|
1677
|
-
import
|
|
1678
|
-
import {
|
|
1679
|
-
/**
|
|
1680
|
-
* Represents an edge measurement result.
|
|
1681
|
-
*/
|
|
1682
|
-
export interface MeasureEdge {
|
|
1683
|
-
/**
|
|
1684
|
-
* The distance between the two points of the edge.
|
|
1685
|
-
*/
|
|
1686
|
-
distance: number;
|
|
1687
|
-
/**
|
|
1688
|
-
* The two points that define the edge.
|
|
1689
|
-
*/
|
|
1690
|
-
points: THREE.Vector3[];
|
|
1691
|
-
}
|
|
1676
|
+
import * as WEBIFC from "web-ifc";
|
|
1677
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1678
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1692
1679
|
/**
|
|
1693
|
-
*
|
|
1680
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1694
1681
|
*/
|
|
1695
|
-
export declare class
|
|
1682
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1696
1683
|
/**
|
|
1697
1684
|
* A unique identifier for the component.
|
|
1698
1685
|
* This UUID is used to register the component within the Components system.
|
|
1699
1686
|
*/
|
|
1700
|
-
static uuid:
|
|
1701
|
-
/** {@link Component.enabled} */
|
|
1702
|
-
enabled: boolean;
|
|
1703
|
-
constructor(components: Components);
|
|
1704
|
-
/**
|
|
1705
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
1706
|
-
*
|
|
1707
|
-
* @param point - The point from which to calculate the distance.
|
|
1708
|
-
* @param lineStart - The start point of the line segment.
|
|
1709
|
-
* @param lineEnd - The end point of the line segment.
|
|
1710
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1711
|
-
* @returns The distance from the point to the line segment.
|
|
1712
|
-
*/
|
|
1713
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1714
|
-
/**
|
|
1715
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
1716
|
-
* It also returns the edges of the found face and their indices.
|
|
1717
|
-
*
|
|
1718
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1719
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1720
|
-
* @param instance - The instance of the mesh (optional).
|
|
1721
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1722
|
-
*/
|
|
1723
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1724
|
-
edges: MeasureEdge[];
|
|
1725
|
-
indices: Set<number>;
|
|
1726
|
-
} | null;
|
|
1727
|
-
/**
|
|
1728
|
-
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1729
|
-
* It also applies instance transformation if provided.
|
|
1730
|
-
*
|
|
1731
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1732
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
1733
|
-
* @param instance - The instance of the mesh (optional).
|
|
1734
|
-
* @returns An object containing the vertices and normal of the face.
|
|
1735
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
1736
|
-
*/
|
|
1737
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1738
|
-
p1: THREE.Vector3;
|
|
1739
|
-
p2: THREE.Vector3;
|
|
1740
|
-
p3: THREE.Vector3;
|
|
1741
|
-
faceNormal: THREE.Vector3;
|
|
1742
|
-
};
|
|
1743
|
-
/**
|
|
1744
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
1745
|
-
* This is used to ensure numerical precision in edge detection.
|
|
1746
|
-
*
|
|
1747
|
-
* @param vector - The vector to round.
|
|
1748
|
-
* @returns The vector with rounded components.
|
|
1749
|
-
*/
|
|
1750
|
-
round(vector: THREE.Vector3): void;
|
|
1751
|
-
/**
|
|
1752
|
-
* Calculates the volume of a set of fragments.
|
|
1753
|
-
*
|
|
1754
|
-
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1755
|
-
* @returns The total volume of the fragments and the bounding sphere.
|
|
1756
|
-
*
|
|
1757
|
-
* @remarks
|
|
1758
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1759
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1760
|
-
*
|
|
1761
|
-
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1762
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
1763
|
-
*/
|
|
1764
|
-
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
1765
|
-
/**
|
|
1766
|
-
* Calculates the total volume of a set of meshes.
|
|
1767
|
-
*
|
|
1768
|
-
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1769
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
1770
|
-
*
|
|
1771
|
-
* @remarks
|
|
1772
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1773
|
-
* and its bounding sphere.
|
|
1774
|
-
*
|
|
1775
|
-
*/
|
|
1776
|
-
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
1777
|
-
private getFaceData;
|
|
1778
|
-
private getVolumeOfMesh;
|
|
1779
|
-
private getSignedVolumeOfTriangle;
|
|
1780
|
-
}
|
|
1781
|
-
import * as WEBIFC from "web-ifc";
|
|
1782
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1783
|
-
import { PropertiesStreamingSettings } from "./src";
|
|
1784
|
-
/**
|
|
1785
|
-
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1786
|
-
*/
|
|
1787
|
-
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1788
|
-
/**
|
|
1789
|
-
* A unique identifier for the component.
|
|
1790
|
-
* This UUID is used to register the component within the Components system.
|
|
1791
|
-
*/
|
|
1792
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1687
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1793
1688
|
/**
|
|
1794
1689
|
* An event that is triggered when properties are streamed from the IFC file.
|
|
1795
1690
|
* The event provides the type of the IFC entity and the corresponding data.
|
|
@@ -2017,29 +1912,111 @@ export declare class IDSSpecifications extends Component {
|
|
|
2017
1912
|
*/
|
|
2018
1913
|
export(info: IDSInfo, specifications?: Iterable<IDSSpecification>): string;
|
|
2019
1914
|
}
|
|
2020
|
-
import
|
|
2021
|
-
import
|
|
2022
|
-
import {
|
|
1915
|
+
import * as THREE from "three";
|
|
1916
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1917
|
+
import { Component, Components } from "../../core";
|
|
2023
1918
|
/**
|
|
2024
|
-
*
|
|
1919
|
+
* Represents an edge measurement result.
|
|
2025
1920
|
*/
|
|
2026
|
-
export interface
|
|
1921
|
+
export interface MeasureEdge {
|
|
2027
1922
|
/**
|
|
2028
|
-
*
|
|
2029
|
-
* @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
|
|
2030
|
-
* @default false
|
|
1923
|
+
* The distance between the two points of the edge.
|
|
2031
1924
|
*/
|
|
2032
|
-
|
|
1925
|
+
distance: number;
|
|
1926
|
+
/**
|
|
1927
|
+
* The two points that define the edge.
|
|
1928
|
+
*/
|
|
1929
|
+
points: THREE.Vector3[];
|
|
2033
1930
|
}
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
export declare class
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
1931
|
+
/**
|
|
1932
|
+
* 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).
|
|
1933
|
+
*/
|
|
1934
|
+
export declare class MeasurementUtils extends Component {
|
|
1935
|
+
/**
|
|
1936
|
+
* A unique identifier for the component.
|
|
1937
|
+
* This UUID is used to register the component within the Components system.
|
|
1938
|
+
*/
|
|
1939
|
+
static uuid: string;
|
|
1940
|
+
/** {@link Component.enabled} */
|
|
1941
|
+
enabled: boolean;
|
|
1942
|
+
constructor(components: Components);
|
|
1943
|
+
/**
|
|
1944
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
1945
|
+
*
|
|
1946
|
+
* @param point - The point from which to calculate the distance.
|
|
1947
|
+
* @param lineStart - The start point of the line segment.
|
|
1948
|
+
* @param lineEnd - The end point of the line segment.
|
|
1949
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1950
|
+
* @returns The distance from the point to the line segment.
|
|
1951
|
+
*/
|
|
1952
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1953
|
+
/**
|
|
1954
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
1955
|
+
* It also returns the edges of the found face and their indices.
|
|
1956
|
+
*
|
|
1957
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1958
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1959
|
+
* @param instance - The instance of the mesh (optional).
|
|
1960
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1961
|
+
*/
|
|
1962
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1963
|
+
edges: MeasureEdge[];
|
|
1964
|
+
indices: Set<number>;
|
|
1965
|
+
} | null;
|
|
1966
|
+
/**
|
|
1967
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1968
|
+
* It also applies instance transformation if provided.
|
|
1969
|
+
*
|
|
1970
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1971
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
1972
|
+
* @param instance - The instance of the mesh (optional).
|
|
1973
|
+
* @returns An object containing the vertices and normal of the face.
|
|
1974
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
1975
|
+
*/
|
|
1976
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1977
|
+
p1: THREE.Vector3;
|
|
1978
|
+
p2: THREE.Vector3;
|
|
1979
|
+
p3: THREE.Vector3;
|
|
1980
|
+
faceNormal: THREE.Vector3;
|
|
1981
|
+
};
|
|
1982
|
+
/**
|
|
1983
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
1984
|
+
* This is used to ensure numerical precision in edge detection.
|
|
1985
|
+
*
|
|
1986
|
+
* @param vector - The vector to round.
|
|
1987
|
+
* @returns The vector with rounded components.
|
|
1988
|
+
*/
|
|
1989
|
+
round(vector: THREE.Vector3): void;
|
|
1990
|
+
/**
|
|
1991
|
+
* Calculates the volume of a set of fragments.
|
|
1992
|
+
*
|
|
1993
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1994
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
1995
|
+
*
|
|
1996
|
+
* @remarks
|
|
1997
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1998
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1999
|
+
*
|
|
2000
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
2001
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
2002
|
+
*/
|
|
2003
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
2004
|
+
/**
|
|
2005
|
+
* Calculates the total volume of a set of meshes.
|
|
2006
|
+
*
|
|
2007
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
2008
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
2009
|
+
*
|
|
2010
|
+
* @remarks
|
|
2011
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
2012
|
+
* and its bounding sphere.
|
|
2013
|
+
*
|
|
2014
|
+
*/
|
|
2015
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
2016
|
+
private getFaceData;
|
|
2017
|
+
private getVolumeOfMesh;
|
|
2018
|
+
private getSignedVolumeOfTriangle;
|
|
2041
2019
|
}
|
|
2042
|
-
export {};
|
|
2043
2020
|
import * as WEBIFC from "web-ifc";
|
|
2044
2021
|
import * as FRAG from "@thatopen/fragments";
|
|
2045
2022
|
import { Component, Components } from "../../core";
|
|
@@ -2065,10 +2042,33 @@ export declare class IfcJsonExporter extends Component {
|
|
|
2065
2042
|
*/
|
|
2066
2043
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
2067
2044
|
}
|
|
2045
|
+
import { BooleanSettingsControl } from "../../Types";
|
|
2046
|
+
import { Viewpoints } from "../index";
|
|
2047
|
+
import { Configurator } from "../../ConfigManager";
|
|
2048
|
+
/**
|
|
2049
|
+
* Configuration interface for the Viewpoints general behavior.
|
|
2050
|
+
*/
|
|
2051
|
+
export interface ViewpointsConfig {
|
|
2052
|
+
/**
|
|
2053
|
+
* Indicates whether to overwrite the fragments colors when applying viewpoints.
|
|
2054
|
+
* @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
|
|
2055
|
+
* @default false
|
|
2056
|
+
*/
|
|
2057
|
+
overwriteColors: boolean;
|
|
2058
|
+
}
|
|
2059
|
+
type ViewpointsConfigType = {
|
|
2060
|
+
overwriteColors: BooleanSettingsControl;
|
|
2061
|
+
};
|
|
2062
|
+
export declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
|
|
2063
|
+
protected _config: ViewpointsConfigType;
|
|
2064
|
+
get overwriteColors(): boolean;
|
|
2065
|
+
set overwriteColors(value: boolean);
|
|
2066
|
+
}
|
|
2067
|
+
export {};
|
|
2068
2068
|
import * as WEBIFC from "web-ifc";
|
|
2069
2069
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
2070
2070
|
import { Disposable, Event, Component, Components } from "../../core";
|
|
2071
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
|
|
2071
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation, RelationsProcessingConfig, EntitiesRelatedEvent } from "./src";
|
|
2072
2072
|
/**
|
|
2073
2073
|
* 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).
|
|
2074
2074
|
*/
|
|
@@ -2109,7 +2109,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
2109
2109
|
constructor(components: Components);
|
|
2110
2110
|
private onFragmentsDisposed;
|
|
2111
2111
|
private indexRelations;
|
|
2112
|
-
getAttributeIndex(inverseAttribute: InverseAttribute): number
|
|
2112
|
+
getAttributeIndex(inverseAttribute: InverseAttribute): number;
|
|
2113
2113
|
/**
|
|
2114
2114
|
* Adds a relation map to the model's relations map.
|
|
2115
2115
|
*
|
|
@@ -2135,7 +2135,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
2135
2135
|
* representation of the relations indexed by entity expressIDs and relation types.
|
|
2136
2136
|
* @throws An error if the model does not have properties loaded.
|
|
2137
2137
|
*/
|
|
2138
|
-
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
2138
|
+
process(model: FragmentsGroup, config?: Partial<RelationsProcessingConfig>): Promise<RelationsMap>;
|
|
2139
2139
|
/**
|
|
2140
2140
|
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
2141
2141
|
*
|
|
@@ -2152,11 +2152,10 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
2152
2152
|
*
|
|
2153
2153
|
* @param model The 'FragmentsGroup' model containing the entity, or its UUID.
|
|
2154
2154
|
* @param expressID The unique identifier of the entity within the model.
|
|
2155
|
-
* @param
|
|
2156
|
-
* @returns An array of express IDs representing the related entities
|
|
2157
|
-
* or the specified relation name is not indexed.
|
|
2155
|
+
* @param attribute The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
2156
|
+
* @returns An array of express IDs representing the related entities. If the array is empty, no relations were found.
|
|
2158
2157
|
*/
|
|
2159
|
-
getEntityRelations(model: FragmentsGroup | string, expressID: number,
|
|
2158
|
+
getEntityRelations(model: FragmentsGroup | string | RelationsMap, expressID: number, attribute: InverseAttribute): number[];
|
|
2160
2159
|
/**
|
|
2161
2160
|
* Serializes the relations of a given relation map into a JSON string.
|
|
2162
2161
|
* 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,
|
|
@@ -2233,7 +2232,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
2233
2232
|
* Converts the relations made into actual IFC data.
|
|
2234
2233
|
*
|
|
2235
2234
|
* @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
|
|
2236
|
-
* It only make sense to use if the relations need to be write in the IFC file.
|
|
2235
|
+
* It only make sense to use it if the relations need to be write in the IFC file.
|
|
2237
2236
|
*
|
|
2238
2237
|
* @returns A promise that resolves when all the relation changes have been applied.
|
|
2239
2238
|
*/
|
|
@@ -2244,16 +2243,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
2244
2243
|
* The event provides information about the type of relation, the inverse attribute,
|
|
2245
2244
|
* the IDs of the entities related, and the IDs of the entities that are being related.
|
|
2246
2245
|
*/
|
|
2247
|
-
readonly onEntitiesRelated: Event<
|
|
2248
|
-
/** The type of the IFC relation. */
|
|
2249
|
-
relType: IfcRelation;
|
|
2250
|
-
/** The inverse attribute of the relation. */
|
|
2251
|
-
invAttribute: InverseAttribute;
|
|
2252
|
-
/** The IDs of the entities that are relating. */
|
|
2253
|
-
relatingIDs: number[];
|
|
2254
|
-
/** The IDs of the entities that are being related. */
|
|
2255
|
-
relatedIDs: number[];
|
|
2256
|
-
}>;
|
|
2246
|
+
readonly onEntitiesRelated: Event<EntitiesRelatedEvent>;
|
|
2257
2247
|
addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
|
|
2258
2248
|
type: IfcRelation;
|
|
2259
2249
|
inv: InverseAttribute;
|
|
@@ -2409,7 +2399,6 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
2409
2399
|
*/
|
|
2410
2400
|
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
2411
2401
|
pset: WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
2412
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties;
|
|
2413
2402
|
}>;
|
|
2414
2403
|
/**
|
|
2415
2404
|
* Removes a Property Set (Pset) from the given model.
|
|
@@ -2602,6 +2591,13 @@ export declare class IfcFinder extends Component {
|
|
|
2602
2591
|
*/
|
|
2603
2592
|
clear(): void;
|
|
2604
2593
|
}
|
|
2594
|
+
import * as WEBIFC from "web-ifc";
|
|
2595
|
+
export interface IfcItemsCategories {
|
|
2596
|
+
[itemID: number]: number;
|
|
2597
|
+
}
|
|
2598
|
+
export declare class IfcCategories {
|
|
2599
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2600
|
+
}
|
|
2605
2601
|
import * as THREE from "three";
|
|
2606
2602
|
import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
|
|
2607
2603
|
import { Configurator } from "../../ConfigManager";
|
|
@@ -2635,84 +2631,23 @@ export declare class ClipperConfigManager extends Configurator<Clipper, ClipperC
|
|
|
2635
2631
|
set size(value: number);
|
|
2636
2632
|
}
|
|
2637
2633
|
export {};
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
path: string;
|
|
2656
|
-
absolute: boolean;
|
|
2657
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2658
|
-
};
|
|
2659
|
-
/** List of categories that won't be converted to fragments. */
|
|
2660
|
-
excludedCategories: Set<number>;
|
|
2661
|
-
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
|
|
2662
|
-
includedCategories: Set<number>;
|
|
2663
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
2664
|
-
saveLocations: boolean;
|
|
2665
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2666
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
2667
|
-
/**
|
|
2668
|
-
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2669
|
-
* If set to true, the path will be set to the default path of the WASM file.
|
|
2670
|
-
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2671
|
-
* Default value is true.
|
|
2672
|
-
*/
|
|
2673
|
-
autoSetWasm: boolean;
|
|
2674
|
-
/**
|
|
2675
|
-
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2676
|
-
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2677
|
-
* If set to null, the default file location handler will be used.
|
|
2678
|
-
*
|
|
2679
|
-
* @param url - The URL of the file to locate.
|
|
2680
|
-
* @returns The absolute path of the file.
|
|
2681
|
-
*/
|
|
2682
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2683
|
-
}
|
|
2684
|
-
import * as WEBIFC from "web-ifc";
|
|
2685
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
2686
|
-
export declare class SpatialStructure {
|
|
2687
|
-
itemsByFloor: IfcItemsCategories;
|
|
2688
|
-
private _units;
|
|
2689
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2690
|
-
cleanUp(): void;
|
|
2691
|
-
}
|
|
2692
|
-
import * as WEBIFC from "web-ifc";
|
|
2693
|
-
export interface IfcItemsCategories {
|
|
2694
|
-
[itemID: number]: number;
|
|
2695
|
-
}
|
|
2696
|
-
export declare class IfcCategories {
|
|
2697
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2698
|
-
}
|
|
2699
|
-
/**
|
|
2700
|
-
* 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.
|
|
2701
|
-
*
|
|
2702
|
-
* @remarks
|
|
2703
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2704
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2705
|
-
*
|
|
2706
|
-
*/
|
|
2707
|
-
export declare const IfcElements: {
|
|
2708
|
-
[key: number]: string;
|
|
2709
|
-
};
|
|
2710
|
-
/**
|
|
2711
|
-
* 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.
|
|
2712
|
-
*/
|
|
2713
|
-
export declare const IfcCategoryMap: {
|
|
2714
|
-
[key: number]: string;
|
|
2715
|
-
};
|
|
2634
|
+
/**
|
|
2635
|
+
* 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.
|
|
2636
|
+
*
|
|
2637
|
+
* @remarks
|
|
2638
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2639
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2640
|
+
*
|
|
2641
|
+
*/
|
|
2642
|
+
export declare const IfcElements: {
|
|
2643
|
+
[key: number]: string;
|
|
2644
|
+
};
|
|
2645
|
+
/**
|
|
2646
|
+
* 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.
|
|
2647
|
+
*/
|
|
2648
|
+
export declare const IfcCategoryMap: {
|
|
2649
|
+
[key: number]: string;
|
|
2650
|
+
};
|
|
2716
2651
|
import * as FRAGS from "@thatopen/fragments";
|
|
2717
2652
|
export declare class IfcPropertiesUtils {
|
|
2718
2653
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2741,13 +2676,26 @@ export declare class IfcPropertiesUtils {
|
|
|
2741
2676
|
export declare const ifcCategoryCase: {
|
|
2742
2677
|
[upperCase: string]: string;
|
|
2743
2678
|
};
|
|
2744
|
-
import { Components } from "../../../../core/Components";
|
|
2745
|
-
import { IDSFacet } from "../facets";
|
|
2746
|
-
export declare const createPropertyFacets: (components: Components, elements: any) => IDSFacet[];
|
|
2747
2679
|
/**
|
|
2748
2680
|
* A Set of unique numbers representing different types of IFC geometries.
|
|
2749
2681
|
*/
|
|
2750
2682
|
export declare const GeometryTypes: Set<number>;
|
|
2683
|
+
import { Components } from "../../../../core/Components";
|
|
2684
|
+
import { IDSFacet } from "../facets";
|
|
2685
|
+
export declare const createPropertyFacets: (components: Components, elements: any) => IDSFacet[];
|
|
2686
|
+
import * as WEBIFC from "web-ifc";
|
|
2687
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2688
|
+
export declare class SpatialStructure {
|
|
2689
|
+
itemsByFloor: IfcItemsCategories;
|
|
2690
|
+
private _units;
|
|
2691
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2692
|
+
cleanUp(): void;
|
|
2693
|
+
}
|
|
2694
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2695
|
+
import * as WEBIFC from "web-ifc";
|
|
2696
|
+
export declare class SpatialIdsFinder {
|
|
2697
|
+
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2698
|
+
}
|
|
2751
2699
|
import * as FRAGS from "@thatopen/fragments";
|
|
2752
2700
|
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
2753
2701
|
import { Components } from "../../../core";
|
|
@@ -2817,84 +2765,374 @@ export declare class IfcQueryGroup {
|
|
|
2817
2765
|
*/
|
|
2818
2766
|
update(modelID: string, file: File): Promise<void>;
|
|
2819
2767
|
}
|
|
2820
|
-
import * as
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
* 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).
|
|
2826
|
-
*/
|
|
2827
|
-
export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
|
|
2828
|
-
/** {@link Disposable.onDisposed} */
|
|
2829
|
-
readonly onDisposed: Event<unknown>;
|
|
2830
|
-
/** {@link Configurable.onSetup} */
|
|
2831
|
-
readonly onSetup: Event<unknown>;
|
|
2832
|
-
/** {@link Configurable.isSetup} */
|
|
2833
|
-
isSetup: boolean;
|
|
2834
|
-
/** The world instance to which this Raycaster belongs. */
|
|
2835
|
-
world: World;
|
|
2836
|
-
/** The components instance to which this grid belongs. */
|
|
2837
|
-
components: Components;
|
|
2838
|
-
/** {@link Configurable.config} */
|
|
2839
|
-
config: SimpleGridConfigManager;
|
|
2840
|
-
protected _defaultConfig: SimpleGridConfig;
|
|
2841
|
-
/** {@link Hideable.visible} */
|
|
2842
|
-
get visible(): boolean;
|
|
2843
|
-
/** {@link Hideable.visible} */
|
|
2844
|
-
set visible(visible: boolean);
|
|
2845
|
-
/** The material of the grid. */
|
|
2846
|
-
get material(): THREE.ShaderMaterial;
|
|
2768
|
+
import * as WEBIFC from "web-ifc";
|
|
2769
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2770
|
+
export declare class IfcFragmentSettings {
|
|
2771
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2772
|
+
includeProperties: boolean;
|
|
2847
2773
|
/**
|
|
2848
|
-
*
|
|
2849
|
-
*
|
|
2774
|
+
* Generate the geometry for categories that are not included by default,
|
|
2775
|
+
* like IFCSPACE.
|
|
2850
2776
|
*/
|
|
2851
|
-
|
|
2777
|
+
optionalCategories: number[];
|
|
2778
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2779
|
+
wasm: {
|
|
2780
|
+
path: string;
|
|
2781
|
+
absolute: boolean;
|
|
2782
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2783
|
+
};
|
|
2784
|
+
/** List of categories that won't be converted to fragments. */
|
|
2785
|
+
excludedCategories: Set<number>;
|
|
2786
|
+
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
|
|
2787
|
+
includedCategories: Set<number>;
|
|
2788
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2789
|
+
saveLocations: boolean;
|
|
2790
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2791
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2852
2792
|
/**
|
|
2853
|
-
* Whether
|
|
2854
|
-
*
|
|
2793
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2794
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2795
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2796
|
+
* Default value is true.
|
|
2855
2797
|
*/
|
|
2856
|
-
|
|
2857
|
-
/**
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2798
|
+
autoSetWasm: boolean;
|
|
2799
|
+
/**
|
|
2800
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2801
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2802
|
+
* If set to null, the default file location handler will be used.
|
|
2803
|
+
*
|
|
2804
|
+
* @param url - The URL of the file to locate.
|
|
2805
|
+
* @returns The absolute path of the file.
|
|
2806
|
+
*/
|
|
2807
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2808
|
+
}
|
|
2809
|
+
import { InverseAttribute } from "./types";
|
|
2810
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
|
|
2811
|
+
forRelating: InverseAttribute;
|
|
2812
|
+
forRelated: InverseAttribute;
|
|
2813
|
+
}>;
|
|
2814
|
+
import { SimplePlane } from "../../Clipper";
|
|
2815
|
+
import { DataSet } from "../../Types";
|
|
2816
|
+
export interface ViewpointCamera {
|
|
2817
|
+
direction: {
|
|
2818
|
+
x: number;
|
|
2819
|
+
y: number;
|
|
2820
|
+
z: number;
|
|
2821
|
+
};
|
|
2822
|
+
position: {
|
|
2823
|
+
x: number;
|
|
2824
|
+
y: number;
|
|
2825
|
+
z: number;
|
|
2826
|
+
};
|
|
2827
|
+
aspectRatio: number;
|
|
2828
|
+
}
|
|
2829
|
+
export interface ViewpointPerspectiveCamera extends ViewpointCamera {
|
|
2830
|
+
fov: number;
|
|
2831
|
+
}
|
|
2832
|
+
export interface ViewpointOrthographicCamera extends ViewpointCamera {
|
|
2833
|
+
viewToWorldScale: number;
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* Represents a viewpoint in a BCF file.
|
|
2837
|
+
*/
|
|
2838
|
+
export interface BCFViewpoint {
|
|
2839
|
+
title?: string;
|
|
2840
|
+
guid: string;
|
|
2841
|
+
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
2842
|
+
selectionComponents: Iterable<string>;
|
|
2843
|
+
exceptionComponents: Iterable<string>;
|
|
2844
|
+
clippingPlanes: DataSet<SimplePlane>;
|
|
2845
|
+
spacesVisible: boolean;
|
|
2846
|
+
spaceBoundariesVisible: boolean;
|
|
2847
|
+
openingsVisible: boolean;
|
|
2848
|
+
defaultVisibility: boolean;
|
|
2867
2849
|
}
|
|
2868
2850
|
import * as THREE from "three";
|
|
2869
|
-
import
|
|
2870
|
-
import {
|
|
2871
|
-
import {
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
primarySize: NumberSettingControl;
|
|
2876
|
-
secondarySize: NumberSettingControl;
|
|
2877
|
-
distance: NumberSettingControl;
|
|
2878
|
-
};
|
|
2851
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2852
|
+
import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
|
|
2853
|
+
import { CameraProjection } from "../../OrthoPerspectiveCamera";
|
|
2854
|
+
import { Components } from "../../Components";
|
|
2855
|
+
import { DataMap, DataSet, World } from "../../Types";
|
|
2856
|
+
import { SimplePlane } from "../../Clipper";
|
|
2879
2857
|
/**
|
|
2880
|
-
*
|
|
2858
|
+
* Represents a BCF compliant viewpoint from BuildingSMART.
|
|
2859
|
+
*
|
|
2860
|
+
* The Viewpoint class provides methods for managing and interacting with viewpoints.
|
|
2861
|
+
* It includes functionality for setting viewpoint properties, updating the camera,
|
|
2862
|
+
* applying color to components, and serializing the viewpoint for export.
|
|
2881
2863
|
*/
|
|
2882
|
-
export
|
|
2864
|
+
export declare class Viewpoint implements BCFViewpoint {
|
|
2865
|
+
title?: string;
|
|
2866
|
+
readonly guid: string;
|
|
2883
2867
|
/**
|
|
2884
|
-
*
|
|
2868
|
+
* ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
|
|
2869
|
+
* Each clipping plane is defined by Location and Direction.
|
|
2870
|
+
* The Direction vector points in the invisible direction meaning the half-space that is clipped.
|
|
2871
|
+
* @experimental
|
|
2885
2872
|
*/
|
|
2886
|
-
|
|
2873
|
+
clippingPlanes: DataSet<SimplePlane>;
|
|
2874
|
+
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
2887
2875
|
/**
|
|
2888
|
-
*
|
|
2876
|
+
* A list of components GUIDs to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
2889
2877
|
*/
|
|
2890
|
-
|
|
2878
|
+
readonly exceptionComponents: DataSet<string>;
|
|
2891
2879
|
/**
|
|
2892
|
-
*
|
|
2880
|
+
* A list of components GUIDs that should be selected (highlighted) when displaying a viewpoint.
|
|
2893
2881
|
*/
|
|
2894
|
-
|
|
2882
|
+
readonly selectionComponents: DataSet<string>;
|
|
2895
2883
|
/**
|
|
2896
|
-
*
|
|
2897
|
-
|
|
2884
|
+
* A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
|
|
2885
|
+
* For this to work, call viewpoint.colorize()
|
|
2886
|
+
*/
|
|
2887
|
+
readonly componentColors: DataMap<THREE.Color, string[]>;
|
|
2888
|
+
/**
|
|
2889
|
+
* Boolean flags to allow fine control over the visibility of spaces.
|
|
2890
|
+
* A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
|
|
2891
|
+
* @default false
|
|
2892
|
+
*/
|
|
2893
|
+
spacesVisible: boolean;
|
|
2894
|
+
/**
|
|
2895
|
+
* Boolean flags to allow fine control over the visibility of space boundaries.
|
|
2896
|
+
* A typical use of these flags is when DefaultVisibility=true but space boundaries should remain hidden.
|
|
2897
|
+
* @default false
|
|
2898
|
+
*/
|
|
2899
|
+
spaceBoundariesVisible: boolean;
|
|
2900
|
+
/**
|
|
2901
|
+
* Boolean flags to allow fine control over the visibility of openings.
|
|
2902
|
+
* A typical use of these flags is when DefaultVisibility=true but openings should remain hidden.
|
|
2903
|
+
* @default false
|
|
2904
|
+
*/
|
|
2905
|
+
openingsVisible: boolean;
|
|
2906
|
+
/**
|
|
2907
|
+
* When true, all components should be visible unless listed in the exceptions
|
|
2908
|
+
* When false all components should be invisible unless listed in the exceptions
|
|
2909
|
+
*/
|
|
2910
|
+
defaultVisibility: boolean;
|
|
2911
|
+
private get _selectionModelIdMap();
|
|
2912
|
+
private get _exceptionModelIdMap();
|
|
2913
|
+
/**
|
|
2914
|
+
* A list of components that should be selected (highlighted) when displaying a viewpoint.
|
|
2915
|
+
* @returns The fragmentIdMap for components marked as selections.
|
|
2916
|
+
*/
|
|
2917
|
+
get selection(): FRAGS.FragmentIdMap;
|
|
2918
|
+
/**
|
|
2919
|
+
* A list of components to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
2920
|
+
* @returns The fragmentIdMap for components marked as exceptions.
|
|
2921
|
+
*/
|
|
2922
|
+
get exception(): FRAGS.FragmentIdMap;
|
|
2923
|
+
/**
|
|
2924
|
+
* Retrieves the projection type of the viewpoint's camera.
|
|
2925
|
+
*
|
|
2926
|
+
* @returns A string representing the projection type of the viewpoint's camera.
|
|
2927
|
+
* It can be either 'Perspective' or 'Orthographic'.
|
|
2928
|
+
*/
|
|
2929
|
+
get projection(): CameraProjection;
|
|
2930
|
+
/**
|
|
2931
|
+
* Retrieves the position vector of the viewpoint's camera.
|
|
2932
|
+
*
|
|
2933
|
+
* @remarks
|
|
2934
|
+
* The position vector represents the camera's position in the world coordinate system.
|
|
2935
|
+
* The function applies the base coordinate system transformation to the position vector.
|
|
2936
|
+
*
|
|
2937
|
+
* @returns A THREE.Vector3 representing the position of the viewpoint's camera.
|
|
2938
|
+
*/
|
|
2939
|
+
get position(): THREE.Vector3;
|
|
2940
|
+
/**
|
|
2941
|
+
* Retrieves the direction vector of the viewpoint's camera.
|
|
2942
|
+
*
|
|
2943
|
+
* @remarks
|
|
2944
|
+
* The direction vector represents the direction in which the camera is pointing.
|
|
2945
|
+
* It is calculated by extracting the x, y, and z components from the camera's direction property.
|
|
2946
|
+
*
|
|
2947
|
+
* @returns A THREE.Vector3 representing the direction of the viewpoint's camera.
|
|
2948
|
+
*/
|
|
2949
|
+
get direction(): THREE.Vector3;
|
|
2950
|
+
private _components;
|
|
2951
|
+
/**
|
|
2952
|
+
* Represents the world in which the viewpoints are created and managed.
|
|
2953
|
+
*/
|
|
2954
|
+
readonly world: World;
|
|
2955
|
+
private get _managerVersion();
|
|
2956
|
+
/**
|
|
2957
|
+
* Retrieves the list of BCF topics associated with the current viewpoint.
|
|
2958
|
+
*
|
|
2959
|
+
* @remarks
|
|
2960
|
+
* This function retrieves the BCFTopics manager from the components,
|
|
2961
|
+
* then filters the list of topics to find those associated with the current viewpoint.
|
|
2962
|
+
*
|
|
2963
|
+
* @returns An array of BCF topics associated with the current viewpoint.
|
|
2964
|
+
*/
|
|
2965
|
+
get topics(): import("../../../openbim/BCFTopics").Topic[];
|
|
2966
|
+
constructor(components: Components, world: World, _config?: {
|
|
2967
|
+
data?: Partial<BCFViewpoint>;
|
|
2968
|
+
setCamera?: boolean;
|
|
2969
|
+
});
|
|
2970
|
+
/**
|
|
2971
|
+
* Adds components to the viewpoint based on the provided fragment ID map.
|
|
2972
|
+
*
|
|
2973
|
+
* @param fragmentIdMap - A map containing fragment IDs as keys and arrays of express IDs as values.
|
|
2974
|
+
*/
|
|
2975
|
+
addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
2976
|
+
/**
|
|
2977
|
+
* Replace the properties of the viewpoint with the provided data.
|
|
2978
|
+
*
|
|
2979
|
+
* @remarks The guid will be ommited as it shouldn't change after it has been initially set.
|
|
2980
|
+
* @remarks The existing selection and exception components will be fully replaced in case new ones are provided.
|
|
2981
|
+
*
|
|
2982
|
+
* @param data - An object containing the properties to be set.
|
|
2983
|
+
* The properties not included in the object will remain unchanged.
|
|
2984
|
+
*
|
|
2985
|
+
* @returns The viewpoint instance with the updated properties.
|
|
2986
|
+
*/
|
|
2987
|
+
set(data: Partial<BCFViewpoint>): this;
|
|
2988
|
+
/**
|
|
2989
|
+
* Sets the viewpoint of the camera in the world.
|
|
2990
|
+
*
|
|
2991
|
+
* @remarks
|
|
2992
|
+
* This function calculates the target position based on the viewpoint information.
|
|
2993
|
+
* It sets the visibility of the viewpoint components and then applies the viewpoint using the camera's controls.
|
|
2994
|
+
*
|
|
2995
|
+
* @param transition - Indicates whether the camera movement should have a transition effect.
|
|
2996
|
+
* Default value is 'true'.
|
|
2997
|
+
*
|
|
2998
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
2999
|
+
*
|
|
3000
|
+
* @returns A Promise that resolves when the camera has been set.
|
|
3001
|
+
*/
|
|
3002
|
+
go(transition?: boolean): Promise<void>;
|
|
3003
|
+
/**
|
|
3004
|
+
* Updates the camera settings of the viewpoint based on the current world's camera and renderer.
|
|
3005
|
+
*
|
|
3006
|
+
* @remarks
|
|
3007
|
+
* This function retrieves the camera's position, direction, and aspect ratio from the world's camera and renderer.
|
|
3008
|
+
* It then calculates the camera's perspective or orthographic settings based on the camera type.
|
|
3009
|
+
* Finally, it updates the viewpoint's camera settings and updates the viewpoint to the Viewpoints manager.
|
|
3010
|
+
*
|
|
3011
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
3012
|
+
* @throws An error if the world's renderer is not available.
|
|
3013
|
+
*/
|
|
3014
|
+
updateCamera(): void;
|
|
3015
|
+
applyVisibility(): void;
|
|
3016
|
+
/**
|
|
3017
|
+
* Applies color to the components in the viewpoint based on their GUIDs.
|
|
3018
|
+
*
|
|
3019
|
+
* This function iterates through the 'componentColors' map, retrieves the fragment IDs
|
|
3020
|
+
* corresponding to each color, and then uses the 'Classifier' to apply the color to those fragments.
|
|
3021
|
+
*
|
|
3022
|
+
* @remarks
|
|
3023
|
+
* The color is applied using the 'Classifier.setColor' method, which sets the color of the specified fragments.
|
|
3024
|
+
* The color is provided as a hexadecimal string, prefixed with a '#'.
|
|
3025
|
+
*/
|
|
3026
|
+
applyColors(): void;
|
|
3027
|
+
/**
|
|
3028
|
+
* Resets the colors of all components in the viewpoint to their original color.
|
|
3029
|
+
*/
|
|
3030
|
+
resetColors(): void;
|
|
3031
|
+
private createComponentTags;
|
|
3032
|
+
private createColorTags;
|
|
3033
|
+
/**
|
|
3034
|
+
* Serializes the viewpoint into a buildingSMART compliant XML string for export.
|
|
3035
|
+
*
|
|
3036
|
+
* @param version - The version of the BCF Manager to use for serialization.
|
|
3037
|
+
* If not provided, the current version of the manager will be used.
|
|
3038
|
+
*
|
|
3039
|
+
* @returns A Promise that resolves to an XML string representing the viewpoint.
|
|
3040
|
+
* The XML string follows the BCF VisualizationInfo schema.
|
|
3041
|
+
*
|
|
3042
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
3043
|
+
* @throws An error if the world's renderer is not available.
|
|
3044
|
+
*/
|
|
3045
|
+
serialize(version?: string): Promise<string>;
|
|
3046
|
+
}
|
|
3047
|
+
import { ControlsSchema, ControlEntry } from "../../Types";
|
|
3048
|
+
import { Components } from "../../Components";
|
|
3049
|
+
export declare abstract class Configurator<T, U extends ControlsSchema> {
|
|
3050
|
+
protected abstract _config: U;
|
|
3051
|
+
protected _component: T;
|
|
3052
|
+
name: string;
|
|
3053
|
+
uuid: string;
|
|
3054
|
+
get controls(): U;
|
|
3055
|
+
constructor(component: T, components: Components, name: string, uuid?: string);
|
|
3056
|
+
copyEntry(controlEntry: ControlEntry): ControlEntry;
|
|
3057
|
+
}
|
|
3058
|
+
import * as THREE from "three";
|
|
3059
|
+
import { Hideable, Event, World, Disposable, Configurable } from "../../Types";
|
|
3060
|
+
import { Components } from "../../Components";
|
|
3061
|
+
import { SimpleGridConfig, SimpleGridConfigManager } from "./simple-grid-config";
|
|
3062
|
+
/**
|
|
3063
|
+
* 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).
|
|
3064
|
+
*/
|
|
3065
|
+
export declare class SimpleGrid implements Hideable, Disposable, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
|
|
3066
|
+
/** {@link Disposable.onDisposed} */
|
|
3067
|
+
readonly onDisposed: Event<unknown>;
|
|
3068
|
+
/** {@link Configurable.onSetup} */
|
|
3069
|
+
readonly onSetup: Event<unknown>;
|
|
3070
|
+
/** {@link Configurable.isSetup} */
|
|
3071
|
+
isSetup: boolean;
|
|
3072
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3073
|
+
world: World;
|
|
3074
|
+
/** The components instance to which this grid belongs. */
|
|
3075
|
+
components: Components;
|
|
3076
|
+
/** {@link Configurable.config} */
|
|
3077
|
+
config: SimpleGridConfigManager;
|
|
3078
|
+
protected _defaultConfig: SimpleGridConfig;
|
|
3079
|
+
/** {@link Hideable.visible} */
|
|
3080
|
+
get visible(): boolean;
|
|
3081
|
+
/** {@link Hideable.visible} */
|
|
3082
|
+
set visible(visible: boolean);
|
|
3083
|
+
/** The material of the grid. */
|
|
3084
|
+
get material(): THREE.ShaderMaterial;
|
|
3085
|
+
/**
|
|
3086
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3087
|
+
* perspective cameras and false for orthographic cameras.
|
|
3088
|
+
*/
|
|
3089
|
+
get fade(): boolean;
|
|
3090
|
+
/**
|
|
3091
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3092
|
+
* perspective cameras and false for orthographic cameras.
|
|
3093
|
+
*/
|
|
3094
|
+
set fade(active: boolean);
|
|
3095
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3096
|
+
readonly three: THREE.Mesh;
|
|
3097
|
+
private _fade;
|
|
3098
|
+
constructor(components: Components, world: World);
|
|
3099
|
+
/** {@link Configurable.setup} */
|
|
3100
|
+
setup(config?: Partial<SimpleGridConfig>): void;
|
|
3101
|
+
/** {@link Disposable.dispose} */
|
|
3102
|
+
dispose(): void;
|
|
3103
|
+
private setupEvents;
|
|
3104
|
+
private updateZoom;
|
|
3105
|
+
}
|
|
3106
|
+
import * as THREE from "three";
|
|
3107
|
+
import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
|
|
3108
|
+
import { Configurator } from "../../ConfigManager";
|
|
3109
|
+
import { SimpleGrid } from "./simple-grid";
|
|
3110
|
+
type SimpleGridConfigType = {
|
|
3111
|
+
visible: BooleanSettingsControl;
|
|
3112
|
+
color: ColorSettingsControl;
|
|
3113
|
+
primarySize: NumberSettingControl;
|
|
3114
|
+
secondarySize: NumberSettingControl;
|
|
3115
|
+
distance: NumberSettingControl;
|
|
3116
|
+
};
|
|
3117
|
+
/**
|
|
3118
|
+
* Configuration interface for the {@link SimpleGrid}.
|
|
3119
|
+
*/
|
|
3120
|
+
export interface SimpleGridConfig {
|
|
3121
|
+
/**
|
|
3122
|
+
* Whether the grid is visible or not.
|
|
3123
|
+
*/
|
|
3124
|
+
visible: boolean;
|
|
3125
|
+
/**
|
|
3126
|
+
* The color of the grid lines.
|
|
3127
|
+
*/
|
|
3128
|
+
color: THREE.Color;
|
|
3129
|
+
/**
|
|
3130
|
+
* The size of the primary grid lines.
|
|
3131
|
+
*/
|
|
3132
|
+
primarySize: number;
|
|
3133
|
+
/**
|
|
3134
|
+
* The size of the secondary grid lines.
|
|
3135
|
+
*/
|
|
2898
3136
|
secondarySize: number;
|
|
2899
3137
|
/**
|
|
2900
3138
|
* The distance at which the grid lines start to fade away.
|
|
@@ -3045,11 +3283,6 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable, Conf
|
|
|
3045
3283
|
setup(config?: Partial<MiniMapConfig>): void;
|
|
3046
3284
|
private updatePlanes;
|
|
3047
3285
|
}
|
|
3048
|
-
import { InverseAttribute } from "./types";
|
|
3049
|
-
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
|
|
3050
|
-
forRelating: InverseAttribute;
|
|
3051
|
-
forRelated: InverseAttribute;
|
|
3052
|
-
}>;
|
|
3053
3286
|
import * as THREE from "three";
|
|
3054
3287
|
import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
|
|
3055
3288
|
import { Configurator } from "../../ConfigManager";
|
|
@@ -3162,141 +3395,30 @@ export declare class MiniMapConfigManager extends Configurator<MiniMap, MiniMapC
|
|
|
3162
3395
|
set backgroundColor(value: THREE.Color);
|
|
3163
3396
|
}
|
|
3164
3397
|
export {};
|
|
3165
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3166
3398
|
import * as THREE from "three";
|
|
3399
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3167
3400
|
import { Components } from "../../Components";
|
|
3168
|
-
import {
|
|
3169
|
-
import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
|
|
3401
|
+
import { SimpleSceneConfig, SimpleSceneConfigManager } from "./simple-scene-config";
|
|
3170
3402
|
/**
|
|
3171
|
-
* A
|
|
3403
|
+
* 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.
|
|
3172
3404
|
*/
|
|
3173
|
-
export declare class
|
|
3405
|
+
export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
|
|
3174
3406
|
/** {@link Configurable.onSetup} */
|
|
3175
3407
|
readonly onSetup: Event<unknown>;
|
|
3176
|
-
/** {@link Disposable.onDisposed} */
|
|
3177
|
-
readonly onDisposed: Event<string>;
|
|
3178
|
-
/**
|
|
3179
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
3180
|
-
* meshes that are currently visible, and the ones that were visible
|
|
3181
|
-
* just before but not anymore.
|
|
3182
|
-
*/
|
|
3183
|
-
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
3184
|
-
/**
|
|
3185
|
-
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3186
|
-
*/
|
|
3187
|
-
enabled: boolean;
|
|
3188
|
-
/**
|
|
3189
|
-
* Needs to check whether there are objects that need to be hidden or shown.
|
|
3190
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3191
|
-
*/
|
|
3192
|
-
needsUpdate: boolean;
|
|
3193
|
-
/** The components instance to which this renderer belongs. */
|
|
3194
|
-
components: Components;
|
|
3195
|
-
/** The render target used to render the visibility scene. */
|
|
3196
|
-
renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
|
|
3197
|
-
/**
|
|
3198
|
-
* The size of the buffer where the result of the visibility check is stored.
|
|
3199
|
-
*/
|
|
3200
|
-
bufferSize: number;
|
|
3201
|
-
/**
|
|
3202
|
-
* The buffer when the result of the visibility check is stored.
|
|
3203
|
-
*/
|
|
3204
|
-
buffer: Uint8Array;
|
|
3205
|
-
/**
|
|
3206
|
-
* Flag to indicate if the renderer shouldn't update the visibility.
|
|
3207
|
-
*/
|
|
3208
|
-
preventUpdate: boolean;
|
|
3209
|
-
/** {@link Configurable.config} */
|
|
3210
|
-
config: CullerRendererConfigManager;
|
|
3211
3408
|
/** {@link Configurable.isSetup} */
|
|
3212
3409
|
isSetup: boolean;
|
|
3213
|
-
/** The world instance to which this renderer belongs. */
|
|
3214
|
-
readonly world: World;
|
|
3215
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
3216
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
3217
|
-
protected _defaultConfig: CullerRendererConfig;
|
|
3218
|
-
protected readonly worker: Worker;
|
|
3219
|
-
protected readonly scene: THREE.Scene;
|
|
3220
|
-
private _availableColor;
|
|
3221
|
-
protected _isWorkerBusy: boolean;
|
|
3222
|
-
constructor(components: Components, world: World);
|
|
3223
|
-
/** {@link Disposable.dispose} */
|
|
3224
|
-
dispose(): void;
|
|
3225
|
-
/**
|
|
3226
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
3227
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
3228
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3229
|
-
* not true.
|
|
3230
|
-
*/
|
|
3231
|
-
updateVisibility: (force?: boolean) => Promise<void>;
|
|
3232
|
-
setup(config?: Partial<CullerRendererConfig>): void;
|
|
3233
|
-
protected getAvailableColor(): {
|
|
3234
|
-
r: number;
|
|
3235
|
-
g: number;
|
|
3236
|
-
b: number;
|
|
3237
|
-
code: string;
|
|
3238
|
-
};
|
|
3239
|
-
protected increaseColor(): void;
|
|
3240
|
-
protected decreaseColor(): void;
|
|
3241
|
-
}
|
|
3242
|
-
import * as THREE from "three";
|
|
3243
|
-
import { CullerRenderer } from "./culler-renderer";
|
|
3244
|
-
import { Components } from "../../Components";
|
|
3245
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3246
|
-
/**
|
|
3247
|
-
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
3248
|
-
*/
|
|
3249
|
-
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3250
|
-
/**
|
|
3251
|
-
* Event triggered when the visibility of meshes is updated.
|
|
3252
|
-
* Contains two sets: seen and unseen.
|
|
3253
|
-
*/
|
|
3254
|
-
readonly onViewUpdated: Event<{
|
|
3255
|
-
seen: Set<THREE.Mesh>;
|
|
3256
|
-
unseen: Set<THREE.Mesh>;
|
|
3257
|
-
}>;
|
|
3258
|
-
/**
|
|
3259
|
-
* Map of color code to THREE.InstancedMesh.
|
|
3260
|
-
* Used to keep track of color-coded meshes.
|
|
3261
|
-
*/
|
|
3262
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3263
|
-
/**
|
|
3264
|
-
* @deprecated use config.threshold instead.
|
|
3265
|
-
*/
|
|
3266
|
-
get threshold(): number;
|
|
3267
3410
|
/**
|
|
3268
|
-
*
|
|
3411
|
+
* The underlying Three.js scene object.
|
|
3412
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3269
3413
|
*/
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
/** {@link Disposable.dispose} */
|
|
3414
|
+
three: THREE.Scene;
|
|
3415
|
+
/** {@link Configurable.config} */
|
|
3416
|
+
config: SimpleSceneConfigManager;
|
|
3417
|
+
protected _defaultConfig: SimpleSceneConfig;
|
|
3418
|
+
constructor(components: Components);
|
|
3419
|
+
/** {@link Configurable.setup} */
|
|
3420
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3278
3421
|
dispose(): void;
|
|
3279
|
-
/**
|
|
3280
|
-
* 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.
|
|
3281
|
-
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3282
|
-
*/
|
|
3283
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3284
|
-
/**
|
|
3285
|
-
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3286
|
-
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3287
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3288
|
-
*/
|
|
3289
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3290
|
-
/**
|
|
3291
|
-
* 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.
|
|
3292
|
-
*
|
|
3293
|
-
* @param meshes - The meshes to update.
|
|
3294
|
-
*
|
|
3295
|
-
* @returns {void}
|
|
3296
|
-
*/
|
|
3297
|
-
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
3298
|
-
private handleWorkerMessage;
|
|
3299
|
-
private getAvailableMaterial;
|
|
3300
3422
|
}
|
|
3301
3423
|
import * as THREE from "three";
|
|
3302
3424
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
@@ -3377,42 +3499,6 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
3377
3499
|
/** {@link Disposable.dispose} */
|
|
3378
3500
|
dispose(disposeResources?: boolean): void;
|
|
3379
3501
|
}
|
|
3380
|
-
import { ControlsSchema, ControlEntry } from "../../Types";
|
|
3381
|
-
import { Components } from "../../Components";
|
|
3382
|
-
export declare abstract class Configurator<T, U extends ControlsSchema> {
|
|
3383
|
-
protected abstract _config: U;
|
|
3384
|
-
protected _component: T;
|
|
3385
|
-
name: string;
|
|
3386
|
-
uuid: string;
|
|
3387
|
-
get controls(): U;
|
|
3388
|
-
constructor(component: T, components: Components, name: string, uuid?: string);
|
|
3389
|
-
copyEntry(controlEntry: ControlEntry): ControlEntry;
|
|
3390
|
-
}
|
|
3391
|
-
import * as THREE from "three";
|
|
3392
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3393
|
-
import { Components } from "../../Components";
|
|
3394
|
-
import { SimpleSceneConfig, SimpleSceneConfigManager } from "./simple-scene-config";
|
|
3395
|
-
/**
|
|
3396
|
-
* 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.
|
|
3397
|
-
*/
|
|
3398
|
-
export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
|
|
3399
|
-
/** {@link Configurable.onSetup} */
|
|
3400
|
-
readonly onSetup: Event<unknown>;
|
|
3401
|
-
/** {@link Configurable.isSetup} */
|
|
3402
|
-
isSetup: boolean;
|
|
3403
|
-
/**
|
|
3404
|
-
* The underlying Three.js scene object.
|
|
3405
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3406
|
-
*/
|
|
3407
|
-
three: THREE.Scene;
|
|
3408
|
-
/** {@link Configurable.config} */
|
|
3409
|
-
config: SimpleSceneConfigManager;
|
|
3410
|
-
protected _defaultConfig: SimpleSceneConfig;
|
|
3411
|
-
constructor(components: Components);
|
|
3412
|
-
/** {@link Configurable.setup} */
|
|
3413
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3414
|
-
dispose(): void;
|
|
3415
|
-
}
|
|
3416
3502
|
import * as THREE from "three";
|
|
3417
3503
|
import { BaseRenderer, Event } from "../../Types";
|
|
3418
3504
|
import { Components } from "../../Components";
|
|
@@ -3530,68 +3616,280 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
3530
3616
|
private static getSubsetOfThree;
|
|
3531
3617
|
}
|
|
3532
3618
|
import * as THREE from "three";
|
|
3533
|
-
import {
|
|
3534
|
-
import { ColorSettingsControl, NumberSettingControl, Vector3SettingControl } from "../../Types";
|
|
3535
|
-
import { Configurator } from "../../ConfigManager";
|
|
3536
|
-
type SimpleSceneConfigType = {
|
|
3537
|
-
backgroundColor: ColorSettingsControl;
|
|
3538
|
-
ambientLight: {
|
|
3539
|
-
color: ColorSettingsControl;
|
|
3540
|
-
intensity: NumberSettingControl;
|
|
3541
|
-
};
|
|
3542
|
-
directionalLight: {
|
|
3543
|
-
color: ColorSettingsControl;
|
|
3544
|
-
intensity: NumberSettingControl;
|
|
3545
|
-
position: Vector3SettingControl;
|
|
3546
|
-
};
|
|
3547
|
-
};
|
|
3548
|
-
declare class DirectionalLightConfig {
|
|
3549
|
-
private _list;
|
|
3550
|
-
private _scene;
|
|
3551
|
-
constructor(list: SimpleSceneConfigType, scene: SimpleScene);
|
|
3552
|
-
get color(): THREE.Color;
|
|
3553
|
-
set color(value: THREE.Color);
|
|
3554
|
-
get intensity(): number;
|
|
3555
|
-
set intensity(value: number);
|
|
3556
|
-
get position(): THREE.Vector3;
|
|
3557
|
-
set position(value: THREE.Vector3);
|
|
3558
|
-
}
|
|
3559
|
-
declare class AmbientLightConfig {
|
|
3560
|
-
private _list;
|
|
3561
|
-
private _scene;
|
|
3562
|
-
constructor(list: SimpleSceneConfigType, scene: SimpleScene);
|
|
3563
|
-
get color(): THREE.Color;
|
|
3564
|
-
set color(value: THREE.Color);
|
|
3565
|
-
get intensity(): number;
|
|
3566
|
-
set intensity(value: number);
|
|
3567
|
-
}
|
|
3619
|
+
import { Disposable, Event } from "../../Types";
|
|
3568
3620
|
/**
|
|
3569
|
-
*
|
|
3621
|
+
* 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.
|
|
3570
3622
|
*/
|
|
3571
|
-
export
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
}
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3623
|
+
export declare class Mouse implements Disposable {
|
|
3624
|
+
dom: HTMLCanvasElement;
|
|
3625
|
+
private _event?;
|
|
3626
|
+
private _position;
|
|
3627
|
+
/** {@link Disposable.onDisposed} */
|
|
3628
|
+
readonly onDisposed: Event<unknown>;
|
|
3629
|
+
constructor(dom: HTMLCanvasElement);
|
|
3630
|
+
/**
|
|
3631
|
+
* The real position of the mouse of the Three.js canvas.
|
|
3632
|
+
*/
|
|
3633
|
+
get position(): THREE.Vector2;
|
|
3634
|
+
/** {@link Disposable.dispose} */
|
|
3635
|
+
dispose(): void;
|
|
3636
|
+
private getPositionY;
|
|
3637
|
+
private getPositionX;
|
|
3638
|
+
private updateMouseInfo;
|
|
3639
|
+
private getDataObject;
|
|
3640
|
+
private setupEvents;
|
|
3589
3641
|
}
|
|
3590
|
-
|
|
3642
|
+
import * as THREE from "three";
|
|
3643
|
+
import { Components } from "../../Components";
|
|
3644
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3645
|
+
import { Mouse } from "./mouse";
|
|
3591
3646
|
/**
|
|
3592
|
-
*
|
|
3647
|
+
* 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.
|
|
3593
3648
|
*/
|
|
3594
|
-
export declare class
|
|
3649
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
3650
|
+
/** {@link Component.enabled} */
|
|
3651
|
+
enabled: boolean;
|
|
3652
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3653
|
+
components: Components;
|
|
3654
|
+
/** {@link Disposable.onDisposed} */
|
|
3655
|
+
readonly onDisposed: Event<unknown>;
|
|
3656
|
+
/** The position of the mouse in the screen. */
|
|
3657
|
+
readonly mouse: Mouse;
|
|
3658
|
+
/**
|
|
3659
|
+
* A reference to the Three.js Raycaster instance.
|
|
3660
|
+
* This is used for raycasting operations.
|
|
3661
|
+
*/
|
|
3662
|
+
readonly three: THREE.Raycaster;
|
|
3663
|
+
/**
|
|
3664
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3665
|
+
* This is used to access the camera and meshes.
|
|
3666
|
+
*/
|
|
3667
|
+
world: World;
|
|
3668
|
+
constructor(components: Components, world: World);
|
|
3669
|
+
/** {@link Disposable.dispose} */
|
|
3670
|
+
dispose(): void;
|
|
3671
|
+
/**
|
|
3672
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3673
|
+
* the first item found. This also takes into account the clipping planes
|
|
3674
|
+
* used by the renderer.
|
|
3675
|
+
*
|
|
3676
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3677
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3678
|
+
* {@link Components.meshes}.
|
|
3679
|
+
*/
|
|
3680
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3681
|
+
/**
|
|
3682
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3683
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
3684
|
+
*
|
|
3685
|
+
* @param origin - The origin of the ray.
|
|
3686
|
+
* @param direction - The direction of the ray.
|
|
3687
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3688
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3689
|
+
*/
|
|
3690
|
+
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;
|
|
3691
|
+
private intersect;
|
|
3692
|
+
private filterClippingPlanes;
|
|
3693
|
+
}
|
|
3694
|
+
import * as THREE from "three";
|
|
3695
|
+
import { Components } from "../../Components";
|
|
3696
|
+
import { AsyncEvent, Configurable, Event, World } from "../../Types";
|
|
3697
|
+
import { CullerRendererConfig, CullerRendererConfigManager } from "./culler-renderer-config";
|
|
3698
|
+
/**
|
|
3699
|
+
* A base renderer to determine visibility on screen.
|
|
3700
|
+
*/
|
|
3701
|
+
export declare class CullerRenderer implements Configurable<CullerRendererConfigManager, CullerRendererConfig> {
|
|
3702
|
+
/** {@link Configurable.onSetup} */
|
|
3703
|
+
readonly onSetup: Event<unknown>;
|
|
3704
|
+
/** {@link Disposable.onDisposed} */
|
|
3705
|
+
readonly onDisposed: Event<string>;
|
|
3706
|
+
/**
|
|
3707
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
3708
|
+
* meshes that are currently visible, and the ones that were visible
|
|
3709
|
+
* just before but not anymore.
|
|
3710
|
+
*/
|
|
3711
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
3712
|
+
/**
|
|
3713
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3714
|
+
*/
|
|
3715
|
+
enabled: boolean;
|
|
3716
|
+
/**
|
|
3717
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
3718
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3719
|
+
*/
|
|
3720
|
+
needsUpdate: boolean;
|
|
3721
|
+
/** The components instance to which this renderer belongs. */
|
|
3722
|
+
components: Components;
|
|
3723
|
+
/** The render target used to render the visibility scene. */
|
|
3724
|
+
renderTarget: THREE.WebGLRenderTarget<THREE.Texture>;
|
|
3725
|
+
/**
|
|
3726
|
+
* The size of the buffer where the result of the visibility check is stored.
|
|
3727
|
+
*/
|
|
3728
|
+
bufferSize: number;
|
|
3729
|
+
/**
|
|
3730
|
+
* The buffer when the result of the visibility check is stored.
|
|
3731
|
+
*/
|
|
3732
|
+
buffer: Uint8Array;
|
|
3733
|
+
/**
|
|
3734
|
+
* Flag to indicate if the renderer shouldn't update the visibility.
|
|
3735
|
+
*/
|
|
3736
|
+
preventUpdate: boolean;
|
|
3737
|
+
/** {@link Configurable.config} */
|
|
3738
|
+
config: CullerRendererConfigManager;
|
|
3739
|
+
/** {@link Configurable.isSetup} */
|
|
3740
|
+
isSetup: boolean;
|
|
3741
|
+
/** The world instance to which this renderer belongs. */
|
|
3742
|
+
readonly world: World;
|
|
3743
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
3744
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
3745
|
+
protected _defaultConfig: CullerRendererConfig;
|
|
3746
|
+
protected readonly worker: Worker;
|
|
3747
|
+
protected readonly scene: THREE.Scene;
|
|
3748
|
+
private _availableColor;
|
|
3749
|
+
protected _isWorkerBusy: boolean;
|
|
3750
|
+
constructor(components: Components, world: World);
|
|
3751
|
+
/** {@link Disposable.dispose} */
|
|
3752
|
+
dispose(): void;
|
|
3753
|
+
/**
|
|
3754
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
3755
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
3756
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3757
|
+
* not true.
|
|
3758
|
+
*/
|
|
3759
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
3760
|
+
setup(config?: Partial<CullerRendererConfig>): void;
|
|
3761
|
+
protected getAvailableColor(): {
|
|
3762
|
+
r: number;
|
|
3763
|
+
g: number;
|
|
3764
|
+
b: number;
|
|
3765
|
+
code: string;
|
|
3766
|
+
};
|
|
3767
|
+
protected increaseColor(): void;
|
|
3768
|
+
protected decreaseColor(): void;
|
|
3769
|
+
}
|
|
3770
|
+
import * as THREE from "three";
|
|
3771
|
+
import { SimpleScene } from "./simple-scene";
|
|
3772
|
+
import { ColorSettingsControl, NumberSettingControl, Vector3SettingControl } from "../../Types";
|
|
3773
|
+
import { Configurator } from "../../ConfigManager";
|
|
3774
|
+
type SimpleSceneConfigType = {
|
|
3775
|
+
backgroundColor: ColorSettingsControl;
|
|
3776
|
+
ambientLight: {
|
|
3777
|
+
color: ColorSettingsControl;
|
|
3778
|
+
intensity: NumberSettingControl;
|
|
3779
|
+
};
|
|
3780
|
+
directionalLight: {
|
|
3781
|
+
color: ColorSettingsControl;
|
|
3782
|
+
intensity: NumberSettingControl;
|
|
3783
|
+
position: Vector3SettingControl;
|
|
3784
|
+
};
|
|
3785
|
+
};
|
|
3786
|
+
declare class DirectionalLightConfig {
|
|
3787
|
+
private _list;
|
|
3788
|
+
private _scene;
|
|
3789
|
+
constructor(list: SimpleSceneConfigType, scene: SimpleScene);
|
|
3790
|
+
get color(): THREE.Color;
|
|
3791
|
+
set color(value: THREE.Color);
|
|
3792
|
+
get intensity(): number;
|
|
3793
|
+
set intensity(value: number);
|
|
3794
|
+
get position(): THREE.Vector3;
|
|
3795
|
+
set position(value: THREE.Vector3);
|
|
3796
|
+
}
|
|
3797
|
+
declare class AmbientLightConfig {
|
|
3798
|
+
private _list;
|
|
3799
|
+
private _scene;
|
|
3800
|
+
constructor(list: SimpleSceneConfigType, scene: SimpleScene);
|
|
3801
|
+
get color(): THREE.Color;
|
|
3802
|
+
set color(value: THREE.Color);
|
|
3803
|
+
get intensity(): number;
|
|
3804
|
+
set intensity(value: number);
|
|
3805
|
+
}
|
|
3806
|
+
/**
|
|
3807
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3808
|
+
*/
|
|
3809
|
+
export interface SimpleSceneConfig {
|
|
3810
|
+
backgroundColor: THREE.Color;
|
|
3811
|
+
directionalLight: {
|
|
3812
|
+
color: THREE.Color;
|
|
3813
|
+
intensity: number;
|
|
3814
|
+
position: THREE.Vector3;
|
|
3815
|
+
};
|
|
3816
|
+
ambientLight: {
|
|
3817
|
+
color: THREE.Color;
|
|
3818
|
+
intensity: number;
|
|
3819
|
+
};
|
|
3820
|
+
}
|
|
3821
|
+
export declare class SimpleSceneConfigManager extends Configurator<SimpleScene, SimpleSceneConfigType> {
|
|
3822
|
+
protected _config: SimpleSceneConfigType;
|
|
3823
|
+
ambientLight: AmbientLightConfig;
|
|
3824
|
+
directionalLight: DirectionalLightConfig;
|
|
3825
|
+
get backgroundColor(): THREE.Color;
|
|
3826
|
+
set backgroundColor(value: THREE.Color);
|
|
3827
|
+
}
|
|
3828
|
+
export {};
|
|
3829
|
+
import * as THREE from "three";
|
|
3830
|
+
import { CullerRenderer } from "./culler-renderer";
|
|
3831
|
+
import { Components } from "../../Components";
|
|
3832
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3833
|
+
/**
|
|
3834
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
3835
|
+
*/
|
|
3836
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3837
|
+
/**
|
|
3838
|
+
* Event triggered when the visibility of meshes is updated.
|
|
3839
|
+
* Contains two sets: seen and unseen.
|
|
3840
|
+
*/
|
|
3841
|
+
readonly onViewUpdated: Event<{
|
|
3842
|
+
seen: Set<THREE.Mesh>;
|
|
3843
|
+
unseen: Set<THREE.Mesh>;
|
|
3844
|
+
}>;
|
|
3845
|
+
/**
|
|
3846
|
+
* Map of color code to THREE.InstancedMesh.
|
|
3847
|
+
* Used to keep track of color-coded meshes.
|
|
3848
|
+
*/
|
|
3849
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3850
|
+
/**
|
|
3851
|
+
* @deprecated use config.threshold instead.
|
|
3852
|
+
*/
|
|
3853
|
+
get threshold(): number;
|
|
3854
|
+
/**
|
|
3855
|
+
* @deprecated use config.threshold instead.
|
|
3856
|
+
*/
|
|
3857
|
+
set threshold(value: number);
|
|
3858
|
+
private _colorCodeMeshMap;
|
|
3859
|
+
private _meshIDColorCodeMap;
|
|
3860
|
+
private _currentVisibleMeshes;
|
|
3861
|
+
private _recentlyHiddenMeshes;
|
|
3862
|
+
private readonly _transparentMat;
|
|
3863
|
+
constructor(components: Components, world: World);
|
|
3864
|
+
/** {@link Disposable.dispose} */
|
|
3865
|
+
dispose(): void;
|
|
3866
|
+
/**
|
|
3867
|
+
* 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.
|
|
3868
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3869
|
+
*/
|
|
3870
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3871
|
+
/**
|
|
3872
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3873
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3874
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3875
|
+
*/
|
|
3876
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3877
|
+
/**
|
|
3878
|
+
* 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.
|
|
3879
|
+
*
|
|
3880
|
+
* @param meshes - The meshes to update.
|
|
3881
|
+
*
|
|
3882
|
+
* @returns {void}
|
|
3883
|
+
*/
|
|
3884
|
+
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
3885
|
+
private handleWorkerMessage;
|
|
3886
|
+
private getAvailableMaterial;
|
|
3887
|
+
}
|
|
3888
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3889
|
+
/**
|
|
3890
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
3891
|
+
*/
|
|
3892
|
+
export declare class Event<T> {
|
|
3595
3893
|
/**
|
|
3596
3894
|
* Add a callback to this event instance.
|
|
3597
3895
|
* @param handler - the callback to be added to this event.
|
|
@@ -3752,33 +4050,10 @@ export interface CameraControllable {
|
|
|
3752
4050
|
controls: CameraControls;
|
|
3753
4051
|
}
|
|
3754
4052
|
import { Base } from "./base";
|
|
3755
|
-
import { World } from "./world";
|
|
3756
|
-
import { Event } from "./event";
|
|
3757
|
-
import { Components } from "../../Components";
|
|
3758
4053
|
/**
|
|
3759
|
-
*
|
|
4054
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
3760
4055
|
*/
|
|
3761
|
-
export declare abstract class
|
|
3762
|
-
readonly worlds: Map<string, World>;
|
|
3763
|
-
/**
|
|
3764
|
-
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
3765
|
-
* The event payload contains the world instance and the action ("added" or "removed").
|
|
3766
|
-
*/
|
|
3767
|
-
readonly onWorldChanged: Event<{
|
|
3768
|
-
world: World;
|
|
3769
|
-
action: "added" | "removed";
|
|
3770
|
-
}>;
|
|
3771
|
-
/**
|
|
3772
|
-
* The current world this item is associated with. It can be null if no world is currently active.
|
|
3773
|
-
*/
|
|
3774
|
-
currentWorld: World | null;
|
|
3775
|
-
protected constructor(components: Components);
|
|
3776
|
-
}
|
|
3777
|
-
import { Base } from "./base";
|
|
3778
|
-
/**
|
|
3779
|
-
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
3780
|
-
*/
|
|
3781
|
-
export declare abstract class Component extends Base {
|
|
4056
|
+
export declare abstract class Component extends Base {
|
|
3782
4057
|
/**
|
|
3783
4058
|
* Whether this component is active or not. The behaviour can vary depending
|
|
3784
4059
|
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
@@ -3806,6 +4081,82 @@ export declare abstract class Base {
|
|
|
3806
4081
|
/** Whether is component is {@link Configurable}. */
|
|
3807
4082
|
isConfigurable: () => this is Configurable<any, any>;
|
|
3808
4083
|
}
|
|
4084
|
+
import { Base } from "./base";
|
|
4085
|
+
import { World } from "./world";
|
|
4086
|
+
import { Event } from "./event";
|
|
4087
|
+
import { Components } from "../../Components";
|
|
4088
|
+
/**
|
|
4089
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
4090
|
+
*/
|
|
4091
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
4092
|
+
readonly worlds: Map<string, World>;
|
|
4093
|
+
/**
|
|
4094
|
+
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
4095
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
4096
|
+
*/
|
|
4097
|
+
readonly onWorldChanged: Event<{
|
|
4098
|
+
world: World;
|
|
4099
|
+
action: "added" | "removed";
|
|
4100
|
+
}>;
|
|
4101
|
+
/**
|
|
4102
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
4103
|
+
*/
|
|
4104
|
+
currentWorld: World | null;
|
|
4105
|
+
protected constructor(components: Components);
|
|
4106
|
+
}
|
|
4107
|
+
import * as THREE from "three";
|
|
4108
|
+
import CameraControls from "camera-controls";
|
|
4109
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
4110
|
+
import { CameraControllable } from "./interfaces";
|
|
4111
|
+
/**
|
|
4112
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
4113
|
+
*/
|
|
4114
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
4115
|
+
/**
|
|
4116
|
+
* Whether the camera is enabled or not.
|
|
4117
|
+
*/
|
|
4118
|
+
abstract enabled: boolean;
|
|
4119
|
+
/**
|
|
4120
|
+
* The Three.js camera instance.
|
|
4121
|
+
*/
|
|
4122
|
+
abstract three: THREE.Camera;
|
|
4123
|
+
/**
|
|
4124
|
+
* Optional CameraControls instance for controlling the camera.
|
|
4125
|
+
* This property is only available if the camera is controllable.
|
|
4126
|
+
*/
|
|
4127
|
+
abstract controls?: CameraControls;
|
|
4128
|
+
/**
|
|
4129
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
4130
|
+
*
|
|
4131
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
4132
|
+
*/
|
|
4133
|
+
hasCameraControls: () => this is CameraControllable;
|
|
4134
|
+
}
|
|
4135
|
+
import * as THREE from "three";
|
|
4136
|
+
import { Disposable } from "./interfaces";
|
|
4137
|
+
import { Event } from "./event";
|
|
4138
|
+
import { Components } from "../../Components";
|
|
4139
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
4140
|
+
/**
|
|
4141
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
4142
|
+
*/
|
|
4143
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
4144
|
+
/** {@link Disposable.onDisposed} */
|
|
4145
|
+
readonly onDisposed: Event<unknown>;
|
|
4146
|
+
/**
|
|
4147
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
4148
|
+
* It should be implemented by subclasses.
|
|
4149
|
+
*/
|
|
4150
|
+
abstract three: THREE.Object3D;
|
|
4151
|
+
/** The set of directional lights managed by this scene component. */
|
|
4152
|
+
directionalLights: Map<string, THREE.DirectionalLight>;
|
|
4153
|
+
/** The set of ambient lights managed by this scene component. */
|
|
4154
|
+
ambientLights: Map<string, THREE.AmbientLight>;
|
|
4155
|
+
protected constructor(components: Components);
|
|
4156
|
+
/** {@link Disposable.dispose} */
|
|
4157
|
+
dispose(): void;
|
|
4158
|
+
deleteAllLights(): void;
|
|
4159
|
+
}
|
|
3809
4160
|
import * as THREE from "three";
|
|
3810
4161
|
import { Vector2 } from "three";
|
|
3811
4162
|
import { Event } from "./event";
|
|
@@ -3872,57 +4223,38 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
3872
4223
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
3873
4224
|
}
|
|
3874
4225
|
import * as THREE from "three";
|
|
3875
|
-
import
|
|
3876
|
-
import {
|
|
3877
|
-
import {
|
|
4226
|
+
import { BaseScene } from "./base-scene";
|
|
4227
|
+
import { BaseCamera } from "./base-camera";
|
|
4228
|
+
import { BaseRenderer } from "./base-renderer";
|
|
4229
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
3878
4230
|
/**
|
|
3879
|
-
*
|
|
4231
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
3880
4232
|
*/
|
|
3881
|
-
export
|
|
4233
|
+
export interface World extends Disposable, Updateable {
|
|
3882
4234
|
/**
|
|
3883
|
-
*
|
|
4235
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
3884
4236
|
*/
|
|
3885
|
-
|
|
4237
|
+
meshes: Set<THREE.Mesh>;
|
|
3886
4238
|
/**
|
|
3887
|
-
* The
|
|
4239
|
+
* The base scene of the world.
|
|
3888
4240
|
*/
|
|
3889
|
-
|
|
4241
|
+
scene: BaseScene;
|
|
3890
4242
|
/**
|
|
3891
|
-
*
|
|
3892
|
-
* This property is only available if the camera is controllable.
|
|
4243
|
+
* The base camera of the world.
|
|
3893
4244
|
*/
|
|
3894
|
-
|
|
4245
|
+
camera: BaseCamera;
|
|
3895
4246
|
/**
|
|
3896
|
-
*
|
|
3897
|
-
*
|
|
3898
|
-
* @returns True if the instance is controllable, false otherwise.
|
|
4247
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
3899
4248
|
*/
|
|
3900
|
-
|
|
3901
|
-
}
|
|
3902
|
-
import * as THREE from "three";
|
|
3903
|
-
import { Disposable } from "./interfaces";
|
|
3904
|
-
import { Event } from "./event";
|
|
3905
|
-
import { Components } from "../../Components";
|
|
3906
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
3907
|
-
/**
|
|
3908
|
-
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
3909
|
-
*/
|
|
3910
|
-
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
3911
|
-
/** {@link Disposable.onDisposed} */
|
|
3912
|
-
readonly onDisposed: Event<unknown>;
|
|
4249
|
+
renderer: BaseRenderer | null;
|
|
3913
4250
|
/**
|
|
3914
|
-
*
|
|
3915
|
-
* It should be implemented by subclasses.
|
|
4251
|
+
* A unique identifier for the world.
|
|
3916
4252
|
*/
|
|
3917
|
-
|
|
3918
|
-
/**
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
protected constructor(components: Components);
|
|
3923
|
-
/** {@link Disposable.dispose} */
|
|
3924
|
-
dispose(): void;
|
|
3925
|
-
deleteAllLights(): void;
|
|
4253
|
+
uuid: string;
|
|
4254
|
+
/**
|
|
4255
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
4256
|
+
*/
|
|
4257
|
+
isDisposing: boolean;
|
|
3926
4258
|
}
|
|
3927
4259
|
import { Event } from "./event";
|
|
3928
4260
|
/**
|
|
@@ -3983,53 +4315,6 @@ export declare class DataSet<T> extends Set<T> {
|
|
|
3983
4315
|
*/
|
|
3984
4316
|
dispose(): void;
|
|
3985
4317
|
}
|
|
3986
|
-
import * as THREE from "three";
|
|
3987
|
-
import { BaseScene } from "./base-scene";
|
|
3988
|
-
import { BaseCamera } from "./base-camera";
|
|
3989
|
-
import { BaseRenderer } from "./base-renderer";
|
|
3990
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
3991
|
-
/**
|
|
3992
|
-
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
3993
|
-
*/
|
|
3994
|
-
export interface World extends Disposable, Updateable {
|
|
3995
|
-
/**
|
|
3996
|
-
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
3997
|
-
*/
|
|
3998
|
-
meshes: Set<THREE.Mesh>;
|
|
3999
|
-
/**
|
|
4000
|
-
* The base scene of the world.
|
|
4001
|
-
*/
|
|
4002
|
-
scene: BaseScene;
|
|
4003
|
-
/**
|
|
4004
|
-
* The base camera of the world.
|
|
4005
|
-
*/
|
|
4006
|
-
camera: BaseCamera;
|
|
4007
|
-
/**
|
|
4008
|
-
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
4009
|
-
*/
|
|
4010
|
-
renderer: BaseRenderer | null;
|
|
4011
|
-
/**
|
|
4012
|
-
* A unique identifier for the world.
|
|
4013
|
-
*/
|
|
4014
|
-
uuid: string;
|
|
4015
|
-
/**
|
|
4016
|
-
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
4017
|
-
*/
|
|
4018
|
-
isDisposing: boolean;
|
|
4019
|
-
}
|
|
4020
|
-
import { Component } from "./component";
|
|
4021
|
-
export type ComponentUIElement = {
|
|
4022
|
-
name: string;
|
|
4023
|
-
componentID: string;
|
|
4024
|
-
attributes: {
|
|
4025
|
-
[name: string]: string;
|
|
4026
|
-
};
|
|
4027
|
-
get: () => HTMLElement;
|
|
4028
|
-
};
|
|
4029
|
-
export declare abstract class ComponentWithUI extends Component {
|
|
4030
|
-
abstract name: string;
|
|
4031
|
-
abstract getUI(): ComponentUIElement[];
|
|
4032
|
-
}
|
|
4033
4318
|
import { Event } from "./event";
|
|
4034
4319
|
/**
|
|
4035
4320
|
* A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations.
|
|
@@ -4143,387 +4428,24 @@ export type ControlEntry = BooleanSettingsControl | ColorSettingsControl | TextS
|
|
|
4143
4428
|
export interface ControlsSchema {
|
|
4144
4429
|
[name: string]: ControlEntry | ControlsSchema;
|
|
4145
4430
|
}
|
|
4146
|
-
import {
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
z: number;
|
|
4153
|
-
};
|
|
4154
|
-
position: {
|
|
4155
|
-
x: number;
|
|
4156
|
-
y: number;
|
|
4157
|
-
z: number;
|
|
4431
|
+
import { Component } from "./component";
|
|
4432
|
+
export type ComponentUIElement = {
|
|
4433
|
+
name: string;
|
|
4434
|
+
componentID: string;
|
|
4435
|
+
attributes: {
|
|
4436
|
+
[name: string]: string;
|
|
4158
4437
|
};
|
|
4159
|
-
|
|
4160
|
-
}
|
|
4161
|
-
export
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
export interface ViewpointOrthographicCamera extends ViewpointCamera {
|
|
4165
|
-
viewToWorldScale: number;
|
|
4166
|
-
}
|
|
4167
|
-
/**
|
|
4168
|
-
* Represents a viewpoint in a BCF file.
|
|
4169
|
-
*/
|
|
4170
|
-
export interface BCFViewpoint {
|
|
4171
|
-
title?: string;
|
|
4172
|
-
guid: string;
|
|
4173
|
-
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
4174
|
-
selectionComponents: Iterable<string>;
|
|
4175
|
-
exceptionComponents: Iterable<string>;
|
|
4176
|
-
clippingPlanes: DataSet<SimplePlane>;
|
|
4177
|
-
spacesVisible: boolean;
|
|
4178
|
-
spaceBoundariesVisible: boolean;
|
|
4179
|
-
openingsVisible: boolean;
|
|
4180
|
-
defaultVisibility: boolean;
|
|
4438
|
+
get: () => HTMLElement;
|
|
4439
|
+
};
|
|
4440
|
+
export declare abstract class ComponentWithUI extends Component {
|
|
4441
|
+
abstract name: string;
|
|
4442
|
+
abstract getUI(): ComponentUIElement[];
|
|
4181
4443
|
}
|
|
4182
4444
|
import * as THREE from "three";
|
|
4183
|
-
import
|
|
4184
|
-
import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
|
|
4185
|
-
import { CameraProjection } from "../../OrthoPerspectiveCamera";
|
|
4445
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
4186
4446
|
import { Components } from "../../Components";
|
|
4187
|
-
import { DataMap, DataSet, World } from "../../Types";
|
|
4188
|
-
import { SimplePlane } from "../../Clipper";
|
|
4189
4447
|
/**
|
|
4190
|
-
*
|
|
4191
|
-
*
|
|
4192
|
-
* The Viewpoint class provides methods for managing and interacting with viewpoints.
|
|
4193
|
-
* It includes functionality for setting viewpoint properties, updating the camera,
|
|
4194
|
-
* applying color to components, and serializing the viewpoint for export.
|
|
4195
|
-
*/
|
|
4196
|
-
export declare class Viewpoint implements BCFViewpoint {
|
|
4197
|
-
title?: string;
|
|
4198
|
-
readonly guid: string;
|
|
4199
|
-
/**
|
|
4200
|
-
* ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
|
|
4201
|
-
* Each clipping plane is defined by Location and Direction.
|
|
4202
|
-
* The Direction vector points in the invisible direction meaning the half-space that is clipped.
|
|
4203
|
-
* @experimental
|
|
4204
|
-
*/
|
|
4205
|
-
clippingPlanes: DataSet<SimplePlane>;
|
|
4206
|
-
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
4207
|
-
/**
|
|
4208
|
-
* A list of components GUIDs to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
4209
|
-
*/
|
|
4210
|
-
readonly exceptionComponents: DataSet<string>;
|
|
4211
|
-
/**
|
|
4212
|
-
* A list of components GUIDs that should be selected (highlighted) when displaying a viewpoint.
|
|
4213
|
-
*/
|
|
4214
|
-
readonly selectionComponents: DataSet<string>;
|
|
4215
|
-
/**
|
|
4216
|
-
* A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
|
|
4217
|
-
* For this to work, call viewpoint.colorize()
|
|
4218
|
-
*/
|
|
4219
|
-
readonly componentColors: DataMap<THREE.Color, string[]>;
|
|
4220
|
-
/**
|
|
4221
|
-
* Boolean flags to allow fine control over the visibility of spaces.
|
|
4222
|
-
* A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
|
|
4223
|
-
* @default false
|
|
4224
|
-
*/
|
|
4225
|
-
spacesVisible: boolean;
|
|
4226
|
-
/**
|
|
4227
|
-
* Boolean flags to allow fine control over the visibility of space boundaries.
|
|
4228
|
-
* A typical use of these flags is when DefaultVisibility=true but space boundaries should remain hidden.
|
|
4229
|
-
* @default false
|
|
4230
|
-
*/
|
|
4231
|
-
spaceBoundariesVisible: boolean;
|
|
4232
|
-
/**
|
|
4233
|
-
* Boolean flags to allow fine control over the visibility of openings.
|
|
4234
|
-
* A typical use of these flags is when DefaultVisibility=true but openings should remain hidden.
|
|
4235
|
-
* @default false
|
|
4236
|
-
*/
|
|
4237
|
-
openingsVisible: boolean;
|
|
4238
|
-
/**
|
|
4239
|
-
* When true, all components should be visible unless listed in the exceptions
|
|
4240
|
-
* When false all components should be invisible unless listed in the exceptions
|
|
4241
|
-
*/
|
|
4242
|
-
defaultVisibility: boolean;
|
|
4243
|
-
private get _selectionModelIdMap();
|
|
4244
|
-
private get _exceptionModelIdMap();
|
|
4245
|
-
/**
|
|
4246
|
-
* A list of components that should be selected (highlighted) when displaying a viewpoint.
|
|
4247
|
-
* @returns The fragmentIdMap for components marked as selections.
|
|
4248
|
-
*/
|
|
4249
|
-
get selection(): FRAGS.FragmentIdMap;
|
|
4250
|
-
/**
|
|
4251
|
-
* A list of components to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
4252
|
-
* @returns The fragmentIdMap for components marked as exceptions.
|
|
4253
|
-
*/
|
|
4254
|
-
get exception(): FRAGS.FragmentIdMap;
|
|
4255
|
-
/**
|
|
4256
|
-
* Retrieves the projection type of the viewpoint's camera.
|
|
4257
|
-
*
|
|
4258
|
-
* @returns A string representing the projection type of the viewpoint's camera.
|
|
4259
|
-
* It can be either 'Perspective' or 'Orthographic'.
|
|
4260
|
-
*/
|
|
4261
|
-
get projection(): CameraProjection;
|
|
4262
|
-
/**
|
|
4263
|
-
* Retrieves the position vector of the viewpoint's camera.
|
|
4264
|
-
*
|
|
4265
|
-
* @remarks
|
|
4266
|
-
* The position vector represents the camera's position in the world coordinate system.
|
|
4267
|
-
* The function applies the base coordinate system transformation to the position vector.
|
|
4268
|
-
*
|
|
4269
|
-
* @returns A THREE.Vector3 representing the position of the viewpoint's camera.
|
|
4270
|
-
*/
|
|
4271
|
-
get position(): THREE.Vector3;
|
|
4272
|
-
/**
|
|
4273
|
-
* Retrieves the direction vector of the viewpoint's camera.
|
|
4274
|
-
*
|
|
4275
|
-
* @remarks
|
|
4276
|
-
* The direction vector represents the direction in which the camera is pointing.
|
|
4277
|
-
* It is calculated by extracting the x, y, and z components from the camera's direction property.
|
|
4278
|
-
*
|
|
4279
|
-
* @returns A THREE.Vector3 representing the direction of the viewpoint's camera.
|
|
4280
|
-
*/
|
|
4281
|
-
get direction(): THREE.Vector3;
|
|
4282
|
-
private _components;
|
|
4283
|
-
/**
|
|
4284
|
-
* Represents the world in which the viewpoints are created and managed.
|
|
4285
|
-
*/
|
|
4286
|
-
readonly world: World;
|
|
4287
|
-
private get _managerVersion();
|
|
4288
|
-
/**
|
|
4289
|
-
* Retrieves the list of BCF topics associated with the current viewpoint.
|
|
4290
|
-
*
|
|
4291
|
-
* @remarks
|
|
4292
|
-
* This function retrieves the BCFTopics manager from the components,
|
|
4293
|
-
* then filters the list of topics to find those associated with the current viewpoint.
|
|
4294
|
-
*
|
|
4295
|
-
* @returns An array of BCF topics associated with the current viewpoint.
|
|
4296
|
-
*/
|
|
4297
|
-
get topics(): import("../../../openbim/BCFTopics").Topic[];
|
|
4298
|
-
constructor(components: Components, world: World, _config?: {
|
|
4299
|
-
data?: Partial<BCFViewpoint>;
|
|
4300
|
-
setCamera?: boolean;
|
|
4301
|
-
});
|
|
4302
|
-
/**
|
|
4303
|
-
* Adds components to the viewpoint based on the provided fragment ID map.
|
|
4304
|
-
*
|
|
4305
|
-
* @param fragmentIdMap - A map containing fragment IDs as keys and arrays of express IDs as values.
|
|
4306
|
-
*/
|
|
4307
|
-
addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
|
|
4308
|
-
/**
|
|
4309
|
-
* Replace the properties of the viewpoint with the provided data.
|
|
4310
|
-
*
|
|
4311
|
-
* @remarks The guid will be ommited as it shouldn't change after it has been initially set.
|
|
4312
|
-
* @remarks The existing selection and exception components will be fully replaced in case new ones are provided.
|
|
4313
|
-
*
|
|
4314
|
-
* @param data - An object containing the properties to be set.
|
|
4315
|
-
* The properties not included in the object will remain unchanged.
|
|
4316
|
-
*
|
|
4317
|
-
* @returns The viewpoint instance with the updated properties.
|
|
4318
|
-
*/
|
|
4319
|
-
set(data: Partial<BCFViewpoint>): this;
|
|
4320
|
-
/**
|
|
4321
|
-
* Sets the viewpoint of the camera in the world.
|
|
4322
|
-
*
|
|
4323
|
-
* @remarks
|
|
4324
|
-
* This function calculates the target position based on the viewpoint information.
|
|
4325
|
-
* It sets the visibility of the viewpoint components and then applies the viewpoint using the camera's controls.
|
|
4326
|
-
*
|
|
4327
|
-
* @param transition - Indicates whether the camera movement should have a transition effect.
|
|
4328
|
-
* Default value is 'true'.
|
|
4329
|
-
*
|
|
4330
|
-
* @throws An error if the world's camera does not have camera controls.
|
|
4331
|
-
*
|
|
4332
|
-
* @returns A Promise that resolves when the camera has been set.
|
|
4333
|
-
*/
|
|
4334
|
-
go(transition?: boolean): Promise<void>;
|
|
4335
|
-
/**
|
|
4336
|
-
* Updates the camera settings of the viewpoint based on the current world's camera and renderer.
|
|
4337
|
-
*
|
|
4338
|
-
* @remarks
|
|
4339
|
-
* This function retrieves the camera's position, direction, and aspect ratio from the world's camera and renderer.
|
|
4340
|
-
* It then calculates the camera's perspective or orthographic settings based on the camera type.
|
|
4341
|
-
* Finally, it updates the viewpoint's camera settings and updates the viewpoint to the Viewpoints manager.
|
|
4342
|
-
*
|
|
4343
|
-
* @throws An error if the world's camera does not have camera controls.
|
|
4344
|
-
* @throws An error if the world's renderer is not available.
|
|
4345
|
-
*/
|
|
4346
|
-
updateCamera(): void;
|
|
4347
|
-
applyVisibility(): void;
|
|
4348
|
-
/**
|
|
4349
|
-
* Applies color to the components in the viewpoint based on their GUIDs.
|
|
4350
|
-
*
|
|
4351
|
-
* This function iterates through the 'componentColors' map, retrieves the fragment IDs
|
|
4352
|
-
* corresponding to each color, and then uses the 'Classifier' to apply the color to those fragments.
|
|
4353
|
-
*
|
|
4354
|
-
* @remarks
|
|
4355
|
-
* The color is applied using the 'Classifier.setColor' method, which sets the color of the specified fragments.
|
|
4356
|
-
* The color is provided as a hexadecimal string, prefixed with a '#'.
|
|
4357
|
-
*/
|
|
4358
|
-
applyColors(): void;
|
|
4359
|
-
/**
|
|
4360
|
-
* Resets the colors of all components in the viewpoint to their original color.
|
|
4361
|
-
*/
|
|
4362
|
-
resetColors(): void;
|
|
4363
|
-
private createComponentTags;
|
|
4364
|
-
private createColorTags;
|
|
4365
|
-
/**
|
|
4366
|
-
* Serializes the viewpoint into a buildingSMART compliant XML string for export.
|
|
4367
|
-
*
|
|
4368
|
-
* @param version - The version of the BCF Manager to use for serialization.
|
|
4369
|
-
* If not provided, the current version of the manager will be used.
|
|
4370
|
-
*
|
|
4371
|
-
* @returns A Promise that resolves to an XML string representing the viewpoint.
|
|
4372
|
-
* The XML string follows the BCF VisualizationInfo schema.
|
|
4373
|
-
*
|
|
4374
|
-
* @throws An error if the world's camera does not have camera controls.
|
|
4375
|
-
* @throws An error if the world's renderer is not available.
|
|
4376
|
-
*/
|
|
4377
|
-
serialize(version?: string): Promise<string>;
|
|
4378
|
-
}
|
|
4379
|
-
import * as THREE from "three";
|
|
4380
|
-
import { Disposable, Event } from "../../Types";
|
|
4381
|
-
/**
|
|
4382
|
-
* 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.
|
|
4383
|
-
*/
|
|
4384
|
-
export declare class Mouse implements Disposable {
|
|
4385
|
-
dom: HTMLCanvasElement;
|
|
4386
|
-
private _event?;
|
|
4387
|
-
private _position;
|
|
4388
|
-
/** {@link Disposable.onDisposed} */
|
|
4389
|
-
readonly onDisposed: Event<unknown>;
|
|
4390
|
-
constructor(dom: HTMLCanvasElement);
|
|
4391
|
-
/**
|
|
4392
|
-
* The real position of the mouse of the Three.js canvas.
|
|
4393
|
-
*/
|
|
4394
|
-
get position(): THREE.Vector2;
|
|
4395
|
-
/** {@link Disposable.dispose} */
|
|
4396
|
-
dispose(): void;
|
|
4397
|
-
private getPositionY;
|
|
4398
|
-
private getPositionX;
|
|
4399
|
-
private updateMouseInfo;
|
|
4400
|
-
private getDataObject;
|
|
4401
|
-
private setupEvents;
|
|
4402
|
-
}
|
|
4403
|
-
import * as THREE from "three";
|
|
4404
|
-
import { Components } from "../../Components";
|
|
4405
|
-
import { Event, World, Disposable } from "../../Types";
|
|
4406
|
-
import { Mouse } from "./mouse";
|
|
4407
|
-
/**
|
|
4408
|
-
* 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.
|
|
4409
|
-
*/
|
|
4410
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
4411
|
-
/** {@link Component.enabled} */
|
|
4412
|
-
enabled: boolean;
|
|
4413
|
-
/** The components instance to which this Raycaster belongs. */
|
|
4414
|
-
components: Components;
|
|
4415
|
-
/** {@link Disposable.onDisposed} */
|
|
4416
|
-
readonly onDisposed: Event<unknown>;
|
|
4417
|
-
/** The position of the mouse in the screen. */
|
|
4418
|
-
readonly mouse: Mouse;
|
|
4419
|
-
/**
|
|
4420
|
-
* A reference to the Three.js Raycaster instance.
|
|
4421
|
-
* This is used for raycasting operations.
|
|
4422
|
-
*/
|
|
4423
|
-
readonly three: THREE.Raycaster;
|
|
4424
|
-
/**
|
|
4425
|
-
* A reference to the world instance to which this Raycaster belongs.
|
|
4426
|
-
* This is used to access the camera and meshes.
|
|
4427
|
-
*/
|
|
4428
|
-
world: World;
|
|
4429
|
-
constructor(components: Components, world: World);
|
|
4430
|
-
/** {@link Disposable.dispose} */
|
|
4431
|
-
dispose(): void;
|
|
4432
|
-
/**
|
|
4433
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
4434
|
-
* the first item found. This also takes into account the clipping planes
|
|
4435
|
-
* used by the renderer.
|
|
4436
|
-
*
|
|
4437
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
4438
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
4439
|
-
* {@link Components.meshes}.
|
|
4440
|
-
*/
|
|
4441
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
4442
|
-
/**
|
|
4443
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
4444
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
4445
|
-
*
|
|
4446
|
-
* @param origin - The origin of the ray.
|
|
4447
|
-
* @param direction - The direction of the ray.
|
|
4448
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
4449
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
4450
|
-
*/
|
|
4451
|
-
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;
|
|
4452
|
-
private intersect;
|
|
4453
|
-
private filterClippingPlanes;
|
|
4454
|
-
}
|
|
4455
|
-
import * as THREE from "three";
|
|
4456
|
-
import { Event, World } from "../../Types";
|
|
4457
|
-
import { Components } from "../../Components";
|
|
4458
|
-
/**
|
|
4459
|
-
* A base renderer to determine visibility on screen.
|
|
4460
|
-
*/
|
|
4461
|
-
export declare class DistanceRenderer {
|
|
4462
|
-
/** {@link Disposable.onDisposed} */
|
|
4463
|
-
readonly onDisposed: Event<string>;
|
|
4464
|
-
/**
|
|
4465
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
4466
|
-
* meshes that are currently visible, and the ones that were visible
|
|
4467
|
-
* just before but not anymore.
|
|
4468
|
-
*/
|
|
4469
|
-
readonly onDistanceComputed: Event<number>;
|
|
4470
|
-
/**
|
|
4471
|
-
* Objects that won't be taken into account in the distance check.
|
|
4472
|
-
*/
|
|
4473
|
-
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
4474
|
-
/**
|
|
4475
|
-
* Whether this renderer is active or not. If not, it won't render anything.
|
|
4476
|
-
*/
|
|
4477
|
-
enabled: boolean;
|
|
4478
|
-
/**
|
|
4479
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
4480
|
-
* for debugging purposes.
|
|
4481
|
-
*/
|
|
4482
|
-
renderDebugFrame: boolean;
|
|
4483
|
-
/** The components instance to which this renderer belongs. */
|
|
4484
|
-
components: Components;
|
|
4485
|
-
/**
|
|
4486
|
-
* The scene where the distance is computed.
|
|
4487
|
-
*/
|
|
4488
|
-
scene: THREE.Scene;
|
|
4489
|
-
/**
|
|
4490
|
-
* The camera used to compute the distance.
|
|
4491
|
-
*/
|
|
4492
|
-
camera: THREE.OrthographicCamera;
|
|
4493
|
-
/**
|
|
4494
|
-
* The material used to compute the distance.
|
|
4495
|
-
*/
|
|
4496
|
-
depthMaterial: THREE.ShaderMaterial;
|
|
4497
|
-
/** The world instance to which this renderer belongs. */
|
|
4498
|
-
readonly world: World;
|
|
4499
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
4500
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
4501
|
-
protected readonly worker: Worker;
|
|
4502
|
-
private _width;
|
|
4503
|
-
private _height;
|
|
4504
|
-
private readonly _postQuad;
|
|
4505
|
-
private readonly tempRT;
|
|
4506
|
-
private readonly resultRT;
|
|
4507
|
-
private readonly bufferSize;
|
|
4508
|
-
private readonly _buffer;
|
|
4509
|
-
protected _isWorkerBusy: boolean;
|
|
4510
|
-
constructor(components: Components, world: World);
|
|
4511
|
-
/** {@link Disposable.dispose} */
|
|
4512
|
-
dispose(): void;
|
|
4513
|
-
/**
|
|
4514
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
4515
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
4516
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
4517
|
-
* not true.
|
|
4518
|
-
*/
|
|
4519
|
-
compute: () => Promise<void>;
|
|
4520
|
-
private handleWorkerMessage;
|
|
4521
|
-
}
|
|
4522
|
-
import * as THREE from "three";
|
|
4523
|
-
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
4524
|
-
import { Components } from "../../Components";
|
|
4525
|
-
/**
|
|
4526
|
-
* Each of the clipping planes created by the clipper.
|
|
4448
|
+
* Each of the clipping planes created by the clipper.
|
|
4527
4449
|
*/
|
|
4528
4450
|
export declare class SimplePlane implements Disposable, Hideable {
|
|
4529
4451
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
@@ -4634,6 +4556,73 @@ export declare class FirstPersonMode implements NavigationMode {
|
|
|
4634
4556
|
set(active: boolean): void;
|
|
4635
4557
|
private setupFirstPersonCamera;
|
|
4636
4558
|
}
|
|
4559
|
+
import * as THREE from "three";
|
|
4560
|
+
import { Event, World } from "../../Types";
|
|
4561
|
+
import { Components } from "../../Components";
|
|
4562
|
+
/**
|
|
4563
|
+
* A base renderer to determine visibility on screen.
|
|
4564
|
+
*/
|
|
4565
|
+
export declare class DistanceRenderer {
|
|
4566
|
+
/** {@link Disposable.onDisposed} */
|
|
4567
|
+
readonly onDisposed: Event<string>;
|
|
4568
|
+
/**
|
|
4569
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
4570
|
+
* meshes that are currently visible, and the ones that were visible
|
|
4571
|
+
* just before but not anymore.
|
|
4572
|
+
*/
|
|
4573
|
+
readonly onDistanceComputed: Event<number>;
|
|
4574
|
+
/**
|
|
4575
|
+
* Objects that won't be taken into account in the distance check.
|
|
4576
|
+
*/
|
|
4577
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
4578
|
+
/**
|
|
4579
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
4580
|
+
*/
|
|
4581
|
+
enabled: boolean;
|
|
4582
|
+
/**
|
|
4583
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
4584
|
+
* for debugging purposes.
|
|
4585
|
+
*/
|
|
4586
|
+
renderDebugFrame: boolean;
|
|
4587
|
+
/** The components instance to which this renderer belongs. */
|
|
4588
|
+
components: Components;
|
|
4589
|
+
/**
|
|
4590
|
+
* The scene where the distance is computed.
|
|
4591
|
+
*/
|
|
4592
|
+
scene: THREE.Scene;
|
|
4593
|
+
/**
|
|
4594
|
+
* The camera used to compute the distance.
|
|
4595
|
+
*/
|
|
4596
|
+
camera: THREE.OrthographicCamera;
|
|
4597
|
+
/**
|
|
4598
|
+
* The material used to compute the distance.
|
|
4599
|
+
*/
|
|
4600
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
4601
|
+
/** The world instance to which this renderer belongs. */
|
|
4602
|
+
readonly world: World;
|
|
4603
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
4604
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
4605
|
+
protected readonly worker: Worker;
|
|
4606
|
+
private _width;
|
|
4607
|
+
private _height;
|
|
4608
|
+
private readonly _postQuad;
|
|
4609
|
+
private readonly tempRT;
|
|
4610
|
+
private readonly resultRT;
|
|
4611
|
+
private readonly bufferSize;
|
|
4612
|
+
private readonly _buffer;
|
|
4613
|
+
protected _isWorkerBusy: boolean;
|
|
4614
|
+
constructor(components: Components, world: World);
|
|
4615
|
+
/** {@link Disposable.dispose} */
|
|
4616
|
+
dispose(): void;
|
|
4617
|
+
/**
|
|
4618
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
4619
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
4620
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
4621
|
+
* not true.
|
|
4622
|
+
*/
|
|
4623
|
+
compute: () => Promise<void>;
|
|
4624
|
+
private handleWorkerMessage;
|
|
4625
|
+
}
|
|
4637
4626
|
import { NavigationMode } from "./types";
|
|
4638
4627
|
import { OrthoPerspectiveCamera } from "../index";
|
|
4639
4628
|
/**
|
|
@@ -4715,11 +4704,6 @@ export declare class ProjectionManager {
|
|
|
4715
4704
|
private getDistance;
|
|
4716
4705
|
private setPerspectiveCamera;
|
|
4717
4706
|
}
|
|
4718
|
-
import * as WEBIFC from "web-ifc";
|
|
4719
|
-
export declare class IfcMetadataReader {
|
|
4720
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
4721
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
4722
|
-
}
|
|
4723
4707
|
/**
|
|
4724
4708
|
* The projection system of the camera.
|
|
4725
4709
|
*/
|
|
@@ -4746,172 +4730,229 @@ export interface NavigationMode {
|
|
|
4746
4730
|
/** Whether this navigation mode is active or not. */
|
|
4747
4731
|
enabled: boolean;
|
|
4748
4732
|
}
|
|
4749
|
-
import * as WEBIFC from "web-ifc";
|
|
4750
|
-
import * as THREE from "three";
|
|
4751
|
-
export declare class Units {
|
|
4752
|
-
factor: number;
|
|
4753
|
-
complement: number;
|
|
4754
|
-
apply(matrix: THREE.Matrix4): void;
|
|
4755
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
4756
|
-
private getLengthUnits;
|
|
4757
|
-
private getScaleMatrix;
|
|
4758
|
-
}
|
|
4759
|
-
import * as THREE from "three";
|
|
4760
|
-
import * as WEBIFC from "web-ifc";
|
|
4761
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
4762
|
-
export declare class CivilReader {
|
|
4763
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
4764
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
4765
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
4766
|
-
coordinationMatrix: THREE.Matrix4;
|
|
4767
|
-
} | undefined;
|
|
4768
|
-
get(civilItems: any): {
|
|
4769
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
4770
|
-
coordinationMatrix: THREE.Matrix4;
|
|
4771
|
-
} | undefined;
|
|
4772
|
-
private getCurves;
|
|
4773
|
-
}
|
|
4774
4733
|
/**
|
|
4775
|
-
* A
|
|
4734
|
+
* A rule for the {@link IfcFinder} to search items based on their category.
|
|
4776
4735
|
*/
|
|
4777
|
-
export interface
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4736
|
+
export interface IfcCategoryRule {
|
|
4737
|
+
/**
|
|
4738
|
+
* The type of this rule. All rules have a fixed type.
|
|
4739
|
+
*/
|
|
4740
|
+
type: "category";
|
|
4741
|
+
/**
|
|
4742
|
+
* The category value. It's a regular expression, so you can make complex queries and use ".*" to match all categories.
|
|
4743
|
+
*/
|
|
4744
|
+
value: RegExp;
|
|
4786
4745
|
}
|
|
4787
4746
|
/**
|
|
4788
|
-
* A
|
|
4747
|
+
* A rule for the {@link IfcFinder} to search items based on the properties defined in their property sets.
|
|
4789
4748
|
*/
|
|
4790
|
-
export interface
|
|
4791
|
-
/**
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4749
|
+
export interface IfcPropertyRule {
|
|
4750
|
+
/**
|
|
4751
|
+
* The type of this rule. All rules have a fixed type.
|
|
4752
|
+
*/
|
|
4753
|
+
type: "property";
|
|
4754
|
+
/**
|
|
4755
|
+
* The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names.
|
|
4756
|
+
*/
|
|
4757
|
+
name: RegExp;
|
|
4758
|
+
/**
|
|
4759
|
+
* The value of the property. It's a regular expression, so you can make complex queries and use ".*" to match all values.
|
|
4760
|
+
*/
|
|
4761
|
+
value: RegExp;
|
|
4802
4762
|
}
|
|
4803
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
4804
4763
|
/**
|
|
4805
|
-
*
|
|
4764
|
+
* A rule for the {@link IfcFinder} to search items based on the value of a numeric property defined in their property sets.
|
|
4806
4765
|
*/
|
|
4807
|
-
export
|
|
4766
|
+
export interface IfcOperatorRule {
|
|
4808
4767
|
/**
|
|
4809
|
-
*
|
|
4810
|
-
* Defaults to 10 geometries.
|
|
4768
|
+
* The type of this rule. All rules have a fixed type.
|
|
4811
4769
|
*/
|
|
4812
|
-
|
|
4770
|
+
type: "operator";
|
|
4813
4771
|
/**
|
|
4814
|
-
*
|
|
4815
|
-
* Defaults to 1000 assets.
|
|
4772
|
+
* The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names.
|
|
4816
4773
|
*/
|
|
4817
|
-
|
|
4774
|
+
name: RegExp;
|
|
4818
4775
|
/**
|
|
4819
|
-
*
|
|
4776
|
+
* The value of the property.
|
|
4820
4777
|
*/
|
|
4821
|
-
|
|
4778
|
+
value: number;
|
|
4779
|
+
/**
|
|
4780
|
+
* The operator to apply to the numeric value.
|
|
4781
|
+
*/
|
|
4782
|
+
operator: "<" | ">" | "=" | "<=" | ">=";
|
|
4822
4783
|
}
|
|
4823
4784
|
/**
|
|
4824
|
-
*
|
|
4785
|
+
* The type of rules that can be used in the queries of the {@link IfcFinder}.
|
|
4825
4786
|
*/
|
|
4826
|
-
export
|
|
4787
|
+
export type IfcFinderRule = IfcCategoryRule | IfcPropertyRule | IfcOperatorRule;
|
|
4788
|
+
/**
|
|
4789
|
+
* The data type used when the queries of the {@link IfcFinder} export or import query data to persist it.
|
|
4790
|
+
*/
|
|
4791
|
+
export type SerializedQuery = {
|
|
4827
4792
|
/**
|
|
4828
|
-
*
|
|
4793
|
+
* {@link IfcFinderQuery.name}
|
|
4829
4794
|
*/
|
|
4830
|
-
|
|
4795
|
+
name: string;
|
|
4831
4796
|
/**
|
|
4832
|
-
*
|
|
4797
|
+
* {@link IfcFinderQuery.inclusive}
|
|
4833
4798
|
*/
|
|
4834
|
-
|
|
4835
|
-
|
|
4799
|
+
inclusive: boolean;
|
|
4800
|
+
/**
|
|
4801
|
+
* The type of query.
|
|
4802
|
+
*/
|
|
4803
|
+
type: string;
|
|
4804
|
+
/**
|
|
4805
|
+
* {@link IfcFinderQuery.ids}
|
|
4806
|
+
*/
|
|
4807
|
+
ids: {
|
|
4808
|
+
[modelID: string]: number[];
|
|
4809
|
+
};
|
|
4810
|
+
/**
|
|
4811
|
+
* {@link IfcFinderQuery.rules}
|
|
4812
|
+
*/
|
|
4813
|
+
rules: {
|
|
4814
|
+
[key: string]: any;
|
|
4815
|
+
}[];
|
|
4816
|
+
};
|
|
4817
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
4818
|
+
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
4819
|
+
import { Components, Event } from "../../../core";
|
|
4836
4820
|
/**
|
|
4837
|
-
*
|
|
4821
|
+
* The base class for all queries used by the {@link IfcFinder}.
|
|
4838
4822
|
*/
|
|
4839
|
-
export
|
|
4823
|
+
export declare abstract class IfcFinderQuery {
|
|
4824
|
+
/**
|
|
4825
|
+
* The list of functions to import the queries. If you create your own custom query, you should add its importer here. See the other queries provided by the library for reference.
|
|
4826
|
+
*/
|
|
4827
|
+
static importers: Map<string, (components: Components, data: any) => IfcFinderQuery>;
|
|
4828
|
+
/**
|
|
4829
|
+
* Event used to notify the progress when performing a query on an IFC file.
|
|
4830
|
+
*/
|
|
4831
|
+
readonly onProgress: Event<number>;
|
|
4832
|
+
/**
|
|
4833
|
+
* A name given to the instance of the query to identify it.
|
|
4834
|
+
*/
|
|
4835
|
+
abstract name: string;
|
|
4836
|
+
/**
|
|
4837
|
+
* The list of IFC items that this query found across all models.
|
|
4838
|
+
*/
|
|
4839
|
+
abstract items: FRAGS.FragmentIdMap;
|
|
4840
|
+
/**
|
|
4841
|
+
* If false, ALL rules of the query must comply to make a match. If true, ANY rule will be enough to make a match.
|
|
4842
|
+
*/
|
|
4843
|
+
inclusive: boolean;
|
|
4844
|
+
/**
|
|
4845
|
+
* The list of rules to be applied by this query.
|
|
4846
|
+
*/
|
|
4847
|
+
rules: IfcFinderRule[];
|
|
4848
|
+
/**
|
|
4849
|
+
* The IDs of the match items per model.
|
|
4850
|
+
*/
|
|
4851
|
+
ids: {
|
|
4852
|
+
[modelID: string]: Set<number>;
|
|
4853
|
+
};
|
|
4840
4854
|
/**
|
|
4841
|
-
*
|
|
4855
|
+
* Whether this query is up to date or not per file. If not, when updating the group where it belongs, it will re-process the given file.
|
|
4842
4856
|
*/
|
|
4843
|
-
|
|
4857
|
+
needsUpdate: Map<string, boolean>;
|
|
4844
4858
|
/**
|
|
4845
|
-
*
|
|
4859
|
+
* Export the current data of this query in a serializable object to persist it over time.
|
|
4846
4860
|
*/
|
|
4847
|
-
|
|
4861
|
+
abstract export(): {
|
|
4862
|
+
[key: string]: any;
|
|
4863
|
+
};
|
|
4848
4864
|
/**
|
|
4849
|
-
*
|
|
4865
|
+
* Perform the search in the given file and save the result.
|
|
4850
4866
|
*/
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
*/
|
|
4856
|
-
export interface IfcOperatorRule {
|
|
4867
|
+
abstract update(modelID: string, file: File): Promise<void>;
|
|
4868
|
+
protected components: Components;
|
|
4869
|
+
protected abstract findInLines(modelID: string, lines: string[]): void;
|
|
4870
|
+
protected constructor(components: Components);
|
|
4857
4871
|
/**
|
|
4858
|
-
*
|
|
4872
|
+
* Imports a query given its data. This data can be generating using its {@link IfcFinderQuery.export} method.
|
|
4873
|
+
*
|
|
4874
|
+
* @param components the instance of {@link Components} used by this app.
|
|
4875
|
+
* @param data the data of the query to import as a serializable object.
|
|
4859
4876
|
*/
|
|
4860
|
-
|
|
4877
|
+
static import(components: Components, data: {
|
|
4878
|
+
[id: string]: any;
|
|
4879
|
+
}): IfcFinderQuery | null;
|
|
4861
4880
|
/**
|
|
4862
|
-
*
|
|
4881
|
+
* Imports the given serialized rules. Only use this when writing your own custom query. See the other queries provided by the library for reference.
|
|
4882
|
+
*
|
|
4883
|
+
* @param serializedRules the rules to be parsed.
|
|
4863
4884
|
*/
|
|
4864
|
-
|
|
4885
|
+
static importRules(serializedRules: {
|
|
4886
|
+
[key: string]: any;
|
|
4887
|
+
}[]): IfcFinderRule[];
|
|
4865
4888
|
/**
|
|
4866
|
-
*
|
|
4889
|
+
* Imports the given IDs. Only use this when writing your own custom query. See the other queries provided by the library for reference.
|
|
4890
|
+
*
|
|
4891
|
+
* @param data the serialized object representing the query whose IDs to parse.
|
|
4867
4892
|
*/
|
|
4868
|
-
|
|
4893
|
+
static importIds(data: SerializedQuery): {
|
|
4894
|
+
[modelID: string]: Set<number>;
|
|
4895
|
+
};
|
|
4869
4896
|
/**
|
|
4870
|
-
*
|
|
4897
|
+
* Clears the data of the given model. If not specified, clears all the data.
|
|
4898
|
+
*
|
|
4899
|
+
* @param modelID ID of the model whose data to clear.
|
|
4871
4900
|
*/
|
|
4872
|
-
|
|
4901
|
+
clear(modelID?: string): void;
|
|
4902
|
+
protected addID(modelID: string, id: number): void;
|
|
4903
|
+
protected getData(): SerializedQuery;
|
|
4904
|
+
protected exportRules(): {
|
|
4905
|
+
[key: string]: any;
|
|
4906
|
+
}[];
|
|
4907
|
+
protected findInFile(modelID: string, file: File): Promise<void>;
|
|
4908
|
+
protected getIdFromLine(line: string): number;
|
|
4909
|
+
protected testRules(line: string): boolean;
|
|
4910
|
+
protected getCategoryFromLine(line: string): string | null;
|
|
4911
|
+
protected getAttributesFromLine(line: string): string[] | null;
|
|
4873
4912
|
}
|
|
4913
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
4914
|
+
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
4915
|
+
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
4916
|
+
import { Components } from "../../../core";
|
|
4874
4917
|
/**
|
|
4875
|
-
*
|
|
4876
|
-
*/
|
|
4877
|
-
export type IfcFinderRule = IfcCategoryRule | IfcPropertyRule | IfcOperatorRule;
|
|
4878
|
-
/**
|
|
4879
|
-
* The data type used when the queries of the {@link IfcFinder} export or import query data to persist it.
|
|
4918
|
+
* A query that checks the direct attributes of IFC items.
|
|
4880
4919
|
*/
|
|
4881
|
-
export
|
|
4920
|
+
export declare class IfcBasicQuery extends IfcFinderQuery {
|
|
4882
4921
|
/**
|
|
4883
4922
|
* {@link IfcFinderQuery.name}
|
|
4884
4923
|
*/
|
|
4885
4924
|
name: string;
|
|
4886
4925
|
/**
|
|
4887
|
-
*
|
|
4926
|
+
* The type of this query.
|
|
4888
4927
|
*/
|
|
4889
|
-
|
|
4928
|
+
static type: "IfcBasicQuery";
|
|
4890
4929
|
/**
|
|
4891
|
-
*
|
|
4930
|
+
* {@link IfcFinderQuery.items}
|
|
4892
4931
|
*/
|
|
4893
|
-
|
|
4932
|
+
get items(): FRAGS.FragmentIdMap;
|
|
4933
|
+
constructor(components: Components, data: {
|
|
4934
|
+
name: string;
|
|
4935
|
+
rules: IfcFinderRule[];
|
|
4936
|
+
inclusive: boolean;
|
|
4937
|
+
});
|
|
4894
4938
|
/**
|
|
4895
|
-
* {@link IfcFinderQuery.
|
|
4939
|
+
* {@link IfcFinderQuery.export}
|
|
4896
4940
|
*/
|
|
4897
|
-
|
|
4898
|
-
[modelID: string]: number[];
|
|
4899
|
-
};
|
|
4941
|
+
export(): SerializedQuery;
|
|
4900
4942
|
/**
|
|
4901
|
-
* {@link IfcFinderQuery.
|
|
4943
|
+
* {@link IfcFinderQuery.update}
|
|
4902
4944
|
*/
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
};
|
|
4945
|
+
update(modelID: string, file: File): Promise<void>;
|
|
4946
|
+
protected findInLines(modelID: string, lines: string[]): void;
|
|
4947
|
+
}
|
|
4907
4948
|
import * as FRAGS from "@thatopen/fragments";
|
|
4908
|
-
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
4909
4949
|
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
4950
|
+
import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types";
|
|
4910
4951
|
import { Components } from "../../../core";
|
|
4911
4952
|
/**
|
|
4912
|
-
* A query that checks the
|
|
4953
|
+
* A query that checks the properties in the property sets assigned to IFC items.
|
|
4913
4954
|
*/
|
|
4914
|
-
export declare class
|
|
4955
|
+
export declare class IfcPropertyQuery extends IfcFinderQuery {
|
|
4915
4956
|
/**
|
|
4916
4957
|
* {@link IfcFinderQuery.name}
|
|
4917
4958
|
*/
|
|
@@ -4919,15 +4960,16 @@ export declare class IfcBasicQuery extends IfcFinderQuery {
|
|
|
4919
4960
|
/**
|
|
4920
4961
|
* The type of this query.
|
|
4921
4962
|
*/
|
|
4922
|
-
static type: "
|
|
4963
|
+
static type: "IfcPropertyQuery";
|
|
4964
|
+
private psets;
|
|
4923
4965
|
/**
|
|
4924
4966
|
* {@link IfcFinderQuery.items}
|
|
4925
4967
|
*/
|
|
4926
4968
|
get items(): FRAGS.FragmentIdMap;
|
|
4927
4969
|
constructor(components: Components, data: {
|
|
4928
4970
|
name: string;
|
|
4929
|
-
rules: IfcFinderRule[];
|
|
4930
4971
|
inclusive: boolean;
|
|
4972
|
+
rules: (IfcPropertyRule | IfcOperatorRule)[];
|
|
4931
4973
|
});
|
|
4932
4974
|
/**
|
|
4933
4975
|
* {@link IfcFinderQuery.export}
|
|
@@ -4939,102 +4981,299 @@ export declare class IfcBasicQuery extends IfcFinderQuery {
|
|
|
4939
4981
|
update(modelID: string, file: File): Promise<void>;
|
|
4940
4982
|
protected findInLines(modelID: string, lines: string[]): void;
|
|
4941
4983
|
}
|
|
4984
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
4985
|
+
/**
|
|
4986
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
4987
|
+
*/
|
|
4988
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
4989
|
+
/**
|
|
4990
|
+
* Amount of properties to be streamed.
|
|
4991
|
+
* Defaults to 100 properties.
|
|
4992
|
+
*/
|
|
4993
|
+
propertiesSize: number;
|
|
4994
|
+
}
|
|
4995
|
+
import * as THREE from "three";
|
|
4996
|
+
import * as WEBIFC from "web-ifc";
|
|
4997
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
4998
|
+
export declare class CivilReader {
|
|
4999
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
5000
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
5001
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
5002
|
+
coordinationMatrix: THREE.Matrix4;
|
|
5003
|
+
} | undefined;
|
|
5004
|
+
get(civilItems: any): {
|
|
5005
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
5006
|
+
coordinationMatrix: THREE.Matrix4;
|
|
5007
|
+
} | undefined;
|
|
5008
|
+
private getCurves;
|
|
5009
|
+
}
|
|
5010
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
5011
|
+
/**
|
|
5012
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
5013
|
+
*/
|
|
5014
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
5015
|
+
/**
|
|
5016
|
+
* Minimum number of geometries to be streamed.
|
|
5017
|
+
* Defaults to 10 geometries.
|
|
5018
|
+
*/
|
|
5019
|
+
minGeometrySize: number;
|
|
5020
|
+
/**
|
|
5021
|
+
* Minimum amount of assets to be streamed.
|
|
5022
|
+
* Defaults to 1000 assets.
|
|
5023
|
+
*/
|
|
5024
|
+
minAssetsSize: number;
|
|
5025
|
+
/**
|
|
5026
|
+
* Maximum amount of triangles per fragment. Useful for controlling the maximum size of fragment files.
|
|
5027
|
+
*/
|
|
5028
|
+
maxTriangles: number | null;
|
|
5029
|
+
}
|
|
5030
|
+
import * as WEBIFC from "web-ifc";
|
|
5031
|
+
export declare class IfcMetadataReader {
|
|
5032
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
5033
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
5034
|
+
}
|
|
5035
|
+
/**
|
|
5036
|
+
* 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.
|
|
5037
|
+
*/
|
|
5038
|
+
export interface StreamedGeometries {
|
|
5039
|
+
[id: number]: {
|
|
5040
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
5041
|
+
boundingBox: Float32Array;
|
|
5042
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
5043
|
+
hasHoles: boolean;
|
|
5044
|
+
/** An optional file path for the geometry data. */
|
|
5045
|
+
geometryFile?: string;
|
|
5046
|
+
};
|
|
5047
|
+
}
|
|
5048
|
+
/**
|
|
5049
|
+
* 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.
|
|
5050
|
+
*/
|
|
5051
|
+
export interface StreamedAsset {
|
|
5052
|
+
/** The unique identifier of the asset. */
|
|
5053
|
+
id: number;
|
|
5054
|
+
/** An array of geometries associated with the asset. */
|
|
5055
|
+
geometries: {
|
|
5056
|
+
/** The unique identifier of the geometry. */
|
|
5057
|
+
geometryID: number;
|
|
5058
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
5059
|
+
transformation: number[];
|
|
5060
|
+
/** The color of the geometry as a number array. */
|
|
5061
|
+
color: number[];
|
|
5062
|
+
}[];
|
|
5063
|
+
}
|
|
5064
|
+
import * as WEBIFC from "web-ifc";
|
|
5065
|
+
import * as THREE from "three";
|
|
5066
|
+
export declare class Units {
|
|
5067
|
+
factor: number;
|
|
5068
|
+
complement: number;
|
|
5069
|
+
apply(matrix: THREE.Matrix4): void;
|
|
5070
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
5071
|
+
private getLengthUnits;
|
|
5072
|
+
private getScaleMatrix;
|
|
5073
|
+
}
|
|
5074
|
+
export type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2";
|
|
5075
|
+
export type IDSFacetParameterName = "Name" | "PredefinedType" | "Value" | "System" | "URI" | "PropertySet" | "BaseName" | "DataType" | "Value" | "Entity" | "Relation";
|
|
5076
|
+
export type IDSSimpleCardinality = "required" | "prohibited";
|
|
5077
|
+
export type IDSConditionalCardinaltiy = IDSSimpleCardinality | "optional";
|
|
5078
|
+
export type IDSSimpleParameter = string | number | boolean;
|
|
5079
|
+
export type IDSEnumerationParameter = string[] | number[] | boolean[];
|
|
5080
|
+
export type IDSPatternParameter = string;
|
|
5081
|
+
export type IDSBoundsParameter = {
|
|
5082
|
+
min?: number;
|
|
5083
|
+
minInclusive?: boolean;
|
|
5084
|
+
max?: number;
|
|
5085
|
+
maxInclusive?: boolean;
|
|
5086
|
+
};
|
|
5087
|
+
export type IDSLengthParameter = {
|
|
5088
|
+
min?: number;
|
|
5089
|
+
length?: number;
|
|
5090
|
+
max?: number;
|
|
5091
|
+
};
|
|
5092
|
+
export interface IDSRestrictionParameter {
|
|
5093
|
+
}
|
|
5094
|
+
export type IDSFacetParameterType = "simple" | "enumeration" | "pattern" | "bounds" | "length";
|
|
5095
|
+
export interface IDSFacetParameter {
|
|
5096
|
+
type: IDSFacetParameterType;
|
|
5097
|
+
parameter: IDSSimpleParameter | IDSEnumerationParameter | IDSPatternParameter | IDSBoundsParameter | IDSLengthParameter;
|
|
5098
|
+
}
|
|
5099
|
+
export interface IDSCheck {
|
|
5100
|
+
parameter: IDSFacetParameterName;
|
|
5101
|
+
currentValue: string | number | boolean | null;
|
|
5102
|
+
requiredValue: any;
|
|
5103
|
+
pass: boolean;
|
|
5104
|
+
}
|
|
5105
|
+
/**
|
|
5106
|
+
* Represents the result of a check performed by an IDSFacet test.
|
|
5107
|
+
*/
|
|
5108
|
+
export interface IDSCheckResult {
|
|
5109
|
+
guid?: string;
|
|
5110
|
+
expressID: number;
|
|
5111
|
+
pass: boolean;
|
|
5112
|
+
checks: IDSCheck[];
|
|
5113
|
+
cardinality: IDSConditionalCardinaltiy;
|
|
5114
|
+
}
|
|
5115
|
+
export interface IDSInfo {
|
|
5116
|
+
title: string;
|
|
5117
|
+
description?: string;
|
|
5118
|
+
copyright?: string;
|
|
5119
|
+
version?: string;
|
|
5120
|
+
author?: string;
|
|
5121
|
+
date?: Date;
|
|
5122
|
+
purpose?: string;
|
|
5123
|
+
milestone?: string;
|
|
5124
|
+
}
|
|
5125
|
+
import { Components } from "../../../../core/Components";
|
|
5126
|
+
import { IDSFacet } from "../facets";
|
|
5127
|
+
export declare const createEntityFacets: (components: Components, elements: any) => IDSFacet[];
|
|
4942
5128
|
import * as FRAGS from "@thatopen/fragments";
|
|
4943
|
-
import {
|
|
4944
|
-
import {
|
|
5129
|
+
import { Components } from "../../../core/Components";
|
|
5130
|
+
import { DataSet } from "../../../core/Types";
|
|
5131
|
+
import { IDSCheckResult, IfcVersion } from "./types";
|
|
5132
|
+
import { IDSFacet } from "./facets";
|
|
4945
5133
|
/**
|
|
4946
|
-
*
|
|
5134
|
+
* Represents a single specification from the Information Delivery Specification (IDS) standard.
|
|
5135
|
+
*
|
|
5136
|
+
* @remarks This class provides methods for testing a model against the specification,
|
|
5137
|
+
* as well as serializing the specification into XML format.
|
|
4947
5138
|
*/
|
|
4948
|
-
export declare
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
/**
|
|
4958
|
-
* A name given to the instance of the query to identify it.
|
|
4959
|
-
*/
|
|
4960
|
-
abstract name: string;
|
|
4961
|
-
/**
|
|
4962
|
-
* The list of IFC items that this query found across all models.
|
|
4963
|
-
*/
|
|
4964
|
-
abstract items: FRAGS.FragmentIdMap;
|
|
4965
|
-
/**
|
|
4966
|
-
* If false, ALL rules of the query must comply to make a match. If true, ANY rule will be enough to make a match.
|
|
4967
|
-
*/
|
|
4968
|
-
inclusive: boolean;
|
|
4969
|
-
/**
|
|
4970
|
-
* The list of rules to be applied by this query.
|
|
4971
|
-
*/
|
|
4972
|
-
rules: IfcFinderRule[];
|
|
4973
|
-
/**
|
|
4974
|
-
* The IDs of the match items per model.
|
|
4975
|
-
*/
|
|
4976
|
-
ids: {
|
|
4977
|
-
[modelID: string]: Set<number>;
|
|
4978
|
-
};
|
|
4979
|
-
/**
|
|
4980
|
-
* Whether this query is up to date or not per file. If not, when updating the group where it belongs, it will re-process the given file.
|
|
4981
|
-
*/
|
|
4982
|
-
needsUpdate: Map<string, boolean>;
|
|
4983
|
-
/**
|
|
4984
|
-
* Export the current data of this query in a serializable object to persist it over time.
|
|
4985
|
-
*/
|
|
4986
|
-
abstract export(): {
|
|
4987
|
-
[key: string]: any;
|
|
4988
|
-
};
|
|
4989
|
-
/**
|
|
4990
|
-
* Perform the search in the given file and save the result.
|
|
4991
|
-
*/
|
|
4992
|
-
abstract update(modelID: string, file: File): Promise<void>;
|
|
5139
|
+
export declare class IDSSpecification {
|
|
5140
|
+
name: string;
|
|
5141
|
+
ifcVersion: Set<IfcVersion>;
|
|
5142
|
+
identifier: string;
|
|
5143
|
+
description?: string;
|
|
5144
|
+
instructions?: string;
|
|
5145
|
+
requirementsDescription?: string;
|
|
5146
|
+
applicability: DataSet<IDSFacet>;
|
|
5147
|
+
requirements: DataSet<IDSFacet>;
|
|
4993
5148
|
protected components: Components;
|
|
4994
|
-
|
|
4995
|
-
protected constructor(components: Components);
|
|
4996
|
-
/**
|
|
4997
|
-
* Imports a query given its data. This data can be generating using its {@link IfcFinderQuery.export} method.
|
|
4998
|
-
*
|
|
4999
|
-
* @param components the instance of {@link Components} used by this app.
|
|
5000
|
-
* @param data the data of the query to import as a serializable object.
|
|
5001
|
-
*/
|
|
5002
|
-
static import(components: Components, data: {
|
|
5003
|
-
[id: string]: any;
|
|
5004
|
-
}): IfcFinderQuery | null;
|
|
5149
|
+
constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
|
|
5005
5150
|
/**
|
|
5006
|
-
*
|
|
5151
|
+
* Tests the model to test against the specification's requirements.
|
|
5007
5152
|
*
|
|
5008
|
-
* @param
|
|
5153
|
+
* @param model - The model to be tested.
|
|
5154
|
+
* @returns An array representing the test results.
|
|
5155
|
+
* If no requirements are defined for the specification, an empty array is returned.
|
|
5009
5156
|
*/
|
|
5010
|
-
|
|
5011
|
-
[key: string]: any;
|
|
5012
|
-
}[]): IfcFinderRule[];
|
|
5157
|
+
test(model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
|
|
5013
5158
|
/**
|
|
5014
|
-
*
|
|
5159
|
+
* Serializes the IDSSpecification instance into XML format.
|
|
5015
5160
|
*
|
|
5016
|
-
* @
|
|
5017
|
-
*/
|
|
5018
|
-
static importIds(data: SerializedQuery): {
|
|
5019
|
-
[modelID: string]: Set<number>;
|
|
5020
|
-
};
|
|
5021
|
-
/**
|
|
5022
|
-
* Clears the data of the given model. If not specified, clears all the data.
|
|
5161
|
+
* @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
|
|
5023
5162
|
*
|
|
5024
|
-
* @
|
|
5163
|
+
* @returns The XML representation of the IDSSpecification.
|
|
5025
5164
|
*/
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5165
|
+
serialize(): string;
|
|
5166
|
+
}
|
|
5167
|
+
import { IDSFacetParameter } from "../types";
|
|
5168
|
+
export declare const getParameterValue: (property: any) => IDSFacetParameter | undefined;
|
|
5169
|
+
import { Components } from "../../../../core/Components";
|
|
5170
|
+
import { IDSFacet } from "../facets";
|
|
5171
|
+
export declare const createClassificationFacets: (components: Components, elements: any) => IDSFacet[];
|
|
5172
|
+
import { Components } from "../../../../core/Components";
|
|
5173
|
+
import { IDSFacet } from "../facets";
|
|
5174
|
+
export declare const createAttributeFacets: (components: Components, elements: any) => IDSFacet[];
|
|
5175
|
+
import * as WEBIFC from "web-ifc";
|
|
5176
|
+
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
5177
|
+
export interface ModelsRelationMap {
|
|
5178
|
+
[modelID: string]: RelationsMap;
|
|
5179
|
+
}
|
|
5180
|
+
/**
|
|
5181
|
+
* Type alias for an array of inverse attribute names.
|
|
5182
|
+
*/
|
|
5183
|
+
export type InverseAttributes = [
|
|
5184
|
+
"IsDecomposedBy",
|
|
5185
|
+
"Decomposes",
|
|
5186
|
+
"AssociatedTo",
|
|
5187
|
+
"HasAssociations",
|
|
5188
|
+
"ClassificationForObjects",
|
|
5189
|
+
"IsGroupedBy",
|
|
5190
|
+
"HasAssignments",
|
|
5191
|
+
"IsDefinedBy",
|
|
5192
|
+
"DefinesOcurrence",
|
|
5193
|
+
"IsTypedBy",
|
|
5194
|
+
"Types",
|
|
5195
|
+
"Defines",
|
|
5196
|
+
"ContainedInStructure",
|
|
5197
|
+
"ContainsElements",
|
|
5198
|
+
"HasControlElements",
|
|
5199
|
+
"AssignedToFlowElement",
|
|
5200
|
+
"ConnectedTo",
|
|
5201
|
+
"ConnectedFrom",
|
|
5202
|
+
"ReferencedBy",
|
|
5203
|
+
"Declares",
|
|
5204
|
+
"HasContext",
|
|
5205
|
+
"Controls",
|
|
5206
|
+
"IsNestedBy",
|
|
5207
|
+
"Nests",
|
|
5208
|
+
"DocumentRefForObjects"
|
|
5209
|
+
];
|
|
5210
|
+
export type InverseAttribute = InverseAttributes[number];
|
|
5211
|
+
/**
|
|
5212
|
+
* Type alias for an array of IfcRelation types from WebIfc.
|
|
5213
|
+
*/
|
|
5214
|
+
export type IfcRelations = [
|
|
5215
|
+
typeof WEBIFC.IFCRELAGGREGATES,
|
|
5216
|
+
typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
|
|
5217
|
+
typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
|
|
5218
|
+
typeof WEBIFC.IFCRELASSIGNSTOGROUP,
|
|
5219
|
+
typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
|
|
5220
|
+
typeof WEBIFC.IFCRELDEFINESBYTYPE,
|
|
5221
|
+
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
5222
|
+
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
5223
|
+
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
5224
|
+
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
5225
|
+
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
5226
|
+
typeof WEBIFC.IFCRELDECLARES,
|
|
5227
|
+
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
5228
|
+
typeof WEBIFC.IFCRELNESTS,
|
|
5229
|
+
typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
|
|
5230
|
+
];
|
|
5231
|
+
export type IfcRelation = IfcRelations[number];
|
|
5232
|
+
export interface RelationsProcessingConfig {
|
|
5233
|
+
relationsToProcess: IfcRelation[];
|
|
5234
|
+
}
|
|
5235
|
+
/**
|
|
5236
|
+
* Interface definition of an Entities Related Event from the IfcRelationsIndexer.
|
|
5237
|
+
* This event gets triggered when two or more entities has been related with each other.
|
|
5238
|
+
*/
|
|
5239
|
+
export interface EntitiesRelatedEvent {
|
|
5240
|
+
/** The type of the IFC relation. */
|
|
5241
|
+
relType: IfcRelation;
|
|
5242
|
+
/** The inverse attribute of the relation. */
|
|
5243
|
+
invAttribute: InverseAttribute;
|
|
5244
|
+
/** The IDs of the entities that are relating. */
|
|
5245
|
+
relatingIDs: number[];
|
|
5246
|
+
/** The IDs of the entities that are being related. */
|
|
5247
|
+
relatedIDs: number[];
|
|
5037
5248
|
}
|
|
5249
|
+
import { IfcRelName } from "./types";
|
|
5250
|
+
type IfcRelAttributePosition = {
|
|
5251
|
+
related: number;
|
|
5252
|
+
relating: number;
|
|
5253
|
+
};
|
|
5254
|
+
export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
|
|
5255
|
+
export {};
|
|
5256
|
+
import { IfcRelName } from "./types";
|
|
5257
|
+
import { IfcRelation } from "../../IfcRelationsIndexer";
|
|
5258
|
+
export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
|
|
5259
|
+
export type IfcRelationNames = [
|
|
5260
|
+
"IfcRelAssignsToControl",
|
|
5261
|
+
"IfcRelAssignsToGroup",
|
|
5262
|
+
"IfcRelAssignsToProduct",
|
|
5263
|
+
"IfcRelAssociatesClassification",
|
|
5264
|
+
"IfcRelAssociatesMaterial",
|
|
5265
|
+
"IfcRelAssociatesDocument",
|
|
5266
|
+
"IfcRelContainedInSpatialStructure",
|
|
5267
|
+
"IfcRelFlowControlElements",
|
|
5268
|
+
"IfcRelConnectsElements",
|
|
5269
|
+
"IfcRelDeclares",
|
|
5270
|
+
"IfcRelAggregates",
|
|
5271
|
+
"IfcRelNests",
|
|
5272
|
+
"IfcRelDefinesByProperties",
|
|
5273
|
+
"IfcRelDefinesByType",
|
|
5274
|
+
"IfcRelDefinesByTemplate"
|
|
5275
|
+
];
|
|
5276
|
+
export type IfcRelName = IfcRelationNames[number];
|
|
5038
5277
|
export type BCFVersion = "2.1" | "3";
|
|
5039
5278
|
export interface BCFTopic {
|
|
5040
5279
|
guid: string;
|
|
@@ -5054,42 +5293,6 @@ export interface BCFTopic {
|
|
|
5054
5293
|
description?: string;
|
|
5055
5294
|
stage?: string;
|
|
5056
5295
|
}
|
|
5057
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
5058
|
-
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
5059
|
-
import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types";
|
|
5060
|
-
import { Components } from "../../../core";
|
|
5061
|
-
/**
|
|
5062
|
-
* A query that checks the properties in the property sets assigned to IFC items.
|
|
5063
|
-
*/
|
|
5064
|
-
export declare class IfcPropertyQuery extends IfcFinderQuery {
|
|
5065
|
-
/**
|
|
5066
|
-
* {@link IfcFinderQuery.name}
|
|
5067
|
-
*/
|
|
5068
|
-
name: string;
|
|
5069
|
-
/**
|
|
5070
|
-
* The type of this query.
|
|
5071
|
-
*/
|
|
5072
|
-
static type: "IfcPropertyQuery";
|
|
5073
|
-
private psets;
|
|
5074
|
-
/**
|
|
5075
|
-
* {@link IfcFinderQuery.items}
|
|
5076
|
-
*/
|
|
5077
|
-
get items(): FRAGS.FragmentIdMap;
|
|
5078
|
-
constructor(components: Components, data: {
|
|
5079
|
-
name: string;
|
|
5080
|
-
inclusive: boolean;
|
|
5081
|
-
rules: (IfcPropertyRule | IfcOperatorRule)[];
|
|
5082
|
-
});
|
|
5083
|
-
/**
|
|
5084
|
-
* {@link IfcFinderQuery.export}
|
|
5085
|
-
*/
|
|
5086
|
-
export(): SerializedQuery;
|
|
5087
|
-
/**
|
|
5088
|
-
* {@link IfcFinderQuery.update}
|
|
5089
|
-
*/
|
|
5090
|
-
update(modelID: string, file: File): Promise<void>;
|
|
5091
|
-
protected findInLines(modelID: string, lines: string[]): void;
|
|
5092
|
-
}
|
|
5093
5296
|
import { Components } from "../../../core/Components";
|
|
5094
5297
|
import { Viewpoint } from "../../../core/Viewpoints";
|
|
5095
5298
|
import { Comment } from "./Comment";
|
|
@@ -5253,13 +5456,6 @@ export declare class Comment {
|
|
|
5253
5456
|
*/
|
|
5254
5457
|
serialize(): string;
|
|
5255
5458
|
}
|
|
5256
|
-
import { IfcRelName } from "./types";
|
|
5257
|
-
type IfcRelAttributePosition = {
|
|
5258
|
-
related: number;
|
|
5259
|
-
relating: number;
|
|
5260
|
-
};
|
|
5261
|
-
export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
|
|
5262
|
-
export {};
|
|
5263
5459
|
import { BCFTopics, BCFVersion } from "../index";
|
|
5264
5460
|
import { BooleanSettingsControl, Configurator, SelectSettingControl, TextSetSettingControl, TextSettingsControl } from "../../../core";
|
|
5265
5461
|
/**
|
|
@@ -5382,196 +5578,6 @@ export declare class BCFTopicsConfigManager extends Configurator<BCFTopics, BCFT
|
|
|
5382
5578
|
set ignoreIncompleteTopicsOnImport(value: boolean);
|
|
5383
5579
|
}
|
|
5384
5580
|
export {};
|
|
5385
|
-
import { IfcRelName } from "./types";
|
|
5386
|
-
import { IfcRelation } from "../../IfcRelationsIndexer";
|
|
5387
|
-
export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
|
|
5388
|
-
export type IfcRelationNames = [
|
|
5389
|
-
"IfcRelAssignsToControl",
|
|
5390
|
-
"IfcRelAssignsToGroup",
|
|
5391
|
-
"IfcRelAssignsToProduct",
|
|
5392
|
-
"IfcRelAssociatesClassification",
|
|
5393
|
-
"IfcRelAssociatesMaterial",
|
|
5394
|
-
"IfcRelAssociatesDocument",
|
|
5395
|
-
"IfcRelContainedInSpatialStructure",
|
|
5396
|
-
"IfcRelFlowControlElements",
|
|
5397
|
-
"IfcRelConnectsElements",
|
|
5398
|
-
"IfcRelDeclares",
|
|
5399
|
-
"IfcRelAggregates",
|
|
5400
|
-
"IfcRelNests",
|
|
5401
|
-
"IfcRelDefinesByProperties",
|
|
5402
|
-
"IfcRelDefinesByType",
|
|
5403
|
-
"IfcRelDefinesByTemplate"
|
|
5404
|
-
];
|
|
5405
|
-
export type IfcRelName = IfcRelationNames[number];
|
|
5406
|
-
import { Components } from "../../../../core/Components";
|
|
5407
|
-
import { IDSFacet } from "../facets";
|
|
5408
|
-
export declare const createEntityFacets: (components: Components, elements: any) => IDSFacet[];
|
|
5409
|
-
import { Components } from "../../../../core/Components";
|
|
5410
|
-
import { IDSFacet } from "../facets";
|
|
5411
|
-
export declare const createClassificationFacets: (components: Components, elements: any) => IDSFacet[];
|
|
5412
|
-
import { Components } from "../../../../core/Components";
|
|
5413
|
-
import { IDSFacet } from "../facets";
|
|
5414
|
-
export declare const createAttributeFacets: (components: Components, elements: any) => IDSFacet[];
|
|
5415
|
-
export type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2";
|
|
5416
|
-
export type IDSFacetParameterName = "Name" | "PredefinedType" | "Value" | "System" | "URI" | "PropertySet" | "BaseName" | "DataType" | "Value" | "Entity" | "Relation";
|
|
5417
|
-
export type IDSSimpleCardinality = "required" | "prohibited";
|
|
5418
|
-
export type IDSConditionalCardinaltiy = IDSSimpleCardinality | "optional";
|
|
5419
|
-
export type IDSSimpleParameter = string | number | boolean;
|
|
5420
|
-
export type IDSEnumerationParameter = string[] | number[] | boolean[];
|
|
5421
|
-
export type IDSPatternParameter = string;
|
|
5422
|
-
export type IDSBoundsParameter = {
|
|
5423
|
-
min?: number;
|
|
5424
|
-
minInclusive?: boolean;
|
|
5425
|
-
max?: number;
|
|
5426
|
-
maxInclusive?: boolean;
|
|
5427
|
-
};
|
|
5428
|
-
export type IDSLengthParameter = {
|
|
5429
|
-
min?: number;
|
|
5430
|
-
length?: number;
|
|
5431
|
-
max?: number;
|
|
5432
|
-
};
|
|
5433
|
-
export interface IDSRestrictionParameter {
|
|
5434
|
-
}
|
|
5435
|
-
export type IDSFacetParameterType = "simple" | "enumeration" | "pattern" | "bounds" | "length";
|
|
5436
|
-
export interface IDSFacetParameter {
|
|
5437
|
-
type: IDSFacetParameterType;
|
|
5438
|
-
parameter: IDSSimpleParameter | IDSEnumerationParameter | IDSPatternParameter | IDSBoundsParameter | IDSLengthParameter;
|
|
5439
|
-
}
|
|
5440
|
-
export interface IDSCheck {
|
|
5441
|
-
parameter: IDSFacetParameterName;
|
|
5442
|
-
currentValue: string | number | boolean | null;
|
|
5443
|
-
requiredValue: any;
|
|
5444
|
-
pass: boolean;
|
|
5445
|
-
}
|
|
5446
|
-
/**
|
|
5447
|
-
* Represents the result of a check performed by an IDSFacet test.
|
|
5448
|
-
*/
|
|
5449
|
-
export interface IDSCheckResult {
|
|
5450
|
-
guid?: string;
|
|
5451
|
-
expressID: number;
|
|
5452
|
-
pass: boolean;
|
|
5453
|
-
checks: IDSCheck[];
|
|
5454
|
-
cardinality: IDSConditionalCardinaltiy;
|
|
5455
|
-
}
|
|
5456
|
-
export interface IDSInfo {
|
|
5457
|
-
title: string;
|
|
5458
|
-
description?: string;
|
|
5459
|
-
copyright?: string;
|
|
5460
|
-
version?: string;
|
|
5461
|
-
author?: string;
|
|
5462
|
-
date?: Date;
|
|
5463
|
-
purpose?: string;
|
|
5464
|
-
milestone?: string;
|
|
5465
|
-
}
|
|
5466
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
5467
|
-
/**
|
|
5468
|
-
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
5469
|
-
*/
|
|
5470
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
5471
|
-
/**
|
|
5472
|
-
* Amount of properties to be streamed.
|
|
5473
|
-
* Defaults to 100 properties.
|
|
5474
|
-
*/
|
|
5475
|
-
propertiesSize: number;
|
|
5476
|
-
}
|
|
5477
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
5478
|
-
import { Components } from "../../../core/Components";
|
|
5479
|
-
import { DataSet } from "../../../core/Types";
|
|
5480
|
-
import { IDSCheckResult, IfcVersion } from "./types";
|
|
5481
|
-
import { IDSFacet } from "./facets";
|
|
5482
|
-
/**
|
|
5483
|
-
* Represents a single specification from the Information Delivery Specification (IDS) standard.
|
|
5484
|
-
*
|
|
5485
|
-
* @remarks This class provides methods for testing a model against the specification,
|
|
5486
|
-
* as well as serializing the specification into XML format.
|
|
5487
|
-
*/
|
|
5488
|
-
export declare class IDSSpecification {
|
|
5489
|
-
name: string;
|
|
5490
|
-
ifcVersion: Set<IfcVersion>;
|
|
5491
|
-
identifier: string;
|
|
5492
|
-
description?: string;
|
|
5493
|
-
instructions?: string;
|
|
5494
|
-
requirementsDescription?: string;
|
|
5495
|
-
applicability: DataSet<IDSFacet>;
|
|
5496
|
-
requirements: DataSet<IDSFacet>;
|
|
5497
|
-
protected components: Components;
|
|
5498
|
-
constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
|
|
5499
|
-
/**
|
|
5500
|
-
* Tests the model to test against the specification's requirements.
|
|
5501
|
-
*
|
|
5502
|
-
* @param model - The model to be tested.
|
|
5503
|
-
* @returns An array representing the test results.
|
|
5504
|
-
* If no requirements are defined for the specification, an empty array is returned.
|
|
5505
|
-
*/
|
|
5506
|
-
test(model: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
|
|
5507
|
-
/**
|
|
5508
|
-
* Serializes the IDSSpecification instance into XML format.
|
|
5509
|
-
*
|
|
5510
|
-
* @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
|
|
5511
|
-
*
|
|
5512
|
-
* @returns The XML representation of the IDSSpecification.
|
|
5513
|
-
*/
|
|
5514
|
-
serialize(): string;
|
|
5515
|
-
}
|
|
5516
|
-
import { IDSFacetParameter } from "../types";
|
|
5517
|
-
export declare const getParameterValue: (property: any) => IDSFacetParameter | undefined;
|
|
5518
|
-
import * as WEBIFC from "web-ifc";
|
|
5519
|
-
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
5520
|
-
export interface ModelsRelationMap {
|
|
5521
|
-
[modelID: string]: RelationsMap;
|
|
5522
|
-
}
|
|
5523
|
-
/**
|
|
5524
|
-
* Type alias for an array of inverse attribute names.
|
|
5525
|
-
*/
|
|
5526
|
-
export type InverseAttributes = [
|
|
5527
|
-
"IsDecomposedBy",
|
|
5528
|
-
"Decomposes",
|
|
5529
|
-
"AssociatedTo",
|
|
5530
|
-
"HasAssociations",
|
|
5531
|
-
"ClassificationForObjects",
|
|
5532
|
-
"IsGroupedBy",
|
|
5533
|
-
"HasAssignments",
|
|
5534
|
-
"IsDefinedBy",
|
|
5535
|
-
"DefinesOcurrence",
|
|
5536
|
-
"IsTypedBy",
|
|
5537
|
-
"Types",
|
|
5538
|
-
"Defines",
|
|
5539
|
-
"ContainedInStructure",
|
|
5540
|
-
"ContainsElements",
|
|
5541
|
-
"HasControlElements",
|
|
5542
|
-
"AssignedToFlowElement",
|
|
5543
|
-
"ConnectedTo",
|
|
5544
|
-
"ConnectedFrom",
|
|
5545
|
-
"ReferencedBy",
|
|
5546
|
-
"Declares",
|
|
5547
|
-
"HasContext",
|
|
5548
|
-
"Controls",
|
|
5549
|
-
"IsNestedBy",
|
|
5550
|
-
"Nests",
|
|
5551
|
-
"DocumentRefForObjects"
|
|
5552
|
-
];
|
|
5553
|
-
export type InverseAttribute = InverseAttributes[number];
|
|
5554
|
-
/**
|
|
5555
|
-
* Type alias for an array of IfcRelation types from WebIfc.
|
|
5556
|
-
*/
|
|
5557
|
-
export type IfcRelations = [
|
|
5558
|
-
typeof WEBIFC.IFCRELAGGREGATES,
|
|
5559
|
-
typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
|
|
5560
|
-
typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
|
|
5561
|
-
typeof WEBIFC.IFCRELASSIGNSTOGROUP,
|
|
5562
|
-
typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
|
|
5563
|
-
typeof WEBIFC.IFCRELDEFINESBYTYPE,
|
|
5564
|
-
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
5565
|
-
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
5566
|
-
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
5567
|
-
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
5568
|
-
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
5569
|
-
typeof WEBIFC.IFCRELDECLARES,
|
|
5570
|
-
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
5571
|
-
typeof WEBIFC.IFCRELNESTS,
|
|
5572
|
-
typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
|
|
5573
|
-
];
|
|
5574
|
-
export type IfcRelation = IfcRelations[number];
|
|
5575
5581
|
import { BooleanSettingsControl, NumberSettingControl } from "../../Types";
|
|
5576
5582
|
import { Configurator } from "../../ConfigManager";
|
|
5577
5583
|
import { CullerRenderer } from "../index";
|
|
@@ -5646,8 +5652,6 @@ export declare class CullerRendererConfigManager extends Configurator<CullerRend
|
|
|
5646
5652
|
private resetInterval;
|
|
5647
5653
|
}
|
|
5648
5654
|
export {};
|
|
5649
|
-
import { BCFTopics } from "../..";
|
|
5650
|
-
export declare const extensionsImporter: (manager: BCFTopics, extensionsXML: string) => void;
|
|
5651
5655
|
import * as FRAGS from "@thatopen/fragments";
|
|
5652
5656
|
import { IDSCheckResult, IDSFacetParameter } from "../types";
|
|
5653
5657
|
import { Components } from "../../../../core/Components";
|
|
@@ -5662,6 +5666,31 @@ export declare class IDSAttribute extends IDSFacet {
|
|
|
5662
5666
|
}
|
|
5663
5667
|
import * as FRAGS from "@thatopen/fragments";
|
|
5664
5668
|
import { Components } from "../../../../core/Components";
|
|
5669
|
+
import { IDSFacetParameter, IDSCheckResult, IDSFacetParameterName, IDSCheck, IDSConditionalCardinaltiy, IDSSimpleCardinality } from "../types";
|
|
5670
|
+
export declare abstract class IDSFacet {
|
|
5671
|
+
protected components: Components;
|
|
5672
|
+
cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
|
|
5673
|
+
instructions?: string;
|
|
5674
|
+
constructor(components: Components);
|
|
5675
|
+
protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
|
|
5676
|
+
protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
|
|
5677
|
+
protected testResult: IDSCheckResult[];
|
|
5678
|
+
protected saveResult(attrs: any, pass: boolean): void;
|
|
5679
|
+
/**
|
|
5680
|
+
* Returns the list of expressIDs that pass the criteria of this facet.
|
|
5681
|
+
* @param model - The IFC model to retrieve entities from.
|
|
5682
|
+
* @param collector - An optional object to collect the retrieved entities.
|
|
5683
|
+
* @remarks
|
|
5684
|
+
* If the collector already includes the entity, it won't get processed any further.
|
|
5685
|
+
*
|
|
5686
|
+
* @returns An array of express IDs of the retrieved entities.
|
|
5687
|
+
*/
|
|
5688
|
+
abstract getEntities(model: FRAGS.FragmentsGroup, collector: FRAGS.IfcProperties): Promise<number[]>;
|
|
5689
|
+
abstract test(entities: FRAGS.IfcProperties, model?: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
|
|
5690
|
+
abstract serialize(type: "applicability" | "requirement"): string;
|
|
5691
|
+
}
|
|
5692
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
5693
|
+
import { Components } from "../../../../core/Components";
|
|
5665
5694
|
import { IDSCheckResult, IDSFacetParameter } from "../types";
|
|
5666
5695
|
import { IDSFacet } from "./Facet";
|
|
5667
5696
|
export declare class IDSClassification extends IDSFacet {
|
|
@@ -5718,36 +5747,64 @@ export declare class IDSProperty extends IDSFacet {
|
|
|
5718
5747
|
private evalDataType;
|
|
5719
5748
|
private evalURI;
|
|
5720
5749
|
}
|
|
5721
|
-
import
|
|
5722
|
-
|
|
5723
|
-
import { IDSFacetParameter, IDSCheckResult, IDSFacetParameterName, IDSCheck, IDSConditionalCardinaltiy, IDSSimpleCardinality } from "../types";
|
|
5724
|
-
export declare abstract class IDSFacet {
|
|
5725
|
-
protected components: Components;
|
|
5726
|
-
cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
|
|
5727
|
-
instructions?: string;
|
|
5728
|
-
constructor(components: Components);
|
|
5729
|
-
protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
|
|
5730
|
-
protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
|
|
5731
|
-
protected testResult: IDSCheckResult[];
|
|
5732
|
-
protected saveResult(attrs: any, pass: boolean): void;
|
|
5733
|
-
/**
|
|
5734
|
-
* Returns the list of expressIDs that pass the criteria of this facet.
|
|
5735
|
-
* @param model - The IFC model to retrieve entities from.
|
|
5736
|
-
* @param collector - An optional object to collect the retrieved entities.
|
|
5737
|
-
* @remarks
|
|
5738
|
-
* If the collector already includes the entity, it won't get processed any further.
|
|
5739
|
-
*
|
|
5740
|
-
* @returns An array of express IDs of the retrieved entities.
|
|
5741
|
-
*/
|
|
5742
|
-
abstract getEntities(model: FRAGS.FragmentsGroup, collector: FRAGS.IfcProperties): Promise<number[]>;
|
|
5743
|
-
abstract test(entities: FRAGS.IfcProperties, model?: FRAGS.FragmentsGroup): Promise<IDSCheckResult[]>;
|
|
5744
|
-
abstract serialize(type: "applicability" | "requirement"): string;
|
|
5745
|
-
}
|
|
5750
|
+
import { BCFTopics } from "../..";
|
|
5751
|
+
export declare const extensionsImporter: (manager: BCFTopics, extensionsXML: string) => void;
|
|
5746
5752
|
import { BufferGeometry } from "three";
|
|
5747
5753
|
import * as THREE from "three";
|
|
5748
5754
|
export declare class TransformHelper {
|
|
5749
5755
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
5750
5756
|
}
|
|
5757
|
+
declare const actual: {
|
|
5758
|
+
186: {
|
|
5759
|
+
7: number[];
|
|
5760
|
+
};
|
|
5761
|
+
250: {
|
|
5762
|
+
8: number[];
|
|
5763
|
+
};
|
|
5764
|
+
253: {
|
|
5765
|
+
8: number[];
|
|
5766
|
+
};
|
|
5767
|
+
257: {
|
|
5768
|
+
8: number[];
|
|
5769
|
+
};
|
|
5770
|
+
};
|
|
5771
|
+
declare const newVersion: {
|
|
5772
|
+
186: {
|
|
5773
|
+
7: ({
|
|
5774
|
+
259: number[];
|
|
5775
|
+
263?: undefined;
|
|
5776
|
+
266?: undefined;
|
|
5777
|
+
} | {
|
|
5778
|
+
263: number[];
|
|
5779
|
+
259?: undefined;
|
|
5780
|
+
266?: undefined;
|
|
5781
|
+
} | {
|
|
5782
|
+
266: number[];
|
|
5783
|
+
259?: undefined;
|
|
5784
|
+
263?: undefined;
|
|
5785
|
+
})[];
|
|
5786
|
+
};
|
|
5787
|
+
190: {
|
|
5788
|
+
7: {
|
|
5789
|
+
259: number[];
|
|
5790
|
+
}[];
|
|
5791
|
+
};
|
|
5792
|
+
250: {
|
|
5793
|
+
8: {
|
|
5794
|
+
259: number[];
|
|
5795
|
+
}[];
|
|
5796
|
+
};
|
|
5797
|
+
};
|
|
5798
|
+
interface V2Schema {
|
|
5799
|
+
[expressID: number]: {
|
|
5800
|
+
[invAttrIndex: number]: {
|
|
5801
|
+
[IfcRelationship: number]: number[];
|
|
5802
|
+
};
|
|
5803
|
+
};
|
|
5804
|
+
}
|
|
5805
|
+
type RelationsMap = Map<number, Map<number, {
|
|
5806
|
+
[ifcRel: number]: number[];
|
|
5807
|
+
}>>;
|
|
5751
5808
|
import { IDSFacetParameter } from "../types";
|
|
5752
5809
|
import { IDSFacet } from "./Facet";
|
|
5753
5810
|
export declare class IdsMaterialFacet extends IDSFacet {
|