@thatopen/components 2.0.4 → 2.0.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/Grids/src/simple-grid.d.ts +1 -3
- package/dist/fragments/FragmentsManager/index.d.ts +1 -0
- package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +2 -1
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +586 -566
- package/dist/namespace.d.ts +1536 -1536
- package/package.json +5 -21
package/dist/namespace.d.ts
CHANGED
|
@@ -1,436 +1,283 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import { Component, Disposable,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
6
|
-
/**
|
|
7
|
-
* A unique identifier for the component.
|
|
8
|
-
* This UUID is used to register the component within the Components system.
|
|
9
|
-
*/
|
|
10
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
11
|
-
/**
|
|
12
|
-
* Event triggered after the update process of all worlds.
|
|
13
|
-
* Subscribers can listen to this event to perform actions post-update.
|
|
14
|
-
*/
|
|
15
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
16
|
-
/**
|
|
17
|
-
* Event triggered before the update process of all worlds.
|
|
18
|
-
* Subscribers can listen to this event to perform actions pre-update.
|
|
19
|
-
*/
|
|
20
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* Event triggered when the Worlds component is disposed.
|
|
23
|
-
* Subscribers can listen to this event to perform cleanup actions.
|
|
24
|
-
*/
|
|
25
|
-
readonly onDisposed: Event<unknown>;
|
|
26
|
-
readonly onWorldCreated: Event<World>;
|
|
27
|
-
readonly onWorldDeleted: Event<string>;
|
|
28
|
-
/**
|
|
29
|
-
* A collection of worlds managed by this component.
|
|
30
|
-
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
31
|
-
*/
|
|
32
|
-
list: Map<string, World>;
|
|
33
|
-
/**
|
|
34
|
-
* A flag indicating whether the Worlds component is enabled.
|
|
35
|
-
* If false, the update process will be skipped.
|
|
36
|
-
*/
|
|
2
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
3
|
+
export declare class Exploder extends Component implements Disposable {
|
|
4
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
37
5
|
enabled: boolean;
|
|
6
|
+
height: number;
|
|
7
|
+
groupName: string;
|
|
8
|
+
/** {@link Disposable.onDisposed} */
|
|
9
|
+
readonly onDisposed: Event<unknown>;
|
|
10
|
+
list: Set<string>;
|
|
38
11
|
constructor(components: Components);
|
|
39
|
-
/**
|
|
40
|
-
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
41
|
-
*
|
|
42
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
43
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
44
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
45
|
-
*
|
|
46
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
47
|
-
*/
|
|
48
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
49
|
-
delete(world: World): void;
|
|
50
12
|
dispose(): void;
|
|
51
|
-
|
|
13
|
+
set(active: boolean): void;
|
|
52
14
|
}
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
|
|
15
|
+
import * as THREE from "three";
|
|
16
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
17
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
18
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
19
|
+
/**
|
|
20
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
21
|
+
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
22
|
+
*/
|
|
23
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
24
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
25
|
+
/** {@link Component.enabled} */
|
|
58
26
|
enabled: boolean;
|
|
59
|
-
|
|
60
|
-
onDisposed: Event<unknown>;
|
|
27
|
+
/** {@link Disposable.onDisposed} */
|
|
28
|
+
readonly onDisposed: Event<unknown>;
|
|
29
|
+
private _absoluteMin;
|
|
30
|
+
private _absoluteMax;
|
|
31
|
+
private _meshes;
|
|
61
32
|
constructor(components: Components);
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
depth: number;
|
|
37
|
+
center: THREE.Vector3;
|
|
38
|
+
};
|
|
39
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
40
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
41
|
+
/** {@link Disposable.dispose} */
|
|
64
42
|
dispose(): void;
|
|
43
|
+
get(): THREE.Box3;
|
|
44
|
+
getSphere(): THREE.Sphere;
|
|
45
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
46
|
+
reset(): void;
|
|
47
|
+
add(group: FragmentsGroup): void;
|
|
48
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
49
|
+
private static getFragmentBounds;
|
|
65
50
|
}
|
|
66
|
-
import
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export declare class
|
|
75
|
-
static readonly
|
|
76
|
-
/** {@link
|
|
77
|
-
readonly onDisposed: Event<void>;
|
|
78
|
-
/** The list of components created in this app. */
|
|
79
|
-
readonly list: Map<string, Component>;
|
|
80
|
-
/** If disabled, the animation loop will be stopped. */
|
|
51
|
+
import * as THREE from "three";
|
|
52
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
53
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
54
|
+
export interface Classification {
|
|
55
|
+
[system: string]: {
|
|
56
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export declare class Classifier extends Component implements Disposable {
|
|
60
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
61
|
+
/** {@link Component.enabled} */
|
|
81
62
|
enabled: boolean;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
* @param Component - The component to get or create.
|
|
89
|
-
*/
|
|
90
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
91
|
-
constructor();
|
|
92
|
-
/**
|
|
93
|
-
* Initializes the library. It should be called at the start of the app after
|
|
94
|
-
* initializing the scene, the renderer and the
|
|
95
|
-
* camera. Additionally, if any component that need a raycaster is
|
|
96
|
-
* used, the {@link raycaster} will need to be initialized.
|
|
97
|
-
*/
|
|
98
|
-
init(): void;
|
|
99
|
-
/**
|
|
100
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
101
|
-
* the library. A memory leak will be created if:
|
|
102
|
-
*
|
|
103
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
104
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
105
|
-
* Angular, Vue, etc).
|
|
106
|
-
*
|
|
107
|
-
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
108
|
-
* referenced by a reference type (object or array).
|
|
109
|
-
*
|
|
110
|
-
* You can learn more about how Three.js handles memory leaks
|
|
111
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
112
|
-
*
|
|
113
|
-
*/
|
|
63
|
+
list: Classification;
|
|
64
|
+
/** {@link Disposable.onDisposed} */
|
|
65
|
+
readonly onDisposed: Event<unknown>;
|
|
66
|
+
constructor(components: Components);
|
|
67
|
+
private onFragmentsDisposed;
|
|
114
68
|
dispose(): void;
|
|
115
|
-
|
|
116
|
-
|
|
69
|
+
remove(guid: string): void;
|
|
70
|
+
find(filter?: {
|
|
71
|
+
[name: string]: string[];
|
|
72
|
+
}): FRAGS.FragmentIdMap;
|
|
73
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
74
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
75
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
76
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
77
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
78
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
79
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
80
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
117
81
|
}
|
|
118
|
-
import
|
|
119
|
-
import {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
82
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
83
|
+
import { Components, Component } from "../../core";
|
|
84
|
+
export declare class Hider extends Component {
|
|
85
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
constructor(components: Components);
|
|
88
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
89
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
90
|
+
private updateCulledVisibility;
|
|
91
|
+
}
|
|
92
|
+
import * as WEBIFC from "web-ifc";
|
|
93
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
94
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
95
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
96
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
97
|
+
onGeometryStreamed: Event<{
|
|
98
|
+
buffer: Uint8Array;
|
|
99
|
+
data: StreamedGeometries;
|
|
100
|
+
}>;
|
|
101
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
102
|
+
onProgress: Event<number>;
|
|
103
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
104
|
+
/** {@link Disposable.onDisposed} */
|
|
124
105
|
readonly onDisposed: Event<unknown>;
|
|
125
|
-
|
|
126
|
-
/** {@link Component.enabled} */
|
|
106
|
+
settings: IfcStreamingSettings;
|
|
127
107
|
enabled: boolean;
|
|
108
|
+
webIfc: WEBIFC.IfcAPI;
|
|
109
|
+
private _spatialTree;
|
|
110
|
+
private _metaData;
|
|
111
|
+
private _visitedGeometries;
|
|
112
|
+
private _streamSerializer;
|
|
113
|
+
private _geometries;
|
|
114
|
+
private _geometryCount;
|
|
115
|
+
private _civil;
|
|
116
|
+
private _groupSerializer;
|
|
117
|
+
private _assets;
|
|
118
|
+
private _meshesWithHoles;
|
|
128
119
|
constructor(components: Components);
|
|
129
|
-
create(world: World): SimpleGrid;
|
|
130
|
-
delete(world: World): void;
|
|
131
120
|
dispose(): void;
|
|
121
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
122
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
123
|
+
private readIfcFile;
|
|
124
|
+
private streamIfcFile;
|
|
125
|
+
private streamAllGeometries;
|
|
126
|
+
private cleanUp;
|
|
127
|
+
private getMesh;
|
|
128
|
+
private getGeometry;
|
|
129
|
+
private streamAssets;
|
|
130
|
+
private streamGeometries;
|
|
132
131
|
}
|
|
133
|
-
import {
|
|
134
|
-
import
|
|
135
|
-
import
|
|
132
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
133
|
+
import * as THREE from "three";
|
|
134
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
135
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
136
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
136
137
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
138
|
+
* Object that can efficiently load binary files that contain
|
|
139
|
+
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
139
140
|
*/
|
|
140
|
-
export declare class
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*/
|
|
144
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
145
|
-
/**
|
|
146
|
-
* Indicates whether the Cullers component is enabled.
|
|
147
|
-
*/
|
|
148
|
-
private _enabled;
|
|
149
|
-
/**
|
|
150
|
-
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
151
|
-
*/
|
|
152
|
-
list: Map<string, MeshCullerRenderer>;
|
|
153
|
-
/**
|
|
154
|
-
* An event that is triggered when the Cullers component is disposed.
|
|
155
|
-
*/
|
|
141
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
142
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
143
|
+
/** {@link Disposable.onDisposed} */
|
|
156
144
|
readonly onDisposed: Event<unknown>;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Creates a new MeshCullerRenderer for the given world.
|
|
173
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
174
|
-
*
|
|
175
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
176
|
-
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
177
|
-
*
|
|
178
|
-
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
179
|
-
*/
|
|
180
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
181
|
-
delete(world: World): void;
|
|
182
|
-
/** {@link Disposable.dispose} */
|
|
183
|
-
dispose(): void;
|
|
184
|
-
}
|
|
185
|
-
import * as THREE from "three";
|
|
186
|
-
import { Components } from "../Components";
|
|
187
|
-
import { SimpleCamera } from "..";
|
|
188
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
189
|
-
/**
|
|
190
|
-
* A flexible camera that uses
|
|
191
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
192
|
-
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
193
|
-
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
194
|
-
*/
|
|
195
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
196
|
-
/**
|
|
197
|
-
* The current {@link NavigationMode}.
|
|
198
|
-
*/
|
|
199
|
-
_mode: NavigationMode | null;
|
|
200
|
-
readonly projection: ProjectionManager;
|
|
201
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
202
|
-
readonly threePersp: THREE.PerspectiveCamera;
|
|
203
|
-
protected readonly _userInputButtons: any;
|
|
204
|
-
protected readonly _frustumSize = 50;
|
|
205
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
206
|
-
private previousSize;
|
|
207
|
-
get mode(): NavigationMode;
|
|
145
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
146
|
+
readonly onFragmentsDisposed: Event<{
|
|
147
|
+
groupID: string;
|
|
148
|
+
fragmentIDs: string[];
|
|
149
|
+
}>;
|
|
150
|
+
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
151
|
+
readonly list: Map<string, Fragment>;
|
|
152
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
153
|
+
/** {@link Component.enabled} */
|
|
154
|
+
enabled: boolean;
|
|
155
|
+
baseCoordinationModel: string;
|
|
156
|
+
private _loader;
|
|
157
|
+
/** The list of meshes of the created fragments. */
|
|
158
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
208
159
|
constructor(components: Components);
|
|
209
160
|
/** {@link Disposable.dispose} */
|
|
210
161
|
dispose(): void;
|
|
162
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
211
163
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* @param
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
* Make the camera view fit all the specified meshes.
|
|
219
|
-
*
|
|
220
|
-
* @param meshes the meshes to fit. If it is not defined, it will
|
|
221
|
-
* evaluate {@link Components.meshes}.
|
|
222
|
-
* @param offset the distance to the fit object
|
|
164
|
+
* Loads a binar file that contain fragment geometry.
|
|
165
|
+
* @param data - The binary data to load.
|
|
166
|
+
* @param config - Optional configuration for loading.
|
|
167
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
168
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
169
|
+
* @returns The loaded FragmentsGroup.
|
|
223
170
|
*/
|
|
224
|
-
|
|
171
|
+
load(data: Uint8Array, config?: Partial<{
|
|
172
|
+
coordinate: boolean;
|
|
173
|
+
name: string;
|
|
174
|
+
properties: FRAGS.IfcProperties;
|
|
175
|
+
relationsMap: RelationsMap;
|
|
176
|
+
}>): FragmentsGroup;
|
|
225
177
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* @
|
|
178
|
+
* Export the specified fragments.
|
|
179
|
+
* @param group - the fragments group to be exported.
|
|
180
|
+
* @returns the exported data as binary buffer.
|
|
229
181
|
*/
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
private enableUserInput;
|
|
233
|
-
private newOrthoCamera;
|
|
234
|
-
private setOrthoPerspCameraAspect;
|
|
182
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
183
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
235
184
|
}
|
|
236
|
-
import * as
|
|
237
|
-
import
|
|
238
|
-
import {
|
|
185
|
+
import * as WEBIFC from "web-ifc";
|
|
186
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
187
|
+
import { IfcFragmentSettings } from "./src";
|
|
188
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
189
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
190
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
191
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
192
|
+
readonly onSetup: Event<void>;
|
|
193
|
+
/** {@link Disposable.onDisposed} */
|
|
194
|
+
readonly onDisposed: Event<string>;
|
|
195
|
+
settings: IfcFragmentSettings;
|
|
196
|
+
enabled: boolean;
|
|
197
|
+
webIfc: WEBIFC.IfcAPI;
|
|
198
|
+
private _material;
|
|
199
|
+
private _spatialTree;
|
|
200
|
+
private _metaData;
|
|
201
|
+
private _fragmentInstances;
|
|
202
|
+
private _civil;
|
|
203
|
+
private _visitedFragments;
|
|
204
|
+
private _materialT;
|
|
205
|
+
constructor(components: Components);
|
|
206
|
+
dispose(): void;
|
|
207
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
208
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
209
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
210
|
+
private getAllGeometries;
|
|
211
|
+
cleanUp(): void;
|
|
212
|
+
private getMesh;
|
|
213
|
+
private getGeometry;
|
|
214
|
+
private autoSetWasm;
|
|
215
|
+
}
|
|
216
|
+
import * as WEBIFC from "web-ifc";
|
|
217
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
218
|
+
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
219
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
220
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
221
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
222
|
+
type: number;
|
|
223
|
+
data: {
|
|
224
|
+
[id: number]: any;
|
|
225
|
+
};
|
|
226
|
+
}>;
|
|
227
|
+
onProgress: AsyncEvent<number>;
|
|
228
|
+
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
229
|
+
/** {@link Disposable.onDisposed} */
|
|
230
|
+
readonly onDisposed: Event<string>;
|
|
231
|
+
enabled: boolean;
|
|
232
|
+
settings: PropertiesStreamingSettings;
|
|
233
|
+
webIfc: WEBIFC.IfcAPI;
|
|
234
|
+
dispose(): Promise<void>;
|
|
235
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
236
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
237
|
+
private readIfcFile;
|
|
238
|
+
private streamIfcFile;
|
|
239
|
+
private streamAllProperties;
|
|
240
|
+
private cleanUp;
|
|
241
|
+
}
|
|
242
|
+
import * as WEBIFC from "web-ifc";
|
|
243
|
+
import * as FRAG from "@thatopen/fragments";
|
|
244
|
+
import { Component, Components } from "../../core";
|
|
239
245
|
/**
|
|
240
|
-
*
|
|
241
|
-
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
246
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
242
247
|
*/
|
|
243
|
-
export declare class
|
|
244
|
-
|
|
248
|
+
export declare class IfcJsonExporter extends Component {
|
|
249
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
245
250
|
/** {@link Component.enabled} */
|
|
246
251
|
enabled: boolean;
|
|
247
|
-
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
248
252
|
constructor(components: Components);
|
|
249
253
|
/**
|
|
250
|
-
*
|
|
251
|
-
* @
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
*
|
|
256
|
-
* using any of these in other parts of the application, make sure that you
|
|
257
|
-
* remove them from the mesh before disposing it.
|
|
258
|
-
*
|
|
259
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
260
|
-
* to remove.
|
|
261
|
-
*
|
|
262
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
263
|
-
*
|
|
264
|
-
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
265
|
-
*/
|
|
266
|
-
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
267
|
-
/**
|
|
268
|
-
* Disposes a geometry from memory.
|
|
269
|
-
*
|
|
270
|
-
* @param geometry - the
|
|
271
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
272
|
-
* to remove.
|
|
254
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
255
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
256
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
257
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
258
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
259
|
+
* to make the location data available (e.g. absolute position of building).
|
|
273
260
|
*/
|
|
274
|
-
|
|
275
|
-
private disposeGeometryAndMaterials;
|
|
276
|
-
private disposeChildren;
|
|
277
|
-
private static disposeMaterial;
|
|
261
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
278
262
|
}
|
|
279
|
-
import * as
|
|
280
|
-
import {
|
|
281
|
-
import {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
readonly onBeforeDrag: Event<void>;
|
|
298
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
299
|
-
readonly onAfterDrag: Event<void>;
|
|
300
|
-
readonly onBeforeCreate: Event<unknown>;
|
|
301
|
-
readonly onBeforeCancel: Event<unknown>;
|
|
302
|
-
readonly onAfterCancel: Event<unknown>;
|
|
303
|
-
readonly onBeforeDelete: Event<unknown>;
|
|
304
|
-
/** {@link Disposable.onDisposed} */
|
|
305
|
-
readonly onDisposed: Event<string>;
|
|
306
|
-
/**
|
|
307
|
-
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
308
|
-
* (up). This is desirable when clipping a building horizontally and a
|
|
309
|
-
* clipping plane is created in its roof, which might have a slight
|
|
310
|
-
* slope for draining purposes.
|
|
311
|
-
*/
|
|
312
|
-
orthogonalY: boolean;
|
|
313
|
-
/**
|
|
314
|
-
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
315
|
-
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
316
|
-
* has to be 'true' for this to apply.
|
|
317
|
-
*/
|
|
318
|
-
toleranceOrthogonalY: number;
|
|
319
|
-
Type: new (...args: any) => SimplePlane;
|
|
320
|
-
list: SimplePlane[];
|
|
321
|
-
/** The material used in all the clipping planes. */
|
|
322
|
-
private _material;
|
|
323
|
-
private _size;
|
|
324
|
-
private _enabled;
|
|
325
|
-
private _visible;
|
|
326
|
-
/** {@link Component.enabled} */
|
|
327
|
-
get enabled(): boolean;
|
|
328
|
-
/** {@link Component.enabled} */
|
|
329
|
-
set enabled(state: boolean);
|
|
330
|
-
/** {@link Hideable.visible } */
|
|
331
|
-
get visible(): boolean;
|
|
332
|
-
/** {@link Hideable.visible } */
|
|
333
|
-
set visible(state: boolean);
|
|
334
|
-
/** The material of the clipping plane representation. */
|
|
335
|
-
get material(): THREE.MeshBasicMaterial;
|
|
336
|
-
/** The material of the clipping plane representation. */
|
|
337
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
338
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
339
|
-
get size(): number;
|
|
340
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
341
|
-
set size(size: number);
|
|
342
|
-
constructor(components: Components);
|
|
343
|
-
/** {@link Disposable.dispose} */
|
|
344
|
-
dispose(): void;
|
|
345
|
-
/** {@link Createable.create} */
|
|
346
|
-
create(world: World): void;
|
|
347
|
-
/**
|
|
348
|
-
* Creates a plane in a certain place and with a certain orientation,
|
|
349
|
-
* without the need of the mouse.
|
|
350
|
-
*
|
|
351
|
-
* @param world - the world where this plane should be created.
|
|
352
|
-
* @param normal - the orientation of the clipping plane.
|
|
353
|
-
* @param point - the position of the clipping plane.
|
|
354
|
-
* navigation.
|
|
355
|
-
*/
|
|
356
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
357
|
-
/**
|
|
358
|
-
* {@link Createable.delete}
|
|
359
|
-
*
|
|
360
|
-
* @param world - the world where the plane to delete is.
|
|
361
|
-
* @param plane - the plane to delete. If undefined, the first plane
|
|
362
|
-
* found under the cursor will be deleted.
|
|
363
|
-
*/
|
|
364
|
-
delete(world: World, plane?: SimplePlane): void;
|
|
365
|
-
/** Deletes all the existing clipping planes. */
|
|
366
|
-
deleteAll(): void;
|
|
367
|
-
private deletePlane;
|
|
368
|
-
private pickPlane;
|
|
369
|
-
private getAllPlaneMeshes;
|
|
370
|
-
private createPlaneFromIntersection;
|
|
371
|
-
private getWorldNormal;
|
|
372
|
-
private normalizePlaneDirectionY;
|
|
373
|
-
private newPlane;
|
|
374
|
-
private updateMaterialsAndPlanes;
|
|
375
|
-
private _onStartDragging;
|
|
376
|
-
private _onEndDragging;
|
|
377
|
-
}
|
|
378
|
-
import { MiniMap } from "./src";
|
|
379
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
380
|
-
import { Components } from "../Components";
|
|
381
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
382
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
383
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
384
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
385
|
-
readonly onDisposed: Event<unknown>;
|
|
386
|
-
enabled: boolean;
|
|
387
|
-
list: Map<string, MiniMap>;
|
|
388
|
-
constructor(components: Components);
|
|
389
|
-
create(world: World): MiniMap;
|
|
390
|
-
delete(id: string): void;
|
|
391
|
-
dispose(): void;
|
|
392
|
-
update(): void;
|
|
393
|
-
}
|
|
394
|
-
import * as WEBIFC from "web-ifc";
|
|
395
|
-
import * as FRAG from "@thatopen/fragments";
|
|
396
|
-
import { Component, Components } from "../../core";
|
|
397
|
-
/**
|
|
398
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
399
|
-
*/
|
|
400
|
-
export declare class IfcJsonExporter extends Component {
|
|
401
|
-
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
402
|
-
/** {@link Component.enabled} */
|
|
403
|
-
enabled: boolean;
|
|
404
|
-
constructor(components: Components);
|
|
405
|
-
/**
|
|
406
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
407
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
408
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
409
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
410
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
411
|
-
* to make the location data available (e.g. absolute position of building).
|
|
412
|
-
*/
|
|
413
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
414
|
-
}
|
|
415
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
416
|
-
import * as WEBIFC from "web-ifc";
|
|
417
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
418
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
419
|
-
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
420
|
-
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
421
|
-
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
422
|
-
interface ChangeMap {
|
|
423
|
-
[modelID: string]: Set<number>;
|
|
424
|
-
}
|
|
425
|
-
interface AttributeListener {
|
|
426
|
-
[modelID: string]: {
|
|
427
|
-
[expressID: number]: {
|
|
428
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
429
|
-
};
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
433
|
-
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
263
|
+
import * as WEBIFC from "web-ifc";
|
|
264
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
265
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
266
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
267
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
268
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
269
|
+
interface ChangeMap {
|
|
270
|
+
[modelID: string]: Set<number>;
|
|
271
|
+
}
|
|
272
|
+
interface AttributeListener {
|
|
273
|
+
[modelID: string]: {
|
|
274
|
+
[expressID: number]: {
|
|
275
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
280
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
434
281
|
/** {@link Disposable.onDisposed} */
|
|
435
282
|
readonly onDisposed: Event<string>;
|
|
436
283
|
readonly onRequestFile: Event<unknown>;
|
|
@@ -485,236 +332,35 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
485
332
|
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
486
333
|
}
|
|
487
334
|
export {};
|
|
488
|
-
import * as
|
|
489
|
-
import { Components, Component } from "../../core";
|
|
490
|
-
export declare class Hider extends Component {
|
|
491
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
492
|
-
enabled: boolean;
|
|
493
|
-
constructor(components: Components);
|
|
494
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
495
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
496
|
-
private updateCulledVisibility;
|
|
497
|
-
}
|
|
498
|
-
import * as THREE from "three";
|
|
499
|
-
export declare class MaterialsUtils {
|
|
500
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
501
|
-
}
|
|
502
|
-
import * as THREE from "three";
|
|
503
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
335
|
+
import * as WEBIFC from "web-ifc";
|
|
504
336
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
505
|
-
import {
|
|
337
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
338
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
506
339
|
/**
|
|
507
|
-
*
|
|
508
|
-
*
|
|
340
|
+
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
341
|
+
* It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
509
342
|
*/
|
|
510
|
-
export declare class
|
|
511
|
-
static readonly uuid: "
|
|
512
|
-
/** {@link Component.enabled} */
|
|
513
|
-
enabled: boolean;
|
|
343
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
344
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
514
345
|
/** {@link Disposable.onDisposed} */
|
|
515
|
-
readonly onDisposed: Event<
|
|
516
|
-
private _absoluteMin;
|
|
517
|
-
private _absoluteMax;
|
|
518
|
-
private _meshes;
|
|
519
|
-
constructor(components: Components);
|
|
520
|
-
static getDimensions(bbox: THREE.Box3): {
|
|
521
|
-
width: number;
|
|
522
|
-
height: number;
|
|
523
|
-
depth: number;
|
|
524
|
-
center: THREE.Vector3;
|
|
525
|
-
};
|
|
526
|
-
static newBound(positive: boolean): THREE.Vector3;
|
|
527
|
-
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
528
|
-
/** {@link Disposable.dispose} */
|
|
529
|
-
dispose(): void;
|
|
530
|
-
get(): THREE.Box3;
|
|
531
|
-
getSphere(): THREE.Sphere;
|
|
532
|
-
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
533
|
-
reset(): void;
|
|
534
|
-
add(group: FragmentsGroup): void;
|
|
535
|
-
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
536
|
-
private static getFragmentBounds;
|
|
537
|
-
}
|
|
538
|
-
import * as THREE from "three";
|
|
539
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
540
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
541
|
-
export interface Classification {
|
|
542
|
-
[system: string]: {
|
|
543
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
export declare class Classifier extends Component implements Disposable {
|
|
547
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
548
|
-
/** {@link Component.enabled} */
|
|
346
|
+
readonly onDisposed: Event<string>;
|
|
549
347
|
enabled: boolean;
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
private
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
567
|
-
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
568
|
-
}
|
|
569
|
-
import * as THREE from "three";
|
|
570
|
-
import { Component, Components } from "../../core";
|
|
571
|
-
export interface MeasureEdge {
|
|
572
|
-
distance: number;
|
|
573
|
-
points: THREE.Vector3[];
|
|
574
|
-
}
|
|
575
|
-
export declare class MeasurementUtils extends Component {
|
|
576
|
-
enabled: boolean;
|
|
577
|
-
static uuid: string;
|
|
578
|
-
constructor(components: Components);
|
|
579
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
580
|
-
edges: MeasureEdge[];
|
|
581
|
-
indices: Set<number>;
|
|
582
|
-
} | null;
|
|
583
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
584
|
-
private getFaceData;
|
|
585
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
586
|
-
p1: THREE.Vector3;
|
|
587
|
-
p2: THREE.Vector3;
|
|
588
|
-
p3: THREE.Vector3;
|
|
589
|
-
faceNormal: THREE.Vector3;
|
|
590
|
-
};
|
|
591
|
-
private round;
|
|
592
|
-
}
|
|
593
|
-
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
594
|
-
import * as THREE from "three";
|
|
595
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
596
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
597
|
-
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
598
|
-
/**
|
|
599
|
-
* Object that can efficiently load binary files that contain
|
|
600
|
-
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
601
|
-
*/
|
|
602
|
-
export declare class FragmentsManager extends Component implements Disposable {
|
|
603
|
-
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
604
|
-
/** {@link Disposable.onDisposed} */
|
|
605
|
-
readonly onDisposed: Event<unknown>;
|
|
606
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
607
|
-
readonly onFragmentsDisposed: Event<{
|
|
608
|
-
groupID: string;
|
|
609
|
-
fragmentIDs: string[];
|
|
610
|
-
}>;
|
|
611
|
-
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
612
|
-
readonly list: Map<string, Fragment>;
|
|
613
|
-
readonly groups: Map<string, FragmentsGroup>;
|
|
614
|
-
/** {@link Component.enabled} */
|
|
615
|
-
enabled: boolean;
|
|
616
|
-
baseCoordinationModel: string;
|
|
617
|
-
private _loader;
|
|
618
|
-
/** The list of meshes of the created fragments. */
|
|
619
|
-
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
620
|
-
constructor(components: Components);
|
|
621
|
-
/** {@link Disposable.dispose} */
|
|
622
|
-
dispose(): void;
|
|
623
|
-
disposeGroup(group: FragmentsGroup): void;
|
|
624
|
-
/**
|
|
625
|
-
* Loads a binar file that contain fragment geometry.
|
|
626
|
-
* @param data - The binary data to load.
|
|
627
|
-
* @param config - Optional configuration for loading.
|
|
628
|
-
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
629
|
-
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
630
|
-
* @returns The loaded FragmentsGroup.
|
|
631
|
-
*/
|
|
632
|
-
load(data: Uint8Array, config?: Partial<{
|
|
633
|
-
coordinate: boolean;
|
|
634
|
-
properties: FRAGS.IfcProperties;
|
|
635
|
-
relationsMap: RelationsMap;
|
|
636
|
-
}>): FragmentsGroup;
|
|
637
|
-
/**
|
|
638
|
-
* Export the specified fragments.
|
|
639
|
-
* @param group - the fragments group to be exported.
|
|
640
|
-
* @returns the exported data as binary buffer.
|
|
641
|
-
*/
|
|
642
|
-
export(group: FragmentsGroup): Uint8Array;
|
|
643
|
-
coordinate(models?: FragmentsGroup[]): void;
|
|
644
|
-
}
|
|
645
|
-
import * as WEBIFC from "web-ifc";
|
|
646
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
647
|
-
import { IfcFragmentSettings } from "./src";
|
|
648
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
649
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
650
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
651
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
652
|
-
readonly onSetup: Event<void>;
|
|
653
|
-
/** {@link Disposable.onDisposed} */
|
|
654
|
-
readonly onDisposed: Event<string>;
|
|
655
|
-
settings: IfcFragmentSettings;
|
|
656
|
-
enabled: boolean;
|
|
657
|
-
webIfc: WEBIFC.IfcAPI;
|
|
658
|
-
private _material;
|
|
659
|
-
private _spatialTree;
|
|
660
|
-
private _metaData;
|
|
661
|
-
private _fragmentInstances;
|
|
662
|
-
private _civil;
|
|
663
|
-
private _visitedFragments;
|
|
664
|
-
private _materialT;
|
|
665
|
-
constructor(components: Components);
|
|
666
|
-
dispose(): void;
|
|
667
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
668
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
669
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
670
|
-
private getAllGeometries;
|
|
671
|
-
cleanUp(): void;
|
|
672
|
-
private getMesh;
|
|
673
|
-
private getGeometry;
|
|
674
|
-
private autoSetWasm;
|
|
675
|
-
}
|
|
676
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
677
|
-
export declare class Exploder extends Component implements Disposable {
|
|
678
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
679
|
-
enabled: boolean;
|
|
680
|
-
height: number;
|
|
681
|
-
groupName: string;
|
|
682
|
-
/** {@link Disposable.onDisposed} */
|
|
683
|
-
readonly onDisposed: Event<unknown>;
|
|
684
|
-
list: Set<string>;
|
|
685
|
-
constructor(components: Components);
|
|
686
|
-
dispose(): void;
|
|
687
|
-
set(active: boolean): void;
|
|
688
|
-
}
|
|
689
|
-
import * as WEBIFC from "web-ifc";
|
|
690
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
691
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
692
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
693
|
-
/**
|
|
694
|
-
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
695
|
-
* It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
696
|
-
*/
|
|
697
|
-
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
698
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
699
|
-
/** {@link Disposable.onDisposed} */
|
|
700
|
-
readonly onDisposed: Event<string>;
|
|
701
|
-
enabled: boolean;
|
|
702
|
-
readonly onRelationsIndexed: Event<{
|
|
703
|
-
modelID: string;
|
|
704
|
-
relationsMap: RelationsMap;
|
|
705
|
-
}>;
|
|
706
|
-
private _relToAttributesMap;
|
|
707
|
-
private _inverseAttributes;
|
|
708
|
-
private _ifcRels;
|
|
709
|
-
/**
|
|
710
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
711
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
712
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
713
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
714
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
715
|
-
* of entity relationships within a model.
|
|
716
|
-
*/
|
|
717
|
-
readonly relationMaps: ModelsRelationMap;
|
|
348
|
+
readonly onRelationsIndexed: Event<{
|
|
349
|
+
modelID: string;
|
|
350
|
+
relationsMap: RelationsMap;
|
|
351
|
+
}>;
|
|
352
|
+
private _relToAttributesMap;
|
|
353
|
+
private _inverseAttributes;
|
|
354
|
+
private _ifcRels;
|
|
355
|
+
/**
|
|
356
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
357
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
358
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
359
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
360
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
361
|
+
* of entity relationships within a model.
|
|
362
|
+
*/
|
|
363
|
+
readonly relationMaps: ModelsRelationMap;
|
|
718
364
|
constructor(components: Components);
|
|
719
365
|
private onFragmentsDisposed;
|
|
720
366
|
/**
|
|
@@ -817,227 +463,905 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
817
463
|
*/
|
|
818
464
|
dispose(): void;
|
|
819
465
|
}
|
|
820
|
-
export type { InverseAttribute } from "./src/types";
|
|
821
|
-
import
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
832
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
833
|
-
onPropertiesStreamed: AsyncEvent<{
|
|
834
|
-
type: number;
|
|
835
|
-
data: {
|
|
836
|
-
[id: number]: any;
|
|
837
|
-
};
|
|
838
|
-
}>;
|
|
839
|
-
onProgress: AsyncEvent<number>;
|
|
840
|
-
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
466
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
467
|
+
import { Component, Disposable, Event } from "../Types";
|
|
468
|
+
/**
|
|
469
|
+
* The entry point of the Components library.
|
|
470
|
+
* It can:
|
|
471
|
+
* - Create and access all the components of the library.
|
|
472
|
+
* - Update all the updatable components automatically.
|
|
473
|
+
* - Dispose all the components, preventing memory leaks.
|
|
474
|
+
*/
|
|
475
|
+
export declare class Components implements Disposable {
|
|
476
|
+
static readonly release = "1.4.21";
|
|
841
477
|
/** {@link Disposable.onDisposed} */
|
|
842
|
-
readonly onDisposed: Event<
|
|
478
|
+
readonly onDisposed: Event<void>;
|
|
479
|
+
/** The list of components created in this app. */
|
|
480
|
+
readonly list: Map<string, Component>;
|
|
481
|
+
/** If disabled, the animation loop will be stopped. */
|
|
843
482
|
enabled: boolean;
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
483
|
+
private _clock;
|
|
484
|
+
add(uuid: string, instance: Component): void;
|
|
485
|
+
/**
|
|
486
|
+
* Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
|
|
487
|
+
* doesn't exist, it will instance it automatically.
|
|
488
|
+
*
|
|
489
|
+
* @param Component - The component to get or create.
|
|
490
|
+
*/
|
|
491
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
492
|
+
constructor();
|
|
493
|
+
/**
|
|
494
|
+
* Initializes the library. It should be called at the start of the app after
|
|
495
|
+
* initializing the scene, the renderer and the
|
|
496
|
+
* camera. Additionally, if any component that need a raycaster is
|
|
497
|
+
* used, the {@link raycaster} will need to be initialized.
|
|
498
|
+
*/
|
|
499
|
+
init(): void;
|
|
500
|
+
/**
|
|
501
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
502
|
+
* the library. A memory leak will be created if:
|
|
503
|
+
*
|
|
504
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
505
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
506
|
+
* Angular, Vue, etc).
|
|
507
|
+
*
|
|
508
|
+
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
509
|
+
* referenced by a reference type (object or array).
|
|
510
|
+
*
|
|
511
|
+
* You can learn more about how Three.js handles memory leaks
|
|
512
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
513
|
+
*
|
|
514
|
+
*/
|
|
515
|
+
dispose(): void;
|
|
516
|
+
private update;
|
|
517
|
+
private static setupBVH;
|
|
853
518
|
}
|
|
854
|
-
import * as
|
|
855
|
-
import {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
data: StreamedGeometries;
|
|
862
|
-
}>;
|
|
863
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
864
|
-
onProgress: Event<number>;
|
|
865
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
866
|
-
/** {@link Disposable.onDisposed} */
|
|
867
|
-
readonly onDisposed: Event<unknown>;
|
|
868
|
-
settings: IfcStreamingSettings;
|
|
519
|
+
import * as THREE from "three";
|
|
520
|
+
import { Component, Components } from "../../core";
|
|
521
|
+
export interface MeasureEdge {
|
|
522
|
+
distance: number;
|
|
523
|
+
points: THREE.Vector3[];
|
|
524
|
+
}
|
|
525
|
+
export declare class MeasurementUtils extends Component {
|
|
869
526
|
enabled: boolean;
|
|
870
|
-
|
|
871
|
-
private _spatialTree;
|
|
872
|
-
private _metaData;
|
|
873
|
-
private _visitedGeometries;
|
|
874
|
-
private _streamSerializer;
|
|
875
|
-
private _geometries;
|
|
876
|
-
private _geometryCount;
|
|
877
|
-
private _civil;
|
|
878
|
-
private _groupSerializer;
|
|
879
|
-
private _assets;
|
|
880
|
-
private _meshesWithHoles;
|
|
527
|
+
static uuid: string;
|
|
881
528
|
constructor(components: Components);
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
private
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
529
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
530
|
+
edges: MeasureEdge[];
|
|
531
|
+
indices: Set<number>;
|
|
532
|
+
} | null;
|
|
533
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
534
|
+
private getFaceData;
|
|
535
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
536
|
+
p1: THREE.Vector3;
|
|
537
|
+
p2: THREE.Vector3;
|
|
538
|
+
p3: THREE.Vector3;
|
|
539
|
+
faceNormal: THREE.Vector3;
|
|
540
|
+
};
|
|
541
|
+
private round;
|
|
542
|
+
}
|
|
543
|
+
import * as THREE from "three";
|
|
544
|
+
import { Components } from "../Components";
|
|
545
|
+
import { Component } from "../Types";
|
|
546
|
+
/**
|
|
547
|
+
* A tool to safely remove meshes and geometries from memory to
|
|
548
|
+
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
549
|
+
*/
|
|
550
|
+
export declare class Disposer extends Component {
|
|
551
|
+
private _disposedComponents;
|
|
552
|
+
/** {@link Component.enabled} */
|
|
553
|
+
enabled: boolean;
|
|
554
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
555
|
+
constructor(components: Components);
|
|
556
|
+
/**
|
|
557
|
+
* {@link Component.uuid}.
|
|
558
|
+
* @return the list of UUIDs of deleted components.
|
|
559
|
+
*/
|
|
560
|
+
get(): Set<string>;
|
|
561
|
+
/**
|
|
562
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
563
|
+
* using any of these in other parts of the application, make sure that you
|
|
564
|
+
* remove them from the mesh before disposing it.
|
|
565
|
+
*
|
|
566
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
567
|
+
* to remove.
|
|
568
|
+
*
|
|
569
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
570
|
+
*
|
|
571
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
572
|
+
*/
|
|
573
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
574
|
+
/**
|
|
575
|
+
* Disposes a geometry from memory.
|
|
576
|
+
*
|
|
577
|
+
* @param geometry - the
|
|
578
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
579
|
+
* to remove.
|
|
580
|
+
*/
|
|
581
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
582
|
+
private disposeGeometryAndMaterials;
|
|
583
|
+
private disposeChildren;
|
|
584
|
+
private static disposeMaterial;
|
|
585
|
+
}
|
|
586
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
587
|
+
import { SimpleRaycaster } from "./src";
|
|
588
|
+
import { Components } from "../Components";
|
|
589
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
590
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
591
|
+
enabled: boolean;
|
|
592
|
+
list: Map<string, SimpleRaycaster>;
|
|
593
|
+
onDisposed: Event<unknown>;
|
|
594
|
+
constructor(components: Components);
|
|
595
|
+
get(world: World): SimpleRaycaster;
|
|
596
|
+
delete(world: World): void;
|
|
597
|
+
dispose(): void;
|
|
598
|
+
}
|
|
599
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
600
|
+
import { Components } from "../Components";
|
|
601
|
+
import { SimpleWorld } from "./src";
|
|
602
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
603
|
+
/**
|
|
604
|
+
* A unique identifier for the component.
|
|
605
|
+
* This UUID is used to register the component within the Components system.
|
|
606
|
+
*/
|
|
607
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
608
|
+
/**
|
|
609
|
+
* Event triggered after the update process of all worlds.
|
|
610
|
+
* Subscribers can listen to this event to perform actions post-update.
|
|
611
|
+
*/
|
|
612
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
613
|
+
/**
|
|
614
|
+
* Event triggered before the update process of all worlds.
|
|
615
|
+
* Subscribers can listen to this event to perform actions pre-update.
|
|
616
|
+
*/
|
|
617
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
618
|
+
/**
|
|
619
|
+
* Event triggered when the Worlds component is disposed.
|
|
620
|
+
* Subscribers can listen to this event to perform cleanup actions.
|
|
621
|
+
*/
|
|
622
|
+
readonly onDisposed: Event<unknown>;
|
|
623
|
+
readonly onWorldCreated: Event<World>;
|
|
624
|
+
readonly onWorldDeleted: Event<string>;
|
|
625
|
+
/**
|
|
626
|
+
* A collection of worlds managed by this component.
|
|
627
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
628
|
+
*/
|
|
629
|
+
list: Map<string, World>;
|
|
630
|
+
/**
|
|
631
|
+
* A flag indicating whether the Worlds component is enabled.
|
|
632
|
+
* If false, the update process will be skipped.
|
|
633
|
+
*/
|
|
634
|
+
enabled: boolean;
|
|
635
|
+
constructor(components: Components);
|
|
636
|
+
/**
|
|
637
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
638
|
+
*
|
|
639
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
640
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
641
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
642
|
+
*
|
|
643
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
644
|
+
*/
|
|
645
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
646
|
+
delete(world: World): void;
|
|
647
|
+
dispose(): void;
|
|
648
|
+
update(delta?: number): void | Promise<void>;
|
|
649
|
+
}
|
|
650
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
651
|
+
import * as THREE from "three";
|
|
652
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
653
|
+
center: THREE.Vector3;
|
|
654
|
+
halfSizes: THREE.Vector3;
|
|
655
|
+
rotation: THREE.Matrix3;
|
|
656
|
+
transformation: THREE.Matrix4;
|
|
657
|
+
};
|
|
658
|
+
import * as THREE from "three";
|
|
659
|
+
export declare class MaterialsUtils {
|
|
660
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
661
|
+
}
|
|
662
|
+
export declare class UUID {
|
|
663
|
+
private static _pattern;
|
|
664
|
+
private static _lut;
|
|
665
|
+
static create(): string;
|
|
666
|
+
static validate(uuid: string): void;
|
|
667
|
+
}
|
|
668
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
669
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
670
|
+
import { Components } from "../Components";
|
|
671
|
+
export declare class Grids extends Component implements Disposable {
|
|
672
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
673
|
+
list: Map<string, SimpleGrid>;
|
|
674
|
+
readonly onDisposed: Event<unknown>;
|
|
675
|
+
config: Required<GridConfig>;
|
|
676
|
+
/** {@link Component.enabled} */
|
|
677
|
+
enabled: boolean;
|
|
678
|
+
constructor(components: Components);
|
|
679
|
+
create(world: World): SimpleGrid;
|
|
680
|
+
delete(world: World): void;
|
|
681
|
+
dispose(): void;
|
|
682
|
+
}
|
|
683
|
+
import * as WEBIFC from "web-ifc";
|
|
684
|
+
export interface IfcItemsCategories {
|
|
685
|
+
[itemID: number]: number;
|
|
686
|
+
}
|
|
687
|
+
export declare class IfcCategories {
|
|
688
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
689
|
+
}
|
|
690
|
+
import * as THREE from "three";
|
|
691
|
+
import { Component, Components, Event, World } from "../core";
|
|
692
|
+
export interface VertexPickerConfig {
|
|
693
|
+
showOnlyVertex: boolean;
|
|
694
|
+
snapDistance: number;
|
|
695
|
+
previewElement: HTMLElement;
|
|
696
|
+
}
|
|
697
|
+
export declare class VertexPicker extends Component {
|
|
698
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
699
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
700
|
+
components: Components;
|
|
701
|
+
private _pickedPoint;
|
|
702
|
+
private _config;
|
|
703
|
+
private _enabled;
|
|
704
|
+
private _workingPlane;
|
|
705
|
+
set enabled(value: boolean);
|
|
706
|
+
get enabled(): boolean;
|
|
707
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
708
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
709
|
+
get workingPlane(): THREE.Plane | null;
|
|
710
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
711
|
+
get config(): Partial<VertexPickerConfig>;
|
|
712
|
+
dispose(): void;
|
|
713
|
+
get(world: World): THREE.Vector3 | null;
|
|
714
|
+
private getClosestVertex;
|
|
715
|
+
private getVertices;
|
|
716
|
+
private getVertex;
|
|
717
|
+
}
|
|
718
|
+
export declare const IfcElements: {
|
|
719
|
+
[key: number]: string;
|
|
720
|
+
};
|
|
721
|
+
import * as THREE from "three";
|
|
722
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
723
|
+
import { SimplePlane } from "./src";
|
|
724
|
+
import { Components } from "../Components";
|
|
725
|
+
/**
|
|
726
|
+
* A lightweight component to easily create and handle
|
|
727
|
+
* [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
728
|
+
*
|
|
729
|
+
* @param components - the instance of {@link Components} used.
|
|
730
|
+
* E.g. {@link SimplePlane}.
|
|
731
|
+
*/
|
|
732
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
733
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
734
|
+
/** {@link Createable.onAfterCreate} */
|
|
735
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
736
|
+
/** {@link Createable.onAfterDelete} */
|
|
737
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
738
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
739
|
+
readonly onBeforeDrag: Event<void>;
|
|
740
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
741
|
+
readonly onAfterDrag: Event<void>;
|
|
742
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
743
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
744
|
+
readonly onAfterCancel: Event<unknown>;
|
|
745
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
746
|
+
/** {@link Disposable.onDisposed} */
|
|
747
|
+
readonly onDisposed: Event<string>;
|
|
748
|
+
/**
|
|
749
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
750
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
751
|
+
* clipping plane is created in its roof, which might have a slight
|
|
752
|
+
* slope for draining purposes.
|
|
753
|
+
*/
|
|
754
|
+
orthogonalY: boolean;
|
|
755
|
+
/**
|
|
756
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
757
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
758
|
+
* has to be 'true' for this to apply.
|
|
759
|
+
*/
|
|
760
|
+
toleranceOrthogonalY: number;
|
|
761
|
+
Type: new (...args: any) => SimplePlane;
|
|
762
|
+
list: SimplePlane[];
|
|
763
|
+
/** The material used in all the clipping planes. */
|
|
764
|
+
private _material;
|
|
765
|
+
private _size;
|
|
766
|
+
private _enabled;
|
|
767
|
+
private _visible;
|
|
768
|
+
/** {@link Component.enabled} */
|
|
769
|
+
get enabled(): boolean;
|
|
770
|
+
/** {@link Component.enabled} */
|
|
771
|
+
set enabled(state: boolean);
|
|
772
|
+
/** {@link Hideable.visible } */
|
|
773
|
+
get visible(): boolean;
|
|
774
|
+
/** {@link Hideable.visible } */
|
|
775
|
+
set visible(state: boolean);
|
|
776
|
+
/** The material of the clipping plane representation. */
|
|
777
|
+
get material(): THREE.MeshBasicMaterial;
|
|
778
|
+
/** The material of the clipping plane representation. */
|
|
779
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
780
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
781
|
+
get size(): number;
|
|
782
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
783
|
+
set size(size: number);
|
|
784
|
+
constructor(components: Components);
|
|
785
|
+
/** {@link Disposable.dispose} */
|
|
786
|
+
dispose(): void;
|
|
787
|
+
/** {@link Createable.create} */
|
|
788
|
+
create(world: World): void;
|
|
789
|
+
/**
|
|
790
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
791
|
+
* without the need of the mouse.
|
|
792
|
+
*
|
|
793
|
+
* @param world - the world where this plane should be created.
|
|
794
|
+
* @param normal - the orientation of the clipping plane.
|
|
795
|
+
* @param point - the position of the clipping plane.
|
|
796
|
+
* navigation.
|
|
797
|
+
*/
|
|
798
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
799
|
+
/**
|
|
800
|
+
* {@link Createable.delete}
|
|
801
|
+
*
|
|
802
|
+
* @param world - the world where the plane to delete is.
|
|
803
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
804
|
+
* found under the cursor will be deleted.
|
|
805
|
+
*/
|
|
806
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
807
|
+
/** Deletes all the existing clipping planes. */
|
|
808
|
+
deleteAll(): void;
|
|
809
|
+
private deletePlane;
|
|
810
|
+
private pickPlane;
|
|
811
|
+
private getAllPlaneMeshes;
|
|
812
|
+
private createPlaneFromIntersection;
|
|
813
|
+
private getWorldNormal;
|
|
814
|
+
private normalizePlaneDirectionY;
|
|
815
|
+
private newPlane;
|
|
816
|
+
private updateMaterialsAndPlanes;
|
|
817
|
+
private _onStartDragging;
|
|
818
|
+
private _onEndDragging;
|
|
819
|
+
}
|
|
820
|
+
import { Components } from "../Components";
|
|
821
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
822
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
823
|
+
/**
|
|
824
|
+
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
825
|
+
* that are not visible to the camera.
|
|
826
|
+
*/
|
|
827
|
+
export declare class Cullers extends Component implements Disposable {
|
|
828
|
+
/**
|
|
829
|
+
* A unique identifier for the Cullers component.
|
|
830
|
+
*/
|
|
831
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
832
|
+
/**
|
|
833
|
+
* Indicates whether the Cullers component is enabled.
|
|
834
|
+
*/
|
|
835
|
+
private _enabled;
|
|
836
|
+
/**
|
|
837
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
838
|
+
*/
|
|
839
|
+
list: Map<string, MeshCullerRenderer>;
|
|
840
|
+
/**
|
|
841
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
842
|
+
*/
|
|
843
|
+
readonly onDisposed: Event<unknown>;
|
|
844
|
+
/**
|
|
845
|
+
* Gets the enabled state of the Cullers component.
|
|
846
|
+
*
|
|
847
|
+
* @returns The current enabled state.
|
|
848
|
+
*/
|
|
849
|
+
get enabled(): boolean;
|
|
850
|
+
/**
|
|
851
|
+
* Sets the enabled state of the Cullers component.
|
|
852
|
+
* Also sets the enabled state of all MeshCullerRenderer instances.
|
|
853
|
+
*
|
|
854
|
+
* @param value - The new enabled state.
|
|
855
|
+
*/
|
|
856
|
+
set enabled(value: boolean);
|
|
857
|
+
constructor(components: Components);
|
|
858
|
+
/**
|
|
859
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
860
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
861
|
+
*
|
|
862
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
863
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
864
|
+
*
|
|
865
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
866
|
+
*/
|
|
867
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
868
|
+
delete(world: World): void;
|
|
869
|
+
/** {@link Disposable.dispose} */
|
|
870
|
+
dispose(): void;
|
|
871
|
+
}
|
|
872
|
+
import { MiniMap } from "./src";
|
|
873
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
874
|
+
import { Components } from "../Components";
|
|
875
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
876
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
877
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
878
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
879
|
+
readonly onDisposed: Event<unknown>;
|
|
880
|
+
enabled: boolean;
|
|
881
|
+
list: Map<string, MiniMap>;
|
|
882
|
+
constructor(components: Components);
|
|
883
|
+
create(world: World): MiniMap;
|
|
884
|
+
delete(id: string): void;
|
|
885
|
+
dispose(): void;
|
|
886
|
+
update(): void;
|
|
887
|
+
}
|
|
888
|
+
import * as THREE from "three";
|
|
889
|
+
import { Components } from "../Components";
|
|
890
|
+
import { SimpleCamera } from "..";
|
|
891
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
892
|
+
/**
|
|
893
|
+
* A flexible camera that uses
|
|
894
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
895
|
+
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
896
|
+
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
897
|
+
*/
|
|
898
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
899
|
+
/**
|
|
900
|
+
* The current {@link NavigationMode}.
|
|
901
|
+
*/
|
|
902
|
+
_mode: NavigationMode | null;
|
|
903
|
+
readonly projection: ProjectionManager;
|
|
904
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
905
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
906
|
+
protected readonly _userInputButtons: any;
|
|
907
|
+
protected readonly _frustumSize = 50;
|
|
908
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
909
|
+
private previousSize;
|
|
910
|
+
get mode(): NavigationMode;
|
|
911
|
+
constructor(components: Components);
|
|
912
|
+
/** {@link Disposable.dispose} */
|
|
913
|
+
dispose(): void;
|
|
914
|
+
/**
|
|
915
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
916
|
+
*
|
|
917
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
918
|
+
*/
|
|
919
|
+
set(mode: NavModeID): void;
|
|
920
|
+
/**
|
|
921
|
+
* Make the camera view fit all the specified meshes.
|
|
922
|
+
*
|
|
923
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
924
|
+
* evaluate {@link Components.meshes}.
|
|
925
|
+
* @param offset the distance to the fit object
|
|
926
|
+
*/
|
|
927
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
928
|
+
/**
|
|
929
|
+
* Allows or prevents all user input.
|
|
930
|
+
*
|
|
931
|
+
* @param active - whether to enable or disable user inputs.
|
|
932
|
+
*/
|
|
933
|
+
setUserInput(active: boolean): void;
|
|
934
|
+
private disableUserInput;
|
|
935
|
+
private enableUserInput;
|
|
936
|
+
private newOrthoCamera;
|
|
937
|
+
private setOrthoPerspCameraAspect;
|
|
938
|
+
}
|
|
939
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
940
|
+
export declare class IfcPropertiesUtils {
|
|
941
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
942
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
943
|
+
[attribute: string]: any;
|
|
944
|
+
} | null>;
|
|
945
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
946
|
+
[relatingID: number]: number[];
|
|
947
|
+
}>;
|
|
948
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
949
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
950
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
951
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
952
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
953
|
+
key: string | null;
|
|
954
|
+
name: string | null;
|
|
955
|
+
}>;
|
|
956
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
957
|
+
key: string | null;
|
|
958
|
+
value: number | null;
|
|
959
|
+
}>;
|
|
960
|
+
static isRel(expressID: number): boolean;
|
|
961
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
962
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
963
|
+
}
|
|
964
|
+
export declare const IfcCategoryMap: {
|
|
965
|
+
[key: number]: string;
|
|
966
|
+
};
|
|
967
|
+
export declare const GeometryTypes: Set<number>;
|
|
968
|
+
import { InverseAttribute } from "./types";
|
|
969
|
+
export declare const relToAttributesMap: Map<number, {
|
|
970
|
+
forRelating: InverseAttribute;
|
|
971
|
+
forRelated: InverseAttribute;
|
|
972
|
+
}>;
|
|
973
|
+
import * as WEBIFC from "web-ifc";
|
|
974
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
975
|
+
export declare class SpatialStructure {
|
|
976
|
+
itemsByFloor: IfcItemsCategories;
|
|
977
|
+
private _units;
|
|
978
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
979
|
+
cleanUp(): void;
|
|
980
|
+
}
|
|
981
|
+
import * as THREE from "three";
|
|
982
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
983
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
984
|
+
/** {@link Disposable.onDisposed} */
|
|
985
|
+
readonly onDisposed: Event<unknown>;
|
|
986
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
987
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
988
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
989
|
+
frontOffset: number;
|
|
990
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
991
|
+
backgroundColor: THREE.Color;
|
|
992
|
+
renderer: THREE.WebGLRenderer;
|
|
993
|
+
enabled: boolean;
|
|
994
|
+
world: World;
|
|
995
|
+
private _lockRotation;
|
|
996
|
+
private _camera;
|
|
997
|
+
private _plane;
|
|
998
|
+
private _size;
|
|
999
|
+
private _tempVector1;
|
|
1000
|
+
private _tempVector2;
|
|
1001
|
+
private _tempTarget;
|
|
1002
|
+
private readonly down;
|
|
1003
|
+
get lockRotation(): boolean;
|
|
1004
|
+
set lockRotation(active: boolean);
|
|
1005
|
+
get zoom(): number;
|
|
1006
|
+
set zoom(value: number);
|
|
1007
|
+
constructor(world: World);
|
|
1008
|
+
dispose(): void;
|
|
1009
|
+
get(): THREE.OrthographicCamera;
|
|
1010
|
+
update(): void;
|
|
1011
|
+
getSize(): THREE.Vector2;
|
|
1012
|
+
resize(size?: THREE.Vector2): void;
|
|
1013
|
+
private updatePlanes;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Simple event handler by
|
|
1017
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1018
|
+
* Keep in mind that:
|
|
1019
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
1020
|
+
* an object.
|
|
1021
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1022
|
+
* the callback as an arrow function.
|
|
1023
|
+
*/
|
|
1024
|
+
export declare class Event<T> {
|
|
1025
|
+
/**
|
|
1026
|
+
* Add a callback to this event instance.
|
|
1027
|
+
* @param handler - the callback to be added to this event.
|
|
1028
|
+
*/
|
|
1029
|
+
add(handler: T extends void ? {
|
|
1030
|
+
(): void;
|
|
1031
|
+
} : {
|
|
1032
|
+
(data: T): void;
|
|
1033
|
+
}): void;
|
|
1034
|
+
/**
|
|
1035
|
+
* Removes a callback from this event instance.
|
|
1036
|
+
* @param handler - the callback to be removed from this event.
|
|
1037
|
+
*/
|
|
1038
|
+
remove(handler: T extends void ? {
|
|
1039
|
+
(): void;
|
|
1040
|
+
} : {
|
|
1041
|
+
(data: T): void;
|
|
1042
|
+
}): void;
|
|
1043
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1044
|
+
trigger: (data?: T) => void;
|
|
1045
|
+
/** Gets rid of all the suscribed events. */
|
|
1046
|
+
reset(): void;
|
|
1047
|
+
private handlers;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Simple event handler by
|
|
1051
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1052
|
+
* Keep in mind that:
|
|
1053
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
1054
|
+
* an object.
|
|
1055
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1056
|
+
* the callback as an arrow function.
|
|
1057
|
+
*/
|
|
1058
|
+
export declare class AsyncEvent<T> {
|
|
1059
|
+
/**
|
|
1060
|
+
* Add a callback to this event instance.
|
|
1061
|
+
* @param handler - the callback to be added to this event.
|
|
1062
|
+
*/
|
|
1063
|
+
add(handler: T extends void ? {
|
|
1064
|
+
(): Promise<void>;
|
|
1065
|
+
} : {
|
|
1066
|
+
(data: T): Promise<void>;
|
|
1067
|
+
}): void;
|
|
1068
|
+
/**
|
|
1069
|
+
* Removes a callback from this event instance.
|
|
1070
|
+
* @param handler - the callback to be removed from this event.
|
|
1071
|
+
*/
|
|
1072
|
+
remove(handler: T extends void ? {
|
|
1073
|
+
(): Promise<void>;
|
|
1074
|
+
} : {
|
|
1075
|
+
(data: T): Promise<void>;
|
|
1076
|
+
}): void;
|
|
1077
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1078
|
+
trigger: (data?: T) => Promise<void>;
|
|
1079
|
+
/** Gets rid of all the suscribed events. */
|
|
1080
|
+
reset(): void;
|
|
1081
|
+
private handlers;
|
|
1082
|
+
}
|
|
1083
|
+
import * as THREE from "three";
|
|
1084
|
+
import CameraControls from "camera-controls";
|
|
1085
|
+
import { Event } from "./event";
|
|
1086
|
+
/**
|
|
1087
|
+
* Whether this component has to be manually destroyed once you are done with
|
|
1088
|
+
* it to prevent
|
|
1089
|
+
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1090
|
+
* This also ensures that the DOM events created by that component will be
|
|
1091
|
+
* cleaned up.
|
|
1092
|
+
*/
|
|
1093
|
+
export interface Disposable {
|
|
1094
|
+
/**
|
|
1095
|
+
* Destroys the object from memory to prevent a
|
|
1096
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1097
|
+
*/
|
|
1098
|
+
dispose: () => void | Promise<void>;
|
|
1099
|
+
/** Fired after the tool has been {@link Disposable.dispose()} */
|
|
1100
|
+
readonly onDisposed: Event<any>;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Whether the geometric representation of this component can be
|
|
1104
|
+
* hidden or shown in the
|
|
1105
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1106
|
+
*/
|
|
1107
|
+
export interface Hideable {
|
|
1108
|
+
/**
|
|
1109
|
+
* Whether the geometric representation of this component is
|
|
1110
|
+
* currently visible or not in the
|
|
1111
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1112
|
+
*/
|
|
1113
|
+
visible: boolean;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Whether this component can be resized. The meaning of this can vary depending
|
|
1117
|
+
* on the component: resizing a
|
|
1118
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1119
|
+
* component could mean changing its resolution, whereas resizing a
|
|
1120
|
+
* [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
1121
|
+
*/
|
|
1122
|
+
export interface Resizeable {
|
|
1123
|
+
/**
|
|
1124
|
+
* Sets size of this component (e.g. the resolution of a
|
|
1125
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1126
|
+
* component.
|
|
1127
|
+
*/
|
|
1128
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1129
|
+
/** Event that fires when the component has been resized. */
|
|
1130
|
+
onResize: Event<THREE.Vector2>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Gets the current size of this component (e.g. the resolution of a
|
|
1133
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1134
|
+
* component.
|
|
1135
|
+
*/
|
|
1136
|
+
getSize: () => THREE.Vector2;
|
|
1137
|
+
}
|
|
1138
|
+
/** Whether this component should be updated each frame. */
|
|
1139
|
+
export interface Updateable {
|
|
1140
|
+
/** Actions that should be executed after updating the component. */
|
|
1141
|
+
onAfterUpdate: Event<any>;
|
|
1142
|
+
/** Actions that should be executed before updating the component. */
|
|
1143
|
+
onBeforeUpdate: Event<any>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Function used to update the state of this component each frame. For
|
|
1146
|
+
* instance, a renderer component will make a render each frame.
|
|
1147
|
+
*/
|
|
1148
|
+
update(delta?: number): void;
|
|
1149
|
+
}
|
|
1150
|
+
/** Basic type to describe the progress of any kind of process. */
|
|
1151
|
+
export interface Progress {
|
|
1152
|
+
/** The amount of things that have been done already. */
|
|
1153
|
+
current: number;
|
|
1154
|
+
/** The total amount of things to be done by the process. */
|
|
1155
|
+
total: number;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Whether this component supports create and destroy operations. This generally
|
|
1159
|
+
* applies for components that work with instances, such as clipping planes or
|
|
1160
|
+
* dimensions.
|
|
1161
|
+
*/
|
|
1162
|
+
export interface Createable {
|
|
1163
|
+
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
1164
|
+
create: (data: any) => void;
|
|
1165
|
+
/**
|
|
1166
|
+
* Finish the creation process of the component, successfully creating an
|
|
1167
|
+
* instance of whatever the component creates.
|
|
1168
|
+
*/
|
|
1169
|
+
endCreation?: (data: any) => void;
|
|
1170
|
+
/**
|
|
1171
|
+
* Cancels the creation process of the component, going back to the state
|
|
1172
|
+
* before starting to create.
|
|
1173
|
+
*/
|
|
1174
|
+
cancelCreation?: (data: any) => void;
|
|
1175
|
+
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
1176
|
+
delete: (data: any) => void;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Whether this component supports to be configured.
|
|
1180
|
+
*/
|
|
1181
|
+
export interface Configurable<T extends Record<string, any>> {
|
|
1182
|
+
/** Wether this components has been already configured. */
|
|
1183
|
+
isSetup: boolean;
|
|
1184
|
+
/** Use the provided configuration to setup the tool. */
|
|
1185
|
+
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
1186
|
+
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
1187
|
+
readonly onSetup: Event<any>;
|
|
1188
|
+
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
1189
|
+
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
1190
|
+
*/
|
|
1191
|
+
config: Required<T>;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
|
|
1195
|
+
*/
|
|
1196
|
+
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
1197
|
+
boundsTree: Object | undefined;
|
|
1198
|
+
disposeBoundsTree: () => void;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Whether a camera uses the Camera Controls library.
|
|
1202
|
+
*/
|
|
1203
|
+
export interface CameraControllable {
|
|
1204
|
+
controls: CameraControls;
|
|
1205
|
+
}
|
|
1206
|
+
import { Base } from "./base";
|
|
1207
|
+
import { World } from "./world";
|
|
1208
|
+
import { Event } from "./event";
|
|
1209
|
+
import { Components } from "../../Components";
|
|
1210
|
+
/**
|
|
1211
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
1212
|
+
* or a renderer.
|
|
1213
|
+
*/
|
|
1214
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1215
|
+
readonly worlds: Map<string, World>;
|
|
1216
|
+
readonly onWorldChanged: Event<{
|
|
1217
|
+
world: World;
|
|
1218
|
+
action: "added" | "removed";
|
|
1219
|
+
}>;
|
|
1220
|
+
currentWorld: World | null;
|
|
1221
|
+
protected constructor(components: Components);
|
|
1222
|
+
}
|
|
1223
|
+
import { Base } from "./base";
|
|
1224
|
+
/**
|
|
1225
|
+
* Components are the building blocks of this library. Components are singleton
|
|
1226
|
+
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1227
|
+
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1228
|
+
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1229
|
+
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1230
|
+
* instance.
|
|
1231
|
+
*/
|
|
1232
|
+
export declare abstract class Component extends Base {
|
|
1233
|
+
/**
|
|
1234
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
1235
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1236
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1237
|
+
* will not be updated automatically each frame.
|
|
1238
|
+
*/
|
|
1239
|
+
abstract enabled: boolean;
|
|
1240
|
+
}
|
|
1241
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1242
|
+
import { Components } from "../../Components";
|
|
1243
|
+
/**
|
|
1244
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1245
|
+
*/
|
|
1246
|
+
export declare abstract class Base {
|
|
1247
|
+
components: Components;
|
|
1248
|
+
constructor(components: Components);
|
|
1249
|
+
/** Whether is component is {@link Disposable}. */
|
|
1250
|
+
isDisposeable: () => this is Disposable;
|
|
1251
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1252
|
+
isResizeable: () => this is Resizeable;
|
|
1253
|
+
/** Whether is component is {@link Updateable}. */
|
|
1254
|
+
isUpdateable: () => this is Updateable;
|
|
1255
|
+
/** Whether is component is {@link Hideable}. */
|
|
1256
|
+
isHideable: () => this is Hideable;
|
|
1257
|
+
/** Whether is component is {@link Configurable}. */
|
|
1258
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1259
|
+
}
|
|
1260
|
+
import * as THREE from "three";
|
|
1261
|
+
import { Vector2 } from "three";
|
|
1262
|
+
import { Event } from "./event";
|
|
1263
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1264
|
+
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1265
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1266
|
+
abstract three: THREE.WebGLRenderer;
|
|
1267
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1268
|
+
onAfterUpdate: Event<unknown>;
|
|
1269
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1270
|
+
onBeforeUpdate: Event<unknown>;
|
|
1271
|
+
/** {@link Disposable.onDisposed} */
|
|
1272
|
+
readonly onDisposed: Event<undefined>;
|
|
1273
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
1274
|
+
/**
|
|
1275
|
+
* Event that fires when there has been a change to the list of clipping
|
|
1276
|
+
* planes used by the active renderer.
|
|
1277
|
+
*/
|
|
1278
|
+
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
1279
|
+
abstract update(delta?: number): void | Promise<void>;
|
|
1280
|
+
abstract dispose(): void;
|
|
1281
|
+
abstract getSize(): Vector2;
|
|
1282
|
+
abstract resize(size: Vector2 | undefined): void;
|
|
1283
|
+
/**
|
|
1284
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
1285
|
+
* instance of the renderer.
|
|
1286
|
+
*/
|
|
1287
|
+
clippingPlanes: THREE.Plane[];
|
|
1288
|
+
/**
|
|
1289
|
+
* Forces the update of the clipping planes and all components that depend
|
|
1290
|
+
* on them that are subscribed to 'onClippingPlanesUpdated'.
|
|
1291
|
+
*/
|
|
1292
|
+
updateClippingPlanes(): void;
|
|
1293
|
+
/**
|
|
1294
|
+
* Adds or removes a
|
|
1295
|
+
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
1296
|
+
* to the renderer.
|
|
1297
|
+
*/
|
|
1298
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
893
1299
|
}
|
|
894
1300
|
import * as THREE from "three";
|
|
895
|
-
import
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
components: Components;
|
|
905
|
-
private _pickedPoint;
|
|
906
|
-
private _config;
|
|
907
|
-
private _enabled;
|
|
908
|
-
private _workingPlane;
|
|
909
|
-
set enabled(value: boolean);
|
|
910
|
-
get enabled(): boolean;
|
|
911
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
912
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
913
|
-
get workingPlane(): THREE.Plane | null;
|
|
914
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
915
|
-
get config(): Partial<VertexPickerConfig>;
|
|
916
|
-
dispose(): void;
|
|
917
|
-
get(world: World): THREE.Vector3 | null;
|
|
918
|
-
private getClosestVertex;
|
|
919
|
-
private getVertices;
|
|
920
|
-
private getVertex;
|
|
1301
|
+
import CameraControls from "camera-controls";
|
|
1302
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1303
|
+
import { CameraControllable } from "./interfaces";
|
|
1304
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1305
|
+
abstract enabled: boolean;
|
|
1306
|
+
abstract three: THREE.Camera;
|
|
1307
|
+
abstract controls?: CameraControls;
|
|
1308
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1309
|
+
hasCameraControls: () => this is CameraControllable;
|
|
921
1310
|
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1311
|
+
import * as THREE from "three";
|
|
1312
|
+
import { BaseScene } from "./base-scene";
|
|
1313
|
+
import { BaseCamera } from "./base-camera";
|
|
1314
|
+
import { BaseRenderer } from "./base-renderer";
|
|
1315
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
1316
|
+
export interface World extends Disposable, Updateable {
|
|
1317
|
+
meshes: Set<THREE.Mesh>;
|
|
1318
|
+
scene: BaseScene;
|
|
1319
|
+
camera: BaseCamera;
|
|
1320
|
+
renderer: BaseRenderer | null;
|
|
1321
|
+
uuid: string;
|
|
1322
|
+
isDisposing: boolean;
|
|
930
1323
|
}
|
|
931
1324
|
import * as THREE from "three";
|
|
932
|
-
import {
|
|
933
|
-
|
|
1325
|
+
import { Disposable } from "./interfaces";
|
|
1326
|
+
import { Event } from "./event";
|
|
1327
|
+
import { Components } from "../../Components";
|
|
1328
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1329
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
934
1330
|
/** {@link Disposable.onDisposed} */
|
|
935
1331
|
readonly onDisposed: Event<unknown>;
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
frontOffset: number;
|
|
940
|
-
overrideMaterial: THREE.MeshDepthMaterial;
|
|
941
|
-
backgroundColor: THREE.Color;
|
|
942
|
-
renderer: THREE.WebGLRenderer;
|
|
943
|
-
enabled: boolean;
|
|
944
|
-
world: World;
|
|
945
|
-
private _lockRotation;
|
|
946
|
-
private _camera;
|
|
947
|
-
private _plane;
|
|
948
|
-
private _size;
|
|
949
|
-
private _tempVector1;
|
|
950
|
-
private _tempVector2;
|
|
951
|
-
private _tempTarget;
|
|
952
|
-
private readonly down;
|
|
953
|
-
get lockRotation(): boolean;
|
|
954
|
-
set lockRotation(active: boolean);
|
|
955
|
-
get zoom(): number;
|
|
956
|
-
set zoom(value: number);
|
|
957
|
-
constructor(world: World);
|
|
1332
|
+
abstract three: THREE.Object3D;
|
|
1333
|
+
protected constructor(components: Components);
|
|
1334
|
+
/** {@link Disposable.dispose} */
|
|
958
1335
|
dispose(): void;
|
|
959
|
-
get(): THREE.OrthographicCamera;
|
|
960
|
-
update(): void;
|
|
961
|
-
getSize(): THREE.Vector2;
|
|
962
|
-
resize(size?: THREE.Vector2): void;
|
|
963
|
-
private updatePlanes;
|
|
964
|
-
}
|
|
965
|
-
export declare const GeometryTypes: Set<number>;
|
|
966
|
-
import * as WEBIFC from "web-ifc";
|
|
967
|
-
export interface IfcItemsCategories {
|
|
968
|
-
[itemID: number]: number;
|
|
969
|
-
}
|
|
970
|
-
export declare class IfcCategories {
|
|
971
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
972
|
-
}
|
|
973
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
974
|
-
export declare class IfcPropertiesUtils {
|
|
975
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
976
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
977
|
-
[attribute: string]: any;
|
|
978
|
-
} | null>;
|
|
979
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
980
|
-
[relatingID: number]: number[];
|
|
981
|
-
}>;
|
|
982
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
983
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
984
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
985
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
986
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
987
|
-
key: string | null;
|
|
988
|
-
name: string | null;
|
|
989
|
-
}>;
|
|
990
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
991
|
-
key: string | null;
|
|
992
|
-
value: number | null;
|
|
993
|
-
}>;
|
|
994
|
-
static isRel(expressID: number): boolean;
|
|
995
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
996
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
997
|
-
}
|
|
998
|
-
export declare const IfcCategoryMap: {
|
|
999
|
-
[key: number]: string;
|
|
1000
|
-
};
|
|
1001
|
-
import * as WEBIFC from "web-ifc";
|
|
1002
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
1003
|
-
export declare class SpatialStructure {
|
|
1004
|
-
itemsByFloor: IfcItemsCategories;
|
|
1005
|
-
private _units;
|
|
1006
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1007
|
-
cleanUp(): void;
|
|
1008
1336
|
}
|
|
1009
1337
|
import * as THREE from "three";
|
|
1010
|
-
import {
|
|
1011
|
-
import { Components } from "../../Components";
|
|
1012
|
-
import { Event, World } from "../../Types";
|
|
1338
|
+
import { Disposable, Event } from "../../Types";
|
|
1013
1339
|
/**
|
|
1014
|
-
* A
|
|
1340
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1341
|
+
* to work with tools like the
|
|
1342
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1343
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1015
1344
|
*/
|
|
1016
|
-
export declare class
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
private _intervalID;
|
|
1029
|
-
private readonly _transparentMat;
|
|
1030
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1345
|
+
export declare class Mouse implements Disposable {
|
|
1346
|
+
dom: HTMLCanvasElement;
|
|
1347
|
+
private _event?;
|
|
1348
|
+
private _position;
|
|
1349
|
+
/** {@link Disposable.onDisposed} */
|
|
1350
|
+
readonly onDisposed: Event<unknown>;
|
|
1351
|
+
constructor(dom: HTMLCanvasElement);
|
|
1352
|
+
/**
|
|
1353
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1354
|
+
*/
|
|
1355
|
+
get position(): THREE.Vector2;
|
|
1356
|
+
/** {@link Disposable.dispose} */
|
|
1031
1357
|
dispose(): void;
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
private
|
|
1035
|
-
private
|
|
1358
|
+
private getPositionY;
|
|
1359
|
+
private getPositionX;
|
|
1360
|
+
private updateMouseInfo;
|
|
1361
|
+
private setupEvents;
|
|
1036
1362
|
}
|
|
1037
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1038
|
-
/// <reference types="node" />
|
|
1039
1363
|
import * as THREE from "three";
|
|
1040
|
-
import { Hideable, Event, World } from "../../Types";
|
|
1364
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
1041
1365
|
import { Components } from "../../Components";
|
|
1042
1366
|
export interface GridConfig {
|
|
1043
1367
|
color: THREE.Color;
|
|
@@ -1075,110 +1399,47 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
1075
1399
|
readonly three: THREE.Mesh;
|
|
1076
1400
|
private _fade;
|
|
1077
1401
|
constructor(components: Components, world: World, config: GridConfig);
|
|
1078
|
-
[Symbol.dispose](): void;
|
|
1079
1402
|
/** {@link Disposable.dispose} */
|
|
1080
1403
|
dispose(): void;
|
|
1081
1404
|
private setupEvents;
|
|
1082
1405
|
private updateZoom;
|
|
1083
1406
|
}
|
|
1084
1407
|
import * as THREE from "three";
|
|
1085
|
-
import { Disposable, Event } from "../../Types";
|
|
1086
|
-
/**
|
|
1087
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1088
|
-
* to work with tools like the
|
|
1089
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1090
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1091
|
-
*/
|
|
1092
|
-
export declare class Mouse implements Disposable {
|
|
1093
|
-
dom: HTMLCanvasElement;
|
|
1094
|
-
private _event?;
|
|
1095
|
-
private _position;
|
|
1096
|
-
/** {@link Disposable.onDisposed} */
|
|
1097
|
-
readonly onDisposed: Event<unknown>;
|
|
1098
|
-
constructor(dom: HTMLCanvasElement);
|
|
1099
|
-
/**
|
|
1100
|
-
* The real position of the mouse of the Three.js canvas.
|
|
1101
|
-
*/
|
|
1102
|
-
get position(): THREE.Vector2;
|
|
1103
|
-
/** {@link Disposable.dispose} */
|
|
1104
|
-
dispose(): void;
|
|
1105
|
-
private getPositionY;
|
|
1106
|
-
private getPositionX;
|
|
1107
|
-
private updateMouseInfo;
|
|
1108
|
-
private setupEvents;
|
|
1109
|
-
}
|
|
1110
|
-
import * as THREE from "three";
|
|
1111
1408
|
import { Components } from "../../Components";
|
|
1112
|
-
import {
|
|
1113
|
-
|
|
1114
|
-
updateInterval?: number;
|
|
1115
|
-
width?: number;
|
|
1116
|
-
height?: number;
|
|
1117
|
-
autoUpdate?: boolean;
|
|
1118
|
-
}
|
|
1409
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1410
|
+
import { Mouse } from "./mouse";
|
|
1119
1411
|
/**
|
|
1120
|
-
* A
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
/**
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1136
|
-
*/
|
|
1137
|
-
needsUpdate: boolean;
|
|
1138
|
-
/**
|
|
1139
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
1140
|
-
* for debugging purposes.
|
|
1141
|
-
*/
|
|
1142
|
-
renderDebugFrame: boolean;
|
|
1143
|
-
components: Components;
|
|
1144
|
-
readonly world: World;
|
|
1145
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
1146
|
-
protected autoUpdate: boolean;
|
|
1147
|
-
protected updateInterval: number;
|
|
1148
|
-
protected readonly worker: Worker;
|
|
1149
|
-
protected readonly scene: THREE.Scene;
|
|
1150
|
-
private _width;
|
|
1151
|
-
private _height;
|
|
1152
|
-
private _availableColor;
|
|
1153
|
-
private readonly renderTarget;
|
|
1154
|
-
private readonly bufferSize;
|
|
1155
|
-
private readonly _buffer;
|
|
1156
|
-
protected _isWorkerBusy: boolean;
|
|
1157
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1412
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1413
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1414
|
+
* events.
|
|
1415
|
+
*/
|
|
1416
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1417
|
+
/** {@link Component.enabled} */
|
|
1418
|
+
enabled: boolean;
|
|
1419
|
+
components: Components;
|
|
1420
|
+
/** {@link Disposable.onDisposed} */
|
|
1421
|
+
readonly onDisposed: Event<unknown>;
|
|
1422
|
+
/** The position of the mouse in the screen. */
|
|
1423
|
+
readonly mouse: Mouse;
|
|
1424
|
+
readonly three: THREE.Raycaster;
|
|
1425
|
+
world: World;
|
|
1426
|
+
constructor(components: Components, world: World);
|
|
1158
1427
|
/** {@link Disposable.dispose} */
|
|
1159
1428
|
dispose(): void;
|
|
1160
1429
|
/**
|
|
1161
|
-
*
|
|
1162
|
-
*
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
1430
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1431
|
+
* the first item found. This also takes into account the clipping planes
|
|
1432
|
+
* used by the renderer.
|
|
1433
|
+
*
|
|
1434
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1435
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1436
|
+
* {@link Components.meshes}.
|
|
1165
1437
|
*/
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
b: number;
|
|
1171
|
-
code: string;
|
|
1172
|
-
};
|
|
1173
|
-
protected increaseColor(): void;
|
|
1174
|
-
protected decreaseColor(): void;
|
|
1175
|
-
private applySettings;
|
|
1438
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
1439
|
+
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;
|
|
1440
|
+
private intersect;
|
|
1441
|
+
private filterClippingPlanes;
|
|
1176
1442
|
}
|
|
1177
|
-
import { InverseAttribute } from "./types";
|
|
1178
|
-
export declare const relToAttributesMap: Map<number, {
|
|
1179
|
-
forRelating: InverseAttribute;
|
|
1180
|
-
forRelated: InverseAttribute;
|
|
1181
|
-
}>;
|
|
1182
1443
|
import * as THREE from "three";
|
|
1183
1444
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1184
1445
|
import { Components } from "../../Components";
|
|
@@ -1208,40 +1469,221 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
1208
1469
|
dispose(disposeResources?: boolean): void;
|
|
1209
1470
|
}
|
|
1210
1471
|
import * as THREE from "three";
|
|
1472
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1211
1473
|
import { Components } from "../../Components";
|
|
1212
|
-
|
|
1213
|
-
|
|
1474
|
+
export interface SimpleSceneConfig {
|
|
1475
|
+
directionalLight: {
|
|
1476
|
+
color: THREE.Color;
|
|
1477
|
+
intensity: number;
|
|
1478
|
+
position: THREE.Vector3;
|
|
1479
|
+
};
|
|
1480
|
+
ambientLight: {
|
|
1481
|
+
color: THREE.Color;
|
|
1482
|
+
intensity: number;
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1214
1485
|
/**
|
|
1215
|
-
* A
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1486
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1487
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1488
|
+
* @noInheritDoc
|
|
1218
1489
|
*/
|
|
1219
|
-
export declare class
|
|
1220
|
-
/** {@link
|
|
1490
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1491
|
+
/** {@link Configurable.isSetup} */
|
|
1492
|
+
isSetup: boolean;
|
|
1493
|
+
three: THREE.Scene;
|
|
1494
|
+
/** {@link Configurable.onSetup} */
|
|
1495
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1496
|
+
config: Required<SimpleSceneConfig>;
|
|
1497
|
+
constructor(components: Components);
|
|
1498
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1499
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1500
|
+
}
|
|
1501
|
+
import * as THREE from "three";
|
|
1502
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1503
|
+
import { Components } from "../../Components";
|
|
1504
|
+
/**
|
|
1505
|
+
* A basic renderer capable of rendering
|
|
1506
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1507
|
+
*/
|
|
1508
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1221
1509
|
enabled: boolean;
|
|
1222
|
-
|
|
1510
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1511
|
+
container: HTMLElement;
|
|
1512
|
+
three: THREE.WebGLRenderer;
|
|
1513
|
+
protected _canvas: HTMLCanvasElement;
|
|
1514
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1515
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
1516
|
+
protected onContainerUpdated: Event<unknown>;
|
|
1517
|
+
private _resizing;
|
|
1518
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1519
|
+
/** {@link Updateable.update} */
|
|
1520
|
+
update(): void;
|
|
1521
|
+
/** {@link Disposable.dispose} */
|
|
1522
|
+
dispose(): void;
|
|
1523
|
+
/** {@link Resizeable.getSize}. */
|
|
1524
|
+
getSize(): THREE.Vector2;
|
|
1525
|
+
/** {@link Resizeable.resize} */
|
|
1526
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1527
|
+
setupEvents(active: boolean): void;
|
|
1528
|
+
private resizeEvent;
|
|
1529
|
+
private setupRenderer;
|
|
1530
|
+
private onContextLost;
|
|
1531
|
+
private onContextBack;
|
|
1532
|
+
}
|
|
1533
|
+
import * as THREE from "three";
|
|
1534
|
+
import CameraControls from "camera-controls";
|
|
1535
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1536
|
+
import { Components } from "../../Components";
|
|
1537
|
+
/**
|
|
1538
|
+
* A basic camera that uses
|
|
1539
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1540
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1541
|
+
* what features it offers.
|
|
1542
|
+
*/
|
|
1543
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1544
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1545
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1546
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1547
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1548
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1223
1549
|
/** {@link Disposable.onDisposed} */
|
|
1224
|
-
readonly onDisposed: Event<
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1550
|
+
readonly onDisposed: Event<string>;
|
|
1551
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1552
|
+
private _allControls;
|
|
1553
|
+
/**
|
|
1554
|
+
* The object that controls the camera. An instance of
|
|
1555
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1556
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1557
|
+
* object to move, rotate, look at objects, etc.
|
|
1558
|
+
*/
|
|
1559
|
+
get controls(): CameraControls;
|
|
1560
|
+
/** {@link Component.enabled} */
|
|
1561
|
+
get enabled(): boolean;
|
|
1562
|
+
/** {@link Component.enabled} */
|
|
1563
|
+
set enabled(enabled: boolean);
|
|
1564
|
+
constructor(components: Components);
|
|
1230
1565
|
/** {@link Disposable.dispose} */
|
|
1231
1566
|
dispose(): void;
|
|
1567
|
+
/** {@link Updateable.update} */
|
|
1568
|
+
update(_delta: number): void;
|
|
1232
1569
|
/**
|
|
1233
|
-
*
|
|
1234
|
-
*
|
|
1235
|
-
* used by the renderer.
|
|
1236
|
-
*
|
|
1237
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1238
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
1239
|
-
* {@link Components.meshes}.
|
|
1570
|
+
* Updates the aspect of the camera to match the size of the
|
|
1571
|
+
* {@link Components.renderer}.
|
|
1240
1572
|
*/
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
private
|
|
1244
|
-
private
|
|
1573
|
+
updateAspect: () => void;
|
|
1574
|
+
private setupCamera;
|
|
1575
|
+
private newCameraControls;
|
|
1576
|
+
private setupEvents;
|
|
1577
|
+
private static getSubsetOfThree;
|
|
1578
|
+
}
|
|
1579
|
+
import * as THREE from "three";
|
|
1580
|
+
import * as WEBIFC from "web-ifc";
|
|
1581
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1582
|
+
export declare class CivilReader {
|
|
1583
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1584
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1585
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1586
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1587
|
+
} | undefined;
|
|
1588
|
+
get(civilItems: any): {
|
|
1589
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1590
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1591
|
+
} | undefined;
|
|
1592
|
+
private getCurves;
|
|
1593
|
+
}
|
|
1594
|
+
import * as WEBIFC from "web-ifc";
|
|
1595
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
1596
|
+
export declare class IfcFragmentSettings {
|
|
1597
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
1598
|
+
includeProperties: boolean;
|
|
1599
|
+
/**
|
|
1600
|
+
* Generate the geometry for categories that are not included by default,
|
|
1601
|
+
* like IFCSPACE.
|
|
1602
|
+
*/
|
|
1603
|
+
optionalCategories: number[];
|
|
1604
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
1605
|
+
coordinate: boolean;
|
|
1606
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1607
|
+
wasm: {
|
|
1608
|
+
path: string;
|
|
1609
|
+
absolute: boolean;
|
|
1610
|
+
logLevel?: WEBIFC.LogLevel;
|
|
1611
|
+
};
|
|
1612
|
+
/** List of categories that won't be converted to fragments. */
|
|
1613
|
+
excludedCategories: Set<number>;
|
|
1614
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
1615
|
+
saveLocations: boolean;
|
|
1616
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1617
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
1618
|
+
autoSetWasm: boolean;
|
|
1619
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1620
|
+
}
|
|
1621
|
+
import * as WEBIFC from "web-ifc";
|
|
1622
|
+
export declare class IfcMetadataReader {
|
|
1623
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
1624
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
1625
|
+
}
|
|
1626
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
1627
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1628
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1629
|
+
minGeometrySize: number;
|
|
1630
|
+
minAssetsSize: number;
|
|
1631
|
+
}
|
|
1632
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1633
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1634
|
+
propertiesSize: number;
|
|
1635
|
+
}
|
|
1636
|
+
import * as WEBIFC from "web-ifc";
|
|
1637
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1638
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1639
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1640
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1641
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1642
|
+
type: number;
|
|
1643
|
+
data: {
|
|
1644
|
+
[id: number]: any;
|
|
1645
|
+
};
|
|
1646
|
+
}>;
|
|
1647
|
+
onProgress: AsyncEvent<number>;
|
|
1648
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1649
|
+
/** {@link Disposable.onDisposed} */
|
|
1650
|
+
readonly onDisposed: Event<string>;
|
|
1651
|
+
enabled: boolean;
|
|
1652
|
+
settings: PropertiesStreamingSettings;
|
|
1653
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1654
|
+
dispose(): Promise<void>;
|
|
1655
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1656
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1657
|
+
private readIfcFile;
|
|
1658
|
+
private streamIfcFile;
|
|
1659
|
+
private streamAllProperties;
|
|
1660
|
+
private getIndices;
|
|
1661
|
+
private cleanUp;
|
|
1662
|
+
}
|
|
1663
|
+
export interface StreamedGeometries {
|
|
1664
|
+
[id: number]: {
|
|
1665
|
+
boundingBox: Float32Array;
|
|
1666
|
+
hasHoles: boolean;
|
|
1667
|
+
geometryFile?: string;
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1670
|
+
export interface StreamedAsset {
|
|
1671
|
+
id: number;
|
|
1672
|
+
geometries: {
|
|
1673
|
+
geometryID: number;
|
|
1674
|
+
transformation: number[];
|
|
1675
|
+
color: number[];
|
|
1676
|
+
}[];
|
|
1677
|
+
}
|
|
1678
|
+
import * as WEBIFC from "web-ifc";
|
|
1679
|
+
import * as THREE from "three";
|
|
1680
|
+
export declare class Units {
|
|
1681
|
+
factor: number;
|
|
1682
|
+
complement: number;
|
|
1683
|
+
apply(matrix: THREE.Matrix4): void;
|
|
1684
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1685
|
+
private getLengthUnits;
|
|
1686
|
+
private getScaleMatrix;
|
|
1245
1687
|
}
|
|
1246
1688
|
import * as THREE from "three";
|
|
1247
1689
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -1304,249 +1746,22 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1304
1746
|
private newHelper;
|
|
1305
1747
|
private static newPlaneMesh;
|
|
1306
1748
|
}
|
|
1307
|
-
import * as THREE from "three";
|
|
1308
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1309
|
-
import { Components } from "../../Components";
|
|
1310
|
-
export interface SimpleSceneConfig {
|
|
1311
|
-
directionalLight: {
|
|
1312
|
-
color: THREE.Color;
|
|
1313
|
-
intensity: number;
|
|
1314
|
-
position: THREE.Vector3;
|
|
1315
|
-
};
|
|
1316
|
-
ambientLight: {
|
|
1317
|
-
color: THREE.Color;
|
|
1318
|
-
intensity: number;
|
|
1319
|
-
};
|
|
1320
|
-
}
|
|
1321
|
-
/**
|
|
1322
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1323
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1324
|
-
* @noInheritDoc
|
|
1325
|
-
*/
|
|
1326
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1327
|
-
/** {@link Configurable.isSetup} */
|
|
1328
|
-
isSetup: boolean;
|
|
1329
|
-
three: THREE.Scene;
|
|
1330
|
-
/** {@link Configurable.onSetup} */
|
|
1331
|
-
readonly onSetup: Event<SimpleScene>;
|
|
1332
|
-
config: Required<SimpleSceneConfig>;
|
|
1333
|
-
constructor(components: Components);
|
|
1334
|
-
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1335
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1336
|
-
}
|
|
1337
1749
|
import { NavigationMode } from "./types";
|
|
1338
1750
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1339
1751
|
/**
|
|
1340
1752
|
* A {@link NavigationMode} that allows first person navigation,
|
|
1341
|
-
* simulating FPS video games.
|
|
1342
|
-
*/
|
|
1343
|
-
export declare class FirstPersonMode implements NavigationMode {
|
|
1344
|
-
private camera;
|
|
1345
|
-
/** {@link NavigationMode.enabled} */
|
|
1346
|
-
enabled: boolean;
|
|
1347
|
-
/** {@link NavigationMode.id} */
|
|
1348
|
-
readonly id = "FirstPerson";
|
|
1349
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
1350
|
-
/** {@link NavigationMode.set} */
|
|
1351
|
-
set(active: boolean): void;
|
|
1352
|
-
private setupFirstPersonCamera;
|
|
1353
|
-
}
|
|
1354
|
-
import * as THREE from "three";
|
|
1355
|
-
import CameraControls from "camera-controls";
|
|
1356
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1357
|
-
import { Components } from "../../Components";
|
|
1358
|
-
/**
|
|
1359
|
-
* A basic camera that uses
|
|
1360
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1361
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1362
|
-
* what features it offers.
|
|
1363
|
-
*/
|
|
1364
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1365
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1366
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1367
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1368
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1369
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
1370
|
-
/** {@link Disposable.onDisposed} */
|
|
1371
|
-
readonly onDisposed: Event<string>;
|
|
1372
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1373
|
-
private _allControls;
|
|
1374
|
-
/**
|
|
1375
|
-
* The object that controls the camera. An instance of
|
|
1376
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1377
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
1378
|
-
* object to move, rotate, look at objects, etc.
|
|
1379
|
-
*/
|
|
1380
|
-
get controls(): CameraControls;
|
|
1381
|
-
/** {@link Component.enabled} */
|
|
1382
|
-
get enabled(): boolean;
|
|
1383
|
-
/** {@link Component.enabled} */
|
|
1384
|
-
set enabled(enabled: boolean);
|
|
1385
|
-
constructor(components: Components);
|
|
1386
|
-
/** {@link Disposable.dispose} */
|
|
1387
|
-
dispose(): void;
|
|
1388
|
-
/** {@link Updateable.update} */
|
|
1389
|
-
update(_delta: number): void;
|
|
1390
|
-
/**
|
|
1391
|
-
* Updates the aspect of the camera to match the size of the
|
|
1392
|
-
* {@link Components.renderer}.
|
|
1393
|
-
*/
|
|
1394
|
-
updateAspect: () => void;
|
|
1395
|
-
private setupCamera;
|
|
1396
|
-
private newCameraControls;
|
|
1397
|
-
private setupEvents;
|
|
1398
|
-
private static getSubsetOfThree;
|
|
1399
|
-
}
|
|
1400
|
-
import * as THREE from "three";
|
|
1401
|
-
import { CameraProjection } from "./types";
|
|
1402
|
-
import { Event } from "../../Types";
|
|
1403
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
1404
|
-
/**
|
|
1405
|
-
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1406
|
-
*/
|
|
1407
|
-
export declare class ProjectionManager {
|
|
1408
|
-
/**
|
|
1409
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
1410
|
-
*/
|
|
1411
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
1412
|
-
current: CameraProjection;
|
|
1413
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1414
|
-
private _component;
|
|
1415
|
-
private _previousDistance;
|
|
1416
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1417
|
-
matchOrthoDistanceEnabled: boolean;
|
|
1418
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
1419
|
-
/**
|
|
1420
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1421
|
-
*
|
|
1422
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
1423
|
-
* it will have no effect.
|
|
1424
|
-
*/
|
|
1425
|
-
set(projection: CameraProjection): Promise<void>;
|
|
1426
|
-
/**
|
|
1427
|
-
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
1428
|
-
* and vice versa.
|
|
1429
|
-
*/
|
|
1430
|
-
toggle(): Promise<void>;
|
|
1431
|
-
private setOrthoCamera;
|
|
1432
|
-
private getPerspectiveDims;
|
|
1433
|
-
private setupOrthoCamera;
|
|
1434
|
-
private getDistance;
|
|
1435
|
-
private setPerspectiveCamera;
|
|
1436
|
-
}
|
|
1437
|
-
import { NavigationMode } from "./types";
|
|
1438
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
1439
|
-
/**
|
|
1440
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1441
|
-
* like many BIM tools.
|
|
1442
|
-
*/
|
|
1443
|
-
export declare class PlanMode implements NavigationMode {
|
|
1444
|
-
private camera;
|
|
1445
|
-
/** {@link NavigationMode.enabled} */
|
|
1446
|
-
enabled: boolean;
|
|
1447
|
-
/** {@link NavigationMode.id} */
|
|
1448
|
-
readonly id = "Plan";
|
|
1449
|
-
private mouseAction1?;
|
|
1450
|
-
private mouseAction2?;
|
|
1451
|
-
private mouseInitialized;
|
|
1452
|
-
private readonly defaultAzimuthSpeed;
|
|
1453
|
-
private readonly defaultPolarSpeed;
|
|
1454
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
1455
|
-
/** {@link NavigationMode.set} */
|
|
1456
|
-
set(active: boolean): void;
|
|
1457
|
-
}
|
|
1458
|
-
/**
|
|
1459
|
-
* The projection system of the camera.
|
|
1460
|
-
*/
|
|
1461
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
1462
|
-
/**
|
|
1463
|
-
* The extensible list of supported navigation modes.
|
|
1464
|
-
*/
|
|
1465
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1466
|
-
/**
|
|
1467
|
-
* An object that determines the behavior of the camera controls
|
|
1468
|
-
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1469
|
-
*/
|
|
1470
|
-
export interface NavigationMode {
|
|
1471
|
-
/** The unique ID of this navigation mode. */
|
|
1472
|
-
id: NavModeID;
|
|
1473
|
-
/**
|
|
1474
|
-
* Enable or disable this navigation mode.
|
|
1475
|
-
* When a new navigation mode is enabled, the previous navigation mode
|
|
1476
|
-
* must be disabled.
|
|
1477
|
-
*
|
|
1478
|
-
* @param active - whether to enable or disable this mode.
|
|
1479
|
-
* @param options - any additional data required to enable or disable it.
|
|
1480
|
-
* */
|
|
1481
|
-
set: (active: boolean, options?: any) => void;
|
|
1482
|
-
/** Whether this navigation mode is active or not. */
|
|
1483
|
-
enabled: boolean;
|
|
1484
|
-
}
|
|
1485
|
-
import * as THREE from "three";
|
|
1486
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
1487
|
-
import { Components } from "../../Components";
|
|
1488
|
-
/**
|
|
1489
|
-
* A basic renderer capable of rendering
|
|
1490
|
-
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1491
|
-
*/
|
|
1492
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
1493
|
-
enabled: boolean;
|
|
1494
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1495
|
-
container: HTMLElement;
|
|
1496
|
-
three: THREE.WebGLRenderer;
|
|
1497
|
-
protected _canvas: HTMLCanvasElement;
|
|
1498
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1499
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
1500
|
-
protected onContainerUpdated: Event<unknown>;
|
|
1501
|
-
private _resizing;
|
|
1502
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1503
|
-
/** {@link Updateable.update} */
|
|
1504
|
-
update(): void;
|
|
1505
|
-
/** {@link Disposable.dispose} */
|
|
1506
|
-
dispose(): void;
|
|
1507
|
-
/** {@link Resizeable.getSize}. */
|
|
1508
|
-
getSize(): THREE.Vector2;
|
|
1509
|
-
/** {@link Resizeable.resize} */
|
|
1510
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1511
|
-
setupEvents(active: boolean): void;
|
|
1512
|
-
private resizeEvent;
|
|
1513
|
-
private setupRenderer;
|
|
1514
|
-
private onContextLost;
|
|
1515
|
-
private onContextBack;
|
|
1516
|
-
}
|
|
1517
|
-
/**
|
|
1518
|
-
* Simple event handler by
|
|
1519
|
-
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1520
|
-
* Keep in mind that:
|
|
1521
|
-
* - If you want to remove it later, you might want to declare the callback as
|
|
1522
|
-
* an object.
|
|
1523
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1524
|
-
* the callback as an arrow function.
|
|
1525
|
-
*/
|
|
1526
|
-
export declare class Event<T> {
|
|
1527
|
-
/**
|
|
1528
|
-
* Add a callback to this event instance.
|
|
1529
|
-
* @param handler - the callback to be added to this event.
|
|
1530
|
-
*/
|
|
1531
|
-
add(handler: T extends void ? {
|
|
1532
|
-
(): void;
|
|
1533
|
-
} : {
|
|
1534
|
-
(data: T): void;
|
|
1535
|
-
}): void;
|
|
1536
|
-
/**
|
|
1537
|
-
* Removes a callback from this event instance.
|
|
1538
|
-
* @param handler - the callback to be removed from this event.
|
|
1539
|
-
*/
|
|
1540
|
-
remove(handler: T extends void ? {
|
|
1541
|
-
(): void;
|
|
1542
|
-
} : {
|
|
1543
|
-
(data: T): void;
|
|
1544
|
-
}): void;
|
|
1545
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
1546
|
-
trigger: (data?: T) => void;
|
|
1547
|
-
/** Gets rid of all the suscribed events. */
|
|
1548
|
-
reset(): void;
|
|
1549
|
-
private handlers;
|
|
1753
|
+
* simulating FPS video games.
|
|
1754
|
+
*/
|
|
1755
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1756
|
+
private camera;
|
|
1757
|
+
/** {@link NavigationMode.enabled} */
|
|
1758
|
+
enabled: boolean;
|
|
1759
|
+
/** {@link NavigationMode.id} */
|
|
1760
|
+
readonly id = "FirstPerson";
|
|
1761
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1762
|
+
/** {@link NavigationMode.set} */
|
|
1763
|
+
set(active: boolean): void;
|
|
1764
|
+
private setupFirstPersonCamera;
|
|
1550
1765
|
}
|
|
1551
1766
|
import { NavigationMode } from "./types";
|
|
1552
1767
|
import { OrthoPerspectiveCamera } from "../index";
|
|
@@ -1565,391 +1780,186 @@ export declare class OrbitMode implements NavigationMode {
|
|
|
1565
1780
|
set(active: boolean): void;
|
|
1566
1781
|
private activateOrbitControls;
|
|
1567
1782
|
}
|
|
1783
|
+
import { NavigationMode } from "./types";
|
|
1784
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1568
1785
|
/**
|
|
1569
|
-
*
|
|
1570
|
-
*
|
|
1571
|
-
* Keep in mind that:
|
|
1572
|
-
* - If you want to remove it later, you might want to declare the callback as
|
|
1573
|
-
* an object.
|
|
1574
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1575
|
-
* the callback as an arrow function.
|
|
1576
|
-
*/
|
|
1577
|
-
export declare class AsyncEvent<T> {
|
|
1578
|
-
/**
|
|
1579
|
-
* Add a callback to this event instance.
|
|
1580
|
-
* @param handler - the callback to be added to this event.
|
|
1581
|
-
*/
|
|
1582
|
-
add(handler: T extends void ? {
|
|
1583
|
-
(): Promise<void>;
|
|
1584
|
-
} : {
|
|
1585
|
-
(data: T): Promise<void>;
|
|
1586
|
-
}): void;
|
|
1587
|
-
/**
|
|
1588
|
-
* Removes a callback from this event instance.
|
|
1589
|
-
* @param handler - the callback to be removed from this event.
|
|
1590
|
-
*/
|
|
1591
|
-
remove(handler: T extends void ? {
|
|
1592
|
-
(): Promise<void>;
|
|
1593
|
-
} : {
|
|
1594
|
-
(data: T): Promise<void>;
|
|
1595
|
-
}): void;
|
|
1596
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
1597
|
-
trigger: (data?: T) => Promise<void>;
|
|
1598
|
-
/** Gets rid of all the suscribed events. */
|
|
1599
|
-
reset(): void;
|
|
1600
|
-
private handlers;
|
|
1601
|
-
}
|
|
1602
|
-
import { Base } from "./base";
|
|
1603
|
-
/**
|
|
1604
|
-
* Components are the building blocks of this library. Components are singleton
|
|
1605
|
-
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1606
|
-
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1607
|
-
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1608
|
-
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1609
|
-
* instance.
|
|
1786
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1787
|
+
* like many BIM tools.
|
|
1610
1788
|
*/
|
|
1611
|
-
export declare
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1789
|
+
export declare class PlanMode implements NavigationMode {
|
|
1790
|
+
private camera;
|
|
1791
|
+
/** {@link NavigationMode.enabled} */
|
|
1792
|
+
enabled: boolean;
|
|
1793
|
+
/** {@link NavigationMode.id} */
|
|
1794
|
+
readonly id = "Plan";
|
|
1795
|
+
private mouseAction1?;
|
|
1796
|
+
private mouseAction2?;
|
|
1797
|
+
private mouseInitialized;
|
|
1798
|
+
private readonly defaultAzimuthSpeed;
|
|
1799
|
+
private readonly defaultPolarSpeed;
|
|
1800
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1801
|
+
/** {@link NavigationMode.set} */
|
|
1802
|
+
set(active: boolean): void;
|
|
1619
1803
|
}
|
|
1620
1804
|
import * as THREE from "three";
|
|
1621
|
-
import
|
|
1622
|
-
import { Event } from "
|
|
1623
|
-
|
|
1624
|
-
* Whether this component has to be manually destroyed once you are done with
|
|
1625
|
-
* it to prevent
|
|
1626
|
-
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1627
|
-
* This also ensures that the DOM events created by that component will be
|
|
1628
|
-
* cleaned up.
|
|
1629
|
-
*/
|
|
1630
|
-
export interface Disposable {
|
|
1631
|
-
/**
|
|
1632
|
-
* Destroys the object from memory to prevent a
|
|
1633
|
-
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1634
|
-
*/
|
|
1635
|
-
dispose: () => void | Promise<void>;
|
|
1636
|
-
/** Fired after the tool has been {@link Disposable.dispose()} */
|
|
1637
|
-
readonly onDisposed: Event<any>;
|
|
1638
|
-
}
|
|
1639
|
-
/**
|
|
1640
|
-
* Whether the geometric representation of this component can be
|
|
1641
|
-
* hidden or shown in the
|
|
1642
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1643
|
-
*/
|
|
1644
|
-
export interface Hideable {
|
|
1645
|
-
/**
|
|
1646
|
-
* Whether the geometric representation of this component is
|
|
1647
|
-
* currently visible or not in the
|
|
1648
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1649
|
-
*/
|
|
1650
|
-
visible: boolean;
|
|
1651
|
-
}
|
|
1805
|
+
import { CameraProjection } from "./types";
|
|
1806
|
+
import { Event } from "../../Types";
|
|
1807
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1652
1808
|
/**
|
|
1653
|
-
*
|
|
1654
|
-
* on the component: resizing a
|
|
1655
|
-
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1656
|
-
* component could mean changing its resolution, whereas resizing a
|
|
1657
|
-
* [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
1809
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1658
1810
|
*/
|
|
1659
|
-
export
|
|
1660
|
-
/**
|
|
1661
|
-
* Sets size of this component (e.g. the resolution of a
|
|
1662
|
-
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1663
|
-
* component.
|
|
1664
|
-
*/
|
|
1665
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1666
|
-
/** Event that fires when the component has been resized. */
|
|
1667
|
-
onResize: Event<THREE.Vector2>;
|
|
1668
|
-
/**
|
|
1669
|
-
* Gets the current size of this component (e.g. the resolution of a
|
|
1670
|
-
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1671
|
-
* component.
|
|
1672
|
-
*/
|
|
1673
|
-
getSize: () => THREE.Vector2;
|
|
1674
|
-
}
|
|
1675
|
-
/** Whether this component should be updated each frame. */
|
|
1676
|
-
export interface Updateable {
|
|
1677
|
-
/** Actions that should be executed after updating the component. */
|
|
1678
|
-
onAfterUpdate: Event<any>;
|
|
1679
|
-
/** Actions that should be executed before updating the component. */
|
|
1680
|
-
onBeforeUpdate: Event<any>;
|
|
1811
|
+
export declare class ProjectionManager {
|
|
1681
1812
|
/**
|
|
1682
|
-
*
|
|
1683
|
-
* instance, a renderer component will make a render each frame.
|
|
1813
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
1684
1814
|
*/
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
}
|
|
1694
|
-
/**
|
|
1695
|
-
* Whether this component supports create and destroy operations. This generally
|
|
1696
|
-
* applies for components that work with instances, such as clipping planes or
|
|
1697
|
-
* dimensions.
|
|
1698
|
-
*/
|
|
1699
|
-
export interface Createable {
|
|
1700
|
-
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
1701
|
-
create: (data: any) => void;
|
|
1815
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
1816
|
+
current: CameraProjection;
|
|
1817
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1818
|
+
private _component;
|
|
1819
|
+
private _previousDistance;
|
|
1820
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1821
|
+
matchOrthoDistanceEnabled: boolean;
|
|
1822
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1702
1823
|
/**
|
|
1703
|
-
*
|
|
1704
|
-
*
|
|
1824
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1825
|
+
*
|
|
1826
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
1827
|
+
* it will have no effect.
|
|
1705
1828
|
*/
|
|
1706
|
-
|
|
1829
|
+
set(projection: CameraProjection): Promise<void>;
|
|
1707
1830
|
/**
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
1710
|
-
*/
|
|
1711
|
-
cancelCreation?: (data: any) => void;
|
|
1712
|
-
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
1713
|
-
delete: (data: any) => void;
|
|
1714
|
-
}
|
|
1715
|
-
/**
|
|
1716
|
-
* Whether this component supports to be configured.
|
|
1717
|
-
*/
|
|
1718
|
-
export interface Configurable<T extends Record<string, any>> {
|
|
1719
|
-
/** Wether this components has been already configured. */
|
|
1720
|
-
isSetup: boolean;
|
|
1721
|
-
/** Use the provided configuration to setup the tool. */
|
|
1722
|
-
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
1723
|
-
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
1724
|
-
readonly onSetup: Event<any>;
|
|
1725
|
-
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
1726
|
-
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
1831
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
1832
|
+
* and vice versa.
|
|
1727
1833
|
*/
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
boundsTree: Object | undefined;
|
|
1735
|
-
disposeBoundsTree: () => void;
|
|
1834
|
+
toggle(): Promise<void>;
|
|
1835
|
+
private setOrthoCamera;
|
|
1836
|
+
private getPerspectiveDims;
|
|
1837
|
+
private setupOrthoCamera;
|
|
1838
|
+
private getDistance;
|
|
1839
|
+
private setPerspectiveCamera;
|
|
1736
1840
|
}
|
|
1737
1841
|
/**
|
|
1738
|
-
*
|
|
1842
|
+
* The projection system of the camera.
|
|
1739
1843
|
*/
|
|
1740
|
-
export
|
|
1741
|
-
controls: CameraControls;
|
|
1742
|
-
}
|
|
1743
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1744
|
-
import { Components } from "../../Components";
|
|
1844
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
1745
1845
|
/**
|
|
1746
|
-
*
|
|
1846
|
+
* The extensible list of supported navigation modes.
|
|
1747
1847
|
*/
|
|
1748
|
-
export
|
|
1749
|
-
components: Components;
|
|
1750
|
-
constructor(components: Components);
|
|
1751
|
-
/** Whether is component is {@link Disposable}. */
|
|
1752
|
-
isDisposeable: () => this is Disposable;
|
|
1753
|
-
/** Whether is component is {@link Resizeable}. */
|
|
1754
|
-
isResizeable: () => this is Resizeable;
|
|
1755
|
-
/** Whether is component is {@link Updateable}. */
|
|
1756
|
-
isUpdateable: () => this is Updateable;
|
|
1757
|
-
/** Whether is component is {@link Hideable}. */
|
|
1758
|
-
isHideable: () => this is Hideable;
|
|
1759
|
-
/** Whether is component is {@link Configurable}. */
|
|
1760
|
-
isConfigurable: () => this is Configurable<any>;
|
|
1761
|
-
}
|
|
1762
|
-
import { Base } from "./base";
|
|
1763
|
-
import { World } from "./world";
|
|
1764
|
-
import { Event } from "./event";
|
|
1765
|
-
import { Components } from "../../Components";
|
|
1848
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1766
1849
|
/**
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1850
|
+
* An object that determines the behavior of the camera controls
|
|
1851
|
+
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1769
1852
|
*/
|
|
1770
|
-
export
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1853
|
+
export interface NavigationMode {
|
|
1854
|
+
/** The unique ID of this navigation mode. */
|
|
1855
|
+
id: NavModeID;
|
|
1856
|
+
/**
|
|
1857
|
+
* Enable or disable this navigation mode.
|
|
1858
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
1859
|
+
* must be disabled.
|
|
1860
|
+
*
|
|
1861
|
+
* @param active - whether to enable or disable this mode.
|
|
1862
|
+
* @param options - any additional data required to enable or disable it.
|
|
1863
|
+
* */
|
|
1864
|
+
set: (active: boolean, options?: any) => void;
|
|
1865
|
+
/** Whether this navigation mode is active or not. */
|
|
1866
|
+
enabled: boolean;
|
|
1778
1867
|
}
|
|
1779
1868
|
import * as THREE from "three";
|
|
1780
|
-
import
|
|
1781
|
-
import {
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
/** Whether is instance is {@link CameraControllable}. */
|
|
1788
|
-
hasCameraControls: () => this is CameraControllable;
|
|
1869
|
+
import { Components } from "../../Components";
|
|
1870
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
1871
|
+
export interface CullerRendererSettings {
|
|
1872
|
+
updateInterval?: number;
|
|
1873
|
+
width?: number;
|
|
1874
|
+
height?: number;
|
|
1875
|
+
autoUpdate?: boolean;
|
|
1789
1876
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1795
|
-
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1796
|
-
abstract three: THREE.WebGLRenderer;
|
|
1797
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1798
|
-
onAfterUpdate: Event<unknown>;
|
|
1799
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1800
|
-
onBeforeUpdate: Event<unknown>;
|
|
1877
|
+
/**
|
|
1878
|
+
* A base renderer to determine visibility on screen
|
|
1879
|
+
*/
|
|
1880
|
+
export declare class CullerRenderer {
|
|
1801
1881
|
/** {@link Disposable.onDisposed} */
|
|
1802
|
-
readonly onDisposed: Event<
|
|
1803
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
1804
|
-
/**
|
|
1805
|
-
* Event that fires when there has been a change to the list of clipping
|
|
1806
|
-
* planes used by the active renderer.
|
|
1807
|
-
*/
|
|
1808
|
-
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
1809
|
-
abstract update(delta?: number): void | Promise<void>;
|
|
1810
|
-
abstract dispose(): void;
|
|
1811
|
-
abstract getSize(): Vector2;
|
|
1812
|
-
abstract resize(size: Vector2 | undefined): void;
|
|
1882
|
+
readonly onDisposed: Event<string>;
|
|
1813
1883
|
/**
|
|
1814
|
-
*
|
|
1815
|
-
*
|
|
1884
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1885
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1886
|
+
* just before but not anymore.
|
|
1816
1887
|
*/
|
|
1817
|
-
|
|
1888
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1889
|
+
/** {@link Component.enabled} */
|
|
1890
|
+
enabled: boolean;
|
|
1818
1891
|
/**
|
|
1819
|
-
*
|
|
1820
|
-
*
|
|
1892
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1893
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1821
1894
|
*/
|
|
1822
|
-
|
|
1895
|
+
needsUpdate: boolean;
|
|
1823
1896
|
/**
|
|
1824
|
-
*
|
|
1825
|
-
*
|
|
1826
|
-
* to the renderer.
|
|
1897
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1898
|
+
* for debugging purposes.
|
|
1827
1899
|
*/
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1900
|
+
renderDebugFrame: boolean;
|
|
1901
|
+
components: Components;
|
|
1902
|
+
readonly world: World;
|
|
1903
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1904
|
+
protected autoUpdate: boolean;
|
|
1905
|
+
protected updateInterval: number;
|
|
1906
|
+
protected readonly worker: Worker;
|
|
1907
|
+
protected readonly scene: THREE.Scene;
|
|
1908
|
+
private _width;
|
|
1909
|
+
private _height;
|
|
1910
|
+
private _availableColor;
|
|
1911
|
+
private readonly renderTarget;
|
|
1912
|
+
private readonly bufferSize;
|
|
1913
|
+
private readonly _buffer;
|
|
1914
|
+
protected _isWorkerBusy: boolean;
|
|
1915
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1840
1916
|
/** {@link Disposable.dispose} */
|
|
1841
1917
|
dispose(): void;
|
|
1842
|
-
}
|
|
1843
|
-
import * as THREE from "three";
|
|
1844
|
-
import { BaseScene } from "./base-scene";
|
|
1845
|
-
import { BaseCamera } from "./base-camera";
|
|
1846
|
-
import { BaseRenderer } from "./base-renderer";
|
|
1847
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
1848
|
-
export interface World extends Disposable, Updateable {
|
|
1849
|
-
meshes: Set<THREE.Mesh>;
|
|
1850
|
-
scene: BaseScene;
|
|
1851
|
-
camera: BaseCamera;
|
|
1852
|
-
renderer: BaseRenderer | null;
|
|
1853
|
-
uuid: string;
|
|
1854
|
-
isDisposing: boolean;
|
|
1855
|
-
}
|
|
1856
|
-
import * as WEBIFC from "web-ifc";
|
|
1857
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
1858
|
-
export declare class IfcFragmentSettings {
|
|
1859
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
1860
|
-
includeProperties: boolean;
|
|
1861
1918
|
/**
|
|
1862
|
-
*
|
|
1863
|
-
*
|
|
1919
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1920
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1921
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1922
|
+
* not true.
|
|
1864
1923
|
*/
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
absolute: boolean;
|
|
1872
|
-
logLevel?: WEBIFC.LogLevel;
|
|
1924
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1925
|
+
protected getAvailableColor(): {
|
|
1926
|
+
r: number;
|
|
1927
|
+
g: number;
|
|
1928
|
+
b: number;
|
|
1929
|
+
code: string;
|
|
1873
1930
|
};
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
saveLocations: boolean;
|
|
1878
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1879
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
1880
|
-
autoSetWasm: boolean;
|
|
1881
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1931
|
+
protected increaseColor(): void;
|
|
1932
|
+
protected decreaseColor(): void;
|
|
1933
|
+
private applySettings;
|
|
1882
1934
|
}
|
|
1935
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1883
1936
|
import * as THREE from "three";
|
|
1884
|
-
import
|
|
1885
|
-
import
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
} | undefined;
|
|
1896
|
-
private getCurves;
|
|
1897
|
-
}
|
|
1898
|
-
import * as WEBIFC from "web-ifc";
|
|
1899
|
-
export declare class IfcMetadataReader {
|
|
1900
|
-
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1901
|
-
}
|
|
1902
|
-
import * as WEBIFC from "web-ifc";
|
|
1903
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1904
|
-
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1905
|
-
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1906
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1907
|
-
onPropertiesStreamed: AsyncEvent<{
|
|
1908
|
-
type: number;
|
|
1909
|
-
data: {
|
|
1910
|
-
[id: number]: any;
|
|
1911
|
-
};
|
|
1937
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1938
|
+
import { Components } from "../../Components";
|
|
1939
|
+
import { Event, World } from "../../Types";
|
|
1940
|
+
/**
|
|
1941
|
+
* A renderer to determine a mesh visibility on screen
|
|
1942
|
+
*/
|
|
1943
|
+
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1944
|
+
threshold: number;
|
|
1945
|
+
readonly onViewUpdated: Event<{
|
|
1946
|
+
seen: Set<THREE.Mesh>;
|
|
1947
|
+
unseen: Set<THREE.Mesh>;
|
|
1912
1948
|
}>;
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
private
|
|
1926
|
-
private
|
|
1927
|
-
private cleanUp;
|
|
1928
|
-
}
|
|
1929
|
-
export interface StreamedGeometries {
|
|
1930
|
-
[id: number]: {
|
|
1931
|
-
boundingBox: Float32Array;
|
|
1932
|
-
hasHoles: boolean;
|
|
1933
|
-
geometryFile?: string;
|
|
1934
|
-
};
|
|
1935
|
-
}
|
|
1936
|
-
export interface StreamedAsset {
|
|
1937
|
-
id: number;
|
|
1938
|
-
geometries: {
|
|
1939
|
-
geometryID: number;
|
|
1940
|
-
transformation: number[];
|
|
1941
|
-
color: number[];
|
|
1942
|
-
}[];
|
|
1943
|
-
}
|
|
1944
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
1945
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1946
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1947
|
-
minGeometrySize: number;
|
|
1948
|
-
minAssetsSize: number;
|
|
1949
|
-
}
|
|
1950
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1951
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1952
|
-
propertiesSize: number;
|
|
1949
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1950
|
+
isProcessing: boolean;
|
|
1951
|
+
private _colorCodeMeshMap;
|
|
1952
|
+
private _meshIDColorCodeMap;
|
|
1953
|
+
private _currentVisibleMeshes;
|
|
1954
|
+
private _recentlyHiddenMeshes;
|
|
1955
|
+
private _intervalID;
|
|
1956
|
+
private readonly _transparentMat;
|
|
1957
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1958
|
+
dispose(): void;
|
|
1959
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1960
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1961
|
+
private handleWorkerMessage;
|
|
1962
|
+
private getAvailableMaterial;
|
|
1953
1963
|
}
|
|
1954
1964
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1955
1965
|
export interface ModelsRelationMap {
|
|
@@ -1980,15 +1990,5 @@ import * as THREE from "three";
|
|
|
1980
1990
|
export declare class TransformHelper {
|
|
1981
1991
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1982
1992
|
}
|
|
1983
|
-
import * as WEBIFC from "web-ifc";
|
|
1984
|
-
import * as THREE from "three";
|
|
1985
|
-
export declare class Units {
|
|
1986
|
-
factor: number;
|
|
1987
|
-
complement: number;
|
|
1988
|
-
apply(matrix: THREE.Matrix4): void;
|
|
1989
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1990
|
-
private getLengthUnits;
|
|
1991
|
-
private getScaleMatrix;
|
|
1992
|
-
}
|
|
1993
1993
|
|
|
1994
1994
|
}
|