@thatopen/components 2.0.0-alpha.4 → 2.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Cullers/src/culler-renderer.d.ts +3 -2
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +1 -0
- package/dist/core/Types/src/async-event.d.ts +34 -0
- package/dist/core/Types/src/index.d.ts +1 -0
- package/dist/fragments/FragmentBoundingBox/index.d.ts +2 -2
- package/dist/fragments/FragmentClassifier/index.d.ts +1 -1
- package/dist/fragments/FragmentHider/index.d.ts +1 -1
- package/dist/fragments/FragmentIfcLoader/index.d.ts +1 -1
- package/dist/fragments/FragmentIfcLoader/src/civil-reader.d.ts +1 -1
- package/dist/fragments/FragmentManager/index.d.ts +1 -1
- package/dist/ifc/IfcJsonExporter/index.d.ts +1 -1
- package/dist/ifc/IfcPropertiesFinder/index.d.ts +2 -2
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +20 -66
- package/dist/ifc/IfcPropertiesManager/index.d.ts +2 -2
- package/dist/ifc/Utils/properties-utils.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +1051 -1089
- package/dist/namespace.d.ts +978 -988
- package/package.json +4 -4
package/dist/namespace.d.ts
CHANGED
|
@@ -1,4 +1,47 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { Components } from "../Components";
|
|
4
|
+
import { Component } from "../Types";
|
|
5
|
+
/**
|
|
6
|
+
* A tool to safely remove meshes and geometries from memory to
|
|
7
|
+
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
8
|
+
*/
|
|
9
|
+
export declare class Disposer extends Component {
|
|
10
|
+
private _disposedComponents;
|
|
11
|
+
/** {@link Component.enabled} */
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
14
|
+
constructor(components: Components);
|
|
15
|
+
/**
|
|
16
|
+
* {@link Component.uuid}.
|
|
17
|
+
* @return the list of UUIDs of deleted components.
|
|
18
|
+
*/
|
|
19
|
+
get(): Set<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
22
|
+
* using any of these in other parts of the application, make sure that you
|
|
23
|
+
* remove them from the mesh before disposing it.
|
|
24
|
+
*
|
|
25
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
26
|
+
* to remove.
|
|
27
|
+
*
|
|
28
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
29
|
+
*
|
|
30
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
31
|
+
*/
|
|
32
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Disposes a geometry from memory.
|
|
35
|
+
*
|
|
36
|
+
* @param geometry - the
|
|
37
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
38
|
+
* to remove.
|
|
39
|
+
*/
|
|
40
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
41
|
+
private disposeGeometryAndMaterials;
|
|
42
|
+
private disposeChildren;
|
|
43
|
+
private static disposeMaterial;
|
|
44
|
+
}
|
|
2
45
|
import { Component, Disposable, World, Event } from "../Types";
|
|
3
46
|
import { SimpleRaycaster } from "./src";
|
|
4
47
|
import { Components } from "../Components";
|
|
@@ -64,65 +107,6 @@ export declare class Components implements Disposable {
|
|
|
64
107
|
private update;
|
|
65
108
|
private static setupBVH;
|
|
66
109
|
}
|
|
67
|
-
import * as THREE from "three";
|
|
68
|
-
import { Components } from "../Components";
|
|
69
|
-
import { Component } from "../Types";
|
|
70
|
-
/**
|
|
71
|
-
* A tool to safely remove meshes and geometries from memory to
|
|
72
|
-
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
73
|
-
*/
|
|
74
|
-
export declare class Disposer extends Component {
|
|
75
|
-
private _disposedComponents;
|
|
76
|
-
/** {@link Component.enabled} */
|
|
77
|
-
enabled: boolean;
|
|
78
|
-
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
79
|
-
constructor(components: Components);
|
|
80
|
-
/**
|
|
81
|
-
* {@link Component.uuid}.
|
|
82
|
-
* @return the list of UUIDs of deleted components.
|
|
83
|
-
*/
|
|
84
|
-
get(): Set<string>;
|
|
85
|
-
/**
|
|
86
|
-
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
87
|
-
* using any of these in other parts of the application, make sure that you
|
|
88
|
-
* remove them from the mesh before disposing it.
|
|
89
|
-
*
|
|
90
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
91
|
-
* to remove.
|
|
92
|
-
*
|
|
93
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
94
|
-
*
|
|
95
|
-
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
96
|
-
*/
|
|
97
|
-
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
98
|
-
/**
|
|
99
|
-
* Disposes a geometry from memory.
|
|
100
|
-
*
|
|
101
|
-
* @param geometry - the
|
|
102
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
103
|
-
* to remove.
|
|
104
|
-
*/
|
|
105
|
-
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
106
|
-
private disposeGeometryAndMaterials;
|
|
107
|
-
private disposeChildren;
|
|
108
|
-
private static disposeMaterial;
|
|
109
|
-
}
|
|
110
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
111
|
-
import { Components } from "../Components";
|
|
112
|
-
import { SimpleWorld } from "./src";
|
|
113
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
114
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
115
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
116
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
117
|
-
readonly onDisposed: Event<unknown>;
|
|
118
|
-
list: Map<string, World>;
|
|
119
|
-
enabled: boolean;
|
|
120
|
-
constructor(components: Components);
|
|
121
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
122
|
-
delete(world: World): void;
|
|
123
|
-
dispose(): void;
|
|
124
|
-
update(delta?: number): void | Promise<void>;
|
|
125
|
-
}
|
|
126
110
|
import { Component, Disposable, World, Event } from "../Types";
|
|
127
111
|
import { GridConfig, SimpleGrid } from "./src";
|
|
128
112
|
export declare class Grids extends Component implements Disposable {
|
|
@@ -239,6 +223,22 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
239
223
|
private _onStartDragging;
|
|
240
224
|
private _onEndDragging;
|
|
241
225
|
}
|
|
226
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
227
|
+
import { Components } from "../Components";
|
|
228
|
+
import { SimpleWorld } from "./src";
|
|
229
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
230
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
231
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
232
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
233
|
+
readonly onDisposed: Event<unknown>;
|
|
234
|
+
list: Map<string, World>;
|
|
235
|
+
enabled: boolean;
|
|
236
|
+
constructor(components: Components);
|
|
237
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
238
|
+
delete(world: World): void;
|
|
239
|
+
dispose(): void;
|
|
240
|
+
update(delta?: number): void | Promise<void>;
|
|
241
|
+
}
|
|
242
242
|
import * as THREE from "three";
|
|
243
243
|
import { Component, Disposable, Event, World } from "../Types";
|
|
244
244
|
import { Components } from "../Components";
|
|
@@ -323,8 +323,77 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
323
323
|
dispose(): void;
|
|
324
324
|
}
|
|
325
325
|
import * as THREE from "three";
|
|
326
|
-
import
|
|
327
|
-
import {
|
|
326
|
+
import { Components } from "../../core/Components";
|
|
327
|
+
import { SimpleCamera } from "../../core";
|
|
328
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
329
|
+
/**
|
|
330
|
+
* A flexible camera that uses
|
|
331
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
332
|
+
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
333
|
+
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
334
|
+
*/
|
|
335
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
336
|
+
/**
|
|
337
|
+
* The current {@link NavigationMode}.
|
|
338
|
+
*/
|
|
339
|
+
mode: NavigationMode;
|
|
340
|
+
readonly projection: ProjectionManager;
|
|
341
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
342
|
+
protected readonly _userInputButtons: any;
|
|
343
|
+
protected readonly _frustumSize = 50;
|
|
344
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
345
|
+
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
346
|
+
constructor(components: Components);
|
|
347
|
+
/** {@link Disposable.dispose} */
|
|
348
|
+
dispose(): void;
|
|
349
|
+
/**
|
|
350
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
351
|
+
*
|
|
352
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
353
|
+
*/
|
|
354
|
+
set(mode: NavModeID): void;
|
|
355
|
+
/**
|
|
356
|
+
* Make the camera view fit all the specified meshes.
|
|
357
|
+
*
|
|
358
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
359
|
+
* evaluate {@link Components.meshes}.
|
|
360
|
+
* @param offset the distance to the fit object
|
|
361
|
+
*/
|
|
362
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
363
|
+
/**
|
|
364
|
+
* Allows or prevents all user input.
|
|
365
|
+
*
|
|
366
|
+
* @param active - whether to enable or disable user inputs.
|
|
367
|
+
*/
|
|
368
|
+
setUserInput(active: boolean): void;
|
|
369
|
+
private disableUserInput;
|
|
370
|
+
private enableUserInput;
|
|
371
|
+
private newOrthoCamera;
|
|
372
|
+
private setOrthoCameraAspect;
|
|
373
|
+
}
|
|
374
|
+
import * as THREE from "three";
|
|
375
|
+
export interface MeasureEdge {
|
|
376
|
+
distance: number;
|
|
377
|
+
points: THREE.Vector3[];
|
|
378
|
+
}
|
|
379
|
+
export declare class MeasurementUtils {
|
|
380
|
+
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
381
|
+
edges: MeasureEdge[];
|
|
382
|
+
indices: Set<number>;
|
|
383
|
+
} | null;
|
|
384
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
385
|
+
private static getFaceData;
|
|
386
|
+
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
387
|
+
p1: THREE.Vector3;
|
|
388
|
+
p2: THREE.Vector3;
|
|
389
|
+
p3: THREE.Vector3;
|
|
390
|
+
faceNormal: THREE.Vector3;
|
|
391
|
+
};
|
|
392
|
+
private static round;
|
|
393
|
+
}
|
|
394
|
+
import * as THREE from "three";
|
|
395
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
396
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
328
397
|
import { Component, Components, Disposable, Event } from "../../core";
|
|
329
398
|
/**
|
|
330
399
|
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
@@ -358,6 +427,56 @@ export declare class FragmentBoundingBox extends Component implements Disposable
|
|
|
358
427
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
|
|
359
428
|
private static getFragmentBounds;
|
|
360
429
|
}
|
|
430
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
431
|
+
import { Components, Component } from "../../core";
|
|
432
|
+
export declare class FragmentHider extends Component {
|
|
433
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
434
|
+
enabled: boolean;
|
|
435
|
+
constructor(components: Components);
|
|
436
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
437
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
438
|
+
private updateCulledVisibility;
|
|
439
|
+
}
|
|
440
|
+
import * as WEBIFC from "web-ifc";
|
|
441
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
442
|
+
import { IfcFragmentSettings } from "./src";
|
|
443
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
444
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
445
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
446
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
447
|
+
readonly onSetup: Event<void>;
|
|
448
|
+
/** {@link Disposable.onDisposed} */
|
|
449
|
+
readonly onDisposed: Event<string>;
|
|
450
|
+
settings: IfcFragmentSettings;
|
|
451
|
+
enabled: boolean;
|
|
452
|
+
webIfc: WEBIFC.IfcAPI;
|
|
453
|
+
private _material;
|
|
454
|
+
private _spatialTree;
|
|
455
|
+
private _metaData;
|
|
456
|
+
private _fragmentInstances;
|
|
457
|
+
private _civil;
|
|
458
|
+
private _propertyExporter;
|
|
459
|
+
private _visitedFragments;
|
|
460
|
+
private _materialT;
|
|
461
|
+
constructor(components: Components);
|
|
462
|
+
dispose(): void;
|
|
463
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
464
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
465
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
466
|
+
private getAllGeometries;
|
|
467
|
+
cleanUp(): void;
|
|
468
|
+
private getMesh;
|
|
469
|
+
private getGeometry;
|
|
470
|
+
private autoSetWasm;
|
|
471
|
+
}
|
|
472
|
+
import * as THREE from "three";
|
|
473
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
474
|
+
center: THREE.Vector3;
|
|
475
|
+
halfSizes: THREE.Vector3;
|
|
476
|
+
rotation: THREE.Matrix3;
|
|
477
|
+
transformation: THREE.Matrix4;
|
|
478
|
+
};
|
|
479
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
361
480
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
362
481
|
export declare class FragmentExploder extends Component implements Disposable {
|
|
363
482
|
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
@@ -373,7 +492,7 @@ export declare class FragmentExploder extends Component implements Disposable {
|
|
|
373
492
|
reset(): void;
|
|
374
493
|
update(): void;
|
|
375
494
|
}
|
|
376
|
-
import * as FRAGS from "
|
|
495
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
377
496
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
378
497
|
export interface Classification {
|
|
379
498
|
[system: string]: {
|
|
@@ -403,49 +522,23 @@ export declare class FragmentClassifier extends Component implements Disposable
|
|
|
403
522
|
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
404
523
|
private saveItem;
|
|
405
524
|
}
|
|
406
|
-
import * as FRAGS from "bim-fragment";
|
|
407
|
-
import { Components, Component } from "../../core";
|
|
408
|
-
export declare class FragmentHider extends Component {
|
|
409
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
410
|
-
enabled: boolean;
|
|
411
|
-
constructor(components: Components);
|
|
412
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
413
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
414
|
-
private updateCulledVisibility;
|
|
415
|
-
}
|
|
416
525
|
import * as WEBIFC from "web-ifc";
|
|
417
|
-
import * as
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
private _metaData;
|
|
432
|
-
private _fragmentInstances;
|
|
433
|
-
private _civil;
|
|
434
|
-
private _propertyExporter;
|
|
435
|
-
private _visitedFragments;
|
|
436
|
-
private _materialT;
|
|
437
|
-
constructor(components: Components);
|
|
438
|
-
dispose(): void;
|
|
439
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
440
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
441
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
442
|
-
private getAllGeometries;
|
|
443
|
-
cleanUp(): void;
|
|
444
|
-
private getMesh;
|
|
445
|
-
private getGeometry;
|
|
446
|
-
private autoSetWasm;
|
|
526
|
+
import * as FRAG from "@thatopen/fragments";
|
|
527
|
+
/**
|
|
528
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
529
|
+
*/
|
|
530
|
+
export declare class IfcJsonExporter {
|
|
531
|
+
/**
|
|
532
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
533
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
534
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
535
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
536
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
537
|
+
* to make the location data available (e.g. absolute position of building).
|
|
538
|
+
*/
|
|
539
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
447
540
|
}
|
|
448
|
-
import { Fragment, FragmentsGroup } from "
|
|
541
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
449
542
|
import * as THREE from "three";
|
|
450
543
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
451
544
|
/**
|
|
@@ -489,126 +582,8 @@ export declare class FragmentManager extends Component implements Disposable {
|
|
|
489
582
|
export(group: FragmentsGroup): Uint8Array;
|
|
490
583
|
coordinate(models?: FragmentsGroup[]): void;
|
|
491
584
|
}
|
|
492
|
-
import * as
|
|
493
|
-
import {
|
|
494
|
-
import { SimpleCamera } from "../../core";
|
|
495
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
496
|
-
/**
|
|
497
|
-
* A flexible camera that uses
|
|
498
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
499
|
-
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
500
|
-
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
501
|
-
*/
|
|
502
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
503
|
-
/**
|
|
504
|
-
* The current {@link NavigationMode}.
|
|
505
|
-
*/
|
|
506
|
-
mode: NavigationMode;
|
|
507
|
-
readonly projection: ProjectionManager;
|
|
508
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
509
|
-
protected readonly _userInputButtons: any;
|
|
510
|
-
protected readonly _frustumSize = 50;
|
|
511
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
512
|
-
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
513
|
-
constructor(components: Components);
|
|
514
|
-
/** {@link Disposable.dispose} */
|
|
515
|
-
dispose(): void;
|
|
516
|
-
/**
|
|
517
|
-
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
518
|
-
*
|
|
519
|
-
* @param mode - The {@link NavigationMode} to set.
|
|
520
|
-
*/
|
|
521
|
-
set(mode: NavModeID): void;
|
|
522
|
-
/**
|
|
523
|
-
* Make the camera view fit all the specified meshes.
|
|
524
|
-
*
|
|
525
|
-
* @param meshes the meshes to fit. If it is not defined, it will
|
|
526
|
-
* evaluate {@link Components.meshes}.
|
|
527
|
-
* @param offset the distance to the fit object
|
|
528
|
-
*/
|
|
529
|
-
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
530
|
-
/**
|
|
531
|
-
* Allows or prevents all user input.
|
|
532
|
-
*
|
|
533
|
-
* @param active - whether to enable or disable user inputs.
|
|
534
|
-
*/
|
|
535
|
-
setUserInput(active: boolean): void;
|
|
536
|
-
private disableUserInput;
|
|
537
|
-
private enableUserInput;
|
|
538
|
-
private newOrthoCamera;
|
|
539
|
-
private setOrthoCameraAspect;
|
|
540
|
-
}
|
|
541
|
-
import * as THREE from "three";
|
|
542
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
543
|
-
center: THREE.Vector3;
|
|
544
|
-
halfSizes: THREE.Vector3;
|
|
545
|
-
rotation: THREE.Matrix3;
|
|
546
|
-
transformation: THREE.Matrix4;
|
|
547
|
-
};
|
|
548
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
549
|
-
import * as THREE from "three";
|
|
550
|
-
export declare class MaterialsUtils {
|
|
551
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
552
|
-
}
|
|
553
|
-
import * as THREE from "three";
|
|
554
|
-
export interface MeasureEdge {
|
|
555
|
-
distance: number;
|
|
556
|
-
points: THREE.Vector3[];
|
|
557
|
-
}
|
|
558
|
-
export declare class MeasurementUtils {
|
|
559
|
-
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
560
|
-
edges: MeasureEdge[];
|
|
561
|
-
indices: Set<number>;
|
|
562
|
-
} | null;
|
|
563
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
564
|
-
private static getFaceData;
|
|
565
|
-
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
566
|
-
p1: THREE.Vector3;
|
|
567
|
-
p2: THREE.Vector3;
|
|
568
|
-
p3: THREE.Vector3;
|
|
569
|
-
faceNormal: THREE.Vector3;
|
|
570
|
-
};
|
|
571
|
-
private static round;
|
|
572
|
-
}
|
|
573
|
-
export declare class UUID {
|
|
574
|
-
private static _pattern;
|
|
575
|
-
private static _lut;
|
|
576
|
-
static create(): string;
|
|
577
|
-
static validate(uuid: string): void;
|
|
578
|
-
}
|
|
579
|
-
import * as THREE from "three";
|
|
580
|
-
import { Component, Components, Event, World, Disposable } from "../core";
|
|
581
|
-
export interface VertexPickerConfig {
|
|
582
|
-
showOnlyVertex: boolean;
|
|
583
|
-
snapDistance: number;
|
|
584
|
-
previewElement: HTMLElement;
|
|
585
|
-
}
|
|
586
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
587
|
-
onVertexFound: Event<THREE.Vector3>;
|
|
588
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
589
|
-
components: Components;
|
|
590
|
-
private _pickedPoint;
|
|
591
|
-
private _config;
|
|
592
|
-
private _enabled;
|
|
593
|
-
private _workingPlane;
|
|
594
|
-
/** {@link Disposable.onDisposed} */
|
|
595
|
-
readonly onDisposed: Event<unknown>;
|
|
596
|
-
set enabled(value: boolean);
|
|
597
|
-
get enabled(): boolean;
|
|
598
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
599
|
-
[Symbol.dispose](): void;
|
|
600
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
601
|
-
get workingPlane(): THREE.Plane | null;
|
|
602
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
603
|
-
get config(): Partial<VertexPickerConfig>;
|
|
604
|
-
dispose(): void;
|
|
605
|
-
get(world: World): THREE.Vector3 | null;
|
|
606
|
-
private getClosestVertex;
|
|
607
|
-
private getVertices;
|
|
608
|
-
private getVertex;
|
|
609
|
-
}
|
|
610
|
-
import * as FRAGS from "bim-fragment";
|
|
611
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
585
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
586
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
612
587
|
import { Disposable, Event, Component, Components } from "../../core";
|
|
613
588
|
import { QueryGroup } from "./src/types";
|
|
614
589
|
export interface QueryResult {
|
|
@@ -645,100 +620,7 @@ export declare class IfcPropertiesFinder extends Component implements Disposable
|
|
|
645
620
|
private getConditionFunctions;
|
|
646
621
|
}
|
|
647
622
|
import * as WEBIFC from "web-ifc";
|
|
648
|
-
import
|
|
649
|
-
/**
|
|
650
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
651
|
-
*/
|
|
652
|
-
export declare class IfcJsonExporter {
|
|
653
|
-
/**
|
|
654
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
655
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
656
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
657
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
658
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
659
|
-
* to make the location data available (e.g. absolute position of building).
|
|
660
|
-
*/
|
|
661
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
662
|
-
}
|
|
663
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
664
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
665
|
-
interface RelationMap {
|
|
666
|
-
[modelID: string]: Map<number, Map<number, number[]>>;
|
|
667
|
-
}
|
|
668
|
-
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
669
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
670
|
-
/** {@link Disposable.onDisposed} */
|
|
671
|
-
readonly onDisposed: Event<string>;
|
|
672
|
-
enabled: boolean;
|
|
673
|
-
/**
|
|
674
|
-
* All the inverse attributes this component can processes.
|
|
675
|
-
*/
|
|
676
|
-
readonly inverseAttributes: string[];
|
|
677
|
-
inverseAttributesToProcess: string[];
|
|
678
|
-
private _relToAttributesMap;
|
|
679
|
-
readonly relationMaps: RelationMap;
|
|
680
|
-
constructor(components: Components);
|
|
681
|
-
private onFragmentsDisposed;
|
|
682
|
-
private getAttributeRels;
|
|
683
|
-
private setRelMap;
|
|
684
|
-
/**
|
|
685
|
-
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
686
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
687
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
688
|
-
*
|
|
689
|
-
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
690
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
691
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
692
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
693
|
-
* of entities that are related through that attribute.
|
|
694
|
-
*
|
|
695
|
-
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
696
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
697
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
698
|
-
* @throws An error if the model does not have properties loaded.
|
|
699
|
-
*/
|
|
700
|
-
process(model: FragmentsGroup): Promise<Map<number, Map<number, number[]>>>;
|
|
701
|
-
/**
|
|
702
|
-
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
703
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
704
|
-
* returning the IDs of related entities if a match is found.
|
|
705
|
-
*
|
|
706
|
-
* @param model The 'FragmentsGroup' model containing the entity.
|
|
707
|
-
* @param expressID The unique identifier of the entity within the model.
|
|
708
|
-
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
709
|
-
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
710
|
-
* or the specified relation name is not indexed.
|
|
711
|
-
*/
|
|
712
|
-
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: string): number[] | null;
|
|
713
|
-
/**
|
|
714
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
715
|
-
* This method iterates through the relations indexed for the given model,
|
|
716
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
717
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
718
|
-
* The resulting object is then serialized into a JSON string.
|
|
719
|
-
*
|
|
720
|
-
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
721
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
722
|
-
* If the model has no indexed relations, 'null' is returned.
|
|
723
|
-
*/
|
|
724
|
-
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
725
|
-
/**
|
|
726
|
-
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
727
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
728
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
729
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
730
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
731
|
-
*
|
|
732
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
733
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
734
|
-
*/
|
|
735
|
-
serializeRelations(): string;
|
|
736
|
-
getRelationsMapFromJSON(json: string): Map<number, Map<number, number[]>>;
|
|
737
|
-
dispose(): void;
|
|
738
|
-
}
|
|
739
|
-
export {};
|
|
740
|
-
import * as WEBIFC from "web-ifc";
|
|
741
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
623
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
742
624
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
743
625
|
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
744
626
|
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
@@ -789,7 +671,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
789
671
|
get(): ChangeMap;
|
|
790
672
|
dispose(): void;
|
|
791
673
|
private increaseMaxID;
|
|
792
|
-
static getIFCSchema(model: FragmentsGroup): import("
|
|
674
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
793
675
|
private newGUID;
|
|
794
676
|
private getOwnerHistory;
|
|
795
677
|
private registerChange;
|
|
@@ -810,6 +692,86 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
810
692
|
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
811
693
|
}
|
|
812
694
|
export {};
|
|
695
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
696
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
697
|
+
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
698
|
+
interface IndexMap {
|
|
699
|
+
[modelID: string]: {
|
|
700
|
+
[expressID: string]: Set<number>;
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
704
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
705
|
+
/** {@link Disposable.onDisposed} */
|
|
706
|
+
readonly onDisposed: Event<string>;
|
|
707
|
+
enabled: boolean;
|
|
708
|
+
relationsToProcess: number[];
|
|
709
|
+
indexMap: IndexMap;
|
|
710
|
+
private _propertiesManager;
|
|
711
|
+
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
712
|
+
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
713
|
+
get propertiesManager(): IfcPropertiesManager | null;
|
|
714
|
+
constructor(components: Components);
|
|
715
|
+
private onFragmentsDisposed;
|
|
716
|
+
dispose(): Promise<void>;
|
|
717
|
+
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
718
|
+
private getNestedPsets;
|
|
719
|
+
private getPsetProperties;
|
|
720
|
+
process(model: FragmentsGroup): Promise<void>;
|
|
721
|
+
private setEntityIndex;
|
|
722
|
+
private cloneProperty;
|
|
723
|
+
private clonePropertyArray;
|
|
724
|
+
}
|
|
725
|
+
export {};
|
|
726
|
+
import * as THREE from "three";
|
|
727
|
+
export declare class MaterialsUtils {
|
|
728
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
729
|
+
}
|
|
730
|
+
export declare class UUID {
|
|
731
|
+
private static _pattern;
|
|
732
|
+
private static _lut;
|
|
733
|
+
static create(): string;
|
|
734
|
+
static validate(uuid: string): void;
|
|
735
|
+
}
|
|
736
|
+
import * as THREE from "three";
|
|
737
|
+
import { Component, Components, Event, World, Disposable } from "../core";
|
|
738
|
+
export interface VertexPickerConfig {
|
|
739
|
+
showOnlyVertex: boolean;
|
|
740
|
+
snapDistance: number;
|
|
741
|
+
previewElement: HTMLElement;
|
|
742
|
+
}
|
|
743
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
744
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
745
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
746
|
+
components: Components;
|
|
747
|
+
private _pickedPoint;
|
|
748
|
+
private _config;
|
|
749
|
+
private _enabled;
|
|
750
|
+
private _workingPlane;
|
|
751
|
+
/** {@link Disposable.onDisposed} */
|
|
752
|
+
readonly onDisposed: Event<unknown>;
|
|
753
|
+
set enabled(value: boolean);
|
|
754
|
+
get enabled(): boolean;
|
|
755
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
756
|
+
[Symbol.dispose](): void;
|
|
757
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
758
|
+
get workingPlane(): THREE.Plane | null;
|
|
759
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
760
|
+
get config(): Partial<VertexPickerConfig>;
|
|
761
|
+
dispose(): void;
|
|
762
|
+
get(world: World): THREE.Vector3 | null;
|
|
763
|
+
private getClosestVertex;
|
|
764
|
+
private getVertices;
|
|
765
|
+
private getVertex;
|
|
766
|
+
}
|
|
767
|
+
import * as WEBIFC from "web-ifc";
|
|
768
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
769
|
+
export declare class SpatialStructure {
|
|
770
|
+
itemsByFloor: IfcItemsCategories;
|
|
771
|
+
private _units;
|
|
772
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
773
|
+
cleanUp(): void;
|
|
774
|
+
}
|
|
813
775
|
import * as WEBIFC from "web-ifc";
|
|
814
776
|
export interface IfcItemsCategories {
|
|
815
777
|
[itemID: number]: number;
|
|
@@ -820,10 +782,11 @@ export declare class IfcCategories {
|
|
|
820
782
|
export declare const IfcElements: {
|
|
821
783
|
[key: number]: string;
|
|
822
784
|
};
|
|
785
|
+
export declare const GeometryTypes: Set<number>;
|
|
823
786
|
export declare const IfcCategoryMap: {
|
|
824
787
|
[key: number]: string;
|
|
825
788
|
};
|
|
826
|
-
import * as FRAGS from "
|
|
789
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
827
790
|
export declare class IfcPropertiesUtils {
|
|
828
791
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
829
792
|
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
@@ -848,99 +811,364 @@ export declare class IfcPropertiesUtils {
|
|
|
848
811
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
849
812
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
850
813
|
}
|
|
851
|
-
export declare const GeometryTypes: Set<number>;
|
|
852
814
|
import * as THREE from "three";
|
|
853
|
-
import
|
|
854
|
-
import { Event } from "./event";
|
|
815
|
+
import { Disposable, Event } from "../../Types";
|
|
855
816
|
/**
|
|
856
|
-
*
|
|
857
|
-
*
|
|
858
|
-
* [
|
|
859
|
-
*
|
|
860
|
-
* cleaned up.
|
|
817
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
818
|
+
* to work with tools like the
|
|
819
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
820
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
861
821
|
*/
|
|
862
|
-
export
|
|
822
|
+
export declare class Mouse implements Disposable {
|
|
823
|
+
dom: HTMLCanvasElement;
|
|
824
|
+
private _event?;
|
|
825
|
+
private _position;
|
|
826
|
+
/** {@link Disposable.onDisposed} */
|
|
827
|
+
readonly onDisposed: Event<unknown>;
|
|
828
|
+
constructor(dom: HTMLCanvasElement);
|
|
863
829
|
/**
|
|
864
|
-
*
|
|
865
|
-
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
830
|
+
* The real position of the mouse of the Three.js canvas.
|
|
866
831
|
*/
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
|
|
832
|
+
get position(): THREE.Vector2;
|
|
833
|
+
/** {@link Disposable.dispose} */
|
|
834
|
+
dispose(): void;
|
|
835
|
+
private getPositionY;
|
|
836
|
+
private getPositionX;
|
|
837
|
+
private updateMouseInfo;
|
|
838
|
+
private setupEvents;
|
|
870
839
|
}
|
|
840
|
+
import * as THREE from "three";
|
|
841
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
842
|
+
import { Components } from "../../Components";
|
|
871
843
|
/**
|
|
872
|
-
*
|
|
873
|
-
*
|
|
874
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
844
|
+
* A basic renderer capable of rendering
|
|
845
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
875
846
|
*/
|
|
876
|
-
export
|
|
847
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
848
|
+
/** {@link Component.enabled} */
|
|
849
|
+
enabled: boolean;
|
|
850
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
851
|
+
container: HTMLElement | null;
|
|
852
|
+
three: THREE.WebGLRenderer;
|
|
853
|
+
protected _canvas: HTMLCanvasElement;
|
|
854
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
855
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
856
|
+
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
857
|
+
/** {@link Updateable.update} */
|
|
858
|
+
update(): void;
|
|
859
|
+
/** {@link Disposable.dispose} */
|
|
860
|
+
dispose(): void;
|
|
861
|
+
/** {@link Resizeable.getSize}. */
|
|
862
|
+
getSize(): THREE.Vector2;
|
|
863
|
+
/** {@link Resizeable.resize} */
|
|
864
|
+
resize: (size?: THREE.Vector2) => void;
|
|
865
|
+
setupEvents(active: boolean): void;
|
|
866
|
+
private resizeEvent;
|
|
867
|
+
private setupRenderer;
|
|
868
|
+
private onContextLost;
|
|
869
|
+
private onContextBack;
|
|
870
|
+
private updateContainer;
|
|
871
|
+
}
|
|
872
|
+
import * as THREE from "three";
|
|
873
|
+
import { Components } from "../../Components";
|
|
874
|
+
import { Event, World, Disposable } from "../../Types";
|
|
875
|
+
import { Mouse } from "./mouse";
|
|
876
|
+
/**
|
|
877
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
878
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
879
|
+
* events.
|
|
880
|
+
*/
|
|
881
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
882
|
+
/** {@link Component.enabled} */
|
|
883
|
+
enabled: boolean;
|
|
884
|
+
components: Components;
|
|
885
|
+
/** {@link Disposable.onDisposed} */
|
|
886
|
+
readonly onDisposed: Event<unknown>;
|
|
887
|
+
/** The position of the mouse in the screen. */
|
|
888
|
+
readonly mouse: Mouse;
|
|
889
|
+
readonly three: THREE.Raycaster;
|
|
890
|
+
world: World;
|
|
891
|
+
constructor(components: Components, world: World);
|
|
892
|
+
/** {@link Disposable.dispose} */
|
|
893
|
+
dispose(): void;
|
|
877
894
|
/**
|
|
878
|
-
*
|
|
879
|
-
*
|
|
880
|
-
*
|
|
895
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
896
|
+
* the first item found. This also takes into account the clipping planes
|
|
897
|
+
* used by the renderer.
|
|
898
|
+
*
|
|
899
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
900
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
901
|
+
* {@link Components.meshes}.
|
|
881
902
|
*/
|
|
882
|
-
|
|
903
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
904
|
+
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;
|
|
905
|
+
private intersect;
|
|
906
|
+
private filterClippingPlanes;
|
|
907
|
+
}
|
|
908
|
+
import * as THREE from "three";
|
|
909
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
910
|
+
import { Components } from "../../Components";
|
|
911
|
+
export interface SimpleSceneConfig {
|
|
912
|
+
directionalLight: {
|
|
913
|
+
color: THREE.Color;
|
|
914
|
+
intensity: number;
|
|
915
|
+
position: THREE.Vector3;
|
|
916
|
+
};
|
|
917
|
+
ambientLight: {
|
|
918
|
+
color: THREE.Color;
|
|
919
|
+
intensity: number;
|
|
920
|
+
};
|
|
883
921
|
}
|
|
884
922
|
/**
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
* component could mean changing its resolution, whereas resizing a
|
|
889
|
-
* [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
923
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
924
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
925
|
+
* @noInheritDoc
|
|
890
926
|
*/
|
|
891
|
-
export
|
|
927
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
928
|
+
/** {@link Configurable.isSetup} */
|
|
929
|
+
isSetup: boolean;
|
|
930
|
+
three: THREE.Scene;
|
|
931
|
+
/** {@link Configurable.onSetup} */
|
|
932
|
+
readonly onSetup: Event<SimpleScene>;
|
|
933
|
+
config: Required<SimpleSceneConfig>;
|
|
934
|
+
constructor(components: Components);
|
|
935
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
936
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
937
|
+
}
|
|
938
|
+
/// <reference types="node" />
|
|
939
|
+
import * as THREE from "three";
|
|
940
|
+
import { Hideable, Event, World } from "../../Types";
|
|
941
|
+
import { Components } from "../../Components";
|
|
942
|
+
export interface GridConfig {
|
|
943
|
+
color: THREE.Color;
|
|
944
|
+
size1: number;
|
|
945
|
+
size2: number;
|
|
946
|
+
distance: number;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* An infinite grid. Created by
|
|
950
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
951
|
+
* and translated to typescript by
|
|
952
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
953
|
+
*/
|
|
954
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
955
|
+
/** {@link Disposable.onDisposed} */
|
|
956
|
+
readonly onDisposed: Event<unknown>;
|
|
957
|
+
world: World;
|
|
958
|
+
components: Components;
|
|
959
|
+
/** {@link Hideable.visible} */
|
|
960
|
+
get visible(): boolean;
|
|
961
|
+
/** {@link Hideable.visible} */
|
|
962
|
+
set visible(visible: boolean);
|
|
963
|
+
/** The material of the grid. */
|
|
964
|
+
get material(): THREE.ShaderMaterial;
|
|
892
965
|
/**
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* component.
|
|
966
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
967
|
+
* perspective cameras and false for orthographic cameras.
|
|
896
968
|
*/
|
|
897
|
-
|
|
898
|
-
/** Event that fires when the component has been resized. */
|
|
899
|
-
onResize: Event<THREE.Vector2>;
|
|
969
|
+
get fade(): boolean;
|
|
900
970
|
/**
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
* component.
|
|
971
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
972
|
+
* perspective cameras and false for orthographic cameras.
|
|
904
973
|
*/
|
|
905
|
-
|
|
974
|
+
set fade(active: boolean);
|
|
975
|
+
private readonly _grid;
|
|
976
|
+
private _fade;
|
|
977
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
978
|
+
[Symbol.dispose](): void;
|
|
979
|
+
/** {@link Component.get} */
|
|
980
|
+
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
981
|
+
/** {@link Disposable.dispose} */
|
|
982
|
+
dispose(): void;
|
|
983
|
+
private setupEvents;
|
|
984
|
+
private updateZoom;
|
|
906
985
|
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
/** Actions that should be executed before updating the component. */
|
|
912
|
-
onBeforeUpdate: Event<any>;
|
|
986
|
+
import * as THREE from "three";
|
|
987
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
988
|
+
import { Components } from "../../Components";
|
|
989
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
913
990
|
/**
|
|
914
|
-
*
|
|
915
|
-
* instance, a renderer component will make a render each frame.
|
|
991
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
916
992
|
*/
|
|
993
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
994
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
995
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
996
|
+
enabled: boolean;
|
|
997
|
+
uuid: string;
|
|
998
|
+
readonly onDisposed: Event<unknown>;
|
|
999
|
+
private _scene?;
|
|
1000
|
+
private _camera?;
|
|
1001
|
+
private _renderer;
|
|
1002
|
+
get scene(): T;
|
|
1003
|
+
set scene(scene: T);
|
|
1004
|
+
get camera(): U;
|
|
1005
|
+
set camera(camera: U);
|
|
1006
|
+
get renderer(): S | null;
|
|
1007
|
+
set renderer(renderer: S | null);
|
|
1008
|
+
constructor(components: Components);
|
|
917
1009
|
update(delta?: number): void;
|
|
918
|
-
|
|
919
|
-
/** Basic type to describe the progress of any kind of process. */
|
|
920
|
-
export interface Progress {
|
|
921
|
-
/** The amount of things that have been done already. */
|
|
922
|
-
current: number;
|
|
923
|
-
/** The total amount of things to be done by the process. */
|
|
924
|
-
total: number;
|
|
1010
|
+
dispose(disposeResources?: boolean): void;
|
|
925
1011
|
}
|
|
926
1012
|
/**
|
|
927
|
-
*
|
|
928
|
-
*
|
|
929
|
-
*
|
|
1013
|
+
* Simple event handler by
|
|
1014
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1015
|
+
* Keep in mind that:
|
|
1016
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
1017
|
+
* an object.
|
|
1018
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1019
|
+
* the callback as an arrow function.
|
|
930
1020
|
*/
|
|
931
|
-
export
|
|
932
|
-
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
933
|
-
create: (data: any) => void;
|
|
1021
|
+
export declare class Event<T> {
|
|
934
1022
|
/**
|
|
935
|
-
*
|
|
936
|
-
*
|
|
1023
|
+
* Add a callback to this event instance.
|
|
1024
|
+
* @param handler - the callback to be added to this event.
|
|
937
1025
|
*/
|
|
938
|
-
|
|
1026
|
+
add(handler: T extends void ? {
|
|
1027
|
+
(): void;
|
|
1028
|
+
} : {
|
|
1029
|
+
(data: T): void;
|
|
1030
|
+
}): void;
|
|
939
1031
|
/**
|
|
940
|
-
*
|
|
941
|
-
*
|
|
1032
|
+
* Removes a callback from this event instance.
|
|
1033
|
+
* @param handler - the callback to be removed from this event.
|
|
942
1034
|
*/
|
|
943
|
-
|
|
1035
|
+
remove(handler: T extends void ? {
|
|
1036
|
+
(): void;
|
|
1037
|
+
} : {
|
|
1038
|
+
(data: T): void;
|
|
1039
|
+
}): void;
|
|
1040
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1041
|
+
trigger: (data?: T) => void;
|
|
1042
|
+
/** Gets rid of all the suscribed events. */
|
|
1043
|
+
reset(): void;
|
|
1044
|
+
private handlers;
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Simple event handler by
|
|
1048
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1049
|
+
* Keep in mind that:
|
|
1050
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
1051
|
+
* an object.
|
|
1052
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1053
|
+
* the callback as an arrow function.
|
|
1054
|
+
*/
|
|
1055
|
+
export declare class AsyncEvent<T> {
|
|
1056
|
+
/**
|
|
1057
|
+
* Add a callback to this event instance.
|
|
1058
|
+
* @param handler - the callback to be added to this event.
|
|
1059
|
+
*/
|
|
1060
|
+
add(handler: T extends void ? {
|
|
1061
|
+
(): Promise<void>;
|
|
1062
|
+
} : {
|
|
1063
|
+
(data: T): Promise<void>;
|
|
1064
|
+
}): void;
|
|
1065
|
+
/**
|
|
1066
|
+
* Removes a callback from this event instance.
|
|
1067
|
+
* @param handler - the callback to be removed from this event.
|
|
1068
|
+
*/
|
|
1069
|
+
remove(handler: T extends void ? {
|
|
1070
|
+
(): Promise<void>;
|
|
1071
|
+
} : {
|
|
1072
|
+
(data: T): Promise<void>;
|
|
1073
|
+
}): void;
|
|
1074
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1075
|
+
trigger: (data?: T) => Promise<void>;
|
|
1076
|
+
/** Gets rid of all the suscribed events. */
|
|
1077
|
+
reset(): void;
|
|
1078
|
+
private handlers;
|
|
1079
|
+
}
|
|
1080
|
+
import * as THREE from "three";
|
|
1081
|
+
import CameraControls from "camera-controls";
|
|
1082
|
+
import { Event } from "./event";
|
|
1083
|
+
/**
|
|
1084
|
+
* Whether this component has to be manually destroyed once you are done with
|
|
1085
|
+
* it to prevent
|
|
1086
|
+
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1087
|
+
* This also ensures that the DOM events created by that component will be
|
|
1088
|
+
* cleaned up.
|
|
1089
|
+
*/
|
|
1090
|
+
export interface Disposable {
|
|
1091
|
+
/**
|
|
1092
|
+
* Destroys the object from memory to prevent a
|
|
1093
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1094
|
+
*/
|
|
1095
|
+
dispose: () => void | Promise<void>;
|
|
1096
|
+
/** Fired after the tool has been {@link Disposable.dispose()} */
|
|
1097
|
+
readonly onDisposed: Event<any>;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Whether the geometric representation of this component can be
|
|
1101
|
+
* hidden or shown in the
|
|
1102
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1103
|
+
*/
|
|
1104
|
+
export interface Hideable {
|
|
1105
|
+
/**
|
|
1106
|
+
* Whether the geometric representation of this component is
|
|
1107
|
+
* currently visible or not in the
|
|
1108
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1109
|
+
*/
|
|
1110
|
+
visible: boolean;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Whether this component can be resized. The meaning of this can vary depending
|
|
1114
|
+
* on the component: resizing a
|
|
1115
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1116
|
+
* component could mean changing its resolution, whereas resizing a
|
|
1117
|
+
* [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
1118
|
+
*/
|
|
1119
|
+
export interface Resizeable {
|
|
1120
|
+
/**
|
|
1121
|
+
* Sets size of this component (e.g. the resolution of a
|
|
1122
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1123
|
+
* component.
|
|
1124
|
+
*/
|
|
1125
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1126
|
+
/** Event that fires when the component has been resized. */
|
|
1127
|
+
onResize: Event<THREE.Vector2>;
|
|
1128
|
+
/**
|
|
1129
|
+
* Gets the current size of this component (e.g. the resolution of a
|
|
1130
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1131
|
+
* component.
|
|
1132
|
+
*/
|
|
1133
|
+
getSize: () => THREE.Vector2;
|
|
1134
|
+
}
|
|
1135
|
+
/** Whether this component should be updated each frame. */
|
|
1136
|
+
export interface Updateable {
|
|
1137
|
+
/** Actions that should be executed after updating the component. */
|
|
1138
|
+
onAfterUpdate: Event<any>;
|
|
1139
|
+
/** Actions that should be executed before updating the component. */
|
|
1140
|
+
onBeforeUpdate: Event<any>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Function used to update the state of this component each frame. For
|
|
1143
|
+
* instance, a renderer component will make a render each frame.
|
|
1144
|
+
*/
|
|
1145
|
+
update(delta?: number): void;
|
|
1146
|
+
}
|
|
1147
|
+
/** Basic type to describe the progress of any kind of process. */
|
|
1148
|
+
export interface Progress {
|
|
1149
|
+
/** The amount of things that have been done already. */
|
|
1150
|
+
current: number;
|
|
1151
|
+
/** The total amount of things to be done by the process. */
|
|
1152
|
+
total: number;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Whether this component supports create and destroy operations. This generally
|
|
1156
|
+
* applies for components that work with instances, such as clipping planes or
|
|
1157
|
+
* dimensions.
|
|
1158
|
+
*/
|
|
1159
|
+
export interface Createable {
|
|
1160
|
+
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
1161
|
+
create: (data: any) => void;
|
|
1162
|
+
/**
|
|
1163
|
+
* Finish the creation process of the component, successfully creating an
|
|
1164
|
+
* instance of whatever the component creates.
|
|
1165
|
+
*/
|
|
1166
|
+
endCreation?: (data: any) => void;
|
|
1167
|
+
/**
|
|
1168
|
+
* Cancels the creation process of the component, going back to the state
|
|
1169
|
+
* before starting to create.
|
|
1170
|
+
*/
|
|
1171
|
+
cancelCreation?: (data: any) => void;
|
|
944
1172
|
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
945
1173
|
delete: (data: any) => void;
|
|
946
1174
|
}
|
|
@@ -972,40 +1200,6 @@ export interface BVHGeometry extends THREE.BufferGeometry {
|
|
|
972
1200
|
export interface CameraControllable {
|
|
973
1201
|
controls: CameraControls;
|
|
974
1202
|
}
|
|
975
|
-
/**
|
|
976
|
-
* Simple event handler by
|
|
977
|
-
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
978
|
-
* Keep in mind that:
|
|
979
|
-
* - If you want to remove it later, you might want to declare the callback as
|
|
980
|
-
* an object.
|
|
981
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
982
|
-
* the callback as an arrow function.
|
|
983
|
-
*/
|
|
984
|
-
export declare class Event<T> {
|
|
985
|
-
/**
|
|
986
|
-
* Add a callback to this event instance.
|
|
987
|
-
* @param handler - the callback to be added to this event.
|
|
988
|
-
*/
|
|
989
|
-
add(handler: T extends void ? {
|
|
990
|
-
(): void;
|
|
991
|
-
} : {
|
|
992
|
-
(data: T): void;
|
|
993
|
-
}): void;
|
|
994
|
-
/**
|
|
995
|
-
* Removes a callback from this event instance.
|
|
996
|
-
* @param handler - the callback to be removed from this event.
|
|
997
|
-
*/
|
|
998
|
-
remove(handler: T extends void ? {
|
|
999
|
-
(): void;
|
|
1000
|
-
} : {
|
|
1001
|
-
(data: T): void;
|
|
1002
|
-
}): void;
|
|
1003
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
1004
|
-
trigger: (data?: T) => void;
|
|
1005
|
-
/** Gets rid of all the suscribed events. */
|
|
1006
|
-
reset(): void;
|
|
1007
|
-
private handlers;
|
|
1008
|
-
}
|
|
1009
1203
|
import { Base } from "./base";
|
|
1010
1204
|
/**
|
|
1011
1205
|
* Components are the building blocks of this library. Components are singleton
|
|
@@ -1024,90 +1218,68 @@ export declare abstract class Component extends Base {
|
|
|
1024
1218
|
*/
|
|
1025
1219
|
abstract enabled: boolean;
|
|
1026
1220
|
}
|
|
1027
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1028
|
-
import { Components } from "../../Components";
|
|
1029
|
-
/**
|
|
1030
|
-
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1031
|
-
*/
|
|
1032
|
-
export declare abstract class Base {
|
|
1033
|
-
components: Components;
|
|
1034
|
-
constructor(components: Components);
|
|
1035
|
-
/** Whether is component is {@link Disposable}. */
|
|
1036
|
-
isDisposeable: () => this is Disposable;
|
|
1037
|
-
/** Whether is component is {@link Resizeable}. */
|
|
1038
|
-
isResizeable: () => this is Resizeable;
|
|
1039
|
-
/** Whether is component is {@link Updateable}. */
|
|
1040
|
-
isUpdateable: () => this is Updateable;
|
|
1041
|
-
/** Whether is component is {@link Hideable}. */
|
|
1042
|
-
isHideable: () => this is Hideable;
|
|
1043
|
-
/** Whether is component is {@link Configurable}. */
|
|
1044
|
-
isConfigurable: () => this is Configurable<any>;
|
|
1045
|
-
}
|
|
1046
|
-
import { Base } from "./base";
|
|
1047
|
-
import { World } from "./world";
|
|
1048
|
-
import { Event } from "./event";
|
|
1049
|
-
import { Components } from "../../Components";
|
|
1050
|
-
/**
|
|
1051
|
-
* One of the elements that make a world. It can be either a scene, a camera
|
|
1052
|
-
* or a renderer.
|
|
1053
|
-
*/
|
|
1054
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
1055
|
-
readonly worlds: Map<string, World>;
|
|
1056
|
-
readonly onWorldChanged: Event<{
|
|
1057
|
-
world: World;
|
|
1058
|
-
action: "added" | "removed";
|
|
1059
|
-
}>;
|
|
1060
|
-
currentWorld: World | null;
|
|
1061
|
-
protected constructor(components: Components);
|
|
1062
|
-
}
|
|
1063
|
-
import * as WEBIFC from "web-ifc";
|
|
1064
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
1065
|
-
export declare class SpatialStructure {
|
|
1066
|
-
itemsByFloor: IfcItemsCategories;
|
|
1067
|
-
private _units;
|
|
1068
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1069
|
-
cleanUp(): void;
|
|
1070
|
-
}
|
|
1071
1221
|
import * as THREE from "three";
|
|
1072
1222
|
import CameraControls from "camera-controls";
|
|
1073
|
-
import {
|
|
1074
|
-
import { CameraControllable } from "./interfaces";
|
|
1075
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1076
|
-
abstract enabled: boolean;
|
|
1077
|
-
abstract three: THREE.Camera;
|
|
1078
|
-
abstract controls?: CameraControls;
|
|
1079
|
-
/** Whether is instance is {@link CameraControllable}. */
|
|
1080
|
-
hasCameraControls: () => this is CameraControllable;
|
|
1081
|
-
}
|
|
1082
|
-
import * as THREE from "three";
|
|
1083
|
-
import { Disposable } from "./interfaces";
|
|
1084
|
-
import { Event } from "./event";
|
|
1223
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1085
1224
|
import { Components } from "../../Components";
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
dispose(): void;
|
|
1094
|
-
}
|
|
1095
|
-
import * as THREE from "three";
|
|
1096
|
-
import { Vector2 } from "three";
|
|
1097
|
-
import { Event } from "./event";
|
|
1098
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
1099
|
-
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1100
|
-
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1101
|
-
abstract three: THREE.WebGLRenderer;
|
|
1225
|
+
/**
|
|
1226
|
+
* A basic camera that uses
|
|
1227
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1228
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1229
|
+
* what features it offers.
|
|
1230
|
+
*/
|
|
1231
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1102
1232
|
/** {@link Updateable.onBeforeUpdate} */
|
|
1103
|
-
|
|
1233
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1104
1234
|
/** {@link Updateable.onAfterUpdate} */
|
|
1105
|
-
|
|
1235
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1236
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1106
1237
|
/** {@link Disposable.onDisposed} */
|
|
1107
|
-
readonly onDisposed: Event<
|
|
1108
|
-
readonly
|
|
1238
|
+
readonly onDisposed: Event<string>;
|
|
1239
|
+
readonly three: THREE.PerspectiveCamera;
|
|
1240
|
+
private _allControls;
|
|
1109
1241
|
/**
|
|
1110
|
-
*
|
|
1242
|
+
* The object that controls the camera. An instance of
|
|
1243
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1244
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1245
|
+
* object to move, rotate, look at objects, etc.
|
|
1246
|
+
*/
|
|
1247
|
+
get controls(): CameraControls;
|
|
1248
|
+
/** {@link Component.enabled} */
|
|
1249
|
+
get enabled(): boolean;
|
|
1250
|
+
/** {@link Component.enabled} */
|
|
1251
|
+
set enabled(enabled: boolean);
|
|
1252
|
+
constructor(components: Components);
|
|
1253
|
+
/** {@link Disposable.dispose} */
|
|
1254
|
+
dispose(): void;
|
|
1255
|
+
/** {@link Updateable.update} */
|
|
1256
|
+
update(_delta: number): void;
|
|
1257
|
+
/**
|
|
1258
|
+
* Updates the aspect of the camera to match the size of the
|
|
1259
|
+
* {@link Components.renderer}.
|
|
1260
|
+
*/
|
|
1261
|
+
updateAspect: () => void;
|
|
1262
|
+
private setupCamera;
|
|
1263
|
+
private newCameraControls;
|
|
1264
|
+
private setupEvents;
|
|
1265
|
+
private static getSubsetOfThree;
|
|
1266
|
+
}
|
|
1267
|
+
import * as THREE from "three";
|
|
1268
|
+
import { Vector2 } from "three";
|
|
1269
|
+
import { Event } from "./event";
|
|
1270
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1271
|
+
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1272
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1273
|
+
abstract three: THREE.WebGLRenderer;
|
|
1274
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1275
|
+
onAfterUpdate: Event<unknown>;
|
|
1276
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1277
|
+
onBeforeUpdate: Event<unknown>;
|
|
1278
|
+
/** {@link Disposable.onDisposed} */
|
|
1279
|
+
readonly onDisposed: Event<undefined>;
|
|
1280
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Event that fires when there has been a change to the list of clipping
|
|
1111
1283
|
* planes used by the active renderer.
|
|
1112
1284
|
*/
|
|
1113
1285
|
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
@@ -1133,6 +1305,34 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
1133
1305
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1134
1306
|
}
|
|
1135
1307
|
import * as THREE from "three";
|
|
1308
|
+
import CameraControls from "camera-controls";
|
|
1309
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1310
|
+
import { CameraControllable } from "./interfaces";
|
|
1311
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1312
|
+
abstract enabled: boolean;
|
|
1313
|
+
abstract three: THREE.Camera;
|
|
1314
|
+
abstract controls?: CameraControls;
|
|
1315
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1316
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1317
|
+
}
|
|
1318
|
+
import { Base } from "./base";
|
|
1319
|
+
import { World } from "./world";
|
|
1320
|
+
import { Event } from "./event";
|
|
1321
|
+
import { Components } from "../../Components";
|
|
1322
|
+
/**
|
|
1323
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
1324
|
+
* or a renderer.
|
|
1325
|
+
*/
|
|
1326
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1327
|
+
readonly worlds: Map<string, World>;
|
|
1328
|
+
readonly onWorldChanged: Event<{
|
|
1329
|
+
world: World;
|
|
1330
|
+
action: "added" | "removed";
|
|
1331
|
+
}>;
|
|
1332
|
+
currentWorld: World | null;
|
|
1333
|
+
protected constructor(components: Components);
|
|
1334
|
+
}
|
|
1335
|
+
import * as THREE from "three";
|
|
1136
1336
|
import { BaseScene } from "./base-scene";
|
|
1137
1337
|
import { BaseCamera } from "./base-camera";
|
|
1138
1338
|
import { BaseRenderer } from "./base-renderer";
|
|
@@ -1142,531 +1342,228 @@ export interface World extends Disposable, Updateable {
|
|
|
1142
1342
|
scene: BaseScene;
|
|
1143
1343
|
camera: BaseCamera;
|
|
1144
1344
|
renderer: BaseRenderer | null;
|
|
1145
|
-
uuid: string;
|
|
1146
|
-
}
|
|
1147
|
-
import * as THREE from "three";
|
|
1148
|
-
import { Components } from "../../Components";
|
|
1149
|
-
import { Event, World } from "../../Types";
|
|
1150
|
-
export interface CullerRendererSettings {
|
|
1151
|
-
updateInterval?: number;
|
|
1152
|
-
width?: number;
|
|
1153
|
-
height?: number;
|
|
1154
|
-
autoUpdate?: boolean;
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* A base renderer to determine visibility on screen
|
|
1158
|
-
*/
|
|
1159
|
-
export declare class CullerRenderer {
|
|
1160
|
-
/** {@link Disposable.onDisposed} */
|
|
1161
|
-
readonly onDisposed: Event<string>;
|
|
1162
|
-
/**
|
|
1163
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
1164
|
-
* meshes that are currently visible, and the ones that were visible
|
|
1165
|
-
* just before but not anymore.
|
|
1166
|
-
*/
|
|
1167
|
-
readonly onViewUpdated: Event<any>;
|
|
1168
|
-
/** {@link Component.enabled} */
|
|
1169
|
-
enabled: boolean;
|
|
1170
|
-
/**
|
|
1171
|
-
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1172
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1173
|
-
*/
|
|
1174
|
-
needsUpdate: boolean;
|
|
1175
|
-
/**
|
|
1176
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
1177
|
-
* for debugging purposes.
|
|
1178
|
-
*/
|
|
1179
|
-
renderDebugFrame: boolean;
|
|
1180
|
-
components: Components;
|
|
1181
|
-
readonly world: World;
|
|
1182
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
1183
|
-
protected autoUpdate: boolean;
|
|
1184
|
-
protected updateInterval: number;
|
|
1185
|
-
protected readonly worker: Worker;
|
|
1186
|
-
protected readonly scene: THREE.Scene;
|
|
1187
|
-
private _width;
|
|
1188
|
-
private _height;
|
|
1189
|
-
private _availableColor;
|
|
1190
|
-
private readonly renderTarget;
|
|
1191
|
-
private readonly bufferSize;
|
|
1192
|
-
private readonly _buffer;
|
|
1193
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1194
|
-
/** {@link Disposable.dispose} */
|
|
1195
|
-
dispose(): void;
|
|
1196
|
-
/**
|
|
1197
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1198
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
1199
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1200
|
-
* not true.
|
|
1201
|
-
*/
|
|
1202
|
-
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1203
|
-
protected getAvailableColor(): {
|
|
1204
|
-
r: number;
|
|
1205
|
-
g: number;
|
|
1206
|
-
b: number;
|
|
1207
|
-
code: string;
|
|
1208
|
-
};
|
|
1209
|
-
protected increaseColor(): void;
|
|
1210
|
-
protected decreaseColor(): void;
|
|
1211
|
-
private applySettings;
|
|
1212
|
-
}
|
|
1213
|
-
import * as THREE from "three";
|
|
1214
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1215
|
-
import { Components } from "../../Components";
|
|
1216
|
-
import { Event, World } from "../../Types";
|
|
1217
|
-
/**
|
|
1218
|
-
* A renderer to determine a mesh visibility on screen
|
|
1219
|
-
*/
|
|
1220
|
-
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1221
|
-
threshold: number;
|
|
1222
|
-
readonly onViewUpdated: Event<{
|
|
1223
|
-
seen: Set<THREE.Mesh>;
|
|
1224
|
-
unseen: Set<THREE.Mesh>;
|
|
1225
|
-
}>;
|
|
1226
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1227
|
-
isProcessing: boolean;
|
|
1228
|
-
private _colorCodeMeshMap;
|
|
1229
|
-
private _meshIDColorCodeMap;
|
|
1230
|
-
private _currentVisibleMeshes;
|
|
1231
|
-
private _recentlyHiddenMeshes;
|
|
1232
|
-
private readonly _transparentMat;
|
|
1233
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1234
|
-
dispose(): void;
|
|
1235
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1236
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1237
|
-
private handleWorkerMessage;
|
|
1238
|
-
private getAvailableMaterial;
|
|
1239
|
-
}
|
|
1240
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1241
|
-
import * as THREE from "three";
|
|
1242
|
-
import { Disposable, Event } from "../../Types";
|
|
1243
|
-
/**
|
|
1244
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1245
|
-
* to work with tools like the
|
|
1246
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1247
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1248
|
-
*/
|
|
1249
|
-
export declare class Mouse implements Disposable {
|
|
1250
|
-
dom: HTMLCanvasElement;
|
|
1251
|
-
private _event?;
|
|
1252
|
-
private _position;
|
|
1253
|
-
/** {@link Disposable.onDisposed} */
|
|
1254
|
-
readonly onDisposed: Event<unknown>;
|
|
1255
|
-
constructor(dom: HTMLCanvasElement);
|
|
1256
|
-
/**
|
|
1257
|
-
* The real position of the mouse of the Three.js canvas.
|
|
1258
|
-
*/
|
|
1259
|
-
get position(): THREE.Vector2;
|
|
1260
|
-
/** {@link Disposable.dispose} */
|
|
1261
|
-
dispose(): void;
|
|
1262
|
-
private getPositionY;
|
|
1263
|
-
private getPositionX;
|
|
1264
|
-
private updateMouseInfo;
|
|
1265
|
-
private setupEvents;
|
|
1266
|
-
}
|
|
1267
|
-
import * as THREE from "three";
|
|
1268
|
-
import { Components } from "../../Components";
|
|
1269
|
-
import { Event, World, Disposable } from "../../Types";
|
|
1270
|
-
import { Mouse } from "./mouse";
|
|
1271
|
-
/**
|
|
1272
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1273
|
-
* that allows to easily get items from the scene using the mouse and touch
|
|
1274
|
-
* events.
|
|
1275
|
-
*/
|
|
1276
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
1277
|
-
/** {@link Component.enabled} */
|
|
1278
|
-
enabled: boolean;
|
|
1279
|
-
components: Components;
|
|
1280
|
-
/** {@link Disposable.onDisposed} */
|
|
1281
|
-
readonly onDisposed: Event<unknown>;
|
|
1282
|
-
/** The position of the mouse in the screen. */
|
|
1283
|
-
readonly mouse: Mouse;
|
|
1284
|
-
readonly three: THREE.Raycaster;
|
|
1285
|
-
world: World;
|
|
1286
|
-
constructor(components: Components, world: World);
|
|
1287
|
-
/** {@link Disposable.dispose} */
|
|
1288
|
-
dispose(): void;
|
|
1289
|
-
/**
|
|
1290
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1291
|
-
* the first item found. This also takes into account the clipping planes
|
|
1292
|
-
* used by the renderer.
|
|
1293
|
-
*
|
|
1294
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1295
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
1296
|
-
* {@link Components.meshes}.
|
|
1297
|
-
*/
|
|
1298
|
-
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1299
|
-
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;
|
|
1300
|
-
private intersect;
|
|
1301
|
-
private filterClippingPlanes;
|
|
1302
|
-
}
|
|
1303
|
-
import * as THREE from "three";
|
|
1304
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1305
|
-
import { Components } from "../../Components";
|
|
1306
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1307
|
-
/**
|
|
1308
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
1309
|
-
*/
|
|
1310
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1311
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1312
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1313
|
-
enabled: boolean;
|
|
1314
|
-
uuid: string;
|
|
1315
|
-
readonly onDisposed: Event<unknown>;
|
|
1316
|
-
private _scene?;
|
|
1317
|
-
private _camera?;
|
|
1318
|
-
private _renderer;
|
|
1319
|
-
get scene(): T;
|
|
1320
|
-
set scene(scene: T);
|
|
1321
|
-
get camera(): U;
|
|
1322
|
-
set camera(camera: U);
|
|
1323
|
-
get renderer(): S | null;
|
|
1324
|
-
set renderer(renderer: S | null);
|
|
1325
|
-
constructor(components: Components);
|
|
1326
|
-
update(delta?: number): void;
|
|
1327
|
-
dispose(disposeResources?: boolean): void;
|
|
1328
|
-
}
|
|
1329
|
-
import * as THREE from "three";
|
|
1330
|
-
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1331
|
-
import { Components } from "../../Components";
|
|
1332
|
-
/**
|
|
1333
|
-
* Each of the planes created by {@link SimpleClipper}.
|
|
1334
|
-
*/
|
|
1335
|
-
export declare class SimplePlane implements Disposable, Hideable {
|
|
1336
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1337
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
1338
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1339
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
1340
|
-
/** {@link Disposable.onDisposed} */
|
|
1341
|
-
readonly onDisposed: Event<unknown>;
|
|
1342
|
-
readonly normal: THREE.Vector3;
|
|
1343
|
-
readonly origin: THREE.Vector3;
|
|
1344
|
-
readonly three: THREE.Plane;
|
|
1345
|
-
protected readonly _helper: THREE.Object3D;
|
|
1346
|
-
protected _visible: boolean;
|
|
1347
|
-
protected _enabled: boolean;
|
|
1348
|
-
components: Components;
|
|
1349
|
-
world: World;
|
|
1350
|
-
private _controlsActive;
|
|
1351
|
-
private readonly _arrowBoundBox;
|
|
1352
|
-
private readonly _planeMesh;
|
|
1353
|
-
private readonly _controls;
|
|
1354
|
-
private readonly _hiddenMaterial;
|
|
1355
|
-
get enabled(): boolean;
|
|
1356
|
-
/** {@link Component.enabled} */
|
|
1357
|
-
set enabled(state: boolean);
|
|
1358
|
-
/** {@link Hideable.visible } */
|
|
1359
|
-
get visible(): boolean;
|
|
1360
|
-
/** {@link Hideable.visible } */
|
|
1361
|
-
set visible(state: boolean);
|
|
1362
|
-
/** The meshes used for raycasting */
|
|
1363
|
-
get meshes(): THREE.Mesh[];
|
|
1364
|
-
/** The material of the clipping plane representation. */
|
|
1365
|
-
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1366
|
-
/** The material of the clipping plane representation. */
|
|
1367
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1368
|
-
/** The size of the clipping plane representation. */
|
|
1369
|
-
get size(): number;
|
|
1370
|
-
/** Sets the size of the clipping plane representation. */
|
|
1371
|
-
set size(size: number);
|
|
1372
|
-
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1373
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1374
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1375
|
-
/** {@link Updateable.update} */
|
|
1376
|
-
update: () => Promise<void>;
|
|
1377
|
-
/** {@link Disposable.dispose} */
|
|
1378
|
-
dispose(): void;
|
|
1379
|
-
private reset;
|
|
1380
|
-
protected toggleControls(state: boolean): void;
|
|
1381
|
-
private newTransformControls;
|
|
1382
|
-
private initializeControls;
|
|
1383
|
-
private createArrowBoundingBox;
|
|
1384
|
-
private changeDrag;
|
|
1385
|
-
private notifyDraggingChanged;
|
|
1386
|
-
private preventCameraMovement;
|
|
1387
|
-
private newHelper;
|
|
1388
|
-
private static newPlaneMesh;
|
|
1389
|
-
}
|
|
1390
|
-
import * as THREE from "three";
|
|
1391
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1392
|
-
import { Components } from "../../Components";
|
|
1393
|
-
export interface SimpleSceneConfig {
|
|
1394
|
-
directionalLight: {
|
|
1395
|
-
color: THREE.Color;
|
|
1396
|
-
intensity: number;
|
|
1397
|
-
position: THREE.Vector3;
|
|
1398
|
-
};
|
|
1399
|
-
ambientLight: {
|
|
1400
|
-
color: THREE.Color;
|
|
1401
|
-
intensity: number;
|
|
1402
|
-
};
|
|
1345
|
+
uuid: string;
|
|
1403
1346
|
}
|
|
1347
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1348
|
+
import { Components } from "../../Components";
|
|
1404
1349
|
/**
|
|
1405
|
-
*
|
|
1406
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1407
|
-
* @noInheritDoc
|
|
1350
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1408
1351
|
*/
|
|
1409
|
-
export declare class
|
|
1410
|
-
|
|
1411
|
-
isSetup: boolean;
|
|
1412
|
-
three: THREE.Scene;
|
|
1413
|
-
/** {@link Configurable.onSetup} */
|
|
1414
|
-
readonly onSetup: Event<SimpleScene>;
|
|
1415
|
-
config: Required<SimpleSceneConfig>;
|
|
1352
|
+
export declare abstract class Base {
|
|
1353
|
+
components: Components;
|
|
1416
1354
|
constructor(components: Components);
|
|
1417
|
-
/**
|
|
1418
|
-
|
|
1355
|
+
/** Whether is component is {@link Disposable}. */
|
|
1356
|
+
isDisposeable: () => this is Disposable;
|
|
1357
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1358
|
+
isResizeable: () => this is Resizeable;
|
|
1359
|
+
/** Whether is component is {@link Updateable}. */
|
|
1360
|
+
isUpdateable: () => this is Updateable;
|
|
1361
|
+
/** Whether is component is {@link Hideable}. */
|
|
1362
|
+
isHideable: () => this is Hideable;
|
|
1363
|
+
/** Whether is component is {@link Configurable}. */
|
|
1364
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1419
1365
|
}
|
|
1420
1366
|
import * as THREE from "three";
|
|
1421
|
-
import {
|
|
1367
|
+
import { Disposable } from "./interfaces";
|
|
1368
|
+
import { Event } from "./event";
|
|
1422
1369
|
import { Components } from "../../Components";
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
enabled: boolean;
|
|
1430
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1431
|
-
container: HTMLElement | null;
|
|
1432
|
-
three: THREE.WebGLRenderer;
|
|
1433
|
-
protected _canvas: HTMLCanvasElement;
|
|
1434
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1435
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
1436
|
-
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1437
|
-
/** {@link Updateable.update} */
|
|
1438
|
-
update(): void;
|
|
1370
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1371
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1372
|
+
/** {@link Disposable.onDisposed} */
|
|
1373
|
+
readonly onDisposed: Event<unknown>;
|
|
1374
|
+
abstract three: THREE.Object3D;
|
|
1375
|
+
protected constructor(components: Components);
|
|
1439
1376
|
/** {@link Disposable.dispose} */
|
|
1440
1377
|
dispose(): void;
|
|
1441
|
-
/** {@link Resizeable.getSize}. */
|
|
1442
|
-
getSize(): THREE.Vector2;
|
|
1443
|
-
/** {@link Resizeable.resize} */
|
|
1444
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1445
|
-
setupEvents(active: boolean): void;
|
|
1446
|
-
private resizeEvent;
|
|
1447
|
-
private setupRenderer;
|
|
1448
|
-
private onContextLost;
|
|
1449
|
-
private onContextBack;
|
|
1450
|
-
private updateContainer;
|
|
1451
1378
|
}
|
|
1452
1379
|
import * as THREE from "three";
|
|
1453
|
-
import CameraControls from "camera-controls";
|
|
1454
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1455
1380
|
import { Components } from "../../Components";
|
|
1381
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
1382
|
+
export interface CullerRendererSettings {
|
|
1383
|
+
updateInterval?: number;
|
|
1384
|
+
width?: number;
|
|
1385
|
+
height?: number;
|
|
1386
|
+
autoUpdate?: boolean;
|
|
1387
|
+
}
|
|
1456
1388
|
/**
|
|
1457
|
-
* A
|
|
1458
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1459
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1460
|
-
* what features it offers.
|
|
1389
|
+
* A base renderer to determine visibility on screen
|
|
1461
1390
|
*/
|
|
1462
|
-
export declare class
|
|
1463
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1464
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1465
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1466
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1467
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
1391
|
+
export declare class CullerRenderer {
|
|
1468
1392
|
/** {@link Disposable.onDisposed} */
|
|
1469
1393
|
readonly onDisposed: Event<string>;
|
|
1470
|
-
readonly three: THREE.PerspectiveCamera;
|
|
1471
|
-
private _allControls;
|
|
1472
1394
|
/**
|
|
1473
|
-
*
|
|
1474
|
-
*
|
|
1475
|
-
*
|
|
1476
|
-
* object to move, rotate, look at objects, etc.
|
|
1395
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1396
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1397
|
+
* just before but not anymore.
|
|
1477
1398
|
*/
|
|
1478
|
-
|
|
1479
|
-
/** {@link Component.enabled} */
|
|
1480
|
-
get enabled(): boolean;
|
|
1399
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1481
1400
|
/** {@link Component.enabled} */
|
|
1482
|
-
|
|
1483
|
-
|
|
1401
|
+
enabled: boolean;
|
|
1402
|
+
/**
|
|
1403
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1404
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1405
|
+
*/
|
|
1406
|
+
needsUpdate: boolean;
|
|
1407
|
+
/**
|
|
1408
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1409
|
+
* for debugging purposes.
|
|
1410
|
+
*/
|
|
1411
|
+
renderDebugFrame: boolean;
|
|
1412
|
+
components: Components;
|
|
1413
|
+
readonly world: World;
|
|
1414
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1415
|
+
protected autoUpdate: boolean;
|
|
1416
|
+
protected updateInterval: number;
|
|
1417
|
+
protected readonly worker: Worker;
|
|
1418
|
+
protected readonly scene: THREE.Scene;
|
|
1419
|
+
private _width;
|
|
1420
|
+
private _height;
|
|
1421
|
+
private _availableColor;
|
|
1422
|
+
private readonly renderTarget;
|
|
1423
|
+
private readonly bufferSize;
|
|
1424
|
+
private readonly _buffer;
|
|
1425
|
+
protected _isWorkerBusy: boolean;
|
|
1426
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1484
1427
|
/** {@link Disposable.dispose} */
|
|
1485
1428
|
dispose(): void;
|
|
1486
|
-
/** {@link Updateable.update} */
|
|
1487
|
-
update(_delta: number): void;
|
|
1488
1429
|
/**
|
|
1489
|
-
*
|
|
1490
|
-
*
|
|
1430
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1431
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1432
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1433
|
+
* not true.
|
|
1491
1434
|
*/
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
minAssetsSize: number;
|
|
1503
|
-
}
|
|
1504
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1505
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1506
|
-
propertiesSize: number;
|
|
1435
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1436
|
+
protected getAvailableColor(): {
|
|
1437
|
+
r: number;
|
|
1438
|
+
g: number;
|
|
1439
|
+
b: number;
|
|
1440
|
+
code: string;
|
|
1441
|
+
};
|
|
1442
|
+
protected increaseColor(): void;
|
|
1443
|
+
protected decreaseColor(): void;
|
|
1444
|
+
private applySettings;
|
|
1507
1445
|
}
|
|
1508
|
-
/// <reference types="node" />
|
|
1509
1446
|
import * as THREE from "three";
|
|
1510
|
-
import { Hideable, Event, World } from "../../Types";
|
|
1447
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1511
1448
|
import { Components } from "../../Components";
|
|
1512
|
-
export interface GridConfig {
|
|
1513
|
-
color: THREE.Color;
|
|
1514
|
-
size1: number;
|
|
1515
|
-
size2: number;
|
|
1516
|
-
distance: number;
|
|
1517
|
-
}
|
|
1518
1449
|
/**
|
|
1519
|
-
*
|
|
1520
|
-
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1521
|
-
* and translated to typescript by
|
|
1522
|
-
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1450
|
+
* Each of the planes created by {@link SimpleClipper}.
|
|
1523
1451
|
*/
|
|
1524
|
-
export declare class
|
|
1452
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
1453
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1454
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
1455
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1456
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
1525
1457
|
/** {@link Disposable.onDisposed} */
|
|
1526
1458
|
readonly onDisposed: Event<unknown>;
|
|
1527
|
-
|
|
1459
|
+
readonly normal: THREE.Vector3;
|
|
1460
|
+
readonly origin: THREE.Vector3;
|
|
1461
|
+
readonly three: THREE.Plane;
|
|
1462
|
+
protected readonly _helper: THREE.Object3D;
|
|
1463
|
+
protected _visible: boolean;
|
|
1464
|
+
protected _enabled: boolean;
|
|
1528
1465
|
components: Components;
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
get
|
|
1540
|
-
/**
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
/** {@link Disposable.onDisposed} */
|
|
1570
|
-
readonly onDisposed: Event<string>;
|
|
1571
|
-
enabled: boolean;
|
|
1572
|
-
settings: PropertiesStreamingSettings;
|
|
1573
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1574
|
-
dispose(): Promise<void>;
|
|
1575
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1576
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1577
|
-
private readIfcFile;
|
|
1578
|
-
private streamIfcFile;
|
|
1579
|
-
private streamAllProperties;
|
|
1580
|
-
private getIndices;
|
|
1581
|
-
private cleanUp;
|
|
1582
|
-
}
|
|
1583
|
-
export interface StreamedGeometries {
|
|
1584
|
-
[id: number]: {
|
|
1585
|
-
boundingBox: Float32Array;
|
|
1586
|
-
hasHoles: boolean;
|
|
1587
|
-
geometryFile?: string;
|
|
1588
|
-
};
|
|
1589
|
-
}
|
|
1590
|
-
export interface StreamedAsset {
|
|
1591
|
-
id: number;
|
|
1592
|
-
geometries: {
|
|
1593
|
-
geometryID: number;
|
|
1594
|
-
transformation: number[];
|
|
1595
|
-
color: number[];
|
|
1596
|
-
}[];
|
|
1466
|
+
world: World;
|
|
1467
|
+
private _controlsActive;
|
|
1468
|
+
private readonly _arrowBoundBox;
|
|
1469
|
+
private readonly _planeMesh;
|
|
1470
|
+
private readonly _controls;
|
|
1471
|
+
private readonly _hiddenMaterial;
|
|
1472
|
+
get enabled(): boolean;
|
|
1473
|
+
/** {@link Component.enabled} */
|
|
1474
|
+
set enabled(state: boolean);
|
|
1475
|
+
/** {@link Hideable.visible } */
|
|
1476
|
+
get visible(): boolean;
|
|
1477
|
+
/** {@link Hideable.visible } */
|
|
1478
|
+
set visible(state: boolean);
|
|
1479
|
+
/** The meshes used for raycasting */
|
|
1480
|
+
get meshes(): THREE.Mesh[];
|
|
1481
|
+
/** The material of the clipping plane representation. */
|
|
1482
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1483
|
+
/** The material of the clipping plane representation. */
|
|
1484
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1485
|
+
/** The size of the clipping plane representation. */
|
|
1486
|
+
get size(): number;
|
|
1487
|
+
/** Sets the size of the clipping plane representation. */
|
|
1488
|
+
set size(size: number);
|
|
1489
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1490
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1491
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1492
|
+
/** {@link Updateable.update} */
|
|
1493
|
+
update: () => Promise<void>;
|
|
1494
|
+
/** {@link Disposable.dispose} */
|
|
1495
|
+
dispose(): void;
|
|
1496
|
+
private reset;
|
|
1497
|
+
protected toggleControls(state: boolean): void;
|
|
1498
|
+
private newTransformControls;
|
|
1499
|
+
private initializeControls;
|
|
1500
|
+
private createArrowBoundingBox;
|
|
1501
|
+
private changeDrag;
|
|
1502
|
+
private notifyDraggingChanged;
|
|
1503
|
+
private preventCameraMovement;
|
|
1504
|
+
private newHelper;
|
|
1505
|
+
private static newPlaneMesh;
|
|
1597
1506
|
}
|
|
1598
|
-
|
|
1599
|
-
import
|
|
1600
|
-
import {
|
|
1601
|
-
import {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1507
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1508
|
+
import * as THREE from "three";
|
|
1509
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1510
|
+
import { Components } from "../../Components";
|
|
1511
|
+
import { Event, World } from "../../Types";
|
|
1512
|
+
/**
|
|
1513
|
+
* A renderer to determine a mesh visibility on screen
|
|
1514
|
+
*/
|
|
1515
|
+
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1516
|
+
threshold: number;
|
|
1517
|
+
readonly onViewUpdated: Event<{
|
|
1518
|
+
seen: Set<THREE.Mesh>;
|
|
1519
|
+
unseen: Set<THREE.Mesh>;
|
|
1607
1520
|
}>;
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
private _metaData;
|
|
1618
|
-
private _visitedGeometries;
|
|
1619
|
-
private _streamSerializer;
|
|
1620
|
-
private _geometries;
|
|
1621
|
-
private _geometryCount;
|
|
1622
|
-
private _civil;
|
|
1623
|
-
private _groupSerializer;
|
|
1624
|
-
private _assets;
|
|
1625
|
-
private _meshesWithHoles;
|
|
1626
|
-
constructor(components: Components);
|
|
1521
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1522
|
+
isProcessing: boolean;
|
|
1523
|
+
private _colorCodeMeshMap;
|
|
1524
|
+
private _meshIDColorCodeMap;
|
|
1525
|
+
private _currentVisibleMeshes;
|
|
1526
|
+
private _recentlyHiddenMeshes;
|
|
1527
|
+
private _intervalID;
|
|
1528
|
+
private readonly _transparentMat;
|
|
1529
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1627
1530
|
dispose(): void;
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
private
|
|
1631
|
-
private
|
|
1632
|
-
private streamAllGeometries;
|
|
1633
|
-
private cleanUp;
|
|
1634
|
-
private getMesh;
|
|
1635
|
-
private getGeometry;
|
|
1636
|
-
private streamAssets;
|
|
1637
|
-
private streamGeometries;
|
|
1531
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1532
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1533
|
+
private handleWorkerMessage;
|
|
1534
|
+
private getAvailableMaterial;
|
|
1638
1535
|
}
|
|
1639
1536
|
import { NavigationMode } from "./types";
|
|
1640
1537
|
/**
|
|
1641
|
-
* A {@link NavigationMode} that allows
|
|
1642
|
-
*
|
|
1538
|
+
* A {@link NavigationMode} that allows first person navigation,
|
|
1539
|
+
* simulating FPS video games.
|
|
1643
1540
|
*/
|
|
1644
|
-
export declare class
|
|
1645
|
-
camera
|
|
1541
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1542
|
+
private camera;
|
|
1646
1543
|
/** {@link NavigationMode.enabled} */
|
|
1647
1544
|
enabled: boolean;
|
|
1648
1545
|
/** {@link NavigationMode.id} */
|
|
1649
|
-
readonly id = "
|
|
1546
|
+
readonly id = "FirstPerson";
|
|
1650
1547
|
constructor(camera: any);
|
|
1651
1548
|
/** {@link NavigationMode.set} */
|
|
1652
1549
|
set(active: boolean): void;
|
|
1653
|
-
private
|
|
1550
|
+
private setupFirstPersonCamera;
|
|
1654
1551
|
}
|
|
1655
1552
|
import { NavigationMode } from "./types";
|
|
1656
1553
|
/**
|
|
1657
|
-
* A {@link NavigationMode} that allows
|
|
1658
|
-
*
|
|
1554
|
+
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1555
|
+
* like in many 3D and CAD softwares.
|
|
1659
1556
|
*/
|
|
1660
|
-
export declare class
|
|
1661
|
-
|
|
1557
|
+
export declare class OrbitMode implements NavigationMode {
|
|
1558
|
+
camera: any;
|
|
1662
1559
|
/** {@link NavigationMode.enabled} */
|
|
1663
1560
|
enabled: boolean;
|
|
1664
1561
|
/** {@link NavigationMode.id} */
|
|
1665
|
-
readonly id = "
|
|
1562
|
+
readonly id = "Orbit";
|
|
1666
1563
|
constructor(camera: any);
|
|
1667
1564
|
/** {@link NavigationMode.set} */
|
|
1668
1565
|
set(active: boolean): void;
|
|
1669
|
-
private
|
|
1566
|
+
private activateOrbitControls;
|
|
1670
1567
|
}
|
|
1671
1568
|
import * as THREE from "three";
|
|
1672
1569
|
import { CameraProjection } from "./types";
|
|
@@ -1705,6 +1602,16 @@ export declare class ProjectionManager {
|
|
|
1705
1602
|
private getDistance;
|
|
1706
1603
|
private setPerspectiveCamera;
|
|
1707
1604
|
}
|
|
1605
|
+
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1606
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1607
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1608
|
+
minGeometrySize: number;
|
|
1609
|
+
minAssetsSize: number;
|
|
1610
|
+
}
|
|
1611
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1612
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1613
|
+
propertiesSize: number;
|
|
1614
|
+
}
|
|
1708
1615
|
import { NavigationMode } from "./types";
|
|
1709
1616
|
/**
|
|
1710
1617
|
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
@@ -1753,14 +1660,102 @@ export interface NavigationMode {
|
|
|
1753
1660
|
enabled: boolean;
|
|
1754
1661
|
}
|
|
1755
1662
|
import * as WEBIFC from "web-ifc";
|
|
1663
|
+
import { Component, Disposable, Event } from "../../../core";
|
|
1664
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1665
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1666
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1667
|
+
onPropertiesStreamed: Event<{
|
|
1668
|
+
type: number;
|
|
1669
|
+
data: {
|
|
1670
|
+
[id: number]: any;
|
|
1671
|
+
};
|
|
1672
|
+
}>;
|
|
1673
|
+
onProgress: Event<number>;
|
|
1674
|
+
onIndicesStreamed: Event<number[][]>;
|
|
1675
|
+
/** {@link Disposable.onDisposed} */
|
|
1676
|
+
readonly onDisposed: Event<string>;
|
|
1677
|
+
enabled: boolean;
|
|
1678
|
+
settings: PropertiesStreamingSettings;
|
|
1679
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1680
|
+
dispose(): Promise<void>;
|
|
1681
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1682
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1683
|
+
private readIfcFile;
|
|
1684
|
+
private streamIfcFile;
|
|
1685
|
+
private streamAllProperties;
|
|
1686
|
+
private getIndices;
|
|
1687
|
+
private cleanUp;
|
|
1688
|
+
}
|
|
1689
|
+
import * as WEBIFC from "web-ifc";
|
|
1690
|
+
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1691
|
+
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1692
|
+
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1693
|
+
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1694
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1695
|
+
onGeometryStreamed: Event<{
|
|
1696
|
+
buffer: Uint8Array;
|
|
1697
|
+
data: StreamedGeometries;
|
|
1698
|
+
}>;
|
|
1699
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1700
|
+
onProgress: Event<number>;
|
|
1701
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
1702
|
+
/** {@link Disposable.onDisposed} */
|
|
1703
|
+
readonly onDisposed: Event<unknown>;
|
|
1704
|
+
settings: IfcStreamingSettings;
|
|
1705
|
+
enabled: boolean;
|
|
1706
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1707
|
+
private _spatialTree;
|
|
1708
|
+
private _metaData;
|
|
1709
|
+
private _visitedGeometries;
|
|
1710
|
+
private _streamSerializer;
|
|
1711
|
+
private _geometries;
|
|
1712
|
+
private _geometryCount;
|
|
1713
|
+
private _civil;
|
|
1714
|
+
private _groupSerializer;
|
|
1715
|
+
private _assets;
|
|
1716
|
+
private _meshesWithHoles;
|
|
1717
|
+
constructor(components: Components);
|
|
1718
|
+
dispose(): void;
|
|
1719
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1720
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1721
|
+
private readIfcFile;
|
|
1722
|
+
private streamIfcFile;
|
|
1723
|
+
private streamAllGeometries;
|
|
1724
|
+
private cleanUp;
|
|
1725
|
+
private getMesh;
|
|
1726
|
+
private getGeometry;
|
|
1727
|
+
private streamAssets;
|
|
1728
|
+
private streamGeometries;
|
|
1729
|
+
}
|
|
1730
|
+
export interface StreamedGeometries {
|
|
1731
|
+
[id: number]: {
|
|
1732
|
+
boundingBox: Float32Array;
|
|
1733
|
+
hasHoles: boolean;
|
|
1734
|
+
geometryFile?: string;
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
export interface StreamedAsset {
|
|
1738
|
+
id: number;
|
|
1739
|
+
geometries: {
|
|
1740
|
+
geometryID: number;
|
|
1741
|
+
transformation: number[];
|
|
1742
|
+
color: number[];
|
|
1743
|
+
}[];
|
|
1744
|
+
}
|
|
1756
1745
|
import * as THREE from "three";
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1746
|
+
import * as WEBIFC from "web-ifc";
|
|
1747
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1748
|
+
export declare class CivilReader {
|
|
1749
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1750
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1751
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1752
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1753
|
+
} | undefined;
|
|
1754
|
+
get(civilItems: any): {
|
|
1755
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1756
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1757
|
+
} | undefined;
|
|
1758
|
+
private getCurves;
|
|
1764
1759
|
}
|
|
1765
1760
|
import * as WEBIFC from "web-ifc";
|
|
1766
1761
|
/** Configuration of the IFC-fragment conversion. */
|
|
@@ -1789,25 +1784,20 @@ export declare class IfcFragmentSettings {
|
|
|
1789
1784
|
autoSetWasm: boolean;
|
|
1790
1785
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1791
1786
|
}
|
|
1792
|
-
import * as THREE from "three";
|
|
1793
|
-
import * as WEBIFC from "web-ifc";
|
|
1794
|
-
import * as FRAGS from "bim-fragment";
|
|
1795
|
-
export declare class CivilReader {
|
|
1796
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1797
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1798
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1799
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1800
|
-
} | undefined;
|
|
1801
|
-
get(civilItems: any): {
|
|
1802
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1803
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1804
|
-
} | undefined;
|
|
1805
|
-
private getCurves;
|
|
1806
|
-
}
|
|
1807
1787
|
import * as WEBIFC from "web-ifc";
|
|
1808
1788
|
export declare class IfcMetadataReader {
|
|
1809
1789
|
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1810
1790
|
}
|
|
1791
|
+
import * as WEBIFC from "web-ifc";
|
|
1792
|
+
import * as THREE from "three";
|
|
1793
|
+
export declare class Units {
|
|
1794
|
+
factor: number;
|
|
1795
|
+
complement: number;
|
|
1796
|
+
apply(matrix: THREE.Matrix4): void;
|
|
1797
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1798
|
+
private getLengthUnits;
|
|
1799
|
+
private getScaleMatrix;
|
|
1800
|
+
}
|
|
1811
1801
|
import { BufferGeometry } from "three";
|
|
1812
1802
|
import * as THREE from "three";
|
|
1813
1803
|
export declare class TransformHelper {
|