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