@thatopen/components 2.0.0-alpha.6 → 2.0.0-alpha.7
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/ifc/IfcRelationsIndexer/index.d.ts +106 -0
- package/dist/ifc/index.d.ts +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +1130 -1031
- package/dist/namespace.d.ts +843 -768
- package/package.json +2 -2
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +0 -31
package/dist/namespace.d.ts
CHANGED
|
@@ -42,19 +42,6 @@ export declare class Disposer extends Component {
|
|
|
42
42
|
private disposeChildren;
|
|
43
43
|
private static disposeMaterial;
|
|
44
44
|
}
|
|
45
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
46
|
-
import { SimpleRaycaster } from "./src";
|
|
47
|
-
import { Components } from "../Components";
|
|
48
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
49
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
50
|
-
enabled: boolean;
|
|
51
|
-
list: Map<string, SimpleRaycaster>;
|
|
52
|
-
onDisposed: Event<unknown>;
|
|
53
|
-
constructor(components: Components);
|
|
54
|
-
get(world: World): SimpleRaycaster;
|
|
55
|
-
delete(world: World): void;
|
|
56
|
-
dispose(): void;
|
|
57
|
-
}
|
|
58
45
|
import { Component, Disposable, Event } from "../Types";
|
|
59
46
|
/**
|
|
60
47
|
* The entry point of the Components library.
|
|
@@ -120,6 +107,35 @@ export declare class Grids extends Component implements Disposable {
|
|
|
120
107
|
delete(world: World): void;
|
|
121
108
|
dispose(): void;
|
|
122
109
|
}
|
|
110
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
111
|
+
import { SimpleRaycaster } from "./src";
|
|
112
|
+
import { Components } from "../Components";
|
|
113
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
114
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
115
|
+
enabled: boolean;
|
|
116
|
+
list: Map<string, SimpleRaycaster>;
|
|
117
|
+
onDisposed: Event<unknown>;
|
|
118
|
+
constructor(components: Components);
|
|
119
|
+
get(world: World): SimpleRaycaster;
|
|
120
|
+
delete(world: World): void;
|
|
121
|
+
dispose(): void;
|
|
122
|
+
}
|
|
123
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
124
|
+
import { Components } from "../Components";
|
|
125
|
+
import { SimpleWorld } from "./src";
|
|
126
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
127
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
128
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
129
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
130
|
+
readonly onDisposed: Event<unknown>;
|
|
131
|
+
list: Map<string, World>;
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
constructor(components: Components);
|
|
134
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
135
|
+
delete(world: World): void;
|
|
136
|
+
dispose(): void;
|
|
137
|
+
update(delta?: number): void | Promise<void>;
|
|
138
|
+
}
|
|
123
139
|
import * as THREE from "three";
|
|
124
140
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
125
141
|
import { SimplePlane } from "./src";
|
|
@@ -223,22 +239,6 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
223
239
|
private _onStartDragging;
|
|
224
240
|
private _onEndDragging;
|
|
225
241
|
}
|
|
226
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
227
|
-
import { Components } from "../Components";
|
|
228
|
-
import { SimpleWorld } from "./src";
|
|
229
|
-
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
230
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
231
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
232
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
233
|
-
readonly onDisposed: Event<unknown>;
|
|
234
|
-
list: Map<string, World>;
|
|
235
|
-
enabled: boolean;
|
|
236
|
-
constructor(components: Components);
|
|
237
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
238
|
-
delete(world: World): void;
|
|
239
|
-
dispose(): void;
|
|
240
|
-
update(delta?: number): void | Promise<void>;
|
|
241
|
-
}
|
|
242
242
|
import * as THREE from "three";
|
|
243
243
|
import { Component, Disposable, Event, World } from "../Types";
|
|
244
244
|
import { Components } from "../Components";
|
|
@@ -323,75 +323,6 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
323
323
|
dispose(): void;
|
|
324
324
|
}
|
|
325
325
|
import * as THREE from "three";
|
|
326
|
-
import { Components } from "../../core/Components";
|
|
327
|
-
import { SimpleCamera } from "../../core";
|
|
328
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
329
|
-
/**
|
|
330
|
-
* A flexible camera that uses
|
|
331
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
332
|
-
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
333
|
-
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
334
|
-
*/
|
|
335
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
336
|
-
/**
|
|
337
|
-
* The current {@link NavigationMode}.
|
|
338
|
-
*/
|
|
339
|
-
mode: NavigationMode;
|
|
340
|
-
readonly projection: ProjectionManager;
|
|
341
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
342
|
-
protected readonly _userInputButtons: any;
|
|
343
|
-
protected readonly _frustumSize = 50;
|
|
344
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
345
|
-
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
346
|
-
constructor(components: Components);
|
|
347
|
-
/** {@link Disposable.dispose} */
|
|
348
|
-
dispose(): void;
|
|
349
|
-
/**
|
|
350
|
-
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
351
|
-
*
|
|
352
|
-
* @param mode - The {@link NavigationMode} to set.
|
|
353
|
-
*/
|
|
354
|
-
set(mode: NavModeID): void;
|
|
355
|
-
/**
|
|
356
|
-
* Make the camera view fit all the specified meshes.
|
|
357
|
-
*
|
|
358
|
-
* @param meshes the meshes to fit. If it is not defined, it will
|
|
359
|
-
* evaluate {@link Components.meshes}.
|
|
360
|
-
* @param offset the distance to the fit object
|
|
361
|
-
*/
|
|
362
|
-
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
363
|
-
/**
|
|
364
|
-
* Allows or prevents all user input.
|
|
365
|
-
*
|
|
366
|
-
* @param active - whether to enable or disable user inputs.
|
|
367
|
-
*/
|
|
368
|
-
setUserInput(active: boolean): void;
|
|
369
|
-
private disableUserInput;
|
|
370
|
-
private enableUserInput;
|
|
371
|
-
private newOrthoCamera;
|
|
372
|
-
private setOrthoCameraAspect;
|
|
373
|
-
}
|
|
374
|
-
import * as THREE from "three";
|
|
375
|
-
export interface MeasureEdge {
|
|
376
|
-
distance: number;
|
|
377
|
-
points: THREE.Vector3[];
|
|
378
|
-
}
|
|
379
|
-
export declare class MeasurementUtils {
|
|
380
|
-
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
381
|
-
edges: MeasureEdge[];
|
|
382
|
-
indices: Set<number>;
|
|
383
|
-
} | null;
|
|
384
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
385
|
-
private static getFaceData;
|
|
386
|
-
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
387
|
-
p1: THREE.Vector3;
|
|
388
|
-
p2: THREE.Vector3;
|
|
389
|
-
p3: THREE.Vector3;
|
|
390
|
-
faceNormal: THREE.Vector3;
|
|
391
|
-
};
|
|
392
|
-
private static round;
|
|
393
|
-
}
|
|
394
|
-
import * as THREE from "three";
|
|
395
326
|
import * as FRAGS from "@thatopen/fragments";
|
|
396
327
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
397
328
|
import { Component, Components, Disposable, Event } from "../../core";
|
|
@@ -428,6 +359,51 @@ export declare class FragmentBoundingBox extends Component implements Disposable
|
|
|
428
359
|
private static getFragmentBounds;
|
|
429
360
|
}
|
|
430
361
|
import * as FRAGS from "@thatopen/fragments";
|
|
362
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
363
|
+
export interface Classification {
|
|
364
|
+
[system: string]: {
|
|
365
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
export declare class FragmentClassifier extends Component implements Disposable {
|
|
369
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
370
|
+
/** {@link Component.enabled} */
|
|
371
|
+
enabled: boolean;
|
|
372
|
+
private _groupSystems;
|
|
373
|
+
/** {@link Disposable.onDisposed} */
|
|
374
|
+
readonly onDisposed: Event<unknown>;
|
|
375
|
+
constructor(components: Components);
|
|
376
|
+
private onFragmentsDisposed;
|
|
377
|
+
/** {@link Component.get} */
|
|
378
|
+
get(): Classification;
|
|
379
|
+
dispose(): void;
|
|
380
|
+
remove(guid: string): void;
|
|
381
|
+
find(filter?: {
|
|
382
|
+
[name: string]: string[];
|
|
383
|
+
}): FRAGS.FragmentIdMap;
|
|
384
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
385
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
386
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
387
|
+
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
388
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
389
|
+
private saveItem;
|
|
390
|
+
}
|
|
391
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
392
|
+
export declare class FragmentExploder extends Component implements Disposable {
|
|
393
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
394
|
+
enabled: boolean;
|
|
395
|
+
height: number;
|
|
396
|
+
groupName: string;
|
|
397
|
+
/** {@link Disposable.onDisposed} */
|
|
398
|
+
readonly onDisposed: Event<string>;
|
|
399
|
+
list: Set<string>;
|
|
400
|
+
constructor(components: Components);
|
|
401
|
+
dispose(): void;
|
|
402
|
+
explode(): void;
|
|
403
|
+
reset(): void;
|
|
404
|
+
update(): void;
|
|
405
|
+
}
|
|
406
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
431
407
|
import { Components, Component } from "../../core";
|
|
432
408
|
export declare class FragmentHider extends Component {
|
|
433
409
|
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
@@ -469,75 +445,6 @@ export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
|
469
445
|
private getGeometry;
|
|
470
446
|
private autoSetWasm;
|
|
471
447
|
}
|
|
472
|
-
import * as THREE from "three";
|
|
473
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
474
|
-
center: THREE.Vector3;
|
|
475
|
-
halfSizes: THREE.Vector3;
|
|
476
|
-
rotation: THREE.Matrix3;
|
|
477
|
-
transformation: THREE.Matrix4;
|
|
478
|
-
};
|
|
479
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
480
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
481
|
-
export declare class FragmentExploder extends Component implements Disposable {
|
|
482
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
483
|
-
enabled: boolean;
|
|
484
|
-
height: number;
|
|
485
|
-
groupName: string;
|
|
486
|
-
/** {@link Disposable.onDisposed} */
|
|
487
|
-
readonly onDisposed: Event<string>;
|
|
488
|
-
list: Set<string>;
|
|
489
|
-
constructor(components: Components);
|
|
490
|
-
dispose(): void;
|
|
491
|
-
explode(): void;
|
|
492
|
-
reset(): void;
|
|
493
|
-
update(): void;
|
|
494
|
-
}
|
|
495
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
496
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
497
|
-
export interface Classification {
|
|
498
|
-
[system: string]: {
|
|
499
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
export declare class FragmentClassifier extends Component implements Disposable {
|
|
503
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
504
|
-
/** {@link Component.enabled} */
|
|
505
|
-
enabled: boolean;
|
|
506
|
-
private _groupSystems;
|
|
507
|
-
/** {@link Disposable.onDisposed} */
|
|
508
|
-
readonly onDisposed: Event<unknown>;
|
|
509
|
-
constructor(components: Components);
|
|
510
|
-
private onFragmentsDisposed;
|
|
511
|
-
/** {@link Component.get} */
|
|
512
|
-
get(): Classification;
|
|
513
|
-
dispose(): void;
|
|
514
|
-
remove(guid: string): void;
|
|
515
|
-
find(filter?: {
|
|
516
|
-
[name: string]: string[];
|
|
517
|
-
}): FRAGS.FragmentIdMap;
|
|
518
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
519
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
520
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
521
|
-
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
522
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
523
|
-
private saveItem;
|
|
524
|
-
}
|
|
525
|
-
import * as WEBIFC from "web-ifc";
|
|
526
|
-
import * as FRAG from "@thatopen/fragments";
|
|
527
|
-
/**
|
|
528
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
529
|
-
*/
|
|
530
|
-
export declare class IfcJsonExporter {
|
|
531
|
-
/**
|
|
532
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
533
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
534
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
535
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
536
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
537
|
-
* to make the location data available (e.g. absolute position of building).
|
|
538
|
-
*/
|
|
539
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
540
|
-
}
|
|
541
448
|
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
542
449
|
import * as THREE from "three";
|
|
543
450
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
@@ -582,21 +489,241 @@ export declare class FragmentManager extends Component implements Disposable {
|
|
|
582
489
|
export(group: FragmentsGroup): Uint8Array;
|
|
583
490
|
coordinate(models?: FragmentsGroup[]): void;
|
|
584
491
|
}
|
|
585
|
-
import * as
|
|
586
|
-
import {
|
|
587
|
-
import {
|
|
588
|
-
import {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
export
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
492
|
+
import * as THREE from "three";
|
|
493
|
+
import { Components } from "../../core/Components";
|
|
494
|
+
import { SimpleCamera } from "../../core";
|
|
495
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
496
|
+
/**
|
|
497
|
+
* A flexible camera that uses
|
|
498
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
499
|
+
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
500
|
+
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
501
|
+
*/
|
|
502
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
503
|
+
/**
|
|
504
|
+
* The current {@link NavigationMode}.
|
|
505
|
+
*/
|
|
506
|
+
mode: NavigationMode;
|
|
507
|
+
readonly projection: ProjectionManager;
|
|
508
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
509
|
+
protected readonly _userInputButtons: any;
|
|
510
|
+
protected readonly _frustumSize = 50;
|
|
511
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
512
|
+
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
513
|
+
constructor(components: Components);
|
|
514
|
+
/** {@link Disposable.dispose} */
|
|
515
|
+
dispose(): void;
|
|
516
|
+
/**
|
|
517
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
518
|
+
*
|
|
519
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
520
|
+
*/
|
|
521
|
+
set(mode: NavModeID): void;
|
|
522
|
+
/**
|
|
523
|
+
* Make the camera view fit all the specified meshes.
|
|
524
|
+
*
|
|
525
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
526
|
+
* evaluate {@link Components.meshes}.
|
|
527
|
+
* @param offset the distance to the fit object
|
|
528
|
+
*/
|
|
529
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
530
|
+
/**
|
|
531
|
+
* Allows or prevents all user input.
|
|
532
|
+
*
|
|
533
|
+
* @param active - whether to enable or disable user inputs.
|
|
534
|
+
*/
|
|
535
|
+
setUserInput(active: boolean): void;
|
|
536
|
+
private disableUserInput;
|
|
537
|
+
private enableUserInput;
|
|
538
|
+
private newOrthoCamera;
|
|
539
|
+
private setOrthoCameraAspect;
|
|
540
|
+
}
|
|
541
|
+
import * as THREE from "three";
|
|
542
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
543
|
+
center: THREE.Vector3;
|
|
544
|
+
halfSizes: THREE.Vector3;
|
|
545
|
+
rotation: THREE.Matrix3;
|
|
546
|
+
transformation: THREE.Matrix4;
|
|
547
|
+
};
|
|
548
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
549
|
+
export declare class UUID {
|
|
550
|
+
private static _pattern;
|
|
551
|
+
private static _lut;
|
|
552
|
+
static create(): string;
|
|
553
|
+
static validate(uuid: string): void;
|
|
554
|
+
}
|
|
555
|
+
import * as THREE from "three";
|
|
556
|
+
export declare class MaterialsUtils {
|
|
557
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
558
|
+
}
|
|
559
|
+
import * as THREE from "three";
|
|
560
|
+
import { Component, Components, Event, World, Disposable } from "../core";
|
|
561
|
+
export interface VertexPickerConfig {
|
|
562
|
+
showOnlyVertex: boolean;
|
|
563
|
+
snapDistance: number;
|
|
564
|
+
previewElement: HTMLElement;
|
|
565
|
+
}
|
|
566
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
567
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
568
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
569
|
+
components: Components;
|
|
570
|
+
private _pickedPoint;
|
|
571
|
+
private _config;
|
|
572
|
+
private _enabled;
|
|
573
|
+
private _workingPlane;
|
|
574
|
+
/** {@link Disposable.onDisposed} */
|
|
575
|
+
readonly onDisposed: Event<unknown>;
|
|
576
|
+
set enabled(value: boolean);
|
|
577
|
+
get enabled(): boolean;
|
|
578
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
579
|
+
[Symbol.dispose](): void;
|
|
580
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
581
|
+
get workingPlane(): THREE.Plane | null;
|
|
582
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
583
|
+
get config(): Partial<VertexPickerConfig>;
|
|
584
|
+
dispose(): void;
|
|
585
|
+
get(world: World): THREE.Vector3 | null;
|
|
586
|
+
private getClosestVertex;
|
|
587
|
+
private getVertices;
|
|
588
|
+
private getVertex;
|
|
589
|
+
}
|
|
590
|
+
import * as WEBIFC from "web-ifc";
|
|
591
|
+
import * as FRAG from "@thatopen/fragments";
|
|
592
|
+
/**
|
|
593
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
594
|
+
*/
|
|
595
|
+
export declare class IfcJsonExporter {
|
|
596
|
+
/**
|
|
597
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
598
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
599
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
600
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
601
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
602
|
+
* to make the location data available (e.g. absolute position of building).
|
|
603
|
+
*/
|
|
604
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
605
|
+
}
|
|
606
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
607
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
608
|
+
interface RelationMap {
|
|
609
|
+
[modelID: string]: Map<number, Map<number, number[]>>;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
613
|
+
* 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.
|
|
614
|
+
*/
|
|
615
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
616
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
617
|
+
/** {@link Disposable.onDisposed} */
|
|
618
|
+
readonly onDisposed: Event<string>;
|
|
619
|
+
enabled: boolean;
|
|
620
|
+
/**
|
|
621
|
+
* All the inverse attributes this component can processes.
|
|
622
|
+
*/
|
|
623
|
+
readonly inverseAttributes: string[];
|
|
624
|
+
inverseAttributesToProcess: string[];
|
|
625
|
+
private _relToAttributesMap;
|
|
626
|
+
/**
|
|
627
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
628
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
629
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
630
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
631
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
632
|
+
* of entity relationships within a model.
|
|
633
|
+
*/
|
|
634
|
+
readonly relationMaps: RelationMap;
|
|
635
|
+
constructor(components: Components);
|
|
636
|
+
private onFragmentsDisposed;
|
|
637
|
+
private getAttributeRels;
|
|
638
|
+
private setRelMap;
|
|
639
|
+
/**
|
|
640
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
641
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
642
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
643
|
+
*
|
|
644
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
645
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
646
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
647
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
648
|
+
* of entities that are related through that attribute.
|
|
649
|
+
*
|
|
650
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
651
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
652
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
653
|
+
* @throws An error if the model does not have properties loaded.
|
|
654
|
+
*/
|
|
655
|
+
process(model: FragmentsGroup): Promise<Map<number, Map<number, number[]>>>;
|
|
656
|
+
/**
|
|
657
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
658
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
659
|
+
* returning the IDs of related entities if a match is found.
|
|
660
|
+
*
|
|
661
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
662
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
663
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
664
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
665
|
+
* or the specified relation name is not indexed.
|
|
666
|
+
*/
|
|
667
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: string): number[] | null;
|
|
668
|
+
/**
|
|
669
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
670
|
+
* This method iterates through the relations indexed for the given model,
|
|
671
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
672
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
673
|
+
* The resulting object is then serialized into a JSON string.
|
|
674
|
+
*
|
|
675
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
676
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
677
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
678
|
+
*/
|
|
679
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
680
|
+
/**
|
|
681
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
682
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
683
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
684
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
685
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
686
|
+
*
|
|
687
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
688
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
689
|
+
*/
|
|
690
|
+
serializeRelations(): string;
|
|
691
|
+
/**
|
|
692
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
693
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
694
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
695
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
696
|
+
* of express IDs of entities related through that relation type.
|
|
697
|
+
*
|
|
698
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
699
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
700
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
701
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
702
|
+
*/
|
|
703
|
+
getRelationsMapFromJSON(json: string): Map<number, Map<number, number[]>>;
|
|
704
|
+
/**
|
|
705
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
706
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
707
|
+
* references that could prevent garbage collection.
|
|
708
|
+
*/
|
|
709
|
+
dispose(): void;
|
|
710
|
+
}
|
|
711
|
+
export {};
|
|
712
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
713
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
714
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
715
|
+
import { QueryGroup } from "./src/types";
|
|
716
|
+
export interface QueryResult {
|
|
717
|
+
[modelID: string]: {
|
|
718
|
+
modelEntities: Set<number>;
|
|
719
|
+
otherEntities: Set<number>;
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
export interface IndexedModels {
|
|
723
|
+
[modelID: string]: {
|
|
724
|
+
[expressID: number]: Set<number>;
|
|
725
|
+
};
|
|
726
|
+
}
|
|
600
727
|
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
601
728
|
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
602
729
|
/** {@link Disposable.onDisposed} */
|
|
@@ -692,77 +819,33 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
692
819
|
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
693
820
|
}
|
|
694
821
|
export {};
|
|
695
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
696
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
697
|
-
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
698
|
-
interface IndexMap {
|
|
699
|
-
[modelID: string]: {
|
|
700
|
-
[expressID: string]: Set<number>;
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
704
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
705
|
-
/** {@link Disposable.onDisposed} */
|
|
706
|
-
readonly onDisposed: Event<string>;
|
|
707
|
-
enabled: boolean;
|
|
708
|
-
relationsToProcess: number[];
|
|
709
|
-
indexMap: IndexMap;
|
|
710
|
-
private _propertiesManager;
|
|
711
|
-
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
712
|
-
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
713
|
-
get propertiesManager(): IfcPropertiesManager | null;
|
|
714
|
-
constructor(components: Components);
|
|
715
|
-
private onFragmentsDisposed;
|
|
716
|
-
dispose(): Promise<void>;
|
|
717
|
-
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
718
|
-
private getNestedPsets;
|
|
719
|
-
private getPsetProperties;
|
|
720
|
-
process(model: FragmentsGroup): Promise<void>;
|
|
721
|
-
private setEntityIndex;
|
|
722
|
-
private cloneProperty;
|
|
723
|
-
private clonePropertyArray;
|
|
724
|
-
}
|
|
725
|
-
export {};
|
|
726
822
|
import * as THREE from "three";
|
|
727
|
-
export
|
|
728
|
-
|
|
823
|
+
export interface MeasureEdge {
|
|
824
|
+
distance: number;
|
|
825
|
+
points: THREE.Vector3[];
|
|
729
826
|
}
|
|
730
|
-
export declare class
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
827
|
+
export declare class MeasurementUtils {
|
|
828
|
+
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
829
|
+
edges: MeasureEdge[];
|
|
830
|
+
indices: Set<number>;
|
|
831
|
+
} | null;
|
|
832
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
833
|
+
private static getFaceData;
|
|
834
|
+
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
835
|
+
p1: THREE.Vector3;
|
|
836
|
+
p2: THREE.Vector3;
|
|
837
|
+
p3: THREE.Vector3;
|
|
838
|
+
faceNormal: THREE.Vector3;
|
|
839
|
+
};
|
|
840
|
+
private static round;
|
|
735
841
|
}
|
|
736
|
-
|
|
737
|
-
import
|
|
738
|
-
export interface
|
|
739
|
-
|
|
740
|
-
snapDistance: number;
|
|
741
|
-
previewElement: HTMLElement;
|
|
842
|
+
export declare const GeometryTypes: Set<number>;
|
|
843
|
+
import * as WEBIFC from "web-ifc";
|
|
844
|
+
export interface IfcItemsCategories {
|
|
845
|
+
[itemID: number]: number;
|
|
742
846
|
}
|
|
743
|
-
export declare class
|
|
744
|
-
|
|
745
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
746
|
-
components: Components;
|
|
747
|
-
private _pickedPoint;
|
|
748
|
-
private _config;
|
|
749
|
-
private _enabled;
|
|
750
|
-
private _workingPlane;
|
|
751
|
-
/** {@link Disposable.onDisposed} */
|
|
752
|
-
readonly onDisposed: Event<unknown>;
|
|
753
|
-
set enabled(value: boolean);
|
|
754
|
-
get enabled(): boolean;
|
|
755
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
756
|
-
[Symbol.dispose](): void;
|
|
757
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
758
|
-
get workingPlane(): THREE.Plane | null;
|
|
759
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
760
|
-
get config(): Partial<VertexPickerConfig>;
|
|
761
|
-
dispose(): void;
|
|
762
|
-
get(world: World): THREE.Vector3 | null;
|
|
763
|
-
private getClosestVertex;
|
|
764
|
-
private getVertices;
|
|
765
|
-
private getVertex;
|
|
847
|
+
export declare class IfcCategories {
|
|
848
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
766
849
|
}
|
|
767
850
|
import * as WEBIFC from "web-ifc";
|
|
768
851
|
import { IfcItemsCategories } from "../../../ifc";
|
|
@@ -772,17 +855,9 @@ export declare class SpatialStructure {
|
|
|
772
855
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
773
856
|
cleanUp(): void;
|
|
774
857
|
}
|
|
775
|
-
import * as WEBIFC from "web-ifc";
|
|
776
|
-
export interface IfcItemsCategories {
|
|
777
|
-
[itemID: number]: number;
|
|
778
|
-
}
|
|
779
|
-
export declare class IfcCategories {
|
|
780
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
781
|
-
}
|
|
782
858
|
export declare const IfcElements: {
|
|
783
859
|
[key: number]: string;
|
|
784
860
|
};
|
|
785
|
-
export declare const GeometryTypes: Set<number>;
|
|
786
861
|
export declare const IfcCategoryMap: {
|
|
787
862
|
[key: number]: string;
|
|
788
863
|
};
|
|
@@ -811,204 +886,6 @@ export declare class IfcPropertiesUtils {
|
|
|
811
886
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
812
887
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
813
888
|
}
|
|
814
|
-
import * as THREE from "three";
|
|
815
|
-
import { Disposable, Event } from "../../Types";
|
|
816
|
-
/**
|
|
817
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
818
|
-
* to work with tools like the
|
|
819
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
820
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
821
|
-
*/
|
|
822
|
-
export declare class Mouse implements Disposable {
|
|
823
|
-
dom: HTMLCanvasElement;
|
|
824
|
-
private _event?;
|
|
825
|
-
private _position;
|
|
826
|
-
/** {@link Disposable.onDisposed} */
|
|
827
|
-
readonly onDisposed: Event<unknown>;
|
|
828
|
-
constructor(dom: HTMLCanvasElement);
|
|
829
|
-
/**
|
|
830
|
-
* The real position of the mouse of the Three.js canvas.
|
|
831
|
-
*/
|
|
832
|
-
get position(): THREE.Vector2;
|
|
833
|
-
/** {@link Disposable.dispose} */
|
|
834
|
-
dispose(): void;
|
|
835
|
-
private getPositionY;
|
|
836
|
-
private getPositionX;
|
|
837
|
-
private updateMouseInfo;
|
|
838
|
-
private setupEvents;
|
|
839
|
-
}
|
|
840
|
-
import * as THREE from "three";
|
|
841
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
842
|
-
import { Components } from "../../Components";
|
|
843
|
-
/**
|
|
844
|
-
* A basic renderer capable of rendering
|
|
845
|
-
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
846
|
-
*/
|
|
847
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
848
|
-
/** {@link Component.enabled} */
|
|
849
|
-
enabled: boolean;
|
|
850
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
851
|
-
container: HTMLElement | null;
|
|
852
|
-
three: THREE.WebGLRenderer;
|
|
853
|
-
protected _canvas: HTMLCanvasElement;
|
|
854
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
855
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
856
|
-
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
857
|
-
/** {@link Updateable.update} */
|
|
858
|
-
update(): void;
|
|
859
|
-
/** {@link Disposable.dispose} */
|
|
860
|
-
dispose(): void;
|
|
861
|
-
/** {@link Resizeable.getSize}. */
|
|
862
|
-
getSize(): THREE.Vector2;
|
|
863
|
-
/** {@link Resizeable.resize} */
|
|
864
|
-
resize: (size?: THREE.Vector2) => void;
|
|
865
|
-
setupEvents(active: boolean): void;
|
|
866
|
-
private resizeEvent;
|
|
867
|
-
private setupRenderer;
|
|
868
|
-
private onContextLost;
|
|
869
|
-
private onContextBack;
|
|
870
|
-
private updateContainer;
|
|
871
|
-
}
|
|
872
|
-
import * as THREE from "three";
|
|
873
|
-
import { Components } from "../../Components";
|
|
874
|
-
import { Event, World, Disposable } from "../../Types";
|
|
875
|
-
import { Mouse } from "./mouse";
|
|
876
|
-
/**
|
|
877
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
878
|
-
* that allows to easily get items from the scene using the mouse and touch
|
|
879
|
-
* events.
|
|
880
|
-
*/
|
|
881
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
882
|
-
/** {@link Component.enabled} */
|
|
883
|
-
enabled: boolean;
|
|
884
|
-
components: Components;
|
|
885
|
-
/** {@link Disposable.onDisposed} */
|
|
886
|
-
readonly onDisposed: Event<unknown>;
|
|
887
|
-
/** The position of the mouse in the screen. */
|
|
888
|
-
readonly mouse: Mouse;
|
|
889
|
-
readonly three: THREE.Raycaster;
|
|
890
|
-
world: World;
|
|
891
|
-
constructor(components: Components, world: World);
|
|
892
|
-
/** {@link Disposable.dispose} */
|
|
893
|
-
dispose(): void;
|
|
894
|
-
/**
|
|
895
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
896
|
-
* the first item found. This also takes into account the clipping planes
|
|
897
|
-
* used by the renderer.
|
|
898
|
-
*
|
|
899
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
900
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
901
|
-
* {@link Components.meshes}.
|
|
902
|
-
*/
|
|
903
|
-
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
904
|
-
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
905
|
-
private intersect;
|
|
906
|
-
private filterClippingPlanes;
|
|
907
|
-
}
|
|
908
|
-
import * as THREE from "three";
|
|
909
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
910
|
-
import { Components } from "../../Components";
|
|
911
|
-
export interface SimpleSceneConfig {
|
|
912
|
-
directionalLight: {
|
|
913
|
-
color: THREE.Color;
|
|
914
|
-
intensity: number;
|
|
915
|
-
position: THREE.Vector3;
|
|
916
|
-
};
|
|
917
|
-
ambientLight: {
|
|
918
|
-
color: THREE.Color;
|
|
919
|
-
intensity: number;
|
|
920
|
-
};
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
924
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
925
|
-
* @noInheritDoc
|
|
926
|
-
*/
|
|
927
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
928
|
-
/** {@link Configurable.isSetup} */
|
|
929
|
-
isSetup: boolean;
|
|
930
|
-
three: THREE.Scene;
|
|
931
|
-
/** {@link Configurable.onSetup} */
|
|
932
|
-
readonly onSetup: Event<SimpleScene>;
|
|
933
|
-
config: Required<SimpleSceneConfig>;
|
|
934
|
-
constructor(components: Components);
|
|
935
|
-
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
936
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
937
|
-
}
|
|
938
|
-
/// <reference types="node" />
|
|
939
|
-
import * as THREE from "three";
|
|
940
|
-
import { Hideable, Event, World } from "../../Types";
|
|
941
|
-
import { Components } from "../../Components";
|
|
942
|
-
export interface GridConfig {
|
|
943
|
-
color: THREE.Color;
|
|
944
|
-
size1: number;
|
|
945
|
-
size2: number;
|
|
946
|
-
distance: number;
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* An infinite grid. Created by
|
|
950
|
-
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
951
|
-
* and translated to typescript by
|
|
952
|
-
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
953
|
-
*/
|
|
954
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
955
|
-
/** {@link Disposable.onDisposed} */
|
|
956
|
-
readonly onDisposed: Event<unknown>;
|
|
957
|
-
world: World;
|
|
958
|
-
components: Components;
|
|
959
|
-
/** {@link Hideable.visible} */
|
|
960
|
-
get visible(): boolean;
|
|
961
|
-
/** {@link Hideable.visible} */
|
|
962
|
-
set visible(visible: boolean);
|
|
963
|
-
/** The material of the grid. */
|
|
964
|
-
get material(): THREE.ShaderMaterial;
|
|
965
|
-
/**
|
|
966
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
967
|
-
* perspective cameras and false for orthographic cameras.
|
|
968
|
-
*/
|
|
969
|
-
get fade(): boolean;
|
|
970
|
-
/**
|
|
971
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
972
|
-
* perspective cameras and false for orthographic cameras.
|
|
973
|
-
*/
|
|
974
|
-
set fade(active: boolean);
|
|
975
|
-
private readonly _grid;
|
|
976
|
-
private _fade;
|
|
977
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
978
|
-
[Symbol.dispose](): void;
|
|
979
|
-
/** {@link Component.get} */
|
|
980
|
-
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
981
|
-
/** {@link Disposable.dispose} */
|
|
982
|
-
dispose(): void;
|
|
983
|
-
private setupEvents;
|
|
984
|
-
private updateZoom;
|
|
985
|
-
}
|
|
986
|
-
import * as THREE from "three";
|
|
987
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
988
|
-
import { Components } from "../../Components";
|
|
989
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
990
|
-
/**
|
|
991
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
992
|
-
*/
|
|
993
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
994
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
995
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
996
|
-
enabled: boolean;
|
|
997
|
-
uuid: string;
|
|
998
|
-
readonly onDisposed: Event<unknown>;
|
|
999
|
-
private _scene?;
|
|
1000
|
-
private _camera?;
|
|
1001
|
-
private _renderer;
|
|
1002
|
-
get scene(): T;
|
|
1003
|
-
set scene(scene: T);
|
|
1004
|
-
get camera(): U;
|
|
1005
|
-
set camera(camera: U);
|
|
1006
|
-
get renderer(): S | null;
|
|
1007
|
-
set renderer(renderer: S | null);
|
|
1008
|
-
constructor(components: Components);
|
|
1009
|
-
update(delta?: number): void;
|
|
1010
|
-
dispose(disposeResources?: boolean): void;
|
|
1011
|
-
}
|
|
1012
889
|
/**
|
|
1013
890
|
* Simple event handler by
|
|
1014
891
|
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
@@ -1043,6 +920,24 @@ export declare class Event<T> {
|
|
|
1043
920
|
reset(): void;
|
|
1044
921
|
private handlers;
|
|
1045
922
|
}
|
|
923
|
+
import { Base } from "./base";
|
|
924
|
+
/**
|
|
925
|
+
* Components are the building blocks of this library. Components are singleton
|
|
926
|
+
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
927
|
+
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
928
|
+
* unique (they can't be instanced more than once), and have a static UUID that
|
|
929
|
+
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
930
|
+
* instance.
|
|
931
|
+
*/
|
|
932
|
+
export declare abstract class Component extends Base {
|
|
933
|
+
/**
|
|
934
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
935
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
936
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
937
|
+
* will not be updated automatically each frame.
|
|
938
|
+
*/
|
|
939
|
+
abstract enabled: boolean;
|
|
940
|
+
}
|
|
1046
941
|
/**
|
|
1047
942
|
* Simple event handler by
|
|
1048
943
|
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
@@ -1077,6 +972,23 @@ export declare class AsyncEvent<T> {
|
|
|
1077
972
|
reset(): void;
|
|
1078
973
|
private handlers;
|
|
1079
974
|
}
|
|
975
|
+
import { Base } from "./base";
|
|
976
|
+
import { World } from "./world";
|
|
977
|
+
import { Event } from "./event";
|
|
978
|
+
import { Components } from "../../Components";
|
|
979
|
+
/**
|
|
980
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
981
|
+
* or a renderer.
|
|
982
|
+
*/
|
|
983
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
984
|
+
readonly worlds: Map<string, World>;
|
|
985
|
+
readonly onWorldChanged: Event<{
|
|
986
|
+
world: World;
|
|
987
|
+
action: "added" | "removed";
|
|
988
|
+
}>;
|
|
989
|
+
currentWorld: World | null;
|
|
990
|
+
protected constructor(components: Components);
|
|
991
|
+
}
|
|
1080
992
|
import * as THREE from "three";
|
|
1081
993
|
import CameraControls from "camera-controls";
|
|
1082
994
|
import { Event } from "./event";
|
|
@@ -1200,69 +1112,35 @@ export interface BVHGeometry extends THREE.BufferGeometry {
|
|
|
1200
1112
|
export interface CameraControllable {
|
|
1201
1113
|
controls: CameraControls;
|
|
1202
1114
|
}
|
|
1203
|
-
import {
|
|
1115
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1116
|
+
import { Components } from "../../Components";
|
|
1204
1117
|
/**
|
|
1205
|
-
*
|
|
1206
|
-
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1207
|
-
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1208
|
-
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1209
|
-
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1210
|
-
* instance.
|
|
1118
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1211
1119
|
*/
|
|
1212
|
-
export declare abstract class
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1120
|
+
export declare abstract class Base {
|
|
1121
|
+
components: Components;
|
|
1122
|
+
constructor(components: Components);
|
|
1123
|
+
/** Whether is component is {@link Disposable}. */
|
|
1124
|
+
isDisposeable: () => this is Disposable;
|
|
1125
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1126
|
+
isResizeable: () => this is Resizeable;
|
|
1127
|
+
/** Whether is component is {@link Updateable}. */
|
|
1128
|
+
isUpdateable: () => this is Updateable;
|
|
1129
|
+
/** Whether is component is {@link Hideable}. */
|
|
1130
|
+
isHideable: () => this is Hideable;
|
|
1131
|
+
/** Whether is component is {@link Configurable}. */
|
|
1132
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1220
1133
|
}
|
|
1221
1134
|
import * as THREE from "three";
|
|
1222
1135
|
import CameraControls from "camera-controls";
|
|
1223
|
-
import {
|
|
1224
|
-
import {
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1232
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1233
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1234
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1235
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1236
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
1237
|
-
/** {@link Disposable.onDisposed} */
|
|
1238
|
-
readonly onDisposed: Event<string>;
|
|
1239
|
-
readonly three: THREE.PerspectiveCamera;
|
|
1240
|
-
private _allControls;
|
|
1241
|
-
/**
|
|
1242
|
-
* The object that controls the camera. An instance of
|
|
1243
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1244
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
1245
|
-
* object to move, rotate, look at objects, etc.
|
|
1246
|
-
*/
|
|
1247
|
-
get controls(): CameraControls;
|
|
1248
|
-
/** {@link Component.enabled} */
|
|
1249
|
-
get enabled(): boolean;
|
|
1250
|
-
/** {@link Component.enabled} */
|
|
1251
|
-
set enabled(enabled: boolean);
|
|
1252
|
-
constructor(components: Components);
|
|
1253
|
-
/** {@link Disposable.dispose} */
|
|
1254
|
-
dispose(): void;
|
|
1255
|
-
/** {@link Updateable.update} */
|
|
1256
|
-
update(_delta: number): void;
|
|
1257
|
-
/**
|
|
1258
|
-
* Updates the aspect of the camera to match the size of the
|
|
1259
|
-
* {@link Components.renderer}.
|
|
1260
|
-
*/
|
|
1261
|
-
updateAspect: () => void;
|
|
1262
|
-
private setupCamera;
|
|
1263
|
-
private newCameraControls;
|
|
1264
|
-
private setupEvents;
|
|
1265
|
-
private static getSubsetOfThree;
|
|
1136
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1137
|
+
import { CameraControllable } from "./interfaces";
|
|
1138
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1139
|
+
abstract enabled: boolean;
|
|
1140
|
+
abstract three: THREE.Camera;
|
|
1141
|
+
abstract controls?: CameraControls;
|
|
1142
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1143
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1266
1144
|
}
|
|
1267
1145
|
import * as THREE from "three";
|
|
1268
1146
|
import { Vector2 } from "three";
|
|
@@ -1305,32 +1183,17 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
1305
1183
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1306
1184
|
}
|
|
1307
1185
|
import * as THREE from "three";
|
|
1308
|
-
import
|
|
1309
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
1310
|
-
import { CameraControllable } from "./interfaces";
|
|
1311
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1312
|
-
abstract enabled: boolean;
|
|
1313
|
-
abstract three: THREE.Camera;
|
|
1314
|
-
abstract controls?: CameraControls;
|
|
1315
|
-
/** Whether is instance is {@link CameraControllable}. */
|
|
1316
|
-
hasCameraControls: () => this is CameraControllable;
|
|
1317
|
-
}
|
|
1318
|
-
import { Base } from "./base";
|
|
1319
|
-
import { World } from "./world";
|
|
1186
|
+
import { Disposable } from "./interfaces";
|
|
1320
1187
|
import { Event } from "./event";
|
|
1321
1188
|
import { Components } from "../../Components";
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
readonly worlds: Map<string, World>;
|
|
1328
|
-
readonly onWorldChanged: Event<{
|
|
1329
|
-
world: World;
|
|
1330
|
-
action: "added" | "removed";
|
|
1331
|
-
}>;
|
|
1332
|
-
currentWorld: World | null;
|
|
1189
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1190
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1191
|
+
/** {@link Disposable.onDisposed} */
|
|
1192
|
+
readonly onDisposed: Event<unknown>;
|
|
1193
|
+
abstract three: THREE.Object3D;
|
|
1333
1194
|
protected constructor(components: Components);
|
|
1195
|
+
/** {@link Disposable.dispose} */
|
|
1196
|
+
dispose(): void;
|
|
1334
1197
|
}
|
|
1335
1198
|
import * as THREE from "three";
|
|
1336
1199
|
import { BaseScene } from "./base-scene";
|
|
@@ -1344,104 +1207,98 @@ export interface World extends Disposable, Updateable {
|
|
|
1344
1207
|
renderer: BaseRenderer | null;
|
|
1345
1208
|
uuid: string;
|
|
1346
1209
|
}
|
|
1347
|
-
import {
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
export declare abstract class Base {
|
|
1353
|
-
components: Components;
|
|
1354
|
-
constructor(components: Components);
|
|
1355
|
-
/** Whether is component is {@link Disposable}. */
|
|
1356
|
-
isDisposeable: () => this is Disposable;
|
|
1357
|
-
/** Whether is component is {@link Resizeable}. */
|
|
1358
|
-
isResizeable: () => this is Resizeable;
|
|
1359
|
-
/** Whether is component is {@link Updateable}. */
|
|
1360
|
-
isUpdateable: () => this is Updateable;
|
|
1361
|
-
/** Whether is component is {@link Hideable}. */
|
|
1362
|
-
isHideable: () => this is Hideable;
|
|
1363
|
-
/** Whether is component is {@link Configurable}. */
|
|
1364
|
-
isConfigurable: () => this is Configurable<any>;
|
|
1210
|
+
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1211
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1212
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1213
|
+
minGeometrySize: number;
|
|
1214
|
+
minAssetsSize: number;
|
|
1365
1215
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
import
|
|
1371
|
-
|
|
1216
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1217
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1218
|
+
propertiesSize: number;
|
|
1219
|
+
}
|
|
1220
|
+
import * as WEBIFC from "web-ifc";
|
|
1221
|
+
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1222
|
+
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1223
|
+
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1224
|
+
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1225
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1226
|
+
onGeometryStreamed: Event<{
|
|
1227
|
+
buffer: Uint8Array;
|
|
1228
|
+
data: StreamedGeometries;
|
|
1229
|
+
}>;
|
|
1230
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1231
|
+
onProgress: Event<number>;
|
|
1232
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
1372
1233
|
/** {@link Disposable.onDisposed} */
|
|
1373
1234
|
readonly onDisposed: Event<unknown>;
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1235
|
+
settings: IfcStreamingSettings;
|
|
1236
|
+
enabled: boolean;
|
|
1237
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1238
|
+
private _spatialTree;
|
|
1239
|
+
private _metaData;
|
|
1240
|
+
private _visitedGeometries;
|
|
1241
|
+
private _streamSerializer;
|
|
1242
|
+
private _geometries;
|
|
1243
|
+
private _geometryCount;
|
|
1244
|
+
private _civil;
|
|
1245
|
+
private _groupSerializer;
|
|
1246
|
+
private _assets;
|
|
1247
|
+
private _meshesWithHoles;
|
|
1248
|
+
constructor(components: Components);
|
|
1377
1249
|
dispose(): void;
|
|
1250
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1251
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1252
|
+
private readIfcFile;
|
|
1253
|
+
private streamIfcFile;
|
|
1254
|
+
private streamAllGeometries;
|
|
1255
|
+
private cleanUp;
|
|
1256
|
+
private getMesh;
|
|
1257
|
+
private getGeometry;
|
|
1258
|
+
private streamAssets;
|
|
1259
|
+
private streamGeometries;
|
|
1378
1260
|
}
|
|
1379
|
-
import * as
|
|
1380
|
-
import {
|
|
1381
|
-
import {
|
|
1382
|
-
export
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1261
|
+
import * as WEBIFC from "web-ifc";
|
|
1262
|
+
import { Component, Disposable, Event } from "../../../core";
|
|
1263
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1264
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1265
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1266
|
+
onPropertiesStreamed: Event<{
|
|
1267
|
+
type: number;
|
|
1268
|
+
data: {
|
|
1269
|
+
[id: number]: any;
|
|
1270
|
+
};
|
|
1271
|
+
}>;
|
|
1272
|
+
onProgress: Event<number>;
|
|
1273
|
+
onIndicesStreamed: Event<number[][]>;
|
|
1392
1274
|
/** {@link Disposable.onDisposed} */
|
|
1393
1275
|
readonly onDisposed: Event<string>;
|
|
1394
|
-
/**
|
|
1395
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
1396
|
-
* meshes that are currently visible, and the ones that were visible
|
|
1397
|
-
* just before but not anymore.
|
|
1398
|
-
*/
|
|
1399
|
-
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1400
|
-
/** {@link Component.enabled} */
|
|
1401
1276
|
enabled: boolean;
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
protected readonly scene: THREE.Scene;
|
|
1419
|
-
private _width;
|
|
1420
|
-
private _height;
|
|
1421
|
-
private _availableColor;
|
|
1422
|
-
private readonly renderTarget;
|
|
1423
|
-
private readonly bufferSize;
|
|
1424
|
-
private readonly _buffer;
|
|
1425
|
-
protected _isWorkerBusy: boolean;
|
|
1426
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1427
|
-
/** {@link Disposable.dispose} */
|
|
1428
|
-
dispose(): void;
|
|
1429
|
-
/**
|
|
1430
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1431
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
1432
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1433
|
-
* not true.
|
|
1434
|
-
*/
|
|
1435
|
-
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1436
|
-
protected getAvailableColor(): {
|
|
1437
|
-
r: number;
|
|
1438
|
-
g: number;
|
|
1439
|
-
b: number;
|
|
1440
|
-
code: string;
|
|
1277
|
+
settings: PropertiesStreamingSettings;
|
|
1278
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1279
|
+
dispose(): Promise<void>;
|
|
1280
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1281
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1282
|
+
private readIfcFile;
|
|
1283
|
+
private streamIfcFile;
|
|
1284
|
+
private streamAllProperties;
|
|
1285
|
+
private getIndices;
|
|
1286
|
+
private cleanUp;
|
|
1287
|
+
}
|
|
1288
|
+
export interface StreamedGeometries {
|
|
1289
|
+
[id: number]: {
|
|
1290
|
+
boundingBox: Float32Array;
|
|
1291
|
+
hasHoles: boolean;
|
|
1292
|
+
geometryFile?: string;
|
|
1441
1293
|
};
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1294
|
+
}
|
|
1295
|
+
export interface StreamedAsset {
|
|
1296
|
+
id: number;
|
|
1297
|
+
geometries: {
|
|
1298
|
+
geometryID: number;
|
|
1299
|
+
transformation: number[];
|
|
1300
|
+
color: number[];
|
|
1301
|
+
}[];
|
|
1445
1302
|
}
|
|
1446
1303
|
import * as THREE from "three";
|
|
1447
1304
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -1504,11 +1361,139 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1504
1361
|
private newHelper;
|
|
1505
1362
|
private static newPlaneMesh;
|
|
1506
1363
|
}
|
|
1507
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1508
1364
|
import * as THREE from "three";
|
|
1509
|
-
import {
|
|
1510
|
-
|
|
1511
|
-
|
|
1365
|
+
import { Disposable, Event } from "../../Types";
|
|
1366
|
+
/**
|
|
1367
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1368
|
+
* to work with tools like the
|
|
1369
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1370
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1371
|
+
*/
|
|
1372
|
+
export declare class Mouse implements Disposable {
|
|
1373
|
+
dom: HTMLCanvasElement;
|
|
1374
|
+
private _event?;
|
|
1375
|
+
private _position;
|
|
1376
|
+
/** {@link Disposable.onDisposed} */
|
|
1377
|
+
readonly onDisposed: Event<unknown>;
|
|
1378
|
+
constructor(dom: HTMLCanvasElement);
|
|
1379
|
+
/**
|
|
1380
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1381
|
+
*/
|
|
1382
|
+
get position(): THREE.Vector2;
|
|
1383
|
+
/** {@link Disposable.dispose} */
|
|
1384
|
+
dispose(): void;
|
|
1385
|
+
private getPositionY;
|
|
1386
|
+
private getPositionX;
|
|
1387
|
+
private updateMouseInfo;
|
|
1388
|
+
private setupEvents;
|
|
1389
|
+
}
|
|
1390
|
+
import * as THREE from "three";
|
|
1391
|
+
import { Components } from "../../Components";
|
|
1392
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1393
|
+
import { Mouse } from "./mouse";
|
|
1394
|
+
/**
|
|
1395
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1396
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1397
|
+
* events.
|
|
1398
|
+
*/
|
|
1399
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1400
|
+
/** {@link Component.enabled} */
|
|
1401
|
+
enabled: boolean;
|
|
1402
|
+
components: Components;
|
|
1403
|
+
/** {@link Disposable.onDisposed} */
|
|
1404
|
+
readonly onDisposed: Event<unknown>;
|
|
1405
|
+
/** The position of the mouse in the screen. */
|
|
1406
|
+
readonly mouse: Mouse;
|
|
1407
|
+
readonly three: THREE.Raycaster;
|
|
1408
|
+
world: World;
|
|
1409
|
+
constructor(components: Components, world: World);
|
|
1410
|
+
/** {@link Disposable.dispose} */
|
|
1411
|
+
dispose(): void;
|
|
1412
|
+
/**
|
|
1413
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1414
|
+
* the first item found. This also takes into account the clipping planes
|
|
1415
|
+
* used by the renderer.
|
|
1416
|
+
*
|
|
1417
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1418
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1419
|
+
* {@link Components.meshes}.
|
|
1420
|
+
*/
|
|
1421
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1422
|
+
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;
|
|
1423
|
+
private intersect;
|
|
1424
|
+
private filterClippingPlanes;
|
|
1425
|
+
}
|
|
1426
|
+
import * as THREE from "three";
|
|
1427
|
+
import { Components } from "../../Components";
|
|
1428
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
1429
|
+
export interface CullerRendererSettings {
|
|
1430
|
+
updateInterval?: number;
|
|
1431
|
+
width?: number;
|
|
1432
|
+
height?: number;
|
|
1433
|
+
autoUpdate?: boolean;
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* A base renderer to determine visibility on screen
|
|
1437
|
+
*/
|
|
1438
|
+
export declare class CullerRenderer {
|
|
1439
|
+
/** {@link Disposable.onDisposed} */
|
|
1440
|
+
readonly onDisposed: Event<string>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1443
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1444
|
+
* just before but not anymore.
|
|
1445
|
+
*/
|
|
1446
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1447
|
+
/** {@link Component.enabled} */
|
|
1448
|
+
enabled: boolean;
|
|
1449
|
+
/**
|
|
1450
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1451
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1452
|
+
*/
|
|
1453
|
+
needsUpdate: boolean;
|
|
1454
|
+
/**
|
|
1455
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1456
|
+
* for debugging purposes.
|
|
1457
|
+
*/
|
|
1458
|
+
renderDebugFrame: boolean;
|
|
1459
|
+
components: Components;
|
|
1460
|
+
readonly world: World;
|
|
1461
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1462
|
+
protected autoUpdate: boolean;
|
|
1463
|
+
protected updateInterval: number;
|
|
1464
|
+
protected readonly worker: Worker;
|
|
1465
|
+
protected readonly scene: THREE.Scene;
|
|
1466
|
+
private _width;
|
|
1467
|
+
private _height;
|
|
1468
|
+
private _availableColor;
|
|
1469
|
+
private readonly renderTarget;
|
|
1470
|
+
private readonly bufferSize;
|
|
1471
|
+
private readonly _buffer;
|
|
1472
|
+
protected _isWorkerBusy: boolean;
|
|
1473
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1474
|
+
/** {@link Disposable.dispose} */
|
|
1475
|
+
dispose(): void;
|
|
1476
|
+
/**
|
|
1477
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1478
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1479
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1480
|
+
* not true.
|
|
1481
|
+
*/
|
|
1482
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1483
|
+
protected getAvailableColor(): {
|
|
1484
|
+
r: number;
|
|
1485
|
+
g: number;
|
|
1486
|
+
b: number;
|
|
1487
|
+
code: string;
|
|
1488
|
+
};
|
|
1489
|
+
protected increaseColor(): void;
|
|
1490
|
+
protected decreaseColor(): void;
|
|
1491
|
+
private applySettings;
|
|
1492
|
+
}
|
|
1493
|
+
import * as THREE from "three";
|
|
1494
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1495
|
+
import { Components } from "../../Components";
|
|
1496
|
+
import { Event, World } from "../../Types";
|
|
1512
1497
|
/**
|
|
1513
1498
|
* A renderer to determine a mesh visibility on screen
|
|
1514
1499
|
*/
|
|
@@ -1533,37 +1518,240 @@ export declare class MeshCullerRenderer extends CullerRenderer {
|
|
|
1533
1518
|
private handleWorkerMessage;
|
|
1534
1519
|
private getAvailableMaterial;
|
|
1535
1520
|
}
|
|
1521
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1522
|
+
import * as THREE from "three";
|
|
1523
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1524
|
+
import { Components } from "../../Components";
|
|
1525
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1526
|
+
/**
|
|
1527
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
1528
|
+
*/
|
|
1529
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1530
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1531
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1532
|
+
enabled: boolean;
|
|
1533
|
+
uuid: string;
|
|
1534
|
+
readonly onDisposed: Event<unknown>;
|
|
1535
|
+
private _scene?;
|
|
1536
|
+
private _camera?;
|
|
1537
|
+
private _renderer;
|
|
1538
|
+
get scene(): T;
|
|
1539
|
+
set scene(scene: T);
|
|
1540
|
+
get camera(): U;
|
|
1541
|
+
set camera(camera: U);
|
|
1542
|
+
get renderer(): S | null;
|
|
1543
|
+
set renderer(renderer: S | null);
|
|
1544
|
+
constructor(components: Components);
|
|
1545
|
+
update(delta?: number): void;
|
|
1546
|
+
dispose(disposeResources?: boolean): void;
|
|
1547
|
+
}
|
|
1548
|
+
import * as THREE from "three";
|
|
1549
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1550
|
+
import { Components } from "../../Components";
|
|
1551
|
+
export interface SimpleSceneConfig {
|
|
1552
|
+
directionalLight: {
|
|
1553
|
+
color: THREE.Color;
|
|
1554
|
+
intensity: number;
|
|
1555
|
+
position: THREE.Vector3;
|
|
1556
|
+
};
|
|
1557
|
+
ambientLight: {
|
|
1558
|
+
color: THREE.Color;
|
|
1559
|
+
intensity: number;
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1564
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1565
|
+
* @noInheritDoc
|
|
1566
|
+
*/
|
|
1567
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1568
|
+
/** {@link Configurable.isSetup} */
|
|
1569
|
+
isSetup: boolean;
|
|
1570
|
+
three: THREE.Scene;
|
|
1571
|
+
/** {@link Configurable.onSetup} */
|
|
1572
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1573
|
+
config: Required<SimpleSceneConfig>;
|
|
1574
|
+
constructor(components: Components);
|
|
1575
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1576
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1577
|
+
}
|
|
1578
|
+
import * as THREE from "three";
|
|
1579
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1580
|
+
import { Components } from "../../Components";
|
|
1581
|
+
/**
|
|
1582
|
+
* A basic renderer capable of rendering
|
|
1583
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1584
|
+
*/
|
|
1585
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1586
|
+
/** {@link Component.enabled} */
|
|
1587
|
+
enabled: boolean;
|
|
1588
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1589
|
+
container: HTMLElement | null;
|
|
1590
|
+
three: THREE.WebGLRenderer;
|
|
1591
|
+
protected _canvas: HTMLCanvasElement;
|
|
1592
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1593
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
1594
|
+
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1595
|
+
/** {@link Updateable.update} */
|
|
1596
|
+
update(): void;
|
|
1597
|
+
/** {@link Disposable.dispose} */
|
|
1598
|
+
dispose(): void;
|
|
1599
|
+
/** {@link Resizeable.getSize}. */
|
|
1600
|
+
getSize(): THREE.Vector2;
|
|
1601
|
+
/** {@link Resizeable.resize} */
|
|
1602
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1603
|
+
setupEvents(active: boolean): void;
|
|
1604
|
+
private resizeEvent;
|
|
1605
|
+
private setupRenderer;
|
|
1606
|
+
private onContextLost;
|
|
1607
|
+
private onContextBack;
|
|
1608
|
+
private updateContainer;
|
|
1609
|
+
}
|
|
1610
|
+
import * as THREE from "three";
|
|
1611
|
+
import CameraControls from "camera-controls";
|
|
1612
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1613
|
+
import { Components } from "../../Components";
|
|
1614
|
+
/**
|
|
1615
|
+
* A basic camera that uses
|
|
1616
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1617
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1618
|
+
* what features it offers.
|
|
1619
|
+
*/
|
|
1620
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1621
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1622
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1623
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1624
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1625
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1626
|
+
/** {@link Disposable.onDisposed} */
|
|
1627
|
+
readonly onDisposed: Event<string>;
|
|
1628
|
+
readonly three: THREE.PerspectiveCamera;
|
|
1629
|
+
private _allControls;
|
|
1630
|
+
/**
|
|
1631
|
+
* The object that controls the camera. An instance of
|
|
1632
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1633
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1634
|
+
* object to move, rotate, look at objects, etc.
|
|
1635
|
+
*/
|
|
1636
|
+
get controls(): CameraControls;
|
|
1637
|
+
/** {@link Component.enabled} */
|
|
1638
|
+
get enabled(): boolean;
|
|
1639
|
+
/** {@link Component.enabled} */
|
|
1640
|
+
set enabled(enabled: boolean);
|
|
1641
|
+
constructor(components: Components);
|
|
1642
|
+
/** {@link Disposable.dispose} */
|
|
1643
|
+
dispose(): void;
|
|
1644
|
+
/** {@link Updateable.update} */
|
|
1645
|
+
update(_delta: number): void;
|
|
1646
|
+
/**
|
|
1647
|
+
* Updates the aspect of the camera to match the size of the
|
|
1648
|
+
* {@link Components.renderer}.
|
|
1649
|
+
*/
|
|
1650
|
+
updateAspect: () => void;
|
|
1651
|
+
private setupCamera;
|
|
1652
|
+
private newCameraControls;
|
|
1653
|
+
private setupEvents;
|
|
1654
|
+
private static getSubsetOfThree;
|
|
1655
|
+
}
|
|
1656
|
+
/// <reference types="node" />
|
|
1657
|
+
import * as THREE from "three";
|
|
1658
|
+
import { Hideable, Event, World } from "../../Types";
|
|
1659
|
+
import { Components } from "../../Components";
|
|
1660
|
+
export interface GridConfig {
|
|
1661
|
+
color: THREE.Color;
|
|
1662
|
+
size1: number;
|
|
1663
|
+
size2: number;
|
|
1664
|
+
distance: number;
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* An infinite grid. Created by
|
|
1668
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1669
|
+
* and translated to typescript by
|
|
1670
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1671
|
+
*/
|
|
1672
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1673
|
+
/** {@link Disposable.onDisposed} */
|
|
1674
|
+
readonly onDisposed: Event<unknown>;
|
|
1675
|
+
world: World;
|
|
1676
|
+
components: Components;
|
|
1677
|
+
/** {@link Hideable.visible} */
|
|
1678
|
+
get visible(): boolean;
|
|
1679
|
+
/** {@link Hideable.visible} */
|
|
1680
|
+
set visible(visible: boolean);
|
|
1681
|
+
/** The material of the grid. */
|
|
1682
|
+
get material(): THREE.ShaderMaterial;
|
|
1683
|
+
/**
|
|
1684
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1685
|
+
* perspective cameras and false for orthographic cameras.
|
|
1686
|
+
*/
|
|
1687
|
+
get fade(): boolean;
|
|
1688
|
+
/**
|
|
1689
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1690
|
+
* perspective cameras and false for orthographic cameras.
|
|
1691
|
+
*/
|
|
1692
|
+
set fade(active: boolean);
|
|
1693
|
+
private readonly _grid;
|
|
1694
|
+
private _fade;
|
|
1695
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
1696
|
+
[Symbol.dispose](): void;
|
|
1697
|
+
/** {@link Component.get} */
|
|
1698
|
+
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1699
|
+
/** {@link Disposable.dispose} */
|
|
1700
|
+
dispose(): void;
|
|
1701
|
+
private setupEvents;
|
|
1702
|
+
private updateZoom;
|
|
1703
|
+
}
|
|
1536
1704
|
import { NavigationMode } from "./types";
|
|
1537
1705
|
/**
|
|
1538
|
-
* A {@link NavigationMode} that allows
|
|
1539
|
-
*
|
|
1706
|
+
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1707
|
+
* like in many 3D and CAD softwares.
|
|
1540
1708
|
*/
|
|
1541
|
-
export declare class
|
|
1709
|
+
export declare class OrbitMode implements NavigationMode {
|
|
1710
|
+
camera: any;
|
|
1711
|
+
/** {@link NavigationMode.enabled} */
|
|
1712
|
+
enabled: boolean;
|
|
1713
|
+
/** {@link NavigationMode.id} */
|
|
1714
|
+
readonly id = "Orbit";
|
|
1715
|
+
constructor(camera: any);
|
|
1716
|
+
/** {@link NavigationMode.set} */
|
|
1717
|
+
set(active: boolean): void;
|
|
1718
|
+
private activateOrbitControls;
|
|
1719
|
+
}
|
|
1720
|
+
import { NavigationMode } from "./types";
|
|
1721
|
+
/**
|
|
1722
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1723
|
+
* like many BIM tools.
|
|
1724
|
+
*/
|
|
1725
|
+
export declare class PlanMode implements NavigationMode {
|
|
1542
1726
|
private camera;
|
|
1543
1727
|
/** {@link NavigationMode.enabled} */
|
|
1544
1728
|
enabled: boolean;
|
|
1545
1729
|
/** {@link NavigationMode.id} */
|
|
1546
|
-
readonly id = "
|
|
1730
|
+
readonly id = "Plan";
|
|
1731
|
+
private mouseAction1?;
|
|
1732
|
+
private mouseAction2?;
|
|
1733
|
+
private mouseInitialized;
|
|
1734
|
+
private readonly defaultAzimuthSpeed;
|
|
1735
|
+
private readonly defaultPolarSpeed;
|
|
1547
1736
|
constructor(camera: any);
|
|
1548
1737
|
/** {@link NavigationMode.set} */
|
|
1549
1738
|
set(active: boolean): void;
|
|
1550
|
-
private setupFirstPersonCamera;
|
|
1551
1739
|
}
|
|
1552
1740
|
import { NavigationMode } from "./types";
|
|
1553
1741
|
/**
|
|
1554
|
-
* A {@link NavigationMode} that allows
|
|
1555
|
-
*
|
|
1742
|
+
* A {@link NavigationMode} that allows first person navigation,
|
|
1743
|
+
* simulating FPS video games.
|
|
1556
1744
|
*/
|
|
1557
|
-
export declare class
|
|
1558
|
-
camera
|
|
1745
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1746
|
+
private camera;
|
|
1559
1747
|
/** {@link NavigationMode.enabled} */
|
|
1560
1748
|
enabled: boolean;
|
|
1561
1749
|
/** {@link NavigationMode.id} */
|
|
1562
|
-
readonly id = "
|
|
1750
|
+
readonly id = "FirstPerson";
|
|
1563
1751
|
constructor(camera: any);
|
|
1564
1752
|
/** {@link NavigationMode.set} */
|
|
1565
1753
|
set(active: boolean): void;
|
|
1566
|
-
private
|
|
1754
|
+
private setupFirstPersonCamera;
|
|
1567
1755
|
}
|
|
1568
1756
|
import * as THREE from "three";
|
|
1569
1757
|
import { CameraProjection } from "./types";
|
|
@@ -1602,36 +1790,6 @@ export declare class ProjectionManager {
|
|
|
1602
1790
|
private getDistance;
|
|
1603
1791
|
private setPerspectiveCamera;
|
|
1604
1792
|
}
|
|
1605
|
-
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1606
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1607
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1608
|
-
minGeometrySize: number;
|
|
1609
|
-
minAssetsSize: number;
|
|
1610
|
-
}
|
|
1611
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1612
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1613
|
-
propertiesSize: number;
|
|
1614
|
-
}
|
|
1615
|
-
import { NavigationMode } from "./types";
|
|
1616
|
-
/**
|
|
1617
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1618
|
-
* like many BIM tools.
|
|
1619
|
-
*/
|
|
1620
|
-
export declare class PlanMode implements NavigationMode {
|
|
1621
|
-
private camera;
|
|
1622
|
-
/** {@link NavigationMode.enabled} */
|
|
1623
|
-
enabled: boolean;
|
|
1624
|
-
/** {@link NavigationMode.id} */
|
|
1625
|
-
readonly id = "Plan";
|
|
1626
|
-
private mouseAction1?;
|
|
1627
|
-
private mouseAction2?;
|
|
1628
|
-
private mouseInitialized;
|
|
1629
|
-
private readonly defaultAzimuthSpeed;
|
|
1630
|
-
private readonly defaultPolarSpeed;
|
|
1631
|
-
constructor(camera: any);
|
|
1632
|
-
/** {@link NavigationMode.set} */
|
|
1633
|
-
set(active: boolean): void;
|
|
1634
|
-
}
|
|
1635
1793
|
/**
|
|
1636
1794
|
* The projection system of the camera.
|
|
1637
1795
|
*/
|
|
@@ -1660,104 +1818,6 @@ export interface NavigationMode {
|
|
|
1660
1818
|
enabled: boolean;
|
|
1661
1819
|
}
|
|
1662
1820
|
import * as WEBIFC from "web-ifc";
|
|
1663
|
-
import { Component, Disposable, Event } from "../../../core";
|
|
1664
|
-
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1665
|
-
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1666
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1667
|
-
onPropertiesStreamed: Event<{
|
|
1668
|
-
type: number;
|
|
1669
|
-
data: {
|
|
1670
|
-
[id: number]: any;
|
|
1671
|
-
};
|
|
1672
|
-
}>;
|
|
1673
|
-
onProgress: Event<number>;
|
|
1674
|
-
onIndicesStreamed: Event<number[][]>;
|
|
1675
|
-
/** {@link Disposable.onDisposed} */
|
|
1676
|
-
readonly onDisposed: Event<string>;
|
|
1677
|
-
enabled: boolean;
|
|
1678
|
-
settings: PropertiesStreamingSettings;
|
|
1679
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1680
|
-
dispose(): Promise<void>;
|
|
1681
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1682
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1683
|
-
private readIfcFile;
|
|
1684
|
-
private streamIfcFile;
|
|
1685
|
-
private streamAllProperties;
|
|
1686
|
-
private getIndices;
|
|
1687
|
-
private cleanUp;
|
|
1688
|
-
}
|
|
1689
|
-
import * as WEBIFC from "web-ifc";
|
|
1690
|
-
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1691
|
-
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1692
|
-
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1693
|
-
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1694
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1695
|
-
onGeometryStreamed: Event<{
|
|
1696
|
-
buffer: Uint8Array;
|
|
1697
|
-
data: StreamedGeometries;
|
|
1698
|
-
}>;
|
|
1699
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1700
|
-
onProgress: Event<number>;
|
|
1701
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
1702
|
-
/** {@link Disposable.onDisposed} */
|
|
1703
|
-
readonly onDisposed: Event<unknown>;
|
|
1704
|
-
settings: IfcStreamingSettings;
|
|
1705
|
-
enabled: boolean;
|
|
1706
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1707
|
-
private _spatialTree;
|
|
1708
|
-
private _metaData;
|
|
1709
|
-
private _visitedGeometries;
|
|
1710
|
-
private _streamSerializer;
|
|
1711
|
-
private _geometries;
|
|
1712
|
-
private _geometryCount;
|
|
1713
|
-
private _civil;
|
|
1714
|
-
private _groupSerializer;
|
|
1715
|
-
private _assets;
|
|
1716
|
-
private _meshesWithHoles;
|
|
1717
|
-
constructor(components: Components);
|
|
1718
|
-
dispose(): void;
|
|
1719
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1720
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1721
|
-
private readIfcFile;
|
|
1722
|
-
private streamIfcFile;
|
|
1723
|
-
private streamAllGeometries;
|
|
1724
|
-
private cleanUp;
|
|
1725
|
-
private getMesh;
|
|
1726
|
-
private getGeometry;
|
|
1727
|
-
private streamAssets;
|
|
1728
|
-
private streamGeometries;
|
|
1729
|
-
}
|
|
1730
|
-
export interface StreamedGeometries {
|
|
1731
|
-
[id: number]: {
|
|
1732
|
-
boundingBox: Float32Array;
|
|
1733
|
-
hasHoles: boolean;
|
|
1734
|
-
geometryFile?: string;
|
|
1735
|
-
};
|
|
1736
|
-
}
|
|
1737
|
-
export interface StreamedAsset {
|
|
1738
|
-
id: number;
|
|
1739
|
-
geometries: {
|
|
1740
|
-
geometryID: number;
|
|
1741
|
-
transformation: number[];
|
|
1742
|
-
color: number[];
|
|
1743
|
-
}[];
|
|
1744
|
-
}
|
|
1745
|
-
import * as THREE from "three";
|
|
1746
|
-
import * as WEBIFC from "web-ifc";
|
|
1747
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1748
|
-
export declare class CivilReader {
|
|
1749
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1750
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1751
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1752
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1753
|
-
} | undefined;
|
|
1754
|
-
get(civilItems: any): {
|
|
1755
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1756
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1757
|
-
} | undefined;
|
|
1758
|
-
private getCurves;
|
|
1759
|
-
}
|
|
1760
|
-
import * as WEBIFC from "web-ifc";
|
|
1761
1821
|
/** Configuration of the IFC-fragment conversion. */
|
|
1762
1822
|
export declare class IfcFragmentSettings {
|
|
1763
1823
|
/** Whether to extract the IFC properties into a JSON. */
|
|
@@ -1788,6 +1848,21 @@ import * as WEBIFC from "web-ifc";
|
|
|
1788
1848
|
export declare class IfcMetadataReader {
|
|
1789
1849
|
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1790
1850
|
}
|
|
1851
|
+
import * as THREE from "three";
|
|
1852
|
+
import * as WEBIFC from "web-ifc";
|
|
1853
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1854
|
+
export declare class CivilReader {
|
|
1855
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1856
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1857
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1858
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1859
|
+
} | undefined;
|
|
1860
|
+
get(civilItems: any): {
|
|
1861
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1862
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1863
|
+
} | undefined;
|
|
1864
|
+
private getCurves;
|
|
1865
|
+
}
|
|
1791
1866
|
import * as WEBIFC from "web-ifc";
|
|
1792
1867
|
import * as THREE from "three";
|
|
1793
1868
|
export declare class Units {
|