@thatopen/components 2.0.0-alpha.0 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Clipper/index.d.ts +4 -4
- package/dist/core/Cullers/src/culler-renderer.d.ts +3 -2
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +1 -0
- package/dist/core/Materials/index.d.ts +3 -15
- package/dist/core/MiniMap/index.d.ts +15 -0
- package/dist/core/MiniMap/src/index.d.ts +34 -0
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +50 -0
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +16 -0
- package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +5 -0
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +16 -0
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +20 -0
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +37 -0
- package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +27 -0
- package/dist/core/Types/src/async-event.d.ts +34 -0
- package/dist/core/Types/src/index.d.ts +1 -0
- package/dist/core/Types/src/interfaces.d.ts +3 -14
- package/dist/core/Worlds/src/simple-renderer.d.ts +3 -4
- package/dist/core/index.d.ts +2 -0
- package/dist/fragments/{FragmentBoundingBox → BoundingBoxes}/index.d.ts +4 -4
- package/dist/fragments/FragmentClassifier/index.d.ts +5 -4
- package/dist/fragments/FragmentHider/index.d.ts +10 -0
- package/dist/fragments/FragmentIfcLoader/index.d.ts +1 -2
- package/dist/fragments/FragmentIfcLoader/src/civil-reader.d.ts +1 -1
- package/dist/fragments/FragmentIfcLoader/src/index.d.ts +1 -0
- package/dist/fragments/FragmentManager/index.d.ts +1 -1
- package/dist/fragments/{FragmentIfcStreamer/src/fragment-ifc-stream-converter.d.ts → IfcGeometryTiler/index.d.ts} +4 -4
- package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/fragment-props-stream-converter.d.ts +4 -4
- package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/index.d.ts +0 -1
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +26 -0
- package/dist/fragments/index.d.ts +5 -2
- package/dist/ifc/IfcJsonExporter/index.d.ts +1 -1
- package/dist/ifc/IfcPropertiesFinder/index.d.ts +2 -2
- package/dist/ifc/IfcPropertiesManager/index.d.ts +2 -2
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +135 -0
- package/dist/ifc/IfcRelationsIndexer/src/getRelationMap.d.ts +3 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +4 -0
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +24 -0
- package/dist/ifc/Utils/properties-utils.d.ts +1 -1
- package/dist/ifc/index.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +3496 -2537
- package/dist/measurement/Utils/index.d.ts +20 -0
- package/dist/measurement/index.d.ts +1 -0
- package/dist/namespace.d.ts +1037 -590
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/vertex-picker.d.ts +31 -0
- package/package.json +6 -5
- package/dist/fragments/FragmentIfcStreamer/index.d.ts +0 -1
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +0 -31
- /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/base-types.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/streaming-settings.d.ts +0 -0
package/dist/namespace.d.ts
CHANGED
|
@@ -51,6 +51,19 @@ export declare class Components implements Disposable {
|
|
|
51
51
|
private update;
|
|
52
52
|
private static setupBVH;
|
|
53
53
|
}
|
|
54
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
55
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
56
|
+
export declare class Grids extends Component implements Disposable {
|
|
57
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
58
|
+
list: Map<string, SimpleGrid>;
|
|
59
|
+
onDisposed: Event<unknown>;
|
|
60
|
+
config: Required<GridConfig>;
|
|
61
|
+
/** {@link Component.enabled} */
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
create(world: World): void;
|
|
64
|
+
delete(world: World): void;
|
|
65
|
+
dispose(): void;
|
|
66
|
+
}
|
|
54
67
|
import * as THREE from "three";
|
|
55
68
|
import { Components } from "../Components";
|
|
56
69
|
import { Component } from "../Types";
|
|
@@ -94,48 +107,6 @@ export declare class Disposer extends Component {
|
|
|
94
107
|
private disposeChildren;
|
|
95
108
|
private static disposeMaterial;
|
|
96
109
|
}
|
|
97
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
98
|
-
import { SimpleRaycaster } from "./src";
|
|
99
|
-
import { Components } from "../Components";
|
|
100
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
101
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
102
|
-
enabled: boolean;
|
|
103
|
-
list: Map<string, SimpleRaycaster>;
|
|
104
|
-
onDisposed: Event<unknown>;
|
|
105
|
-
constructor(components: Components);
|
|
106
|
-
get(world: World): SimpleRaycaster;
|
|
107
|
-
delete(world: World): void;
|
|
108
|
-
dispose(): void;
|
|
109
|
-
}
|
|
110
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
111
|
-
import { Components } from "../Components";
|
|
112
|
-
import { SimpleWorld } from "./src";
|
|
113
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
114
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
115
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
116
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
117
|
-
readonly onDisposed: Event<unknown>;
|
|
118
|
-
list: Map<string, World>;
|
|
119
|
-
enabled: boolean;
|
|
120
|
-
constructor(components: Components);
|
|
121
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
122
|
-
delete(world: World): void;
|
|
123
|
-
dispose(): void;
|
|
124
|
-
update(delta?: number): void | Promise<void>;
|
|
125
|
-
}
|
|
126
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
127
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
128
|
-
export declare class Grids extends Component implements Disposable {
|
|
129
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
130
|
-
list: Map<string, SimpleGrid>;
|
|
131
|
-
onDisposed: Event<unknown>;
|
|
132
|
-
config: Required<GridConfig>;
|
|
133
|
-
/** {@link Component.enabled} */
|
|
134
|
-
enabled: boolean;
|
|
135
|
-
create(world: World): void;
|
|
136
|
-
delete(world: World): void;
|
|
137
|
-
dispose(): void;
|
|
138
|
-
}
|
|
139
110
|
import * as THREE from "three";
|
|
140
111
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
141
112
|
import { SimplePlane } from "./src";
|
|
@@ -177,10 +148,10 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
177
148
|
* has to be 'true' for this to apply.
|
|
178
149
|
*/
|
|
179
150
|
toleranceOrthogonalY: number;
|
|
180
|
-
|
|
151
|
+
list: T[];
|
|
181
152
|
protected PlaneType: new (...args: any) => SimplePlane | T;
|
|
182
153
|
/** The material used in all the clipping planes. */
|
|
183
|
-
protected _material: THREE.
|
|
154
|
+
protected _material: THREE.MeshBasicMaterial;
|
|
184
155
|
private _size;
|
|
185
156
|
private _enabled;
|
|
186
157
|
private _visible;
|
|
@@ -193,9 +164,9 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
193
164
|
/** {@link Hideable.visible } */
|
|
194
165
|
set visible(state: boolean);
|
|
195
166
|
/** The material of the clipping plane representation. */
|
|
196
|
-
get material(): THREE.
|
|
167
|
+
get material(): THREE.MeshBasicMaterial;
|
|
197
168
|
/** The material of the clipping plane representation. */
|
|
198
|
-
set material(material: THREE.
|
|
169
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
199
170
|
/** The size of the geometric representation of the clippings planes. */
|
|
200
171
|
get size(): number;
|
|
201
172
|
/** The size of the geometric representation of the clippings planes. */
|
|
@@ -240,7 +211,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
240
211
|
private _onEndDragging;
|
|
241
212
|
}
|
|
242
213
|
import * as THREE from "three";
|
|
243
|
-
import { Component, Disposable, Event
|
|
214
|
+
import { Component, Disposable, Event } from "../Types";
|
|
244
215
|
import { Components } from "../Components";
|
|
245
216
|
/**
|
|
246
217
|
* A tool to easily handle the materials of massive amounts of
|
|
@@ -250,7 +221,6 @@ export declare class Materials extends Component implements Disposable {
|
|
|
250
221
|
static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
|
|
251
222
|
/** {@link Component.enabled} */
|
|
252
223
|
enabled: boolean;
|
|
253
|
-
private _originalBackground;
|
|
254
224
|
/** {@link Disposable.onDisposed} */
|
|
255
225
|
readonly onDisposed: Event<string>;
|
|
256
226
|
list: {
|
|
@@ -261,6 +231,8 @@ export declare class Materials extends Component implements Disposable {
|
|
|
261
231
|
};
|
|
262
232
|
private _originals;
|
|
263
233
|
constructor(components: Components);
|
|
234
|
+
/** {@link Disposable.dispose} */
|
|
235
|
+
dispose(): void;
|
|
264
236
|
/**
|
|
265
237
|
* Turns the specified material styles on or off.
|
|
266
238
|
*
|
|
@@ -268,19 +240,6 @@ export declare class Materials extends Component implements Disposable {
|
|
|
268
240
|
* @param ids the ids of the style to turn on or off.
|
|
269
241
|
*/
|
|
270
242
|
set(active: boolean, ids?: string[]): void;
|
|
271
|
-
/** {@link Disposable.dispose} */
|
|
272
|
-
dispose(): void;
|
|
273
|
-
/**
|
|
274
|
-
* Sets the color of the background of the scene.
|
|
275
|
-
*
|
|
276
|
-
* @param color: the color to apply.
|
|
277
|
-
*/
|
|
278
|
-
setBackgroundColor(color: THREE.Color, world: World): void;
|
|
279
|
-
/**
|
|
280
|
-
* Resets the scene background to the color that was being used
|
|
281
|
-
* before applying the material manager.
|
|
282
|
-
*/
|
|
283
|
-
resetBackgroundColor(world: World): void;
|
|
284
243
|
/**
|
|
285
244
|
* Creates a new material style.
|
|
286
245
|
* @param id the identifier of the style to create.
|
|
@@ -300,191 +259,101 @@ export declare class Materials extends Component implements Disposable {
|
|
|
300
259
|
*/
|
|
301
260
|
removeMeshes(id: string, meshes: THREE.Mesh[]): void;
|
|
302
261
|
}
|
|
303
|
-
import
|
|
304
|
-
|
|
305
|
-
center: THREE.Vector3;
|
|
306
|
-
halfSizes: THREE.Vector3;
|
|
307
|
-
rotation: THREE.Matrix3;
|
|
308
|
-
transformation: THREE.Matrix4;
|
|
309
|
-
};
|
|
310
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
311
|
-
import * as THREE from "three";
|
|
312
|
-
export declare class MaterialsUtils {
|
|
313
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
314
|
-
}
|
|
315
|
-
export declare class UUID {
|
|
316
|
-
private static _pattern;
|
|
317
|
-
private static _lut;
|
|
318
|
-
static create(): string;
|
|
319
|
-
static validate(uuid: string): void;
|
|
320
|
-
}
|
|
262
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
263
|
+
import { SimpleRaycaster } from "./src";
|
|
321
264
|
import { Components } from "../Components";
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
326
|
-
* that are not visible to the camera.
|
|
327
|
-
*/
|
|
328
|
-
export declare class Cullers extends Component implements Disposable {
|
|
329
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
330
|
-
private _enabled;
|
|
331
|
-
list: Map<string, MeshCullerRenderer>;
|
|
332
|
-
/** {@link Disposable.onDisposed} */
|
|
333
|
-
readonly onDisposed: Event<unknown>;
|
|
334
|
-
/** {@link Component.enabled} */
|
|
335
|
-
get enabled(): boolean;
|
|
336
|
-
set enabled(value: boolean);
|
|
337
|
-
constructor(components: Components);
|
|
338
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
339
|
-
delete(world: World): void;
|
|
340
|
-
/** {@link Disposable.dispose} */
|
|
341
|
-
dispose(): void;
|
|
342
|
-
}
|
|
343
|
-
import * as THREE from "three";
|
|
344
|
-
import * as FRAGS from "bim-fragment";
|
|
345
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
346
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
347
|
-
/**
|
|
348
|
-
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
349
|
-
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
350
|
-
*/
|
|
351
|
-
export declare class FragmentBoundingBox extends Component implements Disposable {
|
|
352
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
353
|
-
/** {@link Component.enabled} */
|
|
265
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
266
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
354
267
|
enabled: boolean;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
private _absoluteMin;
|
|
358
|
-
private _absoluteMax;
|
|
359
|
-
private _meshes;
|
|
268
|
+
list: Map<string, SimpleRaycaster>;
|
|
269
|
+
onDisposed: Event<unknown>;
|
|
360
270
|
constructor(components: Components);
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
height: number;
|
|
364
|
-
depth: number;
|
|
365
|
-
center: THREE.Vector3;
|
|
366
|
-
};
|
|
367
|
-
static newBound(positive: boolean): THREE.Vector3;
|
|
368
|
-
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
369
|
-
/** {@link Disposable.dispose} */
|
|
271
|
+
get(world: World): SimpleRaycaster;
|
|
272
|
+
delete(world: World): void;
|
|
370
273
|
dispose(): void;
|
|
371
|
-
get(): THREE.Box3;
|
|
372
|
-
getSphere(): THREE.Sphere;
|
|
373
|
-
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
374
|
-
reset(): void;
|
|
375
|
-
add(group: FragmentsGroup): void;
|
|
376
|
-
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
|
|
377
|
-
private static getFragmentBounds;
|
|
378
|
-
}
|
|
379
|
-
import * as FRAGS from "bim-fragment";
|
|
380
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
381
|
-
export interface Classification {
|
|
382
|
-
[system: string]: {
|
|
383
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
384
|
-
};
|
|
385
274
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
275
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
276
|
+
import { Components } from "../Components";
|
|
277
|
+
import { SimpleWorld } from "./src";
|
|
278
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
279
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
280
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
281
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
392
282
|
readonly onDisposed: Event<unknown>;
|
|
393
|
-
|
|
394
|
-
private onFragmentsDisposed;
|
|
395
|
-
/** {@link Component.get} */
|
|
396
|
-
get(): Classification;
|
|
397
|
-
dispose(): void;
|
|
398
|
-
remove(guid: string): void;
|
|
399
|
-
find(filter?: {
|
|
400
|
-
[name: string]: string[];
|
|
401
|
-
}): FRAGS.FragmentIdMap;
|
|
402
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
403
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
404
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
405
|
-
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
406
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
407
|
-
private saveItem;
|
|
408
|
-
}
|
|
409
|
-
import * as WEBIFC from "web-ifc";
|
|
410
|
-
import * as FRAGS from "bim-fragment";
|
|
411
|
-
import { IfcFragmentSettings } from "./src";
|
|
412
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
413
|
-
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
414
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
415
|
-
readonly onIfcLoaded: Event<FRAGS.FragmentsGroup>;
|
|
416
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
417
|
-
readonly onSetup: Event<void>;
|
|
418
|
-
/** {@link Disposable.onDisposed} */
|
|
419
|
-
readonly onDisposed: Event<string>;
|
|
420
|
-
settings: IfcFragmentSettings;
|
|
283
|
+
list: Map<string, World>;
|
|
421
284
|
enabled: boolean;
|
|
422
|
-
webIfc: WEBIFC.IfcAPI;
|
|
423
|
-
private _material;
|
|
424
|
-
private _spatialTree;
|
|
425
|
-
private _metaData;
|
|
426
|
-
private _fragmentInstances;
|
|
427
|
-
private _civil;
|
|
428
|
-
private _propertyExporter;
|
|
429
|
-
private _visitedFragments;
|
|
430
|
-
private _materialT;
|
|
431
285
|
constructor(components: Components);
|
|
286
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
287
|
+
delete(world: World): void;
|
|
432
288
|
dispose(): void;
|
|
433
|
-
|
|
434
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
435
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
436
|
-
private getAllGeometries;
|
|
437
|
-
cleanUp(): void;
|
|
438
|
-
private getMesh;
|
|
439
|
-
private getGeometry;
|
|
440
|
-
private autoSetWasm;
|
|
289
|
+
update(delta?: number): void | Promise<void>;
|
|
441
290
|
}
|
|
442
|
-
import { Fragment, FragmentsGroup } from "bim-fragment";
|
|
443
291
|
import * as THREE from "three";
|
|
444
|
-
import {
|
|
292
|
+
import { Components } from "../../core/Components";
|
|
293
|
+
import { SimpleCamera } from "../../core";
|
|
294
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
445
295
|
/**
|
|
446
|
-
*
|
|
447
|
-
* [
|
|
296
|
+
* A flexible camera that uses
|
|
297
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
298
|
+
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
299
|
+
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
448
300
|
*/
|
|
449
|
-
export declare class
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
readonly
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
readonly groups: Map<string, FragmentsGroup>;
|
|
461
|
-
/** {@link Component.enabled} */
|
|
462
|
-
enabled: boolean;
|
|
463
|
-
baseCoordinationModel: string;
|
|
464
|
-
private _loader;
|
|
465
|
-
/** The list of meshes of the created fragments. */
|
|
466
|
-
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
301
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
302
|
+
/**
|
|
303
|
+
* The current {@link NavigationMode}.
|
|
304
|
+
*/
|
|
305
|
+
mode: NavigationMode;
|
|
306
|
+
readonly projection: ProjectionManager;
|
|
307
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
308
|
+
protected readonly _userInputButtons: any;
|
|
309
|
+
protected readonly _frustumSize = 50;
|
|
310
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
311
|
+
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
467
312
|
constructor(components: Components);
|
|
468
313
|
/** {@link Disposable.dispose} */
|
|
469
314
|
dispose(): void;
|
|
470
|
-
disposeGroup(group: FragmentsGroup): void;
|
|
471
315
|
/**
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
* @param
|
|
475
|
-
* @returns the list of IDs of the loaded fragments.
|
|
316
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
317
|
+
*
|
|
318
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
476
319
|
*/
|
|
477
|
-
|
|
320
|
+
set(mode: NavModeID): void;
|
|
478
321
|
/**
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
* @
|
|
322
|
+
* Make the camera view fit all the specified meshes.
|
|
323
|
+
*
|
|
324
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
325
|
+
* evaluate {@link Components.meshes}.
|
|
326
|
+
* @param offset the distance to the fit object
|
|
482
327
|
*/
|
|
483
|
-
|
|
484
|
-
|
|
328
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
329
|
+
/**
|
|
330
|
+
* Allows or prevents all user input.
|
|
331
|
+
*
|
|
332
|
+
* @param active - whether to enable or disable user inputs.
|
|
333
|
+
*/
|
|
334
|
+
setUserInput(active: boolean): void;
|
|
335
|
+
private disableUserInput;
|
|
336
|
+
private enableUserInput;
|
|
337
|
+
private newOrthoCamera;
|
|
338
|
+
private setOrthoCameraAspect;
|
|
339
|
+
}
|
|
340
|
+
import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
|
|
341
|
+
import { MiniMap } from "./src";
|
|
342
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
343
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
344
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
345
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
346
|
+
readonly onDisposed: Event<unknown>;
|
|
347
|
+
enabled: boolean;
|
|
348
|
+
list: Map<string, MiniMap>;
|
|
349
|
+
constructor(components: Components);
|
|
350
|
+
create(world: World): MiniMap;
|
|
351
|
+
delete(id: string): void;
|
|
352
|
+
dispose(): void | Promise<void>;
|
|
353
|
+
update(): void;
|
|
485
354
|
}
|
|
486
355
|
import * as WEBIFC from "web-ifc";
|
|
487
|
-
import * as FRAG from "
|
|
356
|
+
import * as FRAG from "@thatopen/fragments";
|
|
488
357
|
/**
|
|
489
358
|
* Object to export all the properties from an IFC to a JS object.
|
|
490
359
|
*/
|
|
@@ -499,14 +368,21 @@ export declare class IfcJsonExporter {
|
|
|
499
368
|
*/
|
|
500
369
|
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
501
370
|
}
|
|
502
|
-
import * as
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
371
|
+
import * as THREE from "three";
|
|
372
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
373
|
+
center: THREE.Vector3;
|
|
374
|
+
halfSizes: THREE.Vector3;
|
|
375
|
+
rotation: THREE.Matrix3;
|
|
376
|
+
transformation: THREE.Matrix4;
|
|
377
|
+
};
|
|
378
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
379
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
380
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
381
|
+
import { QueryGroup } from "./src/types";
|
|
382
|
+
export interface QueryResult {
|
|
383
|
+
[modelID: string]: {
|
|
384
|
+
modelEntities: Set<number>;
|
|
385
|
+
otherEntities: Set<number>;
|
|
510
386
|
};
|
|
511
387
|
}
|
|
512
388
|
export interface IndexedModels {
|
|
@@ -536,39 +412,8 @@ export declare class IfcPropertiesFinder extends Component implements Disposable
|
|
|
536
412
|
private arrayUnion;
|
|
537
413
|
private getConditionFunctions;
|
|
538
414
|
}
|
|
539
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
540
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
541
|
-
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
542
|
-
interface IndexMap {
|
|
543
|
-
[modelID: string]: {
|
|
544
|
-
[expressID: string]: Set<number>;
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
548
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
549
|
-
/** {@link Disposable.onDisposed} */
|
|
550
|
-
readonly onDisposed: Event<string>;
|
|
551
|
-
enabled: boolean;
|
|
552
|
-
relationsToProcess: number[];
|
|
553
|
-
indexMap: IndexMap;
|
|
554
|
-
private _propertiesManager;
|
|
555
|
-
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
556
|
-
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
557
|
-
get propertiesManager(): IfcPropertiesManager | null;
|
|
558
|
-
constructor(components: Components);
|
|
559
|
-
private onFragmentsDisposed;
|
|
560
|
-
dispose(): Promise<void>;
|
|
561
|
-
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
562
|
-
private getNestedPsets;
|
|
563
|
-
private getPsetProperties;
|
|
564
|
-
process(model: FragmentsGroup): Promise<void>;
|
|
565
|
-
private setEntityIndex;
|
|
566
|
-
private cloneProperty;
|
|
567
|
-
private clonePropertyArray;
|
|
568
|
-
}
|
|
569
|
-
export {};
|
|
570
415
|
import * as WEBIFC from "web-ifc";
|
|
571
|
-
import { FragmentsGroup } from "
|
|
416
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
572
417
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
573
418
|
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
574
419
|
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
@@ -619,7 +464,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
619
464
|
get(): ChangeMap;
|
|
620
465
|
dispose(): void;
|
|
621
466
|
private increaseMaxID;
|
|
622
|
-
static getIFCSchema(model: FragmentsGroup): import("
|
|
467
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
623
468
|
private newGUID;
|
|
624
469
|
private getOwnerHistory;
|
|
625
470
|
private registerChange;
|
|
@@ -640,7 +485,442 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
640
485
|
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
641
486
|
}
|
|
642
487
|
export {};
|
|
643
|
-
|
|
488
|
+
import { Components } from "../Components";
|
|
489
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
490
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
491
|
+
/**
|
|
492
|
+
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
493
|
+
* that are not visible to the camera.
|
|
494
|
+
*/
|
|
495
|
+
export declare class Cullers extends Component implements Disposable {
|
|
496
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
497
|
+
private _enabled;
|
|
498
|
+
list: Map<string, MeshCullerRenderer>;
|
|
499
|
+
/** {@link Disposable.onDisposed} */
|
|
500
|
+
readonly onDisposed: Event<unknown>;
|
|
501
|
+
/** {@link Component.enabled} */
|
|
502
|
+
get enabled(): boolean;
|
|
503
|
+
set enabled(value: boolean);
|
|
504
|
+
constructor(components: Components);
|
|
505
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
506
|
+
delete(world: World): void;
|
|
507
|
+
/** {@link Disposable.dispose} */
|
|
508
|
+
dispose(): void;
|
|
509
|
+
}
|
|
510
|
+
import * as WEBIFC from "web-ifc";
|
|
511
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
512
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
513
|
+
import { RelationsMap, ModelsRelationMap, InverseAttributes, InverseAttribute } from "./src/types";
|
|
514
|
+
/**
|
|
515
|
+
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
516
|
+
* It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
517
|
+
*/
|
|
518
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
519
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
520
|
+
/** {@link Disposable.onDisposed} */
|
|
521
|
+
readonly onDisposed: Event<string>;
|
|
522
|
+
enabled: boolean;
|
|
523
|
+
readonly onRelationsIndexed: Event<{
|
|
524
|
+
modelID: string;
|
|
525
|
+
relationsMap: RelationsMap;
|
|
526
|
+
}>;
|
|
527
|
+
private _relToAttributesMap;
|
|
528
|
+
/**
|
|
529
|
+
* Array of inverse attribute names.
|
|
530
|
+
* This array is used to define the inverse attributes that the indexer will process and index.
|
|
531
|
+
*/
|
|
532
|
+
readonly inverseAttributes: InverseAttributes;
|
|
533
|
+
/**
|
|
534
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
535
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
536
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
537
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
538
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
539
|
+
* of entity relationships within a model.
|
|
540
|
+
*/
|
|
541
|
+
readonly relationMaps: ModelsRelationMap;
|
|
542
|
+
constructor(components: Components);
|
|
543
|
+
private onFragmentsDisposed;
|
|
544
|
+
private getAttributeRels;
|
|
545
|
+
/**
|
|
546
|
+
* Adds a relation map to the model's relations map.
|
|
547
|
+
*
|
|
548
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
549
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
550
|
+
*
|
|
551
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
552
|
+
*/
|
|
553
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
554
|
+
/**
|
|
555
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
556
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
557
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
558
|
+
*
|
|
559
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
560
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
561
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
562
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
563
|
+
* of entities that are related through that attribute.
|
|
564
|
+
*
|
|
565
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
566
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
567
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
568
|
+
* @throws An error if the model does not have properties loaded.
|
|
569
|
+
*/
|
|
570
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
571
|
+
/**
|
|
572
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations based on predefined inverse attributes.
|
|
573
|
+
*
|
|
574
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
575
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
576
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
577
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
578
|
+
*/
|
|
579
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
580
|
+
/**
|
|
581
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
582
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
583
|
+
* returning the IDs of related entities if a match is found.
|
|
584
|
+
*
|
|
585
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
586
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
587
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
588
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
589
|
+
* or the specified relation name is not indexed.
|
|
590
|
+
*/
|
|
591
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
592
|
+
/**
|
|
593
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
594
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
595
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
596
|
+
* The resulting object is then serialized into a JSON string.
|
|
597
|
+
*
|
|
598
|
+
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
599
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
600
|
+
*/
|
|
601
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
602
|
+
/**
|
|
603
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
604
|
+
* This method iterates through the relations indexed for the given model,
|
|
605
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
606
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
607
|
+
* The resulting object is then serialized into a JSON string.
|
|
608
|
+
*
|
|
609
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
610
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
611
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
612
|
+
*/
|
|
613
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
614
|
+
/**
|
|
615
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
616
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
617
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
618
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
619
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
620
|
+
*
|
|
621
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
622
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
623
|
+
*/
|
|
624
|
+
serializeAllRelations(): string;
|
|
625
|
+
/**
|
|
626
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
627
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
628
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
629
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
630
|
+
* of express IDs of entities related through that relation type.
|
|
631
|
+
*
|
|
632
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
633
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
634
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
635
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
636
|
+
*/
|
|
637
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
638
|
+
/**
|
|
639
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
640
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
641
|
+
* references that could prevent garbage collection.
|
|
642
|
+
*/
|
|
643
|
+
dispose(): void;
|
|
644
|
+
}
|
|
645
|
+
import * as THREE from "three";
|
|
646
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
647
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
648
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
649
|
+
/**
|
|
650
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
651
|
+
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
652
|
+
*/
|
|
653
|
+
export declare class BoundingBoxes extends Component implements Disposable {
|
|
654
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
655
|
+
/** {@link Component.enabled} */
|
|
656
|
+
enabled: boolean;
|
|
657
|
+
/** {@link Disposable.onDisposed} */
|
|
658
|
+
readonly onDisposed: Event<unknown>;
|
|
659
|
+
private _absoluteMin;
|
|
660
|
+
private _absoluteMax;
|
|
661
|
+
private _meshes;
|
|
662
|
+
constructor(components: Components);
|
|
663
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
664
|
+
width: number;
|
|
665
|
+
height: number;
|
|
666
|
+
depth: number;
|
|
667
|
+
center: THREE.Vector3;
|
|
668
|
+
};
|
|
669
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
670
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
671
|
+
/** {@link Disposable.dispose} */
|
|
672
|
+
dispose(): void;
|
|
673
|
+
get(): THREE.Box3;
|
|
674
|
+
getSphere(): THREE.Sphere;
|
|
675
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
676
|
+
reset(): void;
|
|
677
|
+
add(group: FragmentsGroup): void;
|
|
678
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
679
|
+
private static getFragmentBounds;
|
|
680
|
+
}
|
|
681
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
682
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
683
|
+
import { Components, Component } from "../../core";
|
|
684
|
+
export declare class FragmentHider extends Component {
|
|
685
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
686
|
+
enabled: boolean;
|
|
687
|
+
constructor(components: Components);
|
|
688
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
689
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
690
|
+
private updateCulledVisibility;
|
|
691
|
+
}
|
|
692
|
+
import * as THREE from "three";
|
|
693
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
694
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
695
|
+
export interface Classification {
|
|
696
|
+
[system: string]: {
|
|
697
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
export declare class FragmentClassifier extends Component implements Disposable {
|
|
701
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
702
|
+
/** {@link Component.enabled} */
|
|
703
|
+
enabled: boolean;
|
|
704
|
+
list: Classification;
|
|
705
|
+
/** {@link Disposable.onDisposed} */
|
|
706
|
+
readonly onDisposed: Event<unknown>;
|
|
707
|
+
constructor(components: Components);
|
|
708
|
+
private onFragmentsDisposed;
|
|
709
|
+
dispose(): void;
|
|
710
|
+
remove(guid: string): void;
|
|
711
|
+
find(filter?: {
|
|
712
|
+
[name: string]: string[];
|
|
713
|
+
}): FRAGS.FragmentIdMap;
|
|
714
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
715
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
716
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
717
|
+
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
718
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
719
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
720
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
721
|
+
private saveItem;
|
|
722
|
+
}
|
|
723
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
724
|
+
export declare class FragmentExploder extends Component implements Disposable {
|
|
725
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
726
|
+
enabled: boolean;
|
|
727
|
+
height: number;
|
|
728
|
+
groupName: string;
|
|
729
|
+
/** {@link Disposable.onDisposed} */
|
|
730
|
+
readonly onDisposed: Event<string>;
|
|
731
|
+
list: Set<string>;
|
|
732
|
+
constructor(components: Components);
|
|
733
|
+
dispose(): void;
|
|
734
|
+
explode(): void;
|
|
735
|
+
reset(): void;
|
|
736
|
+
update(): void;
|
|
737
|
+
}
|
|
738
|
+
import * as WEBIFC from "web-ifc";
|
|
739
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
740
|
+
import { IfcFragmentSettings } from "./src";
|
|
741
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
742
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
743
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
744
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
745
|
+
readonly onSetup: Event<void>;
|
|
746
|
+
/** {@link Disposable.onDisposed} */
|
|
747
|
+
readonly onDisposed: Event<string>;
|
|
748
|
+
settings: IfcFragmentSettings;
|
|
749
|
+
enabled: boolean;
|
|
750
|
+
webIfc: WEBIFC.IfcAPI;
|
|
751
|
+
private _material;
|
|
752
|
+
private _spatialTree;
|
|
753
|
+
private _metaData;
|
|
754
|
+
private _fragmentInstances;
|
|
755
|
+
private _civil;
|
|
756
|
+
private _propertyExporter;
|
|
757
|
+
private _visitedFragments;
|
|
758
|
+
private _materialT;
|
|
759
|
+
constructor(components: Components);
|
|
760
|
+
dispose(): void;
|
|
761
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
762
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
763
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
764
|
+
private getAllGeometries;
|
|
765
|
+
cleanUp(): void;
|
|
766
|
+
private getMesh;
|
|
767
|
+
private getGeometry;
|
|
768
|
+
private autoSetWasm;
|
|
769
|
+
}
|
|
770
|
+
import * as WEBIFC from "web-ifc";
|
|
771
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
772
|
+
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
773
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
774
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
775
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
776
|
+
type: number;
|
|
777
|
+
data: {
|
|
778
|
+
[id: number]: any;
|
|
779
|
+
};
|
|
780
|
+
}>;
|
|
781
|
+
onProgress: AsyncEvent<number>;
|
|
782
|
+
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
783
|
+
/** {@link Disposable.onDisposed} */
|
|
784
|
+
readonly onDisposed: Event<string>;
|
|
785
|
+
enabled: boolean;
|
|
786
|
+
settings: PropertiesStreamingSettings;
|
|
787
|
+
webIfc: WEBIFC.IfcAPI;
|
|
788
|
+
dispose(): Promise<void>;
|
|
789
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
790
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
791
|
+
private readIfcFile;
|
|
792
|
+
private streamIfcFile;
|
|
793
|
+
private streamAllProperties;
|
|
794
|
+
private cleanUp;
|
|
795
|
+
}
|
|
796
|
+
import * as WEBIFC from "web-ifc";
|
|
797
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
798
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
799
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
800
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
801
|
+
onGeometryStreamed: Event<{
|
|
802
|
+
buffer: Uint8Array;
|
|
803
|
+
data: StreamedGeometries;
|
|
804
|
+
}>;
|
|
805
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
806
|
+
onProgress: Event<number>;
|
|
807
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
808
|
+
/** {@link Disposable.onDisposed} */
|
|
809
|
+
readonly onDisposed: Event<unknown>;
|
|
810
|
+
settings: IfcStreamingSettings;
|
|
811
|
+
enabled: boolean;
|
|
812
|
+
webIfc: WEBIFC.IfcAPI;
|
|
813
|
+
private _spatialTree;
|
|
814
|
+
private _metaData;
|
|
815
|
+
private _visitedGeometries;
|
|
816
|
+
private _streamSerializer;
|
|
817
|
+
private _geometries;
|
|
818
|
+
private _geometryCount;
|
|
819
|
+
private _civil;
|
|
820
|
+
private _groupSerializer;
|
|
821
|
+
private _assets;
|
|
822
|
+
private _meshesWithHoles;
|
|
823
|
+
constructor(components: Components);
|
|
824
|
+
dispose(): void;
|
|
825
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
826
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
827
|
+
private readIfcFile;
|
|
828
|
+
private streamIfcFile;
|
|
829
|
+
private streamAllGeometries;
|
|
830
|
+
private cleanUp;
|
|
831
|
+
private getMesh;
|
|
832
|
+
private getGeometry;
|
|
833
|
+
private streamAssets;
|
|
834
|
+
private streamGeometries;
|
|
835
|
+
}
|
|
836
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
837
|
+
import * as THREE from "three";
|
|
838
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
839
|
+
/**
|
|
840
|
+
* Object that can efficiently load binary files that contain
|
|
841
|
+
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
842
|
+
*/
|
|
843
|
+
export declare class FragmentManager extends Component implements Disposable {
|
|
844
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
845
|
+
/** {@link Disposable.onDisposed} */
|
|
846
|
+
readonly onDisposed: Event<unknown>;
|
|
847
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
848
|
+
readonly onFragmentsDisposed: Event<{
|
|
849
|
+
groupID: string;
|
|
850
|
+
fragmentIDs: string[];
|
|
851
|
+
}>;
|
|
852
|
+
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
853
|
+
readonly list: Map<string, Fragment>;
|
|
854
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
855
|
+
/** {@link Component.enabled} */
|
|
856
|
+
enabled: boolean;
|
|
857
|
+
baseCoordinationModel: string;
|
|
858
|
+
private _loader;
|
|
859
|
+
/** The list of meshes of the created fragments. */
|
|
860
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
861
|
+
constructor(components: Components);
|
|
862
|
+
/** {@link Disposable.dispose} */
|
|
863
|
+
dispose(): void;
|
|
864
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
865
|
+
/**
|
|
866
|
+
* Loads one or many fragments into the scene.
|
|
867
|
+
* @param data - the bytes containing the data for the fragments to load.
|
|
868
|
+
* @param coordinate - whether this fragmentsgroup should be federated with the others.
|
|
869
|
+
* @returns the list of IDs of the loaded fragments.
|
|
870
|
+
*/
|
|
871
|
+
load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
|
|
872
|
+
/**
|
|
873
|
+
* Export the specified fragments.
|
|
874
|
+
* @param group - the fragments group to be exported.
|
|
875
|
+
* @returns the exported data as binary buffer.
|
|
876
|
+
*/
|
|
877
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
878
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
879
|
+
}
|
|
880
|
+
import * as THREE from "three";
|
|
881
|
+
export declare class MaterialsUtils {
|
|
882
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
883
|
+
}
|
|
884
|
+
export declare class UUID {
|
|
885
|
+
private static _pattern;
|
|
886
|
+
private static _lut;
|
|
887
|
+
static create(): string;
|
|
888
|
+
static validate(uuid: string): void;
|
|
889
|
+
}
|
|
890
|
+
import * as THREE from "three";
|
|
891
|
+
import { Component, Components, Event, World, Disposable } from "../core";
|
|
892
|
+
export interface VertexPickerConfig {
|
|
893
|
+
showOnlyVertex: boolean;
|
|
894
|
+
snapDistance: number;
|
|
895
|
+
previewElement: HTMLElement;
|
|
896
|
+
}
|
|
897
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
898
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
899
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
900
|
+
components: Components;
|
|
901
|
+
private _pickedPoint;
|
|
902
|
+
private _config;
|
|
903
|
+
private _enabled;
|
|
904
|
+
private _workingPlane;
|
|
905
|
+
/** {@link Disposable.onDisposed} */
|
|
906
|
+
readonly onDisposed: Event<unknown>;
|
|
907
|
+
set enabled(value: boolean);
|
|
908
|
+
get enabled(): boolean;
|
|
909
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
910
|
+
[Symbol.dispose](): void;
|
|
911
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
912
|
+
get workingPlane(): THREE.Plane | null;
|
|
913
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
914
|
+
get config(): Partial<VertexPickerConfig>;
|
|
915
|
+
dispose(): void;
|
|
916
|
+
get(world: World): THREE.Vector3 | null;
|
|
917
|
+
private getClosestVertex;
|
|
918
|
+
private getVertices;
|
|
919
|
+
private getVertex;
|
|
920
|
+
}
|
|
921
|
+
export declare const IfcElements: {
|
|
922
|
+
[key: number]: string;
|
|
923
|
+
};
|
|
644
924
|
import * as WEBIFC from "web-ifc";
|
|
645
925
|
export interface IfcItemsCategories {
|
|
646
926
|
[itemID: number]: number;
|
|
@@ -648,12 +928,93 @@ export interface IfcItemsCategories {
|
|
|
648
928
|
export declare class IfcCategories {
|
|
649
929
|
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
650
930
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
931
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
932
|
+
export declare class IfcPropertiesUtils {
|
|
933
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
934
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
935
|
+
[attribute: string]: any;
|
|
936
|
+
} | null>;
|
|
937
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
938
|
+
[relatingID: number]: number[];
|
|
939
|
+
}>;
|
|
940
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
941
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
942
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
943
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
944
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
945
|
+
key: string | null;
|
|
946
|
+
name: string | null;
|
|
947
|
+
}>;
|
|
948
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
949
|
+
key: string | null;
|
|
950
|
+
value: number | null;
|
|
951
|
+
}>;
|
|
952
|
+
static isRel(expressID: number): boolean;
|
|
953
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
954
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
955
|
+
}
|
|
654
956
|
export declare const IfcCategoryMap: {
|
|
655
957
|
[key: number]: string;
|
|
656
958
|
};
|
|
959
|
+
import * as THREE from "three";
|
|
960
|
+
export interface MeasureEdge {
|
|
961
|
+
distance: number;
|
|
962
|
+
points: THREE.Vector3[];
|
|
963
|
+
}
|
|
964
|
+
export declare class MeasurementUtils {
|
|
965
|
+
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
966
|
+
edges: MeasureEdge[];
|
|
967
|
+
indices: Set<number>;
|
|
968
|
+
} | null;
|
|
969
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
970
|
+
private static getFaceData;
|
|
971
|
+
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
972
|
+
p1: THREE.Vector3;
|
|
973
|
+
p2: THREE.Vector3;
|
|
974
|
+
p3: THREE.Vector3;
|
|
975
|
+
faceNormal: THREE.Vector3;
|
|
976
|
+
};
|
|
977
|
+
private static round;
|
|
978
|
+
}
|
|
979
|
+
export declare const GeometryTypes: Set<number>;
|
|
980
|
+
import * as THREE from "three";
|
|
981
|
+
import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
|
|
982
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
983
|
+
/** {@link Disposable.onDisposed} */
|
|
984
|
+
readonly onDisposed: Event<unknown>;
|
|
985
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
986
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
987
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
988
|
+
frontOffset: number;
|
|
989
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
990
|
+
backgroundColor: THREE.Color;
|
|
991
|
+
renderer: THREE.WebGLRenderer;
|
|
992
|
+
enabled: boolean;
|
|
993
|
+
world: World;
|
|
994
|
+
private _lockRotation;
|
|
995
|
+
private _camera;
|
|
996
|
+
private _plane;
|
|
997
|
+
private _size;
|
|
998
|
+
private _tempVector1;
|
|
999
|
+
private _tempVector2;
|
|
1000
|
+
private _tempTarget;
|
|
1001
|
+
private readonly down;
|
|
1002
|
+
get lockRotation(): boolean;
|
|
1003
|
+
set lockRotation(active: boolean);
|
|
1004
|
+
get zoom(): number;
|
|
1005
|
+
set zoom(value: number);
|
|
1006
|
+
constructor(world: World);
|
|
1007
|
+
dispose(): void;
|
|
1008
|
+
get(): THREE.OrthographicCamera;
|
|
1009
|
+
update(): void;
|
|
1010
|
+
getSize(): THREE.Vector2;
|
|
1011
|
+
resize(size?: THREE.Vector2): void;
|
|
1012
|
+
private updatePlanes;
|
|
1013
|
+
}
|
|
1014
|
+
export declare const relToAttributesMap: Map<number, {
|
|
1015
|
+
forRelating?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
|
|
1016
|
+
forRelated?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
|
|
1017
|
+
}>;
|
|
657
1018
|
import * as WEBIFC from "web-ifc";
|
|
658
1019
|
import { IfcItemsCategories } from "../../../ifc";
|
|
659
1020
|
export declare class SpatialStructure {
|
|
@@ -662,30 +1023,186 @@ export declare class SpatialStructure {
|
|
|
662
1023
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
663
1024
|
cleanUp(): void;
|
|
664
1025
|
}
|
|
665
|
-
import * as
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
1026
|
+
import * as THREE from "three";
|
|
1027
|
+
import { Disposable, Event } from "../../Types";
|
|
1028
|
+
/**
|
|
1029
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1030
|
+
* to work with tools like the
|
|
1031
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1032
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1033
|
+
*/
|
|
1034
|
+
export declare class Mouse implements Disposable {
|
|
1035
|
+
dom: HTMLCanvasElement;
|
|
1036
|
+
private _event?;
|
|
1037
|
+
private _position;
|
|
1038
|
+
/** {@link Disposable.onDisposed} */
|
|
1039
|
+
readonly onDisposed: Event<unknown>;
|
|
1040
|
+
constructor(dom: HTMLCanvasElement);
|
|
1041
|
+
/**
|
|
1042
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1043
|
+
*/
|
|
1044
|
+
get position(): THREE.Vector2;
|
|
1045
|
+
/** {@link Disposable.dispose} */
|
|
1046
|
+
dispose(): void;
|
|
1047
|
+
private getPositionY;
|
|
1048
|
+
private getPositionX;
|
|
1049
|
+
private updateMouseInfo;
|
|
1050
|
+
private setupEvents;
|
|
1051
|
+
}
|
|
1052
|
+
export declare const getRelationMap: (properties: Record<string, Record<string, any>>, relationType: number, onElementsFound?: ((relatingID: number, relatedIDs: number[]) => void) | undefined) => {
|
|
1053
|
+
[relatingID: number]: number[];
|
|
1054
|
+
};
|
|
1055
|
+
import * as THREE from "three";
|
|
1056
|
+
import { Components } from "../../Components";
|
|
1057
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1058
|
+
import { Mouse } from "./mouse";
|
|
1059
|
+
/**
|
|
1060
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1061
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1062
|
+
* events.
|
|
1063
|
+
*/
|
|
1064
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1065
|
+
/** {@link Component.enabled} */
|
|
1066
|
+
enabled: boolean;
|
|
1067
|
+
components: Components;
|
|
1068
|
+
/** {@link Disposable.onDisposed} */
|
|
1069
|
+
readonly onDisposed: Event<unknown>;
|
|
1070
|
+
/** The position of the mouse in the screen. */
|
|
1071
|
+
readonly mouse: Mouse;
|
|
1072
|
+
readonly three: THREE.Raycaster;
|
|
1073
|
+
world: World;
|
|
1074
|
+
constructor(components: Components, world: World);
|
|
1075
|
+
/** {@link Disposable.dispose} */
|
|
1076
|
+
dispose(): void;
|
|
1077
|
+
/**
|
|
1078
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1079
|
+
* the first item found. This also takes into account the clipping planes
|
|
1080
|
+
* used by the renderer.
|
|
1081
|
+
*
|
|
1082
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1083
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1084
|
+
* {@link Components.meshes}.
|
|
1085
|
+
*/
|
|
1086
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1087
|
+
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
1088
|
+
private intersect;
|
|
1089
|
+
private filterClippingPlanes;
|
|
1090
|
+
}
|
|
1091
|
+
import { NavigationMode } from "./types";
|
|
1092
|
+
/**
|
|
1093
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1094
|
+
* like many BIM tools.
|
|
1095
|
+
*/
|
|
1096
|
+
export declare class PlanMode implements NavigationMode {
|
|
1097
|
+
private camera;
|
|
1098
|
+
/** {@link NavigationMode.enabled} */
|
|
1099
|
+
enabled: boolean;
|
|
1100
|
+
/** {@link NavigationMode.id} */
|
|
1101
|
+
readonly id = "Plan";
|
|
1102
|
+
private mouseAction1?;
|
|
1103
|
+
private mouseAction2?;
|
|
1104
|
+
private mouseInitialized;
|
|
1105
|
+
private readonly defaultAzimuthSpeed;
|
|
1106
|
+
private readonly defaultPolarSpeed;
|
|
1107
|
+
constructor(camera: any);
|
|
1108
|
+
/** {@link NavigationMode.set} */
|
|
1109
|
+
set(active: boolean): void;
|
|
1110
|
+
}
|
|
1111
|
+
import { NavigationMode } from "./types";
|
|
1112
|
+
/**
|
|
1113
|
+
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1114
|
+
* like in many 3D and CAD softwares.
|
|
1115
|
+
*/
|
|
1116
|
+
export declare class OrbitMode implements NavigationMode {
|
|
1117
|
+
camera: any;
|
|
1118
|
+
/** {@link NavigationMode.enabled} */
|
|
1119
|
+
enabled: boolean;
|
|
1120
|
+
/** {@link NavigationMode.id} */
|
|
1121
|
+
readonly id = "Orbit";
|
|
1122
|
+
constructor(camera: any);
|
|
1123
|
+
/** {@link NavigationMode.set} */
|
|
1124
|
+
set(active: boolean): void;
|
|
1125
|
+
private activateOrbitControls;
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* The projection system of the camera.
|
|
1129
|
+
*/
|
|
1130
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
1131
|
+
/**
|
|
1132
|
+
* The extensible list of supported navigation modes.
|
|
1133
|
+
*/
|
|
1134
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1135
|
+
/**
|
|
1136
|
+
* An object that determines the behavior of the camera controls
|
|
1137
|
+
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1138
|
+
*/
|
|
1139
|
+
export interface NavigationMode {
|
|
1140
|
+
/** The unique ID of this navigation mode. */
|
|
1141
|
+
id: NavModeID;
|
|
1142
|
+
/**
|
|
1143
|
+
* Enable or disable this navigation mode.
|
|
1144
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
1145
|
+
* must be disabled.
|
|
1146
|
+
*
|
|
1147
|
+
* @param active - whether to enable or disable this mode.
|
|
1148
|
+
* @param options - any additional data required to enable or disable it.
|
|
1149
|
+
* */
|
|
1150
|
+
set: (active: boolean, options?: any) => void;
|
|
1151
|
+
/** Whether this navigation mode is active or not. */
|
|
1152
|
+
enabled: boolean;
|
|
1153
|
+
}
|
|
1154
|
+
import * as THREE from "three";
|
|
1155
|
+
import { CameraProjection } from "./types";
|
|
1156
|
+
import { Event } from "../../../core";
|
|
1157
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1158
|
+
/**
|
|
1159
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1160
|
+
*/
|
|
1161
|
+
export declare class ProjectionManager {
|
|
1162
|
+
/**
|
|
1163
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
1164
|
+
*/
|
|
1165
|
+
readonly onChanged: Event<THREE.Camera>;
|
|
1166
|
+
current: CameraProjection;
|
|
1167
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1168
|
+
private _component;
|
|
1169
|
+
private _previousDistance;
|
|
1170
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1171
|
+
matchOrthoDistanceEnabled: boolean;
|
|
1172
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1173
|
+
/**
|
|
1174
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1175
|
+
*
|
|
1176
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
1177
|
+
* it will have no effect.
|
|
1178
|
+
*/
|
|
1179
|
+
set(projection: CameraProjection): Promise<void>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
1182
|
+
* and vice versa.
|
|
1183
|
+
*/
|
|
1184
|
+
toggle(): Promise<void>;
|
|
1185
|
+
private setOrthoCamera;
|
|
1186
|
+
private getDims;
|
|
1187
|
+
private setupOrthoCamera;
|
|
1188
|
+
private getDistance;
|
|
1189
|
+
private setPerspectiveCamera;
|
|
1190
|
+
}
|
|
1191
|
+
import { NavigationMode } from "./types";
|
|
1192
|
+
/**
|
|
1193
|
+
* A {@link NavigationMode} that allows first person navigation,
|
|
1194
|
+
* simulating FPS video games.
|
|
1195
|
+
*/
|
|
1196
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1197
|
+
private camera;
|
|
1198
|
+
/** {@link NavigationMode.enabled} */
|
|
1199
|
+
enabled: boolean;
|
|
1200
|
+
/** {@link NavigationMode.id} */
|
|
1201
|
+
readonly id = "FirstPerson";
|
|
1202
|
+
constructor(camera: any);
|
|
1203
|
+
/** {@link NavigationMode.set} */
|
|
1204
|
+
set(active: boolean): void;
|
|
1205
|
+
private setupFirstPersonCamera;
|
|
689
1206
|
}
|
|
690
1207
|
/**
|
|
691
1208
|
* Simple event handler by
|
|
@@ -786,7 +1303,7 @@ export interface Updateable {
|
|
|
786
1303
|
* Function used to update the state of this component each frame. For
|
|
787
1304
|
* instance, a renderer component will make a render each frame.
|
|
788
1305
|
*/
|
|
789
|
-
update(delta?: number): void
|
|
1306
|
+
update(delta?: number): void;
|
|
790
1307
|
}
|
|
791
1308
|
/** Basic type to describe the progress of any kind of process. */
|
|
792
1309
|
export interface Progress {
|
|
@@ -801,31 +1318,20 @@ export interface Progress {
|
|
|
801
1318
|
* dimensions.
|
|
802
1319
|
*/
|
|
803
1320
|
export interface Createable {
|
|
804
|
-
readonly onBeforeCreate: Event<any>;
|
|
805
1321
|
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
806
1322
|
create: (data: any) => void;
|
|
807
|
-
/** Fired after successfully calling {@link Createable.create} */
|
|
808
|
-
readonly onAfterCreate: Event<any>;
|
|
809
1323
|
/**
|
|
810
1324
|
* Finish the creation process of the component, successfully creating an
|
|
811
1325
|
* instance of whatever the component creates.
|
|
812
1326
|
*/
|
|
813
|
-
endCreation
|
|
814
|
-
/** Fired before calling {@link Createable.cancelCreation}. */
|
|
815
|
-
readonly onBeforeCancel: Event<any>;
|
|
1327
|
+
endCreation?: (data: any) => void;
|
|
816
1328
|
/**
|
|
817
1329
|
* Cancels the creation process of the component, going back to the state
|
|
818
1330
|
* before starting to create.
|
|
819
1331
|
*/
|
|
820
|
-
cancelCreation
|
|
821
|
-
/** Fired after calling {@link Createable.cancelCreation}. */
|
|
822
|
-
readonly onAfterCancel: Event<any>;
|
|
823
|
-
/** Fired before calling {@link Createable.delete}. */
|
|
824
|
-
readonly onBeforeDelete: Event<any>;
|
|
1332
|
+
cancelCreation?: (data: any) => void;
|
|
825
1333
|
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
826
1334
|
delete: (data: any) => void;
|
|
827
|
-
/** Fired after successfully calling {@link Createable.delete()} */
|
|
828
|
-
readonly onAfterDelete: Event<any>;
|
|
829
1335
|
}
|
|
830
1336
|
/**
|
|
831
1337
|
* Whether this component supports to be configured.
|
|
@@ -855,24 +1361,39 @@ export interface BVHGeometry extends THREE.BufferGeometry {
|
|
|
855
1361
|
export interface CameraControllable {
|
|
856
1362
|
controls: CameraControls;
|
|
857
1363
|
}
|
|
858
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
859
|
-
import { Components } from "../../Components";
|
|
860
1364
|
/**
|
|
861
|
-
*
|
|
1365
|
+
* Simple event handler by
|
|
1366
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1367
|
+
* Keep in mind that:
|
|
1368
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
1369
|
+
* an object.
|
|
1370
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1371
|
+
* the callback as an arrow function.
|
|
862
1372
|
*/
|
|
863
|
-
export declare
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
1373
|
+
export declare class AsyncEvent<T> {
|
|
1374
|
+
/**
|
|
1375
|
+
* Add a callback to this event instance.
|
|
1376
|
+
* @param handler - the callback to be added to this event.
|
|
1377
|
+
*/
|
|
1378
|
+
add(handler: T extends void ? {
|
|
1379
|
+
(): Promise<void>;
|
|
1380
|
+
} : {
|
|
1381
|
+
(data: T): Promise<void>;
|
|
1382
|
+
}): void;
|
|
1383
|
+
/**
|
|
1384
|
+
* Removes a callback from this event instance.
|
|
1385
|
+
* @param handler - the callback to be removed from this event.
|
|
1386
|
+
*/
|
|
1387
|
+
remove(handler: T extends void ? {
|
|
1388
|
+
(): Promise<void>;
|
|
1389
|
+
} : {
|
|
1390
|
+
(data: T): Promise<void>;
|
|
1391
|
+
}): void;
|
|
1392
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1393
|
+
trigger: (data?: T) => Promise<void>;
|
|
1394
|
+
/** Gets rid of all the suscribed events. */
|
|
1395
|
+
reset(): void;
|
|
1396
|
+
private handlers;
|
|
876
1397
|
}
|
|
877
1398
|
import { Base } from "./base";
|
|
878
1399
|
/**
|
|
@@ -892,6 +1413,36 @@ export declare abstract class Component extends Base {
|
|
|
892
1413
|
*/
|
|
893
1414
|
abstract enabled: boolean;
|
|
894
1415
|
}
|
|
1416
|
+
import * as THREE from "three";
|
|
1417
|
+
import CameraControls from "camera-controls";
|
|
1418
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1419
|
+
import { CameraControllable } from "./interfaces";
|
|
1420
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1421
|
+
abstract enabled: boolean;
|
|
1422
|
+
abstract three: THREE.Camera;
|
|
1423
|
+
abstract controls?: CameraControls;
|
|
1424
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1425
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1426
|
+
}
|
|
1427
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1428
|
+
import { Components } from "../../Components";
|
|
1429
|
+
/**
|
|
1430
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1431
|
+
*/
|
|
1432
|
+
export declare abstract class Base {
|
|
1433
|
+
components: Components;
|
|
1434
|
+
constructor(components: Components);
|
|
1435
|
+
/** Whether is component is {@link Disposable}. */
|
|
1436
|
+
isDisposeable: () => this is Disposable;
|
|
1437
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1438
|
+
isResizeable: () => this is Resizeable;
|
|
1439
|
+
/** Whether is component is {@link Updateable}. */
|
|
1440
|
+
isUpdateable: () => this is Updateable;
|
|
1441
|
+
/** Whether is component is {@link Hideable}. */
|
|
1442
|
+
isHideable: () => this is Hideable;
|
|
1443
|
+
/** Whether is component is {@link Configurable}. */
|
|
1444
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1445
|
+
}
|
|
895
1446
|
import { Base } from "./base";
|
|
896
1447
|
import { World } from "./world";
|
|
897
1448
|
import { Event } from "./event";
|
|
@@ -910,17 +1461,6 @@ export declare abstract class BaseWorldItem extends Base {
|
|
|
910
1461
|
protected constructor(components: Components);
|
|
911
1462
|
}
|
|
912
1463
|
import * as THREE from "three";
|
|
913
|
-
import CameraControls from "camera-controls";
|
|
914
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
915
|
-
import { CameraControllable } from "./interfaces";
|
|
916
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
917
|
-
abstract enabled: boolean;
|
|
918
|
-
abstract three: THREE.Camera;
|
|
919
|
-
abstract controls?: CameraControls;
|
|
920
|
-
/** Whether is instance is {@link CameraControllable}. */
|
|
921
|
-
hasCameraControls: () => this is CameraControllable;
|
|
922
|
-
}
|
|
923
|
-
import * as THREE from "three";
|
|
924
1464
|
import { Vector2 } from "three";
|
|
925
1465
|
import { Event } from "./event";
|
|
926
1466
|
import { BaseWorldItem } from "./base-world-item";
|
|
@@ -1011,6 +1551,54 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
1011
1551
|
update(delta?: number): void;
|
|
1012
1552
|
dispose(disposeResources?: boolean): void;
|
|
1013
1553
|
}
|
|
1554
|
+
/// <reference types="node" />
|
|
1555
|
+
import * as THREE from "three";
|
|
1556
|
+
import { Hideable, Event, World } from "../../Types";
|
|
1557
|
+
import { Components } from "../../Components";
|
|
1558
|
+
export interface GridConfig {
|
|
1559
|
+
color: THREE.Color;
|
|
1560
|
+
size1: number;
|
|
1561
|
+
size2: number;
|
|
1562
|
+
distance: number;
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* An infinite grid. Created by
|
|
1566
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1567
|
+
* and translated to typescript by
|
|
1568
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1569
|
+
*/
|
|
1570
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1571
|
+
/** {@link Disposable.onDisposed} */
|
|
1572
|
+
readonly onDisposed: Event<unknown>;
|
|
1573
|
+
world: World;
|
|
1574
|
+
components: Components;
|
|
1575
|
+
/** {@link Hideable.visible} */
|
|
1576
|
+
get visible(): boolean;
|
|
1577
|
+
/** {@link Hideable.visible} */
|
|
1578
|
+
set visible(visible: boolean);
|
|
1579
|
+
/** The material of the grid. */
|
|
1580
|
+
get material(): THREE.ShaderMaterial;
|
|
1581
|
+
/**
|
|
1582
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1583
|
+
* perspective cameras and false for orthographic cameras.
|
|
1584
|
+
*/
|
|
1585
|
+
get fade(): boolean;
|
|
1586
|
+
/**
|
|
1587
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1588
|
+
* perspective cameras and false for orthographic cameras.
|
|
1589
|
+
*/
|
|
1590
|
+
set fade(active: boolean);
|
|
1591
|
+
private readonly _grid;
|
|
1592
|
+
private _fade;
|
|
1593
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
1594
|
+
[Symbol.dispose](): void;
|
|
1595
|
+
/** {@link Component.get} */
|
|
1596
|
+
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1597
|
+
/** {@link Disposable.dispose} */
|
|
1598
|
+
dispose(): void;
|
|
1599
|
+
private setupEvents;
|
|
1600
|
+
private updateZoom;
|
|
1601
|
+
}
|
|
1014
1602
|
import * as THREE from "three";
|
|
1015
1603
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1016
1604
|
import { Components } from "../../Components";
|
|
@@ -1042,38 +1630,6 @@ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
|
1042
1630
|
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1043
1631
|
}
|
|
1044
1632
|
import * as THREE from "three";
|
|
1045
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
1046
|
-
import { Components } from "../../Components";
|
|
1047
|
-
/**
|
|
1048
|
-
* A basic renderer capable of rendering
|
|
1049
|
-
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1050
|
-
*/
|
|
1051
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
1052
|
-
/** {@link Component.enabled} */
|
|
1053
|
-
enabled: boolean;
|
|
1054
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1055
|
-
container: HTMLElement | null;
|
|
1056
|
-
three: THREE.WebGLRenderer;
|
|
1057
|
-
protected _canvas: HTMLCanvasElement;
|
|
1058
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1059
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
1060
|
-
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1061
|
-
/** {@link Updateable.update} */
|
|
1062
|
-
update(): void;
|
|
1063
|
-
/** {@link Disposable.dispose} */
|
|
1064
|
-
dispose(): void;
|
|
1065
|
-
/** {@link Resizeable.getSize}. */
|
|
1066
|
-
getSize(): THREE.Vector2;
|
|
1067
|
-
/** {@link Resizeable.resize} */
|
|
1068
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1069
|
-
setupEvents(active: boolean): void;
|
|
1070
|
-
private resizeEvent;
|
|
1071
|
-
private setupRenderer;
|
|
1072
|
-
private onContextLost;
|
|
1073
|
-
private onContextBack;
|
|
1074
|
-
private updateContainer;
|
|
1075
|
-
}
|
|
1076
|
-
import * as THREE from "three";
|
|
1077
1633
|
import CameraControls from "camera-controls";
|
|
1078
1634
|
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1079
1635
|
import { Components } from "../../Components";
|
|
@@ -1095,95 +1651,64 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
1095
1651
|
private _allControls;
|
|
1096
1652
|
/**
|
|
1097
1653
|
* The object that controls the camera. An instance of
|
|
1098
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1099
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
1100
|
-
* object to move, rotate, look at objects, etc.
|
|
1101
|
-
*/
|
|
1102
|
-
get controls(): CameraControls;
|
|
1103
|
-
/** {@link Component.enabled} */
|
|
1104
|
-
get enabled(): boolean;
|
|
1105
|
-
/** {@link Component.enabled} */
|
|
1106
|
-
set enabled(enabled: boolean);
|
|
1107
|
-
constructor(components: Components);
|
|
1108
|
-
/** {@link Disposable.dispose} */
|
|
1109
|
-
dispose(): void;
|
|
1110
|
-
/** {@link Updateable.update} */
|
|
1111
|
-
update(_delta: number): void;
|
|
1112
|
-
/**
|
|
1113
|
-
* Updates the aspect of the camera to match the size of the
|
|
1114
|
-
* {@link Components.renderer}.
|
|
1115
|
-
*/
|
|
1116
|
-
updateAspect: () => void;
|
|
1117
|
-
private setupCamera;
|
|
1118
|
-
private newCameraControls;
|
|
1119
|
-
private setupEvents;
|
|
1120
|
-
private static getSubsetOfThree;
|
|
1121
|
-
}
|
|
1122
|
-
import * as THREE from "three";
|
|
1123
|
-
import { Disposable, Event } from "../../Types";
|
|
1124
|
-
/**
|
|
1125
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1126
|
-
* to work with tools like the
|
|
1127
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1128
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1129
|
-
*/
|
|
1130
|
-
export declare class Mouse implements Disposable {
|
|
1131
|
-
dom: HTMLCanvasElement;
|
|
1132
|
-
private _event?;
|
|
1133
|
-
private _position;
|
|
1134
|
-
/** {@link Disposable.onDisposed} */
|
|
1135
|
-
readonly onDisposed: Event<unknown>;
|
|
1136
|
-
constructor(dom: HTMLCanvasElement);
|
|
1137
|
-
/**
|
|
1138
|
-
* The real position of the mouse of the Three.js canvas.
|
|
1654
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1655
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1656
|
+
* object to move, rotate, look at objects, etc.
|
|
1139
1657
|
*/
|
|
1140
|
-
get
|
|
1658
|
+
get controls(): CameraControls;
|
|
1659
|
+
/** {@link Component.enabled} */
|
|
1660
|
+
get enabled(): boolean;
|
|
1661
|
+
/** {@link Component.enabled} */
|
|
1662
|
+
set enabled(enabled: boolean);
|
|
1663
|
+
constructor(components: Components);
|
|
1141
1664
|
/** {@link Disposable.dispose} */
|
|
1142
1665
|
dispose(): void;
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1666
|
+
/** {@link Updateable.update} */
|
|
1667
|
+
update(_delta: number): void;
|
|
1668
|
+
/**
|
|
1669
|
+
* Updates the aspect of the camera to match the size of the
|
|
1670
|
+
* {@link Components.renderer}.
|
|
1671
|
+
*/
|
|
1672
|
+
updateAspect: () => void;
|
|
1673
|
+
private setupCamera;
|
|
1674
|
+
private newCameraControls;
|
|
1146
1675
|
private setupEvents;
|
|
1676
|
+
private static getSubsetOfThree;
|
|
1147
1677
|
}
|
|
1148
1678
|
import * as THREE from "three";
|
|
1679
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1149
1680
|
import { Components } from "../../Components";
|
|
1150
|
-
import { Event, World, Disposable } from "../../Types";
|
|
1151
|
-
import { Mouse } from "./mouse";
|
|
1152
1681
|
/**
|
|
1153
|
-
* A
|
|
1154
|
-
*
|
|
1155
|
-
* events.
|
|
1682
|
+
* A basic renderer capable of rendering
|
|
1683
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1156
1684
|
*/
|
|
1157
|
-
export declare class
|
|
1158
|
-
/** {@link Component.enabled} */
|
|
1685
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1159
1686
|
enabled: boolean;
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
constructor(components: Components,
|
|
1687
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1688
|
+
container: HTMLElement;
|
|
1689
|
+
three: THREE.WebGLRenderer;
|
|
1690
|
+
protected _canvas: HTMLCanvasElement;
|
|
1691
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1692
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
1693
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
1694
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1695
|
+
/** {@link Updateable.update} */
|
|
1696
|
+
update(): void;
|
|
1168
1697
|
/** {@link Disposable.dispose} */
|
|
1169
1698
|
dispose(): void;
|
|
1170
|
-
/**
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1180
|
-
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
1181
|
-
private intersect;
|
|
1182
|
-
private filterClippingPlanes;
|
|
1699
|
+
/** {@link Resizeable.getSize}. */
|
|
1700
|
+
getSize(): THREE.Vector2;
|
|
1701
|
+
/** {@link Resizeable.resize} */
|
|
1702
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1703
|
+
setupEvents(active: boolean): void;
|
|
1704
|
+
private resizeEvent;
|
|
1705
|
+
private setupRenderer;
|
|
1706
|
+
private onContextLost;
|
|
1707
|
+
private onContextBack;
|
|
1183
1708
|
}
|
|
1184
1709
|
import * as THREE from "three";
|
|
1185
1710
|
import { Components } from "../../Components";
|
|
1186
|
-
import { Event, World } from "../../Types";
|
|
1711
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
1187
1712
|
export interface CullerRendererSettings {
|
|
1188
1713
|
updateInterval?: number;
|
|
1189
1714
|
width?: number;
|
|
@@ -1201,7 +1726,7 @@ export declare class CullerRenderer {
|
|
|
1201
1726
|
* meshes that are currently visible, and the ones that were visible
|
|
1202
1727
|
* just before but not anymore.
|
|
1203
1728
|
*/
|
|
1204
|
-
readonly onViewUpdated: Event<any>;
|
|
1729
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1205
1730
|
/** {@link Component.enabled} */
|
|
1206
1731
|
enabled: boolean;
|
|
1207
1732
|
/**
|
|
@@ -1227,6 +1752,7 @@ export declare class CullerRenderer {
|
|
|
1227
1752
|
private readonly renderTarget;
|
|
1228
1753
|
private readonly bufferSize;
|
|
1229
1754
|
private readonly _buffer;
|
|
1755
|
+
protected _isWorkerBusy: boolean;
|
|
1230
1756
|
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1231
1757
|
/** {@link Disposable.dispose} */
|
|
1232
1758
|
dispose(): void;
|
|
@@ -1247,6 +1773,7 @@ export declare class CullerRenderer {
|
|
|
1247
1773
|
protected decreaseColor(): void;
|
|
1248
1774
|
private applySettings;
|
|
1249
1775
|
}
|
|
1776
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1250
1777
|
import * as THREE from "three";
|
|
1251
1778
|
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1252
1779
|
import { Components } from "../../Components";
|
|
@@ -1266,6 +1793,7 @@ export declare class MeshCullerRenderer extends CullerRenderer {
|
|
|
1266
1793
|
private _meshIDColorCodeMap;
|
|
1267
1794
|
private _currentVisibleMeshes;
|
|
1268
1795
|
private _recentlyHiddenMeshes;
|
|
1796
|
+
private _intervalID;
|
|
1269
1797
|
private readonly _transparentMat;
|
|
1270
1798
|
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1271
1799
|
dispose(): void;
|
|
@@ -1274,55 +1802,6 @@ export declare class MeshCullerRenderer extends CullerRenderer {
|
|
|
1274
1802
|
private handleWorkerMessage;
|
|
1275
1803
|
private getAvailableMaterial;
|
|
1276
1804
|
}
|
|
1277
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1278
|
-
/// <reference types="node" />
|
|
1279
|
-
import * as THREE from "three";
|
|
1280
|
-
import { Hideable, Event, World } from "../../Types";
|
|
1281
|
-
import { Components } from "../../Components";
|
|
1282
|
-
export interface GridConfig {
|
|
1283
|
-
color: THREE.Color;
|
|
1284
|
-
size1: number;
|
|
1285
|
-
size2: number;
|
|
1286
|
-
distance: number;
|
|
1287
|
-
}
|
|
1288
|
-
/**
|
|
1289
|
-
* An infinite grid. Created by
|
|
1290
|
-
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1291
|
-
* and translated to typescript by
|
|
1292
|
-
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1293
|
-
*/
|
|
1294
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1295
|
-
/** {@link Disposable.onDisposed} */
|
|
1296
|
-
readonly onDisposed: Event<unknown>;
|
|
1297
|
-
world: World;
|
|
1298
|
-
components: Components;
|
|
1299
|
-
/** {@link Hideable.visible} */
|
|
1300
|
-
get visible(): boolean;
|
|
1301
|
-
/** {@link Hideable.visible} */
|
|
1302
|
-
set visible(visible: boolean);
|
|
1303
|
-
/** The material of the grid. */
|
|
1304
|
-
get material(): THREE.ShaderMaterial;
|
|
1305
|
-
/**
|
|
1306
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1307
|
-
* perspective cameras and false for orthographic cameras.
|
|
1308
|
-
*/
|
|
1309
|
-
get fade(): boolean;
|
|
1310
|
-
/**
|
|
1311
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1312
|
-
* perspective cameras and false for orthographic cameras.
|
|
1313
|
-
*/
|
|
1314
|
-
set fade(active: boolean);
|
|
1315
|
-
private readonly _grid;
|
|
1316
|
-
private _fade;
|
|
1317
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
1318
|
-
[Symbol.dispose](): void;
|
|
1319
|
-
/** {@link Component.get} */
|
|
1320
|
-
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1321
|
-
/** {@link Disposable.dispose} */
|
|
1322
|
-
dispose(): void;
|
|
1323
|
-
private setupEvents;
|
|
1324
|
-
private updateZoom;
|
|
1325
|
-
}
|
|
1326
1805
|
import * as THREE from "three";
|
|
1327
1806
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1328
1807
|
import { Components } from "../../Components";
|
|
@@ -1394,19 +1873,34 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
|
1394
1873
|
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1395
1874
|
propertiesSize: number;
|
|
1396
1875
|
}
|
|
1876
|
+
import * as THREE from "three";
|
|
1877
|
+
import * as WEBIFC from "web-ifc";
|
|
1878
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1879
|
+
export declare class CivilReader {
|
|
1880
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1881
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1882
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1883
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1884
|
+
} | undefined;
|
|
1885
|
+
get(civilItems: any): {
|
|
1886
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1887
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1888
|
+
} | undefined;
|
|
1889
|
+
private getCurves;
|
|
1890
|
+
}
|
|
1397
1891
|
import * as WEBIFC from "web-ifc";
|
|
1398
|
-
import { Component, Disposable, Event } from "../../../core";
|
|
1892
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1399
1893
|
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1400
1894
|
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1401
1895
|
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1402
|
-
onPropertiesStreamed:
|
|
1896
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1403
1897
|
type: number;
|
|
1404
1898
|
data: {
|
|
1405
1899
|
[id: number]: any;
|
|
1406
1900
|
};
|
|
1407
1901
|
}>;
|
|
1408
|
-
onProgress:
|
|
1409
|
-
onIndicesStreamed:
|
|
1902
|
+
onProgress: AsyncEvent<number>;
|
|
1903
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1410
1904
|
/** {@link Disposable.onDisposed} */
|
|
1411
1905
|
readonly onDisposed: Event<string>;
|
|
1412
1906
|
enabled: boolean;
|
|
@@ -1422,87 +1916,6 @@ export declare class FragmentPropsStreamConverter extends Component implements D
|
|
|
1422
1916
|
private cleanUp;
|
|
1423
1917
|
}
|
|
1424
1918
|
import * as WEBIFC from "web-ifc";
|
|
1425
|
-
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1426
|
-
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1427
|
-
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1428
|
-
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1429
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1430
|
-
onGeometryStreamed: Event<{
|
|
1431
|
-
buffer: Uint8Array;
|
|
1432
|
-
data: StreamedGeometries;
|
|
1433
|
-
}>;
|
|
1434
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1435
|
-
onProgress: Event<number>;
|
|
1436
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
1437
|
-
/** {@link Disposable.onDisposed} */
|
|
1438
|
-
readonly onDisposed: Event<unknown>;
|
|
1439
|
-
settings: IfcStreamingSettings;
|
|
1440
|
-
enabled: boolean;
|
|
1441
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1442
|
-
private _spatialTree;
|
|
1443
|
-
private _metaData;
|
|
1444
|
-
private _visitedGeometries;
|
|
1445
|
-
private _streamSerializer;
|
|
1446
|
-
private _geometries;
|
|
1447
|
-
private _geometryCount;
|
|
1448
|
-
private _civil;
|
|
1449
|
-
private _groupSerializer;
|
|
1450
|
-
private _assets;
|
|
1451
|
-
private _meshesWithHoles;
|
|
1452
|
-
constructor(components: Components);
|
|
1453
|
-
dispose(): void;
|
|
1454
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1455
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1456
|
-
private readIfcFile;
|
|
1457
|
-
private streamIfcFile;
|
|
1458
|
-
private streamAllGeometries;
|
|
1459
|
-
private cleanUp;
|
|
1460
|
-
private getMesh;
|
|
1461
|
-
private getGeometry;
|
|
1462
|
-
private streamAssets;
|
|
1463
|
-
private streamGeometries;
|
|
1464
|
-
}
|
|
1465
|
-
export interface StreamedGeometries {
|
|
1466
|
-
[id: number]: {
|
|
1467
|
-
boundingBox: Float32Array;
|
|
1468
|
-
hasHoles: boolean;
|
|
1469
|
-
geometryFile?: string;
|
|
1470
|
-
};
|
|
1471
|
-
}
|
|
1472
|
-
export interface StreamedAsset {
|
|
1473
|
-
id: number;
|
|
1474
|
-
geometries: {
|
|
1475
|
-
geometryID: number;
|
|
1476
|
-
transformation: number[];
|
|
1477
|
-
color: number[];
|
|
1478
|
-
}[];
|
|
1479
|
-
}
|
|
1480
|
-
import * as WEBIFC from "web-ifc";
|
|
1481
|
-
import * as THREE from "three";
|
|
1482
|
-
export declare class Units {
|
|
1483
|
-
factor: number;
|
|
1484
|
-
complement: number;
|
|
1485
|
-
apply(matrix: THREE.Matrix4): void;
|
|
1486
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1487
|
-
private getLengthUnits;
|
|
1488
|
-
private getScaleMatrix;
|
|
1489
|
-
}
|
|
1490
|
-
import * as THREE from "three";
|
|
1491
|
-
import * as WEBIFC from "web-ifc";
|
|
1492
|
-
import * as FRAGS from "bim-fragment";
|
|
1493
|
-
export declare class CivilReader {
|
|
1494
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1495
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1496
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1497
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1498
|
-
} | undefined;
|
|
1499
|
-
get(civilItems: any): {
|
|
1500
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1501
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1502
|
-
} | undefined;
|
|
1503
|
-
private getCurves;
|
|
1504
|
-
}
|
|
1505
|
-
import * as WEBIFC from "web-ifc";
|
|
1506
1919
|
/** Configuration of the IFC-fragment conversion. */
|
|
1507
1920
|
export declare class IfcFragmentSettings {
|
|
1508
1921
|
/** Whether to extract the IFC properties into a JSON. */
|
|
@@ -1533,6 +1946,55 @@ import * as WEBIFC from "web-ifc";
|
|
|
1533
1946
|
export declare class IfcMetadataReader {
|
|
1534
1947
|
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1535
1948
|
}
|
|
1949
|
+
export interface StreamedGeometries {
|
|
1950
|
+
[id: number]: {
|
|
1951
|
+
boundingBox: Float32Array;
|
|
1952
|
+
hasHoles: boolean;
|
|
1953
|
+
geometryFile?: string;
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
export interface StreamedAsset {
|
|
1957
|
+
id: number;
|
|
1958
|
+
geometries: {
|
|
1959
|
+
geometryID: number;
|
|
1960
|
+
transformation: number[];
|
|
1961
|
+
color: number[];
|
|
1962
|
+
}[];
|
|
1963
|
+
}
|
|
1964
|
+
import * as WEBIFC from "web-ifc";
|
|
1965
|
+
import * as THREE from "three";
|
|
1966
|
+
export declare class Units {
|
|
1967
|
+
factor: number;
|
|
1968
|
+
complement: number;
|
|
1969
|
+
apply(matrix: THREE.Matrix4): void;
|
|
1970
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1971
|
+
private getLengthUnits;
|
|
1972
|
+
private getScaleMatrix;
|
|
1973
|
+
}
|
|
1974
|
+
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1975
|
+
export interface ModelsRelationMap {
|
|
1976
|
+
[modelID: string]: RelationsMap;
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Type alias for an array of inverse attribute names.
|
|
1980
|
+
*/
|
|
1981
|
+
export type InverseAttributes = [
|
|
1982
|
+
"IsDecomposedBy",
|
|
1983
|
+
"Decomposes",
|
|
1984
|
+
"AssociatedTo",
|
|
1985
|
+
"HasAssociations",
|
|
1986
|
+
"ClassificationForObjects",
|
|
1987
|
+
"IsGroupedBy",
|
|
1988
|
+
"HasAssignments",
|
|
1989
|
+
"IsDefinedBy",
|
|
1990
|
+
"DefinesOcurrence",
|
|
1991
|
+
"IsTypedBy",
|
|
1992
|
+
"Types",
|
|
1993
|
+
"Defines",
|
|
1994
|
+
"ContainedInStructure",
|
|
1995
|
+
"ContainsElements"
|
|
1996
|
+
];
|
|
1997
|
+
export type InverseAttribute = InverseAttributes[number];
|
|
1536
1998
|
import { BufferGeometry } from "three";
|
|
1537
1999
|
import * as THREE from "three";
|
|
1538
2000
|
export declare class TransformHelper {
|
|
@@ -1561,20 +2023,5 @@ export interface Query {
|
|
|
1561
2023
|
description?: string;
|
|
1562
2024
|
groups: QueryGroup;
|
|
1563
2025
|
}
|
|
1564
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1565
|
-
export declare class FragmentExploder extends Component implements Disposable {
|
|
1566
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1567
|
-
enabled: boolean;
|
|
1568
|
-
height: number;
|
|
1569
|
-
groupName: string;
|
|
1570
|
-
/** {@link Disposable.onDisposed} */
|
|
1571
|
-
readonly onDisposed: Event<string>;
|
|
1572
|
-
list: Set<string>;
|
|
1573
|
-
constructor(components: Components);
|
|
1574
|
-
dispose(): void;
|
|
1575
|
-
explode(): void;
|
|
1576
|
-
reset(): void;
|
|
1577
|
-
update(): void;
|
|
1578
|
-
}
|
|
1579
2026
|
|
|
1580
2027
|
}
|