@thatopen/components 1.5.0 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Clipper/index.d.ts +104 -0
- package/dist/core/Clipper/src/index.d.ts +1 -0
- package/dist/core/Clipper/src/simple-plane.d.ts +61 -0
- package/dist/core/Components/index.d.ts +52 -0
- package/dist/core/Cullers/index.d.ts +23 -0
- package/dist/core/Cullers/src/culler-renderer.d.ts +66 -0
- package/dist/core/Cullers/src/index.d.ts +3 -0
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +27 -0
- package/dist/core/Cullers/src/screen-culler-helper.d.ts +1 -0
- package/dist/core/Disposer/index.d.ts +43 -0
- package/dist/core/Grids/index.d.ts +13 -0
- package/dist/core/Grids/src/index.d.ts +1 -0
- package/dist/core/Grids/src/simple-grid.d.ts +48 -0
- package/dist/core/Materials/index.d.ts +61 -0
- package/dist/core/Raycasters/index.d.ts +13 -0
- package/dist/core/Raycasters/src/index.d.ts +2 -0
- package/dist/core/Raycasters/src/mouse.d.ts +26 -0
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +36 -0
- package/dist/core/Types/index.d.ts +1 -0
- package/dist/core/Types/src/base-camera.d.ts +11 -0
- package/dist/core/Types/src/base-renderer.d.ts +40 -0
- package/dist/core/Types/src/base-scene.d.ts +13 -0
- package/dist/core/Types/src/base-world-item.d.ts +17 -0
- package/dist/core/Types/src/base.d.ts +19 -0
- package/dist/core/Types/src/component.d.ts +18 -0
- package/dist/core/Types/src/event.d.ts +34 -0
- package/dist/core/Types/src/index.d.ts +9 -0
- package/dist/core/Types/src/interfaces.d.ts +134 -0
- package/dist/core/Types/src/world.d.ts +12 -0
- package/dist/core/Worlds/index.d.ts +17 -0
- package/dist/core/Worlds/src/index.d.ts +4 -0
- package/dist/core/Worlds/src/simple-camera.d.ts +46 -0
- package/dist/core/Worlds/src/simple-renderer.d.ts +32 -0
- package/dist/core/Worlds/src/simple-scene.d.ts +30 -0
- package/dist/core/Worlds/src/simple-world.d.ts +26 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/fragments/FragmentBoundingBox/index.d.ts +36 -0
- package/dist/fragments/FragmentClassifier/index.d.ts +30 -0
- package/dist/fragments/FragmentExploder/index.d.ts +15 -0
- package/dist/fragments/FragmentIfcLoader/index.d.ts +33 -0
- package/dist/fragments/FragmentIfcLoader/src/civil-reader.d.ts +15 -0
- package/dist/fragments/FragmentIfcLoader/src/ifc-fragment-settings.d.ts +27 -0
- package/dist/fragments/FragmentIfcLoader/src/ifc-metadata-reader.d.ts +4 -0
- package/dist/fragments/FragmentIfcLoader/src/index.d.ts +3 -0
- package/dist/fragments/FragmentIfcLoader/src/spatial-structure.d.ts +8 -0
- package/dist/fragments/FragmentIfcLoader/src/transform-helper.d.ts +5 -0
- package/dist/fragments/FragmentIfcLoader/src/units.d.ts +10 -0
- package/dist/fragments/FragmentIfcStreamer/index.d.ts +1 -0
- package/dist/fragments/FragmentIfcStreamer/src/base-types.d.ts +15 -0
- package/dist/fragments/FragmentIfcStreamer/src/fragment-ifc-stream-converter.d.ts +41 -0
- package/dist/fragments/FragmentIfcStreamer/src/fragment-props-stream-converter.d.ts +27 -0
- package/dist/fragments/FragmentIfcStreamer/src/index.d.ts +4 -0
- package/dist/fragments/FragmentIfcStreamer/src/streaming-settings.d.ts +10 -0
- package/dist/fragments/FragmentManager/index.d.ts +44 -0
- package/dist/fragments/index.d.ts +5 -0
- package/dist/ifc/IfcJsonExporter/index.d.ts +16 -0
- package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +1 -0
- package/dist/ifc/IfcPropertiesFinder/index.d.ts +37 -0
- package/dist/ifc/IfcPropertiesFinder/src/types.d.ts +23 -0
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +31 -0
- package/dist/ifc/IfcPropertiesManager/index.d.ts +73 -0
- package/dist/ifc/Utils/ifc-categories.d.ts +7 -0
- package/dist/ifc/Utils/ifc-category-map.d.ts +3 -0
- package/dist/ifc/Utils/ifc-elements-map.d.ts +3 -0
- package/dist/ifc/Utils/index.d.ts +4 -0
- package/dist/ifc/Utils/properties-utils.d.ts +25 -0
- package/dist/ifc/index.d.ts +5 -0
- package/dist/index.cjs +88 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +9024 -0
- package/dist/namespace.d.ts +1580 -0
- package/dist/utils/bbox.d.ts +7 -0
- package/dist/utils/geometry.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/materials.d.ts +4 -0
- package/dist/utils/uuid.d.ts +6 -0
- package/package.json +10 -5
|
@@ -0,0 +1,1580 @@
|
|
|
1
|
+
declare namespace OBC {
|
|
2
|
+
import { Component, Disposable, Event } from "../Types";
|
|
3
|
+
/**
|
|
4
|
+
* The entry point of the Components library.
|
|
5
|
+
* It can:
|
|
6
|
+
* - Create and access all the components of the library.
|
|
7
|
+
* - Update all the updatable components automatically.
|
|
8
|
+
* - Dispose all the components, preventing memory leaks.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Components implements Disposable {
|
|
11
|
+
static readonly release = "1.4.21";
|
|
12
|
+
/** {@link Disposable.onDisposed} */
|
|
13
|
+
readonly onDisposed: Event<void>;
|
|
14
|
+
/** The list of components created in this app. */
|
|
15
|
+
readonly list: Map<string, Component>;
|
|
16
|
+
/** If disabled, the animation loop will be stopped. */
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
private _clock;
|
|
19
|
+
add(uuid: string, instance: Component): void;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
|
|
22
|
+
* doesn't exist, it will instance it automatically.
|
|
23
|
+
*
|
|
24
|
+
* @param Component - The component to get or create.
|
|
25
|
+
*/
|
|
26
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Initializes the library. It should be called at the start of the app after
|
|
30
|
+
* initializing the scene, the renderer and the
|
|
31
|
+
* camera. Additionally, if any component that need a raycaster is
|
|
32
|
+
* used, the {@link raycaster} will need to be initialized.
|
|
33
|
+
*/
|
|
34
|
+
init(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
37
|
+
* the library. A memory leak will be created if:
|
|
38
|
+
*
|
|
39
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
40
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
41
|
+
* Angular, Vue, etc).
|
|
42
|
+
*
|
|
43
|
+
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
44
|
+
* referenced by a reference type (object or array).
|
|
45
|
+
*
|
|
46
|
+
* You can learn more about how Three.js handles memory leaks
|
|
47
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
dispose(): void;
|
|
51
|
+
private update;
|
|
52
|
+
private static setupBVH;
|
|
53
|
+
}
|
|
54
|
+
import * as THREE from "three";
|
|
55
|
+
import { Components } from "../Components";
|
|
56
|
+
import { Component } from "../Types";
|
|
57
|
+
/**
|
|
58
|
+
* A tool to safely remove meshes and geometries from memory to
|
|
59
|
+
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
60
|
+
*/
|
|
61
|
+
export declare class Disposer extends Component {
|
|
62
|
+
private _disposedComponents;
|
|
63
|
+
/** {@link Component.enabled} */
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
66
|
+
constructor(components: Components);
|
|
67
|
+
/**
|
|
68
|
+
* {@link Component.uuid}.
|
|
69
|
+
* @return the list of UUIDs of deleted components.
|
|
70
|
+
*/
|
|
71
|
+
get(): Set<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
74
|
+
* using any of these in other parts of the application, make sure that you
|
|
75
|
+
* remove them from the mesh before disposing it.
|
|
76
|
+
*
|
|
77
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
78
|
+
* to remove.
|
|
79
|
+
*
|
|
80
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
81
|
+
*
|
|
82
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
83
|
+
*/
|
|
84
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
85
|
+
/**
|
|
86
|
+
* Disposes a geometry from memory.
|
|
87
|
+
*
|
|
88
|
+
* @param geometry - the
|
|
89
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
90
|
+
* to remove.
|
|
91
|
+
*/
|
|
92
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
93
|
+
private disposeGeometryAndMaterials;
|
|
94
|
+
private disposeChildren;
|
|
95
|
+
private static disposeMaterial;
|
|
96
|
+
}
|
|
97
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
98
|
+
import { SimpleRaycaster } from "./src";
|
|
99
|
+
import { Components } from "../Components";
|
|
100
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
101
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
list: Map<string, SimpleRaycaster>;
|
|
104
|
+
onDisposed: Event<unknown>;
|
|
105
|
+
constructor(components: Components);
|
|
106
|
+
get(world: World): SimpleRaycaster;
|
|
107
|
+
delete(world: World): void;
|
|
108
|
+
dispose(): void;
|
|
109
|
+
}
|
|
110
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
111
|
+
import { Components } from "../Components";
|
|
112
|
+
import { SimpleWorld } from "./src";
|
|
113
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
114
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
115
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
116
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
117
|
+
readonly onDisposed: Event<unknown>;
|
|
118
|
+
list: Map<string, World>;
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
constructor(components: Components);
|
|
121
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
122
|
+
delete(world: World): void;
|
|
123
|
+
dispose(): void;
|
|
124
|
+
update(delta?: number): void | Promise<void>;
|
|
125
|
+
}
|
|
126
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
127
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
128
|
+
export declare class Grids extends Component implements Disposable {
|
|
129
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
130
|
+
list: Map<string, SimpleGrid>;
|
|
131
|
+
onDisposed: Event<unknown>;
|
|
132
|
+
config: Required<GridConfig>;
|
|
133
|
+
/** {@link Component.enabled} */
|
|
134
|
+
enabled: boolean;
|
|
135
|
+
create(world: World): void;
|
|
136
|
+
delete(world: World): void;
|
|
137
|
+
dispose(): void;
|
|
138
|
+
}
|
|
139
|
+
import * as THREE from "three";
|
|
140
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
141
|
+
import { SimplePlane } from "./src";
|
|
142
|
+
import { Components } from "../Components";
|
|
143
|
+
/**
|
|
144
|
+
* A lightweight component to easily create and handle
|
|
145
|
+
* [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
146
|
+
*
|
|
147
|
+
* @param components - the instance of {@link Components} used.
|
|
148
|
+
* @param planeType - the type of plane to be used by the clipper.
|
|
149
|
+
* E.g. {@link SimplePlane}.
|
|
150
|
+
*/
|
|
151
|
+
export declare class Clipper<T extends SimplePlane> extends Component implements Createable, Disposable, Hideable {
|
|
152
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
153
|
+
/** {@link Createable.onAfterCreate} */
|
|
154
|
+
readonly onAfterCreate: Event<T>;
|
|
155
|
+
/** {@link Createable.onAfterDelete} */
|
|
156
|
+
readonly onAfterDelete: Event<T>;
|
|
157
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
158
|
+
readonly onBeforeDrag: Event<void>;
|
|
159
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
160
|
+
readonly onAfterDrag: Event<void>;
|
|
161
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
162
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
163
|
+
readonly onAfterCancel: Event<unknown>;
|
|
164
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
165
|
+
/** {@link Disposable.onDisposed} */
|
|
166
|
+
readonly onDisposed: Event<string>;
|
|
167
|
+
/**
|
|
168
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
169
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
170
|
+
* clipping plane is created in its roof, which might have a slight
|
|
171
|
+
* slope for draining purposes.
|
|
172
|
+
*/
|
|
173
|
+
orthogonalY: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
176
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
177
|
+
* has to be 'true' for this to apply.
|
|
178
|
+
*/
|
|
179
|
+
toleranceOrthogonalY: number;
|
|
180
|
+
planes: T[];
|
|
181
|
+
protected PlaneType: new (...args: any) => SimplePlane | T;
|
|
182
|
+
/** The material used in all the clipping planes. */
|
|
183
|
+
protected _material: THREE.Material;
|
|
184
|
+
private _size;
|
|
185
|
+
private _enabled;
|
|
186
|
+
private _visible;
|
|
187
|
+
/** {@link Component.enabled} */
|
|
188
|
+
get enabled(): boolean;
|
|
189
|
+
/** {@link Component.enabled} */
|
|
190
|
+
set enabled(state: boolean);
|
|
191
|
+
/** {@link Hideable.visible } */
|
|
192
|
+
get visible(): boolean;
|
|
193
|
+
/** {@link Hideable.visible } */
|
|
194
|
+
set visible(state: boolean);
|
|
195
|
+
/** The material of the clipping plane representation. */
|
|
196
|
+
get material(): THREE.Material;
|
|
197
|
+
/** The material of the clipping plane representation. */
|
|
198
|
+
set material(material: THREE.Material);
|
|
199
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
200
|
+
get size(): number;
|
|
201
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
202
|
+
set size(size: number);
|
|
203
|
+
constructor(components: Components);
|
|
204
|
+
endCreation(): void;
|
|
205
|
+
cancelCreation(): void;
|
|
206
|
+
/** {@link Disposable.dispose} */
|
|
207
|
+
dispose(): void;
|
|
208
|
+
/** {@link Createable.create} */
|
|
209
|
+
create(world: World): void;
|
|
210
|
+
/**
|
|
211
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
212
|
+
* without the need of the mouse.
|
|
213
|
+
*
|
|
214
|
+
* @param world - the world where this plane should be created.
|
|
215
|
+
* @param normal - the orientation of the clipping plane.
|
|
216
|
+
* @param point - the position of the clipping plane.
|
|
217
|
+
* navigation.
|
|
218
|
+
*/
|
|
219
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): T;
|
|
220
|
+
/**
|
|
221
|
+
* {@link Createable.delete}
|
|
222
|
+
*
|
|
223
|
+
* @param world - the world where the plane to delete is.
|
|
224
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
225
|
+
* found under the cursor will be deleted.
|
|
226
|
+
*/
|
|
227
|
+
delete(world: World, plane?: T): void;
|
|
228
|
+
/** Deletes all the existing clipping planes. */
|
|
229
|
+
deleteAll(): void;
|
|
230
|
+
private deletePlane;
|
|
231
|
+
private pickPlane;
|
|
232
|
+
private getAllPlaneMeshes;
|
|
233
|
+
private createPlaneFromIntersection;
|
|
234
|
+
private getWorldNormal;
|
|
235
|
+
private normalizePlaneDirectionY;
|
|
236
|
+
private newPlane;
|
|
237
|
+
protected newPlaneInstance(world: World, point: THREE.Vector3, normal: THREE.Vector3): T;
|
|
238
|
+
private updateMaterialsAndPlanes;
|
|
239
|
+
private _onStartDragging;
|
|
240
|
+
private _onEndDragging;
|
|
241
|
+
}
|
|
242
|
+
import * as THREE from "three";
|
|
243
|
+
import { Component, Disposable, Event, World } from "../Types";
|
|
244
|
+
import { Components } from "../Components";
|
|
245
|
+
/**
|
|
246
|
+
* A tool to easily handle the materials of massive amounts of
|
|
247
|
+
* objects and scene background easily.
|
|
248
|
+
*/
|
|
249
|
+
export declare class Materials extends Component implements Disposable {
|
|
250
|
+
static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
|
|
251
|
+
/** {@link Component.enabled} */
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
private _originalBackground;
|
|
254
|
+
/** {@link Disposable.onDisposed} */
|
|
255
|
+
readonly onDisposed: Event<string>;
|
|
256
|
+
list: {
|
|
257
|
+
[id: string]: {
|
|
258
|
+
material: THREE.Material;
|
|
259
|
+
meshes: Set<THREE.Mesh | THREE.InstancedMesh>;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
private _originals;
|
|
263
|
+
constructor(components: Components);
|
|
264
|
+
/**
|
|
265
|
+
* Turns the specified material styles on or off.
|
|
266
|
+
*
|
|
267
|
+
* @param active whether to turn it on or off.
|
|
268
|
+
* @param ids the ids of the style to turn on or off.
|
|
269
|
+
*/
|
|
270
|
+
set(active: boolean, ids?: string[]): void;
|
|
271
|
+
/** {@link Disposable.dispose} */
|
|
272
|
+
dispose(): void;
|
|
273
|
+
/**
|
|
274
|
+
* Sets the color of the background of the scene.
|
|
275
|
+
*
|
|
276
|
+
* @param color: the color to apply.
|
|
277
|
+
*/
|
|
278
|
+
setBackgroundColor(color: THREE.Color, world: World): void;
|
|
279
|
+
/**
|
|
280
|
+
* Resets the scene background to the color that was being used
|
|
281
|
+
* before applying the material manager.
|
|
282
|
+
*/
|
|
283
|
+
resetBackgroundColor(world: World): void;
|
|
284
|
+
/**
|
|
285
|
+
* Creates a new material style.
|
|
286
|
+
* @param id the identifier of the style to create.
|
|
287
|
+
* @param material the material of the style.
|
|
288
|
+
*/
|
|
289
|
+
addMaterial(id: string, material: THREE.Material): void;
|
|
290
|
+
/**
|
|
291
|
+
* Assign meshes to a certain style.
|
|
292
|
+
* @param id the identifier of the style.
|
|
293
|
+
* @param meshes the meshes to assign to the style.
|
|
294
|
+
*/
|
|
295
|
+
addMeshes(id: string, meshes: THREE.Mesh[]): void;
|
|
296
|
+
/**
|
|
297
|
+
* Remove meshes from a certain style.
|
|
298
|
+
* @param id the identifier of the style.
|
|
299
|
+
* @param meshes the meshes to assign to the style.
|
|
300
|
+
*/
|
|
301
|
+
removeMeshes(id: string, meshes: THREE.Mesh[]): void;
|
|
302
|
+
}
|
|
303
|
+
import * as THREE from "three";
|
|
304
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
305
|
+
center: THREE.Vector3;
|
|
306
|
+
halfSizes: THREE.Vector3;
|
|
307
|
+
rotation: THREE.Matrix3;
|
|
308
|
+
transformation: THREE.Matrix4;
|
|
309
|
+
};
|
|
310
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
311
|
+
import * as THREE from "three";
|
|
312
|
+
export declare class MaterialsUtils {
|
|
313
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
314
|
+
}
|
|
315
|
+
export declare class UUID {
|
|
316
|
+
private static _pattern;
|
|
317
|
+
private static _lut;
|
|
318
|
+
static create(): string;
|
|
319
|
+
static validate(uuid: string): void;
|
|
320
|
+
}
|
|
321
|
+
import { Components } from "../Components";
|
|
322
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
323
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
324
|
+
/**
|
|
325
|
+
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
326
|
+
* that are not visible to the camera.
|
|
327
|
+
*/
|
|
328
|
+
export declare class Cullers extends Component implements Disposable {
|
|
329
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
330
|
+
private _enabled;
|
|
331
|
+
list: Map<string, MeshCullerRenderer>;
|
|
332
|
+
/** {@link Disposable.onDisposed} */
|
|
333
|
+
readonly onDisposed: Event<unknown>;
|
|
334
|
+
/** {@link Component.enabled} */
|
|
335
|
+
get enabled(): boolean;
|
|
336
|
+
set enabled(value: boolean);
|
|
337
|
+
constructor(components: Components);
|
|
338
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
339
|
+
delete(world: World): void;
|
|
340
|
+
/** {@link Disposable.dispose} */
|
|
341
|
+
dispose(): void;
|
|
342
|
+
}
|
|
343
|
+
import * as THREE from "three";
|
|
344
|
+
import * as FRAGS from "bim-fragment";
|
|
345
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
346
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
347
|
+
/**
|
|
348
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
349
|
+
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
350
|
+
*/
|
|
351
|
+
export declare class FragmentBoundingBox extends Component implements Disposable {
|
|
352
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
353
|
+
/** {@link Component.enabled} */
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
/** {@link Disposable.onDisposed} */
|
|
356
|
+
readonly onDisposed: Event<unknown>;
|
|
357
|
+
private _absoluteMin;
|
|
358
|
+
private _absoluteMax;
|
|
359
|
+
private _meshes;
|
|
360
|
+
constructor(components: Components);
|
|
361
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
362
|
+
width: number;
|
|
363
|
+
height: number;
|
|
364
|
+
depth: number;
|
|
365
|
+
center: THREE.Vector3;
|
|
366
|
+
};
|
|
367
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
368
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
369
|
+
/** {@link Disposable.dispose} */
|
|
370
|
+
dispose(): void;
|
|
371
|
+
get(): THREE.Box3;
|
|
372
|
+
getSphere(): THREE.Sphere;
|
|
373
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
374
|
+
reset(): void;
|
|
375
|
+
add(group: FragmentsGroup): void;
|
|
376
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
|
|
377
|
+
private static getFragmentBounds;
|
|
378
|
+
}
|
|
379
|
+
import * as FRAGS from "bim-fragment";
|
|
380
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
381
|
+
export interface Classification {
|
|
382
|
+
[system: string]: {
|
|
383
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
export declare class FragmentClassifier extends Component implements Disposable {
|
|
387
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
388
|
+
/** {@link Component.enabled} */
|
|
389
|
+
enabled: boolean;
|
|
390
|
+
private _groupSystems;
|
|
391
|
+
/** {@link Disposable.onDisposed} */
|
|
392
|
+
readonly onDisposed: Event<unknown>;
|
|
393
|
+
constructor(components: Components);
|
|
394
|
+
private onFragmentsDisposed;
|
|
395
|
+
/** {@link Component.get} */
|
|
396
|
+
get(): Classification;
|
|
397
|
+
dispose(): void;
|
|
398
|
+
remove(guid: string): void;
|
|
399
|
+
find(filter?: {
|
|
400
|
+
[name: string]: string[];
|
|
401
|
+
}): FRAGS.FragmentIdMap;
|
|
402
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
403
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
404
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
405
|
+
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
406
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
407
|
+
private saveItem;
|
|
408
|
+
}
|
|
409
|
+
import * as WEBIFC from "web-ifc";
|
|
410
|
+
import * as FRAGS from "bim-fragment";
|
|
411
|
+
import { IfcFragmentSettings } from "./src";
|
|
412
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
413
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
414
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
415
|
+
readonly onIfcLoaded: Event<FRAGS.FragmentsGroup>;
|
|
416
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
417
|
+
readonly onSetup: Event<void>;
|
|
418
|
+
/** {@link Disposable.onDisposed} */
|
|
419
|
+
readonly onDisposed: Event<string>;
|
|
420
|
+
settings: IfcFragmentSettings;
|
|
421
|
+
enabled: boolean;
|
|
422
|
+
webIfc: WEBIFC.IfcAPI;
|
|
423
|
+
private _material;
|
|
424
|
+
private _spatialTree;
|
|
425
|
+
private _metaData;
|
|
426
|
+
private _fragmentInstances;
|
|
427
|
+
private _civil;
|
|
428
|
+
private _propertyExporter;
|
|
429
|
+
private _visitedFragments;
|
|
430
|
+
private _materialT;
|
|
431
|
+
constructor(components: Components);
|
|
432
|
+
dispose(): void;
|
|
433
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
434
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
435
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
436
|
+
private getAllGeometries;
|
|
437
|
+
cleanUp(): void;
|
|
438
|
+
private getMesh;
|
|
439
|
+
private getGeometry;
|
|
440
|
+
private autoSetWasm;
|
|
441
|
+
}
|
|
442
|
+
import { Fragment, FragmentsGroup } from "bim-fragment";
|
|
443
|
+
import * as THREE from "three";
|
|
444
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
445
|
+
/**
|
|
446
|
+
* Object that can efficiently load binary files that contain
|
|
447
|
+
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
448
|
+
*/
|
|
449
|
+
export declare class FragmentManager extends Component implements Disposable {
|
|
450
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
451
|
+
/** {@link Disposable.onDisposed} */
|
|
452
|
+
readonly onDisposed: Event<unknown>;
|
|
453
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
454
|
+
readonly onFragmentsDisposed: Event<{
|
|
455
|
+
groupID: string;
|
|
456
|
+
fragmentIDs: string[];
|
|
457
|
+
}>;
|
|
458
|
+
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
459
|
+
readonly list: Map<string, Fragment>;
|
|
460
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
461
|
+
/** {@link Component.enabled} */
|
|
462
|
+
enabled: boolean;
|
|
463
|
+
baseCoordinationModel: string;
|
|
464
|
+
private _loader;
|
|
465
|
+
/** The list of meshes of the created fragments. */
|
|
466
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
467
|
+
constructor(components: Components);
|
|
468
|
+
/** {@link Disposable.dispose} */
|
|
469
|
+
dispose(): void;
|
|
470
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
471
|
+
/**
|
|
472
|
+
* Loads one or many fragments into the scene.
|
|
473
|
+
* @param data - the bytes containing the data for the fragments to load.
|
|
474
|
+
* @param coordinate - whether this fragmentsgroup should be federated with the others.
|
|
475
|
+
* @returns the list of IDs of the loaded fragments.
|
|
476
|
+
*/
|
|
477
|
+
load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
|
|
478
|
+
/**
|
|
479
|
+
* Export the specified fragments.
|
|
480
|
+
* @param group - the fragments group to be exported.
|
|
481
|
+
* @returns the exported data as binary buffer.
|
|
482
|
+
*/
|
|
483
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
484
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
485
|
+
}
|
|
486
|
+
import * as WEBIFC from "web-ifc";
|
|
487
|
+
import * as FRAG from "bim-fragment";
|
|
488
|
+
/**
|
|
489
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
490
|
+
*/
|
|
491
|
+
export declare class IfcJsonExporter {
|
|
492
|
+
/**
|
|
493
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
494
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
495
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
496
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
497
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
498
|
+
* to make the location data available (e.g. absolute position of building).
|
|
499
|
+
*/
|
|
500
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
501
|
+
}
|
|
502
|
+
import * as FRAGS from "bim-fragment";
|
|
503
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
504
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
505
|
+
import { QueryGroup } from "./src/types";
|
|
506
|
+
export interface QueryResult {
|
|
507
|
+
[modelID: string]: {
|
|
508
|
+
modelEntities: Set<number>;
|
|
509
|
+
otherEntities: Set<number>;
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
export interface IndexedModels {
|
|
513
|
+
[modelID: string]: {
|
|
514
|
+
[expressID: number]: Set<number>;
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
518
|
+
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
519
|
+
/** {@link Disposable.onDisposed} */
|
|
520
|
+
readonly onDisposed: Event<unknown>;
|
|
521
|
+
enabled: boolean;
|
|
522
|
+
indexedModels: IndexedModels;
|
|
523
|
+
private readonly _conditionFunctions;
|
|
524
|
+
private _noHandleAttributes;
|
|
525
|
+
constructor(components: Components);
|
|
526
|
+
private onFragmentsDisposed;
|
|
527
|
+
dispose(): void;
|
|
528
|
+
private indexEntityRelations;
|
|
529
|
+
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
530
|
+
private toFragmentMap;
|
|
531
|
+
private simpleQuery;
|
|
532
|
+
private getMatchingEntities;
|
|
533
|
+
private combineArrays;
|
|
534
|
+
private getCommonElements;
|
|
535
|
+
private arrayIntersection;
|
|
536
|
+
private arrayUnion;
|
|
537
|
+
private getConditionFunctions;
|
|
538
|
+
}
|
|
539
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
540
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
541
|
+
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
542
|
+
interface IndexMap {
|
|
543
|
+
[modelID: string]: {
|
|
544
|
+
[expressID: string]: Set<number>;
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
548
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
549
|
+
/** {@link Disposable.onDisposed} */
|
|
550
|
+
readonly onDisposed: Event<string>;
|
|
551
|
+
enabled: boolean;
|
|
552
|
+
relationsToProcess: number[];
|
|
553
|
+
indexMap: IndexMap;
|
|
554
|
+
private _propertiesManager;
|
|
555
|
+
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
556
|
+
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
557
|
+
get propertiesManager(): IfcPropertiesManager | null;
|
|
558
|
+
constructor(components: Components);
|
|
559
|
+
private onFragmentsDisposed;
|
|
560
|
+
dispose(): Promise<void>;
|
|
561
|
+
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
562
|
+
private getNestedPsets;
|
|
563
|
+
private getPsetProperties;
|
|
564
|
+
process(model: FragmentsGroup): Promise<void>;
|
|
565
|
+
private setEntityIndex;
|
|
566
|
+
private cloneProperty;
|
|
567
|
+
private clonePropertyArray;
|
|
568
|
+
}
|
|
569
|
+
export {};
|
|
570
|
+
import * as WEBIFC from "web-ifc";
|
|
571
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
572
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
573
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
574
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
575
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
576
|
+
interface ChangeMap {
|
|
577
|
+
[modelID: string]: Set<number>;
|
|
578
|
+
}
|
|
579
|
+
interface AttributeListener {
|
|
580
|
+
[modelID: string]: {
|
|
581
|
+
[expressID: number]: {
|
|
582
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
587
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
588
|
+
/** {@link Disposable.onDisposed} */
|
|
589
|
+
readonly onDisposed: Event<string>;
|
|
590
|
+
readonly onRequestFile: Event<unknown>;
|
|
591
|
+
ifcToExport: ArrayBuffer | null;
|
|
592
|
+
readonly onElementToPset: Event<{
|
|
593
|
+
model: FragmentsGroup;
|
|
594
|
+
psetID: number;
|
|
595
|
+
elementID: number;
|
|
596
|
+
}>;
|
|
597
|
+
readonly onPropToPset: Event<{
|
|
598
|
+
model: FragmentsGroup;
|
|
599
|
+
psetID: number;
|
|
600
|
+
propID: number;
|
|
601
|
+
}>;
|
|
602
|
+
readonly onPsetRemoved: Event<{
|
|
603
|
+
model: FragmentsGroup;
|
|
604
|
+
psetID: number;
|
|
605
|
+
}>;
|
|
606
|
+
readonly onDataChanged: Event<{
|
|
607
|
+
model: FragmentsGroup;
|
|
608
|
+
expressID: number;
|
|
609
|
+
}>;
|
|
610
|
+
wasm: {
|
|
611
|
+
path: string;
|
|
612
|
+
absolute: boolean;
|
|
613
|
+
};
|
|
614
|
+
enabled: boolean;
|
|
615
|
+
attributeListeners: AttributeListener;
|
|
616
|
+
selectedModel?: FragmentsGroup;
|
|
617
|
+
private _changeMap;
|
|
618
|
+
constructor(components: Components);
|
|
619
|
+
get(): ChangeMap;
|
|
620
|
+
dispose(): void;
|
|
621
|
+
private increaseMaxID;
|
|
622
|
+
static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
|
|
623
|
+
private newGUID;
|
|
624
|
+
private getOwnerHistory;
|
|
625
|
+
private registerChange;
|
|
626
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
627
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
628
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
629
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
630
|
+
}>;
|
|
631
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
632
|
+
private newSingleProperty;
|
|
633
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
634
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
635
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
636
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
637
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
638
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
639
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
640
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
641
|
+
}
|
|
642
|
+
export {};
|
|
643
|
+
export declare const GeometryTypes: Set<number>;
|
|
644
|
+
import * as WEBIFC from "web-ifc";
|
|
645
|
+
export interface IfcItemsCategories {
|
|
646
|
+
[itemID: number]: number;
|
|
647
|
+
}
|
|
648
|
+
export declare class IfcCategories {
|
|
649
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
650
|
+
}
|
|
651
|
+
export declare const IfcElements: {
|
|
652
|
+
[key: number]: string;
|
|
653
|
+
};
|
|
654
|
+
export declare const IfcCategoryMap: {
|
|
655
|
+
[key: number]: string;
|
|
656
|
+
};
|
|
657
|
+
import * as WEBIFC from "web-ifc";
|
|
658
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
659
|
+
export declare class SpatialStructure {
|
|
660
|
+
itemsByFloor: IfcItemsCategories;
|
|
661
|
+
private _units;
|
|
662
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
663
|
+
cleanUp(): void;
|
|
664
|
+
}
|
|
665
|
+
import * as FRAGS from "bim-fragment";
|
|
666
|
+
export declare class IfcPropertiesUtils {
|
|
667
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
668
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
669
|
+
[attribute: string]: any;
|
|
670
|
+
} | null>;
|
|
671
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
672
|
+
[relatingID: number]: number[];
|
|
673
|
+
}>;
|
|
674
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
675
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
676
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
677
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
678
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
679
|
+
key: string | null;
|
|
680
|
+
name: string | null;
|
|
681
|
+
}>;
|
|
682
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
683
|
+
key: string | null;
|
|
684
|
+
value: number | null;
|
|
685
|
+
}>;
|
|
686
|
+
static isRel(expressID: number): boolean;
|
|
687
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
688
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Simple event handler by
|
|
692
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
693
|
+
* Keep in mind that:
|
|
694
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
695
|
+
* an object.
|
|
696
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
697
|
+
* the callback as an arrow function.
|
|
698
|
+
*/
|
|
699
|
+
export declare class Event<T> {
|
|
700
|
+
/**
|
|
701
|
+
* Add a callback to this event instance.
|
|
702
|
+
* @param handler - the callback to be added to this event.
|
|
703
|
+
*/
|
|
704
|
+
add(handler: T extends void ? {
|
|
705
|
+
(): void;
|
|
706
|
+
} : {
|
|
707
|
+
(data: T): void;
|
|
708
|
+
}): void;
|
|
709
|
+
/**
|
|
710
|
+
* Removes a callback from this event instance.
|
|
711
|
+
* @param handler - the callback to be removed from this event.
|
|
712
|
+
*/
|
|
713
|
+
remove(handler: T extends void ? {
|
|
714
|
+
(): void;
|
|
715
|
+
} : {
|
|
716
|
+
(data: T): void;
|
|
717
|
+
}): void;
|
|
718
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
719
|
+
trigger: (data?: T) => void;
|
|
720
|
+
/** Gets rid of all the suscribed events. */
|
|
721
|
+
reset(): void;
|
|
722
|
+
private handlers;
|
|
723
|
+
}
|
|
724
|
+
import * as THREE from "three";
|
|
725
|
+
import CameraControls from "camera-controls";
|
|
726
|
+
import { Event } from "./event";
|
|
727
|
+
/**
|
|
728
|
+
* Whether this component has to be manually destroyed once you are done with
|
|
729
|
+
* it to prevent
|
|
730
|
+
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
731
|
+
* This also ensures that the DOM events created by that component will be
|
|
732
|
+
* cleaned up.
|
|
733
|
+
*/
|
|
734
|
+
export interface Disposable {
|
|
735
|
+
/**
|
|
736
|
+
* Destroys the object from memory to prevent a
|
|
737
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
738
|
+
*/
|
|
739
|
+
dispose: () => void | Promise<void>;
|
|
740
|
+
/** Fired after the tool has been {@link Disposable.dispose()} */
|
|
741
|
+
readonly onDisposed: Event<any>;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Whether the geometric representation of this component can be
|
|
745
|
+
* hidden or shown in the
|
|
746
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
747
|
+
*/
|
|
748
|
+
export interface Hideable {
|
|
749
|
+
/**
|
|
750
|
+
* Whether the geometric representation of this component is
|
|
751
|
+
* currently visible or not in the
|
|
752
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
753
|
+
*/
|
|
754
|
+
visible: boolean;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Whether this component can be resized. The meaning of this can vary depending
|
|
758
|
+
* on the component: resizing a
|
|
759
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
760
|
+
* component could mean changing its resolution, whereas resizing a
|
|
761
|
+
* [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
762
|
+
*/
|
|
763
|
+
export interface Resizeable {
|
|
764
|
+
/**
|
|
765
|
+
* Sets size of this component (e.g. the resolution of a
|
|
766
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
767
|
+
* component.
|
|
768
|
+
*/
|
|
769
|
+
resize: (size?: THREE.Vector2) => void;
|
|
770
|
+
/** Event that fires when the component has been resized. */
|
|
771
|
+
onResize: Event<THREE.Vector2>;
|
|
772
|
+
/**
|
|
773
|
+
* Gets the current size of this component (e.g. the resolution of a
|
|
774
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
775
|
+
* component.
|
|
776
|
+
*/
|
|
777
|
+
getSize: () => THREE.Vector2;
|
|
778
|
+
}
|
|
779
|
+
/** Whether this component should be updated each frame. */
|
|
780
|
+
export interface Updateable {
|
|
781
|
+
/** Actions that should be executed after updating the component. */
|
|
782
|
+
onAfterUpdate: Event<any>;
|
|
783
|
+
/** Actions that should be executed before updating the component. */
|
|
784
|
+
onBeforeUpdate: Event<any>;
|
|
785
|
+
/**
|
|
786
|
+
* Function used to update the state of this component each frame. For
|
|
787
|
+
* instance, a renderer component will make a render each frame.
|
|
788
|
+
*/
|
|
789
|
+
update(delta?: number): void | Promise<void>;
|
|
790
|
+
}
|
|
791
|
+
/** Basic type to describe the progress of any kind of process. */
|
|
792
|
+
export interface Progress {
|
|
793
|
+
/** The amount of things that have been done already. */
|
|
794
|
+
current: number;
|
|
795
|
+
/** The total amount of things to be done by the process. */
|
|
796
|
+
total: number;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Whether this component supports create and destroy operations. This generally
|
|
800
|
+
* applies for components that work with instances, such as clipping planes or
|
|
801
|
+
* dimensions.
|
|
802
|
+
*/
|
|
803
|
+
export interface Createable {
|
|
804
|
+
readonly onBeforeCreate: Event<any>;
|
|
805
|
+
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
806
|
+
create: (data: any) => void;
|
|
807
|
+
/** Fired after successfully calling {@link Createable.create} */
|
|
808
|
+
readonly onAfterCreate: Event<any>;
|
|
809
|
+
/**
|
|
810
|
+
* Finish the creation process of the component, successfully creating an
|
|
811
|
+
* instance of whatever the component creates.
|
|
812
|
+
*/
|
|
813
|
+
endCreation: (data: any) => void;
|
|
814
|
+
/** Fired before calling {@link Createable.cancelCreation}. */
|
|
815
|
+
readonly onBeforeCancel: Event<any>;
|
|
816
|
+
/**
|
|
817
|
+
* Cancels the creation process of the component, going back to the state
|
|
818
|
+
* before starting to create.
|
|
819
|
+
*/
|
|
820
|
+
cancelCreation: (data: any) => void;
|
|
821
|
+
/** Fired after calling {@link Createable.cancelCreation}. */
|
|
822
|
+
readonly onAfterCancel: Event<any>;
|
|
823
|
+
/** Fired before calling {@link Createable.delete}. */
|
|
824
|
+
readonly onBeforeDelete: Event<any>;
|
|
825
|
+
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
826
|
+
delete: (data: any) => void;
|
|
827
|
+
/** Fired after successfully calling {@link Createable.delete()} */
|
|
828
|
+
readonly onAfterDelete: Event<any>;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Whether this component supports to be configured.
|
|
832
|
+
*/
|
|
833
|
+
export interface Configurable<T extends Record<string, any>> {
|
|
834
|
+
/** Wether this components has been already configured. */
|
|
835
|
+
isSetup: boolean;
|
|
836
|
+
/** Use the provided configuration to setup the tool. */
|
|
837
|
+
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
838
|
+
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
839
|
+
readonly onSetup: Event<any>;
|
|
840
|
+
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
841
|
+
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
842
|
+
*/
|
|
843
|
+
config: Required<T>;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
|
|
847
|
+
*/
|
|
848
|
+
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
849
|
+
boundsTree: Object | undefined;
|
|
850
|
+
disposeBoundsTree: () => void;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Whether a camera uses the Camera Controls library.
|
|
854
|
+
*/
|
|
855
|
+
export interface CameraControllable {
|
|
856
|
+
controls: CameraControls;
|
|
857
|
+
}
|
|
858
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
859
|
+
import { Components } from "../../Components";
|
|
860
|
+
/**
|
|
861
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
862
|
+
*/
|
|
863
|
+
export declare abstract class Base {
|
|
864
|
+
components: Components;
|
|
865
|
+
constructor(components: Components);
|
|
866
|
+
/** Whether is component is {@link Disposable}. */
|
|
867
|
+
isDisposeable: () => this is Disposable;
|
|
868
|
+
/** Whether is component is {@link Resizeable}. */
|
|
869
|
+
isResizeable: () => this is Resizeable;
|
|
870
|
+
/** Whether is component is {@link Updateable}. */
|
|
871
|
+
isUpdateable: () => this is Updateable;
|
|
872
|
+
/** Whether is component is {@link Hideable}. */
|
|
873
|
+
isHideable: () => this is Hideable;
|
|
874
|
+
/** Whether is component is {@link Configurable}. */
|
|
875
|
+
isConfigurable: () => this is Configurable<any>;
|
|
876
|
+
}
|
|
877
|
+
import { Base } from "./base";
|
|
878
|
+
/**
|
|
879
|
+
* Components are the building blocks of this library. Components are singleton
|
|
880
|
+
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
881
|
+
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
882
|
+
* unique (they can't be instanced more than once), and have a static UUID that
|
|
883
|
+
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
884
|
+
* instance.
|
|
885
|
+
*/
|
|
886
|
+
export declare abstract class Component extends Base {
|
|
887
|
+
/**
|
|
888
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
889
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
890
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
891
|
+
* will not be updated automatically each frame.
|
|
892
|
+
*/
|
|
893
|
+
abstract enabled: boolean;
|
|
894
|
+
}
|
|
895
|
+
import { Base } from "./base";
|
|
896
|
+
import { World } from "./world";
|
|
897
|
+
import { Event } from "./event";
|
|
898
|
+
import { Components } from "../../Components";
|
|
899
|
+
/**
|
|
900
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
901
|
+
* or a renderer.
|
|
902
|
+
*/
|
|
903
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
904
|
+
readonly worlds: Map<string, World>;
|
|
905
|
+
readonly onWorldChanged: Event<{
|
|
906
|
+
world: World;
|
|
907
|
+
action: "added" | "removed";
|
|
908
|
+
}>;
|
|
909
|
+
currentWorld: World | null;
|
|
910
|
+
protected constructor(components: Components);
|
|
911
|
+
}
|
|
912
|
+
import * as THREE from "three";
|
|
913
|
+
import CameraControls from "camera-controls";
|
|
914
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
915
|
+
import { CameraControllable } from "./interfaces";
|
|
916
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
917
|
+
abstract enabled: boolean;
|
|
918
|
+
abstract three: THREE.Camera;
|
|
919
|
+
abstract controls?: CameraControls;
|
|
920
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
921
|
+
hasCameraControls: () => this is CameraControllable;
|
|
922
|
+
}
|
|
923
|
+
import * as THREE from "three";
|
|
924
|
+
import { Vector2 } from "three";
|
|
925
|
+
import { Event } from "./event";
|
|
926
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
927
|
+
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
928
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
929
|
+
abstract three: THREE.WebGLRenderer;
|
|
930
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
931
|
+
onAfterUpdate: Event<unknown>;
|
|
932
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
933
|
+
onBeforeUpdate: Event<unknown>;
|
|
934
|
+
/** {@link Disposable.onDisposed} */
|
|
935
|
+
readonly onDisposed: Event<undefined>;
|
|
936
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
937
|
+
/**
|
|
938
|
+
* Event that fires when there has been a change to the list of clipping
|
|
939
|
+
* planes used by the active renderer.
|
|
940
|
+
*/
|
|
941
|
+
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
942
|
+
abstract update(delta?: number): void | Promise<void>;
|
|
943
|
+
abstract dispose(): void;
|
|
944
|
+
abstract getSize(): Vector2;
|
|
945
|
+
abstract resize(size: Vector2 | undefined): void;
|
|
946
|
+
/**
|
|
947
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
948
|
+
* instance of the renderer.
|
|
949
|
+
*/
|
|
950
|
+
clippingPlanes: THREE.Plane[];
|
|
951
|
+
/**
|
|
952
|
+
* Forces the update of the clipping planes and all components that depend
|
|
953
|
+
* on them that are subscribed to 'onClippingPlanesUpdated'.
|
|
954
|
+
*/
|
|
955
|
+
updateClippingPlanes(): void;
|
|
956
|
+
/**
|
|
957
|
+
* Adds or removes a
|
|
958
|
+
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
959
|
+
* to the renderer.
|
|
960
|
+
*/
|
|
961
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
962
|
+
}
|
|
963
|
+
import * as THREE from "three";
|
|
964
|
+
import { Disposable } from "./interfaces";
|
|
965
|
+
import { Event } from "./event";
|
|
966
|
+
import { Components } from "../../Components";
|
|
967
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
968
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
969
|
+
/** {@link Disposable.onDisposed} */
|
|
970
|
+
readonly onDisposed: Event<unknown>;
|
|
971
|
+
abstract three: THREE.Object3D;
|
|
972
|
+
protected constructor(components: Components);
|
|
973
|
+
/** {@link Disposable.dispose} */
|
|
974
|
+
dispose(): void;
|
|
975
|
+
}
|
|
976
|
+
import * as THREE from "three";
|
|
977
|
+
import { BaseScene } from "./base-scene";
|
|
978
|
+
import { BaseCamera } from "./base-camera";
|
|
979
|
+
import { BaseRenderer } from "./base-renderer";
|
|
980
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
981
|
+
export interface World extends Disposable, Updateable {
|
|
982
|
+
meshes: Set<THREE.Mesh>;
|
|
983
|
+
scene: BaseScene;
|
|
984
|
+
camera: BaseCamera;
|
|
985
|
+
renderer: BaseRenderer | null;
|
|
986
|
+
uuid: string;
|
|
987
|
+
}
|
|
988
|
+
import * as THREE from "three";
|
|
989
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
990
|
+
import { Components } from "../../Components";
|
|
991
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
992
|
+
/**
|
|
993
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
994
|
+
*/
|
|
995
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
996
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
997
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
998
|
+
enabled: boolean;
|
|
999
|
+
uuid: string;
|
|
1000
|
+
readonly onDisposed: Event<unknown>;
|
|
1001
|
+
private _scene?;
|
|
1002
|
+
private _camera?;
|
|
1003
|
+
private _renderer;
|
|
1004
|
+
get scene(): T;
|
|
1005
|
+
set scene(scene: T);
|
|
1006
|
+
get camera(): U;
|
|
1007
|
+
set camera(camera: U);
|
|
1008
|
+
get renderer(): S | null;
|
|
1009
|
+
set renderer(renderer: S | null);
|
|
1010
|
+
constructor(components: Components);
|
|
1011
|
+
update(delta?: number): void;
|
|
1012
|
+
dispose(disposeResources?: boolean): void;
|
|
1013
|
+
}
|
|
1014
|
+
import * as THREE from "three";
|
|
1015
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1016
|
+
import { Components } from "../../Components";
|
|
1017
|
+
export interface SimpleSceneConfig {
|
|
1018
|
+
directionalLight: {
|
|
1019
|
+
color: THREE.Color;
|
|
1020
|
+
intensity: number;
|
|
1021
|
+
position: THREE.Vector3;
|
|
1022
|
+
};
|
|
1023
|
+
ambientLight: {
|
|
1024
|
+
color: THREE.Color;
|
|
1025
|
+
intensity: number;
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1030
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1031
|
+
* @noInheritDoc
|
|
1032
|
+
*/
|
|
1033
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1034
|
+
/** {@link Configurable.isSetup} */
|
|
1035
|
+
isSetup: boolean;
|
|
1036
|
+
three: THREE.Scene;
|
|
1037
|
+
/** {@link Configurable.onSetup} */
|
|
1038
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1039
|
+
config: Required<SimpleSceneConfig>;
|
|
1040
|
+
constructor(components: Components);
|
|
1041
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1042
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1043
|
+
}
|
|
1044
|
+
import * as THREE from "three";
|
|
1045
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1046
|
+
import { Components } from "../../Components";
|
|
1047
|
+
/**
|
|
1048
|
+
* A basic renderer capable of rendering
|
|
1049
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1050
|
+
*/
|
|
1051
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1052
|
+
/** {@link Component.enabled} */
|
|
1053
|
+
enabled: boolean;
|
|
1054
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1055
|
+
container: HTMLElement | null;
|
|
1056
|
+
three: THREE.WebGLRenderer;
|
|
1057
|
+
protected _canvas: HTMLCanvasElement;
|
|
1058
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1059
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
1060
|
+
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1061
|
+
/** {@link Updateable.update} */
|
|
1062
|
+
update(): void;
|
|
1063
|
+
/** {@link Disposable.dispose} */
|
|
1064
|
+
dispose(): void;
|
|
1065
|
+
/** {@link Resizeable.getSize}. */
|
|
1066
|
+
getSize(): THREE.Vector2;
|
|
1067
|
+
/** {@link Resizeable.resize} */
|
|
1068
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1069
|
+
setupEvents(active: boolean): void;
|
|
1070
|
+
private resizeEvent;
|
|
1071
|
+
private setupRenderer;
|
|
1072
|
+
private onContextLost;
|
|
1073
|
+
private onContextBack;
|
|
1074
|
+
private updateContainer;
|
|
1075
|
+
}
|
|
1076
|
+
import * as THREE from "three";
|
|
1077
|
+
import CameraControls from "camera-controls";
|
|
1078
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1079
|
+
import { Components } from "../../Components";
|
|
1080
|
+
/**
|
|
1081
|
+
* A basic camera that uses
|
|
1082
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1083
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1084
|
+
* what features it offers.
|
|
1085
|
+
*/
|
|
1086
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1087
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1088
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1089
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1090
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1091
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1092
|
+
/** {@link Disposable.onDisposed} */
|
|
1093
|
+
readonly onDisposed: Event<string>;
|
|
1094
|
+
readonly three: THREE.PerspectiveCamera;
|
|
1095
|
+
private _allControls;
|
|
1096
|
+
/**
|
|
1097
|
+
* The object that controls the camera. An instance of
|
|
1098
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1099
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1100
|
+
* object to move, rotate, look at objects, etc.
|
|
1101
|
+
*/
|
|
1102
|
+
get controls(): CameraControls;
|
|
1103
|
+
/** {@link Component.enabled} */
|
|
1104
|
+
get enabled(): boolean;
|
|
1105
|
+
/** {@link Component.enabled} */
|
|
1106
|
+
set enabled(enabled: boolean);
|
|
1107
|
+
constructor(components: Components);
|
|
1108
|
+
/** {@link Disposable.dispose} */
|
|
1109
|
+
dispose(): void;
|
|
1110
|
+
/** {@link Updateable.update} */
|
|
1111
|
+
update(_delta: number): void;
|
|
1112
|
+
/**
|
|
1113
|
+
* Updates the aspect of the camera to match the size of the
|
|
1114
|
+
* {@link Components.renderer}.
|
|
1115
|
+
*/
|
|
1116
|
+
updateAspect: () => void;
|
|
1117
|
+
private setupCamera;
|
|
1118
|
+
private newCameraControls;
|
|
1119
|
+
private setupEvents;
|
|
1120
|
+
private static getSubsetOfThree;
|
|
1121
|
+
}
|
|
1122
|
+
import * as THREE from "three";
|
|
1123
|
+
import { Disposable, Event } from "../../Types";
|
|
1124
|
+
/**
|
|
1125
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1126
|
+
* to work with tools like the
|
|
1127
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1128
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1129
|
+
*/
|
|
1130
|
+
export declare class Mouse implements Disposable {
|
|
1131
|
+
dom: HTMLCanvasElement;
|
|
1132
|
+
private _event?;
|
|
1133
|
+
private _position;
|
|
1134
|
+
/** {@link Disposable.onDisposed} */
|
|
1135
|
+
readonly onDisposed: Event<unknown>;
|
|
1136
|
+
constructor(dom: HTMLCanvasElement);
|
|
1137
|
+
/**
|
|
1138
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1139
|
+
*/
|
|
1140
|
+
get position(): THREE.Vector2;
|
|
1141
|
+
/** {@link Disposable.dispose} */
|
|
1142
|
+
dispose(): void;
|
|
1143
|
+
private getPositionY;
|
|
1144
|
+
private getPositionX;
|
|
1145
|
+
private updateMouseInfo;
|
|
1146
|
+
private setupEvents;
|
|
1147
|
+
}
|
|
1148
|
+
import * as THREE from "three";
|
|
1149
|
+
import { Components } from "../../Components";
|
|
1150
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1151
|
+
import { Mouse } from "./mouse";
|
|
1152
|
+
/**
|
|
1153
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1154
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1155
|
+
* events.
|
|
1156
|
+
*/
|
|
1157
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1158
|
+
/** {@link Component.enabled} */
|
|
1159
|
+
enabled: boolean;
|
|
1160
|
+
components: Components;
|
|
1161
|
+
/** {@link Disposable.onDisposed} */
|
|
1162
|
+
readonly onDisposed: Event<unknown>;
|
|
1163
|
+
/** The position of the mouse in the screen. */
|
|
1164
|
+
readonly mouse: Mouse;
|
|
1165
|
+
readonly three: THREE.Raycaster;
|
|
1166
|
+
world: World;
|
|
1167
|
+
constructor(components: Components, world: World);
|
|
1168
|
+
/** {@link Disposable.dispose} */
|
|
1169
|
+
dispose(): void;
|
|
1170
|
+
/**
|
|
1171
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1172
|
+
* the first item found. This also takes into account the clipping planes
|
|
1173
|
+
* used by the renderer.
|
|
1174
|
+
*
|
|
1175
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1176
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1177
|
+
* {@link Components.meshes}.
|
|
1178
|
+
*/
|
|
1179
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1180
|
+
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;
|
|
1181
|
+
private intersect;
|
|
1182
|
+
private filterClippingPlanes;
|
|
1183
|
+
}
|
|
1184
|
+
import * as THREE from "three";
|
|
1185
|
+
import { Components } from "../../Components";
|
|
1186
|
+
import { Event, World } from "../../Types";
|
|
1187
|
+
export interface CullerRendererSettings {
|
|
1188
|
+
updateInterval?: number;
|
|
1189
|
+
width?: number;
|
|
1190
|
+
height?: number;
|
|
1191
|
+
autoUpdate?: boolean;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* A base renderer to determine visibility on screen
|
|
1195
|
+
*/
|
|
1196
|
+
export declare class CullerRenderer {
|
|
1197
|
+
/** {@link Disposable.onDisposed} */
|
|
1198
|
+
readonly onDisposed: Event<string>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1201
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1202
|
+
* just before but not anymore.
|
|
1203
|
+
*/
|
|
1204
|
+
readonly onViewUpdated: Event<any>;
|
|
1205
|
+
/** {@link Component.enabled} */
|
|
1206
|
+
enabled: boolean;
|
|
1207
|
+
/**
|
|
1208
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1209
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1210
|
+
*/
|
|
1211
|
+
needsUpdate: boolean;
|
|
1212
|
+
/**
|
|
1213
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1214
|
+
* for debugging purposes.
|
|
1215
|
+
*/
|
|
1216
|
+
renderDebugFrame: boolean;
|
|
1217
|
+
components: Components;
|
|
1218
|
+
readonly world: World;
|
|
1219
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1220
|
+
protected autoUpdate: boolean;
|
|
1221
|
+
protected updateInterval: number;
|
|
1222
|
+
protected readonly worker: Worker;
|
|
1223
|
+
protected readonly scene: THREE.Scene;
|
|
1224
|
+
private _width;
|
|
1225
|
+
private _height;
|
|
1226
|
+
private _availableColor;
|
|
1227
|
+
private readonly renderTarget;
|
|
1228
|
+
private readonly bufferSize;
|
|
1229
|
+
private readonly _buffer;
|
|
1230
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1231
|
+
/** {@link Disposable.dispose} */
|
|
1232
|
+
dispose(): void;
|
|
1233
|
+
/**
|
|
1234
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1235
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1236
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1237
|
+
* not true.
|
|
1238
|
+
*/
|
|
1239
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1240
|
+
protected getAvailableColor(): {
|
|
1241
|
+
r: number;
|
|
1242
|
+
g: number;
|
|
1243
|
+
b: number;
|
|
1244
|
+
code: string;
|
|
1245
|
+
};
|
|
1246
|
+
protected increaseColor(): void;
|
|
1247
|
+
protected decreaseColor(): void;
|
|
1248
|
+
private applySettings;
|
|
1249
|
+
}
|
|
1250
|
+
import * as THREE from "three";
|
|
1251
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1252
|
+
import { Components } from "../../Components";
|
|
1253
|
+
import { Event, World } from "../../Types";
|
|
1254
|
+
/**
|
|
1255
|
+
* A renderer to determine a mesh visibility on screen
|
|
1256
|
+
*/
|
|
1257
|
+
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1258
|
+
threshold: number;
|
|
1259
|
+
readonly onViewUpdated: Event<{
|
|
1260
|
+
seen: Set<THREE.Mesh>;
|
|
1261
|
+
unseen: Set<THREE.Mesh>;
|
|
1262
|
+
}>;
|
|
1263
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1264
|
+
isProcessing: boolean;
|
|
1265
|
+
private _colorCodeMeshMap;
|
|
1266
|
+
private _meshIDColorCodeMap;
|
|
1267
|
+
private _currentVisibleMeshes;
|
|
1268
|
+
private _recentlyHiddenMeshes;
|
|
1269
|
+
private readonly _transparentMat;
|
|
1270
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1271
|
+
dispose(): void;
|
|
1272
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1273
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1274
|
+
private handleWorkerMessage;
|
|
1275
|
+
private getAvailableMaterial;
|
|
1276
|
+
}
|
|
1277
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1278
|
+
/// <reference types="node" />
|
|
1279
|
+
import * as THREE from "three";
|
|
1280
|
+
import { Hideable, Event, World } from "../../Types";
|
|
1281
|
+
import { Components } from "../../Components";
|
|
1282
|
+
export interface GridConfig {
|
|
1283
|
+
color: THREE.Color;
|
|
1284
|
+
size1: number;
|
|
1285
|
+
size2: number;
|
|
1286
|
+
distance: number;
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* An infinite grid. Created by
|
|
1290
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1291
|
+
* and translated to typescript by
|
|
1292
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1293
|
+
*/
|
|
1294
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1295
|
+
/** {@link Disposable.onDisposed} */
|
|
1296
|
+
readonly onDisposed: Event<unknown>;
|
|
1297
|
+
world: World;
|
|
1298
|
+
components: Components;
|
|
1299
|
+
/** {@link Hideable.visible} */
|
|
1300
|
+
get visible(): boolean;
|
|
1301
|
+
/** {@link Hideable.visible} */
|
|
1302
|
+
set visible(visible: boolean);
|
|
1303
|
+
/** The material of the grid. */
|
|
1304
|
+
get material(): THREE.ShaderMaterial;
|
|
1305
|
+
/**
|
|
1306
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1307
|
+
* perspective cameras and false for orthographic cameras.
|
|
1308
|
+
*/
|
|
1309
|
+
get fade(): boolean;
|
|
1310
|
+
/**
|
|
1311
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1312
|
+
* perspective cameras and false for orthographic cameras.
|
|
1313
|
+
*/
|
|
1314
|
+
set fade(active: boolean);
|
|
1315
|
+
private readonly _grid;
|
|
1316
|
+
private _fade;
|
|
1317
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
1318
|
+
[Symbol.dispose](): void;
|
|
1319
|
+
/** {@link Component.get} */
|
|
1320
|
+
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1321
|
+
/** {@link Disposable.dispose} */
|
|
1322
|
+
dispose(): void;
|
|
1323
|
+
private setupEvents;
|
|
1324
|
+
private updateZoom;
|
|
1325
|
+
}
|
|
1326
|
+
import * as THREE from "three";
|
|
1327
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1328
|
+
import { Components } from "../../Components";
|
|
1329
|
+
/**
|
|
1330
|
+
* Each of the planes created by {@link SimpleClipper}.
|
|
1331
|
+
*/
|
|
1332
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
1333
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1334
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
1335
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1336
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
1337
|
+
/** {@link Disposable.onDisposed} */
|
|
1338
|
+
readonly onDisposed: Event<unknown>;
|
|
1339
|
+
readonly normal: THREE.Vector3;
|
|
1340
|
+
readonly origin: THREE.Vector3;
|
|
1341
|
+
readonly three: THREE.Plane;
|
|
1342
|
+
protected readonly _helper: THREE.Object3D;
|
|
1343
|
+
protected _visible: boolean;
|
|
1344
|
+
protected _enabled: boolean;
|
|
1345
|
+
components: Components;
|
|
1346
|
+
world: World;
|
|
1347
|
+
private _controlsActive;
|
|
1348
|
+
private readonly _arrowBoundBox;
|
|
1349
|
+
private readonly _planeMesh;
|
|
1350
|
+
private readonly _controls;
|
|
1351
|
+
private readonly _hiddenMaterial;
|
|
1352
|
+
get enabled(): boolean;
|
|
1353
|
+
/** {@link Component.enabled} */
|
|
1354
|
+
set enabled(state: boolean);
|
|
1355
|
+
/** {@link Hideable.visible } */
|
|
1356
|
+
get visible(): boolean;
|
|
1357
|
+
/** {@link Hideable.visible } */
|
|
1358
|
+
set visible(state: boolean);
|
|
1359
|
+
/** The meshes used for raycasting */
|
|
1360
|
+
get meshes(): THREE.Mesh[];
|
|
1361
|
+
/** The material of the clipping plane representation. */
|
|
1362
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1363
|
+
/** The material of the clipping plane representation. */
|
|
1364
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1365
|
+
/** The size of the clipping plane representation. */
|
|
1366
|
+
get size(): number;
|
|
1367
|
+
/** Sets the size of the clipping plane representation. */
|
|
1368
|
+
set size(size: number);
|
|
1369
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1370
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1371
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1372
|
+
/** {@link Updateable.update} */
|
|
1373
|
+
update: () => Promise<void>;
|
|
1374
|
+
/** {@link Disposable.dispose} */
|
|
1375
|
+
dispose(): void;
|
|
1376
|
+
private reset;
|
|
1377
|
+
protected toggleControls(state: boolean): void;
|
|
1378
|
+
private newTransformControls;
|
|
1379
|
+
private initializeControls;
|
|
1380
|
+
private createArrowBoundingBox;
|
|
1381
|
+
private changeDrag;
|
|
1382
|
+
private notifyDraggingChanged;
|
|
1383
|
+
private preventCameraMovement;
|
|
1384
|
+
private newHelper;
|
|
1385
|
+
private static newPlaneMesh;
|
|
1386
|
+
}
|
|
1387
|
+
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1388
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1389
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1390
|
+
minGeometrySize: number;
|
|
1391
|
+
minAssetsSize: number;
|
|
1392
|
+
}
|
|
1393
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1394
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1395
|
+
propertiesSize: number;
|
|
1396
|
+
}
|
|
1397
|
+
import * as WEBIFC from "web-ifc";
|
|
1398
|
+
import { Component, Disposable, Event } from "../../../core";
|
|
1399
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1400
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1401
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1402
|
+
onPropertiesStreamed: Event<{
|
|
1403
|
+
type: number;
|
|
1404
|
+
data: {
|
|
1405
|
+
[id: number]: any;
|
|
1406
|
+
};
|
|
1407
|
+
}>;
|
|
1408
|
+
onProgress: Event<number>;
|
|
1409
|
+
onIndicesStreamed: Event<number[][]>;
|
|
1410
|
+
/** {@link Disposable.onDisposed} */
|
|
1411
|
+
readonly onDisposed: Event<string>;
|
|
1412
|
+
enabled: boolean;
|
|
1413
|
+
settings: PropertiesStreamingSettings;
|
|
1414
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1415
|
+
dispose(): Promise<void>;
|
|
1416
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1417
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1418
|
+
private readIfcFile;
|
|
1419
|
+
private streamIfcFile;
|
|
1420
|
+
private streamAllProperties;
|
|
1421
|
+
private getIndices;
|
|
1422
|
+
private cleanUp;
|
|
1423
|
+
}
|
|
1424
|
+
import * as WEBIFC from "web-ifc";
|
|
1425
|
+
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1426
|
+
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1427
|
+
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1428
|
+
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1429
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1430
|
+
onGeometryStreamed: Event<{
|
|
1431
|
+
buffer: Uint8Array;
|
|
1432
|
+
data: StreamedGeometries;
|
|
1433
|
+
}>;
|
|
1434
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1435
|
+
onProgress: Event<number>;
|
|
1436
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
1437
|
+
/** {@link Disposable.onDisposed} */
|
|
1438
|
+
readonly onDisposed: Event<unknown>;
|
|
1439
|
+
settings: IfcStreamingSettings;
|
|
1440
|
+
enabled: boolean;
|
|
1441
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1442
|
+
private _spatialTree;
|
|
1443
|
+
private _metaData;
|
|
1444
|
+
private _visitedGeometries;
|
|
1445
|
+
private _streamSerializer;
|
|
1446
|
+
private _geometries;
|
|
1447
|
+
private _geometryCount;
|
|
1448
|
+
private _civil;
|
|
1449
|
+
private _groupSerializer;
|
|
1450
|
+
private _assets;
|
|
1451
|
+
private _meshesWithHoles;
|
|
1452
|
+
constructor(components: Components);
|
|
1453
|
+
dispose(): void;
|
|
1454
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1455
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1456
|
+
private readIfcFile;
|
|
1457
|
+
private streamIfcFile;
|
|
1458
|
+
private streamAllGeometries;
|
|
1459
|
+
private cleanUp;
|
|
1460
|
+
private getMesh;
|
|
1461
|
+
private getGeometry;
|
|
1462
|
+
private streamAssets;
|
|
1463
|
+
private streamGeometries;
|
|
1464
|
+
}
|
|
1465
|
+
export interface StreamedGeometries {
|
|
1466
|
+
[id: number]: {
|
|
1467
|
+
boundingBox: Float32Array;
|
|
1468
|
+
hasHoles: boolean;
|
|
1469
|
+
geometryFile?: string;
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
export interface StreamedAsset {
|
|
1473
|
+
id: number;
|
|
1474
|
+
geometries: {
|
|
1475
|
+
geometryID: number;
|
|
1476
|
+
transformation: number[];
|
|
1477
|
+
color: number[];
|
|
1478
|
+
}[];
|
|
1479
|
+
}
|
|
1480
|
+
import * as WEBIFC from "web-ifc";
|
|
1481
|
+
import * as THREE from "three";
|
|
1482
|
+
export declare class Units {
|
|
1483
|
+
factor: number;
|
|
1484
|
+
complement: number;
|
|
1485
|
+
apply(matrix: THREE.Matrix4): void;
|
|
1486
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1487
|
+
private getLengthUnits;
|
|
1488
|
+
private getScaleMatrix;
|
|
1489
|
+
}
|
|
1490
|
+
import * as THREE from "three";
|
|
1491
|
+
import * as WEBIFC from "web-ifc";
|
|
1492
|
+
import * as FRAGS from "bim-fragment";
|
|
1493
|
+
export declare class CivilReader {
|
|
1494
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1495
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1496
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1497
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1498
|
+
} | undefined;
|
|
1499
|
+
get(civilItems: any): {
|
|
1500
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1501
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1502
|
+
} | undefined;
|
|
1503
|
+
private getCurves;
|
|
1504
|
+
}
|
|
1505
|
+
import * as WEBIFC from "web-ifc";
|
|
1506
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
1507
|
+
export declare class IfcFragmentSettings {
|
|
1508
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
1509
|
+
includeProperties: boolean;
|
|
1510
|
+
/**
|
|
1511
|
+
* Generate the geometry for categories that are not included by default,
|
|
1512
|
+
* like IFCSPACE.
|
|
1513
|
+
*/
|
|
1514
|
+
optionalCategories: number[];
|
|
1515
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
1516
|
+
coordinate: boolean;
|
|
1517
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1518
|
+
wasm: {
|
|
1519
|
+
path: string;
|
|
1520
|
+
absolute: boolean;
|
|
1521
|
+
logLevel?: WEBIFC.LogLevel;
|
|
1522
|
+
};
|
|
1523
|
+
/** List of categories that won't be converted to fragments. */
|
|
1524
|
+
excludedCategories: Set<number>;
|
|
1525
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
1526
|
+
saveLocations: boolean;
|
|
1527
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1528
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
1529
|
+
autoSetWasm: boolean;
|
|
1530
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1531
|
+
}
|
|
1532
|
+
import * as WEBIFC from "web-ifc";
|
|
1533
|
+
export declare class IfcMetadataReader {
|
|
1534
|
+
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1535
|
+
}
|
|
1536
|
+
import { BufferGeometry } from "three";
|
|
1537
|
+
import * as THREE from "three";
|
|
1538
|
+
export declare class TransformHelper {
|
|
1539
|
+
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1540
|
+
}
|
|
1541
|
+
export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
|
|
1542
|
+
export type ConditionFunctions = {
|
|
1543
|
+
[queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
|
|
1544
|
+
};
|
|
1545
|
+
export type QueryOperators = "AND" | "OR";
|
|
1546
|
+
export interface AttributeQuery {
|
|
1547
|
+
operator?: QueryOperators;
|
|
1548
|
+
attribute: string;
|
|
1549
|
+
condition: QueryConditions;
|
|
1550
|
+
value: string | number | boolean;
|
|
1551
|
+
negateResult?: boolean;
|
|
1552
|
+
caseSensitive?: boolean;
|
|
1553
|
+
}
|
|
1554
|
+
export interface QueryGroup {
|
|
1555
|
+
operator?: QueryOperators;
|
|
1556
|
+
description?: string;
|
|
1557
|
+
queries: (AttributeQuery | QueryGroup)[];
|
|
1558
|
+
}
|
|
1559
|
+
export interface Query {
|
|
1560
|
+
name: string;
|
|
1561
|
+
description?: string;
|
|
1562
|
+
groups: QueryGroup;
|
|
1563
|
+
}
|
|
1564
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1565
|
+
export declare class FragmentExploder extends Component implements Disposable {
|
|
1566
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1567
|
+
enabled: boolean;
|
|
1568
|
+
height: number;
|
|
1569
|
+
groupName: string;
|
|
1570
|
+
/** {@link Disposable.onDisposed} */
|
|
1571
|
+
readonly onDisposed: Event<string>;
|
|
1572
|
+
list: Set<string>;
|
|
1573
|
+
constructor(components: Components);
|
|
1574
|
+
dispose(): void;
|
|
1575
|
+
explode(): void;
|
|
1576
|
+
reset(): void;
|
|
1577
|
+
update(): void;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
}
|